ChangeLog-2017-03-23 [plain text]
2017-03-23 Andreas Kling <akling@apple.com>
Let the UI process do memory kills and replace crashes with diagnostic logging.
<https://webkit.org/b/170016>
<rdar://problem/31091292>
Reviewed by Chris Dumez.
Remove the memory kill code from WebCore that just crashes in favor of controlled
teardown from UI process side in WebKit2.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::simulatedProcessCrashKey):
(WebCore::DiagnosticLoggingKeys::exceededActiveMemoryLimitKey):
(WebCore::DiagnosticLoggingKeys::exceededInactiveMemoryLimitKey):
(WebCore::DiagnosticLoggingKeys::exceededBackgroundCPULimitKey):
* page/DiagnosticLoggingKeys.h:
* page/MemoryRelease.cpp:
(WebCore::didExceedMemoryLimitAndFailedToRecover): Deleted.
* page/MemoryRelease.h:
2017-03-23 Youenn Fablet <youenn@apple.com>
Clean RTCPeerConnection.idl after bug 169978
https://bugs.webkit.org/show_bug.cgi?id=169989
Reviewed by Eric Carlson.
No change of behavior.
Moving addTransceiver to overloaded method to union type to match spec.
Refactoring RTCRtpSender to take a String&&.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver):
(WebCore::RTCPeerConnection::completeAddTransceiver):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl: Cosmetic changes except for addTransceiver.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
* Modules/mediastream/RTCRtpSender.h:
2017-03-23 Youenn Fablet <youenn@apple.com>
Add logging in case libwebrtc.dylib cannot be opened
https://bugs.webkit.org/show_bug.cgi?id=170017
Reviewed by Geoffrey Garen.
No change of behavior.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):
2017-03-23 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a speculative build fix
<rdar://problem/31225378>
* crypto/CommonCryptoUtilities.h:
2017-03-23 Brady Eidson <beidson@apple.com>
WebSQL databases should not openable in private browsing.
<rdar://problem/30383335> and https://bugs.webkit.org/show_bug.cgi?id=170013
Reviewed by Alex Christensen.
Test: storage/websql/private-browsing-open-disabled.html
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabaseBackend):
(WebCore::DatabaseManager::tryToOpenDatabaseBackend): Throw an exception if in private browsing.
* Modules/webdatabase/DatabaseManager.h:
2017-03-22 Dean Jackson <dino@apple.com>
NeverDestroyed<MediaQueryEvaluator> must explicitly construct with a String
https://bugs.webkit.org/show_bug.cgi?id=169987
<rdar://problem/31211087>
Reviewed by Alex Christensen.
CSSDefaultStyleSheets creates a static MediaQueryEvaluator, but thanks
to the template magic of NeverDestroyed, it was converting the char*
argument into a bool, and calling the wrong constructor.
Unfortunately this is difficult to test because it only affects
the default UA style sheets, and they currently don't have
and @media rules (which would always evaluate to true given
the bug). I don't want to put in a useless rule just to check
if the bug is fixed. When one is added for bug 168447, this change
will be exercised.
* css/CSSDefaultStyleSheets.cpp: Explicitly construct with a String
rather than a char*.
(WebCore::screenEval):
(WebCore::printEval):
2017-03-23 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Make mock video source work on iOS
https://bugs.webkit.org/show_bug.cgi?id=169923
Reviewed by Youenn Fablet.
Generate IOSurface-backed CVPixelBuffers. Allocate them from a
CVPixelBufferPool for efficiency.
No new tests, no functional change.
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage):
(WebCore::MockRealtimeVideoSourceMac::applySize):
* platform/mock/MockRealtimeVideoSource.h:
2017-03-22 Andreas Kling <akling@apple.com>
Let MemoryPressureHandler track whether the process is active or inactive.
<https://webkit.org/b/169990>
Reviewed by Antti Koivisto.
Have PerformanceMonitor inform MemoryPressureHandler about relevant
changes to the page activity states.
Also change the "1 hour after last page load" policy to "1 hour after
last being visible in an active window."
* page/MainFrame.cpp:
(WebCore::MainFrame::didCompleteLoad):
* page/MainFrame.h:
* page/MemoryRelease.cpp:
(WebCore::processIsEligibleForMemoryKill): Deleted.
* page/MemoryRelease.h:
* page/Page.h:
(WebCore::Page::performanceMonitor):
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::PerformanceMonitor):
(WebCore::PerformanceMonitor::activityStateChanged):
(WebCore::PerformanceMonitor::processMayBecomeInactiveTimerFired):
(WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure):
* page/PerformanceMonitor.h:
2017-03-22 Youenn Fablet <youenn@apple.com>
Support RTCPeerConnectionState
https://bugs.webkit.org/show_bug.cgi?id=169978
Reviewed by Jon Lee.
Test: webrtc/connection-state.html
Implementing https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum.
Its state and event is based on changes made to ice gathering state and ice connection state.
* CMakeLists.txt: Adding RTCPeerConnectionState idl.
* DerivedSources.make: Ditto.
* Modules/mediastream/RTCPeerConnection.cpp: Splitting close in doClose/doStop so that we can send closed event
in case close is called, but not if stopped.
(WebCore::RTCPeerConnection::doClose):
(WebCore::RTCPeerConnection::close):
(WebCore::RTCPeerConnection::stop):
(WebCore::RTCPeerConnection::doStop):
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::updateConnectionState):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl: Fixing IDL and minor cosmetic changes
* Modules/mediastream/RTCPeerConnection.js:
(setLocalDescription): Cosmetic change.
(setRemoteDescription):
* Modules/mediastream/RTCPeerConnectionState.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnIceGatheringChange): Adding 'gathering' state
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* platform/mediastream/RTCPeerConnectionState.h: Added.
2017-03-22 Jiewen Tan <jiewen_tan@apple.com>
ASSERT_WITH_SECURITY_IMPLICATION hit when removing an <input type="range"> while dragging on iOS
https://bugs.webkit.org/show_bug.cgi?id=165535
<rdar://problem/29559749>
Reviewed by Ryosuke Niwa.
Utimately we should prevent SliderThumbElement::unregisterForTouchEvents() being called while
updating render tree. A quick fix for this is to move dispatchFormControlChangeEvent for input
from stopDragging up to the callers which really needs to dispatch this event, i.e., finishing
dragging the slider. It is clear that not every caller of stopDragging wants to
dispatchFormControlChangeEvent.
Test: fast/forms/range/range-remove-on-drag.html
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::stopDragging):
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::handleTouchEndAndCancel):
2017-03-22 Antti Koivisto <antti@apple.com>
Dynamically applied :empty pseudo class with display:none does not get unapplied
https://bugs.webkit.org/show_bug.cgi?id=169907
Reviewed by Ryosuke Niwa.
We improperly reset the styleAffectedByEmpty bit when removing the renderer when :empty starts
applying. We then fail to invalidate the style when the element becomes non-empty again.
Fix by resetting the style relation bits only when computing the style.
Test: fast/css/empty-display-none-invalidation.html
* dom/Element.cpp:
(WebCore::Element::resetStyleRelations):
Expose this separately.
(WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
Don't reset style relation bits when removing renderers.
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::ElementRareData::resetComputedStyle):
(WebCore::ElementRareData::resetStyleRelations):
Reset all these bits in one function.
(WebCore::ElementRareData::resetDynamicRestyleObservations): Deleted.
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveComposedTree):
Call the explicit style relation reset function when recomputing style.
2017-03-22 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Honor GTK+ font settings
https://bugs.webkit.org/show_bug.cgi?id=82889
Reviewed by Carlos Garcia Campos.
After much discussion with Behdad and Martin (who is still not completely convinced I think
:) I want to merge cairo font options into the Fontconfig pattern used for rendering using
cairo_ft_font_options_substitute(). This is how the API was designed to be used anyway.
Fontconfig will still have final say over whether to actually respect the desktop settings
or not, so it can still choose to ignore the desktop's settings, but I don't think it makes
sense to have desktop-wide font settings and not tell Fontconfig about them, especially when
the whole point of WebKitGTK+ is desktop integration. This should also reduce complaints
that we're not following desktop settings and that we're drawing fonts differently than
Firefox.
* PlatformGTK.cmake:
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::getDefaultCairoFontOptions):
* platform/graphics/cairo/CairoUtilities.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::createFontConfigPatternForCharacters):
(WebCore::strongAliasesForFamily):
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::getDefaultFontconfigOptions):
(WebCore::getDefaultCairoFontOptions): Deleted.
* platform/graphics/gtk/GdkCairoUtilities.cpp:
(getDefaultCairoFontOptions):
2017-03-22 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls size lags behind media size
https://bugs.webkit.org/show_bug.cgi?id=169962
<rdar://problem/30340293>
Reviewed by Dean Jackson.
We used to dispatch the "resize" event to the shadow root on a timer and commit changes to the DOM
when handling it inside of a requestAnimationFrame() callback. We now dispatch the "resize" event
as a post-layout task and commit to the DOM right away which ensures immediate size changes of the
controls.
* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
Making some layout() safer by returning early in case they're called during the object construction
phase, due to the LayoutNode "width" setter now calling that method.
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get width):
(MediaControls.prototype.set width):
Calling layout() in the "width" setter to ensure that the inline controls layout is invalidated as
soon as the controls width changes instead of waiting on the next rAF to update the layout.
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.flushScheduledLayoutCallbacks):
Add a new method to immediately call queued layouts.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.handleEvent):
Flush all queued layouts when handling a "resize" event.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::layoutSizeChanged):
Queue the "resize" event as a post-layout task.
(WebCore::HTMLMediaElement::contextDestroyed):
* html/HTMLMediaElement.h:
Remove the queue we no longer use.
2017-03-22 Andy Estes <aestes@apple.com>
Try to fix the Mac CMake build after r214266.
* PlatformMac.cmake:
2017-03-22 Chris Dumez <cdumez@apple.com>
WebKit should disallow beforeunload alerts from web pages users have never interacted with
https://bugs.webkit.org/show_bug.cgi?id=169936
<rdar://problem/23798897>
Reviewed by Brent Fulgham.
WebKit should disallow beforeunload alerts from web pages users have never interacted with.
This reduces the risk of annoyance to the user and is allowed by the specification:
- https://html.spec.whatwg.org/multipage/browsers.html#prompt-to-unload-a-document (Step 8):
which says:
"""
The user agent is encouraged to avoid asking the user for confirmation if it judges that doing
so would be annoying, deceptive, or pointless. A simple heuristic might be that if the user
has not interacted with the document, the user agent would not ask for confirmation before
unloading it.
"""
Firefox already implements this, Chrome does not.
Tests: fast/events/beforeunload-alert-no-user-interaction.html
fast/events/beforeunload-alert-user-interaction.html
fast/events/beforeunload-alert-user-interaction2.html
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2017-03-22 Brent Fulgham <bfulgham@apple.com>
ASan violation in IconLoader::stopLoading
https://bugs.webkit.org/show_bug.cgi?id=169960
<rdar://problem/30577691>
Reviewed by David Kilzer.
DocumentLoader::finishLoadingIcon handles the life cycle of the IconLoader. Once this method is called,
we should return immediately rather than attempt to make further modifications to the IconLoader.
No new tests due to lack of test features (see https://bugs.webkit.org/show_bug.cgi?id=164895). Easily
tested in MiniBrowser under ASan visiting websites with icons.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished):
2017-03-22 Nan Wang <n_wang@apple.com>
AX: WebKit is returning the wrong rangeForLine
https://bugs.webkit.org/show_bug.cgi?id=169940
Reviewed by Chris Fleizach.
The AXRangeForLine is being calculated using VisiblePostition, so
when we try to use the index we should validate it using VisiblePosition.
Changes are covered in the modified test.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::characterOffsetForIndex):
2017-03-22 John Wilander <wilander@apple.com>
Resource Load Statistics: Fix partitioning bug for client-side cookie access
https://bugs.webkit.org/show_bug.cgi?id=169906
<rdar://problem/31164456>
Reviewed by Alex Christensen.
The existing test case was expanded to cover this change.
* platform/network/NetworkStorageSession.h:
Moved the two cookieStoragePartition() functions into the class.
Also declared them const.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition):
Now checks whether it should partition or not.
(WebCore::getPartitioningDomain):
Inline convenience function.
(WebCore::NetworkStorageSession::shouldPartitionCookies):
Renamed since it now receives a top privately controlled domain
instead of a host.
(WebCore::cookieStoragePartition): Deleted.
This moved into NetworkStorageSession.
(WebCore::hostIsInDomain): Deleted.
No longer needed since we generate the top privately controlled
domain for both the resource and the partition.
(WebCore::NetworkStorageSession::shouldPartitionCookiesForHost): Deleted.
Renamed WebCore::NetworkStorageSession::shouldPartitionCookies().
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesInPartitionForURL):
Now calls WebCore::NetworkStorageSession::cookieStoragePartition().
(WebCore::setCookiesFromDOM):
Now calls WebCore::NetworkStorageSession::cookieStoragePartition().
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
Now calls WebCore::NetworkStorageSession::cookieStoragePartition().
2017-03-22 Jer Noble <jer.noble@apple.com>
Media files served without an extension will not load in <video> tag.
https://bugs.webkit.org/show_bug.cgi?id=169895
Reviewed by Eric Carlson.
Test: http/tests/media/video-served-as-text-with-type.html
Media files served without an extension will commonly have no MIME type (or incorrect MIME type) information
delivered in the HTTP header. In situations like these, if media referenced by a <source> tag with a type=
attribute containing MIME type (and optionally, codec) information, that type should be used preferentially.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::contentMIMEType):
(WebCore::MediaPlayer::contentTypeCodecs):
(WebCore::MediaPlayer::contentMIMETypeWasInferredFromExtension):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2017-03-22 Andy Estes <aestes@apple.com>
[QuickLook] Move QuickLook.{h,mm} to platform/ios/
https://bugs.webkit.org/show_bug.cgi?id=169963
Reviewed by Andreas Kling.
* WebCore.xcodeproj/project.pbxproj:
* platform/ios/QuickLook.h: Renamed from Source/WebCore/loader/ios/QuickLook.h.
* platform/ios/QuickLook.mm: Renamed from Source/WebCore/loader/ios/QuickLook.mm.
2017-03-22 Andy Estes <aestes@apple.com>
[QuickLook] Rename QuickLookHandle to PreviewLoader
https://bugs.webkit.org/show_bug.cgi?id=169961
Reviewed by Andreas Kling.
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::isQuickLookResource):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didReceiveData):
(WebCore::SubresourceLoader::didReceiveBuffer):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::shouldCreateQuickLookHandleForResponse): Deleted.
* loader/SubresourceLoader.h:
* loader/ios/PreviewLoader.h: Copied from Source/WebCore/loader/ios/QuickLook.h.
* loader/ios/PreviewLoader.mm: Added.
(testingClient):
(emptyClient):
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
(-[WebPreviewLoader appendDataArray:]):
(-[WebPreviewLoader finishedAppending]):
(-[WebPreviewLoader failed]):
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
(-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
(-[WebPreviewLoader connectionDidFinishLoading:]):
(isQuickLookPasswordError):
(-[WebPreviewLoader connection:didFailWithError:]):
(WebCore::PreviewLoader::PreviewLoader):
(WebCore::PreviewLoader::~PreviewLoader):
(WebCore::PreviewLoader::shouldCreateForMIMEType):
(WebCore::PreviewLoader::create):
(WebCore::PreviewLoader::didReceiveData):
(WebCore::PreviewLoader::didReceiveBuffer):
(WebCore::PreviewLoader::didFinishLoading):
(WebCore::PreviewLoader::didFail):
(WebCore::PreviewLoader::setClientForTesting):
* loader/ios/QuickLook.h:
(): Deleted.
* loader/ios/QuickLook.mm:
(WebCore::QLPreviewGetSupportedMIMETypesSet):
(WebCore::removeQLPreviewConverterForURL):
(WebCore::registerQLPreviewConverterIfNeeded):
(WebCore::QLPreviewProtocol):
(WebCore::isQuickLookPreviewURL):
(qlPreviewConverterDictionaryMutex): Deleted.
(QLPreviewConverterDictionary): Deleted.
(QLContentDictionary): Deleted.
(addQLPreviewConverterWithFileForURL): Deleted.
(createQLPreviewProtocol): Deleted.
(testingClient): Deleted.
(emptyClient): Deleted.
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:quickLookHandle:]): Deleted.
(-[WebPreviewLoader appendDataArray:]): Deleted.
(-[WebPreviewLoader finishedAppending]): Deleted.
(-[WebPreviewLoader failed]): Deleted.
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): Deleted.
(-[WebPreviewLoader connection:didReceiveData:lengthReceived:]): Deleted.
(-[WebPreviewLoader connectionDidFinishLoading:]): Deleted.
(isQuickLookPasswordError): Deleted.
(-[WebPreviewLoader connection:didFailWithError:]): Deleted.
(WebCore::QuickLookHandle::QuickLookHandle): Deleted.
(WebCore::QuickLookHandle::~QuickLookHandle): Deleted.
(WebCore::QuickLookHandle::shouldCreateForMIMEType): Deleted.
(WebCore::QuickLookHandle::create): Deleted.
(WebCore::QuickLookHandle::didReceiveData): Deleted.
(WebCore::QuickLookHandle::didReceiveBuffer): Deleted.
(WebCore::QuickLookHandle::didFinishLoading): Deleted.
(WebCore::QuickLookHandle::didFail): Deleted.
(WebCore::QuickLookHandle::setClientForTesting): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ios/PreviewLoaderClient.h: Renamed from Source/WebCore/platform/network/ios/QuickLookHandleClient.h.
(WebCore::PreviewLoaderClient::~PreviewLoaderClient):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setQuickLookPassword):
* testing/MockPreviewLoaderClient.cpp: Renamed from Source/WebCore/testing/MockQuickLookHandleClient.cpp.
(WebCore::MockPreviewLoaderClient::singleton):
(WebCore::MockPreviewLoaderClient::didRequestPassword):
* testing/MockPreviewLoaderClient.h: Renamed from Source/WebCore/testing/MockQuickLookHandleClient.h.
2017-03-22 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableStreamBYOBRequest respond() (readable stream state)
https://bugs.webkit.org/show_bug.cgi?id=169759
Reviewed by Youenn Fablet.
Implemented readable state part of respond() function. Parts of code cannot
currently be reached as they require ReadableStreamBYOBReader to be implemented.
Added new tests and updated expectations.
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerEnqueue): Name shortened.
(readableByteStreamControllerRespondInternal): Updated with readable state case.
(cloneArrayBuffer): Added.
(readableByteStreamControllerRespondInReadableState): Added.
(readableByteStreamControllerRespondInClosedState): Updated.
(readableByteStreamControllerProcessPullDescriptors): Added.
(readableByteStreamControllerFillDescriptorFromQueue): Added.
(readableByteStreamControllerShiftPendingDescriptor): Name shortened.
(readableByteStreamControllerCommitDescriptor): Name shortened.
(readableByteStreamControllerConvertDescriptor): Name shortened.
2017-03-22 Youenn Fablet <youenn@apple.com>
RTCPeerConnection is crashing if no backend is created
https://bugs.webkit.org/show_bug.cgi?id=169938
Reviewed by Geoffrey Garen.
RTCPeerConnection should not be visible if it is not able to create a backend.
In case when this happens anyway, it should be able to be stopped and destroyed without crashing.
To do so, we need to set its state to closed.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
(WebCore::RTCPeerConnection::close): Cosmetic change, just in case stop becomes reentrant at some point.
2017-03-22 Antoine Quint <graouts@webkit.org>
[Modern Media Controls] Rendering glitches for fullscreen controls while dragging
https://bugs.webkit.org/show_bug.cgi?id=169949
<rdar://problem/30687803>
Reviewed by Eric Carlson.
Clipping the controls bar has some unwelcome side effects and isn't necessary, so
we simply remove it. An existing test was amended to check that there is no clipping
applied to the controls bar.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen > .controls-bar):
2017-03-22 John Wilander <wilander@apple.com>
Add back the null check in TextureCacheCV::textureFromImage()
https://bugs.webkit.org/show_bug.cgi?id=169931
<rdar://problem/27139820>
Reviewed by Alex Christensen.
No new tests. Just adding back a check that was previously there.
* platform/graphics/cv/TextureCacheCV.mm:
(WebCore::TextureCacheCV::textureFromImage):
2017-03-21 Antti Koivisto <antti@apple.com>
Use AtomicString in RuleSet and RuleFeature
https://bugs.webkit.org/show_bug.cgi?id=119310
<rdar://problem/28214658>
Reviewed by Andreas Kling.
..instead of the plain AtomicStringImpl*. This introduces some ref churn but not too much.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::ancestorClassRules):
(WebCore::DocumentRuleSets::ancestorAttributeRulesForHTML):
* css/DocumentRuleSets.h:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
(WebCore::makeAttributeSelectorKey):
(WebCore::RuleFeatureSet::collectFeatures):
* css/RuleFeature.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::addToRuleSet):
(WebCore::rulesCountForName):
(WebCore::RuleSet::addRule):
* css/RuleSet.h:
(WebCore::RuleSet::idRules):
(WebCore::RuleSet::classRules):
(WebCore::RuleSet::shadowPseudoElementRules):
(WebCore::RuleSet::tagRules):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasSelectorForAttribute):
(WebCore::StyleResolver::hasSelectorForClass):
(WebCore::StyleResolver::hasSelectorForId):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
(WebCore::Style::SharingResolver::classNamesAffectedByRules):
2017-03-22 Youenn Fablet <youenn@apple.com>
Safari sends empty "Access-Control-Request-Headers" in preflight request
https://bugs.webkit.org/show_bug.cgi?id=169851
Reviewed by Chris Dumez.
Covered by updated test.
* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest): Not adding "Access-Control-Request-Headers" to
request header if value is empty.
2017-03-22 Youenn Fablet <youenn@apple.com>
XMLHttpRequest: getAllResponseHeaders() should lowercase header names before sorting
https://bugs.webkit.org/show_bug.cgi?id=169286
Reviewed by Chris Dumez.
Covered by rebased tests.
https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method now mandates to lowercase the header names and
sort them before appending them. This ensures that differences in the way headers are processed by browsers are
not visible to web pages. This also moves towards lowercased/case-insensitive header processing which should be
the norm.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::getAllResponseHeaders): Lower-casing, then sorting, then serializing headers.
* xml/XMLHttpRequest.h: Storing getAllResponseHeaders result if case needed again.
2017-03-22 Chris Dumez <cdumez@apple.com>
Implement the "noopener" feature for window.open()
https://bugs.webkit.org/show_bug.cgi?id=163960
<rdar://problem/28941679>
Reviewed by Sam Weinig.
Implement the "noopener" feature for window.open(). If 'noopener' is passed to window.open()
then the new Window's opener property will be null.
Tests: imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html
imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html
imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html
imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html
imported/w3c/web-platform-tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/WindowFeatures.cpp:
(WebCore::parseWindowFeatures):
(WebCore::setWindowFeature):
* page/WindowFeatures.h:
2017-03-21 Sergio Villar Senin <svillar@igalia.com>
[Soup] "Only from websites I visit" cookie policy is broken
https://bugs.webkit.org/show_bug.cgi?id=168912
Reviewed by Carlos Garcia Campos.
Do not reset the first party for cookies on redirects. That's properly done for the main
resource in DocumentLoader::willSendRequest and, in the case of subresources, is absolutely
wrong (which is what we were doing since r143931).
The most notable effect was that subresources loaded via redirects were effectively
bypassing the "no third party" policy for cookies.
Test: http/tests/security/cookies/third-party-cookie-blocking-redirect.html
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::doRedirect):
2017-03-22 Carlos Garcia Campos <cgarcia@igalia.com>
Make it possible to use WEB_UI_STRING macros to mark translatable strings in glib based ports
https://bugs.webkit.org/show_bug.cgi?id=169672
Reviewed by Michael Catanzaro.
WEB_UI_STRING macros are currently used by Cocoa based ports and Windows port. For other ports it simply returns
the given string, but it's not translated. In the GTK+ port we have all translatable strings from
LocalizedStrings.cpp copied in LocalizedStringsGtk.cpp to use the glib macros to mark them as translatable. In
most of the cases the strings are exactly in the same, in some others (the context menu ones) the string only
differs in the mnemonics used by GTK, and only in a few cases the strings are different. We could remove most of
that duplication if strings used by WEB_UI_STRING were marked as translatable in glib based ports too.
This patch makes that possible with the following changes:
- Add WEB_UI_STRING_WITH_MNEMONIC() to handle the cases where the strings only differ in the mnemonics. It
receives the string with mnemonics that is ignored in all ports except GTK+.
- All platform specific strings have been moved to the platform files, to ensure scanners don't include
strings from other ports.
- For the same reason a new macro WEB_UI_CFSTRING has been also added, just to make sure that CF strings are
only used by CF based ports. The implementation is the same as WEB_UI_STRING, it only changes the name to
not confuse the scanners.
- And again for the same reason, for non-CF and non-Glib cases WEB_UI_STRING is not used, since in those cases
strings are not really translated and String::fromUTF8() is actually used. So, now we use String::fromUTF8()
directly instead of WEB_UI_STRING to not confuse the scanners.
* CMakeLists.txt: Add LocalizedStrings.cpp to the compilation.
* PlatformGTK.cmake: Move LocalizedStringsGtk.cpp to the list of sources not depending on GTK+, since it no
longer uses GTK+.
* extract-localizable-strings.pl: Update it to handle the new macros.
* platform/LocalizedStrings.cpp:
(WebCore::formatLocalizedString):
(WebCore::contextMenuItemTagOpenLinkInNewWindow):
(WebCore::contextMenuItemTagDownloadLinkToDisk):
(WebCore::contextMenuItemTagOpenImageInNewWindow):
(WebCore::contextMenuItemTagCopyImageToClipboard):
(WebCore::contextMenuItemTagOpenFrameInNewWindow):
(WebCore::contextMenuItemTagCopy):
(WebCore::contextMenuItemTagGoBack):
(WebCore::contextMenuItemTagGoForward):
(WebCore::contextMenuItemTagStop):
(WebCore::contextMenuItemTagReload):
(WebCore::contextMenuItemTagCut):
(WebCore::contextMenuItemTagPaste):
(WebCore::contextMenuItemTagIgnoreSpelling):
(WebCore::contextMenuItemTagLearnSpelling):
(WebCore::contextMenuItemTagLookUpInDictionary):
(WebCore::contextMenuItemTagOpenLink):
(WebCore::contextMenuItemTagIgnoreGrammar):
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckSpelling):
(WebCore::contextMenuItemTagCheckSpellingWhileTyping):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):
(WebCore::contextMenuItemTagFontMenu):
(WebCore::contextMenuItemTagBold):
(WebCore::contextMenuItemTagItalic):
(WebCore::contextMenuItemTagUnderline):
(WebCore::contextMenuItemTagOutline):
(WebCore::contextMenuItemTagOpenVideoInNewWindow):
(WebCore::contextMenuItemTagOpenAudioInNewWindow):
(WebCore::contextMenuItemTagDownloadVideoToDisk):
(WebCore::contextMenuItemTagDownloadAudioToDisk):
(WebCore::contextMenuItemTagExitVideoFullscreen):
(WebCore::contextMenuItemTagMediaPlay):
(WebCore::contextMenuItemTagMediaPause):
(WebCore::contextMenuItemTagMediaMute):
(WebCore::contextMenuItemTagInspectElement):
(WebCore::AXAutoFillContactsLabel):
(WebCore::imageTitle):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::textTrackCountryAndLanguageMenuItemText):
(WebCore::textTrackLanguageMenuItemText):
(WebCore::closedCaptionTrackMenuItemText):
(WebCore::sdhTrackMenuItemText):
(WebCore::easyReaderTrackMenuItemText):
(WebCore::forcedTrackMenuItemText):
(WebCore::audioDescriptionTrackSuffixText):
(WebCore::webCryptoMasterKeyKeychainLabel):
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::copyImageUnknownFileLabel):
(WebCore::contextMenuItemTagSearchInSpotlight):
(WebCore::contextMenuItemTagSearchWeb):
(WebCore::contextMenuItemTagShowFonts):
(WebCore::contextMenuItemTagStyles):
(WebCore::contextMenuItemTagShowColors):
(WebCore::contextMenuItemTagSpeechMenu):
(WebCore::contextMenuItemTagStartSpeaking):
(WebCore::contextMenuItemTagStopSpeaking):
(WebCore::contextMenuItemTagCorrectSpellingAutomatically):
(WebCore::contextMenuItemTagSubstitutionsMenu):
(WebCore::contextMenuItemTagShowSubstitutions):
(WebCore::contextMenuItemTagSmartCopyPaste):
(WebCore::contextMenuItemTagSmartQuotes):
(WebCore::contextMenuItemTagSmartDashes):
(WebCore::contextMenuItemTagSmartLinks):
(WebCore::contextMenuItemTagTextReplacement):
(WebCore::contextMenuItemTagTransformationsMenu):
(WebCore::contextMenuItemTagMakeUpperCase):
(WebCore::contextMenuItemTagMakeLowerCase):
(WebCore::contextMenuItemTagCapitalize):
(WebCore::contextMenuItemTagChangeBack):
(WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen):
(WebCore::contextMenuItemTagExitVideoEnhancedFullscreen):
(WebCore::AXARIAContentGroupText):
(WebCore::AXHorizontalRuleDescriptionText):
(WebCore::AXMarkText):
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):
(WebCore::builtInPDFPluginName):
(WebCore::pdfDocumentTypeDescription):
(WebCore::postScriptDocumentTypeDescription):
(WebCore::keygenMenuItem2048):
(WebCore::keygenKeychainItemName):
(WebCore::htmlSelectMultipleItems):
(WebCore::fileButtonChooseMediaFileLabel):
(WebCore::fileButtonChooseMultipleMediaFilesLabel):
(WebCore::fileButtonNoMediaFileSelectedLabel):
(WebCore::fileButtonNoMediaFilesSelectedLabel):
(WebCore::insertListTypeNone):
(WebCore::insertListTypeBulleted):
(WebCore::insertListTypeBulletedAccessibilityTitle):
(WebCore::insertListTypeNumbered):
(WebCore::insertListTypeNumberedAccessibilityTitle):
(WebCore::exitFullScreenButtonAccessibilityTitle):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::contextMenuItemTagDelete):
(WebCore::contextMenuItemTagSelectAll):
* platform/win/LocalizedStringsWin.cpp:
(WebCore::contextMenuItemTagSearchWeb):
(WebCore::uploadFileText):
(WebCore::allFilesText):
2017-03-21 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Migrate off of CTFontCreateForCSS
https://bugs.webkit.org/show_bug.cgi?id=168894
Reviewed by Antti Koivisto.
Use the new font selection algorithm introduced in r213163 on iOS.
Test: fast/text/font-weights.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
* platform/graphics/cocoa/FontCocoa.mm: On iOS only, CTFontCreateForCSS()
will return a 0-sized font if the passed size parameter is 0. However, all
other CT APIs will create a 12-px-sized font if the passed size parameter is
0. Most of our code knows and understands this (because this is how it works
on the Mac). However, this one place needs to be updated to understand this.
2017-03-21 Simon Fraser <simon.fraser@apple.com>
Make non-decoded image flashing less intrusive
https://bugs.webkit.org/show_bug.cgi?id=169942
Reviewed by Said Abou-Hallawa.
When compositing borders are enabled, we paint yellow for images that paint but don't yet have a decoded
frame. Give this yellow 50% alpha to make it less intrusive
Also log to the images log channel when we destroy decoded data.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::draw):
2017-03-20 Matt Rajca <mrajca@apple.com>
Loosen audio playback restrictions when the volume is 0.
https://bugs.webkit.org/show_bug.cgi?id=169897
Reviewed by Eric Carlson.
Added API tests.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):
2017-03-21 Brady Eidson <beidson@apple.com>
Disable all virtual tables.
<rdar://problem/31081972> and https://bugs.webkit.org/show_bug.cgi?id=169928
Reviewed by Jer Noble.
No new tests (Covered by changes to existing test).
* Modules/webdatabase/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::createVTable):
(WebCore::DatabaseAuthorizer::dropVTable):
2017-03-21 Anders Carlsson <andersca@apple.com>
Remove bogus availability annotations from DOM SPI headers.
rdar://problem/31015675
Rubber-stamped by Dan Bernstein.
* platform/cocoa/WebKitAvailability.h:
Remove __NSi_9876_5 #define.
2017-03-21 Zalan Bujtas <zalan@apple.com>
Tear down descendant renderers when <slot>'s display value is set to no "contents".
https://bugs.webkit.org/show_bug.cgi?id=169921
<rdar://problem/30336417>
Reviewed by Antti Koivisto.
Since "display: contents" does not generate a renderer, when an element's display value is
changed to something other than "contents", we not only create a renderer but also reparent its descendant
subtree (e.g from slot's parent to the newly constructed slot renderer). During this reparenting, we
need to tear down the descendant subtree tree and build it up again to reflect the new rendering context.
Test: fast/shadow-dom/slot-with-continuation-descendants.html
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
2017-03-19 Wenson Hsieh <wenson_hsieh@apple.com>
Teach TextIndicator to estimate the background color of the given Range
https://bugs.webkit.org/show_bug.cgi?id=169869
<rdar://problem/31127272>
Reviewed by Anders Carlsson and Simon Fraser.
Introduces a simple heuristic to compute a background color that is appropriate to use as a border surrounding
the snapshot of the given Range. This work is only carried out if TextIndicatorOptionComputeEstimatedBackgroundColor
is specified. The details of how this background color is estimated (as well as when to fall back) can be improved
in several ways (one idea is to sample colors along the edge of the snapshot). For the time being, this patch
naively walks up the render tree in search of enclosing parent renderers that have background colors. If any
renderers have a style that is deemed too complex to capture in a single background color, then fall back to the
base document background color; otherwise, the estimated background color is the result of blending these
background colors together.
* page/TextIndicator.cpp:
(WebCore::styleContainsComplexBackground):
Bail out of the background color codepath if the renderer has backdrop filters, has a background image, or uses
a non-normal blend mode.
(WebCore::fallbackBackgroundColorForTextSelection):
(WebCore::estimatedBackgroundColorForRange):
(WebCore::initializeIndicator):
* page/TextIndicator.h:
2017-03-20 Jer Noble <jer.noble@apple.com>
Crash in WebCore: WebCore::CARingBuffer::getCurrentFrameBounds + 28
https://bugs.webkit.org/show_bug.cgi?id=169887
<rdar://problem/23648082>
Reviewed by Eric Carlson.
Because AudioSourceProviderAVFObjC::prepareCallback() can concievably be called after the AudioSourceProviderAVFObjC
it refers to has been destroyed, add an extra layer of indirection between the tap and the provider, and invalidate
that level of indirection before the AudioSourceProviderAVFObjC is destroyed.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::initCallback):
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
(WebCore::AudioSourceProviderAVFObjC::prepareCallback):
(WebCore::AudioSourceProviderAVFObjC::unprepareCallback):
(WebCore::AudioSourceProviderAVFObjC::processCallback):
2017-03-21 Simon Fraser <simon.fraser@apple.com>
Remove logging left in by mistake.
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::willBeDestroyed):
2017-03-21 Jon Lee <jonlee@apple.com>
Clean up RTCSdpType, RTC enums and headers
https://bugs.webkit.org/show_bug.cgi?id=169741
Reviewed by Youenn Fablet.
Convert to RTCSdpType.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
* Modules/mediastream/MediaEndpointSessionDescription.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
Convert SDP argument to lvalue.
* Modules/mediastream/RTCSessionDescription.cpp:
* Modules/mediastream/RTCSessionDescription.h:
* Modules/mediastream/RTCSessionDescription.idl:
Keep RTC enum IDLs above platform. Move the C++ enum headers into platform.
* Modules/mediastream/RTCEnums.h: Removed.
* Modules/mediastream/RTCIceConnectionState.h: Removed.
* Modules/mediastream/RTCIceGatheringState.h: Removed.
* Modules/mediastream/RTCIceTransportState.h: Removed.
* Modules/mediastream/RTCSignalingState.h: Removed.
* platform/mediastream/PeerConnectionStates.h: Remove from .xcodeproj. Move enums to separate headers.
* platform/mediastream/RTCBundlePolicy.h:
* platform/mediastream/RTCIceConnectionState.h:
* platform/mediastream/RTCIceGatheringState.h:
* platform/mediastream/RTCIceTransportPolicy.h:
* platform/mediastream/RTCIceTransportState.h:
* platform/mediastream/RTCRtpTransceiverDirection.h: Renamed from Source/WebCore/Modules/mediastream/RTCRtpTransceiverDirection.h.
* platform/mediastream/RTCSdpType.h:
* platform/mediastream/RTCSignalingState.h:
Move RtpTransceiverDirection out to a separate IDL.
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpTransceiver.cpp:
* Modules/mediastream/RTCRtpTransceiver.h:
* WebCore.xcodeproj/project.pbxproj:
Replace RTCEnums include with specific headers per enum.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCIceTransport.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::completeAddTransceiver): Remove unneeded static_cast.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.h:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/mock/MockMediaEndpoint.h:
Clean up license.
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
Modernize header to use #pragma once.
* platform/mediastream/RTCDTMFSenderHandler.h:
* platform/mediastream/RTCDTMFSenderHandlerClient.h:
* platform/mediastream/RTCIceCandidateDescriptor.h:
* platform/mediastream/RTCPeerConnectionHandlerClient.h:
* platform/mediastream/RTCSessionDescriptionDescriptor.h:
* platform/mediastream/RTCSessionDescriptionRequest.h:
* platform/mediastream/RTCVoidRequest.h:
* platform/mock/RTCNotifiersMock.h:
2017-03-20 Jon Lee <jonlee@apple.com>
Add iceCandidatePoolSize to RTCConfiguration
https://bugs.webkit.org/show_bug.cgi?id=169866
Reviewed by Youenn Fablet.
Test: webrtc/rtcconfiguration-icecandidatepoolsize.html
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl: Add iceCandidatePoolSize.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration): Set the size in libwebrtc.
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
2017-03-20 Jon Lee <jonlee@apple.com>
Follow-up on comments for bug 169664
https://bugs.webkit.org/show_bug.cgi?id=169709
Reviewed by Youenn Fablet.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::deriveAggregatedIceConnectionState): Update deriveAggregatedIceConnectionState.
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged): Set a capacity and used
uncheckedAppend.
2017-03-20 Simon Fraser <simon.fraser@apple.com>
Add a system trace point for memory warning handling
https://bugs.webkit.org/show_bug.cgi?id=169893
Reviewed by Zalan Bujtas.
Add a TraceScope for low memory handling, which logs 'critical' and 'synchronous'.
* page/MemoryRelease.cpp:
(WebCore::releaseMemory):
2017-03-20 Simon Fraser <simon.fraser@apple.com>
Optimize packing of Document and superclass data members
https://bugs.webkit.org/show_bug.cgi?id=169880
Reviewed by Antti Koivisto.
Move data members around to optimize packing in SecurityContext, SuspendableTimer and Document.
This saves as few hundred bytes on Document.
Padding detected via Tools/Scripts/dump-class-layout
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::SecurityContext):
* dom/SecurityContext.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::SuspendableTimer):
* page/SuspendableTimer.h:
2017-03-20 Chris Dumez <cdumez@apple.com>
Suspend media playback in background tabs
https://bugs.webkit.org/show_bug.cgi?id=169883
<rdar://problem/28056151>
Reviewed by Eric Carlson.
Suspend media playback in background tabs to save battery
except in cases where we cannot (e.g. PiP, AirPlay).
Test: media/media-playback-page-visibility.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::visibilityStateChanged):
When page visibility state changes, begin / end media session
interruption with reason PlatformMediaSession::EnteringBackground.
This reason was already used on iOS when the application enters
or exist background. HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction()
takes care of preventing interruption in case of AirPlay or PiP.
2017-03-20 Daniel Bates <dabates@apple.com>
Prevent new navigations from onbeforeunload handler
https://bugs.webkit.org/show_bug.cgi?id=169891
<rdar://problem/31155736>
Reviewed by Ryosuke Niwa.
Ensure that all navigations initiated from an onbeforeunload handler are disallowed
regardless of how they were scheduled. Such navigations go against the expectation
of a user.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isNavigationAllowed): Added.
(WebCore::FrameLoader::loadURL): Modified code to call FrameLoader::isNavigationAllowed().
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::stopAllLoaders): Ditto.
* loader/FrameLoader.h:
2017-03-20 Alex Christensen <achristensen@webkit.org>
Prepare SocketStreamHandle for being created from WK2
https://bugs.webkit.org/show_bug.cgi?id=169885
Reviewed by Andy Estes.
No change in behavior.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::sendFrame):
Rename send to sendData to prevent name collisions with IPC::MessageSender::send.
* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::sendData):
(WebCore::SocketStreamHandle::send): Deleted.
* platform/network/SocketStreamHandle.h:
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImpl.h:
Make platformSend and platformClose public so I can call them from IPC proxies.
2017-03-20 Andy Estes <aestes@apple.com>
[QuickLook] Subresources should be in the same origin as the main document
https://bugs.webkit.org/show_bug.cgi?id=169868
<rdar://problem/29898214>
Reviewed by Daniel Bates.
Prior to this change, QuickLook documents were placed in a unique origin, which meant all
subresources were loaded as cross-origin requests. This prevented XMLHttpRequests to the
QuickLook custom protocol, since cross-origin XHRs must be made to a protocol that
understands CORS.
Instead of a unique origin, we now create an origin for QuickLook documents from the preview
response URL (an x-apple-ql-id: URL), which will allow QuickLook to make same-origin XHRs by
using a URL with the same scheme and host as the preview response URL.
Test: http/tests/quicklook/same-origin-xmlhttprequest-allowed.html
* dom/Document.cpp:
(WebCore::Document::applyQuickLookSandbox):
2017-03-17 Jiewen Tan <jiewen_tan@apple.com>
window.crypto.getRandomValues() uses the insecure RC4 RNG
https://bugs.webkit.org/show_bug.cgi?id=169623
<rdar://problem/31044229>
Reviewed by Brent Fulgham.
This patch replaces the RC4 RNG with one based on AES-CTR.
No change of behavior.
* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues):
2017-03-20 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Respect constraints passed to getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=169870
<rdar://problem/31138936>
Reviewed by Youenn Fablet and Jer Noble.
Remember the fitness score calculated when evaluating constraints passed to getUserMedia, so
the best device is chosen when more than one device supports the constraints. Register two
mock video and two mock audio devices with different capabilities so these changes can
be tested.
No new tests, existing tests updated.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::selectSettings): Store fitness score in m_fitnessScore.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Don't assume sampleRate is 44.1K
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers): Use sampleRate() instead of m_sampleRate.
(WebCore::MockRealtimeAudioSourceMac::reconfigure): Ditto.
(WebCore::MockRealtimeAudioSourceMac::render): Ditto.
(WebCore::MockRealtimeAudioSourceMac::applySampleRate): Ditto.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::updateSettings): Don't assume sampleRate is 44.1K
(WebCore::MockRealtimeAudioSource::initializeCapabilities): Support a range of sample rates.
(WebCore::MockRealtimeAudioSource::startProducingData): Initialize sampleRate if it hasn't
already been set.
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::audioDevices): Return an array of devices.
(WebCore::MockRealtimeMediaSource::videoDevices): Ditto.
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
(WebCore::MockRealtimeMediaSource::mockAudioSourcePersistentID): Deleted.
(WebCore::MockRealtimeMediaSource::mockVideoSourcePersistentID): Deleted.
(WebCore::MockRealtimeMediaSource::mockAudioSourceName): Deleted.
(WebCore::MockRealtimeMediaSource::mockVideoSourceName): Deleted.
(WebCore::MockRealtimeMediaSource::audioDeviceInfo): Deleted.
(WebCore::MockRealtimeMediaSource::videoDeviceInfo): Deleted.
* platform/mock/MockRealtimeMediaSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
2017-03-20 Wenson Hsieh <wenson_hsieh@apple.com>
TextIndicator should support a mode where selection rects are used to size the snapshot
https://bugs.webkit.org/show_bug.cgi?id=169845
<rdar://problem/31127818>
Reviewed by Beth Dakin.
Adds TextIndicator support in iOS for using the would-be selection rects of a given range to determine
snapshotting bounds. See below changes for more details.
* dom/Range.cpp:
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines):
(WebCore::Range::collectSelectionRects):
Mark these helper methods as const.
* dom/Range.h:
* page/TextIndicator.cpp:
(WebCore::getSelectionRectsForRange):
(WebCore::initializeIndicator):
If TextIndicatorOptionUseSelectionRectForSizing is enabled, then compute selection rects and set the text rects
to be the resulting selection rects. These are in document coordinates.
* page/TextIndicator.h:
2017-03-20 Simon Fraser <simon.fraser@apple.com>
Move code out of renderer destructors into willBeDestroyed()
https://bugs.webkit.org/show_bug.cgi?id=169650
Reviewed by Antti Koivisto.
This is done for four reasons. First, code in willBeDestroyed() is able to call
virtual functions on derived classes. Second, this code will run before we've destroyed
the renderer's rareData, so can safely access it. Third, RenderWidget is special, and can have
its lifetime extended via manual ref-counting, and we want all cleanup to complete
before it goes into this weird zombie state. Fourth, in a shiny future where we have
ref-counted RenderObjects, we want cleanup code to be run explicitly and not tied
to object lifetime, and this is a step in that direction.
For all classes that derive from RenderObject, move code from the destructor into
willBeDestroyed(). New willBeDestroyed() implementations must call the base class.
RenderBlock and RenderBlockFlow are special; RenderBlockFlow::willBeDestroyed()
skips over RenderBlock::willBeDestroyed(), but they both need to run some code, which
I moved into RenderBlock::blockWillBeDestroyed().
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::~RenderBlock):
(WebCore::RenderBlock::willBeDestroyed):
(WebCore::RenderBlock::blockWillBeDestroyed):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::~RenderBlockFlow):
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::willBeDestroyed):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::~RenderBoxModelObject):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::willBeDestroyed):
* rendering/RenderCounter.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::~RenderEmbeddedObject):
(WebCore::RenderEmbeddedObject::willBeDestroyed):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::~RenderImage):
(WebCore::RenderImage::willBeDestroyed):
* rendering/RenderImage.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::~RenderLayerModelObject):
(WebCore::RenderLayerModelObject::willBeDestroyed):
* rendering/RenderLayerModelObject.h:
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::~RenderLineBreak):
(WebCore::RenderLineBreak::willBeDestroyed):
* rendering/RenderLineBreak.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::~RenderListBox):
(WebCore::RenderListBox::willBeDestroyed):
* rendering/RenderListBox.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::~RenderListItem):
(WebCore::RenderListItem::willBeDestroyed):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::~RenderListMarker):
(WebCore::RenderListMarker::willBeDestroyed):
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::~RenderMenuList):
(WebCore::RenderMenuList::willBeDestroyed):
* rendering/RenderMenuList.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::~RenderNamedFlowThread):
(WebCore::RenderNamedFlowThread::willBeDestroyed):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::~RenderQuote):
(WebCore::RenderQuote::willBeDestroyed):
* rendering/RenderQuote.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::~RenderSearchField):
(WebCore::RenderSearchField::willBeDestroyed):
* rendering/RenderSearchField.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::~RenderSnapshottedPlugIn):
(WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::~RenderText):
(WebCore::RenderText::willBeDestroyed):
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::~RenderTextControlMultiLine):
(WebCore::RenderTextControlMultiLine::willBeDestroyed):
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::~RenderVideo):
(WebCore::RenderVideo::willBeDestroyed):
* rendering/RenderVideo.h:
* rendering/RenderWidget.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::~RenderSVGImage):
(WebCore::RenderSVGImage::willBeDestroyed):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::~RenderSVGResourceContainer):
(WebCore::RenderSVGResourceContainer::willBeDestroyed):
2017-03-20 Jon Lee <jonlee@apple.com>
Mark differences in media stream implementation
https://bugs.webkit.org/show_bug.cgi?id=169873
Reviewed by Eric Carlson.
Rearrange IDL and add comments based on 05 February 2017 Editor's Draft of Media
Capture and Streams spec.
* Modules/mediastream/DOMURLMediaStream.idl:
* Modules/mediastream/MediaDeviceInfo.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/MediaStream.idl:
* Modules/mediastream/MediaStreamEvent.idl:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/MediaStreamTrackEvent.idl:
* Modules/mediastream/MediaTrackConstraints.idl:
* Modules/mediastream/MediaTrackSupportedConstraints.idl:
* Modules/mediastream/NavigatorMediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl:
2017-03-20 Per Arne Vollan <pvollan@apple.com>
Use CopyFontDescriptorWithStrokeForStyle to get correct stroke width for captions.
https://bugs.webkit.org/show_bug.cgi?id=169674
Reviewed by Eric Carlson.
Use the MediaAccessibility function MACopyFontDescriptorWithStrokeForStyle to get
correct video captions stroke width from a given font size.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
* html/shadow/MediaControlElements.h:
* page/CaptionUserPreferences.h:
(WebCore::CaptionUserPreferences::captionStrokeWidth):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionStrokeWidth):
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
(WebCore::CaptionUserPreferencesMediaAF::strokeWidth): Deleted.
* page/CaptionUserPreferencesMediaAF.h:
* platform/cf/MediaAccessibilitySoftLink.cpp:
* platform/cf/MediaAccessibilitySoftLink.h:
2017-03-20 Emanuele Aina <emanuele.aina@collabora.com>
[Cairo] Ensure depth and stencil renderbuffers are created on GLESv2
https://bugs.webkit.org/show_bug.cgi?id=166643
Reviewed by Darin Adler.
If the gfx device doesn't support GL_OES_packed_depth_stencil, the
separate depth and stencil buffers are not generated.
Copy what GraphicsContext3DEfl used to do and apply it in
GraphicsContext3DCairo.
The Intel gfx driver seem to tolerate unbound renderbuffers, but
enabling debugging in Mesa yields an error:
$ MESA_DEBUG=1 \
MESA_EXTENSION_OVERRIDE=-GL_OES_packed_depth_stencil
./bin/MiniBrowser http://webglsamples.org/aquarium/aquarium.html
Mesa: User error: GL_INVALID_OPERATION in glRenderbufferStorage(no renderbuffer bound)
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Ensure separate depth and stencil renderbuffers are created.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
Ensure separate depth and stencil renderbuffers are released.
2017-03-19 Chris Dumez <cdumez@apple.com>
Implement self.origin
https://bugs.webkit.org/show_bug.cgi?id=168023
Reviewed by Sam Weinig.
Implement self.origin:
- https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
Firefox and Chrome already support this.
Test: imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::origin):
* page/DOMWindow.h:
* page/WindowOrWorkerGlobalScope.idl:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::origin):
* workers/WorkerGlobalScope.h:
2017-03-18 Jon Lee <jonlee@apple.com>
Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
https://bugs.webkit.org/show_bug.cgi?id=169731
Reviewed by Alex Christensen.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Create a new $implementationAsKey. Look for
ImplementedAs, and if it exists, override the value with the alias. Set the parameters of
convert<>() using JSValueToNative.
(IsValidContextForJSValueToNative): Update to include IDLDictionaryMembers.
(JSValueToNative): Bypass parseEnumeration serialization for enums if the context is an
IDLDictionaryMember. Dictionary members need convert<IDLEnumeration> which throw a TypeError
or return the enum (and utilizes parseEnumeration). parseEnumeration, in contrast, returns
an optional.
* bindings/scripts/test/TestObj.idl: Add test cases in TestDictionary.
Update test results.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2017-03-18 Simon Fraser <simon.fraser@apple.com>
Use initializers for Document member variables
https://bugs.webkit.org/show_bug.cgi?id=169848
Reviewed by Chris Dumez.
Move Document to use C++11 brace initializers.
No behavior change.
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::xmlStandaloneStatus):
(WebCore::Document::setHasXMLDeclaration):
2017-03-18 Chris Dumez <cdumez@apple.com>
innerText setter inserts empty text node if value starts with newline
https://bugs.webkit.org/show_bug.cgi?id=169600
Reviewed by Ryosuke Niwa.
innerText setter should not create empty text nodes as per:
- https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute (step 6.2)
No new tests, updated existing test.
* html/HTMLElement.cpp:
(WebCore::textToFragment):
2017-03-18 Chris Dumez <cdumez@apple.com>
Allow setting the prototype of cross-origin objects, as long as they don't change
https://bugs.webkit.org/show_bug.cgi?id=169787
Reviewed by Mark Lam.
Allow setting the prototype of cross-origin objects, as long as they don't change:
- https://html.spec.whatwg.org/multipage/browsers.html#windowproxy-setprototypeof
- https://html.spec.whatwg.org/multipage/browsers.html#location-setprototypeof
- https://tc39.github.io/ecma262/#sec-set-immutable-prototype
Tests: imported/w3c/web-platform-tests/common/domain-setter.sub.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html
imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html
imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html
imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html
imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html
* bindings/js/JSLocationCustom.cpp:
* page/Location.idl:
Drop custom setPrototype() implementation for Location and mark Location as an immutable
prototype exotic object now that JSC does the right thing for those.
2017-03-17 Youenn Fablet <youenn@apple.com>
Stop sending media data as soon as peer connection is closed
https://bugs.webkit.org/show_bug.cgi?id=169813
Reviewed by Eric Carlson.
Stopping sending of media data as soon as the peer connection is closed.
By stopping sending at source level, this may stop by a few frames/chunks earlier than before.
Making sure RealtimeOutgoingVideoSource is stopping observing the media source when being stopped and deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::stop):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::stop):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2017-03-17 Youenn Fablet <youenn@apple.com>
Implement incoming webrtc data based on tracksCurr
https://bugs.webkit.org/show_bug.cgi?id=169836
Reviewed by Eric Carlson.
Test: webrtc/video-with-receiver.html
Constructing incoming tracks based on libwebrtc OnAddTrack.
Constructing incoming media streams based on libwebrtc OnAddStream.
Firing only addstream if legacy API flag is on.
Ensuring that media stream and media stream tracks relationship is still correctly implemented.
For that, we keep a map that relates libwebrtc media streams with WebCore media streams.
Adding the ability to get a receiver related to the track on the track event.
Implementing the possibility to create a transceiver ahead of track arrival time.
Created transceivers that are not related to any real source are kept in the peer connection back end.
When a libwebrtc track is appearing, it is associated with the track source of the corresponding transceiver based on track type.
Added the ability to create empty real time sources and set their data libwebrtc track when being available.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::addTrackFromPlatform):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::OnAddStream):
(WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
(WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
(WebCore::LibWebRTCMediaEndpoint::stop):
(WebCore::createMediaStreamTrack): Deleted.
(WebCore::LibWebRTCMediaEndpoint::addStream): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
(WebCore::createReceiverForSource):
(WebCore::createEmptySource):
(WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream):
(WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::setSourceTrack):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::setSourceTrack):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
2017-03-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Compensate for video capture orientation
https://bugs.webkit.org/show_bug.cgi?id=169313
<rdar://problem/30994785>
Unreviewed, fix a crash in r214120 found by the bots.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener invalidate]): Drive-by removal of unnecessary code.
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
Actually retain self before callOnMainThread.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
Invalidate the change listener first.
2017-03-17 Dean Jackson <dino@apple.com>
MediaQueryList instances do not update for `prefers-reduced-motion`
https://bugs.webkit.org/show_bug.cgi?id=169835
<rdar://problem/30339378>
Reviewed by Anders Carlsson.
Tell the document it needs to evaluate the MediaQueryLists
if accessibility settings change.
Test: fast/media/mq-prefers-reduced-motion-matchMedia.html
* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):
2017-03-17 Brady Eidson <beidson@apple.com>
Make HTTPCookieStorage operate in the UIProcess in absence of a WebProcessPool.
<rdar://problem/31102330> and https://bugs.webkit.org/show_bug.cgi?id=169797
Reviewed by Alex Christensen.
No new tests (No behavior change).
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::flushCookieStore):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::flushCookieStore):
2017-03-17 Dave Hyatt <hyatt@apple.com>
Disable per-region boxes for multicolumn
https://bugs.webkit.org/show_bug.cgi?id=169830
Reviewed by Zalan Bujtas.
Test: fast/multicol/float-adjacent-to-overflow-block.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::borderBoxRectInRegion):
(WebCore::RenderBox::renderBoxRegionInfo):
Limit all of the per-region box code to RenderNamedFlowThreads.
This code should never be used by multicolumn layout.
2017-03-17 Said Abou-Hallawa <sabouhallawa@apple.com>
Time channel attack on SVG Filters
https://bugs.webkit.org/show_bug.cgi?id=118689
Reviewed by Simon Fraser.
The time channel attack can happen if the attacker applies FEColorMatrix
or FEConvolveMatrix and provides a matrix which is filled with subnormal
floating point values. Performing floating-point operations on subnormals
is very expensive unless the pixel in the source graphics is black (or
zero). By measuring the time a filter takes to be applied, the attacker
can know whether the pixel he wants to steal from an iframe is black or
white. By repeating the same process on all the pixels in the iframe, the
attacker can reconstruct the whole page of the iframe.
To fix this issue, the values in the matrices of these filters will clamped
to FLT_MIN. We do not want to consume too much time calculating filtered
pixels because of such tiny values. The difference between applying FLT_MIN
and applying a subnormal should not be even noticeable. Normalizing the
floating-point matrices should happen only at the beginning of the filter
platformApplySoftware().
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::fastSetInteriorPixels):
(WebCore::FEConvolveMatrix::fastSetOuterPixels):
(WebCore::FEConvolveMatrix::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::normalizedFloats):
2017-03-17 Jer Noble <jer.noble@apple.com>
Explicitly resize the audio buffer in RealtimeOutgoingAudioSource.
https://bugs.webkit.org/show_bug.cgi?id=169814
<rdar://problem/30975496>
Reviewed by Eric Carlson.
Rather than just reserving sufficient capacity, actually change the buffer's underlying size to match.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2017-03-17 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Make sure all CryptoKey classes are structured clonable
https://bugs.webkit.org/show_bug.cgi?id=169232
<rdar://problem/31106660>
Reviewed by Brent Fulgham.
This patch does the following few things: 1) It makes CryptoKeyEC and CryptoKeyRaw
structured clonable; 2) It makes CryptoKeyAES and CryptoKeyHMAC to use a move importer
during deserialization; 3) It adds some tests to make sure CryptoKeyAES, CryptoKeyHMAC
and CryptoKeyRSA won't lose their internal data during serialization/deserialization.
Tests: crypto/workers/subtle/ec-postMessage-worker.html
crypto/workers/subtle/raw-postMessage-worker.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::readHMACKey):
(WebCore::CloneDeserializer::readAESKey):
(WebCore::CloneDeserializer::readECKey):
(WebCore::CloneDeserializer::readRawKey):
(WebCore::CloneDeserializer::readCryptoKey):
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::namedCurveString):
(WebCore::CryptoKeyEC::isValidECAlgorithm):
* crypto/keys/CryptoKeyEC.h:
2017-03-17 Michael Saboff <msaboff@apple.com>
Use USE_INTERNAL_SDK to compute ENABLE_FAST_JIT_PERMISSIONS instead of HAVE_INTERNAL_SDK
https://bugs.webkit.org/show_bug.cgi?id=169817
Reviewed by Filip Pizlo.
* Configurations/FeatureDefines.xcconfig:
2017-03-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Compensate for video capture orientation
https://bugs.webkit.org/show_bug.cgi?id=169313
<rdar://problem/30994785>
Reviewed by Jer Noble.
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.
Add 'orientation' and 'mirrored' attributes to MediaSample
* platform/MediaSample.h:
(WebCore::MediaSample::videoOrientation):
(WebCore::MediaSample::videoMirrored):
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
A video sample can be rotated and/or mirrored, so the video layer may need to be rotated
and resized for display. We don't want expose this information to the renderer, so allocate
return a generic CALayer as the player's platforLayer, and add the video layer as a sublayer
so we can adjust it to display correctly. Add an enum for playback state as well as display
mode so we correctly display a black frame when video frames are available but playback has
not yet started.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener initWithParent:]):
(-[WebAVSampleBufferStatusChangeListener invalidate]):
(-[WebAVSampleBufferStatusChangeListener beginObservingLayers]):
(-[WebAVSampleBufferStatusChangeListener stopObservingLayers]): Ditto.
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
(WebCore::runWithoutAnimations):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::displayLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged):
(-[WebAVSampleBufferStatusChangeListener beginObservingLayer:]): Deleted.
(-[WebAVSampleBufferStatusChangeListener stopObservingLayer:]): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paused): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldBePlaying): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Add connection parameter so we can get the
video orientation.
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
Pass sample orientation to libwebrtc.
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2017-03-17 Zalan Bujtas <zalan@apple.com>
Fix the flow thread state on the descendants of out of flow positioned replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=169821
<rdar://problem/30964017>
Reviewed by Simon Fraser.
Descendants of a replaced out of flow elmement should inherit the flowthread state
from the replaced element and not from the replaced element's parent.
Test: fast/multicol/fix-inherit-when-container-is-replaced.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFlowThreadState):
2017-03-17 Jon Davis <jond@apple.com>
Update feature status for outdated entries: CSS Shapes, Force Click Events
https://bugs.webkit.org/show_bug.cgi?id=169829
Reviewed by Matt Baker.
* features.json:
2017-03-17 Alex Christensen <achristensen@webkit.org>
Make SocketStreamError a private header.
https://bugs.webkit.org/show_bug.cgi?id=169831
* WebCore.xcodeproj/project.pbxproj:
I'll need this from WebKit2.
2017-03-17 Alex Christensen <achristensen@webkit.org>
Add encoder for SocketStreamError
https://bugs.webkit.org/show_bug.cgi?id=169831
Reviewed by Andy Estes.
This isn't used yet, but we'll soon need to send these across IPC.
* platform/network/SocketStreamError.h:
(WebCore::SocketStreamError::encode):
(WebCore::SocketStreamError::decode):
2017-03-17 Alex Christensen <achristensen@webkit.org>
Make SocketStreamHandle virtual functions asynchronous
https://bugs.webkit.org/show_bug.cgi?id=169818
Reviewed by Andy Estes.
No change in behavior. Instead of returning immediately, call a completion handler.
This is in preparation for making them truly asynchronous.
I still need to be able to synchronously get the number of buffered bytes, but the
buffer itself will soon be in the NetworkProcess with a new subclass of SocketStreamHandle
that messages across IPC. The number of buffered bytes will still be stored in the WebProcess,
and when it updates, the message from SocketStreamHandleClient::didUpdateBufferedAmount will update it.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::send):
(WebCore::SocketStreamHandle::close):
(WebCore::SocketStreamHandle::sendPendingData): Deleted.
* platform/network/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::bufferedAmount): Deleted.
* platform/network/SocketStreamHandleImpl.cpp: Added.
(WebCore::SocketStreamHandleImpl::platformSend):
(WebCore::SocketStreamHandleImpl::sendPendingData):
(WebCore::SocketStreamHandleImpl::bufferedAmount):
m_buffer was moved from SocketStreamHandle to SocketStreamHandleImpl, so some of the logic must move with it.
I moved as much logic that was shared in the superclass to a new shared location for code shared among the subclass implementations.
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
(WebCore::SocketStreamHandleImpl::platformSend): Deleted.
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
(WebCore::SocketStreamHandleImpl::platformSend): Deleted.
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
(WebCore::SocketStreamHandleImpl::platformSend): Deleted.
2017-03-17 Antti Koivisto <antti@apple.com>
Add a reload policy where only expired subresources are revalidated
https://bugs.webkit.org/show_bug.cgi?id=169756
Reviewed by Andreas Kling.
Test: http/tests/cache/reload-expired-only.html
The default reload behavior revalidates all resources on the page. This patch adds
a new policy that revalidates expired (and uncacheable) resources only. Using this
policy can speed up reloads significantly and also reduce network traffic and server
load.
* history/PageCache.cpp:
(WebCore::canCachePage):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::reload):
* loader/FrameLoader.cpp:
(WebCore::isBackForwardLoadType):
(WebCore::isReload):
Add a helper function.
(WebCore::FrameLoader::loadURL):
(WebCore::logNavigation):
(WebCore::FrameLoader::reload):
Replace bool arguments with OptionSet<ReloadOption>. Most of the patch is about adapting to this.
(WebCore::FrameLoader::transitionToCommitted):
(WebCore::FrameLoader::subresourceCachePolicy):
Return CachePolicyVerify for 'ReloadExpiredOnly' frame load type. This is the substantive
change that causes the behavior difference.
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::defaultRequestCachingPolicy):
Flip the isMainResource condition for better readability.
(WebCore::FrameLoader::shouldPerformFragmentNavigation):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
(WebCore::FrameLoader::reload):
* loader/FrameLoaderTypes.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreDocumentState):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::reloadRevalidatingExpiredKey):
* page/DiagnosticLoggingKeys.h:
* replay/UserInputBridge.cpp:
(WebCore::UserInputBridge::reloadFrame):
* replay/UserInputBridge.h:
* testing/Internals.cpp:
(WebCore::Internals::forceReload):
(WebCore::Internals::reloadExpiredOnly):
Testing support.
* testing/Internals.h:
* testing/Internals.idl:
2017-03-17 Nan Wang <n_wang@apple.com>
AX: VoiceOver no longer works corectly with editable text in the web
https://bugs.webkit.org/show_bug.cgi?id=169801
Reviewed by Chris Fleizach.
The issue is that since we are entering text controls when getting the text marker,
the end text marker of the input tag might associate to the placeholder div instead of
the input tag itself.
Fixed the issue by checking the shadow elements using shadowHost() instead of isShadowRoot().
Also, only enter text controls when navigating by characters/indexes, so that both Mac and
iOS will get the correct text marker ranges for shadow host elements.
Tests: accessibility/ios-simulator/element-text-range-for-text-control.html
accessibility/mac/text-markers-for-input-with-placeholder.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::characterOffsetForIndex):
* accessibility/AXObjectCache.h:
2017-03-17 Wenson Hsieh <wenson_hsieh@apple.com>
[WK1] Support animated transitions when performing a data interaction operation
https://bugs.webkit.org/show_bug.cgi?id=169805
<rdar://problem/31045767>
Reviewed by Beth Dakin and Megan Gardner.
When performing a snapshot excluding the current selection, use ScrollableArea::visibleContentRect to compute
the visible content rect rather than FrameView::visualViewportRect. In WebKit1, the latter will return the
entire content view's bounds.
* page/TextIndicator.cpp:
(WebCore::takeSnapshots):
2017-03-17 Dave Hyatt <hyatt@apple.com>
Initial letter does not paginate properly.
https://bugs.webkit.org/show_bug.cgi?id=169795
<rdar://problem/23715770>
Reviewed by Zalan Bujtas.
Tests: fast/css-generated-content/initial-letter-pagination-raised.html
fast/css-generated-content/initial-letter-pagination-raised-rl.html
fast/css-generated-content/initial-letter-pagination-sunken.html
fast/css-generated-content/initial-letter-pagination-sunken-rl.html
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::FloatingObject):
(WebCore::FloatingObject::copyToNewContainer):
(WebCore::FloatingObject::cloneForNewParent):
(WebCore::FloatingObject::translationOffsetToAncestor):
* rendering/FloatingObjects.h:
(WebCore::FloatingObject::setMarginOffset):
(WebCore::FloatingObject::locationOffsetOfBorderBox):
(WebCore::FloatingObject::marginOffset):
Add the margin offset to the FloatingObject so that we can control the
placement of the border box relative to the margin box without relying
on only the CSS-specified margins. This allows for sunken initial letter
FloatingObjects to be created and propagated out to ancestor blocks for painting
without altering the CSS margins of the sunken letter.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):
Update the logical height for initial letter containers after the initial
letter shifts to the next page, since the lines that follow need to lay out
relative to the initial letter, i.e., they shift down if it shifts down.
(WebCore::RenderBlockFlow::addOverflowFromFloats):
(WebCore::RenderBlockFlow::paintFloats):
(WebCore::RenderBlockFlow::clipOutFloatingObjects):
Patched to use the new helpers on FloatingObject rather than
xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
Updated to set the placement and margins of the floating object before
returning. The initial letter adjustments have been factored out into their
own function.
(WebCore::RenderBlockFlow::adjustInitialLetterPosition):
A helper function called by computeLogicalLocationForFloat that handles
the placement and margin adjustments for initial letters. Note that sunken
letters no longer "hack" the top margin of the child but instead rely on
the fact that the FloatingObject has its own independent margin offset now
that can be set to a value that is distinct from the CSS supplied margin.
(WebCore::RenderBlockFlow::positionNewFloats):
Revised to no longer do the placement, but to let computeLogicalLocationForFloat
do it. The height is still set here however, since we don't know that until after
the child has received a layout.
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
(WebCore::RenderBlockFlow::hitTestFloats):
(WebCore::RenderBlockFlow::adjustForBorderFit):
Patched to use the new FloatingObject helpers rather than
xPositionForFloatIncludingMargins and yPositionForFloatIncludingMargins.
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::setLogicalMarginsForFloat):
New helper function for setting the margin offsets on a FloatingObject.
(WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin): Deleted.
(WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin): Deleted.
Deleted in favor of new FloatingObject helpers.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::isUnsplittableForPagination):
Make initial letter unsplittable as far as pagination is concerned.
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox):
(WebCore::RootInlineBox::includeFontForBox):
(WebCore::RootInlineBox::includeGlyphsForBox):
(WebCore::RootInlineBox::fitsToGlyphs):
Turn off the restriction that you can't fit to vertical glyphs. The numbers returned
are fine now. This allows vertical initial letters to work.
2017-03-17 Youenn Fablet <youenn@apple.com>
RealtimeIncomingAudioSource is not stopping properly
https://bugs.webkit.org/show_bug.cgi?id=169807
Reviewed by Eric Carlson.
Test: webrtc/release-after-getting-track.html
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::stopProducingData):
2017-03-16 Alex Christensen <achristensen@webkit.org>
Use completion handlers instead of return values for sending websocket data
https://bugs.webkit.org/show_bug.cgi?id=169802
Reviewed by Carlos Garcia Campos.
No change in behavior, but this is a baby step towards making things more asynchronous.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::processOutgoingFrameQueue):
(WebCore::WebSocketChannel::sendFrame):
* Modules/websockets/WebSocketChannel.h:
* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::send):
* platform/network/SocketStreamHandle.h:
* platform/network/cf/SocketStreamHandleImpl.h:
2017-03-17 Zan Dobersek <zdobersek@igalia.com>
WebGPU: build fixes for non-Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=169781
Reviewed by Alex Christensen.
Enable building WebGPU code for other ports and fix various build
failures. This still leaves the GPUDevice::platformLayer() method
missing for other ports, as well as the general implementation of
the WebGPU platform abstractions under platform/graphics/gpu/.
* CMakeLists.txt: Move the WebGPU build targets here.
* PlatformMac.cmake:
* html/canvas/WebGPULibrary.h: Explicitly include the WTFString.h
header to suppress missing WTF::String definition errors.
* platform/graphics/gpu/GPUBuffer.cpp:
(WebCore::GPUBuffer::contents): Avoid ambiguous calls to
ArrayBuffer::create() by passing nullptr as the first argument.
* platform/graphics/gpu/GPUDevice.h: Include the Forward.h header
to forward-declare the WTF::String class. Also remove the unused
PlatformGPUDevice typedef for non-Cocoa platforms.
(WebCore::GPUDevice::layer): Move this and the related m_layer
member variable under the PLATFORM(COCOA) guard.
* platform/graphics/gpu/GPUFunction.cpp:
(WebCore::GPUFunction::GPUFunction): Remove the GPULibrary
parameter checks in this no-op constructor that's used on
non-Cocoa platforms.
2017-03-17 Miguel Gomez <magomez@igalia.com>
Follow-up (r213833): write a layout test for 169199
https://bugs.webkit.org/show_bug.cgi?id=169576
<rdar://problem/31024766>
Reviewed by Said Abou-Hallawa.
Add a function to Internals to force the deletion of the ImageDecoder just after
requesting the async decoding of a frame, and implement that behaviour in BitmapImage.
Test: fast/images/clear-animation-decoder.html
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::internalStartAnimation):
* platform/graphics/BitmapImage.h:
* testing/Internals.cpp:
(WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-17 Carlos Garcia Campos <cgarcia@igalia.com>
[Cairo] Handle the blend mode in GraphicsContext::drawPattern
https://bugs.webkit.org/show_bug.cgi?id=169746
Reviewed by Žan Doberšek.
We are not taking into account the blend mode when passing the cairo operator to drawPatternToCairoContext().
This is based on patch by Žan Doberšek, just adding the toCairoOperator changes to make it easier to handle
it. Instead of checking everywhere if blend mode is Normal to decide whether to use toCairoOperator with
CompositeOperator or BlendMode, there's no a single toCairoOperator that receives both parameters, but BlendMode
is optional and defaults to Normal.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::toCairoCompositeOperator):
(WebCore::toCairoOperator):
* platform/graphics/cairo/CairoUtilities.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::setPlatformCompositeOperation):
(WebCore::GraphicsContext::drawPattern):
2017-03-16 Alex Christensen <achristensen@webkit.org>
Fix GTK build.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::readBytes):
Changing RefPtr to Ref broke something.
For the record, EWS was orange so I couldn't see these build failures.
2017-03-16 Alex Christensen <achristensen@webkit.org>
Fix GTK build.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::readBytes):
didFailToReceiveSocketStreamData needs a parameter.
2017-03-16 Dean Jackson <dino@apple.com>
WebGL: Improve index validation when using uint index values
https://bugs.webkit.org/show_bug.cgi?id=169798
Reviewed by Simon Fraser.
Make sure that we test index validation with the correct type.
Also stop using -1 in WebGLBuffer to indicate non-existant values.
Test: fast/canvas/webgl/draw-elements-out-of-bounds-uint-index.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Use optional<> and
unsigned values.
* html/canvas/WebGLBuffer.cpp: Use unsigned for maxIndex (they can't be negative)
and optional<> to indicate unknown value.
(WebCore::WebGLBuffer::getCachedMaxIndex):
(WebCore::WebGLBuffer::setCachedMaxIndex):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative): Use optional<> and
unsigned values.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateVertexAttributes): No need to check if
an unsigned value is less than zero.
2017-03-16 Simon Fraser <simon.fraser@apple.com>
Improve the system tracing points
https://bugs.webkit.org/show_bug.cgi?id=169790
Reviewed by Zalan Bujtas.
Use a more cohesive set of system trace points that give a good overview of what
WebKit is doing. Added points for resource loading, render tree building, sync messages
to the web process, async image decode, WASM and fetching cookies.
* loader/CookieJar.cpp:
(WebCore::cookies):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::logResourceLoaded):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::didCancel):
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::startAsyncDecodingQueue):
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
(WebCore::DisplayRefreshMonitorIOS::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorIOS::displayLinkFired):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::commit):
2017-03-16 Simon Fraser <simon.fraser@apple.com>
RenderView::documentBeingDestroyed() needs a new name.
https://bugs.webkit.org/show_bug.cgi?id=166727
Reviewed by Andreas Kling.
Now that we destroy the render tree for documents going into the page cache, RenderView::documentBeingDestroyed()
is misleadingly named. Rename it to renderTreeBeingDestroyed() and fix all callers.
* page/FrameView.cpp:
(WebCore::FrameView::scheduleRelayoutOfSubtree):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame):
* rendering/CounterNode.cpp:
(WebCore::CounterNode::resetRenderers):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::highQualityRepaintTimerFired):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed):
(WebCore::canMergeContiguousAnonymousBlocks):
(WebCore::RenderBlock::removeChild):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
(WebCore::RenderBlockFlow::removeChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
(WebCore::RenderBox::deleteLineBoxWrapper):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::willBeDestroyed):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::removeChildInternal):
(WebCore::RenderElement::clearLayoutRootIfNeeded):
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
(WebCore::RenderImage::notifyFinished):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyFlushRequired):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::deleteInlineBoxWrapper):
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::attachRegion):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::resetFlowThreadStateOnRemoval):
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
* rendering/RenderObject.h:
(WebCore::RenderObject::renderTreeBeingDestroyed):
(WebCore::RenderObject::documentBeingDestroyed): Deleted.
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::detachQuote):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::attachRegion):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::willBeDestroyed):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::removeChild):
* rendering/RenderTable.h:
(WebCore::RenderTable::setNeedsSectionRecalc):
* rendering/RenderText.cpp:
(WebCore::RenderText::removeAndDestroyTextBoxes):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updatePlayer):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markClientForInvalidation):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::subtreeChildWasAdded):
(WebCore::RenderSVGText::subtreeChildWillBeRemoved):
(WebCore::RenderSVGText::subtreeChildWasRemoved):
(WebCore::RenderSVGText::subtreeStyleDidChange):
2017-03-16 Youenn Fablet <youenn@apple.com>
Wrap legacy WebRTC API in runtime flag
https://bugs.webkit.org/show_bug.cgi?id=169646
Reviewed by Alex Christensen.
Test: webrtc/legacy-api.html
Adding a runtime flag for legacy API.
Making some WebIDL peer connection members runtime-enabled.
Adding a JS private getter on this flag so that overloaded operations behave as promise-based only if flag is turned off.
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnectionInternals.js:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::isWebRTCLegacyAPIEnabled):
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled):
(WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled):
2017-03-16 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Support SPKI/PKCS8 for Elliptic Curve
https://bugs.webkit.org/show_bug.cgi?id=169318
<rdar://problem/31081956>
Reviewed by Brent Fulgham.
This patch adds SPKI/PKCS8 support for Elliptic Curve cryptos. We can now import/export
SPKI/PKCS8 Elliptic Curve keys after this change. Few things to note: 1) This patch
implements a loose DER encoder/decoder for hacking the underlying CommonCrypto library.
2) It only permits id-ecPublicKey as the AlgorithmIdentifier following OpenSSL/Chrome(BoringSSL).
3) It follows OpenSSL/Chrome(BoringSSL) to replace ECParameters in ECPrivateKey with custom
tags. Hence, we should fully comply with OpenSSL/Chrome(BoringSSL).
Tests: crypto/subtle/ec-import-jwk-key-export-pkcs8-key.html
crypto/subtle/ec-import-jwk-key-export-spki-key.html
crypto/subtle/ec-import-pkcs8-key-export-jwk-key.html
crypto/subtle/ec-import-pkcs8-key-export-pkcs8-key-p256.html
crypto/subtle/ec-import-pkcs8-key-export-pkcs8-key-p384.html
crypto/subtle/ec-import-raw-key-export-spki-key.html
crypto/subtle/ec-import-spki-key-export-jwk-key.html
crypto/subtle/ec-import-spki-key-export-raw-key.html
crypto/subtle/ec-import-spki-key-export-spki-key-p256.html
crypto/subtle/ec-import-spki-key-export-spki-key-p384.html
crypto/subtle/ecdh-generate-export-key-spki-p256.html
crypto/subtle/ecdh-generate-export-key-spki-p384.html
crypto/subtle/ecdh-generate-export-pkcs8-p256.html
crypto/subtle/ecdh-generate-export-pkcs8-p384.html
crypto/subtle/ecdh-import-pkcs8-key-p256.html
crypto/subtle/ecdh-import-pkcs8-key-p384.html
crypto/subtle/ecdh-import-spki-key-p256.html
crypto/subtle/ecdh-import-spki-key-p384.html
crypto/workers/subtle/ec-generate-export-pkcs8-key.html
crypto/workers/subtle/ec-generate-export-spki-key.html
crypto/workers/subtle/ec-import-pkcs8-key.html
crypto/workers/subtle/ec-import-spki-key.html
* WebCore.xcodeproj/project.pbxproj:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::importKey):
(WebCore::CryptoAlgorithmECDH::exportKey):
* crypto/gnutls/CryptoKeyECGnuTLS.cpp:
(WebCore::CryptoKeyEC::platformExportRaw):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformExportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportPkcs8):
(WebCore::CryptoKeyEC::exportRaw): Deleted.
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::importSpki):
(WebCore::CryptoKeyEC::importPkcs8):
(WebCore::CryptoKeyEC::exportRaw):
(WebCore::CryptoKeyEC::exportSpki):
(WebCore::CryptoKeyEC::exportPkcs8):
* crypto/keys/CryptoKeyEC.h:
* crypto/mac/CommonCryptoDERUtilities.h: Added.
(WebCore::bytesUsedToEncodedLength):
(WebCore::extraBytesNeededForEncodedLength):
(WebCore::addEncodedASN1Length):
(WebCore::bytesNeededForEncodedLength):
* crypto/mac/CryptoKeyECMac.cpp:
(WebCore::compareBytes):
(WebCore::CryptoKeyEC::platformExportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::getOID):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformExportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportPkcs8):
(WebCore::CryptoKeyEC::exportRaw): Deleted.
Enlarge the robust of exportRaw.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::exportSpki):
(WebCore::CryptoKeyRSA::exportPkcs8):
Enhance the implementation.
(WebCore::bytesUsedToEncodedLength): Deleted.
(WebCore::bytesNeededForEncodedLength): Deleted.
(WebCore::addEncodedASN1Length): Deleted.
Moved to CommonCryptoDERUtilities.h.
2017-03-16 Alex Christensen <achristensen@webkit.org>
Don't use an optional for didReceiveSocketStreamData's length
https://bugs.webkit.org/show_bug.cgi?id=169699
Reviewed by Brady Eidson.
Rather than sending a message with an optional length, send a message with a length
and send a different message if the receiving of bytes failed.
No new tests (no behavior change).
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
* Modules/websockets/WebSocketChannel.h:
* platform/network/SocketStreamHandleClient.h:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::readStreamCallback):
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::readBytes):
2017-03-16 Zalan Bujtas <zalan@apple.com>
Simple line layout: Extend webkit-hyphenate-limit-lines to cover subsequent words.
https://bugs.webkit.org/show_bug.cgi?id=169631
Reviewed by Antti Koivisto.
This patch extends webkit-hyphenate-limit-lines to cover separate words across multiple lines.
Example:
webkit-hyphenate-limit-lines: 1;
"if this line wraps at foo-
bar, the next line should
not hyphenate at all. How-
ever the line after that
could."
Test: fast/text/simple-line-layout-hyphenation-limit-lines-accross-words.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::setHyphenationDisabled):
(WebCore::SimpleLineLayout::LineState::isHyphenationDisabled):
(WebCore::SimpleLineLayout::updateLineConstrains):
(WebCore::SimpleLineLayout::hyphenPositionForFragment):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::createTextRuns):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter): Deleted.
2017-03-16 Zan Dobersek <zdobersek@igalia.com>
[GLib] Add SSLKeyGeneratorGLib.cpp
https://bugs.webkit.org/show_bug.cgi?id=169740
Reviewed by Sergio Villar Senin.
Move the getSupportedKeySizes() and signedPublicKeyAndChallengeString()
functions from TemporaryLinkStubs.cpp to SSLKeyGeneratorGLib.cpp. The
userIdleTime() function can be removed in this process since it's not
used anywhere anymore.
* PlatformGTK.cmake:
* platform/glib/SSLKeyGeneratorGLib.cpp: Renamed from Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp.
(WebCore::getSupportedKeySizes):
(WebCore::signedPublicKeyAndChallengeString):
2017-03-16 Zalan Bujtas <zalan@apple.com>
Stay inside the continuation while searching for a candidate ancestor for insertion.
https://bugs.webkit.org/show_bug.cgi?id=169768
<rdar://problem/30959936>
Reviewed by David Hyatt.
Test: fast/inline/continuation-crash-with-anon-ancestors.html
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildToContinuation):
2017-03-16 Jon Lee <jonlee@apple.com>
Add FIXMEs to update WebRTC
https://bugs.webkit.org/show_bug.cgi?id=169735
Reviewed by Youenn Fablet.
Rearrange order of methods and properties based on the 13 March 2017
version of the WebRTC spec.
* CMakeLists.txt: Add RTCIceTransport and RTCIceTransportState.
* DerivedSources.make:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCDataChannelEvent.idl:
* Modules/mediastream/RTCIceCandidate.idl:
* Modules/mediastream/RTCIceCandidateEvent.idl:
* Modules/mediastream/RTCIceServer.idl:
* Modules/mediastream/RTCIceTransport.cpp: Added.
* Modules/mediastream/RTCIceTransport.idl: Added.
* Modules/mediastream/RTCIceTransport.h: Minor update to rename state to transportState.
(WebCore::RTCIceTransport::state):
(WebCore::RTCIceTransport::setState):
(WebCore::RTCIceTransport::transportState): Deleted.
(WebCore::RTCIceTransport::setTransportState): Deleted.
* Modules/mediastream/RTCIceTransportState.h: Added.
* Modules/mediastream/RTCIceTransportState.idl: Added.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpTransceiver.idl:
* Modules/mediastream/RTCStatsReport.idl:
* WebCore.xcodeproj/project.pbxproj:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged): Refactor.
2017-03-16 Youenn Fablet <youenn@apple.com>
Improve WebRTC track enabled support
https://bugs.webkit.org/show_bug.cgi?id=169727
Reviewed by Alex Christensen.
Tests: webrtc/peer-connection-audio-mute2.html
webrtc/peer-connection-remote-audio-mute.html
webrtc/video-remote-mute.html
Making sure muted/disabled sources produce silence/black frames.
For outgoing audio/video sources, this should be done by the actual a/v providers.
We keep this filtering here until we are sure they implement that.
* platform/audio/mac/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks): Ensuring disabled audio tracks send silence.
Used for outgoing webrtc tracks.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render): Ditto.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData): Ditto.
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame): Generating black frames if muted.
(WebCore::RealtimeIncomingVideoSource::OnFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable): Ensuring we quit after sending black frame.
2017-03-16 Youenn Fablet <youenn@apple.com>
LibWebRTC outgoing source should be thread safe refcounted
https://bugs.webkit.org/show_bug.cgi?id=169726
Reviewed by Alex Christensen.
Preventive fix.
Also fixing the size of the buffer for the audio source as its reserved size is byte count.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2017-03-16 Youenn Fablet <youenn@apple.com>
MediaStreamTrack remote() no longer exists
https://bugs.webkit.org/show_bug.cgi?id=169734
Reviewed by Alex Christensen.
Removing MediaStreamTrack remote.
Removing RealtimeMediaSource::remote as isCaptureSource which is closer to its use in MediaStreamPrivate to
detect whether sources are capture sources or not.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::hasCaptureVideoSource):
(WebCore::MediaStreamPrivate::hasCaptureAudioSource):
(WebCore::MediaStreamPrivate::hasLocalVideoSource): Deleted.
(WebCore::MediaStreamPrivate::hasLocalAudioSource): Deleted.
* platform/mediastream/MediaStreamPrivate.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::stopProducingData):
(WebCore::MediaStreamTrack::remote): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/webaudio/MediaStreamAudioSource.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::hasLocalVideoSource):
(WebCore::MediaStreamPrivate::hasLocalAudioSource):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::isCaptureTrack):
(WebCore::MediaStreamTrackPrivate::remote): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::reset):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::isCaptureSource):
(WebCore::RealtimeMediaSource::remote): Deleted.
(WebCore::RealtimeMediaSource::setRemote): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeVideoSource.h:
2017-03-16 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Crash on debug removing a positioned child
https://bugs.webkit.org/show_bug.cgi?id=169739
Reviewed by Sergio Villar Senin.
When we add or remove a positioned item we don't need to mark
the grid as dirty, because positioned items do not affect the layout
of the grid at all.
This was causing a crash when a positioned item was removed
after a layout. As after the positioned item was removed,
the method RenderGrid::layoutBlock() was not called,
so when the grid was repainted we got a crash.
Test: fast/css-grid-layout/grid-crash-remove-positioned-item.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild): Add early return to avoid marking
the grid as dirty for positioned grid items.
(WebCore::RenderGrid::removeChild): Ditto.
2017-03-16 Carlos Alberto Lopez Perez <clopez@igalia.com>
[WebRTC] SDP sess-id in the "o=" line should be a value between 0 and LLONG_MAX.
https://bugs.webkit.org/show_bug.cgi?id=169681
Reviewed by Alejandro G. Castro.
Use an int64_t type for storing sess-id and ensure that the value generated is always between 0 and LLONG_MAX (2^63-1).
To the JS world (sdp.js) we pass and read this value as a string type.
The JS world (sdp.js) was already using a string type for sess-id.
This caused a bug when reading the sess-id value at configurationFromJSON(): no value was obtained because a numeric type was expected.
So, after this patch, sess-id is passed and read as a string from sdp.js, and converted to an int64_t type for internal use.
This way we also avoid a rounding problem that happens with values near LLONG_MAX when converting from int64_t to double when passed to the JS world,
and that could cause that we end passing a number bigger than LLONG_MAX to sdp.js.
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::configurationFromJSON):
(WebCore::configurationToJSON):
* platform/mediastream/MediaEndpointSessionConfiguration.h:
(WebCore::MediaEndpointSessionConfiguration::sessionId):
(WebCore::MediaEndpointSessionConfiguration::setSessionId):
(WebCore::MediaEndpointSessionConfiguration::MediaEndpointSessionConfiguration):
2017-03-15 Jon Lee <jonlee@apple.com>
Flatten RTC enum naming
https://bugs.webkit.org/show_bug.cgi?id=169664
Reviewed by Youenn Fablet.
Use consistent names of RTC enums throughout WebCore. This means surfacing
ICE enums out of PeerConnectionState. Keep the old names around for other
ports.
Add RTCIceConnectionState, RTCIceGatheringState, and RTCSignalingState enums.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCIceConnectionState.h: Added. The enum is defined in
PeerConnectionStates.h, so just include that file.
* Modules/mediastream/RTCIceConnectionState.idl: Added.
* Modules/mediastream/RTCIceGatheringState.h: Added.
* Modules/mediastream/RTCIceGatheringState.idl: Added.
* Modules/mediastream/RTCSignalingState.h: Added.
* Modules/mediastream/RTCSignalingState.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/PeerConnectionStates.h: Move the existing enums into
WebCore, but keep aliases to the old names within the PeerConnectionStates
namespace.
Refactor to use the new enum names.
* Modules/mediastream/MediaEndpointPeerConnection.cpp: Refactor.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl: Add FIXMEs for bringing this up
to spec.
* Modules/mediastream/RTCIceTransport.h:
* Modules/mediastream/RTCPeerConnection.cpp: Refactor the three functions
below to using the enum instead of returning strings. This allows remove of
the internal* versions of these functions.
(WebCore::RTCPeerConnection::signalingState): Deleted.
(WebCore::RTCPeerConnection::iceGatheringState): Deleted.
(WebCore::RTCPeerConnection::iceConnectionState): Deleted.
* Modules/mediastream/RTCPeerConnection.h: Replace internalSignalingState,
internalIceGatheringState, and internalIceConnectionState.
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.cpp:
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/mock/MockMediaEndpoint.cpp:
* platform/mock/MockMediaEndpoint.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::processIceTransportStateChange):
2017-03-15 Jer Noble <jer.noble@apple.com>
Optionally capture audio in the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=169609
Reviewed by Alex Christensen.
Export some previously un-exported symbols from WebCore for use in WebKit2.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/WebAudioBufferList.h:
* platform/mediastream/RealtimeMediaSource.h:
2017-03-15 Zalan Bujtas <zalan@apple.com>
Do not reparent floating object until after intruding/overhanging dependency is cleared.
https://bugs.webkit.org/show_bug.cgi?id=169711
<rdar://problem/30959743>
Reviewed by Simon Fraser.
This patch ensures that we cleanup the m_floatingObjects for siblings before reparenting the fresh float.
Test: fast/block/float/inline-becomes-float-and-moves-around.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:
(WebCore::RenderElement::noLongerAffectsParentBlock):
2017-03-15 Dean Jackson <dino@apple.com>
Make a base class for WebGL and WebGPU contexts
https://bugs.webkit.org/show_bug.cgi?id=169651
<rdar://problem/31053489>
Reviewed by Simon Fraser.
Add a new pure virtual base class, GPUBasedCanvasRenderingContext, that
will be used by WebGL and WebGPU rendering contexts. This allows us
to avoid some code duplication, since many places treat the two
as the same.
Also rename is3d() -> isWebGL() and isGPU() -> isWebGPU().
* WebCore.xcodeproj/project.pbxproj: New file.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::isGPUBased):
(WebCore::HTMLCanvasElement::getImageData):
(WebCore::HTMLCanvasElement::isGPU): Deleted.
(WebCore::HTMLCanvasElement::is3D): Deleted.
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGL):
(WebCore::CanvasRenderingContext::isWebGPU):
(WebCore::CanvasRenderingContext::isGPUBased):
(WebCore::CanvasRenderingContext::is3d): Deleted.
(WebCore::CanvasRenderingContext::isGPU): Deleted.
* html/canvas/GPUBasedCanvasRenderingContext.h: Added.
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* html/canvas/WebGPURenderingContext.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):
2017-03-15 Daniel Bates <dabates@apple.com>
Iteratively dispatch DOM events after restoring a cached page
https://bugs.webkit.org/show_bug.cgi?id=169703
<rdar://problem/31075903>
Reviewed by Brady Eidson.
Make dispatching of DOM events when restoring a page from the page cache symmetric with
dispatching of events when saving a page to the page cache.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore): Move code to dispatch events from here to FrameLoader::didRestoreFromCachedPage().
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Ensure that no DOM events are dispatched during
restoration of a cached page. Call didRestoreFromCachedPage() after restoring the page to
dispatch DOM events on the restored frames.
(WebCore::FrameLoader::willRestoreFromCachedPage): Renamed; formerly named prepareForCachedPageRestore().
(WebCore::FrameLoader::didRestoreFromCachedPage): Added.
(WebCore::FrameLoader::prepareForCachedPageRestore): Renamed to willRestoreFromCachedPage().
* loader/FrameLoader.h:
* page/FrameTree.cpp:
(WebCore::FrameTree::traverseNextInPostOrderWithWrap): Returns the next Frame* in a post-order
traversal of the frame tree optionally wrapping around to the deepest first child in the tree.
(WebCore::FrameTree::deepFirstChild): Added.
* page/FrameTree.h:
2017-03-15 Dave Hyatt <hyatt@apple.com>
Positioned SVG not sized correctly
https://bugs.webkit.org/show_bug.cgi?id=169693
<rdar://problem/30996893>
Reviewed by Zalan Bujtas.
Test: svg/in-html/rect-positioned.html
Change computeReplacedLogicalHeight to take an estimatedUsedWidth. This
value is used instead of the available logical width to resolve replaced
elements without intrinsic sizes but with aspect ratios set.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeight):
* rendering/RenderBox.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeConstrainedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):
* rendering/RenderReplaced.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::computeReplacedLogicalHeight): Deleted.
* rendering/RenderVideo.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
* rendering/svg/RenderSVGRoot.h:
2017-03-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Using the arrow keys to navigate in the tracks menu also scrolls the page
https://bugs.webkit.org/show_bug.cgi?id=169671
<rdar://problem/31060091>
Reviewed by Eric Carlson.
We need to call preventDefault() when handling a "keydown" event that we recognize.
Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-default-on-keydown.html
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype._handleKeydown):
2017-03-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Tracks menu overlaps controls bar in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=169670
<rdar://problem/31060086>
Reviewed by Eric Carlson.
It used to be that the top of the tracks button was the same as the top of the controls
bar, but that changed when we fixed https://bugs.webkit.org/show_bug.cgi?id=169412. We
now use the top of the controls bar to computed the y-position for the tracks panel.
We are not adding a new test, instead we're unflaking a test that started failing
reliably once we fixed https://bugs.webkit.org/show_bug.cgi?id=169412.
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
2017-03-14 Jon Lee <jonlee@apple.com>
Clean up RTCPeerConnection IDL
https://bugs.webkit.org/show_bug.cgi?id=169660
Reviewed by Youenn Fablet.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver): Refactor to use RTCRtpTransceiverInit.
(WebCore::RTCPeerConnection::completeAddTransceiver):
* Modules/mediastream/RTCPeerConnection.h: Remove redundant definitions.
* Modules/mediastream/RTCPeerConnection.idl: Using 13 March 2017 Editor's Draft of
WebRTC spec. Move RTCOfferAnswerOptions out to separate IDLs. Keep RTCDataChannelInit and
RTCRtpTransceiverInit since they appear to be used only in RTCPeerConnection.
Reorder the properties, functions, and events based on their appearance in the spec.
Legacy MediaStream calls are placed at the end. I tried to use "partial interface" in the
same file, but in the end nothing was generated, so everything is contained in one interface
block.
* Modules/mediastream/RTCEnums.h: Added. This will be an all-in-one header to hold the
enums.
Move RTCAnswerOptions, RTCOfferAnswerOptions, RTCOfferOptions, RTCRtpTransceiverDirection
out to their own IDL's.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCAnswerOptions.h: Added.
* Modules/mediastream/RTCAnswerOptions.idl: Added.
* Modules/mediastream/RTCOfferAnswerOptions.h:
* Modules/mediastream/RTCOfferAnswerOptions.idl: Added.
* Modules/mediastream/RTCOfferOptions.h: Added. Remove |offerToReceiveVideo| and
|offerToReceiveAudio|, which are not used.
* Modules/mediastream/RTCOfferOptions.idl: Added.
* Modules/mediastream/RTCRtpTransceiverDirection.h: Added.
* Modules/mediastream/RTCRtpTransceiverDirection.idl: Added. Use a typedef for
RTCRtpTransceiverDirection to prevent the code generator from prefixing RTCRtpTransceiver.
* Modules/mediastream/RTCRtpTransceiver.idl: Move RTCRtpTransceiverDirection.
* WebCore.xcodeproj/project.pbxproj: Add IDLs and derived sources. Remove unused
HTMLMediaElementMediaStream.h. Reorder.
Refactor.
* Modules/mediastream/RTCRtpTransceiver.h: Use RTCRtpTransceiverDirection.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
2017-03-15 Zan Dobersek <zdobersek@igalia.com>
[GTK] Initialize m_button, m_clickCount members in PlatformMouseEvent constructors
https://bugs.webkit.org/show_bug.cgi?id=169666
Reviewed by Michael Catanzaro.
Initialize the m_button and m_clickCount class members in the GTK+-specific
implementation of PlatformMouseEvent constructors to NoButton and 0,
respectively. The constructors expect to operate on passed-in GTK+ events
that will be able to initialize those two members to some valid values, but
this is not guaranteed.
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
2017-03-15 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Add missing class member initializations
https://bugs.webkit.org/show_bug.cgi?id=169665
Reviewed by Michael Catanzaro.
Zero-initialize the members in various TextureMapper classes
that are missing the proper initialization, as reported by
the Coverity tool.
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
* platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
2017-03-15 Alex Christensen <achristensen@webkit.org>
Compiled content extensions should include the JSON source
https://bugs.webkit.org/show_bug.cgi?id=169643
Reviewed by Geoffrey Garen.
Serializing the JSON string from which a content extension was compiled
to disk with the compiled content extension will allow us to validate content
extensions and automatically migrate older content extensions to new versions.
It less than doubles the size of the compiled content extension on disk, and when
interpreting the bytecode that memory is never read, so it doesn't increase our
dirty memory usage.
Covered by new API tests.
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
2017-03-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Captions do not default to Auto when language is changed
https://bugs.webkit.org/show_bug.cgi?id=169675
<rdar://problem/30423369>
Reviewed by Eric Carlson.
Ensure we correctly mark the Off and Auto items as selected when we are using the
Off and Auto tracks.
Tests: media/modern-media-controls/tracks-support/tracks-support-auto-text-track.html
media/modern-media-controls/tracks-support/tracks-support-off-text-track.html
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.tracksPanelIsTrackInSectionSelected):
(TracksSupport.prototype.tracksPanelSelectionDidChange):
2017-03-15 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213977.
This change broke the Windows build.
Reverted changeset:
"Make a base class for WebGL and WebGPU contexts"
https://bugs.webkit.org/show_bug.cgi?id=169651
http://trac.webkit.org/changeset/213977
2017-03-15 Youenn Fablet <youenn@apple.com>
run-webkit-tests is always creating mock libwebrtc tracks
https://bugs.webkit.org/show_bug.cgi?id=169658
Reviewed by Alex Christensen.
Tests: webrtc/peer-connection-audio-mute.html
webrtc/video-mute.html
Creating real libwebrtc av tracks in case of RealTwoPeerConnections mock factory.
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
* testing/MockLibWebRTCPeerConnection.h:
2017-03-15 Youenn Fablet <youenn@apple.com>
Preventive clean-up: ensure RTCPeerConnection stays valid when calling postTask
https://bugs.webkit.org/show_bug.cgi?id=169661
Reviewed by Alex Christensen.
Protecting the RTCPeerConnection object when calling postTask since it might get collected between the task post
and task run. Also do not send negotiationNeeded event if RTCPeerConnection is closed (covered by added test).
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
2017-03-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Always use six digits to display time when overall media duration is an hour or more
https://bugs.webkit.org/show_bug.cgi?id=169668
<rdar://problem/31059699>
Reviewed by Dean Jackson.
Always use six digits to display times when the overall media duration is an hour or more. This
ensures that we don't display too much white space around labels when we know we will eventually
need six digits to display the full time, but the current time to display is under an hour.
Test: media/modern-media-controls/time-control/time-control-use-six-digits-for-time-labels.html
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.get useSixDigitsForTimeLabels):
(TimeControl.prototype.set useSixDigitsForTimeLabels):
(TimeControl.prototype.set width):
(TimeControl.prototype.get isSufficientlyWide):
(TimeControl.prototype._availableWidthHasChanged):
(TimeControl.prototype.get labelsMayDisplayTimesOverAnHour): Deleted.
(TimeControl.prototype.set labelsMayDisplayTimesOverAnHour): Deleted.
* Modules/modern-media-controls/controls/time-label.js:
(TimeLabel.prototype._formattedTime):
* Modules/modern-media-controls/media/time-labels-support.js:
(TimeLabelsSupport.prototype.syncControl):
(TimeLabelsSupport):
2017-03-15 Dean Jackson <dino@apple.com>
Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=169669
Reviewed by Antoine Quint.
* WebCore.xcodeproj/project.pbxproj:
2017-03-14 Dean Jackson <dino@apple.com>
Make a base class for WebGL and WebGPU contexts
https://bugs.webkit.org/show_bug.cgi?id=169651
<rdar://problem/31053489>
Reviewed by Simon Fraser.
Add a new pure virtual base class, GPUBasedCanvasRenderingContext, that
will be used by WebGL and WebGPU rendering contexts. This allows us
to avoid some code duplication, since many places treat the two
as the same.
Also rename is3d() -> isWebGL() and isGPU() -> isWebGPU().
* WebCore.xcodeproj/project.pbxproj: New file.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::isGPUBased):
(WebCore::HTMLCanvasElement::getImageData):
(WebCore::HTMLCanvasElement::isGPU): Deleted.
(WebCore::HTMLCanvasElement::is3D): Deleted.
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGL):
(WebCore::CanvasRenderingContext::isWebGPU):
(WebCore::CanvasRenderingContext::isGPUBased):
(WebCore::CanvasRenderingContext::is3d): Deleted.
(WebCore::CanvasRenderingContext::isGPU): Deleted.
* html/canvas/GPUBasedCanvasRenderingContext.h: Added.
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* html/canvas/WebGPURenderingContext.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):
2017-03-15 Zan Dobersek <zdobersek@igalia.com>
Unreviewed GTK+ build fix. Sprinkle ENABLE(MEDIA_STREAM) build guards
in the Internals class to avoid compilation failures when building
with this feature disabled.
* testing/Internals.cpp:
(WebCore::Internals::~Internals):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-14 Youenn Fablet <youenn@apple.com>
CanvasCapture should not generate a frame per each canvas draw command
https://bugs.webkit.org/show_bug.cgi?id=169498
Reviewed by Simon Fraser & Eric Carlson.
Test: fast/mediastream/captureStream/canvas2d-heavy-drawing.html
Making Canvas capture be asynchronous.
This ensures that one frame will be created for a set of synchronous draw commands.
In the future, we should find a better approach, like aligning with requestAnimationFrame.
Adding internals observer API for media stream tracks.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* platform/mediastream/RealtimeMediaSource.h:
* testing/Internals.cpp:
(WebCore::Internals::~Internals):
(WebCore::Internals::observeMediaStreamTrack):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-14 Wenson Hsieh <wenson_hsieh@apple.com>
RenderElements should unregister for viewport visibility callbacks when they are destroyed
https://bugs.webkit.org/show_bug.cgi?id=169521
<rdar://problem/30959545>
Reviewed by Simon Fraser.
When registering a RenderElement for viewport visibility callbacks, we always need to make sure that it is unregistered
before it is destroyed. While we account for this in the destructor of RenderElement, we only unregister in the destructor
if we are already registered for visibility callbacks. In the call to RenderObject::willBeDestroyed(), we clear out rare
data, which holds RenderElement's viewport callback registration state, so upon entering the destructor of RenderElement,
we skip unregistration because RenderElement thinks that it is not registered.
We can mitigate this by unregistering the RenderElement earlier, in RenderElement::willBeDestroyed, prior to clearing out
the rare data. However, we'd ideally want to move the cleanup logic out of the destructor altogether and into willBeDestroyed
(see https://bugs.webkit.org/show_bug.cgi?id=169650).
Test: fast/media/video-element-in-details-collapse.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
2017-03-14 Dean Jackson <dino@apple.com>
Rename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
https://bugs.webkit.org/show_bug.cgi?id=169628
<rdar://problems/31047025>
Fix Windows build.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printLayer):
2017-03-14 Andy Estes <aestes@apple.com>
REGRESSION (r209760): Apple Pay doesn't work on sites that specify empty contact fields
https://bugs.webkit.org/show_bug.cgi?id=169639
<rdar://problem/30957789>
Reviewed by Anders Carlsson.
Shipping and billing contact fields are allowed to be empty.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
2017-03-14 Anders Carlsson <andersca@apple.com>
Propagate PassKit errors
https://bugs.webkit.org/show_bug.cgi?id=169633
rdar://problem/31043392
Reviewed by Dean Jackson.
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convert):
(WebCore::convertAndValidate):
* Modules/applepay/PaymentRequest.h:
2017-03-14 Alan Kinsley <zalan@apple.com>
Simple line layout: Adjust hyphenation constrains based on the normal line layout line-breaking logic.
https://bugs.webkit.org/show_bug.cgi?id=169617
Reviewed by Antti Koivisto.
This patch ensures that simple line layout ends up with the same hyphenation context as normal line layout.
Test: fast/text/simple-line-layout-hyphenation-constrains.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::hyphenPositionForFragment): see webkit.org/b/169613
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
* rendering/line/BreakingContext.h: Integral -> fractional.
(WebCore::tryHyphenating):
2017-03-06 Jer Noble <jer.noble@apple.com>
Refactor: Allow WebKit2 to override the creation of RealtimeMediaSources
https://bugs.webkit.org/show_bug.cgi?id=169227
Reviewed by Eric Carlson.
Allow clients of RealtimeMediaSourceCenter to specify a factory for creating
RealtimeMediaSources, to be used by subclasess of RealtimeMediaSourceCenter. Add virtual
methods to retrieve the "default" factories for the RealtimeMediaSourceCenter subclass. The
requires moving the creation of sources up from CaptureDeviceManager into
RealtimeMediaSourceCenterMac, and the addition of factory methods to AVAudioCaptureSource
and AVVideoCaptureSource.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::deviceWithUID):
(CaptureDeviceManager::bestSourcesForTypeAndConstraints): Deleted.
(CaptureDeviceManager::sourceWithUID): Deleted.
* platform/mediastream/CaptureDeviceManager.h:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::setVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::audioFactory):
(WebCore::RealtimeMediaSourceCenter::videoFactory):
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::factory):
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::factory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
(WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
(WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::factory):
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
(WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::factory):
* platform/mock/MockRealtimeVideoSource.h:
2017-03-14 Dean Jackson <dino@apple.com>
Rename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
https://bugs.webkit.org/show_bug.cgi?id=169628
<rdar://problems/31047025>
Reviewed by Simon Fraser.
Rename LayerTypeWebGLLayer to LayerTypeContentsProvidedLayer
and use it for both WebGLLayer and WebGPULayer, to avoid
code duplication.
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::layerTypeForPlatformLayer):
(PlatformCALayerCocoa::PlatformCALayerCocoa):
(PlatformCALayerCocoa::commonInit):
2017-03-13 Jer Noble <jer.noble@apple.com>
Make classes used by Media Stream encode/decode friendly
https://bugs.webkit.org/show_bug.cgi?id=169567
Reviewed by Eric Carlson.
Add encode() and decode() methods and implementations to a variety of media stream related classes.
* platform/audio/mac/CAAudioStreamDescription.h:
(WebCore::CAAudioStreamDescription::encode):
(WebCore::CAAudioStreamDescription::decode):
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::width):
(WebCore::RealtimeMediaSourceSettings::setWidth):
(WebCore::RealtimeMediaSourceSettings::height):
(WebCore::RealtimeMediaSourceSettings::setHeight):
(WebCore::RealtimeMediaSourceSettings::sampleRate):
(WebCore::RealtimeMediaSourceSettings::setSampleRate):
(WebCore::RealtimeMediaSourceSettings::sampleSize):
(WebCore::RealtimeMediaSourceSettings::setSampleSize):
(WebCore::RealtimeMediaSourceSettings::encode):
(WebCore::RealtimeMediaSourceSettings::decode):
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
(WebCore::RealtimeMediaSourceSupportedConstraints::encode):
(WebCore::RealtimeMediaSourceSupportedConstraints::decode):
2017-03-14 Jer Noble <jer.noble@apple.com>
Adapt CARingBuffer to be usable across processes
https://bugs.webkit.org/show_bug.cgi?id=169591
Reviewed by Alex Christensen.
When used with a SharedMemory backing store, storing the pointers to channel data at the beginning
of the channel data itself is problematic: when the SharedMemory is mapped on the far side of the
process boundary, it will not exist at the same memory location as it did on the near side. Instead
of storing these pointers inside the channel data, store them in a small (usually 1 or 2 entry) vector
recreated when the backing store is (re-)allocated.
* platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::CARingBuffer):
(WebCore::CARingBuffer::allocate):
(WebCore::CARingBuffer::deallocate):
(WebCore::ZeroRange):
(WebCore::StoreABL):
(WebCore::FetchABL):
(WebCore::CARingBuffer::store):
(WebCore::CARingBuffer::getCurrentFrameBounds):
(WebCore::CARingBuffer::fetch):
* platform/audio/mac/CARingBuffer.h:
2017-03-14 Jer Noble <jer.noble@apple.com>
Pulling more frames from AudioSampleDataSource than the last push added will always fail.
https://bugs.webkit.org/show_bug.cgi?id=168644
Reviewed by Eric Carlson.
Rather than use the delta between the ring buffer's end time and the last pushed timestamp
(or what is effectively the number of samples in the last push operation) to determine if
there is enough buffered data to satisfy a pull operation, use the ring buffer's actual
buffered duration.
Then, instead of saving the last pushed timestamp, explicitly save the last push count, and
use that data to inform how much to offset the output timestamps (or what is effectively how
much to allow the source to pre-buffer).
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
* platform/audio/mac/AudioSampleDataSource.h:
2017-03-14 Megan Gardner <megan_gardner@apple.com>
Correctly export WebItemProviderPasteboard
https://bugs.webkit.org/show_bug.cgi?id=169578
Reviewed by Tim Horton.
* platform/ios/WebItemProviderPasteboard.h:
2017-03-14 Adrian Perez de Castro <aperez@igalia.com>
Remove redundant check for "firstLine" in RenderBlock::lineHeight()
https://bugs.webkit.org/show_bug.cgi?id=169610
Reviewed by Michael Catanzaro.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lineHeight): Remove test of "firstLine" that
was already checked in the condition for the enclosing if-clause.
2017-03-14 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Fullscreen controls during Live Broadcast is completely broken
https://bugs.webkit.org/show_bug.cgi?id=169354
<rdar://problem/30636370>
Reviewed by Dean Jackson.
When playing a Live Broadcast video in fullscreen, we should not show any scrubbing-related
piece of UI and ensure that we show the status label.
Test: http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen > .controls-bar .status-label):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/media/seek-support.js:
(SeekSupport.prototype.get mediaEvents):
(SeekSupport.prototype.syncControl):
2017-03-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: More accurate Resource Timing data in Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=169577
Reviewed by Youenn Fablet.
* inspector/InspectorNetworkAgent.h:
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didFinishLoading):
Use the ResourceLoader to get the start time that responseEnd is relative to
so we can send the more accurate responseEnd when available.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
Pass ResourceLoader through to Web Inspector in didFinishLoading.
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::copyTimingData):
The differences from the reference start are in Seconds, not milliseconds.
2017-03-14 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Data interaction tests occasionally hit assertions in debug builds
https://bugs.webkit.org/show_bug.cgi?id=169002
<rdar://problem/30994806>
Reviewed by Tim Horton.
Data interaction unit tests occasionally fail due to the UI process expecting the latest received EditorState to
contain post layout data, but finding that it does not in -[WKContentView selectedTextRange]. The incomplete
EditorStates in question are sent while performing a data interaction operation, due to transient changes in the
frame selection. The UI process does not need to (and should not) be informed of these selection changes at all.
We can fix this by preventing the editor client from responding to selection changes during data interaction
operation. This patch also renames setIgnoreCompositionSelectionChange to setIgnoreSelectionChanges to better
reflect the fact that it is used outside of the context of holding selection change updates during IME. We
already use this affordance in various places, such as TextIndicator (while taking a snapshot on iOS), in
FindController on iOS, and when replacing selected or dictated text. Additionally, there is no logic in
setIgnoreCompositionSelectionChange that limits its use to composition.
* editing/Editor.cpp:
(WebCore::Editor::cancelCompositionIfSelectionIsInvalid):
(WebCore::Editor::setComposition):
(WebCore::Editor::revealSelectionAfterEditingOperation):
(WebCore::Editor::setIgnoreSelectionChanges):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::setIgnoreCompositionSelectionChange): Deleted.
* editing/Editor.h:
(WebCore::Editor::ignoreSelectionChanges):
(WebCore::Editor::ignoreCompositionSelectionChange): Deleted.
* editing/mac/EditorMac.mm:
(WebCore::Editor::selectionWillChange):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
2017-03-14 Antoine Quint <graouts@apple.com>
[Modern Media Controls] iOS may attempt to load fullscreen icon variants
https://bugs.webkit.org/show_bug.cgi?id=169608
<rdar://problem/31037369>
Reviewed by Eric Carlson.
Only return fullscreen or compact variants for macOS.
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
2017-03-14 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls are laid out incorrectly with RTL languages
https://bugs.webkit.org/show_bug.cgi?id=169605
<rdar://problem/30975709>
Reviewed by Eric Carlson.
Encorce "direction: ltr" on the controls since the controls layout should not be changed
by the host page's direction.
Test: media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr.html
* Modules/modern-media-controls/controls/controls-bar.css:
(.controls-bar):
2017-03-13 Wenson Hsieh <wenson_hsieh@apple.com>
Make RepaintRegionAccumulator hold a WeakPtr to its root RenderView
https://bugs.webkit.org/show_bug.cgi?id=168480
<rdar://problem/30566976>
Reviewed by Antti Koivisto.
Implements two mitigations to prevent the symptoms of the bug from occurring (see the bugzilla for more details).
Test: editing/execCommand/show-modal-dialog-during-execCommand.html
* editing/EditorCommand.cpp:
(WebCore::Editor::Command::execute):
Do not allow edit commands to execute if the frame's document before and after layout differ (that is, edit commands
triggered by a certain document should not run on a different document).
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
(WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
Turns RepaintRegionAccumulator's reference to its root RenderView into a WeakPtr to gracefully handle the case
where its RenderView is destroyed before RepaintRegionAccumulator's destructor gets a chance to flush the
RenderView's repaint regions.
* rendering/RenderView.h:
2017-03-14 Zan Dobersek <zdobersek@igalia.com>
[GLib] Use USE(GLIB) guards in WebCore/workers/
https://bugs.webkit.org/show_bug.cgi?id=169595
Reviewed by Carlos Garcia Campos.
Utilize the USE(GLIB) build guards in the WorkerRunLoop and WorkerThread
class implementations to guard GLib-specific header inclusions and GLib
API invocations, instead of the more specific PLATFORM(GTK) guards.
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
2017-03-14 Zan Dobersek <zdobersek@igalia.com>
[Soup] Suppress compiler warnings in NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=169593
Reviewed by Carlos Garcia Campos.
Return default-constructed Vector objects in the NetworkStorageSession's
getAllCookies() and getCookies() methods, avoiding compiler warnings.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
2017-03-13 Joseph Pecoraro <pecoraro@apple.com>
Remove unused methods of ResourceRequestBase
https://bugs.webkit.org/show_bug.cgi?id=169579
Reviewed by Youenn Fablet.
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::reportUploadProgress): Deleted.
(WebCore::ResourceRequestBase::setReportUploadProgress): Deleted.
(WebCore::ResourceRequestBase::reportLoadTiming): Deleted.
(WebCore::ResourceRequestBase::setReportLoadTiming): Deleted.
(WebCore::ResourceRequestBase::reportRawHeaders): Deleted.
(WebCore::ResourceRequestBase::setReportRawHeaders): Deleted.
Remove unused code.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
Remove callers of setters that did nothing.
2017-03-13 Youenn Fablet <youenn@apple.com>
Make RealtimeMediaSource::type an enum class
https://bugs.webkit.org/show_bug.cgi?id=169491
Reviewed by Sam Weinig.
No change of behavior.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::getAudioTracks):
(WebCore::MediaStream::getVideoTracks):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::kind):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::bestSourcesForTypeAndConstraints):
(CaptureDeviceManager::sourceWithUID):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::AVAudioCaptureSource):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::createMutedRemoteSource):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
2017-03-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Move paintCurrentFrameInContext from RealtimeMediaSources to MediaPlayer
https://bugs.webkit.org/show_bug.cgi?id=169474
<rdar://problem/30976747>
Reviewed by Youenn Fablet.
Every video capture source has extremely similar code to render the current frame to
a graphics context. Because the media player gets every video sample buffer, have it
hang onto the most recent frame so it can implement paintCurrentFrameInContext directly.
Fix an existing race condition that occasionally caused the readyState to advance to
"have enough data" before a video was ready to paint by defining a MediaStreamTrackPrivate
readyState and observing that.
No new tests, covered by existing tests. These changes uncovered a bug in
fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html, which
was updated.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
(WebCore::CanvasCaptureMediaStreamTrack::Source::paintCurrentFrameInContext): Deleted.
(WebCore::CanvasCaptureMediaStreamTrack::Source::currentFrameImage): Deleted.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
Drive-by change - don't pass status to parent callback, it is a property of the layer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Drive-by cleanup - we don't
use AVSampleBufferRenderSynchronizer so don't fail if it isn't available.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Hang onto new frame,
invalidate cached image, update readyState.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): No more "updatePausedImage".
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Drive-by cleanup - Add an early
return if there is no need for a layer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): renderingModeChanged -> updateRenderingMode.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Minor cleanup.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Renamed from renderingModeChanged,
add a bool return to signal when the mode changes.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): No more m_haveEverPlayed. Update display
mode immediately.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): No more paused image.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Only return HaveNothing, HaveMetadata,
or HaveEnoughData. Don't return HaveEnoughData until all enabled tracks are providing data and never
drop back to HaveMetadata.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode): Renamed from renderingModeChanged.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged): Update intrinsic
size directly.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): No more m_hasReceivedMedia.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::readyStateChanged): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): Reset imagePainter
when active video track changes.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Paint current
frame image.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::CurrentFramePainter::reset): New.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::renderingModeChanged): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSamplesAvailable): Deleted.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::paintCurrentFrameInContext): Deleted.
(WebCore::MediaStreamPrivate::currentFrameImage): Deleted.
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
(WebCore::MediaStreamTrackPrivate::endTrack): Update readyState.
(WebCore::MediaStreamTrackPrivate::clone): Clone readyState.
(WebCore::MediaStreamTrackPrivate::sourceStopped): Update readyState.
(WebCore::MediaStreamTrackPrivate::videoSampleAvailable): Ditto.
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable): Ditto.
(WebCore::MediaStreamTrackPrivate::updateReadyState): New, update readyState and notify observers.
(WebCore::MediaStreamTrackPrivate::paintCurrentFrameInContext): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::paintCurrentFrameInContext): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::currentFrameImage): Deleted.
(WebCore::RealtimeMediaSource::paintCurrentFrameInContext): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(-[WebCoreAVMediaCaptureSourceObserver disconnect]): Drive-by fix - clear m_callback
after calling removeNotificationObservers.
(-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]): Drive-by fix - remove
the correct listener.
(-[WebCoreAVMediaCaptureSourceObserver endSessionInterrupted:]):
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::currentFrameImage): Deleted.
(WebCore::AVVideoCaptureSource::currentFrameCGImage): Deleted.
(WebCore::AVVideoCaptureSource::paintCurrentFrameInContext): Deleted.
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::drawImage): Deleted.
(WebCore::RealtimeIncomingVideoSource::currentFrameImage): Deleted.
(WebCore::RealtimeIncomingVideoSource::paintCurrentFrameInContext): Deleted.
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext): Deleted.
(WebCore::MockRealtimeVideoSource::currentFrameImage): Deleted.
* platform/mock/MockRealtimeVideoSource.h:
2017-03-13 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][SOUP] Fix build after r213877
https://bugs.webkit.org/show_bug.cgi?id=140191
Unreviewed build fix.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookie): Add missing setCookie() declaration.
2017-03-13 Brady Eidson <beidson@apple.com>
WKWebView provides no access to cookies.
https://bugs.webkit.org/show_bug.cgi?id=140191
Reviewed by Tim Horton.
Covered by API tests.
* platform/Cookie.h:
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookie):
(WebCore::NetworkStorageSession::deleteCookie):
(WebCore::nsCookiesToCookieVector):
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::deleteCookie):
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
2017-03-13 Devin Rousso <webkit@devinrousso.com>
Web Inspector: Event Listeners section is missing 'once', 'passive' event listener flags
https://bugs.webkit.org/show_bug.cgi?id=167080
Reviewed by Joseph Pecoraro.
Test: inspector/dom/getEventListenersForNode.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
Add "passive" and "once" values to the EventListener protocol object when applicable.
2017-03-13 John Wilander <wilander@apple.com>
Resource Load Statistics: More efficient network process messaging + Fix bug in user interaction reporting
https://bugs.webkit.org/show_bug.cgi?id=169506
Reviewed by Alex Christensen.
Covered by previous test which now follows the code path more closely to when reporting
happens in the web process.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
No longer explicitly calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
Instead just calls ResourceLoadStatisticsStore::fireDataModificationHandler().
(WebCore::ResourceLoadObserver::logUserInteraction):
Updated to call the new ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
Now takes two vectors – domainsToRemove and domainsToAdd.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::toString):
Added boolean field isMarkedForCookiePartitioning.
(WebCore::ResourceLoadStatistics::merge):
Added boolean field isMarkedForCookiePartitioning.
* loader/ResourceLoadStatistics.h:
Added boolean field isMarkedForCookiePartitioning.
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
Now marks statistics with isMarkedForCookiePartitioning before sending them off to
ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
Now accepts a handler with two vectors.
(WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
Now the only exported version of this function is the one without arguments.
The one internal to WebCore accepts two vectors – domainsToRemove and domainsToAdd.
The exported one generates the two vectors and then calls the internal one.
(WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
No longer explicitly calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
* loader/ResourceLoadStatisticsStore.h:
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
Now takes two vectors – domainsToRemove and domainsToAdd.
2017-03-13 Dean Jackson <dino@apple.com>
Respect the runtime flag for WebGPU, default feature to off.
https://bugs.webkit.org/show_bug.cgi?id=169564
<rdar://problems/31018864>
Reviewed by Tim Horton.
Make sure WebGPU respects its runtime feature flag. Also, since
this implementation doesn't validate content, it should default
to being disabled.
Test: fast/canvas/webgpu/webgpu-runtime-flag.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::getContextWebGPU):
2017-03-13 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
Add new files.
2017-03-13 Chris Dumez <cdumez@apple.com>
Allow termination of background WebProcesses that go over a given CPU usage threshold
https://bugs.webkit.org/show_bug.cgi?id=169456
<rdar://problem/30960968>
Reviewed by Andreas Kling.
Add CPUMonitor utility class to monitor CPU usage and call a provided lambda
whenever the process exceeds the provided CPU limit over a given period of
time.
* WebCore.xcodeproj/project.pbxproj:
* platform/CPUMonitor.cpp: Added.
(WebCore::CPUMonitor::CPUMonitor):
(WebCore::CPUMonitor::setCPULimit):
(WebCore::CPUMonitor::timerFired):
* platform/CPUMonitor.h: Added.
2017-03-13 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Volume icon doesn't turn to mute when the knob is set to 0
https://bugs.webkit.org/show_bug.cgi?id=169553
<rdar://problem/30754543>
Reviewed by Eric Carlson.
When we start changing the volume using the mouse, we record the volume at that point
and as we drag the volume slider, we set the mute button to show that the media is
muted if the volume is 0, and set the actual media volume to be the initial volume
prior to dragging. This way, when we toggle the "muted" property by pressing the
mute button, the original volume is restored.
To function correctly, this required some changed to Slider. The volume slider would
fail to update if the value set was the same as the initial value since we would use
only the "change" event to identify the end of a slider drag interaction. This was
incorrect since if the initial value and the final value while dragging the slider
were the same, no "change" event would be fired. So we now use mouse events to
identify when the slider is being dragged.
Test: media/modern-media-controls/volume-support/volume-support-drag-to-mute.html
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.set value):
(Slider.prototype.handleEvent):
(Slider.prototype._handleMousedownEvent):
(Slider.prototype._handleInputEvent):
(Slider.prototype._handleMouseupEvent):
(Slider.prototype._handleChangeEvent): Deleted.
* Modules/modern-media-controls/controls/volume-slider.js:
(VolumeSlider):
(VolumeSlider.prototype.draw):
(VolumeSlider.prototype.handleEvent): Deleted.
* Modules/modern-media-controls/media/volume-support.js:
(VolumeSupport.prototype.controlValueWillStartChanging):
(VolumeSupport.prototype.controlValueDidChange):
2017-03-13 Per Arne Vollan <pvollan@apple.com>
[Win] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=169546
Reviewed by Brent Fulgham.
There is no matching constructor in the Cookie class.
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::getRawCookies):
2017-03-13 Miguel Gomez <magomez@igalia.com>
ImageDecoder can be deleted while the async decoder thread is still using it
https://bugs.webkit.org/show_bug.cgi?id=169199
Reviewed by Carlos Garcia Campos.
Make the image decoder used by ImageSource and ImageFrameCache into a RefPtr instead of
and unique_ptr, and pass a reference to the decoder thread. This ensures that the decoder
will stay alive as long as the decoding thread is processing frames. Also, stop the async
decoding queue if a new decoder is set to ImageFrameCache.
No new tests.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setDecoder):
(WebCore::ImageFrameCache::decoder):
(WebCore::ImageFrameCache::startAsyncDecodingQueue):
(WebCore::ImageFrameCache::metadata):
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::setDecoder): Deleted.
Moved to source file so we can keep the ImageDecoder forward declaration.
(WebCore::ImageFrameCache::decoder): Deleted.
Moved to source file so we can keep the ImageDecoder forward declaration.
* platform/graphics/ImageSource.h:
* platform/graphics/cg/ImageDecoderCG.h:
(WebCore::ImageDecoder::create):
* platform/graphics/win/ImageDecoderDirect2D.h:
(WebCore::ImageDecoder::create):
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
* platform/image-decoders/ImageDecoder.h:
2017-03-13 Manuel Rego Casasnovas <rego@igalia.com>
Unprefix -webkit-min-content, -webkit-max-content and -webkit-fit-content
https://bugs.webkit.org/show_bug.cgi?id=169195
Reviewed by Sergio Villar Senin.
Based on Blink r200846 by <cbiesinger@chromium.org>.
https://src.chromium.org/viewvc/blink?revision=200846&view=revision
This patch adds support for the unprefixed version of these properties,
while it keeps the prefixed ones working too.
-webkit-fill-available is left out of this change, as the CSS WG
is still defining the final keyword and behavior.
With this patch WebKit will be in the same situation than Blink
regarding these intrinsic sizing keywords (see http://crbug.com/245157).
Test: fast/css-intrinsic-dimensions/height-property-value.html
fast/css-intrinsic-dimensions/width-property-value.html
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::init):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLengthSizing):
(WebCore::StyleBuilderConverter::createGridTrackBreadth):
* css/html.css:
(fieldset):
* css/parser/CSSPropertyParser.cpp:
(WebCore::validWidthOrHeightKeyword):
(WebCore::isGridTrackFixedSized):
(WebCore::consumeGridBreadth):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
2017-03-13 Dean Jackson <dino@apple.com>
WebGPU remote layer hosting
https://bugs.webkit.org/show_bug.cgi?id=169539
<rdar://problem/31005380>
Reviewed by Jon Lee.
Implement the WebProcess side of WebGPULayer hosting,
via LayerTypeWebGPULayer.
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<): Provide nice pretty printing.
* platform/graphics/ca/PlatformCALayer.h: Add LayerTypeWebGPULayer.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Support LayerTypeWebGPULayer.
(PlatformCALayerCocoa::layerTypeForPlatformLayer):
(PlatformCALayerCocoa::PlatformCALayerCocoa):
(PlatformCALayerCocoa::commonInit):
2017-03-13 Zan Dobersek <zdobersek@igalia.com>
Unreviewed GTK+ build fix. Adjust the Cookie constructor
invocation in CookieJarSoup, using empty values for the
newly-added parameters. This should probably be revised
to determine whether meaningful values can be passed in.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::getRawCookies):
2017-03-13 Jon Lee <jonlee@apple.com>
WebGPU: Backend - hosting WebGPU layers
https://bugs.webkit.org/show_bug.cgi?id=169366
<rdar://problem/30928735>
Reviewed by Dean Jackson.
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create): Create the device and the
rendering context.
* platform/graphics/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::commit):
* platform/graphics/cocoa/GPUDrawableMetal.mm:
(WebCore::GPUDrawable::release): Fix a log message
* platform/graphics/gpu/GPUCommandBuffer.cpp:
(WebCore::GPUCommandBuffer::commit): Deleted. Moved to GPUCommandBufferMetal.
* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy): WebGPU canvas should return CanvasAsLayerContents.
2017-03-12 Jon Lee <jonlee@apple.com>
Remove stubs from WebGPU front end
https://bugs.webkit.org/show_bug.cgi?id=169375
Reviewed by Dean Jackson.
Remove stubs and use the back end.
* html/canvas/WebGPUCommandBuffer.cpp:
* html/canvas/WebGPUCommandBuffer.h:
* html/canvas/WebGPUCommandQueue.cpp:
* html/canvas/WebGPUCommandQueue.h:
* html/canvas/WebGPUDepthStencilDescriptor.cpp:
(WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Remove redundant clause.
* html/canvas/WebGPUDepthStencilDescriptor.h:
* html/canvas/WebGPUDepthStencilDescriptor.idl: Remove label property. Not needed yet.
* html/canvas/WebGPUDepthStencilState.cpp:
* html/canvas/WebGPUDepthStencilState.h:
* html/canvas/WebGPUEnums.cpp:
* html/canvas/WebGPUEnums.h:
* html/canvas/WebGPURenderCommandEncoder.cpp:
* html/canvas/WebGPURenderCommandEncoder.h:
* html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
* html/canvas/WebGPURenderPassAttachmentDescriptor.h:
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.h:
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h:
* html/canvas/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::colorAttachments): Uncomment code with GPURenderPassColorAttachmentDescriptor available.
* html/canvas/WebGPURenderPassDescriptor.h:
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h:
* html/canvas/WebGPURenderPipelineDescriptor.cpp:
* html/canvas/WebGPURenderPipelineDescriptor.h:
* html/canvas/WebGPURenderPipelineDescriptor.idl: Remove label property. Not needed yet.
* html/canvas/WebGPURenderPipelineState.cpp:
* html/canvas/WebGPURenderPipelineState.h:
2017-03-12 Dean Jackson <dino@apple.com>
WebGPU Backend
https://bugs.webkit.org/show_bug.cgi?id=169535
<rdar://problem/31002364>
Reviewed by Jon Lee.
Fill in the remainder of the WebGPU backend. This is effectively
a C++ representation of the Metal API.
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGPUDrawable.cpp:
(WebCore::WebGPUDrawable::WebGPUDrawable):
* html/canvas/WebGPUDrawable.h:
(WebCore::GPUDrawable::texture): Deleted.
* platform/graphics/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::platformBuffer):
* platform/graphics/cocoa/GPUCommandBufferMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUFunctionMetal.mm.
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
(WebCore::GPUCommandBuffer::platformCommandBuffer):
(WebCore::GPUCommandBuffer::presentDrawable):
* platform/graphics/cocoa/GPUCommandQueueMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUFunctionMetal.mm.
(WebCore::GPUCommandQueue::GPUCommandQueue):
(WebCore::GPUCommandQueue::label):
(WebCore::GPUCommandQueue::setLabel):
(WebCore::GPUCommandQueue::platformCommandQueue):
* platform/graphics/cocoa/GPUDepthStencilDescriptorMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm.
(WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor):
(WebCore::GPUDepthStencilDescriptor::depthWriteEnabled):
(WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled):
(WebCore::GPUDepthStencilDescriptor::depthCompareFunction):
(WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction):
(WebCore::GPUDepthStencilDescriptor::platformDepthStencilDescriptor):
* platform/graphics/cocoa/GPUDepthStencilStateMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUFunctionMetal.mm.
(WebCore::GPUDepthStencilState::GPUDepthStencilState):
(WebCore::GPUDepthStencilState::label):
(WebCore::GPUDepthStencilState::setLabel):
(WebCore::GPUDepthStencilState::platformDepthStencilState):
* platform/graphics/cocoa/GPUDrawableMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUFunctionMetal.mm.
(WebCore::GPUDrawable::GPUDrawable):
(WebCore::GPUDrawable::release):
(WebCore::GPUDrawable::platformDrawable):
(WebCore::GPUDrawable::platformTexture):
* platform/graphics/cocoa/GPUFunctionMetal.mm:
(WebCore::GPUFunction::GPUFunction):
(WebCore::GPUFunction::platformFunction):
* platform/graphics/cocoa/GPULibraryMetal.mm:
(WebCore::GPULibrary::GPULibrary):
(WebCore::GPULibrary::setLabel):
(WebCore::GPULibrary::platformLibrary):
* platform/graphics/cocoa/GPURenderCommandEncoderMetal.mm: Added.
(WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder):
(WebCore::GPURenderCommandEncoder::setRenderPipelineState):
(WebCore::GPURenderCommandEncoder::setDepthStencilState):
(WebCore::GPURenderCommandEncoder::setVertexBuffer):
(WebCore::GPURenderCommandEncoder::setFragmentBuffer):
(WebCore::GPURenderCommandEncoder::drawPrimitives):
(WebCore::GPURenderCommandEncoder::endEncoding):
(WebCore::GPURenderCommandEncoder::platformRenderCommandEncoder):
* platform/graphics/cocoa/GPURenderPassAttachmentDescriptorMetal.mm: Added.
(WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor):
(WebCore::GPURenderPassAttachmentDescriptor::loadAction):
(WebCore::GPURenderPassAttachmentDescriptor::setLoadAction):
(WebCore::GPURenderPassAttachmentDescriptor::storeAction):
(WebCore::GPURenderPassAttachmentDescriptor::setStoreAction):
(WebCore::GPURenderPassAttachmentDescriptor::setTexture):
(WebCore::GPURenderPassAttachmentDescriptor::platformRenderPassAttachmentDescriptor):
* platform/graphics/cocoa/GPURenderPassColorAttachmentDescriptorMetal.mm: Added.
(WebCore::GPURenderPassColorAttachmentDescriptor::create):
(WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
(WebCore::GPURenderPassColorAttachmentDescriptor::clearColor):
(WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor):
(WebCore::GPURenderPassColorAttachmentDescriptor::platformRenderPassColorAttachmentDescriptor):
* platform/graphics/cocoa/GPURenderPassDepthAttachmentDescriptorMetal.mm: Added.
(WebCore::GPURenderPassDepthAttachmentDescriptor::create):
(WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor):
(WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth):
(WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth):
(WebCore::GPURenderPassDepthAttachmentDescriptor::platformRenderPassDepthAttachmentDescriptor):
* platform/graphics/cocoa/GPURenderPassDescriptorMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUBufferMetal.mm.
(WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor):
(WebCore::GPURenderPassDescriptor::colorAttachments):
(WebCore::GPURenderPassDescriptor::depthAttachment):
(WebCore::GPURenderPassDescriptor::platformRenderPassDescriptor):
* platform/graphics/cocoa/GPURenderPipelineColorAttachmentDescriptorMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPULibraryMetal.mm.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::create):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::platformRenderPipelineColorAttachmentDescriptor):
* platform/graphics/cocoa/GPURenderPipelineDescriptorMetal.mm: Added.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
(WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat):
(WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat):
(WebCore::GPURenderPipelineDescriptor::setVertexFunction):
(WebCore::GPURenderPipelineDescriptor::setFragmentFunction):
(WebCore::GPURenderPipelineDescriptor::colorAttachments):
(WebCore::GPURenderPipelineDescriptor::reset):
(WebCore::GPURenderPipelineDescriptor::platformRenderPipelineDescriptor):
* platform/graphics/cocoa/GPURenderPipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm.
(WebCore::GPURenderPipelineState::GPURenderPipelineState):
(WebCore::GPURenderPipelineState::label):
(WebCore::GPURenderPipelineState::setLabel):
(WebCore::GPURenderPipelineState::platformRenderPipelineState):
* platform/graphics/cocoa/GPUTextureDescriptorMetal.mm:
(WebCore::GPUTextureDescriptor::GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::platformTextureDescriptor):
* platform/graphics/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::platformTexture):
* platform/graphics/gpu/GPUBuffer.cpp:
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUCommandBuffer.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp.
(WebCore::GPUCommandBuffer::create):
(WebCore::GPUCommandBuffer::~GPUCommandBuffer):
(WebCore::GPUCommandBuffer::commit):
(WebCore::GPUCommandBuffer::createRenderCommandEncoder):
(WebCore::GPUCommandBuffer::presentDrawable):
* platform/graphics/gpu/GPUCommandBuffer.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPUCommandQueue.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp.
(WebCore::GPUCommandQueue::create):
(WebCore::GPUCommandQueue::~GPUCommandQueue):
(WebCore::GPUCommandQueue::createCommandBuffer):
(WebCore::GPUCommandQueue::label):
(WebCore::GPUCommandQueue::setLabel):
* platform/graphics/gpu/GPUCommandQueue.h: Copied from Source/WebCore/platform/graphics/gpu/GPULibrary.h.
* platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.cpp.
(WebCore::GPUDepthStencilDescriptor::create):
(WebCore::GPUDepthStencilDescriptor::~GPUDepthStencilDescriptor):
(WebCore::GPUDepthStencilDescriptor::depthWriteEnabled):
(WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled):
(WebCore::GPUDepthStencilDescriptor::depthCompareFunction):
(WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction):
* platform/graphics/gpu/GPUDepthStencilDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPUDepthStencilState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp.
(WebCore::GPUDepthStencilState::create):
(WebCore::GPUDepthStencilState::~GPUDepthStencilState):
(WebCore::GPUDepthStencilState::label):
(WebCore::GPUDepthStencilState::setLabel):
* platform/graphics/gpu/GPUDepthStencilState.h: Copied from Source/WebCore/platform/graphics/gpu/GPULibrary.h.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createCommandQueue):
(WebCore::GPUDevice::getFramebuffer):
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::markLayerComposited):
(WebCore::GPUDevice::createCommandQueue): Deleted.
(WebCore::GPUDevice::getFramebuffer): Deleted.
* platform/graphics/gpu/GPUDrawable.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp.
(WebCore::GPUDrawable::create):
(WebCore::GPUDrawable::~GPUDrawable):
(WebCore::GPUDrawable::release):
* platform/graphics/gpu/GPUDrawable.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPUEnums.h: Copied from Source/WebCore/platform/graphics/cocoa/GPUFunctionMetal.mm.
* platform/graphics/gpu/GPUFunction.h:
* platform/graphics/gpu/GPULibrary.cpp:
* platform/graphics/gpu/GPULibrary.h:
* platform/graphics/gpu/GPURenderCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPULibrary.cpp.
(WebCore::GPURenderCommandEncoder::create):
(WebCore::GPURenderCommandEncoder::~GPURenderCommandEncoder):
(WebCore::GPURenderCommandEncoder::setRenderPipelineState):
(WebCore::GPURenderCommandEncoder::setDepthStencilState):
(WebCore::GPURenderCommandEncoder::setVertexBuffer):
(WebCore::GPURenderCommandEncoder::setFragmentBuffer):
(WebCore::GPURenderCommandEncoder::drawPrimitives):
(WebCore::GPURenderCommandEncoder::endEncoding):
* platform/graphics/gpu/GPURenderCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.cpp.
(WebCore::GPURenderPassAttachmentDescriptor::~GPURenderPassAttachmentDescriptor):
(WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor):
(WebCore::GPURenderPassAttachmentDescriptor::loadAction):
(WebCore::GPURenderPassAttachmentDescriptor::setLoadAction):
(WebCore::GPURenderPassAttachmentDescriptor::storeAction):
(WebCore::GPURenderPassAttachmentDescriptor::setStoreAction):
(WebCore::GPURenderPassAttachmentDescriptor::setTexture):
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUDevice.cpp.
(WebCore::GPURenderPassColorAttachmentDescriptor::create):
(WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
(WebCore::GPURenderPassColorAttachmentDescriptor::~GPURenderPassColorAttachmentDescriptor):
(WebCore::GPURenderPassColorAttachmentDescriptor::clearColor):
(WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor):
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.cpp.
(WebCore::GPURenderPassDepthAttachmentDescriptor::create):
(WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor):
(WebCore::GPURenderPassDepthAttachmentDescriptor::~GPURenderPassDepthAttachmentDescriptor):
(WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth):
(WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth):
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPURenderPassDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp.
(WebCore::GPURenderPassDescriptor::create):
(WebCore::GPURenderPassDescriptor::~GPURenderPassDescriptor):
(WebCore::GPURenderPassDescriptor::depthAttachment):
* platform/graphics/gpu/GPURenderPassDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.cpp.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::~GPURenderPipelineColorAttachmentDescriptor):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat):
(WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat):
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPUTexture.h.
* platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUDevice.cpp.
(WebCore::GPURenderPipelineDescriptor::create):
(WebCore::GPURenderPipelineDescriptor::~GPURenderPipelineDescriptor):
(WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat):
(WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat):
(WebCore::GPURenderPipelineDescriptor::setVertexFunction):
(WebCore::GPURenderPipelineDescriptor::setFragmentFunction):
(WebCore::GPURenderPipelineDescriptor::colorAttachments):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Copied from Source/WebCore/platform/graphics/gpu/GPULibrary.h.
* platform/graphics/gpu/GPURenderPipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPULibrary.cpp.
(WebCore::GPURenderPipelineState::create):
(WebCore::GPURenderPipelineState::~GPURenderPipelineState):
(WebCore::GPURenderPipelineState::label):
(WebCore::GPURenderPipelineState::setLabel):
* platform/graphics/gpu/GPURenderPipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPULibrary.h.
* platform/graphics/gpu/GPUTexture.cpp:
(WebCore::GPUTexture::createFromDrawable):
(WebCore::GPUTexture::createFromExistingTexture): Deleted.
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.cpp:
* platform/graphics/gpu/GPUTextureDescriptor.h:
2017-03-12 Zalan Bujtas <zalan@apple.com>
Simple line layout: Paginated content is not painted properly when font overflows line height.
https://bugs.webkit.org/show_bug.cgi?id=169516
Reviewed by Antti Koivisto.
adjustLineIndexForStruts should take the IndexType::First/Last into account
when searching for the line index in a paginated context.
This also changes the the computed offset height from m_lineHeight to m_ascent + m_descent
so that we can find lines with large fonts (but small line height).
Test: fast/multicol/simple-line-layout-line-index-after-strut.html
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):
(WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
(WebCore::SimpleLineLayout::RunResolver::rangeForRect):
* rendering/SimpleLineLayoutResolver.h:
2017-03-12 Brady Eidson <beidson@apple.com>
Add full NSHTTPCookie fidelity to WebCore::Cookie.
https://bugs.webkit.org/show_bug.cgi?id=169514
Reviewed by Dean Jackson.
No new tests (Refactor, no testable behavior change for now).
* platform/Cookie.h:
(WebCore::Cookie::Cookie):
(WebCore::Cookie::encode):
(WebCore::Cookie::decode):
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::portVectorFromList):
(WebCore::portStringFromVector):
(WebCore::Cookie::Cookie):
(WebCore::Cookie::operator NSHTTPCookie *):
* platform/network/mac/CookieJarMac.mm:
(WebCore::getRawCookies):
2017-03-12 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION (r213764): Async image decoding is disabled for animated images
https://bugs.webkit.org/show_bug.cgi?id=169529
Reviewed by Jon Lee.
The change r213764 causes the animated images to be decoded synchronously
because we were calling frameImageAtIndex() with an empty sizeForDrawing
but with a valid subsamplingLevel. This call is translated to be synchronous
image decoding. The fix is get the current image frame without any decoding.
This is because are sure that in the case of animated image, the current
image frame can not be deleted.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
2017-03-12 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableStreamBYOBRequest respond() (closed stream state)
https://bugs.webkit.org/show_bug.cgi?id=168781
Reviewed by Youenn Fablet.
Implemented ReadableStreamBYOBRequest respond() method in the case of a closed stream.
Added tests related to respond() method and updated WPT imported tests expectations.
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerRespond): Added.
(readableByteStreamControllerRespondInternal): Added.
(readableByteStreamControllerRespondInClosedState): Added.
(readableByteStreamControllerShiftPendingPullInto): Added.
(readableByteStreamControllerInvalidateBYOBRequest): Added.
(readableByteStreamControllerCommitPullIntoDescriptor): Added.
(readableByteStreamControllerConvertPullIntoDescriptor): Added.
(readableStreamFulfillReadIntoRequest): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(respond): Implemented.
2017-03-11 Simon Fraser <simon.fraser@apple.com>
Fix memory estimate for layers supporting subpixel-antialised text
https://bugs.webkit.org/show_bug.cgi?id=169507
rdar://problem/30979337
Reviewed by Alexey Proskuryakov.
Deep color layers on iOS use 5 bytes per pixel, layers supporting subpixel-antialiaed
text on Mac use 8 bytes per pixel.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::backingStoreBytesPerPixel):
2017-03-11 Youenn Fablet <youenn@apple.com>
XMLHttpRequest: make setRequestHeader() use `, ` as separator (including a space)
https://bugs.webkit.org/show_bug.cgi?id=169285
Reviewed by Sam Weinig.
Covered by updated tests.
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::add): Reverting back to ', '.
2017-03-11 Said Abou-Hallawa <sabouhallawa@apple.com>
Enable async image decoding for large images
https://bugs.webkit.org/show_bug.cgi?id=165039
Reviewed by Simon Fraser.
When BitmapImage::draw() is called for a large image, we are going to request async
image decoding for the native image instead of drawing it. If a lower resolution
native image is available for this, it is going to be drawn. Otherwise nothing will
be drawn. In both cases, a repaint will be scheduled for the image observer. This
should improve the image first time paint and the scrolling scenarios. It also makes
the scrolling more responsive by removing the decoding step from the main thread.
For now we are going to disable the asynchronous image decoding for the webkit test
runner because drawing the image does not block the page rendering anymore. An image
can be repainted later when its frame is ready for painting. This can cause a test
to fail because the webkit test runner may capture an image for the page before painting
all the images. The asynchronous image decoding can to be explicitly enabled from
the test page. Once the specs of the image 'async' attribute and 'ready' event is
approved, this should be revisited. It is important to test what we ship and eventually
async image decoding should be enabled in the webkit test runner.
* loader/cache/CachedImage.h: Change the default of LargeImageAsyncDecoding and AnimatedImageAsyncDecoding
to be false. This change fixes a layout test which creates an CachedImage inside an ImageDocument. The
CachedImage in this case does not have a loader so getting the values of these options from the settings
which is false for the DRT/WTR did not happen.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData): ImageSource::hasDecodingQueue() is renamed to ImageSource::hasAsyncDecodingQueue().
(WebCore::BitmapImage::frameImageAtIndex): Use String::utf8().data() instead of String::characters8().
(WebCore::BitmapImage::draw): If drawing the current frame is called while it is being
decoded, draw the current native image if the current frame was decoded but for a
different size and and will not invoke decoding while painting. If the frame is being
decoded and there isn't a decoded frame, return without drawing but set a flag that
that this image needs a repaint.
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Renaming a function.
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Ditto.
(WebCore::BitmapImage::internalStartAnimation): Use String::utf8().data() instead of String::characters8().
(WebCore::BitmapImage::advanceAnimation): Ditto.
(WebCore::BitmapImage::internalAdvanceAnimation): Ditto.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Now this callback can be
called form the ImageFrameCache when finishing a frame of an animated image or the
frame of a large image. For large images, we need to call CachedImage::changedInRect()
if this image needs a repaint. If the decoding queue is idle, we should close it.
(WebCore::BitmapImage::isLargeImageAsyncDecodingRequired): Deleted. Function was renamed.
(WebCore::BitmapImage::isAnimatedImageAsyncDecodingRequired): Deleted. Ditto.
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::~ImageFrameCache): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageFrameCache::decodingQueue): Change the QNS of the decoding thread to be WorkQueue::QOS::Default.
WorkQueue::QOS::UserInteractive causes the scrolling thread to preempted which can make the scrolling choppy.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
(WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): A helper function to tell whether the decoding thread is idle.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::hasAsyncDecodingQueue): Rename this function to be consistent with the rest of the functions.
(WebCore::ImageFrameCache::hasDecodingQueue): Deleted.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::shouldUseAsyncDecoding): Renaming a function. Change the heuristic for large images be
a little bigger than the heuristic for animated images.
(WebCore::ImageSource::isAsyncDecodingRequired): Deleted.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::hasAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageSource::isAsyncDecodingQueueIdle): A wrapper for ImageFrameCache::isAsyncDecodingQueueIdle().
(WebCore::ImageSource::hasDecodingQueue): Deleted.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): CGImageSourceCreateThumbnailAtIndex() returns a CGImage with
the image native size regardless of the subsamplingLevel unless kCGImageSourceSubsampleFactor is passed. Here
we are trying to see which size is smaller: the image native size or the sizeForDrawing. If we want a CGImage
with the image native size, sizeForDrawing will not passed. So we need to get the image native size with the
default subsampling and then compare it with sizeForDrawing.
2017-03-11 Jon Lee <jonlee@apple.com>
WebGPU prototype - Front-End
https://bugs.webkit.org/show_bug.cgi?id=167952
Reviewed by Dean Jackson.
This patch adds all of the relevant front-end files, and builds successfully when
ENABLE(WEBGPU) is off. For the back-end components that are not yet
implemented, a stub was added with a FIXME.
* DerivedSources.make: Add all the new IDL files.
* WebCore.xcodeproj/project.pbxproj: New IDL, front-end and generated files.
JS custom bindings.
* bindings/js/JSDocumentCustom.cpp: Add WebGPU clause for getCSSCanvasContext.
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
* bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp: Added.
* bindings/js/JSWebGPURenderingContextCustom.cpp: Added.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebGPUType):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::isGPU):
(WebCore::HTMLCanvasElement::getContextWebGPU): For release builds, switch to ASSERT_UNUSED.
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isGPU):
.cpp, .h, .idl files, wrapped in WEBGPU conditional, and enabled at runtime.
* html/canvas/WebGPUBuffer:
* html/canvas/WebGPUCommandBuffer:
* html/canvas/WebGPUCommandQueue:
* html/canvas/WebGPUDepthStencilDescriptor:
* html/canvas/WebGPUDepthStencilState:
* html/canvas/WebGPUDrawable:
* html/canvas/WebGPUEnums:
* html/canvas/WebGPUFunction:
* html/canvas/WebGPULibrary:
* html/canvas/WebGPUObject (no IDL):
* html/canvas/WebGPURenderCommandEncoder:
* html/canvas/WebGPURenderPassAttachmentDescriptor:
* html/canvas/WebGPURenderPassColorAttachmentDescriptor:
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor:
* html/canvas/WebGPURenderPassDescriptor:
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor:
* html/canvas/WebGPURenderPipelineDescriptor:
* html/canvas/WebGPURenderPipelineState:
* html/canvas/WebGPURenderingContext:
* html/canvas/WebGPUTexture:
* html/canvas/WebGPUTextureDescriptor: Add stubs.
2017-03-11 Brady Eidson <beidson@apple.com>
Cleanup "addCookie" and its sole user.
https://bugs.webkit.org/show_bug.cgi?id=169486
Reviewed by Brian Burg.
No new tests (Refactor, no behavior change)
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::addCookie): Deleted.
* loader/CookieJar.h:
* platform/Cookie.h:
(WebCore::Cookie::Cookie):
(WebCore::CookieHash::hash):
(WebCore::CookieHash::equal):
(WebCore::Cookie::encode):
(WebCore::Cookie::decode):
* platform/CookiesStrategy.h:
* platform/network/NetworkStorageSession.h:
* platform/network/PlatformCookieJar.h:
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::addCookie): Deleted.
* platform/network/cocoa/CookieCocoa.mm: Copied from Source/WebCore/loader/CookieJar.h.
(WebCore::Cookie::operator NSHTTPCookie *):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm: Copied from Source/WebCore/loader/CookieJar.h.
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::nsCookieStorage):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::addCookie): Deleted.
* platform/network/mac/CookieJarMac.mm:
(WebCore::deleteCookiesForHostnames):
(WebCore::deleteAllCookiesModifiedSince):
(WebCore::addCookie): Deleted.
(WebCore::cookieStorage): Deleted.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::toSoupCookie): Deleted.
(WebCore::addCookie): Deleted.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::toSoupCookie):
(WebCore::NetworkStorageSession::setCookies):
2017-03-10 Alex Christensen <achristensen@webkit.org>
Fix watch and tv builds after r213294
https://bugs.webkit.org/show_bug.cgi?id=169508
Reviewed by Dan Bernstein.
* Configurations/FeatureDefines.xcconfig:
2017-03-10 Dave Hyatt <hyatt@apple.com>
Percentage constrained images shrinking inside blocks inside nested flex boxes
https://bugs.webkit.org/show_bug.cgi?id=169438
Reviewed by Dean Jackson.
Added new test in fast/hidpi.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeChildPreferredLogicalWidths):
Make sure to clear out flexbox override sizes when computing preferred logical widths,
since they should not ever influence the preferred size.
2017-03-10 Youenn Fablet <youenn@apple.com>
Move libwebrtc backend to using tracks
https://bugs.webkit.org/show_bug.cgi?id=169472
Reviewed by Alex Christensen.
Covered by current test sets.
This change allows to move away from streams and use more tracks.
This allows future better alignment with the spec and better implementation of sender/receover/transceiver.
Small refactoring to use more Ref<> in WebRTC track-based code.
Added a notifyAddedTrack to notify the backend that a track was added.
For libwebrtc, this allows calling AddTrack before making the offer.
Updated mock libwebrtc backend accordingly.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::notifyAddedTrack):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::setTrack):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::AddTrack):
(WebCore::MockLibWebRTCPeerConnection::RemoveTrack):
(WebCore::MockLibWebRTCPeerConnection::CreateOffer):
(WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockRtpSender::MockRtpSender):
(WebCore::MockRtpSender::ssrc):
(WebCore::MockRtpSender::media_type):
(WebCore::MockRtpSender::id):
(WebCore::MockRtpSender::stream_ids):
(WebCore::MockRtpSender::GetParameters):
(WebCore::MockRtpSender::SetParameters):
(WebCore::MockRtpSender::GetDtmfSender):
2017-03-10 Zalan Bujtas <zalan@apple.com>
Simple line layout: Check how many orphans needed on the current page before breaking.
https://bugs.webkit.org/show_bug.cgi?id=169477
Reviewed by Antti Koivisto.
Before breaking for the widows we actually need to check for orphans first.
Test: fast/multicol/simple-line-layout-orphans-and-widows.html
* rendering/SimpleLineLayoutPagination.cpp:
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
2017-03-10 Dean Jackson <dino@apple.com>
WebGPU: Backend - Textures and TextureDescriptors
https://bugs.webkit.org/show_bug.cgi?id=169365
<rdar://problem/30928716>
Reviewed by Jon Lee with help from Anders Carlsson.
Backend implementation of textures for WebGPU, which adds
the GPUTexture and GPUTextureDescriptor classes, as well
as a creation method on GPUDevice.
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GPUTextureDescriptorMetal.mm: Added.
(WebCore::GPUTextureDescriptor::GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::width):
(WebCore::GPUTextureDescriptor::setWidth):
(WebCore::GPUTextureDescriptor::height):
(WebCore::GPUTextureDescriptor::setHeight):
(WebCore::GPUTextureDescriptor::sampleCount):
(WebCore::GPUTextureDescriptor::setSampleCount):
(WebCore::GPUTextureDescriptor::textureType):
(WebCore::GPUTextureDescriptor::setTextureType):
(WebCore::GPUTextureDescriptor::storageMode):
(WebCore::GPUTextureDescriptor::setStorageMode):
(WebCore::GPUTextureDescriptor::usage):
(WebCore::GPUTextureDescriptor::setUsage):
(WebCore::GPUTextureDescriptor::platformTextureDescriptor):
* platform/graphics/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::width):
(WebCore::GPUTexture::height):
(WebCore::GPUTexture::platformTexture):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createTexture):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUTexture.cpp:
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::createFromExistingTexture):
(WebCore::GPUTexture::~GPUTexture):
(WebCore::GPUTexture::width):
(WebCore::GPUTexture::height):
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.cpp:
(WebCore::GPUTextureDescriptor::create):
(WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::width):
(WebCore::GPUTextureDescriptor::setWidth):
(WebCore::GPUTextureDescriptor::height):
(WebCore::GPUTextureDescriptor::setHeight):
(WebCore::GPUTextureDescriptor::sampleCount):
(WebCore::GPUTextureDescriptor::setSampleCount):
(WebCore::GPUTextureDescriptor::textureType):
(WebCore::GPUTextureDescriptor::setTextureType):
(WebCore::GPUTextureDescriptor::storageMode):
(WebCore::GPUTextureDescriptor::setStorageMode):
(WebCore::GPUTextureDescriptor::usage):
(WebCore::GPUTextureDescriptor::setUsage):
* platform/graphics/gpu/GPUTextureDescriptor.h:
2017-03-10 Per Arne Vollan <pvollan@apple.com>
[Win] Scrollbars buttons have incorrect size in HiDPI.
https://bugs.webkit.org/show_bug.cgi?id=169463
Reviewed by Alex Christensen.
There seems to be a bug in DrawThemeBackground when the device context is scaled.
We can work around this by scaling the drawing rectangle instead.
* platform/win/ScrollbarThemeWin.cpp:
(WebCore::ScrollbarThemeWin::paintButton):
2017-03-10 Zalan Bujtas <zalan@apple.com>
Simple line layout: Oprhan lines with visual overflow does not work properly.
https://bugs.webkit.org/show_bug.cgi?id=169409
Reviewed by Antti Koivisto.
Add visual overflow checking for block strut. This logic is copied from RenderBlockFlow::adjustLinePositionForPagination.
Covered by existing test.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeOverflow):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutPagination.cpp:
(WebCore::SimpleLineLayout::setPageBreakForLine):
2017-03-09 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Layer content blurry with nested perspective and transforms
https://bugs.webkit.org/show_bug.cgi?id=169457
rdar://problem/29879484
Reviewed by Tim Horton.
We set rasterizationScale on CALayers to the same values as contentsScale, to
avoid blurry layers when CA rasterizes, which often happens with nested perspective
transforms.
However, in UI-side compositing, if the page is not zoomed, we never applied the
rasterizationScale in the UI process. This happened because the PlatformCALayerRemote
constructor set m_properties.contentsScale, but did not set the dirty bit that
triggers the application of contentsScale and rasterizationScale in RemoteLayerTreePropertyApplier.
The fix is to set this dirty bit.
The rest of the changes are for testing. Internals now exposes layerIDForElement()
for returns an internal (non-stable-across-loads) layerID, which can be passed
to UIScriptController.propertiesOfLayerWithID() in the UI process, which inspects
the built layer (UIView) hierarchy. propertiesOfLayerWithID() returns a dictionary
which the test can dump as JSON, or pull values out of.
A few #pragma once cleanups also.
Tests: compositing/ios/basic-layer-properties.html
compositing/ios/rasterization-scale.html
* testing/Internals.cpp:
(WebCore::Internals::layerIDForElement):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r213618.
https://bugs.webkit.org/show_bug.cgi?id=169475
Suspect this is the cause of a large memory regression
(Requested by jonlee_ on #webkit).
Reverted changeset:
"Enable async image decoding for large images"
https://bugs.webkit.org/show_bug.cgi?id=165039
http://trac.webkit.org/changeset/213618
2017-03-10 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-10 Antti Koivisto <antti@apple.com>
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html is unreliable
https://bugs.webkit.org/show_bug.cgi?id=169465
Reviewed by Zalan Bujtas.
It shows all subtests passing but that is a bug. We don't even support all the unit types.
The test occasionally fails when reloading, that failing results are actually the correct ones.
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::SizesAttributeParser):
Ensure we have correct size for the iframe before parsing 'sizes' attribute values. The interpretation of
these may depend on the iframe dimensions.
2017-03-10 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
Unreviewed.
Add some debugging in the hope of understanding why airplay-button.html fails once a day on bots.
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.scheduleLayout):
(const.scheduler.new.prototype.unscheduleLayout):
(const.scheduler.new.prototype._requestFrameIfNeeded):
(const.scheduler.new.prototype._frameDidFire):
(const.scheduler.new.prototype._layout):
2017-03-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213633.
This change caused LayoutTest imported/w3c/web-platform-
tests/html/semantics/embedded-content/the-img-
element/sizes/parse-a-sizes-attribute.html to become a flaky
failure.
Reverted changeset:
"Loading in-body stylesheets should not block rendering of
elements before them"
https://bugs.webkit.org/show_bug.cgi?id=169345
http://trac.webkit.org/changeset/213633
2017-03-09 Alex Christensen <achristensen@webkit.org>
Fix CMake build
* PlatformMac.cmake:
2017-03-09 Alex Christensen <achristensen@webkit.org>
Fix GTK build after r213696
* PlatformMac.cmake:
2017-03-09 Brian Nicholson <bnicholson@mozilla.com> and Alex Christensen <achristensen@webkit.org>
Expose public APIs for content filters
https://bugs.webkit.org/show_bug.cgi?id=150479
Reviewed by Brady Eidson and Geoff Garen.
* English.lproj/Localizable.strings:
2017-03-09 Matt Baker <mattbaker@apple.com>
Web Inspector: Add XHR breakpoints UI
https://bugs.webkit.org/show_bug.cgi?id=168763
<rdar://problem/30952439>
Reviewed by Joseph Pecoraro.
Test: inspector/dom-debugger/xhr-breakpoints.html
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::discardBindings):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
Don't break for XHRs when breakpoints are disabled.
2017-03-09 Michael Saboff <msaboff@apple.com>
Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
https://bugs.webkit.org/show_bug.cgi?id=169387
Reviewed by Filip Pizlo.
Added a forwarding header file for JavScriptCore/runtime/ConfigFile.h.
* ForwardingHeaders/runtime/ConfigFile.h: Added.
2017-03-09 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove statistics data as part of full website data removal
https://bugs.webkit.org/show_bug.cgi?id=169448
Reviewed by Alex Christensen.
Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
The version of this function that takes a modifiedSince parameter
checks if it is equal to or less than the start of the Unix epoch.
If so, it clears the store. This is to support clear all website
data.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
(WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback):
* loader/ResourceLoadStatisticsStore.h:
Added m_writePersistentStoreHandler, a setter for it, and
ResourceLoadStatisticsStore::clearInMemoryAndPersistent().
2017-03-09 Matt Rajca <mrajca@apple.com>
Only consider autoplay interference in the first 10 seconds of playback.
https://bugs.webkit.org/show_bug.cgi?id=169455
Reviewed by Alex Christensen.
If the media duration is relatively long, say, 10 minutes, and you pause 5 minutes in, that's
probably not a strong indication users may not want auto-play. This patch limits interference
events to the first 10 seconds of automatic playback.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
(WebCore::HTMLMediaElement::pageMutedStateDidChange):
* html/HTMLMediaElement.h:
2017-03-09 Brady Eidson <beidson@apple.com>
Add WKURLSchemeHandler API for handling custom protocols.
https://bugs.webkit.org/show_bug.cgi?id=169422
Reviewed by Tim Horton.
* platform/URLParser.cpp:
(WebCore::URLParser::maybeCanonicalizeScheme):
(WebCore::URLParser::isSpecialScheme):
* platform/URLParser.h:
2017-03-09 Dean Jackson <dino@apple.com>
WebGPU: Backend - Buffers
https://bugs.webkit.org/show_bug.cgi?id=169451
<rdar://problem/30959168>
Reviewed by Tim Horton.
Implement the backend for GPUBuffer, which
represents a chunk of memory that can be used
by the GPU. You create one using an ArrayBufferView.
WebKit API Test: GPUBuffer.mm
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::length):
(WebCore::GPUBuffer::contents):
(WebCore::GPUBuffer::platformBuffer):
* platform/graphics/gpu/GPUBuffer.cpp:
(WebCore::GPUBuffer::create):
(WebCore::GPUBuffer::~GPUBuffer):
(WebCore::GPUBuffer::length):
(WebCore::GPUBuffer::contents):
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createBufferFromData):
* platform/graphics/gpu/GPUDevice.h:
2017-03-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Show HTTP protocol version and other Network Load Metrics (IP Address, Priority, Connection ID)
https://bugs.webkit.org/show_bug.cgi?id=29687
<rdar://problem/19281586>
Reviewed by Matt Baker and Brian Burg.
Test: http/tests/inspector/network/resource-metrics.html
* inspector/InspectorNetworkAgent.cpp:
(WebCore::toProtocol):
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
(WebCore::InspectorNetworkAgent::didFinishLoading):
Send metrics at didFinishLoading time, we do not have all of
these at didReceiveResponse time.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* inspector/InspectorNetworkAgent.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
Include or pass on NetworkLoadMetrics to Web Inspector.
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Add new optional metrics properties.
(WTF::Persistence::Coder<std::optional<WebCore::NetworkLoadPriority>>::encode):
(WTF::Persistence::Coder<std::optional<WebCore::NetworkLoadPriority>>::decode):
We never encode this but this is needed for the compiler.
* platform/spi/cocoa/NSURLConnectionSPI.h:
New SPI for NSURLSessionTaskTransactionMetrics details.
2017-03-09 Anders Carlsson <andersca@apple.com>
Use the right conditional.
* Modules/applepay/ApplePayError.idl:
2017-03-09 Daniel Bates <dabates@apple.com>
Guard Credential Management implementation behind a runtime enabled feature flag
https://bugs.webkit.org/show_bug.cgi?id=169364
<rdar://problem/30957425>
Reviewed by Brent Fulgham.
Add a runtime enabled feature flag for Credential Management (disabled by default).
Once we are happy with this feature we can enable the feature by default or remove the
the runtime enabled feature flag so as to enable it by default.
* Modules/credentials/BasicCredential.idl: Enable only if the runtime enabled feature flag is
enabled.
* Modules/credentials/PasswordCredential.idl: Ditto.
* Modules/credentials/SiteBoundCredential.idl: Ditto.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Added.
(WebCore::RuntimeEnabledFeatures::credentialManagementEnabled): Added.
2017-03-09 Anders Carlsson <andersca@apple.com>
Add delegate support to WebCore
https://bugs.webkit.org/show_bug.cgi?id=169427
Part of rdar://problem/28880714.
Reviewed by Geoffrey Garen.
* Configurations/FeatureDefines.xcconfig:
Add feature define.
* DerivedSources.make:
Add idl files.
* Modules/applepay/ApplePayError.cpp:
(WebCore::ApplePayError::create):
(WebCore::ApplePayError::ApplePayError):
(WebCore::ApplePayError::~ApplePayError):
* Modules/applepay/ApplePayError.h:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePayPaymentAuthorizationResult.h:
* Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePayShippingContactUpdate.h:
* Modules/applepay/ApplePayShippingContactUpdate.idl:
* Modules/applepay/ApplePayShippingMethodUpdate.h:
* Modules/applepay/ApplePayShippingMethodUpdate.idl:
Add new files.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::toPaymentAuthorizationStatus):
Move this function to the top.
(WebCore::convertAndValidate):
Add new convertAndValidate functions.
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePaySession.idl:
Implement the old functions in terms of the new functions.
* Modules/applepay/PaymentCoordinator.cpp:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
2017-03-09 Yoav Weiss <yoav@yoav.ws>
[link preload] Double downloads of preloaded CSS
https://bugs.webkit.org/show_bug.cgi?id=169274
Reviewed by Antti Koivisto.
Avoid reloading link preloads in case of a charset mismatch.
Charset mismatch can happen for header based preloads, as they are requested before
the HTML's `<meta charset>` tag is processed. This change makes sure that in those
cases, we modify the resource's encoding setting instead of reloading it.
Test: http/tests/preload/single_download_preload_headers.php
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Initialize m_unknownCharset to be the same as the preload flag.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasUnknownEncoding):
(WebCore::CachedResource::setHasUnknownEncoding):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy): In case of a charset
mismatch, set the encoding of the Resource instead of reloading it if the charset is unknown.
2017-03-09 Jiewen Tan <jiewen_tan@apple.com>
Implement PBKDF2 in WebCrypto
https://bugs.webkit.org/show_bug.cgi?id=143458
<rdar://problem/27311703>
Reviewed by Brent Fulgham.
This patch implements PBKDF2 according to the spec:
https://www.w3.org/TR/WebCryptoAPI/#pbkdf2. Supported
operations include deriveKey, deriveBits, importKey and
getKeyLength.
Tests: crypto/subtle/ecdh-import-key-derive-pbkdf2-key.html
crypto/subtle/pbkdf2-derive-bits-malformed-parametrs.html
crypto/subtle/pbkdf2-import-key-derive-bits.html
crypto/subtle/pbkdf2-import-key-derive-hmac-key.html
crypto/subtle/pbkdf2-import-key-malformed-parameters.html
crypto/subtle/pbkdf2-import-key.html
crypto/workers/subtle/pbkdf2-import-key-derive-bits.html
crypto/workers/subtle/pbkdf2-import-key-derive-hmac-key.html
crypto/workers/subtle/pbkdf2-import-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoKeyCustom.cpp:
(WebCore::JSCryptoKey::algorithm):
Added RawKeyAlgorithm.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
A bit of reordering.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
Faked implementation.
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: Added.
(WebCore::CryptoAlgorithmPBKDF2::create):
(WebCore::CryptoAlgorithmPBKDF2::identifier):
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
(WebCore::CryptoAlgorithmPBKDF2::getKeyLength):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h: Added.
* crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/keys/CryptoKeyRaw.cpp: Added.
(WebCore::CryptoKeyRaw::CryptoKeyRaw):
(WebCore::CryptoKeyRaw::buildAlgorithm):
(WebCore::CryptoKeyRaw::exportData):
* crypto/keys/CryptoKeyRaw.h: Added.
(WebCore::RawKeyAlgorithm::RawKeyAlgorithm):
The CryptoKey class for PBKDF2 and later on HKDF.
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp: Added.
(WebCore::commonCryptoHMACAlgorithm):
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h: Added.
* crypto/parameters/Pbkdf2Params.idl: Added.
2017-03-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] iOS: long press on play button shows the Copy menu
https://bugs.webkit.org/show_bug.cgi?id=169355
<rdar://problem/30928998>
Reviewed by Dean Jackson.
Disable built-in UI behavior that shows a magnifier or a copy callout when pressing
on an element for a long time. These do not make sense for media controls.
Test: media/modern-media-controls/audio/audio-controls-styles.html
* Modules/modern-media-controls/controls/media-controls.css:
(:host):
2017-03-09 Alex Christensen <achristensen@webkit.org>
[Content Extensions] Introduce if-top-url and unless-top-url
https://bugs.webkit.org/show_bug.cgi?id=169433
Reviewed by Brady Eidson.
In r184116 I added if-domain and unless-domain to control whether a rule applies
based on the domain of the main document URL. I'm expanding this by adding if-top-url
and unless-top-url that run regular expressions on the entire main document URL so that
example.com/user1content can be distinguished from example.com/user2content.
To not add to the number of passes we make on the URLs for each load and to maintain JSON
backwards compatibility, I've made it so that if-top-url and unless-top-url can be used
instead of if-domain and unless-domain (which continue to work) but the two condition types
cannot be used together since running regular expressions on the entire main document URL
is strictly more powerful than checking the domain and subdomains.
As a minor detail, content extension regexes are by default ASCII-case-insensitive, so I've
done the same with top URL regexes, adding top-url-filter-is-case-sensitive to mirror the existing
url-filter-is-case-sensitive if the JSON author decides to make regexes case sensitive.
Covered by new API tests.
* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
(WebCore::ContentExtensions::ContentExtension::topURLActions):
(WebCore::ContentExtensions::ContentExtension::cachedConditionedActions): Deleted.
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::addUniversalActionsToDFA):
(WebCore::ContentExtensions::compileToBytecode):
We had three copies of compiling to bytecode that were almost the same and would've been made into three copies of the same code.
I moved them to one helper function that is called three times.
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
Add the new error type for JSON that tries to use if-top-url and unless-top-url with if-domain and unless-domain.
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger):
Parse the new values if-top-url, unless-top-url, and top-url-filter-is-case-sensitive.
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::~Trigger):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithConditions):
* contentextensions/DFABytecodeInterpreter.h:
2017-03-09 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Show individual messages in the content pane for a WebSocket
https://bugs.webkit.org/show_bug.cgi?id=169011
Reviewed by Joseph Pecoraro.
Add walltime parameter.
No new tests. Tests will be added in a follow up patch.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
2017-03-09 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r213628.
Use 'size_t' for the function definition to match the header file. If you do not,
the 32-bit build fails..
* crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp:
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):
2017-03-09 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add a UI delegate hook for custom handling of data interaction operations
https://bugs.webkit.org/show_bug.cgi?id=169430
<rdar://problem/30954654>
Reviewed by Tim Horton.
Ensure that m_documentUnderMouse is properly cleaned up even in the case where no drag operation was performed
due to the drop bailing at the client layer.
* page/DragController.cpp:
(WebCore::DragController::dragEnded):
2017-03-08 Matt Rajca <mrajca@apple.com>
Let clients control autoplay quirks with website policies.
https://bugs.webkit.org/show_bug.cgi?id=169390
Reviewed by Wenson Hsieh.
Added API tests.
Many sites incorrectly assume media will start off playing and display a pause button from the
start. We can trick many of these sites into updating their controls by sending a "pause"
event when we prevent a media element from playing.
We don't want this to become standard web behavior, however, since ultimately sites should adapt
to the new behavior. This patch lets clients decide which limited set of sites gets to use auto-play
quirks.
* html/HTMLMediaElement.cpp:
(WebCore::needsAutoplayPlayPauseEventsQuirk):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::allowsAutoplayQuirks):
(WebCore::DocumentLoader::setAllowsAutoplayQuirks):
2017-03-09 Mark Lam <mark.lam@apple.com>
Make the VM Traps mechanism non-polling for the DFG and FTL.
https://bugs.webkit.org/show_bug.cgi?id=168920
<rdar://problem/30738588>
Reviewed by Filip Pizlo.
No new tests needed. This is covered by existing tests.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
(WebCore::WorkerScriptController::scheduleExecutionTermination):
2017-03-08 Dean Jackson <dino@apple.com>
WebGPU: Backend - Library and Functions
https://bugs.webkit.org/show_bug.cgi?id=169371
<rdar://problem/30928792>
Reviewed by Tim Horton.
Implement the backends for GPULibrary and GPUFunction.
A GPULibrary is created from a GPUDevice, given some
shader source code. You can then extract the GPUFunctions
from the library.
WebKitAPITests: GPULibrary and GPUFunction.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GPUFunctionMetal.mm:
(WebCore::GPUFunction::GPUFunction):
(WebCore::GPUFunction::name):
(WebCore::GPUFunction::platformFunction):
* platform/graphics/cocoa/GPULibraryMetal.mm:
(WebCore::GPULibrary::GPULibrary):
(WebCore::GPULibrary::label):
(WebCore::GPULibrary::setLabel):
(WebCore::GPULibrary::functionNames):
(WebCore::GPULibrary::platformLibrary):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createLibrary):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUFunction.cpp:
(WebCore::GPUFunction::create):
(WebCore::GPUFunction::~GPUFunction):
(WebCore::GPUFunction::GPUFunction):
(WebCore::GPUFunction::name):
* platform/graphics/gpu/GPUFunction.h:
* platform/graphics/gpu/GPULibrary.cpp:
(WebCore::GPULibrary::create):
(WebCore::GPULibrary::~GPULibrary):
(WebCore::GPULibrary::label):
(WebCore::GPULibrary::setLabel):
(WebCore::GPULibrary::functionNames):
(WebCore::GPULibrary::functionWithName):
* platform/graphics/gpu/GPULibrary.h:
2017-03-09 Chris Dumez <cdumez@apple.com>
Align Document.elementFromPoint() with the CSSOM specification
https://bugs.webkit.org/show_bug.cgi?id=169403
Reviewed by Sam Weinig.
Align Document.elementFromPoint() with the CSSOM specification:
- https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
In particular, the parameters should be mandatory and of type double.
The parameters are mandatory in both Firefox and Chrome already. Parameters
are finite floating point in Firefox and integers in Chrome.
Test: fast/dom/elementFromPoint-parameters.html
* dom/DocumentOrShadowRoot.idl:
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementFromPoint):
* dom/TreeScope.h:
2017-03-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Fullscreen controls are difficult to drag around
https://bugs.webkit.org/show_bug.cgi?id=169412
<rdar://problem/30931892>
Reviewed by Eric Carlson.
Up until now, we would simply check that the event target when attempting to
initiate a drag would be the controls bar and not any of its children. This
was not so great as this would encompass also a large margin around the left,
center and right button containers as well as the time labels. We now check
that the event target is anything but an interactive element (<button> or <input>).
The existing test at media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html
has been updated to initiate dragging right between the rewind and play/pause button,
which would fail prior to this patch since this would have hit-tested within the center
button container and thus prevent dragging.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen button.volume-down):
(.media-controls.mac.fullscreen button.volume-up):
(.media-controls.mac.fullscreen button.rewind):
(.media-controls.mac.fullscreen button.play-pause):
(.media-controls.mac.fullscreen button.forward):
(.media-controls.mac.fullscreen .buttons-container.right button):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype._handleMousedown):
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline > .controls-bar button):
* Modules/modern-media-controls/controls/macos-media-controls.css:
(.media-controls.mac > .controls-bar button):
2017-03-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls are not visible in fullscreen without the controls attribute
https://bugs.webkit.org/show_bug.cgi?id=169411
<rdar://problem/30931724>
Reviewed by Eric Carlson.
Ensure we show controls in fullscreen in the absence of the controls attribute.
Tests: media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-parent-element.html
media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get mediaEvents):
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
2017-03-09 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add top level pagination support.
https://bugs.webkit.org/show_bug.cgi?id=169410
<rdar://problem/28536227>
Reviewed by Antti Koivisto.
This patch enables top level pagination for simple line layout.
Covered by existing tests.
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::pushLayoutStateForPagination): Pagination flag needs to be set before calling pushLayoutStateForCurrentFlowThread.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/SimpleLineLayoutPagination.cpp:
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Matching normal line layout values.
(WebCore::SimpleLineLayout::setPageBreakForLine): Logic here matches RenderBlockFlow::adjustLinePositionForPagination
2017-03-09 Tomas Popela <tpopela@redhat.com>
[GStreamer][MSE] Fix 'comparison between signed and unsigned integer
expressions' warning
Reviewed by Žan Doberšek.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::flush):
2017-03-08 Per Arne Vollan <pvollan@apple.com>
Implement stroke-width CSS property.
https://bugs.webkit.org/show_bug.cgi?id=169273
Reviewed by Simon Fraser.
Support setting text stroke width using the CSS property stroke-width, see https://drafts.fxtf.org/paint/.
Text stroke width can currently be set with the -webkit-text-stroke-width property. To make sure this still
works, I added a check to determine if the stroke-width property has been explicitly set. If it has not been
set, we fall back to the value of the -webkit-text-stroke-width property.
Tests: fast/css/stroke-width-percent.html
fast/css/stroke-width.html
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueStrokeWidth):
(WebCore::StyleBuilderCustom::applyValueWebkitTextStrokeWidth):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeOverflow):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::computeTextSelectionPaintStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::computedTextStrokeWidth):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setHasExplicitlySetStrokeWidth):
(WebCore::RenderStyle::hasExplicitlySetStrokeWidth):
(WebCore::RenderStyle::setHasExplicitlySetWebKitTextStrokeWidth):
(WebCore::RenderStyle::hasExplicitlySetWebKitTextStrokeWidth):
(WebCore::RenderStyle::InheritedFlags::operator==):
2017-03-09 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-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] iOS: Live Broadcast video shows scrubber with 00:00 duration until paused
https://bugs.webkit.org/show_bug.cgi?id=169374
<rdar://problem/30063273>
Reviewed by Dean Jackson.
We need to make sure we update the controls layout when they come back from being hidden, so promote
that functionality from MacOSInlineMediaControls to MediaControls so that iOS can pick that behavior
up.
Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label-enabled-hidden-controls-bar.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange): Deleted.
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.controlsBarVisibilityDidChange):
2017-03-08 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Implement SubtleCrypto::DeriveKey method
https://bugs.webkit.org/show_bug.cgi?id=169386
<rdar://problem/23789585>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It implements SubtleCrypto::DeriveKey method according to the spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveKey.
2. It implements getKeyLength operations for AES-CBC, AES-KW, AES-CFB,
AES-GCM, and HMAC, which is needed by the SubtleCrypto::DeriveKey method.
3. It enables ECDH DeriveKey operation.
4. It replaces unigned long with size_t in all the crypto codes.
Tests: crypto/subtle/derive-key-malformed-parameters.html
crypto/subtle/ecdh-import-key-derive-aes-key.html
crypto/subtle/ecdh-import-key-derive-hmac-key-custom-length.html
crypto/subtle/unwrap-key-malformed-parameters.html
crypto/subtle/wrap-key-malformed-parameters.html
crypto/workers/subtle/ecdh-import-key-derive-key.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionSignPromise):
(WebCore::jsSubtleCryptoFunctionVerifyPromise):
(WebCore::jsSubtleCryptoFunctionDigestPromise):
(WebCore::jsSubtleCryptoFunctionDeriveKeyPromise):
(WebCore::jsSubtleCryptoFunctionDeriveBitsPromise):
Remove unnecessary return statement from callbacks.
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::getKeyLength):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::generateKey):
(WebCore::CryptoAlgorithmAES_CFB::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::generateKey):
(WebCore::CryptoAlgorithmAES_GCM::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::getKeyLength):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::getKeyLength):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::getKeyLengthFromHash):
(WebCore::CryptoKeyHMAC::generate):
(WebCore::CryptoKeyHMAC::getKeyLength):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/mac/CryptoAlgorithmECDHMac.cpp:
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):
* crypto/parameters/AesKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/AesKeyGenParams.idl.
* crypto/parameters/CryptoAlgorithmAesKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h.
Rename AesKeyGenParams to AesKeyParams to represent a unified dictionary for AesKeyGenParams and AesDerivedKeyParams.
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
2017-03-08 Wenson Hsieh <wenson_hsieh@apple.com>
Add plumbing for WebCore to notify WebKit2 when an edit drag has concluded
https://bugs.webkit.org/show_bug.cgi?id=169392
<rdar://problem/30882974>
Reviewed by Tim Horton.
Add DragClient::didConcludeEditDrag and invoke it after performing an edit drag in
DragController::performDragOperation.
* page/DragClient.h:
(WebCore::DragClient::didConcludeEditDrag):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
2017-03-08 Matt Baker <mattbaker@apple.com>
Web Inspector: Add DOM breakpoints UI for node/subtree modification events
https://bugs.webkit.org/show_bug.cgi?id=168101
Reviewed by Joseph Pecoraro.
Test: inspector/dom-debugger/dom-breakpoints.html
* inspector/InspectorDOMAgent.h:
Removed declarations for undefined member functions.
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded):
(WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
Check that DebuggerAgent breakpoints are active before breaking.
(WebCore::InspectorDOMDebuggerAgent::clear): Deleted.
Replaced by call to discardBindings.
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
DOMDebugger agent needs to discard bindings when the main frame navigates.
2017-03-08 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Implement ECDH DeriveBits operation
https://bugs.webkit.org/show_bug.cgi?id=169319
<rdar://problem/23789585>
Reviewed by Brent Fulgham.
This patch implements DeriveBits operation of ECDH according to the spec:
https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
Tests: crypto/subtle/derive-bits-malformed-parameters.html
crypto/subtle/ecdh-derive-bits-malformed-parametrs.html
crypto/subtle/ecdh-generate-key-derive-bits.html
crypto/subtle/ecdh-import-key-derive-bits-custom-length.html
crypto/subtle/ecdh-import-key-derive-bits-null-length.html
crypto/workers/subtle/ecdh-import-key-derive-bits.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDeriveKeyPromise):
(WebCore::jsSubtleCryptoFunctionDeriveBitsPromise):
(WebCore::JSSubtleCrypto::generateKey):
Reorder a bit of the functions.
* crypto/CommonCryptoUtilities.h:
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::deriveBits):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):
* crypto/keys/CryptoKeyEC.h:
* crypto/mac/CryptoAlgorithmECDHMac.cpp: Added.
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):
* crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h: Added.
* crypto/parameters/EcdhKeyDeriveParams.idl: Added.
2017-03-08 John Wilander <wilander@apple.com>
Resource Load Statistics: Communicate to the network process which domains to partition
https://bugs.webkit.org/show_bug.cgi?id=169322
<rdar://problem/30768921>
Reviewed by Alex Christensen.
Test: http/tests/loading/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
Now calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler()
to tell the network process the domain has got user interaction.
(WebCore::ResourceLoadObserver::logUserInteraction):
Now calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler()
to tell the network process the domain has got user interaction.
(WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
To allow TestRunner to set a domain for which
partitioning should be applied.
(WebCore::ResourceLoadObserver::primaryDomain):
New overloaded convenience function.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
Now bootstraps the network process' set of known domains to
partition cookies for.
(WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
(WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
(WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
Now tells the network process to start partitioning again
when user interaction ages out.
* loader/ResourceLoadStatisticsStore.h:
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::shouldPartitionCookiesForHost):
(WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
2017-03-08 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Should be able to see where Resources came from (Memory Cache, Disk Cache)
https://bugs.webkit.org/show_bug.cgi?id=164892
<rdar://problem/29320562>
Reviewed by Brian Burg.
Test: http/tests/inspector/network/resource-response-source-disk-cache.html
http/tests/inspector/network/resource-response-source-memory-cache.html
http/tests/inspector/network/resource-response-source-network.html
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setSource): Deleted.
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::setSource):
Make Source mutable to allow it to be set in const methods.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
Set the Response source after a successful memory cache validation
as early as possible so that future copies have up to date info.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::responseSource):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
(WebCore::InspectorNetworkAgent::markResourceAsCached): Deleted.
Eliminate this "markResourceAsCached" path.
Update Response to include required source parameter instead of
optional fromDiskCache parameter.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::markResourceAsCachedImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::markResourceAsCached): Deleted.
* inspector/InspectorNetworkAgent.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
Eliminate this "markResourceAsCached" call because the later delegate
messages will include this information.
2017-03-08 Chris Dumez <cdumez@apple.com>
Drop support for non-standard document.all.tags()
https://bugs.webkit.org/show_bug.cgi?id=169337
Reviewed by Sam Weinig.
Drop support for non-standard document.all.tags(). It is not part of the specification:
- https://html.spec.whatwg.org/multipage/infrastructure.html#the-htmlallcollection-interface
It is not supported by Firefox and its support was dropped from Chrome back in early 2014:
- https://src.chromium.org/viewvc/blink?view=revision&revision=166870
No new tests, updated existing test.
* html/HTMLAllCollection.cpp:
* html/HTMLAllCollection.h:
* html/HTMLAllCollection.idl:
2017-03-08 Said Abou-Hallawa <sabouhallawa@apple.com>
Enable async image decoding for large images
https://bugs.webkit.org/show_bug.cgi?id=165039
Reviewed by Simon Fraser.
Once FrameView finishes flushing compositing, it will request all its
images, which intersect with the tileCoverageRect (aka the futureRect)
of the TileController, to start asynchronously decoding their image frames.
This should improve the image first time paint and the scrolling scenarios.
It also makes the scrolling more responsive by removing the decoding step
from the main thread.
For now we are going to disable the asynchronous image decoding for the
webkit test runner because drawing the image does not block the page rendering
anymore. An image can be repainted later when its frame is ready for painting.
This can cause a test to fail because the webkit test runner may capture
an image for the page before painting all the images. The asynchronous image
decoding can to be explicitly enabled from the test page. Once the specs
of the image 'async' attribute and 'ready' event is approved, this should
be revisited. It is important to test what we ship and eventually async
image decoding should be enabled in the webkit test runner.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didAttachRenderers):
(WebCore::HTMLImageElement::willDetachRenderers):
Register/unregister the renderer of the HTMLImageElement for async image decoding
from the RenderView. I followed what HTMLMediaElement to registerForVisibleInViewportCallback().
* html/HTMLImageElement.h:
* page/FrameView.cpp:
(WebCore::FrameView::flushCompositingStateForThisFrame): For all the images inside
the tileCoverageRect of the TileController, request async image decoding.
(WebCore::FrameView::applyRecursivelyWithAbsoluteRect): Request the async image decoding for the
the images inside this FrameView and then recursively do the same thing for all sub FrameViews.
(WebCore::FrameView::requestAsyncDecodingForImagesInAbsoluteRect): Calls the RenderView to
make the request.
(WebCore::FrameView::requestAsyncDecodingForImagesInAbsoluteRectIncludingSubframes): Calls
applyRecursivelyWithAbsoluteRect giving an apply lambda which calls requestAsyncDecodingForImagesInAbsoluteRect.
* page/FrameView.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData): ImageSource::hasDecodingQueue() is renamed to ImageSource::hasAsyncDecodingQueue().
(WebCore::BitmapImage::dataChanged): Use String::utf8().data() instead of String::characters8().
(WebCore::BitmapImage::draw): If drawing the current frame is called while it is being
decoded, draw the the image if the current frame was decoded but for a different size
and and will not invoke decoding while painting. If the frame is being decoded and there
isn't a decoded frame, return without drawing but set a flag that that this image needs
a repaint.
(WebCore::BitmapImage::internalStartAnimation): Use String::utf8().data() instead of String::characters8().
(WebCore::BitmapImage::advanceAnimation): Ditto.
(WebCore::BitmapImage::internalAdvanceAnimation): Ditto.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Now this callback can be
called form the ImageFrameCache when finishing a frame of an animated image or the
frame of a large image. For large images, we need to call CachedImage::changedInRect()
if this image needs a repaint. If the decoding queue is idle, we should close it.
(WebCore::BitmapImage::requestAsyncDecoding): This is called form
RenderView::requestAsyncDecodingForImagesInRect().
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::requestAsyncDecoding): Add the default implementation of a virtual function.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::~ImageFrameCache): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageFrameCache::decodingQueue): Change the QNS of the decoding thread to be WorkQueue::QOS::Default.
WorkQueue::QOS::UserInteractive causes the scrolling thread to preempted which can make the scrolling choppy.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
(WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): A helper function to tell whether the decoding thread is idle.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::hasAsyncDecodingQueue): Rename this function to be consistent with the rest of the functions.
(WebCore::ImageFrameCache::hasDecodingQueue): Deleted.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::hasAsyncDecodingQueue): hasDecodingQueue() was renamed to hasAsyncDecodingQueue().
(WebCore::ImageSource::isAsyncDecodingQueueIdle): A wrapper for ImageFrameCache::isAsyncDecodingQueueIdle().
(WebCore::ImageSource::hasDecodingQueue): Deleted.
* platform/graphics/TiledBacking.h: Fix a comment. tileGridExtent() is the only one that is used for testing.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::intersectsAbsoluteRect): Make this function does what shouldRepaintForImageAnimation()
was doing expect the check for document.activeDOMObjectsAreSuspended().
(WebCore::RenderElement::newImageAnimationFrameAvailable): Replace the call to
shouldRepaintForImageAnimation() by checking document().activeDOMObjectsAreSuspended() then a call to
RenderElement::intersectsAbsoluteRect().
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Ditto.
(WebCore::RenderElement::registerForAsyncImageDecodingCallback): Call the RenderView to register the renderer..
(WebCore::RenderElement::unregisterForAsyncImageDecodingCallback): Call the RenderView to unregister the renderer..
(WebCore::shouldRepaintForImageAnimation): Deleted.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setIsRegisteredForAsyncImageDecodingCallback):
* rendering/RenderObject.h:
(WebCore::RenderObject::isRegisteredForAsyncImageDecodingCallback):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
Mark/unmark the renderer for being RegisteredForAsyncImageDecodingCallback.
* rendering/RenderReplaced.h: Make intrinsicSize() be a public function.
* rendering/RenderView.cpp:
(WebCore::RenderView::registerForAsyncImageDecodingCallback): Register a renderer for async image decoding.
(WebCore::RenderView::unregisterForAsyncImageDecodingCallback): Remove a renderer from the list of async image decoding.
(WebCore::RenderView::requestAsyncDecodingForImagesInAbsoluteRect):This loops through all the registered RenderImages
inside this RenderView and if any of them intersects with the rectangle, requestAsyncDecoding for it.
* rendering/RenderView.h:
2017-03-08 Michael Catanzaro <mcatanzaro@igalia.com>
Fix missing return value after r213499
https://bugs.webkit.org/show_bug.cgi?id=168198
Reviewed by Myles C. Maxfield.
* platform/text/CharacterProperties.h:
(WebCore::isEmojiGroupCandidate):
2017-03-08 Wenson Hsieh <wenson_hsieh@apple.com>
Add TextIndicator support for providing a snapshot excluding selected content
https://bugs.webkit.org/show_bug.cgi?id=169309
<rdar://problem/30883525>
Reviewed by Tim Horton.
Work towards <rdar://problem/30882974>. Adds support in TextIndicator to include a snapshot of all visible
content, excluding nodes captured in the current selection. This comes in the form of the new
TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection flag -- see per-method changes for more details.
No new tests, since there is no change in behavior yet.
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/FrameSnapshotting.h:
Introduce a new snapshot option flag, SnapshotOptionsPaintEverythingExcludingSelection.
(WebCore::snapshotFrameRectWithClip):
* page/TextIndicator.cpp:
If TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection is turned on, capture and include a
snapshot of the visible bounds of the frame.
(WebCore::takeSnapshot):
(WebCore::takeSnapshots):
(WebCore::initializeIndicator):
* page/TextIndicator.h:
Introduce TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthOfTextRange):
* platform/graphics/FontCascade.h:
Teach FontCascade to retrieve the width of a range in a TextRun, and also compute the widths of the TextRun
before and after the range. This is used by InlineTextBox to compute the painting rect to clip out when skipping
text decorations for the selected region of the TextRun.
* rendering/InlineTextBox.cpp:
Teach InlineTextBox to respect PaintBehaviorExcludeSelection. When painting text, if this paint behavior is
used, we will not paint the portion of the text run that lies inside the range determined by selectionStartEnd().
Similarly, when painting text decorations, we exclude the rect surrounding the selected content.
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintDecoration):
* rendering/InlineTextBox.h:
* rendering/PaintPhase.h:
Introduce PaintBehaviorExcludeSelection, used to inform members of the render tree not to paint portions that
lie within the current selection range.
* rendering/RenderLayer.cpp:
Propagate the PaintBehaviorExcludeSelection flag to children when painting.
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::shouldPaint):
Teach RenderReplaced to respect PaintBehaviorExcludeSelection by bailing from painting if it is selected and the
paint behavior is enabled.
* rendering/TextDecorationPainter.h:
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextSelectionPaintStyle):
* rendering/TextPaintStyle.h:
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintText):
* rendering/TextPainter.h:
2017-03-08 Youenn Fablet <youenn@apple.com>
Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
https://bugs.webkit.org/show_bug.cgi?id=169389
Reviewed by Eric Carlson.
Temporary fix to support appr.tc web site.
A future patch should allow to set MaxBundle.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration):
2017-03-08 Chris Dumez <cdumez@apple.com>
Drop select.remove() / options.remove() overloads taking an option element in parameter
https://bugs.webkit.org/show_bug.cgi?id=169339
Reviewed by Sam Weinig.
Drop select.remove() / options.remove() overloads taking an option element in parameter.
It is non-standard:
- https://html.spec.whatwg.org/multipage/forms.html#the-select-element
- https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection
It is not supported by Firefox and was removed from Chrome:
- https://bugs.chromium.org/p/chromium/issues/detail?id=345697
- https://bugs.chromium.org/p/chromium/issues/detail?id=398627
Chrome UseCounter data shows consistent 0% usage:
- https://www.chromestatus.com/metrics/feature/timeline/popularity/398
Test: fast/dom/HTMLSelectElement/remove-option-element.html
* html/HTMLOptionsCollection.cpp:
* html/HTMLOptionsCollection.h:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
* html/HTMLSelectElement.idl:
2017-03-08 Chris Dumez <cdumez@apple.com>
Parameter to input.setCustomValidity() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=169332
Reviewed by Sam Weinig.
Parameter to input.setCustomValidity() should not be nullable:
- https://html.spec.whatwg.org/#htmlinputelement
Firefox and Chrome agree with the specification so the change
should be safe.
Test: fast/forms/setCustomValidity-null-parameter.html
* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
2017-03-08 Simon Fraser <simon.fraser@apple.com>
Support transitions/animations of background-position with right/bottom-relative values
https://bugs.webkit.org/show_bug.cgi?id=162048
Reviewed by Dean Jackson.
Re-landing r206713.
Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px"
work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending.
Also improve logging of calculated lengths, and better animation logging for FillLayer properties.
Test: transitions/background-position-transitions.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID
around so logging can use it.
(WebCore::FillLayerAnimationPropertyWrapperBase::property):
(WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter):
(WebCore::FillLayerPropertyWrapperGetter::value):
(WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
(WebCore::createCalculatedLength):
(WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
(WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
(WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging
can show the result.
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionNumber::dump):
(WebCore::CalcExpressionBinaryOperation::dump):
(WebCore::CalcExpressionLength::dump):
(WebCore::CalcExpressionBlendLength::dump):
(WebCore::operator<<):
* platform/CalculationValue.h:
* platform/Length.cpp:
(WebCore::operator<<):
2017-03-08 Anders Carlsson <andersca@apple.com>
Simplify the PaymentCoordinator interface
https://bugs.webkit.org/show_bug.cgi?id=169382
Part of rdar://problem/28880714.
Reviewed by Tim Horton.
Add four new structs: PaymentAuthorizationResult, PaymentMethodUpdate, ShippingContactUpdate and ShippingMethodUpdate.
Change the various PaymentCoordinator and PaymentCoordinatorClient functions to take these new objects instead of multiple parameters.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::ApplePaySession::didSelectShippingContact):
* Modules/applepay/PaymentAuthorizationStatus.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentRequest.h:
* loader/EmptyClients.cpp:
2017-03-08 Simon Fraser <simon.fraser@apple.com>
Change determineNonLayerDescendantsPaintedContent to max out based on renderers traversed
https://bugs.webkit.org/show_bug.cgi?id=169384
Reviewed by Zalan Bujtas.
determineNonLayerDescendantsPaintedContent() would bail after depth 3, sibling count 20. However,
empirical testing shows that it would run to completion more often if the limit was based on the
number of nodes traversed (in particular, it's common to see fairly deep subtrees with few siblings).
Running to completion has huge memory advantages, because we can then be sure to have checked all the
renderers for smoothed text, allowing us, on some pages, to avoid the extra memory cost of using
layers that support subpixel-antialiased text.
Performance measurement shows that mean runtime of this function goes up from 0.30us to 0.34us
with a 200 renderer limit, which seems worthwhile.
Test: compositing/contents-format/subpixel-antialiased-text-traversal.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
2017-03-08 Youenn Fablet <youenn@apple.com>
Support canvas captureStream
https://bugs.webkit.org/show_bug.cgi?id=169192
Reviewed by Dean Jackson.
Tests: fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-clone-track.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-creation.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-exceptions.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-imagebitmaprenderingcontext.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-offscreencanvas.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html
fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html
Adding canvas captureStream as defined in https://w3c.github.io/mediacapture-fromelement/#html-canvas-element-media-capture-extensions
This allows creating a video MediaStreamTrack fed by canvas taken frames.
Frames are produced when canvas get changed.
Tests taken from Chromium.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: Added.
(WebCore::CanvasCaptureMediaStreamTrack::create):
(WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
(WebCore::CanvasCaptureMediaStreamTrack::Source::create):
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
(WebCore::CanvasCaptureMediaStreamTrack::Source::stopProducingData):
(WebCore::CanvasCaptureMediaStreamTrack::Source::requestFrameTimerFired):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
(WebCore::CanvasCaptureMediaStreamTrack::Source::paintCurrentFrameInContext):
(WebCore::CanvasCaptureMediaStreamTrack::Source::currentFrameImage):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h: Added.
(isType):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.idl: Added.
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::isCanvas):
* Modules/mediastream/MediaStreamTrack.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toMediaSample):
(WebCore::HTMLCanvasElement::captureStream):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::clear):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::drawArraysInstanced):
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::toBGRAData):
* platform/graphics/ImageBuffer.h:
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::releaseUint8Vector):
(WebCore::MediaSampleAVFObjC::createImageSample):
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::transferData):
(WebCore::ImageBufferData::toBGRAData):
* platform/graphics/cg/ImageBufferDataCG.h:
2017-03-07 Anders Carlsson <andersca@apple.com>
Use the new code path when dragging web contents
https://bugs.webkit.org/show_bug.cgi?id=169298
Reviewed by Beth Dakin.
* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelection):
Add a new function that writes the selection to a writer object.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Use the new writeSelection if mustUseLegacyDragClient is false.
* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::WebContent::WebContent):
(WebCore::PasteboardWriterData::WebContent::~WebContent):
(WebCore::PasteboardWriterData::setWebContent):
* platform/PasteboardWriterData.h:
Add getters and setters.
* platform/mac/PasteboardWriter.mm:
(WebCore::toUTIUnlessAlreadyUTI):
Add a helper.
(WebCore::createPasteboardWriter):
Convert web content to pasteboard types.
2017-03-08 Dave Hyatt <hyatt@apple.com>
CSS Multicolumn should not clip columns horizontally
https://bugs.webkit.org/show_bug.cgi?id=169363
Reviewed by Sam Weinig.
Revised multiple tests in fast/multicol.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
Stop clipping horizontally. Section 8.1 of the spec changed from "clip" to "don't clip",
so we're changing to match the latest draft. Keep iBooks-based pagination clipping though.
2017-03-08 Simon Fraser <simon.fraser@apple.com>
Add support for history.scrollRestoration
https://bugs.webkit.org/show_bug.cgi?id=147782
rdar://problem/22614568
Reviewed by Sam Weinig.
Add support for history.scrollRestoration, per spec:
<https://html.spec.whatwg.org/multipage/browsers.html#dom-history-scroll-restoration>
This is a new attribute on the History interface. On setting, sets the "shouldRestoreScrollPosition"
state on the current history item, and the getter returns that state. pushState() inherits the
state from the current item.
HistoryController::restoreScrollPositionAndViewState() consults this state, and if set to "manual"
("don't restore) it just uses the current scroll position (we need something to pass to
setPageScaleFactor() so can't just avoid the restoration).
FrameLoader::scrollToFragmentWithParentBoundary() also needs to consult the historyItem
to know if it's OK to scroll to a fragment, on back/forward same-document loads.
Tests: fast/history/history-scroll-restoration-attribute.html
fast/history/history-scroll-restoration.html
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::shouldRestoreScrollPosition):
(WebCore::HistoryItem::setShouldRestoreScrollPosition):
* history/HistoryItem.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::itemAllowsScrollRestoration):
(WebCore::isSameDocumentReload):
(WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState):
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* page/History.cpp:
(WebCore::History::scrollRestoration):
(WebCore::History::setScrollRestoration):
* page/History.h:
* page/History.idl:
2017-03-08 Chris Dumez <cdumez@apple.com>
[iOS] Throttle DOM timers to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169213
<rdar://problem/30876965>
Reviewed by Simon Fraser.
Throttle and align DOM timers to ~30fps in low power mode on iOS
to save battery.
Test: fast/dom/timer-throttling-lowPowerMode.html
* page/DOMTimer.h:
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::updateDOMTimerAlignmentInterval):
2017-03-08 Chris Dumez <cdumez@apple.com>
Update outdated comment about HTMLElement.dropzone
https://bugs.webkit.org/show_bug.cgi?id=169338
Reviewed by Sam Weinig.
Update outdated comment about HTMLElement.dropzone since it was dropped
from the HTML specification:
- https://github.com/whatwg/html/commit/3044a7e8517a4488cea811789d19974a8d5a56ae
Also add comment about HTMLElement.webkitdropzone since Blink dropped
it in:
- https://bugs.chromium.org/p/chromium/issues/detail?id=688943
* html/HTMLElement.idl:
2017-03-06 Matt Rajca <mrajca@apple.com>
Add support for an autoplay play-pause events quirk.
https://bugs.webkit.org/show_bug.cgi?id=169235
Reviewed by Jer Noble.
For sites that assume media starts off playing, send a playing and pause event to trigger
custom media controls to update.
* html/HTMLMediaElement.cpp:
(WebCore::needsAutoplayPlayPauseEventsQuirk):
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
* html/HTMLMediaElement.h:
2017-03-08 Zan Dobersek <zdobersek@igalia.com>
MediaPlayerPrivateGStreamerBase::volume() should override the MediaPlayerPrivate method
https://bugs.webkit.org/show_bug.cgi?id=169347
Reviewed by Carlos Garcia Campos.
Enable the MediaPlayerPrivate::volume() method for the USE(GSTREAMER) configuration
and override it in the MediaPlayerPrivateGStreamerBase class.
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2017-03-08 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Actually implement flush() on playback pipeline
https://bugs.webkit.org/show_bug.cgi?id=169202
Reviewed by Žan Doberšek.
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp: Added GRefPtr support for GstQuery.
(WTF::adoptGRef):
(WTF::refGPtr<GstQuery>):
(WTF::derefGPtr<GstQuery>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h: Ditto.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GUniquePtr support for GstSegment.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::flush): Only actually flush in the non-seek case. For the seek case,
GStreamer seek will already do the flush.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::addSourceBuffer): Configure appsrc to be time-based instead of bytes-based to ensure
that the segments it produces are time-based.
(WebCore::segmentFixerProbe): This captures the next segment in the stream and "fixes" its base time by setting
it to the start time. This prevent audio/video desynchronizations.
(WebCore::PlaybackPipeline::flush): Really implement flushing by sending flush start/stop events, reconfiguring
appsrc with a new (seamless) segment (so it reconfigures the rest of the elements in that stream), and attached
a segmentFixerProbe to fix the segment emitted by basesrc (appsrc). The current pipeline position is used as
start time used for the new segment. This prevents displaying samples already displayed before flushing, while
allowing the decoder to decode them as a base for future (dependent) p-frame and b-frame samples.
2017-03-07 Simon Fraser <simon.fraser@apple.com>
Remove never-implemented CSS3 text decoration-related properties
https://bugs.webkit.org/show_bug.cgi?id=169009
Reviewed by Zalan Bujtas.
The following CSS properties were added many years ago based on an old CSS3 Text
draft (https://www.w3.org/TR/2003/CR-css3-text-20030514/), but never had any implementations.
Remove them.
text-line-through
text-line-through-color
text-line-through-mode
text-line-through-style
text-line-through-width
text-overline
text-overline-color
text-overline-mode
text-overline-style
text-overline-width
text-underline
text-underline-color
text-underline-mode
text-underline-style
text-underline-width
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
2017-03-07 Simon Fraser <simon.fraser@apple.com>
Have fixedPositionCreatesStackingContext be on by default everywhere
https://bugs.webkit.org/show_bug.cgi?id=169334
Reviewed by Zalan Bujtas.
It makes no sense to have web-exposed CSS functionality be different based on setting,
and other browser are now aligned with having position:fixed create stacking context.
So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
always force stacking context for position:fixed.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* page/Settings.cpp:
* page/Settings.in:
2017-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
Asynchronous image decoding should consider the drawing size if it is smaller than the size of the image
https://bugs.webkit.org/show_bug.cgi?id=168814
Reviewed by Simon Fraser.
If the image destinationRect.size() is smaller than the imageSourceSize
(e.g. 3000x3000 pixels), CGImageSourceCreateThumbnailAtIndex() is slower
than CGImageSourceCreateImageAtIndex() in decoding this image. To overcome
this problem, the entry (kCGImageSourceThumbnailMaxPixelSize,
max(destinationRect.width, destinationRect.height)) is added to the options
dictionary when calling CGImageSourceCreateThumbnailAtIndex(). This will
avoid copying a large block of memory for the unscaled bitmap image.
An argument named 'sizeForDrawing' of type std::optional<IntSize> will be passed
all the way from BitmapImage to ImageDecoder. If bool(sizeForDrawing) equals
true that means we want async image decoding. Otherwise the image will be decoded
synchronously.
The subsamplingLevel argument will be passed as std::optional<SubsamplingLevel>.
to ImageFrame query functions. When combined with sizeForDrawing, the meaning of
these two arguments will be the following:
-- !bool(subsamplingLevel): No caching is required. return what is stored in ImageFrameCache.
-- bool(subsamplingLevel) && !bool(sizeForDrawing): Match subsamplingLevel only. Recache if it's different.
-- bool(subsamplingLevel) && bool(sizeForDrawing): Match both both. . Recache if one of them is different.
We are going to allow decoding the same ImageFrame for different sizeForDrawings.
The rule is a new decoding is allowed only if the maxPixelSize(sizeForDrawing) of
the last requested image decoding is less than the new request sizeForDrawing.
* loader/cache/CachedImage.h: Add a helper function which returns the URL of a CachedImage.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex): Add a new argument for sizeForDrawing.
(WebCore::BitmapImage::nativeImage): Pass an empty sizeForDrawing to frameImageAtIndex(). We an image with the native size.
(WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
(WebCore::BitmapImage::nativeImageOfSize): Ditto.
(WebCore::BitmapImage::draw): Pass the destRect.size() to internalStartAnimation().
(WebCore::BitmapImage::isAsyncDecodingRequired): A helper function to answer the question
whether the async image decoding is required. It takes into account the animated images, the
large image, and the image size.
(WebCore::BitmapImage::internalStartAnimation): If async image decoding is requested for this frame m_sizeForDraw
will be set. If internalStartAnimation() is called from startAnimation(), sizeForDraw will be empty. In this
case no async image decoding will be requested. This happens only when startAnimation() is called from outside
BitmapImage::draw().
(WebCore::BitmapImage::advanceAnimation): Change the log message.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Ditto.
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::operator=): Include m_sizeForDraw in the properties of ImageFrame.
(WebCore::maxPixelSize): Returns the maximum of the width() and the height of an IntSize.
(WebCore::ImageFrame::isBeingDecoded): Returns true if the ImageFrame is currently being decoded for a specific sizeForDrawing.
(WebCore::ImageFrame::hasValidNativeImage): Ditto.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::enqueueSizeForDecoding): Adds a new sizeForDrawing; this sets the ImageFrame is being decoded for this sizeForDrawing.
(WebCore::ImageFrame::dequeueSizeForDecoding): Removes the first sizeForDrawing was enqueued; this marks this ImageFrame has finished decoding for this sizeForDrawing.
(WebCore::ImageFrame::clearSizeForDecoding): Clears the sizeForDecoding queue. Marks the ImageFrame for not being decoded.
(WebCore::ImageFrame::isEmpty): Replace Decoding::Empty by Decoding::None.
(WebCore::ImageFrame::sizeForDrawing): Returns the ImageFrame sizeForDraw.
(WebCore::ImageFrame::hasDecodedNativeImage): Returns true if the ImageFrame doesn't need decoding before drawing.
(WebCore::ImageFrame::hasValidNativeImage): Deleted. Moved to the source file.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Take a new argument for sizeForDraw.
(WebCore::ImageFrameCache::setFrameMetadataAtIndex): When sizeForDraw is set, use the decoder to get the image
frame size. Otherwise, get the size of the nativeImage.
(WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Take a new argument for sizeForDraw.
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Ditto.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Pass the sizeForDraw as a new property of the ImageFrame.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Store sizeForDraw in ImageFrameRequest. Delete unneeded check.
This function always receives a valid subsamplingLevel.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Marks all the queued ImageFrames for not being decoded.
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Take a new argument for sizeForDraw. If this function fixes the
properties of ImageFrame properties, keep the old sizeForDraw and/or subsamplingLevel. If a new frame is
decoded, no async image decoding will be done in this code path. So pass an empty std::optional<IntSize> to
ImageDecoder::createFrameImageAtIndex() and store std::optional<IntSize> in ImageFrame.
(WebCore::ImageFrameCache::frameMetadataAtIndex): A new helper function which takes a variable number of arguments which
will be passed to the (ImageFrame::*functor).
(WebCore::ImageFrameCache::frameMetadataAtIndexCacheIfNeeded): Make this function takes a variable number of arguments which
will be passed to the frameAtIndexCacheIfNeeded().
(WebCore::ImageFrameCache::size): Pass an Metadata, valid SubsamplingLevel and empty sizeForDraw to frameMetadataAtIndexCacheIfNeeded().
(WebCore::ImageFrameCache::sizeRespectingOrientation): Ditto.
(WebCore::ImageFrameCache::singlePixelSolidColor): Pass MetadataAndImage, empty SubsamplingLevel and empty sizeForDraw to
frameMetadataAtIndexCacheIfNeeded(); we can use the current frame image regardless of its size.
(WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Pass the ImageFrame method as a function argument instead of
passing it as a template argument.
(WebCore::ImageFrameCache::frameIsCompleteAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Pass subsamplingLevel and sizeForDrawing to frameMetadataAtIndex().
(WebCore::ImageFrameCache::frameHasDecodedNativeImage): New helper function to answer the question whether an ImageFrame will need
decoding when drawing or not.
(WebCore::ImageFrameCache::frameSubsamplingLevelAtIndex): Pass the ImageFrame method as a function argument instead of
passing it as a template argument.
(WebCore::ImageFrameCache::frameSizeAtIndex): Ditto.
(WebCore::ImageFrameCache::frameBytesAtIndex): Ditto.
(WebCore::ImageFrameCache::frameDurationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameOrientationAtIndex):
(WebCore::ImageFrameCache::frameImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameAtIndex): Deleted. Renamed to frameAtIndexCacheIfNeeded().
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded):
* platform/graphics/ImageObserver.h: Define a virtual function for image sourceUrl().
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::frameImageAtIndex): Take a new argument for sizeForDrawing.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Take a new argument for sizeForDrawing.
(WebCore::ImageSource::frameHasValidNativeImageAtIndex): Ditto.
(WebCore::ImageSource::frameHasDecodedNativeImage): New helper function.
(WebCore::ImageSource::frameImageAtIndex): Ditto.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions): Create a dictionary with the basic image decoding options.
(WebCore::createImageSourceAsyncOptions): Create a dictionary with the basic asynchronous image decoding options.
(WebCore::appendImageSourceOption): Append the SubsamplingLevel or the MaxPixelSize option to an CGImageSource options dictionary.
(WebCore::appendImageSourceOptions): Append the SubsamplingLevel and the MaxPixelSize option to an CGImageSource options dictionary.
(WebCore::imageSourceOptions): Creates a dictionary for the synchronous image decoding options.
(WebCore::imageSourceAsyncOptions): Creates a dictionary for the asynchronous image decoding options.
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the DecodingMode argument by an std::optional<IntSize>.
* platform/graphics/cg/ImageDecoderCG.h: Change a prototype.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the DecodingMode argument by an std::optional<IntSize>.
* platform/graphics/win/ImageDecoderDirect2D.h: Change a prototype.
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the DecodingMode argument by an std::optional<IntSize>.
* platform/image-decoders/ImageDecoder.h: Change a prototype.
2017-03-07 Simon Fraser <simon.fraser@apple.com>
Parsing -webkit-hyphenate-character uses confusingly named consumeLocale()
https://bugs.webkit.org/show_bug.cgi?id=168638
Reviewed by Zalan Bujtas.
Parsing CSSPropertyWebkitHyphenateCharacter very confusingly called consumeLocale(),
which is really just "consume the 'auto' ident or a string", so rename that function.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAutoOrString):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeLocale): Deleted.
2017-03-07 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Implement ECDH ImportKey/ExportKey operations
https://bugs.webkit.org/show_bug.cgi?id=169257
<rdar://problem/23789585>
Reviewed by Brent Fulgham.
This patch implements ECDH ImportKey/ExportKey operations according to:
https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations. Sad that we can't
support SPKI/PKCS8 formats at this moment due to lack of necessary
support in the underlying crypto library. Bug 169318 is tracking the
issue. Also, this patch fixes minor bugs while importing JWK keys for
HMAC/RSA.
Tests: crypto/subtle/ec-export-key-malformed-parameters.html
crypto/subtle/ec-import-jwk-key-export-jwk-key-private.html
crypto/subtle/ec-import-jwk-key-export-jwk-key-public.html
crypto/subtle/ec-import-jwk-key-export-raw-key.html
crypto/subtle/ec-import-key-malformed-parameters.html
crypto/subtle/ec-import-raw-key-export-jwk-key.html
crypto/subtle/ec-import-raw-key-export-raw-key.html
crypto/subtle/ecdh-generate-export-jwk-key-p256.html
crypto/subtle/ecdh-generate-export-jwk-key-p384.html
crypto/subtle/ecdh-generate-export-key-raw-p256.html
crypto/subtle/ecdh-generate-export-key-raw-p384.html
crypto/subtle/ecdh-import-jwk-key-minimum.html
crypto/subtle/ecdh-import-jwk-private-key-p256.html
crypto/subtle/ecdh-import-jwk-private-key-p384.html
crypto/subtle/ecdh-import-jwk-public-key-p256.html
crypto/subtle/ecdh-import-jwk-public-key-p384.html
crypto/subtle/ecdh-import-raw-key-p256.html
crypto/subtle/ecdh-import-raw-key-p384.html
crypto/workers/subtle/ec-generate-export-jwk-key.html
crypto/workers/subtle/ec-generate-export-raw-key.html
crypto/workers/subtle/ec-import-jwk-key-private.html
crypto/workers/subtle/ec-import-jwk-key-public.html
crypto/workers/subtle/ec-import-raw-key.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::supportExportKeyThrow):
Added EC family support.
* crypto/CommonCryptoUtilities.h:
Added needed CommonCrypto SPIs.
* crypto/CryptoAlgorithm.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::importKey):
(WebCore::CryptoAlgorithmECDH::exportKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/gnutls/CryptoKeyECGnuTLS.cpp:
(WebCore::CryptoKeyEC::keySizeInBits):
(WebCore::CryptoKeyEC::exportRaw):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformAddFieldElements):
Faked implementations for GTK+.
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::toNamedCurve):
(WebCore::CryptoKeyEC::generatePair):
(WebCore::CryptoKeyEC::importRaw):
(WebCore::CryptoKeyEC::importJwk):
(WebCore::CryptoKeyEC::exportJwk):
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::importJwk):
Fixed a bug.
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
Fixed a bug.
* crypto/mac/CryptoKeyECMac.cpp:
(WebCore::doesUncompressedPointMatchNamedCurve):
(WebCore::doesFieldElementMatchNamedCurve):
(WebCore::getKeySizeFromNamedCurve):
(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::keySizeInBits):
(WebCore::CryptoKeyEC::exportRaw):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformAddFieldElements):
2017-03-07 Youenn Fablet <youenn@apple.com>
WebRTC can be used even if getUserMedia is off
https://bugs.webkit.org/show_bug.cgi?id=169303
Reviewed by Alex Christensen.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::peerConnectionEnabled): No longer tieing peerConnectionEnabled to
mediaStreamEnabled.
2017-03-07 Dean Jackson <dino@apple.com>
Make platformDevice() not inline, to avoid a
weak external symbol issue on newer compilers/linkers
* platform/graphics/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::platformDevice):
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::platformDevice): Deleted.
2017-03-07 Dean Jackson <dino@apple.com>
Some platforms won't be able to create a GPUDevice
https://bugs.webkit.org/show_bug.cgi?id=169314
<rdar://problems/30907521>
Reviewed by Jon Lee.
Protect for the case where the hardware doesn't support Metal. And
we might as well disable WebGPU completely in the iOS simulator
for now.
* Configurations/FeatureDefines.xcconfig:
* platform/graphics/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::GPUDevice):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::create):
2017-03-07 Maureen Daum <mdaum@apple.com>
Correctly check for an empty database file.
<rdar://problem/30542242> Removing Website Data not working (WebSQL directories being left behind)
https://bugs.webkit.org/show_bug.cgi?id=169256
Reviewed by Brady Eidson.
Tests: DatabaseTrackerTest.DeleteDatabaseFileIfEmpty verifies that we actually delete an empty file.
Instead of checking that a database file's size is zero bytes, we should check if it contains
any tables. Once we open an empty database file and set its journal mode to WAL, it will have a
valid SQLite header and therefore will no longer be empty. We can know that the database was empty
if it does not contain any tables.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
Use BEGIN EXCLUSIVE TRANSACTION in order to obtain the exclusive lock. If the database doesn't contain
any tables, it is empty and can be deleted.
2017-03-07 Alex Christensen <achristensen@webkit.org>
[URLParser] Fix file URLs that are just file:// and a Windows drive letter
https://bugs.webkit.org/show_bug.cgi?id=169242
Reviewed by Tim Horton.
This is specified in https://url.spec.whatwg.org/#file-host-state and tested by a newly-passing
web platform test. I added the check for the windows drive quirk in the FileHost state of the
parser but I forgot it when FileHost is the terminal state.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2017-03-07 Chris Dumez <cdumez@apple.com>
Drop non-standard MessageEvent.webkitInitMessageEvent()
https://bugs.webkit.org/show_bug.cgi?id=169295
Reviewed by Joseph Pecoraro.
Drop non-standard MessageEvent.webkitInitMessageEvent().
Chrome dropped it almost 3 years ago. They had UseCounter data showing
consistent 0% usage:
- https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/H6lsGFqdy3Y
- https://www.chromestatus.com/metrics/feature/timeline/popularity/223
- https://src.chromium.org/viewvc/blink?revision=174967&view=revision
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent): Deleted.
(WebCore::JSMessageEvent::webkitInitMessageEvent): Deleted.
* dom/MessageEvent.idl:
2017-03-07 Chris Dumez <cdumez@apple.com>
Label of an <option> element should not be displayed in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=169296
<rdar://problem/30900751>
Reviewed by Simon Fraser.
Label of an <option> element should not be displayed in quirks mode, to
match Chrome and Firefox. However, we should still display the label in
strict mode, as per the HTML specification:
- https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2
Chrome renders the label in strict mode, same as us. Firefox does not:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1345242
Tests: fast/dom/HTMLOptionElement/option-label-quirksmode.html
fast/dom/HTMLOptionElement/option-label-quirksmode2.html
fast/dom/HTMLOptionElement/option-label-strictmode.html
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::displayLabel):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
* html/HTMLOptionElement.h:
2017-03-07 Dean Jackson <dino@apple.com>
Add GPUDevice implementation and WebGPULayer
https://bugs.webkit.org/show_bug.cgi?id=169219
<rdar://problem/30879048>
Reviewed by Sam Weinig.
Add a basic implementation of a GPUDevice object,
which references a MTLDevice. Also add a WebGPULayer
that will ultimately be used to host WebGPU content.
WebKit API Test: WebCore/mac/GPUDevice.mm
* Configurations/WebCore.xcconfig: Link to Metal.
* PlatformMac.cmake: New files.
* WebCore.xcodeproj/project.pbxproj:
* platform/Logging.h: Add a WebGPU logging channel.
* platform/graphics/cocoa/GPUDeviceMetal.mm: Added.
(WebCore::GPUDevice::GPUDevice): Cocoa implementation.
(WebCore::GPUDevice::reshape):
* platform/graphics/cocoa/WebGPULayer.h: Added.
* platform/graphics/cocoa/WebGPULayer.mm: Added.
(-[WebGPULayer initWithGPUDevice:]):
(-[WebGPULayer copyImageSnapshotWithColorSpace:]):
(-[WebGPULayer display]):
* platform/graphics/gpu/GPUDevice.cpp: Added.
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::~GPUDevice):
(WebCore::GPUDevice::GPUDevice): Implementation for platforms
other than Mac and iOS hardware.
(WebCore::GPUDevice::reshape):
* platform/graphics/gpu/GPUDevice.h: Added.
(WebCore::GPUDevice::platformLayer):
(WebCore::GPUDevice::platformDevice):
(WebCore::GPUDevice::layer):
2017-03-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Log an error to the console when an image fails to load
https://bugs.webkit.org/show_bug.cgi?id=169292
Reviewed by Dean Jackson.
In order to help debug flaky tests we now log the image source when an image fails to load.
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.handleEvent):
(IconButton.prototype._loadImage):
2017-03-07 Zalan Bujtas <zalan@apple.com>
Simple line layout: Do not use invalid m_lastNonWhitespaceFragment while removing trailing whitespace.
https://bugs.webkit.org/show_bug.cgi?id=169288
rdar://problem/30576976
Reviewed by Antti Koivisto.
When the current line has nothing but whitespace, m_lastNonWhitespaceFragment is invalid so
we should not use the start/end values to decide how many characters we need to revert.
This patch makes m_lastNonWhitespaceFragment optional. When it's invalid we just remove
all the runs from the current line since they are all considered whitespace runs.
Test: fast/text/simple-line-layout-line-is-all-whitespace.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::revertAllRunsOnCurrentLine):
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
2017-03-07 Alex Christensen <achristensen@webkit.org>
[Content Extensions] Rename "Domain" to "Condition" where appropriate
https://bugs.webkit.org/show_bug.cgi?id=169297
Reviewed by Brady Eidson.
In r184116 I added the ability for a content blocker author to add conditions to the triggers,
if-domain and unless-domain which look at the domain of the main document URL.
I plan to add more conditions soon to run regexes on the entire URL, but to make that patch more
manageable, I took the non-behavior-changing parts and put them in this patch.
No change in behavior except some error messages were made more generic.
* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
(WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
Pass the main document URL instead of just the domain. No change in behavior yet.
(WebCore::ContentExtensions::ContentExtension::cachedConditionedActions):
(WebCore::ContentExtensions::ContentExtension::universalActionsWithConditions):
(WebCore::ContentExtensions::ContentExtension::populateDomainCacheIfNeeded): Deleted.
(WebCore::ContentExtensions::ContentExtension::cachedDomainActions): Deleted.
(WebCore::ContentExtensions::ContentExtension::universalActionsWithDomains): Deleted.
* contentextensions/ContentExtension.h:
(WebCore::ContentExtensions::ContentExtension::universalActionsWithoutConditions):
(WebCore::ContentExtensions::ContentExtension::universalActionsWithoutDomains): Deleted.
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::serializeActions):
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getStringList):
Don't pass the error type as a parameter. It's always JSONInvalidConditionList.
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::loadTrigger):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::~Trigger):
(WebCore::ContentExtensions::Trigger::isEmpty):
(WebCore::ContentExtensions::Trigger::operator==):
(WebCore::ContentExtensions::TriggerHash::hash):
Use bitwise xor instead of bitwise or to have fewer hash collisions.
Also, before we were accidentally doing the same hash operation here for IfDomain and UnlessDomain.
This caused unnecessary hash collisions. This is fixed, but should not change any behavior.
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::matchesCondition):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsMatchingEverything):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithConditions):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
(WebCore::ContentExtensions::matchesDomain): Deleted.
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithDomains): Deleted.
* contentextensions/DFABytecodeInterpreter.h:
* loader/ResourceLoadInfo.h:
2017-03-07 Michael Catanzaro <mcatanzaro@igalia.com>
[FreeType] FontPlatformData::fallbacks() returns unprepared FcPatterns
https://bugs.webkit.org/show_bug.cgi?id=164689
Reviewed by Carlos Garcia Campos.
From the documentation of FcFontSort():
"""The returned FcFontSet references FcPattern structures which may be shared by the
return value from multiple FcFontSort calls, applications must not modify these patterns.
Instead, they should be passed, along with p to FcFontRenderPrepare which combines them into
a complete pattern."""
That means each call to FcFontSort() must be followed up by a call to FcFontRenderPrepare(),
else the patterns will lack information about how to draw the font properly.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::fallbacks):
2017-03-07 Myles C. Maxfield <mmaxfield@apple.com>
Parsing font descriptors inside @font-face needs to accept ranges
https://bugs.webkit.org/show_bug.cgi?id=168893
Reviewed by Dean Jackson.
Parse font-weight, font-stretch, and font-style ranges according to
https://drafts.csswg.org/css-fonts-4/#font-prop-desc. There is one difference, though:
as documented in https://github.com/w3c/csswg-drafts/issues/783, slashes are a better
delimiters than hyphens, so this patch implements that instead. I'll update the spec to
include slashes as soon as possible.
Because this patch is all about creating FontSelectionValues from fonts, it doesn't
actually modify the font selection algorithm, and therefore only tests the creation of
these new values. The font selection algorithm itself is already tested elsewhere.
This new work is behind the ENABLE(VARIATION_FONTS) flag.
Test: fast/text/font-selection-font-face-parse.html
* css/CSSFontFace.cpp:
(WebCore::calculateWeightRange):
(WebCore::calculateStretchRange):
(WebCore::calculateItalicRange):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::consumeFontStretchRange):
(WebCore::consumeFontStyleRange):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::extractVariationBounds):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::capabilitiesForFontDescriptor):
2017-03-07 Dave Hyatt <hyatt@apple.com>
Animated GIFs fail to play in multi-column layout
https://bugs.webkit.org/show_bug.cgi?id=167901
<rdar://problem/30382262>
Reviewed by Zalan Bujtas.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
Make sure to handle the case where we pass in a null repaintContainer and need
to cross a multicolumn flow thread -> region boundary as a result.
2017-03-07 Fujii Hironori <Hironori.Fujii@sony.com>
ShadowBlur::calculateLayerBoundingRect doesn't need to return the enclosingIntRect of layerRect
https://bugs.webkit.org/show_bug.cgi?id=168650
Reviewed by Simon Fraser.
No new tests, no behavior change.
* platform/graphics/ShadowBlur.h: Change the type of return value
from IntRect to IntSize.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::calculateLayerBoundingRect): Ditto.
(WebCore::ShadowBlur::drawRectShadow): Rename a variable layerRect layerSize.
(WebCore::ShadowBlur::drawInsetShadow): Ditto.
(WebCore::ShadowBlur::drawRectShadowWithoutTiling): Ditto.
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling): Ditto.
(WebCore::ShadowBlur::beginShadowLayer): Ditto.
2017-03-07 Chris Dumez <cdumez@apple.com>
Replace debug assertion with release one in Frame::setView()
https://bugs.webkit.org/show_bug.cgi?id=169189
Reviewed by Ryosuke Niwa.
Replace debug assertion with release one in Frame::setView() to make make sure the
document does not have a living render tree. This will help identify possible
remaining cases where this can happen.
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInView): Deleted.
* dom/Document.h:
* page/Frame.cpp:
(WebCore::Frame::setView):
2017-03-07 Youenn Fablet <youenn@apple.com>
Expose WebRTC current/pending description getters
https://bugs.webkit.org/show_bug.cgi?id=169216
Reviewed by Alex Christensen.
Test: webrtc/descriptionGetters.html
Implement pending and current description getters through libwebrtc.
These getters do not yet match the spec as can be seen from the test, which is written to match the implemented behavior.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::currentLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::currentRemoteDescription):
(WebCore::LibWebRTCPeerConnectionBackend::pendingLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::pendingRemoteDescription):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2017-03-07 Chris Dumez <cdumez@apple.com>
Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
https://bugs.webkit.org/show_bug.cgi?id=169236
Reviewed by Simon Fraser.
* dom/Document.cpp:
(WebCore::Document::minimumDOMTimerInterval):
(WebCore::Document::timerAlignmentInterval):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
(WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
(WebCore::ScriptExecutionContext::timerAlignmentInterval):
* dom/ScriptExecutionContext.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didInstallTimer):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didInstallTimer):
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createTimerInstallData):
* inspector/TimelineRecordFactory.h:
* page/DOMTimer.cpp:
(WebCore::shouldForwardUserGesture):
(WebCore::userGestureTokenToForward):
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::intervalClampedToMinimum):
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout):
(WebCore::DOMWindow::setInterval):
* page/Page.cpp:
(WebCore::Page::setTimerThrottlingState):
(WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
(WebCore::Page::updateDOMTimerAlignmentInterval):
* page/Page.h:
(WebCore::Page::domTimerAlignmentInterval):
* page/Settings.cpp:
(WebCore::Settings::setMinimumDOMTimerInterval):
* page/Settings.h:
(WebCore::Settings::minimumDOMTimerInterval):
* page/SuspendableTimer.h:
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* platform/Timer.cpp:
(WebCore::TimerBase::setNextFireTime):
* platform/Timer.h:
(WebCore::TimerBase::alignedFireTime):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setMinimumTimerInterval):
* testing/InternalSettings.h:
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::setTimeout):
(WebCore::WorkerGlobalScope::setInterval):
2017-03-07 Chris Dumez <cdumez@apple.com>
Align initEvent / initCustomEvent / initMessageEvent with the latest specification
https://bugs.webkit.org/show_bug.cgi?id=169176
Reviewed by Alex Christensen.
Align initEvent / initCustomEvent / initMessageEvent with the latest specification
after:
- https://github.com/whatwg/dom/pull/417
- https://github.com/whatwg/html/pull/2410
In particular, the following changes were made:
- initEvent: The length property now properly returns 1 instead of 3 as only the
first parameter is mandatory. We were already behaving correcting the the length
property value was wrong because we forgot to drop a hack from the bindings
generator.
- initCustomEvent: Make all parameters except the first optional. Previously, all
parameters were mandatory so this is safe.
- initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
A side effect of dropping the custom code is that null is no longer considered as
valid input for the last parameter. The parameter is of type sequence<> and the
new behavior is consistent with the specification and Firefox. If it turns out to
break existing content, I'll make the parameter nullable in a follow-up.
No new tests, updated existing tests.
* bindings/js/JSMessageEventCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/CustomEvent.idl:
* dom/MessageEvent.idl:
2017-03-07 Antti Koivisto <antti@apple.com>
Differentiate between pending head and body stylesheets in Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=169277
Reviewed by Andreas Kling.
Split pending stylesheet node set into separate sets for head and body elements and processing instructions.
This tightens typing and will also be useful later.
* style/StyleScope.cpp:
(WebCore::Style::Scope::~Scope):
(WebCore::Style::Scope::addPendingSheet):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::didRemovePendingStylesheet):
(WebCore::Style::Scope::hasPendingSheet):
(WebCore::Style::Scope::hasPendingSheetInBody):
(WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet): Deleted.
* style/StyleScope.h:
(WebCore::Style::Scope::hasPendingSheet): Deleted.
(WebCore::Style::Scope::hasPendingSheets): Deleted.
* style/StyleTreeResolver.cpp:
(WebCore::Style::hasLoadingStylesheet):
Just test for body stylesheets.
(WebCore::Style::TreeResolver::resolve):
Treat all before-body stylesheets uniformly.
2017-03-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
https://bugs.webkit.org/show_bug.cgi?id=169280
<rdar://problem/30876078>
Reviewed by Jon Lee.
We need to track when a new load start to see if we might have recovered from an error
and hide the "invalid" placard.
Test: media/modern-media-controls/placard-support/placard-support-error-recover.html
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents):
2017-03-07 Andy Estes <aestes@apple.com>
REGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=169266
Reviewed by Tim Horton.
r213412 added functions to create a CGImageRef from a canvas image buffer, which were used
to create data: URLs and blobs. If JPEG premultiplication is applied, though,
WebCore::cgImage() would return an image with a data provider pointing to stack memory.
I fixed a similar issue in ImageBuffer::toCGImage() by leaking the reference to a
Uint8ClampedArray then creating a CGDataProviderRef with a releaseData function that adopts
the leaked reference.
We could take that approach in cgImage() too by allocating the premultiplied data buffer on
the heap then freeing it with a releaseData function, but it's simpler to refactor
toCGImage()/cgImage() to return an encoded image as a CFDataRef instead of a CFImageRef.
This ensures that a CGDataProviderRef never outlives the data it points to.
Covered by existing tests.
* platform/graphics/ImageBuffer.h: Renamed toCGImage() to toCFData().
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::dataURL): Changed to take a CFDataRef.
(WebCore::dataVector): Renamed from data(). Changed to take a CFDataRef.
(WebCore::ImageBuffer::toDataURL): Changed to call toCFData().
(WebCore::ImageBuffer::toData): Ditto.
(WebCore::ImageBuffer::toCFData): Changed to return a CFDataRef after encoding the
CGImageRef that was previously returned.
(WebCore::cfData): Ditto.
(WebCore::dataURL): Changed to call cfData().
(WebCore::data): Ditto.
(WebCore::ImageBuffer::toCGImage): Renamed to ImageBuffer::toCFData().
(WebCore::cgImage): Renamed to WebCore::cfData().
2017-03-07 Myles C. Maxfield <mmaxfield@apple.com>
Test fix after r213505
https://bugs.webkit.org/show_bug.cgi?id=169267
Unreviewed.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
2017-03-06 Myles C. Maxfield <mmaxfield@apple.com>
Apply well-known-axis variation values at the right time in preparePlatformFont()
https://bugs.webkit.org/show_bug.cgi?id=168896
Reviewed by Jon Lee.
Simply plumb the FontSelectionRequest to the place where font variations are implemented.
Test: fast/text/variations/font-selection-properties.html
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
2017-03-06 Myles C. Maxfield <mmaxfield@apple.com>
Unreviewed post-review fixup after r213464
https://bugs.webkit.org/show_bug.cgi?id=169255
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::computeNecessarySynthesis):
2017-03-06 Brent Fulgham <bfulgham@apple.com>
Validate DOM after potentially destructive actions during parser insert operations
https://bugs.webkit.org/show_bug.cgi?id=169222
<rdar://problem/30689729>
Reviewed by Ryosuke Niwa.
Do not perform an insert operation if the next child's parent is no longer
part of the tree. This can happen if JavaScript runs during node removal
events and modifies the contents of the document.
This patch was inspired by a similar Blink change by Marius Mlynski:
<https://src.chromium.org/viewvc/blink?view=revision&revision=200690>
Tests: fast/parser/scriptexec-during-parserInsertBefore.html
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeReparentTask):
(WebCore::executeInsertAlreadyParsedChildTask):
2017-03-06 Myles C. Maxfield <mmaxfield@apple.com>
Update isEmojiGroupCandidate() to the latest version of Unicode
https://bugs.webkit.org/show_bug.cgi?id=168198
Reviewed by Jon Lee.
In the latest version of Unicode, many more code points are candidates for emoji groups.
Therefore, isEmojiGroupCandidate() should be made more permissive. This way, the function
is more future-proof.
Test: editing/deleting/delete-emoji.html
* platform/text/CharacterProperties.h:
(WebCore::icuLibraryUnderstandsSupplementalSymbolsAndPictographs):
(WebCore::isEmojiGroupCandidate):
2017-03-06 Youenn Fablet <youenn@apple.com>
Use default configuration for libwebrtc peerconnection
https://bugs.webkit.org/show_bug.cgi?id=169239
Reviewed by Alex Christensen.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration): Using the default configuration instead of the aggressive one.
2017-03-06 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] SN-DBS fails to build: Cannot open include file: 'WebCoreTestSupportPrefix.h'
https://bugs.webkit.org/show_bug.cgi?id=169244
Reviewed by Alex Christensen.
A distributed build system SN-DBS can not find
WebCoreTestSupportPrefix.h without an include path to it.
* CMakeLists.txt: Add 'WebCore/testing/js' to include paths.
2017-03-06 Fujii Hironori <Hironori.Fujii@sony.com>
[cairo] error C2065: 'quality': undeclared identifier since r213412
https://bugs.webkit.org/show_bug.cgi?id=169240
Reviewed by Ryosuke Niwa.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::toDataURL): Name the unnamed second argument 'quality'.
2017-03-06 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Implement ECDH GenerateKey operation
https://bugs.webkit.org/show_bug.cgi?id=169093
<rdar://problem/23789585>
Reviewed by Brent Fulgham.
This patch implements GenerateKey operation of ECDH according to:
https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
Note: Sad that we are not able to support P-521 at this moment due
to lack of necessary support in the underlying crypto library.
Tests: crypto/subtle/ec-generate-key-malformed-parameters.html
crypto/subtle/ecdh-generate-key-extractable.html
crypto/subtle/ecdh-generate-key-p256.html
crypto/subtle/ecdh-generate-key-p384.html
crypto/subtle/ecdh-generate-key-single-usage.html
crypto/workers/subtle/ec-generate-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoKeyCustom.cpp:
(WebCore::JSCryptoKey::algorithm):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
Add support for ECDH.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
Structured clonable will be added later on.
* crypto/CommonCryptoUtilities.h:
Add SPI for EC.
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp: Added.
(WebCore::CryptoAlgorithmECDH::create):
(WebCore::CryptoAlgorithmECDH::identifier):
(WebCore::CryptoAlgorithmECDH::generateKey):
* crypto/algorithms/CryptoAlgorithmECDH.h: Added.
* crypto/gnutls/CryptoKeyECGnuTLS.cpp: Added.
(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::platformGeneratePair):
* crypto/keys/CryptoKeyEC.cpp: Added.
(WebCore::CryptoKeyEC::CryptoKeyEC):
(WebCore::CryptoKeyEC::generatePair):
(WebCore::CryptoKeyEC::buildAlgorithm):
(WebCore::CryptoKeyEC::exportData):
* crypto/keys/CryptoKeyEC.h: Added.
(WebCore::EcKeyAlgorithm::EcKeyAlgorithm):
(WebCore::EcKeyAlgorithm::namedCurve):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Add support for ECDH.
* crypto/mac/CryptoKeyECMac.cpp: Added.
(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::platformGeneratePair):
* crypto/parameters/CryptoAlgorithmEcKeyParams.h: Added.
* crypto/parameters/EcKeyParams.idl: Added.
2017-03-06 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused parameter warning after r213464
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
2017-03-06 Michael Saboff <msaboff@apple.com>
Take advantage of fast permissions switching of JIT memory for devices that support it
https://bugs.webkit.org/show_bug.cgi?id=169155
Reviewed by Saam Barati.
Updated the Xcode config files to match what is in the JavaScriptCore ones.
* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebCore.xcconfig:
2017-03-06 Aakash Jain <aakash_jain@apple.com>
Make WKMenuItemIdentifiersPrivate.h private header
https://bugs.webkit.org/show_bug.cgi?id=168981
Reviewed by Tim Horton.
* platform/spi/mac/NSMenuSPI.h: NSUserInterfaceItemIdentification is in the public header in recent SDKs.
2017-03-06 Dave Hyatt <hyatt@apple.com>
REGRESSION: Block no longer shrinks to preferred width in this flex box layout
https://bugs.webkit.org/show_bug.cgi?id=169203
<rdar://problem/30873895>
Reviewed by Simon Fraser.
Added new test in css3/flexbox.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::adjustStyleForAlignment):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
Resolve auto alignment values by adjusting the render style as needed. Make a helper
function for adjusting only alignment that can be called from the inner text control
custom style creation.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
Replaced items in grids should not stretch by default.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasStretchedLogicalWidth):
Patched to properly check the default alignment for the child, making sure
that if it's a replacd item inside a grid, that the default is start and not
stretch.
* rendering/RenderBox.h:
(WebCore::RenderBox::selfAlignmentNormalBehavior):
Self-alignment function now takes an optional child argument, since the behavior
varies in grids depending on the child being replaced or not.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::alignmentForChild):
Fixed to do the right thing when the child is anonymous.
(WebCore::RenderFlexibleBox::styleDidChange): Deleted.
* rendering/RenderFlexibleBox.h:
Deleted, since alignment changes are handled at the style diff level now.
* rendering/RenderFullScreen.h:
Patched the selfAlignmentNormalBehavior method to take an optional child argument.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::styleDidChange):
(WebCore::RenderGrid::alignSelfForChild):
(WebCore::RenderGrid::justifySelfForChild):
(WebCore::RenderGrid::columnAxisPositionForChild):
(WebCore::RenderGrid::rowAxisPositionForChild):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::defaultAlignmentIsStretch): Deleted.
(WebCore::defaultAlignmentChangedToStretchInRowAxis): Deleted.
(WebCore::defaultAlignmentChangedFromStretchInRowAxis): Deleted.
(WebCore::defaultAlignmentChangedFromStretchInColumnAxis): Deleted.
(WebCore::selfAlignmentChangedToStretchInRowAxis): Deleted.
(WebCore::selfAlignmentChangedFromStretchInRowAxis): Deleted.
(WebCore::selfAlignmentChangedFromStretchInColumnAxis): Deleted.
* rendering/RenderGrid.h:
Removed the alignment change logic in styleDidChange for grids, since style diffing handles
it now. Updated all selfAlignmentForNormalBehavior queries to pass in the child so that
replaced elements are handled properly.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::overflowInlineDirection):
(WebCore::RenderStyle::overflowBlockDirection):
(WebCore::RenderStyle::setJustifySelfPosition):
New helpers used by grid and by adjustRenderStyle.
* style/StyleChange.cpp:
(WebCore::Style::determineChange):
If alignment or justification changes occur on a parent that could affect the child (e.g., align-items)
return Inherit so the child render styles get adjusted properly.
2017-03-06 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: numberOfChannels == 2 in WebCore::RealtimeIncomingAudioSource::OnData
https://bugs.webkit.org/show_bug.cgi?id=169224
<rdar://problem/30856811>
Reviewed by Alex Christensen.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData): Updated assertion to allow 1 channel since we can handle it as well.
2017-03-06 Chris Dumez <cdumez@apple.com>
[iOS] Throttle CSS animations to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169138
<rdar://problem/30837805>
Reviewed by Said Abou-Hallawa.
Throttle software CSS animations to 30fps in low power mode on iOS
to save battery.
Test: fast/animation/css-animation-throttling-lowPowerMode.html
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
(WebCore::CSSAnimationControllerPrivate::animationInterval):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
(WebCore::CSSAnimationController::updateThrottlingState):
(WebCore::CSSAnimationController::animationInterval):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::animationsInterval):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-03 Matt Rajca <mrajca@apple.com>
Media: notify clients when the user never plays a media element that was prevented from auto-playing
https://bugs.webkit.org/show_bug.cgi?id=169150
Reviewed by Alex Christensen.
Added API tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
* page/AutoplayEvent.h:
2017-03-06 Alex Christensen <achristensen@webkit.org>
Refactor ContentExtensionParser
https://bugs.webkit.org/show_bug.cgi?id=169214
Reviewed by Brady Eidson.
No change in behavior, as verified by existing API tests.
This will make it easier to use getStringList for other things in coming patches.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getStringList):
(WebCore::ContentExtensions::getDomainList):
2017-03-06 Alex Christensen <achristensen@webkit.org>
Fix URLs relative to file URLs with paths beginning with Windows drive letters
https://bugs.webkit.org/show_bug.cgi?id=169178
Reviewed by Tim Horton.
Windows drives in file URLs can begin with windows drive letters, such as file:///C:/
which should not be removed when making other URLs relative to them.
See https://url.spec.whatwg.org/#file-slash-state
Covered by new API tests and newly passing web-platform-tests.
* platform/URLParser.cpp:
(WebCore::URLParser::copyBaseWindowsDriveLetter):
(WebCore::URLParser::copyASCIIStringUntil):
(WebCore::URLParser::parse):
* platform/URLParser.h:
2017-03-06 Simon Fraser <simon.fraser@apple.com>
Only use layer backing store which supports subpixel antialiased text if we know subpixel antialiased will be painted into it
https://bugs.webkit.org/show_bug.cgi?id=169191
Reviewed by Zalan Bujtas.
Instead of unconditionally calling setSupportsSubpixelAntialiasedText() on GraphicsLayers created
by RenderLayerBacking, only do so when we know (or suspect) that a layer contains smoothed text.
This is done by enhancing RenderLayer::isVisuallyNonEmpty() and RenderLayer::hasNonEmptyChildRenderers()
to take a PaintedContentRequest parameter, which allows the caller to specify what qualities of
the layer contents it is interested in. Most of the time, this is just any painted content, but on
platforms where GraphicsLayer::supportsSubpixelAntialiasedLayerText() returns true, the query also
asks about whether the layer will contain subpixel-antialiased text. In this case, it can't early
return as soon as painted content is found; it must keep iterating renderers while all the query
requests are unsatisfied, or until it hits depth or sibling limits. If a limit is hit, we take the
same path of assuming there is subpixel-antialiased text (via the "Undetermined" state).
RenderLayerBacking also makes use of PaintedContentRequest during its non-composited child layer walk.
To offset the additional cost of this tree walking, RenderLayerBacking now caches information about its
painted content for the duration of a single update via PaintedContentsInfo, so we no longer call
isDirectlyCompositedImage() and isSimpleContainerCompositingLayer() multiple times per backing per update.
The traversal code here too now has to continue until all necessary states in the request have been computed.
Add some functions to RenderImage so that we know if it's showing the alt text or has a non-bitmap image
(which may contain text).
Subpixel-antialiased ("smoothed") text is disabled by DRT and WTR by default, so we need Internals API to enable it.
Platforms now express their support for subpixel-antialiased text via GraphicsLayer::supportsSubpixelAntialiasedLayerText()
which only returns true on Mac.
Tests: compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style.html
compositing/contents-format/subpixel-antialiased-text-configs.html
compositing/contents-format/subpixel-antialiased-text-images.html
compositing/contents-format/subpixel-antialiased-text-visibility.html
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsSubpixelAntialiasedLayerText):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::supportsSubpixelAntialiasedLayerText):
(WebCore::GraphicsLayerCA::changeLayerTypeTo):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isShowingMissingOrImageError):
(WebCore::RenderImage::isShowingAltText):
(WebCore::RenderImage::hasNonBitmapImage):
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::PaintedContentsInfo::PaintedContentsInfo):
(WebCore::PaintedContentsInfo::setWantsSubpixelAntialiasedTextState):
(WebCore::PaintedContentsInfo::paintsBoxDecorations):
(WebCore::PaintedContentsInfo::paintsContent):
(WebCore::PaintedContentsInfo::paintsSubpixelAntialiasedText):
(WebCore::PaintedContentsInfo::isSimpleContainer):
(WebCore::PaintedContentsInfo::isDirectlyCompositedImage):
(WebCore::PaintedContentsInfo::paintsBoxDecorationsDetermination):
(WebCore::PaintedContentsInfo::paintsContentDetermination):
(WebCore::PaintedContentsInfo::paintsSubpixelAntialiasedTextDetermination):
(WebCore::PaintedContentsInfo::contentsTypeDetermination):
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
(WebCore::RenderLayerBacking::updateAfterDescendants):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
(WebCore::RenderLayerBacking::paintsContent):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
(WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
(WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
(WebCore::RenderLayerBacking::containsPaintedContent):
(WebCore::RenderLayerBacking::contentChanged):
(WebCore::RenderLayerBacking::updateImageContents):
(WebCore::RenderLayerBacking::paintsChildRenderers): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
* testing/Internals.cpp:
(WebCore::Internals::setFontSmoothingEnabled):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-06 Myles C. Maxfield <mmaxfield@apple.com>
Expand font-weight and font-stretch to take any number
https://bugs.webkit.org/show_bug.cgi?id=168889
Reviewed by Simon Fraser.
This patch expands parsing support for font-weight and font-stretch so that they can accept
numbers in addition to the keyword values they accepted previously. Eventually, these numbers
will be used as inputs to select variation fonts; however, in this patch, the values are just
parsed and held in our internal data model. This means that this patch doesn't actually change
the general behavior of WebKit; instead, it parses new values, outputs them (via
getComputedStyle() and similar functions), and provides them as input to our preexisting font
selection algorithm.
This patch doesn't actually modify anything algorithmically, and therefore, it doesn't include
any additional tests for the font selection algorithm. Instead, it tests the parsing of the
newly accepted values (both input and output).
Because our internal data model needs to hold numbers now, this patch also completely eliminates
the FontWidth, FontItalic, and FontTraitsMask enum values in favor of FontSelectionValues (which
can hold numbers instead of individual enum values). Therefore, every place which we were using
these enum values is migrated in this patch to using FontSelectionValues instead.
Tests: fast/text/font-selection-font-face-parse.html
fast/text/font-selection-font-loading-api-parse.html
fast/text/font-style-parse.html
fast/text/font-weight-parse.html
* accessibility/AccessibilityRenderObject.cpp: Migrate off of old enum types.
(WebCore::AccessibilityRenderObject::hasBoldFont):
(WebCore::AccessibilityRenderObject::hasItalicFont):
(WebCore::AccessibilityRenderObject::hasPlainText):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp: Ditto.
(getAttributeSetForAccessibilityObject):
* css/CSSComputedStyleDeclaration.cpp: Output newly parsed values.
(WebCore::fontWeightFromStyle):
(WebCore::fontStretchFromStyle):
(WebCore::fontStyleFromStyle):
(WebCore::fontShorthandValueForSelectionProperties):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontFace.cpp: Migrate off old enum types.
(WebCore::calculateWeightRange):
(WebCore::CSSFontFace::setWeight):
(WebCore::calculateStretchRange):
(WebCore::CSSFontFace::setStretch):
(WebCore::calculateStyleRange):
(WebCore::CSSFontFace::setStyle):
(WebCore::CSSFontFace::calculateStyleMask): Deleted.
(WebCore::CSSFontFace::calculateWeightMask): Deleted.
(WebCore::CSSFontFace::calculateStretch): Deleted.
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp: Migrate off old enum types.
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
(WebCore::calculateWeightValue):
(WebCore::calculateStretchValue):
(WebCore::calculateStyleValue):
(WebCore::computeFontSelectionRequest):
(WebCore::CSSFontFaceSet::matchingFaces):
(WebCore::CSSFontFaceSet::fontFace):
(WebCore::computeFontTraitsMask): Deleted.
(WebCore::computeFontStretch): Deleted.
* css/CSSFontFaceSet.h:
* css/CSSFontSelector.cpp: Migrate off old enum types.
(WebCore::CSSFontSelector::fontRangesForFamily):
* css/CSSPrimitiveValueMappings.h: font-weight and font-style are no longer
keyword properties.
(WebCore::CSSPrimitiveValue::operator FontWeight): Deleted.
(WebCore::CSSPrimitiveValue::operator FontItalic): Deleted.
* css/CSSProperties.json: Use the same infrastructure for all three of the
font selection properties.
* css/CSSSegmentedFontFace.cpp: Migrate off old enum types.
(WebCore::CSSSegmentedFontFace::fontRanges):
* css/CSSValueKeywords.in: The 100-based font-weight values are now represented
as real numbers.
* css/FontFace.cpp: Update the string output functions for the new values.
(WebCore::rangeIsSingleValue):
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
* css/StyleBuilderConverter.h: Use CSSValue conversion functions to convert
to our new data model.
(WebCore::StyleBuilderConverter::convertFontWeight):
(WebCore::StyleBuilderConverter::convertFontStretch):
(WebCore::StyleBuilderConverter::convertFontStyle):
* css/StyleBuilderCustom.h: font-weight is no longer a completely custom
property.
(WebCore::StyleBuilderCustom::applyInitialFontWeight): Deleted.
(WebCore::StyleBuilderCustom::applyInheritFontWeight): Deleted.
(WebCore::StyleBuilderCustom::applyValueFontWeight): Deleted.
* css/parser/CSSParserFastPaths.cpp: font-style is no longer a keyword property.
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp: Parse the new values in the font selection
properties.
(WebCore::consumeFontWeightKeywordValue):
(WebCore::consumeFontWeightCSS21):
(WebCore::consumeFontWeight):
(WebCore::consumeFontStyleKeywordValue):
(WebCore::consumeFontStyle):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::consumeFont):
* editing/EditingStyle.cpp: Migrate off old enum types.
(WebCore::fontWeightIsBold):
* editing/mac/EditorMac.mm: Ditto.
(WebCore::Editor::applyFontStyles):
* platform/graphics/FontCache.h: Unify our font selection values into
their enclosing struct, FontSelectionCapabilities. Also, clean up utility
functions.
* platform/graphics/FontCascade.cpp: Migrate off old enum types.
(WebCore::FontCascade::FontCascade):
* platform/graphics/FontCascade.h: Ditto.
(WebCore::FontCascade::italic):
(WebCore::FontCascade::weight):
* platform/graphics/FontDescription.cpp: Ditto.
(WebCore::FontDescription::FontDescription):
(WebCore::FontCascadeDescription::lighterWeight):
(WebCore::FontCascadeDescription::bolderWeight):
(WebCore::FontDescription::traitsMask): Deleted.
* platform/graphics/FontDescription.h: Migrate off old enum types.
(WebCore::FontDescription::italic):
(WebCore::FontDescription::stretch):
(WebCore::FontDescription::weight):
(WebCore::FontDescription::fontSelectionRequest):
(WebCore::FontDescription::computedPixelSize):
(WebCore::FontDescription::setItalic):
(WebCore::FontDescription::setStretch):
(WebCore::FontDescription::setIsItalic):
(WebCore::FontDescription::setWeight):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::lighterWeight):
(WebCore::FontCascadeDescription::bolderWeight):
(WebCore::FontCascadeDescription::initialItalic):
(WebCore::FontCascadeDescription::initialWeight):
(WebCore::FontCascadeDescription::initialStretch):
* platform/graphics/FontSelectionAlgorithm.cpp: Delete code which was only
present to convert from the old enum types to the new FontSelectionRequest
type.
(WebCore::fontSelectionRequestForTraitsMask): Deleted.
(WebCore::initialFontSelectionCapabilitiesForTraitsMask): Deleted.
(WebCore::fontSelectionCapabilitiesForTraitsMask): Deleted.
* platform/graphics/FontSelectionAlgorithm.h: Migrate to new named functions
for special values.
(WebCore::isItalic):
(WebCore::boldWeightValue):
(WebCore::normalWeightValue):
(WebCore::isFontWeightBold):
(WebCore::normalStretchValue):
(WebCore::FontSelectionRequest::FontSelectionRequest):
* platform/graphics/cocoa/FontCacheCoreText.cpp: Migrate all platforms which
compile this file to know about FontDatabase. This simplifies the interaction
between @font-face fonts and installed fonts. Also, migrate off old enum types.
(WebCore::stretchFromCoreTextTraits):
(WebCore::fontWeightFromCoreText):
(WebCore::capabilitiesForFontDescriptor):
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
(WebCore::platformFontLookupWithFamily):
(WebCore::invalidateFontCache):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::lookupFallbackFont):
(WebCore::toTraitsMask): Deleted.
(WebCore::isFontWeightBold): Deleted.
(WebCore::toCoreTextFontWeight): Deleted.
(): Deleted.
(WebCore::FontDatabase::capabilitiesForFontDescriptor): Deleted.
(WebCore::calculateFontSelectionRequest): Deleted.
* platform/graphics/freetype/FontCacheFreeType.cpp: Migrate off old enum types.
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
(WebCore::fontWeightToFontconfigWeight):
(): Deleted.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp: Ditto.
(WebCore::FontPlatformData::FontPlatformData):
* platform/graphics/ios/FontCacheIOS.mm: Ditto.
(WebCore::baseSystemFontDescriptor):
(WebCore::systemFontModificationAttributes):
(WebCore::systemFontDescriptor):
(WebCore::platformFontWithFamilySpecialCase):
(WebCore::FontCache::weightOfCTFont): Deleted.
* platform/graphics/mac/FontCacheMac.mm: Ditto.
(WebCore::toNSFontWeight):
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/win/FontCacheWin.cpp: Ditto.
(WebCore::toGDIFontWeight):
(WebCore::traitsInFamilyEnumProc):
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
(): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp: Ditto.
(WebCore::MockRealtimeVideoSource::applySize):
* platform/text/TextFlags.h: Delete old enum types.
* platform/win/DragImageWin.cpp: Migrate off old enum types.
(WebCore::dragLabelFont):
* rendering/RenderEmbeddedObject.cpp: Ditto.
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
* rendering/RenderThemeGtk.cpp: Ditto.
(WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
* rendering/RenderThemeIOS.mm: Ditto.
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
* rendering/RenderThemeMac.mm: Ditto.
(WebCore::toFontWeight):
* rendering/RenderThemeWin.cpp: Ditto.
(WebCore::fillFontDescription):
2017-03-06 Chris Dumez <cdumez@apple.com>
[iOS] Disable autoplay of silent videos in low power mode
https://bugs.webkit.org/show_bug.cgi?id=168985
<rdar://problem/30739051>
Reviewed by Jer Noble.
Disable autoplay of silent videos in low power mode on iOS to save battery.
We force the display of the start button when denying autoplay in low power
mode to allow the user to start playback.
Test: media/modern-media-controls/start-support/start-support-lowPowerMode.html
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::shouldForceControlsDisplay):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
Add shouldForceControlsDisplay property on MediaControlsHost. This property
is set to true when we want to force the display for media controls. Currently,
this only returns true for autoplay videos, while in low power mode.
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype._updateControls):
Take into consideration MediaControlsHost.shouldForceControlsDisplay when
initializing shouldShowControls variable.
* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype._shouldShowStartButton):
Show the start button when MediaControlsHost.shouldForceControlsDisplay
returns true.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
Add MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode restriction
to the session when low power mode is enabled so we know we need to force a
gesture to start playback of autoplay videos.
(WebCore::HTMLMediaElement::shouldForceControlsDisplay):
Add convenience function to decide if we should force display of media controls.
This returns true if the media element is a video with autoplay attribute and
its session has the MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode
restriction (i.e. we are in low power mode).
(WebCore::HTMLMediaElement::configureMediaControls):
Force requireControls variable to true if shouldForceControlsDisplay() returns
true. We do this here instead of inside HTMLMediaElement::controls() because
we do not want to change the value of media.controls exposed to JavaScript.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
Add MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode to the list
of restrictions that get removed on user gesture.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):
Deny playback for videos that have the RequireUserGestureForVideoDueToLowPowerMode
restriction unless there is a user gesture.
* html/MediaElementSession.h:
Add new MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode
restriction.
2017-03-06 Chris Dumez <cdumez@apple.com>
LayoutTest fast/dom/timer-throttling-hidden-page.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=168927
Reviewed by Simon Fraser.
Update internals.isTimerThrottled() to return true for any kind of throttling.
It used to only account only for specific timers that do not cause changes
inside the viewport. It now accounts for all kind of throttling, such as
timer alignment due to the page being hidden.
* page/DOMTimer.h:
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):
2017-03-06 Dave Hyatt <hyatt@apple.com>
Enable fieldsets to be flexboxes, grids and multicolumn.
https://bugs.webkit.org/show_bug.cgi?id=169082
Reviewed by Simon Fraser .
Added new tests in fast/forms/fieldset.
This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
derived classes can also be fieldsets.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove RenderFieldset from the project.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::titleUIElement):
Call in to RenderBlock now instead of RenderFieldset.
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::createElementRenderer):
* html/HTMLFieldSetElement.h:
The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
can be supported. A special flag has been added that indicates only to make flexbox and block-related
renderers (not table display types).
* rendering/OrderIterator.cpp:
(WebCore::OrderIterator::shouldSkipChild):
(WebCore::OrderIteratorPopulator::collectChild):
* rendering/OrderIterator.h:
Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
excluded children like the legends of fieldsets.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlockRareData::RenderBlockRareData):
When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
across any layout system, since the legend is now just treated as part of the border.
(WebCore::RenderBlock::computePreferredLogicalWidths):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
preferred width in their own way and not as part of a specific layout system.
(WebCore::RenderBlock::renderName):
Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
(WebCore::RenderBlock::layoutExcludedChildren):
Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
the layout of legends by both placing them and setting the correct intrinsic border before amount on the
block.
(WebCore::RenderBlock::findFieldsetLegend):
Moved from RenderFieldset.
(WebCore::RenderBlock::adjustBorderBoxRectForPainting):
(WebCore::RenderBlock::paintRectToClipOutFromBorder):
These methods are used when painting to shrink the border box as needed to account for the legend and to
provide the portion of the border that needs to be clipped out. These methods have been enhanced to
properly support all writing modes.
(WebCore::RenderBlock::intrinsicBorderForFieldset):
(WebCore::RenderBlock::setIntrinsicBorderForFieldset):
(WebCore::RenderBlock::borderTop):
(WebCore::RenderBlock::borderLeft):
(WebCore::RenderBlock::borderBottom):
(WebCore::RenderBlock::borderRight):
(WebCore::RenderBlock::borderBefore):
These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
properly factored in.
(WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
* rendering/RenderBlock.h:
This method computes the preferred widths for legend children in order to ensure that the legend properly
grows the width of the fieldset when it is the widest item.
(WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
(WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
(and our old behavior).
(WebCore::RenderBlock::paintExcludedChildrenInBorder):
Method for painting the excluded children that might be present in our border. We only do this if the
paint phase is a box decoration painting phase and if the legend isn't self-painting.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns):
Allow fieldsets to create columns now.
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
get handled properly.
(WebCore::RenderBlockFlow::addChild):
Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
remain outside of it.
(WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
Renamed to layoutExcludedChildren.
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):
(WebCore::RenderBox::paintMask):
Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
order to properly shrink the border box rect for painting and to clip out the portion of the border
covered by the legend.
(WebCore::RenderBox::avoidsFloats):
Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
its removal, we need to put this in the base class along with legends.
* rendering/RenderBox.h:
(WebCore::RenderBox::isGridItem):
(WebCore::RenderBox::isFlexItem):
Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
(WebCore::RenderBox::adjustBorderBoxRectForPainting):
This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
Patched to properly paint fieldsets using the new helpers.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::FlexBoxIterator::next):
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/RenderElement.h:
Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
display types.
* rendering/RenderFieldset.cpp: Removed.
* rendering/RenderFieldset.h: Removed.
Remove RenderFieldset files from the tree.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
(WebCore::RenderFlexibleBox::firstLineBaseline):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
part of the flexible box layout.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::layoutGridItems):
Make sure grids lay out their legends properly by calling layoutExcludedChildren.
Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
part of the grid's layout.
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::populate):
Pull legends back up into the block and don't let them be part of the flow thread.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::requiresBalancing):
Fix an assert to allow legends to exist as siblings of multicolumn sets.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isFieldset):
Changed to examine the HTML element rather than RenderFieldset.
* rendering/RenderObject.h:
(WebCore::RenderObject::isExcludedFromNormalLayout):
(WebCore::RenderObject::setIsExcludedFromNormalLayout):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
the layout system and can be skipped.
(WebCore::RenderObject::isExcludedAndPlacedInBorder):
Helper method for asking if an object is painting inside the border. Used to know we
need to factor it into preferred width calculations outside of any one layout system
and also to know that we need to paint it when we paint the fieldset's border instead of
later (after we might have scrolled or clipped the child painting area).
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutExcludedChildren):
(WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
* rendering/RenderRubyRun.h:
Rename layoutSpecialExcludedChild to layoutExcludedChildren.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::adjustBorderBoxRectForPainting):
(WebCore::RenderTable::paintBoxDecorations):
(WebCore::RenderTable::paintMask):
(WebCore::RenderTable::subtractCaptionRect): Deleted.
* rendering/RenderTable.h:
Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
way.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBoxDecorations):
(WebCore::RenderTableCell::paintMask):
Make sure table cells adjust their border box rects for painting. Again this is prep work for
cells potentially being fieldsets, but not supported yet.
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::layoutExcludedChildren):
(WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
(WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
* rendering/RenderTextControlMultiLine.h:
Renamed the methods for doing the excluded child layout.
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
2017-03-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Tracks panel should clip and scroll content when numerous tracks are available
https://bugs.webkit.org/show_bug.cgi?id=169201
<rdar://problem/30867979>
Reviewed by Eric Carlson.
We now position and size the tracks panel dynamically and ensure a max-height is applied
to the panel so that it allows a margin of 10px above it within the media controls. We also
apply that same max-height to a new intermediary scrollable container for the track lists,
so that it scrolls independently of the container and the background tint.
Test: media/modern-media-controls/tracks-panel/tracks-panel-position-and-size.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.showTracksPanel): Deleted.
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .volume.slider):
(.media-controls.mac.inline .tracks-panel): Deleted.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.showTracksPanel): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
* Modules/modern-media-controls/controls/tracks-panel.css:
(.tracks-panel > .background-tint > div,):
(.tracks-panel > .scrollable-container):
(.tracks-panel section):
(.tracks-panel section:first-of-type):
(.tracks-panel section > h3):
(.tracks-panel section > ul):
(.tracks-panel section > ul > li):
(.tracks-panel section > ul > li:focus):
(.tracks-panel section > ul > li.selected:before):
(.tracks-panel section > ul > li.animated):
(.tracks-panel > .background-tint > div): Deleted.
(.tracks-panel > section): Deleted.
(.tracks-panel > section:first-of-type): Deleted.
(.tracks-panel > section > h3): Deleted.
(.tracks-panel > section > ul): Deleted.
(.tracks-panel > section > ul > li): Deleted.
(.tracks-panel > section > ul > li:focus): Deleted.
(.tracks-panel > section > ul > li.selected:before): Deleted.
(.tracks-panel > section > ul > li.animated): Deleted.
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.get maxHeight):
(TracksPanel.prototype.set maxHeight):
(TracksPanel.prototype.commitProperty):
(TracksPanel.prototype._childrenFromDataSource):
2017-03-06 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Stretch should grow and shrink items to fit its grid area
https://bugs.webkit.org/show_bug.cgi?id=163200
Reviewed by Darin Adler.
After some discussions the CSS WG agreed that stretch should not only
grow items, but also shrink them to fit its grid area.
That way the "min-width|height: auto" is somehow ignored for grid items.
More info at: https://github.com/w3c/csswg-drafts/issues/283
The good part is that this allows us to remove some ugly code we've
in RenderBox that was only used by Grid Layout.
For images, we'll be stretching on both axis right now, so the aspect
ratio won't be preserved. The default behavior might change in those
cases, but that should be implemented in a different patch.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::computeLogicalHeight):
2017-03-06 Miguel Gomez <magomez@igalia.com>
[GTK] WebProcess from WebKitGtk+ 2.15.x SIGSEVs in GIFLZWContext::doLZW(unsigned char const*, unsigned long) at Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp:303
https://bugs.webkit.org/show_bug.cgi?id=167304
Reviewed by Carlos Garcia Campos.
Add a lock to ensure that the GIFImageReader that we are using for decoding is not deleted while
the decoding thread is using it.
No new tests.
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::clearFrameBufferCache):
2017-03-06 Antti Koivisto <antti@apple.com>
Allow render tree building before loading stylesheet elements
https://bugs.webkit.org/show_bug.cgi?id=169079
<rdar://problem/30865709>
Reviewed by Andreas Kling.
Currently we don't resolve style or construct renderers if there are any pending
stylesheet loads. This patch enables style and renderer constuction up to the
first encountered loading style element.
This is a step toward allowing incremental rendering for in-body stylesheets.
* dom/Document.cpp:
(WebCore::Document::needsStyleRecalc):
Ensure scrolling to anchor eventually happens.
* dom/Document.h:
(WebCore::Document::isIgnoringPendingStylesheets):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::removedFrom):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* style/StyleScope.cpp:
(WebCore::Style::Scope::addPendingSheet):
(WebCore::Style::Scope::removePendingSheet):
Track pending sheet nodes in a map so we can test if a given node has a pending sheet.
This is also more robust in general.
(WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet):
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleScope.h:
(WebCore::Style::Scope::hasPendingSheet):
(WebCore::Style::Scope::hasPendingSheets):
(WebCore::Style::Scope::addPendingSheet): Deleted.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
Instead of global test for placeholder construction check the status of the pending sheet flag.
(WebCore::Style::hasLoadingStylesheet):
(WebCore::Style::TreeResolver::resolveComposedTree):
Set a flag when encountering a pending top level sheet during DOM traversal.
(WebCore::Style::TreeResolver::resolve):
* style/StyleTreeResolver.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
Ensure SVG images have layout before getting the size.
2017-03-06 Vanessa Chipirrás Navalón <vchipirras@igalia.com>
[GStreamer] Adopt nullptr
https://bugs.webkit.org/show_bug.cgi?id=123438
Reviewed by Xabier Rodriguez-Calvar.
To adapt the code to the C++11 standard, all NULL or 0 pointers have been changed to nullptr.
* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleNewDeinterleavePad):
(WebCore::AudioFileReader::plugDeinterleave):
(WebCore::AudioFileReader::decodeAudioForBusCreation):
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::configureAudioBin):
(WebCore::AudioSourceProviderGStreamer::setClient):
(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webkit_web_audio_src_init):
(webKitWebAudioSrcLoop):
(webKitWebAudioSrcChangeState):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::setEnabled):
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
(WebCore::initializeGStreamerAndRegisterWebKitElements):
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::newTextSample):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContents):
Removed the unused second argument on processTableOfContentsEntry function.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
Removed the unused second argument on this function.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Removed the unused second argument on processTableOfContentsEntry function.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
(WebCore::MediaPlayerPrivateGStreamerBase::muted):
(WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfMute):
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
(WebCore::MediaPlayerPrivateGStreamerBase::decodedFrameCount):
(WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webkit_text_combiner_init):
(webkitTextCombinerPadEvent):
(webkitTextCombinerRequestNewPad):
(webkitTextCombinerNew):
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkNew):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkit_video_sink_init):
(webkitVideoSinkProposeAllocation):
(webkitVideoSinkNew):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::setSelected):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcDispose):
(webKitWebSrcSetProperty):
(webKitWebSrcStop):
(webKitWebSrcChangeState):
(webKitWebSrcQueryWithParent):
(webKitWebSrcGetProtocols):
(StreamingClient::handleResponseReceived):
(StreamingClient::handleDataReceived):
(ResourceHandleStreamingClient::didFail):
(ResourceHandleStreamingClient::wasBlocked):
(ResourceHandleStreamingClient::cannotShowURL):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcGetProtocols):
2017-03-06 Andreas Kling <akling@apple.com>
[iOS] Report domains crashing under memory pressure via enhanced privacy logging.
<https://webkit.org/b/169133>
<rdar://problem/29964017>
Reviewed by Antti Koivisto.
* page/DiagnosticLoggingKeys.h:
2017-03-05 Simon Fraser <simon.fraser@apple.com>
Avoid backing store for layers with empty text nodes in a few more cases
https://bugs.webkit.org/show_bug.cgi?id=169185
Reviewed by Dan Bernstein.
In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
whitespace text.
Covered by existing tests.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
2017-03-05 Chris Dumez <cdumez@apple.com>
Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename()
https://bugs.webkit.org/show_bug.cgi?id=169066
Reviewed by Sam Weinig.
Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename().
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2017-03-05 Chris Dumez <cdumez@apple.com>
Using <form> in <template> causes following <form> to get swallowed
https://bugs.webkit.org/show_bug.cgi?id=163552
Reviewed by Sam Weinig.
As per the HTML specification [1], when finding a "form" tag in the "in body"
insertion mode, we should insert an HTML element for the token, and, if there
is no template element on the stack of open elements, set the form element
pointer to point to the element created.
We were missing the "if there is no template element on the stack of open
elements" check and setting the form element pointer unconditionally.
This patch fixes the issue.
[1] https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody:form-element-pointer-2
Test: fast/parser/form-after-template.html
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLFormElement):
2017-03-04 Myles C. Maxfield <mmaxfield@apple.com>
Update CSSFontSelector's matching algorithm to understand ranges
https://bugs.webkit.org/show_bug.cgi?id=168892
Reviewed by Jon Lee.
This patch migrates the font selection algorithm out of FontCacheCoreText and into its own file which can be shared
among all ports. It then migrates our web font selection algorithm to use it.
This patch doesn't actually change the parsing rules; it just changes the internal machinery for how fonts get
selected. Therefore, this patch simply makes zero-length ranges from the discrete values the parser emits, and passes
those zero-length ranges to the range-based font selection routine. This means that this patch doesn't actually
change the results of the font selection algorithm.
One of the inputs to the new font selection algorithm is font-stretch, which previously was not parsed inside
@font-face blocks or the CSS Font Loading API. This patch therefore adds parsing support and modifies the existing
tests for these pieces to expect parsing to work. Because the font selection algorithm itself is shared between
installed fonts and webfonts, this patch doesn't add any additional tests for it (because it is already covered under
existing tests).
No new tests because there is no behavior change.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj: Add new file for the font selection algorithm.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::calculateStretch): Used on @font-face blocks and the CSS Font Loading API.
(WebCore::CSSFontFace::setStretch): Fill out the previously stubbed function.
* css/CSSFontFace.h: Add the range member variable to CSSFontFaces.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered): Now that we care about font-stretch, we need to
look it up for local fonts too. This current approach of an extra FontSelectionValue hanging around with a
FontTraitsMask is very ugly and will be removed soon (https://bugs.webkit.org/show_bug.cgi?id=168889 and
https://bugs.webkit.org/show_bug.cgi?id=168890).
(WebCore::computeFontStretch): Used on @font-face blocks and the CSS Font Loading API.
(WebCore::CSSFontFaceSet::matchingFaces): Educate about font-stretch.
(WebCore::CSSFontFaceSet::fontFace): Migrate to the new font-selection algorithm.
(WebCore::fontFaceComparator): Deleted.
* css/CSSFontFaceSet.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Educate about font-stretch.
(WebCore::CSSFontSelector::fontRangesForFamily): Ditto.
* css/FontFace.cpp:
(WebCore::FontFace::setStretch): Ditto.
(WebCore::FontFace::stretch): Ditto.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseFontFaceDescriptor): Ditto.
* platform/graphics/FontCache.h: Ditto.
* platform/graphics/FontDescription.h:
* platform/graphics/FontSelectionAlgorithm.cpp: Added.
(WebCore::FontSelectionAlgorithm::filterCapability):
(WebCore::FontSelectionAlgorithm::indexOfBestCapabilities):
(WebCore::fontSelectionRequestForTraitsMask):
(WebCore::initialFontSelectionCapabilitiesForTraitsMask):
(WebCore::fontSelectionCapabilitiesForTraitsMask):
* platform/graphics/FontSelectionAlgorithm.h: Added. Taken from FontCacheCoreText.cpp.
(WebCore::FontSelectionValue::FontSelectionValue):
(WebCore::FontSelectionValue::operator float):
(WebCore::FontSelectionValue::rawValue):
(WebCore::FontSelectionValue::maximumValue):
(WebCore::FontSelectionValue::minimumValue):
(WebCore::FontSelectionValue::operator+):
(WebCore::FontSelectionValue::operator-):
(WebCore::FontSelectionValue::operator*):
(WebCore::FontSelectionValue::operator/):
(WebCore::FontSelectionValue::operator==):
(WebCore::FontSelectionValue::operator!=):
(WebCore::FontSelectionValue::operator<):
(WebCore::FontSelectionValue::operator<=):
(WebCore::FontSelectionValue::operator>):
(WebCore::FontSelectionValue::operator>=):
(WebCore::FontSelectionRange::isValid):
(WebCore::FontSelectionRange::expand):
(WebCore::FontSelectionRange::includes):
(WebCore::FontSelectionRequest::operator==):
(WebCore::FontSelectionRequest::operator!=):
(WebCore::FontSelectionRequestKey::FontSelectionRequestKey):
(WebCore::FontSelectionRequestKey::isHashTableDeletedValue):
(WebCore::FontSelectionRequestKey::operator==):
(WebCore::FontSelectionRequestKeyHash::hash):
(WebCore::FontSelectionRequestKeyHash::equal):
(WebCore::FontSelectionCapabilities::expand):
(WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm):
(WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
(WebCore::FontSelectionAlgorithm::iterateActiveCapabilities):
* platform/graphics/cocoa/FontCacheCoreText.cpp: Moved to FontSelectionAlgorithm.
(WebCore::stretchFromCoreTextTraits):
(WebCore::FontDatabase::capabilitiesForFontDescriptor):
(WebCore::findClosestFont):
(WebCore::calculateFontSelectionRequest):
(WebCore::platformFontLookupWithFamily):
(WebCore::FontCache::getTraitsInFamily): Deleted.
(WebCore::iterateActiveFontsWithReturn): Deleted.
(WebCore::iterateActiveFonts): Deleted.
(WebCore::findClosestStretch): Deleted.
(WebCore::filterStretch): Deleted.
(WebCore::findClosestStyle): Deleted.
(WebCore::filterStyle): Deleted.
(WebCore::findClosestWeight): Deleted.
(WebCore::filterWeight): Deleted.
(WebCore::computeTargetWeight): Deleted.
* platform/text/TextFlags.h: Moved to FontSelectionAlgorithm.
(WebCore::FontSelectionValue::FontSelectionValue): Deleted.
(WebCore::FontSelectionValue::operator float): Deleted.
(WebCore::FontSelectionValue::operator+): Deleted.
(WebCore::FontSelectionValue::operator-): Deleted.
(WebCore::FontSelectionValue::operator*): Deleted.
(WebCore::FontSelectionValue::operator/): Deleted.
(WebCore::FontSelectionValue::operator==): Deleted.
(WebCore::FontSelectionValue::operator!=): Deleted.
(WebCore::FontSelectionValue::operator<): Deleted.
(WebCore::FontSelectionValue::operator<=): Deleted.
(WebCore::FontSelectionValue::operator>): Deleted.
(WebCore::FontSelectionValue::operator>=): Deleted.
(WebCore::FontSelectionValue::rawValue): Deleted.
(WebCore::FontSelectionValue::maximumValue): Deleted.
(WebCore::FontSelectionValue::minimumValue): Deleted.
(WebCore::FontSelectionRange::isValid): Deleted.
(WebCore::FontSelectionRange::expand): Deleted.
(WebCore::FontSelectionRange::includes): Deleted.
(WebCore::FontSelectionCapabilities::expand): Deleted.
2017-03-05 Simon Fraser <simon.fraser@apple.com>
Make some RenderLayer tree traversal in RenderLayerBacking more generic
https://bugs.webkit.org/show_bug.cgi?id=169177
Reviewed by Zalan Bujtas.
The real goal of this patch is reduce the number of callers of
RenderLayerBacking::isPaintDestinationForDescendantLayers() to one. To achieve that,
have the setContentsVisible() logic (which is really just about the CSS 'visibility' property)
do its own tree traversal which just consults layer.hasVisibleContent(). So
make descendantLayerPaintsIntoAncestor() a generic traversal function which walks
descendant layers which may paint into the target layer. The "Visible" in the name
reflects the fact that it can bypass a subtree for a layer with !hasVisibleDescendant().
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):
(WebCore::traverseVisibleNonCompositedDescendantLayers):
(WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
(WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
(WebCore::descendantLayerPaintsIntoAncestor): Deleted.
* rendering/RenderLayerBacking.h:
2017-03-04 Simon Fraser <simon.fraser@apple.com>
Clarify some terminology in RenderLayerBacking
https://bugs.webkit.org/show_bug.cgi?id=169174
Reviewed by Zalan Bujtas.
Rename some functions related to directly-composited background images and
box decorations for clarify.
Only behavior change is for canDirectlyCompositeBackgroundBackgroundImage() to check
GraphicsLayer::supportsContentsTiling(), which means that RenderLayerBacking::contentChanged()
will no longer trigger a updateGeometry() when it gets BackgroundImageChanged on non-
CoordinateGraphics platforms.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateAfterDescendants):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
(WebCore::hasPaintedBoxDecorationsOrBackgroundImage):
(WebCore::supportsDirectlyCompositedBoxDecorations):
(WebCore::RenderLayerBacking::paintsBoxDecorations):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
(WebCore::RenderLayerBacking::contentChanged):
(WebCore::RenderLayerBacking::updateDirectlyCompositedContents): Deleted.
(WebCore::canCreateTiledImage): Deleted.
(WebCore::hasVisibleBoxDecorationsOrBackgroundImage): Deleted.
(WebCore::supportsDirectBoxDecorationsComposition): Deleted.
* rendering/RenderLayerBacking.h:
2017-03-04 Alex Christensen <achristensen@webkit.org>
Cleanup after r213418
https://bugs.webkit.org/show_bug.cgi?id=169165
Reviewed by Youenn Fablet.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData):
Restore the assertion I removed.
2017-03-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r213379.
https://bugs.webkit.org/show_bug.cgi?id=169169
broke GTK+ and Windows builds (Requested by mcatanzaro on
#webkit).
Reverted changeset:
"Enable fieldsets to be flexboxes, grids and multicolumn."
https://bugs.webkit.org/show_bug.cgi?id=169082
http://trac.webkit.org/changeset/213379
2017-03-03 Youenn Fablet <youenn@apple.com>
[WebRTC] Update libwebrtc source code
https://bugs.webkit.org/show_bug.cgi?id=168599
Reviewed by Alex Christensen.
* Modules/mediastream/RTCStatsReport.h:
* Modules/mediastream/RTCStatsReport.idl:
Update to match the latest spec, which matches the new structures in libwebrtc.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData):
Comment out an assertion that was failing. We should revisit this.
* testing/MockLibWebRTCPeerConnection.h:
2017-03-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r213400.
https://bugs.webkit.org/show_bug.cgi?id=169163
Caused frequent assertion failures (Requested by ap on
#webkit).
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/213400
2017-03-03 Andy Estes <aestes@apple.com>
Add support for canvas.toBlob
https://bugs.webkit.org/show_bug.cgi?id=148878
Reviewed by Tim Horton.
Address additional review feedback received after r213412 landed.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toBlob): Passed null to the blob callback if blob conversion
fails for any reason.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::cgImage): Removed an unnecessary local variable.
2017-03-03 Andy Estes <aestes@apple.com>
Add support for canvas.toBlob
https://bugs.webkit.org/show_bug.cgi?id=148878
<rdar://problem/22590406>
Reviewed by Tim Horton.
These tests now pass:
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/BlobCallback.cpp: Added.
(WebCore::BlobCallback::scheduleCallback):
* fileapi/BlobCallback.h: Added.
(WebCore::BlobCallback::~BlobCallback):
* fileapi/BlobCallback.idl: Added.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toBlob):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::writeFunction):
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageBuffer::toData):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::data):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageBuffer::toData):
(WebCore::ImageBuffer::toCGImage):
(WebCore::cgImage):
(WebCore::dataURL):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageBuffer::toData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::toData):
2017-03-03 Dean Jackson <dino@apple.com>
Add WebGPU compile flag and experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=169161
<rdar://problem/30846689>
Reviewed by Tim Horton.
Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
and an InternalSetting.
* Configurations/FeatureDefines.xcconfig:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
(WebCore::RuntimeEnabledFeatures::webGPUEnabled):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebGPUEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2017-03-03 Simon Fraser <simon.fraser@apple.com>
Clean up some RenderLayerBacking code
https://bugs.webkit.org/show_bug.cgi?id=169160
Reviewed by Dean Jackson.
Modern loops in descendantLayerPaintsIntoAncestor().
Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
it refers to renderers, not RenderLayers.
Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
"Paints" already implies non-composited.
No behavior change.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::paintsBoxDecorations):
(WebCore::RenderLayerBacking::paintsChildRenderers):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
(WebCore::descendantLayerPaintsIntoAncestor):
(WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
(WebCore::RenderLayerBacking::paintsChildren): Deleted.
* rendering/RenderLayerBacking.h:
2017-03-03 Simon Fraser <simon.fraser@apple.com>
Clean up RenderImage and a RenderImageResource function
https://bugs.webkit.org/show_bug.cgi?id=169153
Reviewed by Zalan Bujtas.
Change all calls to imageResource().cachedImage() in RenderImage to use the inline
cachedImage() function.
In RenderImage::paintReplaced(), early return after the broken image block (and no need
to test imageResource().hasImage() again in the second condition). Convert height/width to size,
which also forces us to be explicit about using flooredIntSize() when fetching the image
(perhaps this should be a roundedIntSize, but I didn't want to change behavior).
Change RenderImageResource::image() to take an IntSize, rather than int height and width.
No behavior change.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::styleDidChange):
(WebCore::RenderImage::imageChanged):
(WebCore::RenderImage::notifyFinished):
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
(WebCore::RenderImage::embeddedContentBox):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::image):
* rendering/RenderImageResource.h:
(WebCore::RenderImageResource::image):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::image):
* rendering/RenderImageResourceStyleImage.h:
2017-03-03 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-03 Chris Dumez <cdumez@apple.com>
[iOS] Throttle SVG SMIL animations to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169137
<rdar://problem/30833754>
Reviewed by Simon Fraser.
Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
battery.
Test: svg/animations/animations-lowPowerMode-throttling.html
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):
* svg/SVGSVGElement.idl:
* svg/animation/SMILTime.h:
(WebCore::SMILTime::SMILTime):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::SMILTimeContainer):
(WebCore::SMILTimeContainer::animationFrameDelay):
(WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SMILTimeContainer.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime):
* testing/Internals.cpp:
(WebCore::Internals::svgAnimationsInterval):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-03 Joseph Pecoraro <pecoraro@apple.com>
[Mac] WebCore.framework is missing a symlink from Frameworks to Versions/Current/Frameworks when the latter exists
https://bugs.webkit.org/show_bug.cgi?id=169067
Reviewed by Dan Bernstein.
* WebCore.xcodeproj/project.pbxproj:
2017-03-03 Sam Weinig <sam@webkit.org>
REGRESSION (r209760): Apple Pay doesn't work on casper.com, shopspring.com, maybe other sites
<rdar://problem/30313445>
https://bugs.webkit.org/show_bug.cgi?id=169149
Reviewed by Simon Fraser.
Relax restriction that the ApplePayShippingMethod sequence must not be empty. This
was incorrect.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
2017-03-03 Alex Christensen <achristensen@webkit.org>
[URLParser] Fix file: as a relative file URL
https://bugs.webkit.org/show_bug.cgi?id=169122
Reviewed by Tim Horton.
This is clearly defined in https://url.spec.whatwg.org/#file-state with the EOF code point.
I got it wrong and didn't test it. It's been added to the web platform tests since we last updated.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2017-03-03 Dave Hyatt <hyatt@apple.com>
Enable fieldsets to be flexboxes, grids and multicolumn.
https://bugs.webkit.org/show_bug.cgi?id=169082
Reviewed by Simon Fraser.
Added new tests in fast/forms/fieldset.
This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
derived classes can also be fieldsets.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove RenderFieldset from the project.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::titleUIElement):
Call in to RenderBlock now instead of RenderFieldset.
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::createElementRenderer):
* html/HTMLFieldSetElement.h:
The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
can be supported. A special flag has been added that indicates only to make flexbox and block-related
renderers (not table display types).
* rendering/OrderIterator.cpp:
(WebCore::OrderIterator::shouldSkipChild):
(WebCore::OrderIteratorPopulator::collectChild):
* rendering/OrderIterator.h:
Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
excluded children like the legends of fieldsets.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlockRareData::RenderBlockRareData):
When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
across any layout system, since the legend is now just treated as part of the border.
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
preferred width in their own way and not as part of a specific layout system.
(WebCore::RenderBlock::renderName):
Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
(WebCore::RenderBlock::layoutExcludedChildren):
Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
the layout of legends by both placing them and setting the correct intrinsic border before amount on the
block.
(WebCore::RenderBlock::findFieldsetLegend):
Moved from RenderFieldset.
(WebCore::RenderBlock::adjustBorderBoxRectForPainting):
(WebCore::RenderBlock::paintRectToClipOutFromBorder):
These methods are used when painting to shrink the border box as needed to account for the legend and to
provide the portion of the border that needs to be clipped out. These methods have been enhanced to
properly support all writing modes.
(WebCore::RenderBlock::intrinsicBorderForFieldset):
(WebCore::RenderBlock::setIntrinsicBorderForFieldset):
(WebCore::RenderBlock::borderTop):
(WebCore::RenderBlock::borderLeft):
(WebCore::RenderBlock::borderBottom):
(WebCore::RenderBlock::borderRight):
(WebCore::RenderBlock::borderBefore):
These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
properly factored in.
(WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
* rendering/RenderBlock.h:
This method computes the preferred widths for legend children in order to ensure that the legend properly
grows the width of the fieldset when it is the widest item.
(WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
(WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
(and our old behavior).
(WebCore::RenderBlock::paintExcludedChildrenInBorder):
Method for painting the excluded children that might be present in our border. We only do this if the
paint phase is a box decoration painting phase and if the legend isn't self-painting.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns):
Allow fieldsets to create columns now.
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
get handled properly.
(WebCore::RenderBlockFlow::addChild):
Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
remain outside of it.
(WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
Renamed to layoutExcludedChildren.
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):
(WebCore::RenderBox::paintMask):
Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
order to properly shrink the border box rect for painting and to clip out the portion of the border
covered by the legend.
(WebCore::RenderBox::avoidsFloats):
Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
its removal, we need to put this in the base class along with legends.
* rendering/RenderBox.h:
(WebCore::RenderBox::isGridItem):
(WebCore::RenderBox::isFlexItem):
Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
(WebCore::RenderBox::adjustBorderBoxRectForPainting):
This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
Patched to properly paint fieldsets using the new helpers.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::FlexBoxIterator::next):
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/RenderElement.h:
Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
display types.
* rendering/RenderFieldset.cpp: Removed.
* rendering/RenderFieldset.h: Removed.
Remove RenderFieldset files from the tree.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
(WebCore::RenderFlexibleBox::firstLineBaseline):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
part of the flexible box layout.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::layoutGridItems):
Make sure grids lay out their legends properly by calling layoutExcludedChildren.
Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
part of the grid's layout.
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::populate):
Pull legends back up into the block and don't let them be part of the flow thread.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::requiresBalancing):
Fix an assert to allow legends to exist as siblings of multicolumn sets.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isFieldset):
Changed to examine the HTML element rather than RenderFieldset.
* rendering/RenderObject.h:
(WebCore::RenderObject::isExcludedFromNormalLayout):
(WebCore::RenderObject::setIsExcludedFromNormalLayout):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
the layout system and can be skipped.
(WebCore::RenderObject::isExcludedAndPlacedInBorder):
Helper method for asking if an object is painting inside the border. Used to know we
need to factor it into preferred width calculations outside of any one layout system
and also to know that we need to paint it when we paint the fieldset's border instead of
later (after we might have scrolled or clipped the child painting area).
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutExcludedChildren):
(WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
* rendering/RenderRubyRun.h:
Rename layoutSpecialExcludedChild to layoutExcludedChildren.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::adjustBorderBoxRectForPainting):
(WebCore::RenderTable::paintBoxDecorations):
(WebCore::RenderTable::paintMask):
(WebCore::RenderTable::subtractCaptionRect): Deleted.
* rendering/RenderTable.h:
Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
way.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBoxDecorations):
(WebCore::RenderTableCell::paintMask):
Make sure table cells adjust their border box rects for painting. Again this is prep work for
cells potentially being fieldsets, but not supported yet.
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::layoutExcludedChildren):
(WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
(WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
* rendering/RenderTextControlMultiLine.h:
Renamed the methods for doing the excluded child layout.
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
2017-03-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213344.
This changed caused LayoutTest crashes under GuardMalloc.
Reverted changeset:
"Add support for canvas.toBlob"
https://bugs.webkit.org/show_bug.cgi?id=148878
http://trac.webkit.org/changeset/213344
2017-03-03 Konstantin Tokarev <annulen@yandex.ru>
Unreviewed typo fix
* features.json:
2017-03-03 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Remove #if USE(VIDEOTOOLBOX) from AVVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=169131
Reviewed by Youenn Fablet.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::currentFrameCGImage):
2017-03-03 Chris Dumez <cdumez@apple.com>
Add assertion in Frame::setView() to make sure associated document has no living render tree
https://bugs.webkit.org/show_bug.cgi?id=169134
Reviewed by Brent Fulgham.
Add assertion in Frame::setView() to make sure associated document has no living render tree.
This is not supposed to happen and r213311 fixed one case where this could happen. We need
to find out if it can still happen.
* page/Frame.cpp:
(WebCore::Frame::setView):
2017-03-02 Sam Weinig <sam@webkit.org>
Rename htmlediting.h/cpp to Editing.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=169103
Reviewed by Alex Christensen.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
* accessibility/AccessibilityNodeObject.cpp:
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityRenderObject.cpp:
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* dom/Document.cpp:
* dom/Element.cpp:
* dom/Node.h:
* dom/Position.cpp:
* dom/PositionIterator.cpp:
* dom/Range.cpp:
* editing/AlternativeTextController.cpp:
* editing/AppendNodeCommand.cpp:
* editing/ApplyBlockElementCommand.cpp:
* editing/ApplyStyleCommand.cpp:
* editing/BreakBlockquoteCommand.cpp:
* editing/CompositeEditCommand.cpp:
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::CreateLinkCommand):
* editing/DeleteFromTextNodeCommand.cpp:
* editing/DeleteSelectionCommand.cpp:
* editing/EditCommand.cpp:
* editing/Editing.cpp: Copied from Source/WebCore/editing/htmlediting.cpp.
* editing/Editing.h: Copied from Source/WebCore/editing/htmlediting.h.
* editing/EditingAllInOne.cpp:
* editing/EditingStyle.cpp:
* editing/Editor.cpp:
* editing/EditorCommand.cpp:
* editing/FormatBlockCommand.cpp:
* editing/FrameSelection.cpp:
* editing/HTMLInterchange.cpp:
* editing/IndentOutdentCommand.cpp:
* editing/InsertLineBreakCommand.cpp:
* editing/InsertListCommand.cpp:
* editing/InsertNodeBeforeCommand.cpp:
* editing/InsertParagraphSeparatorCommand.cpp:
* editing/InsertTextCommand.cpp:
* editing/ModifySelectionListLevel.cpp:
* editing/RemoveNodeCommand.cpp:
* editing/ReplaceNodeWithSpanCommand.cpp:
* editing/ReplaceSelectionCommand.cpp:
* editing/SpellChecker.cpp:
* editing/TextIterator.cpp:
* editing/TypingCommand.cpp:
* editing/VisiblePosition.cpp:
* editing/VisibleSelection.cpp:
* editing/VisibleUnits.cpp:
* editing/cocoa/DataDetection.mm:
* editing/cocoa/EditorCocoa.mm:
* editing/htmlediting.cpp: Removed.
* editing/htmlediting.h: Removed.
* editing/ios/EditorIOS.mm:
* editing/mac/DictionaryLookup.mm:
* editing/mac/EditorMac.mm:
* editing/markup.cpp:
* html/HTMLTextFormControlElement.cpp:
* inspector/InspectorDOMAgent.cpp:
* page/DOMSelection.cpp:
* page/DragController.cpp:
* page/EventHandler.cpp:
* page/FocusController.cpp:
* page/Frame.cpp:
* platform/ios/PasteboardIOS.mm:
* platform/mac/PasteboardMac.mm:
* rendering/RenderBox.cpp:
* rendering/RenderObject.cpp:
2017-03-02 Matt Baker <mattbaker@apple.com>
Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
https://bugs.webkit.org/show_bug.cgi?id=169086
Reviewed by Joseph Pecoraro.
Test: inspector/dom/push-node-by-path-to-frontend.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::nodeForPath):
During top-down document traversal, descend into content document nodes
when visiting an HTMLFrameOwnerElement.
2017-03-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213274.
This change caused flakiness with LayoutTest memory/memory-
pressure-simulation.html
Reverted changeset:
"Don't keep dead resources in MemoryCache while under memory
pressure."
https://bugs.webkit.org/show_bug.cgi?id=169070
http://trac.webkit.org/changeset/213274
2017-03-02 Jiewen Tan <jiewen_tan@apple.com>
WebCrypto API support for AES-GCM
https://bugs.webkit.org/show_bug.cgi?id=157175
<rdar://problem/27311691>
Reviewed by Brent Fulgham.
This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
crypto/subtle/aes-gcm-generate-export-raw-key.html
crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
crypto/subtle/aes-gcm-generate-key.html
crypto/subtle/aes-gcm-import-jwk-key-length-128.html
crypto/subtle/aes-gcm-import-jwk-key-length-192.html
crypto/subtle/aes-gcm-import-jwk-key-length-256.html
crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
crypto/subtle/aes-gcm-import-key-decrypt.html
crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
crypto/subtle/aes-gcm-import-key-encrypt.html
crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
crypto/subtle/aes-gcm-import-raw-key.html
crypto/workers/subtle/aes-gcm-import-key-decrypt.html
crypto/workers/subtle/aes-gcm-import-key-encrypt.html
crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
Add CryptoAlgorithmAES_CFBMac.cpp as well.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
Add support for AES-GCM.
* crypto/CommonCryptoUtilities.h:
Include SPI header for AES-GCM support. We have a mismatch SPI between different OS version.
Therefore, a guardian is placed.
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
(WebCore::tagLengthIsValid):
(WebCore::CryptoAlgorithmAES_GCM::create):
(WebCore::CryptoAlgorithmAES_GCM::identifier):
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::generateKey):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
(WebCore::CryptoAlgorithmAES_GCM::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
* crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
(WebCore::encryptAES_GCM):
(WebCore::decyptAES_GCM):
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/AesGcmParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
2017-03-02 Andy Estes <aestes@apple.com>
Add support for canvas.toBlob
https://bugs.webkit.org/show_bug.cgi?id=148878
<rdar://problem/22590406>
Reviewed by Tim Horton.
These tests now pass:
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/BlobCallback.cpp: Added.
(WebCore::BlobCallback::scheduleCallback):
* fileapi/BlobCallback.h: Added.
(WebCore::BlobCallback::~BlobCallback):
* fileapi/BlobCallback.idl: Added.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toBlob):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::writeFunction):
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageBuffer::toData):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::data):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageBuffer::toData):
(WebCore::ImageBuffer::toCGImage):
(WebCore::cgImage):
(WebCore::dataURL):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageBuffer::toData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::toData):
2017-03-02 Myles C. Maxfield <mmaxfield@apple.com>
Migrate font-stretch to use fixed-point values
https://bugs.webkit.org/show_bug.cgi?id=169107
Reviewed by Dean Jackson.
There are a few benefits of using fixed-point values:
- Not all of the entropy of a float is necessary for font selection. In particular, values are
expected to stay between around -1000 to 1000, and only need to have a few fractional bits.
Therefore, the values can be represented by 16-bit fixed point numbers, which includes one sign
bit and two fractional bits. This is smaller than the 32-bit floating point numbers we were
using, which means FontDescription can be slimmed down. This becomes even more important when
the rest of the variation font properties are implemented, since those will use these fixed-
point values too.
- Fixed point values have a larger distance between adjacent representable values, which means
there are more collisions, which means our cache hit rates are higher.
No new tests because there is no behavior change.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontStretchFromStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStretch):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::stretch):
(WebCore::FontDescription::setStretch):
(WebCore::FontCascadeDescription::initialStretch):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::defaultFontSelectionValues):
(WebCore::preparePlatformFont):
(WebCore::FontDatabase::InstalledFont::InstalledFont):
(WebCore::FontDatabase::InstalledFontFamily::expand):
(WebCore::FontDatabase::capabilitiesForFontDescriptor):
(WebCore::FontDatabase::stretchThreshold):
(WebCore::FontDatabase::italicThreshold):
(WebCore::FontDatabase::weightThreshold):
(WebCore::findClosestStretch):
(WebCore::filterStretch):
(WebCore::findClosestStyle):
(WebCore::filterStyle):
(WebCore::findClosestWeight):
(WebCore::filterWeight):
(WebCore::computeTargetWeight):
(WebCore::findClosestFont):
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
(WebCore::defaultVariationValues): Deleted.
(WebCore::FontDatabase::Range::Range): Deleted.
(WebCore::FontDatabase::Range::isValid): Deleted.
(WebCore::FontDatabase::Range::expand): Deleted.
(WebCore::FontDatabase::Range::includes): Deleted.
(): Deleted.
* platform/text/TextFlags.h:
(WebCore::FontSelectionValue::FontSelectionValue):
(WebCore::FontSelectionValue::operator float):
(WebCore::FontSelectionValue::operator+):
(WebCore::FontSelectionValue::operator-):
(WebCore::FontSelectionValue::operator*):
(WebCore::FontSelectionValue::operator/):
(WebCore::FontSelectionValue::operator==):
(WebCore::FontSelectionValue::operator!=):
(WebCore::FontSelectionValue::operator<):
(WebCore::FontSelectionValue::operator<=):
(WebCore::FontSelectionValue::operator>):
(WebCore::FontSelectionValue::operator>=):
(WebCore::FontSelectionValue::rawValue):
(WebCore::FontSelectionRange::isValid):
(WebCore::FontSelectionRange::expand):
(WebCore::FontSelectionRange::includes):
(WebCore::FontSelectionCapabilities::expand):
2017-03-02 Alex Christensen <achristensen@webkit.org>
Modernize ContentExtensionParser
https://bugs.webkit.org/show_bug.cgi?id=169106
Reviewed by Andy Estes.
We were returning std::error_code and passing the return value as a parameter reference.
because we wrote this code before we had WTF::Expected.
No change in behavior, verified by many API tests.
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadRule):
(WebCore::ContentExtensions::loadEncodedRules):
(WebCore::ContentExtensions::parseRuleList):
* contentextensions/ContentExtensionParser.h:
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
* contentextensions/ContentExtensionRule.h:
2017-03-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213301.
This change broke internal builds.
Reverted changeset:
"WebCrypto API support for AES-GCM"
https://bugs.webkit.org/show_bug.cgi?id=157175
http://trac.webkit.org/changeset/213301
2017-03-02 Aakash Jain <aakash_jain@apple.com>
Move stringMatchesWildcardString from WebKit2 to WebCore
https://bugs.webkit.org/show_bug.cgi?id=169065
Reviewed by Alexey Proskuryakov.
* WebCore.xcodeproj/project.pbxproj: Added StringUtilities.h and StringUtilities.mm
* PlatformMac.cmake: Added StringUtilities.mm
* platform/mac/StringUtilities.h: Added.
* platform/mac/StringUtilities.mm: Added.
(WebCore::wildcardRegexPatternString): Added.
(WebCore::stringMatchesWildcardString): Added.
2017-02-28 Matt Rajca <mrajca@apple.com>
Media: send "did interfere with playback" events when the user pauses an autoplaying element
https://bugs.webkit.org/show_bug.cgi?id=169006
Reviewed by Alex Christensen.
Added API tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pauseInternal):
2017-03-02 Chris Dumez <cdumez@apple.com>
We should prevent load of subframes inserted during FrameTree deconstruction
https://bugs.webkit.org/show_bug.cgi?id=169095
Reviewed by Brent Fulgham.
When deconstructing the FrameTree, we fire the unload event in each subframe.
Such unload event handler may insert a new frame, we would previously load
such new frame which was unsafe as we would end up with an attached subframe
on a detached tree. To address the issue, we prevent new subframes from loading
while deconstructing the FrameTree and firing the unload events. This new
behavior is consistent with Chrome and should therefore be safe from a
compatibility standpoint.
Test: fast/frames/insert-frame-unload-handler.html
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::disconnectSubframes):
Update SubframeLoadingDisabler call site now that the constructor takes in
a pointer instead of a reference.
* html/HTMLFrameOwnerElement.h:
(WebCore::SubframeLoadingDisabler::SubframeLoadingDisabler):
(WebCore::SubframeLoadingDisabler::~SubframeLoadingDisabler):
Update SubframeLoadingDisabler constructor to take in a pointer instead
of a reference, for convenience.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::detachChildren):
Prevent loads in subframes while detaching the subframes. It would be unsafe
as we copy the list of frames before iterating to fire the unload events.
Therefore, newly inserted frames would not get unloaded.
2017-03-02 Dave Hyatt <hyatt@apple.com>
flex-basis should be 0% (not 0px) when omitted
https://bugs.webkit.org/show_bug.cgi?id=169100
rdar://problem/30429154
Reviewed by Dean Jackson.
Covered by existing tests.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeFlex):
2017-02-22 Jiewen Tan <jiewen_tan@apple.com>
WebCrypto API support for AES-GCM
https://bugs.webkit.org/show_bug.cgi?id=157175
<rdar://problem/27311691>
Reviewed by Brent Fulgham.
This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
crypto/subtle/aes-gcm-generate-export-raw-key.html
crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
crypto/subtle/aes-gcm-generate-key.html
crypto/subtle/aes-gcm-import-jwk-key-length-128.html
crypto/subtle/aes-gcm-import-jwk-key-length-192.html
crypto/subtle/aes-gcm-import-jwk-key-length-256.html
crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
crypto/subtle/aes-gcm-import-key-decrypt.html
crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
crypto/subtle/aes-gcm-import-key-encrypt.html
crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
crypto/subtle/aes-gcm-import-raw-key.html
crypto/workers/subtle/aes-gcm-import-key-decrypt.html
crypto/workers/subtle/aes-gcm-import-key-encrypt.html
crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
Add CryptoAlgorithmAES_CFBMac.cpp as well.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
Add support for AES-GCM.
* crypto/CommonCryptoUtilities.h:
Include SPI header for AES-GCM support.
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
(WebCore::tagLengthIsValid):
(WebCore::CryptoAlgorithmAES_GCM::create):
(WebCore::CryptoAlgorithmAES_GCM::identifier):
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::generateKey):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
(WebCore::CryptoAlgorithmAES_GCM::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
* crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
(WebCore::encryptAES_GCM):
(WebCore::decyptAES_GCM):
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/AesGcmParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
2017-03-02 Alex Christensen <achristensen@webkit.org>
Continue enabling WebRTC
https://bugs.webkit.org/show_bug.cgi?id=169056
Reviewed by Jon Lee.
* Configurations/FeatureDefines.xcconfig:
2017-03-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213281.
This change caused API test WebKit2.UserMediaBasic to time
out.
Reverted changeset:
"[MediaStream] UIClient may not be notified of capture state
change when leaving a page"
https://bugs.webkit.org/show_bug.cgi?id=169014
http://trac.webkit.org/changeset/213281
2017-03-02 Jon Lee <jonlee@apple.com>
Improve consistency of captions rendering on Mac
https://bugs.webkit.org/show_bug.cgi?id=169071
Reviewed by Eric Carlson.
* page/CaptionUserPreferencesMediaAF.h:
(WebCore::CaptionUserPreferencesMediaAF::captionsEdgeColorForTextColor): Deleted.
(WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor): Deleted.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::appendCSS): Helper function to add a CSS rule with a provided StringBuilder.
(WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS): Refactor to use
appendCSS.
(WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS): Ditto.
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): Update text edge styles.
- Add a blur to the shadow
- Drop shadow style includes 1px text border
- Always use black for the text edge color
Also convert the stroke rules to using the CSS property and values instead of straight strings.
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): Fly-by fix of a typo.
2017-03-02 Chris Dumez <cdumez@apple.com>
Download attribute set to "*\" save file with name "example.com"
https://bugs.webkit.org/show_bug.cgi?id=169066
<rdar://problem/30740875>
Reviewed by Alex Christensen.
The issue is that a backslash in recognized as an escaping character in
a quoted string as per RFC2616:
"
The backslash character ("\") MAY be used as a single-character
quoting mechanism only within quoted-string and comment constructs.
"
We therefore need to escape the backslashes in the filename before
using it in the Content-Disposition header, inside the quoted string.
Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2017-03-02 Youenn Fablet <youenn@apple.com>
[WebRTC] Activate ICE candidate privacy policy
https://bugs.webkit.org/show_bug.cgi?id=168975
Reviewed by Alex Christensen.
Test: webrtc/datachannel/filter-ice-candidate.html
* testing/Internals.cpp:
(WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
(WebCore::Internals::setICECandidateFiltering):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-02 Eric Carlson <eric.carlson@apple.com>
[MediaStream] UIClient may not be notified of capture state change when leaving a page
https://bugs.webkit.org/show_bug.cgi?id=169014
<rdar://problem/30632267>
Reviewed by Youenn Fablet.
Enable and update the WebKit API test WebKit2.UserMedia.
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Always call page.updateIsPlayingMedia() if there
is active media in the document because it won't be possible when the state changes later
because the frame will have been cleared.
2017-03-02 Tomas Popela <tpopela@redhat.com>
[WK2] Keyboard menu key should show context menu
https://bugs.webkit.org/show_bug.cgi?id=72099
Reviewed by Carlos Garcia Campos.
Show the context menu when the GtkWidget::popup-menu signal is
emitted. This signal is triggered by pressing a key (usually
the Menu key or the Shift + F10 shortcut) or it could be emitted on
WebKitWebView.
Test: fast/events/context-activated-by-key-event.html
Also could be tested by:
ManualTests/keyboard-menukey-event.html
ManualTests/win/contextmenu-key.html
ManualTests/win/contextmenu-key2.html
* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEventForKey):
Correctly send the mouse event that used for showing the context menu.
Previously the event was immediately dispatched as it is, but this was
only the right way if some element was focused on the page. If there
was no focused element or non-empty text range then the event lacked
the right node, where it was supposed to be shown. The correct node
is determined and added to the event in the sendContextMenuEvent() so
we have to use this function to send the event.
Also use absoluteBoundingBoxRect() instead of
pixelSnappedAbsoluteClippedOverflowRect() when determining
a coordinate where to show the context menu for the currently focus
element. The latter is not returning a right box (it is bigger) which
could lead to the situation that no menu will be displayed at all,
because the HitTest won't contain the right element as the
determined coordinates could be outside of the element.
* page/EventHandler.h:
2017-03-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
https://bugs.webkit.org/show_bug.cgi?id=166420
Reviewed by Žan Doberšek.
This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.
2017-03-02 Andreas Kling <akling@apple.com>
Don't keep dead resources in MemoryCache while under memory pressure.
<https://webkit.org/b/169070>
Reviewed by Antti Koivisto.
Have CachedResource::deleteIfPossible() remove the resource from the MemoryCache
if we're under memory pressure and that was the only thing keeping it alive.
This is consistent with the policy where dead resources are evicted from the cache
as we come under pressure.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::deleteIfPossible):
2017-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
https://bugs.webkit.org/show_bug.cgi?id=169024
Reviewed by Youenn Fablet.
This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
Fixes: http/tests/download/literal-utf-8.html
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename):
2017-03-01 Alex Christensen <achristensen@webkit.org>
Actually fix Windows build.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
Win32Handle is now in WTF namespace.
2017-03-01 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r213214
https://bugs.webkit.org/show_bug.cgi?id=168908
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2017-03-01 Myles C. Maxfield <mmaxfield@apple.com>
Implement font-stretch for installed fonts
https://bugs.webkit.org/show_bug.cgi?id=168888
Reviewed by Darin Adler and Dave Hyatt.
This patch implements the font-stretch property. Both parsing and the implementation is
implemented. Contrary to the name, this property doesn't actually stretch fonts; instead,
it provides one more input to the font selection routine.
The mapping from Core Text's [-1, 1] width values to font-stretch's percentage-based
values is not perfect. For now, I've implemented a piecewise linear curve mapping the
two. However, I expect to be able to improve this transfer function soon.
This patch does not implement the font-stretch descriptor in @font-face, and therefore
does not work with web fonts. I will add this support in
https://bugs.webkit.org/show_bug.cgi?id=168892. The reason it isn't done in this patch is
it requires some architectural changes to our CSSFontFace classes which are large enough
they should be separated into their own patch.
This patch lays the groundwork for implementing the 'wdth' variation axis. It does this
by adding a floating-point value to RenderStyle instead of just an enum. The font-stretch
keywords get converted to these floating-point numbers in accordance with the Fonts spec.
This patch doesn't actually implement the variations piece of font-stretch, because that
piece also requires some architectural changes. This patch just implements the installed
font selection piece.
This patch also fixes the regression introduced in r213163 with Helvetica Neue. Now that
our font selection algorithm has a concept of font stretch, weights 800 and 900 of
Helvetica Neue are rendered as expected. (And this patch updates the tests to make sure.)
Tests: fast/text/font-stretch-parse.html
fast/text/font-stretch-shorthand.html
FontCacheTest.FontLookupFromFamilyName
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontStretchFromStyle): Map style values to CSS keywords.
(WebCore::ComputedStyleExtractor::propertyValue): Call the above function.
* css/CSSFontValue.cpp:
(WebCore::CSSFontValue::customCSSText): Used in getComputedStyle() for the "font"
shorthand.
(WebCore::CSSFontValue::equals):
* css/CSSFontValue.h:
* css/CSSProperties.json:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStretch): Map CSS keywords to style values.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::appendFontLonghandValueIfExplicit): Used for
Element.style.font.
(WebCore::StyleProperties::fontValue):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID): Now that variation fonts are being
implemented, font-stretch is no longer a keyword property. Instead, it can also take a
number or percentage.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontStretch): Parse the value.
(WebCore::CSSPropertyParser::parseSingleValue): Call the above function.
(WebCore::CSSPropertyParser::consumeFont): Ditto.
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey): Caches should be sensitive to this
new value.
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::stretch): The parsed style value.
(WebCore::FontDescription::setStretch):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::initialStretch):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::InstalledFont::InstalledFont): Update the installed font selection
algorithm to understand font-stretch.
(WebCore::findClosestStretch):
(WebCore::filterStretch):
(WebCore::findClosestFont):
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
2017-03-01 Antti Koivisto <antti@apple.com>
Rename recalcStyle to resolveStyle and clean up the signature
https://bugs.webkit.org/show_bug.cgi?id=169049
Reviewed by Sam Weinig.
Move to modern naming.
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
Only two of the possible values are used so pass in a two-value enum.
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::createRenderTree):
(WebCore::Document::finishedParsing):
(WebCore::Document::webkitWillEnterFullScreenForElement):
(WebCore::Document::recalcStyle): Deleted.
* dom/Document.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::reportDataReceived):
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Parent::Parent):
(WebCore::Style::TreeResolver::resolve):
Remove the argument, Document invalidates the document element if everything needs to be re-resolved.
* style/StyleTreeResolver.h:
2017-03-01 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r213259.
Broke an internal build
Reverted changeset:
"Continue enabling WebRTC"
https://bugs.webkit.org/show_bug.cgi?id=169056
http://trac.webkit.org/changeset/213259
2017-03-01 Alex Christensen <achristensen@webkit.org>
Continue enabling WebRTC
https://bugs.webkit.org/show_bug.cgi?id=169056
Reviewed by Jon Lee.
* Configurations/FeatureDefines.xcconfig:
2017-03-01 Chris Dumez <cdumez@apple.com>
[WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
https://bugs.webkit.org/show_bug.cgi?id=169060
<rdar://problem/30773140>
Reviewed by Darin Adler.
Make sure we never set the suggested filename to the empty string when
the download attribute is present but has no value.
Test: http/tests/download/anchor-download-no-value.html
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2017-03-01 Antoine Quint <graouts@apple.com>
[ios-simulator] Unskip media/modern-media-controls/audio/audio-controls-metrics.html
https://bugs.webkit.org/show_bug.cgi?id=167258
<rdar://problem/30282740>
We weren't enforcing the min-width to be 200px as well as the default width, and the
UA stylesheet would override it. Setting a default min-width that trumps the UA
stylesheet makes the test work correctly on iOS and we can safely unskip this test.
Reviewed by Jon Lee.
* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):
2017-03-01 Javier Fernandez <jfernandez@igalia.com>
Missing 'specification' section in the place-content shorthand
https://bugs.webkit.org/show_bug.cgi?id=169052
Reviewed by Darin Adler.
Added 'specification' section in the place-content shorthand.
No new tests, no new functionality.
* css/CSSProperties.json:
2017-02-28 Matt Rajca <mrajca@apple.com>
Media: notify clients when autoplayed media is muted
https://bugs.webkit.org/show_bug.cgi?id=168987
Reviewed by Alex Christensen.
Added API tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::pageMutedStateDidChange):
* page/AutoplayEvent.h:
2017-03-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r213226.
https://bugs.webkit.org/show_bug.cgi?id=169051
Speculative rollout, might be causing several failures and
crashes in WebKitGTK+ (Requested by lajava on #webkit).
Reverted changeset:
"REGRESSION(r213062): [SOUP] UTF-8 filename in Content-
Disposition header incorrectly handled since r213062"
https://bugs.webkit.org/show_bug.cgi?id=169024
http://trac.webkit.org/changeset/213226
2017-03-01 James Craig <jcraig@apple.com>
AX: add role aliases for ARIA DPUB module
https://bugs.webkit.org/show_bug.cgi?id=168978
<rdar://problem/30762724>
Reviewed by Chris Fleizach.
Added role aliases for ARIA DPUB module, and updated existing tests.
Test: accessibility/roles-exposed.html
Test: inspector/dom/getAccessibilityPropertiesForNode.html
* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
2017-03-01 Alex Christensen <achristensen@webkit.org>
Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
https://bugs.webkit.org/show_bug.cgi?id=169045
<rdar://problem/30735413>
Reviewed by Youenn Fablet.
WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
All other tests pass instead of crashing immediately when creating an Internals object.
* Modules/mediastream/RTCController.cpp:
(WebCore::RTCController::disableICECandidateFiltering):
(WebCore::RTCController::enableICECandidateFiltering):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* testing/Internals.cpp:
(WebCore::Internals::enableMockMediaEndpoint):
(WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
(WebCore::Internals::useMockRTCPeerConnectionFactory):
* testing/Internals.h:
2017-03-01 Javier Fernandez <jfernandez@igalia.com>
[css-align] Implement the place-content shorthand
https://bugs.webkit.org/show_bug.cgi?id=168771
Reviewed by Manuel Rego Casasnovas.
The CSS Box Alignment specification defines a new shorthand to set the
Content Alignment properties (align-content and justify-content) at the
same time.
This patch provides the implementation of the CSS parsing logic and the
required regression tests.
Test: css3/parse-place-content.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
2017-03-01 Simon Fraser <simon.fraser@apple.com>
Try to fix Windows build after r213191.
* platform/spi/win/CoreTextSPIWin.h:
2017-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
https://bugs.webkit.org/show_bug.cgi?id=169024
Reviewed by Youenn Fablet.
This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
Fixes: http/tests/download/literal-utf-8.html
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename):
2017-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
https://bugs.webkit.org/show_bug.cgi?id=169019
Reviewed by Xabier Rodriguez-Calvar.
The timeout happens normally when the media player is deleted and the pipeline state is set to NULL. The call to
gst_element_set_state() never returns because of different deadlocks with the video sink. Sometimes the deadlock
happens with the sample mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
calls webkitVideoSinkRepaintRequested() with the lock held, that ends up calling
MediaPlayerPrivateGStreamerBase::triggerRepaint(). When rendering can't be accelerated the draw timer is
scheduled and triggerRepaint blocks until the timer is fired. If the media player is destroyed before the timer
is fired, when setting the pipeline state to NULL, other VideoRenderRequestScheduler methods can be called, like
stop() that tries to get the sample mutex that is still held by requestRender(). So, first we need to make
sure that requestRender() releases the lock before calling webkitVideoSinkRepaintRequested(). But that's not
enough, we also need to ensure that the pipeline is set to NULL state after everyting has been properly
stopped. This is currently done in ~MediaPlayerPrivateGStreamer that happens before
~MediaPlayerPrivateGStreamerBase, so gst_element_set_state() is hanging before allowing the
MediaPlayerPrivateGStreamerBase to be cleaned up. We should move the call to the end of
~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex are properly cleaned up before.
Fixes: fast/canvas/canvas-createPattern-video-loading.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Do not reset pipeline here.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Stop the draw mutex and notify the
lock to ensure we unblock. Do the pipeline reset at the end.
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::requestRender): Release the mutex lock before calling webkitVideoSinkRepaintRequested().
2017-03-01 Tomas Popela <tpopela@redhat.com>
Unreviewed compiler warning fix after r213218
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2017-03-01 Tomas Popela <tpopela@redhat.com>
[Cairo] Incorrectly determining height in GraphicsContext::roundToDevicePixels()
https://bugs.webkit.org/show_bug.cgi?id=169031
Reviewed by Carlos Garcia Campos.
We should compare if height is between -1 and 0 and not mixing height
and width together.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::roundToDevicePixels):
2017-03-01 Tomas Popela <tpopela@redhat.com>
[GTK] Fix problems found by Coverity scan in platform's keyboard and mouse events
https://bugs.webkit.org/show_bug.cgi?id=169028
Reviewed by Carlos Garcia Campos.
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Initialize
the m_handledByInputMethod member.
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent): Initialize the
m_modifierFlags member.
2017-03-01 Andreas Kling <akling@apple.com>
Move MemoryPressureHandler to WTF
<https://webkit.org/b/168908>
Reviewed by Sam Weinig.
* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptController.cpp:
* history/PageCache.cpp:
* html/HTMLMediaElement.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/InspectorMemoryAgent.h:
* page/FrameView.cpp:
* page/MemoryRelease.h:
* page/linux/ResourceUsageThreadLinux.cpp:
* platform/Linux.cmake:
* platform/graphics/FontCache.cpp:
* platform/graphics/WidthCache.h:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileGrid.mm:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/TileControllerMemoryHandlerIOS.cpp:
* testing/Internals.cpp:
2017-03-01 Per Arne Vollan <pvollan@apple.com>
[Win] Popup menus are too small in HiDPI mode.
https://bugs.webkit.org/show_bug.cgi?id=168965
Reviewed by Brent Fulgham.
Scale font with device scale factor.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::show):
(WebCore::PopupMenuWin::calculatePositionAndSize):
(WebCore::PopupMenuWin::paint):
* platform/win/PopupMenuWin.h:
2017-03-01 Joseph Pecoraro <pecoraro@apple.com>
[WebRTC] Install libwebrtc.dylib inside of WebCore.framework
https://bugs.webkit.org/show_bug.cgi?id=168859
Reviewed by Dan Bernstein.
* Configurations/WebCore.xcconfig:
Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
or in the WK_OVERRIDE_FRAMEWORKS_DIR.
2017-02-28 Myles C. Maxfield <mmaxfield@apple.com>
Addressing post-review comments on r213163
https://bugs.webkit.org/show_bug.cgi?id=168678
Unreviewed.
No new tests because there is no behavior change.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::platformFontLookupWithFamily):
2017-02-28 Simon Fraser <simon.fraser@apple.com>
Don't use the LinearGlyphMask format if accelerated drawing is disabled
https://bugs.webkit.org/show_bug.cgi?id=168997
Reviewed by Tim Horton.
Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
so don't use that backing store format when accelerated drawing is disabled.
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
2017-02-28 Simon Fraser <simon.fraser@apple.com>
Make the repaint indicators show subpixel antialiased text indication a bit more clearly
https://bugs.webkit.org/show_bug.cgi?id=168988
Reviewed by Tim Horton.
Put a more obvious stroke around the repaint count when subpixel-antialiased layer text is enabled.
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
(WebCore::PlatformCALayer::drawTextAtPoint):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::drawTextAtPoint):
* platform/graphics/ca/win/PlatformCALayerWin.h:
2017-02-28 Alex Christensen <achristensen@webkit.org>
LibWebRTCProvider should check existence of libwebrtc.dylib
https://bugs.webkit.org/show_bug.cgi?id=168986
<rdar://problem/30735413>
Reviewed by Youenn Fablet.
Some configurations of the webrtc tests overwrite the availability of WebRTC in order to test it
with MockLibWebRTCPeerConnection. If the dylib can not be found, we can't use it, so we want to
fail these tests rather than crashing calling rtc::LogMessage::LogToDebug.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::factory):
(WebCore::LibWebRTCProvider::webRTCAvailable):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::useMockRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
2017-02-28 Tim Horton <timothy_horton@apple.com>
Apply a review comment that was missing in r213182
* loader/ios/QuickLook.mm:
(WebCore::isQuickLookPreviewURL):
2017-02-28 Tim Horton <timothy_horton@apple.com>
[iOS] Getting QLPreviewProtocol slows down first navigation in Web process
https://bugs.webkit.org/show_bug.cgi?id=168940
<rdar://problem/29468999>
Reviewed by Simon Fraser.
No new tests, just a performance improvement.
* loader/DocumentLoader.cpp:
(WebCore::isRemoteWebArchive):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
Make use of isQuickLookPreviewURL.
* loader/ios/QuickLook.h:
* loader/ios/QuickLook.mm:
(WebCore::isQuickLookPreviewURL):
Add isQuickLookPreviewURL, which first early-returns if the protocol
of the URL is a well-known protocol, and then falls back to loading QuickLook.
In a microbenchmark this is a 30-40% improvement in total time spent
loading an empty HTML document (wall-clock time between loadHTMLString
and didFinishNavigation).
2017-02-28 Simon Fraser <simon.fraser@apple.com>
Add Geolocation and DeviceOrientation to features.json
* features.json:
2017-02-28 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction should support attachment elements
https://bugs.webkit.org/show_bug.cgi?id=168916
<rdar://problem/30664519>
Reviewed by Ryosuke Niwa.
Teaches DragController to recognize and initiate dragging on attachment elements, and also adds a new
convenience method to the WebItemProviderPasteboard for block enumeration of available UIItemProviders. Covered
by a new API test: DataInteractionTests.AttachmentElementItemProviders.
* page/DragController.cpp:
(WebCore::DragController::draggableElement):
(WebCore::DragController::startDrag):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
2017-02-28 Mark Lam <mark.lam@apple.com>
Remove setExclusiveThread() and peers from the JSLock.
https://bugs.webkit.org/show_bug.cgi?id=168977
Reviewed by Filip Pizlo.
No new tests because this should already be covered by existing tests.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
2017-02-28 Dave Hyatt <hyatt@apple.com>
Centering text inside a button set to display flex and justify-content: center is impossible
https://bugs.webkit.org/show_bug.cgi?id=148872
<rdar://problem/22590086>
Reviewed by Simon Fraser.
Added new test in fast/forms.
* rendering/RenderButton.cpp:
(WebCore::RenderButton::addChild):
(WebCore::RenderButton::updateAnonymousChildStyle):
(WebCore::RenderButton::styleDidChange):
(WebCore::RenderButton::styleWillChange): Deleted.
(WebCore::RenderButton::setupInnerStyle): Deleted.
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::propagateStyleToAnonymousChildren):
* rendering/RenderElement.h:
(WebCore::RenderElement::updateAnonymousChildStyle):
2017-02-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add missing compact mode assets for macOS
https://bugs.webkit.org/show_bug.cgi?id=168980
<rdar://problem/30763269>
Reviewed by Jon Lee.
Adding missing compact mode assets for the AirPlay, tracks, PiP and volume buttons.
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
(.media-controls.mac.inline.compact button.airplay):
(.media-controls.mac.inline.compact button.pip):
(.media-controls.mac.inline.compact button.tracks):
* Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-compact@1x.png:
* Modules/modern-media-controls/images/macOS/volume-compact@2x.png:
* Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Added.
2017-02-28 Chris Dumez <cdumez@apple.com>
[iOS] Throttle requestAnimationFrame to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=168837
<rdar://problem/30700929>
Reviewed by Simon Fraser.
Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery.
ScriptedAnimationController now maintains an OptionSet of throttling reasons.
Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode.
The requestAnimationFrame interval is then determined based on those throttling
reasons:
- OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling)
- LowPowerMode: 30fps
- No reasons: 60fps
The Page now keeps track of low power mode state using a LowPowerModeNotifier.
Whenever low power mode changes, it updates the throttling reasons in all the
documents' ScriptedAnimationControllers in the frame tree.
Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html
fast/animation/request-animation-frame-throttling-lowPowerMode.html
* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
* dom/Document.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::throttlingReasonToString):
(WebCore::throttlingReasonsToString):
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
(WebCore::ScriptedAnimationController::isThrottled):
(WebCore::ScriptedAnimationController::interval):
(WebCore::ScriptedAnimationController::page):
(WebCore::ScriptedAnimationController::scheduleAnimation):
* dom/ScriptedAnimationController.h:
(WebCore::ScriptedAnimationController::create):
* page/FrameView.cpp:
(WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::isLowPowerModeEnabled):
(WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
(WebCore::updateScriptedAnimationsThrottlingReason):
(WebCore::Page::setIsVisuallyIdleInternal):
(WebCore::Page::handleLowModePowerChange):
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::requestAnimationFrameInterval):
(WebCore::Internals::setLowPowerModeEnabled):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-28 Youenn Fablet <youenn@apple.com>
[WebRTC] Limit libwebrtc logging in Debug build
https://bugs.webkit.org/show_bug.cgi?id=168974
Reviewed by Alex Christensen.
Covered by manual testing..
* platform/Logging.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
2017-02-28 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] Migrate off of CTFontCreateForCSS
https://bugs.webkit.org/show_bug.cgi?id=168678
Reviewed by David Hyatt.
This patch implements the Font Matching Algorithm detailed in
https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm
Previously, this was implemented inside Core Text (via
CTFontCreateForCSS()), but that implementation does not understand
variation fonts. Therefore it should move to WebKit (along with
the general fact that CSS algorithms should be implemented in a
CSS engine, not the platform's text engine).
This implementation is not completely divorced from the platform,
however - Core Text exposes font weights on a [-1, 1] range, but
CSS operates on a [1, 999] range. In order to provide the mapping
to CSS weights, Core Text infrastructure is necessary. Therefore,
this new implementation of the matching algorithm is only used
on certain operating systems.
The new implementation of the algorithm is not bug-compatible with
the existing implementation; this patch does represent a behavior
change. However, I have reviewed the differences manually and
believe this algorithm to be a progression over the previous one
(except for one case with Helvetica Neue - see
LayoutTests/ChangeLog for more information about that).
This patch also represents a 27% performance progression on our
standard page load test (just measuring the performance of the font
matching algorithm, and nothing else). (Because font matching is
only a small part of the entire test, the overall progression is
much smaller.)
Tests: FontCacheTest.FontLookupFromFamilyName
FontCacheTest.FontLookupFromPostScriptName
* platform/graphics/FontCache.h:
(WebCore::FontCache::createFontPlatformDataForTesting): Allow for
unit testing.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isSystemFont): Inlined.
(WebCore::FontDatabase::singleton): Cache results of Core Text
lookups.
(WebCore::FontDatabase::Range::Range): Because of variation fonts,
fonts' weights, widths, and slopes need to be represented as a range
instead of an individual value.
(WebCore::FontDatabase::Range::isValid):
(WebCore::FontDatabase::Range::expand):
(WebCore::FontDatabase::Range::includes):
(WebCore::FontDatabase::InstalledFont::InstalledFont): Represents a
Font Descriptor as well as some lookup information about it.
(WebCore::FontDatabase::InstalledFontCollection::InstalledFontCollection):
A collection of installed fonts.
(WebCore::FontDatabase::InstalledFontCollection::insertInstalledFont):
Cache minima and maxima.
(WebCore::FontDatabase::InstalledFontCollection::isEmpty):
(WebCore::FontDatabase::InstalledFontCollection::size):
(WebCore::FontDatabase::lookupFamilyName): Get all the fonts in
the family.
(WebCore::FontDatabase::lookupPostScriptName): Get the font with
the given PostScript name.
(WebCore::FontDatabase::clear):
(WebCore::FontDatabase::FontDatabase): Cache.
(WebCore::iterateActiveFontsWithReturn): The Font Matching Algorithm
works by starting with every font in the family, and the eliminating
items from the set iteratively. Instead of actually removing items
from a vector or linked list, we instead want to treat the collection
as immutable and keep a parallel side-table of which items have been
eliminated (in order to reduce copies and allocations). This makes
sense because most families only have a handful of fonts in them.
This function consults with the side-table to iterate only over the
fonts which have not been eliminated.
(WebCore::iterateActiveFonts): Ditto.
(WebCore::findClosestStretch):
(WebCore::filterStretch): Eliminate fonts based on their stretch
value.
(WebCore::findClosestStyle):
(WebCore::filterStyle): Eliminate fonts based on their style value.
(WebCore::findClosestWeight):
(WebCore::filterWeight): Eliminate fonts based on their weight value.
(WebCore::computeTargetWeight):
(WebCore::findClosestFont): If we have a set of fonts in a family,
select the font in the set which best matches the criteria.
(WebCore::platformFontLookupWithFamily): While findClosestFont()
function satisfies the spec's notion of the font matching algorithm,
WebKit actually claims to be able to look up fonts by their PostScript
name. Therefore, this function has a higher-level of logic to rectify
the confusion that results when the PostScript name doesn't agree with
the other CSS properties (like if you say "Helvetica-Bold" but also say
font-weight: 100).
* platform/spi/cocoa/CoreTextSPI.h: Add signature for system CSS
font weight support.
2017-02-24 Matt Rajca <mrajca@apple.com>
Media: notify clients when autoplayed media ends without being paused
https://bugs.webkit.org/show_bug.cgi?id=168852
Reviewed by Alex Christensen.
Added API tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
Set state accordingly if we autoplayed or if playback was prevented.
(WebCore::HTMLMediaElement::play):
Update state if playback was prevented.
(WebCore::HTMLMediaElement::playInternal):
Update state if playback began without user interaction.
(WebCore::HTMLMediaElement::pauseInternal):
Update state.
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
If playback ends and it began without user interaction, send a DidPlayMediaWithoutInterference event.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
* html/HTMLMediaElement.h:
* page/AutoplayEvent.h:
2017-02-27 Dave Hyatt <hyatt@apple.com>
Update flexbox to Blink's tip of tree
https://bugs.webkit.org/show_bug.cgi?id=168657
Reviewed by Zalan Bujtas.
Added new tests in css3/flexbox.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* rendering/FlexibleBoxAlgorithm.cpp: Added.
(WebCore::FlexItem::FlexItem):
(WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm):
(WebCore::FlexLayoutAlgorithm::computeNextFlexLine):
* rendering/FlexibleBoxAlgorithm.h: Added.
(WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize):
(WebCore::FlexItem::flexBaseMarginBoxSize):
(WebCore::FlexItem::flexedMarginBoxSize):
(WebCore::FlexLayoutAlgorithm::isMultiline):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
(WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/OrderIterator.cpp:
(WebCore::OrderIterator::next):
(WebCore::OrderIterator::reset):
(WebCore::OrderIteratorPopulator::~OrderIteratorPopulator):
(WebCore::OrderIteratorPopulator::collectChild):
(WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted.
(WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted.
* rendering/OrderIterator.h:
(WebCore::OrderIteratorPopulator::OrderIteratorPopulator):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
(WebCore::RenderBlock::computeChildPreferredLogicalWidths):
(WebCore::RenderBlock::hasDefiniteLogicalHeight):
(WebCore::RenderBlock::availableLogicalHeightForPercentageComputation):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::hasPercentHeightDescendants):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::columnFlexItemHasStretchAlignment):
(WebCore::RenderBox::isStretchingColumnFlexItem):
(WebCore::RenderBox::hasStretchedLogicalWidth):
(WebCore::RenderBox::sizesLogicalWidthToFitContent):
(WebCore::RenderBox::computeInlineDirectionMargins):
(WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem):
(WebCore::RenderBox::updateLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightWithoutLayout):
(WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
(WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells):
(WebCore::tableCellShouldHaveZeroInitialSize):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::RenderBox::percentageLogicalHeightIsResolvable):
(WebCore::RenderBox::hasUnsplittableScrollingOverflow):
(WebCore::flexItemHasStretchAlignment): Deleted.
(WebCore::isStretchingColumnFlexItem): Deleted.
(WebCore::logicalWidthIsResolvable): Deleted.
(WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted.
(WebCore::percentageLogicalHeightIsResolvable): Deleted.
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted.
(WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::isGridItem):
(WebCore::RenderBox::isFlexItem):
(WebCore::RenderBox::selfAlignmentNormalBehavior):
* rendering/RenderBoxModelObject.cpp:
(WebCore::isOutOfFlowPositionedWithImplicitHeight):
(WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection):
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeChildInternal):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::LineContext::LineContext):
(WebCore::RenderFlexibleBox::RenderFlexibleBox):
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
(WebCore::contentAlignmentNormalBehavior):
(WebCore::RenderFlexibleBox::styleDidChange):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
(WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning):
(WebCore::RenderFlexibleBox::hasOrthogonalFlow):
(WebCore::RenderFlexibleBox::flexBasisForChild):
(WebCore::RenderFlexibleBox::crossAxisExtentForChild):
(WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight):
(WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight):
(WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight):
(WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight):
(WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth):
(WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild):
(WebCore::RenderFlexibleBox::mainAxisExtentForChild):
(WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar):
(WebCore::RenderFlexibleBox::crossAxisExtent):
(WebCore::RenderFlexibleBox::mainAxisExtent):
(WebCore::RenderFlexibleBox::mainAxisContentExtent):
(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::transformedWritingMode):
(WebCore::RenderFlexibleBox::flowAwareMarginStartForChild):
(WebCore::RenderFlexibleBox::flowAwareMarginEndForChild):
(WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild):
(WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
(WebCore::RenderFlexibleBox::flowAwareLocationForChild):
(WebCore::RenderFlexibleBox::useChildAspectRatio):
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
(WebCore::RenderFlexibleBox::setFlowAwareLocationForChild):
(WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite):
(WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite):
(WebCore::RenderFlexibleBox::cacheChildMainSize):
(WebCore::RenderFlexibleBox::clearCachedMainSizeForChild):
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
(WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis):
(WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild):
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::marginBoxAscentForChild):
(WebCore::RenderFlexibleBox::computeChildMarginValue):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
(WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
(WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
(WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution):
(WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
(WebCore::RenderFlexibleBox::constructFlexItem):
(WebCore::RenderFlexibleBox::freezeViolations):
(WebCore::RenderFlexibleBox::freezeInflexibleItems):
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
(WebCore::alignmentOffset):
(WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
(WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
(WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
(WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild):
(WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild):
(WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout):
(WebCore::RenderFlexibleBox::prepareChildForPositionedLayout):
(WebCore::RenderFlexibleBox::alignmentForChild):
(WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis):
(WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight):
(WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize):
(WebCore::RenderFlexibleBox::crossAxisOverflowForChild):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::initialAlignContentOffset):
(WebCore::alignContentSpaceBetweenChildren):
(WebCore::RenderFlexibleBox::alignFlexLines):
(WebCore::RenderFlexibleBox::adjustAlignmentForChild):
(WebCore::RenderFlexibleBox::alignChildren):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
(WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
(WebCore::RenderFlexibleBox::flipForWrapReverse):
(WebCore::RenderFlexibleBox::Violation::Violation): Deleted.
(WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted.
(WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted.
(WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted.
(WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted.
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted.
(WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted.
(WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted.
(WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted.
(WebCore::RenderFlexibleBox::needToStretchChild): Deleted.
(WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted.
* rendering/RenderFlexibleBox.h:
(WebCore::RenderFlexibleBox::orderIterator):
(WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
(WebCore::selfAlignmentChangedToStretchInRowAxis):
(WebCore::selfAlignmentChangedFromStretchInRowAxis):
(WebCore::selfAlignmentChangedFromStretchInColumnAxis):
(WebCore::RenderGrid::styleDidChange):
(WebCore::RenderGrid::computeTrackBasedLogicalHeight):
(WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
(WebCore::RenderGrid::gridGapForDirection):
(WebCore::RenderGrid::guttersSize):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
(WebCore::RenderGrid::trackSizesForComputedStyle):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::alignSelfForChild):
(WebCore::RenderGrid::justifySelfForChild):
(WebCore::RenderGrid::columnAxisPositionForChild):
(WebCore::RenderGrid::rowAxisPositionForChild):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
* rendering/RenderGrid.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeLogicalHeight):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::layout):
* rendering/RenderTableSection.cpp:
(WebCore::shouldFlexCellChild):
(WebCore::RenderTableSection::relayoutCellIfFlexed):
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderTableSection.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight):
* rendering/style/RenderStyle.cpp:
(WebCore::resolvedSelfAlignment):
(WebCore::RenderStyle::resolvedAlignSelf):
(WebCore::RenderStyle::resolvedJustifySelf):
* rendering/style/RenderStyle.h:
* style/RenderTreeUpdater.cpp:
(WebCore::textRendererIsNeeded):
2017-02-28 Alex Christensen <achristensen@webkit.org>
Main resource requests need cachePartition
https://bugs.webkit.org/show_bug.cgi?id=168806
<rdar://30639764>
Reviewed by Brady Eidson.
Test: http/tests/security/credentials-main-resource.html
r211751 caused an unintended regression on pages whose main resource is protected
by basic authentication. We were not setting the cache partition for main resource
requests, and we use the cache partition now for credentials, so the credentials for
the main resource were not being put into a partition in the CredentialStorage that
would not be used for subresources of the page, whose requests had the correct partition
for the domain of the page. This caused users to have to enter their credentials twice,
once for the main resource and once for any subresources. This is fixed by using the
domain from the main resource request as the cache partition. Elsewhere the Document is
used to get the cache partition, but there is no Document yet when requesting the main resource.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
Set the cache partition for the main resource loads based on the SecurityOrigin of the
initial request if we are loading the main resource for a new top document. If the main resource
request is redirected, then we will still use the partition of the initial request because that is
what the user requested and that is where the user entered the credentials.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setDomainForCachePartition):
* loader/cache/CachedResourceRequest.h:
2017-02-28 Alex Christensen <achristensen@webkit.org>
REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=167967
Reviewed by Brady Eidson.
XHR credentials have a persistence of CredentialPersistenceNone because we keep
them in the WebCore::CredentialStorage. We were storing them to CFNetwork's NSURLCredentialStorage
on iOS and then they were being given as the proposedCredential in
NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone.
This fixes http/tests/security/credentials-iframes.html
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::set):
* platform/network/CredentialStorage.h:
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
2017-02-27 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build.
* PlatformWinCairo.cmake:
2017-02-27 Alex Christensen <achristensen@webkit.org>
Begin enabling WebRTC on 64-bit
https://bugs.webkit.org/show_bug.cgi?id=168915
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig:
2017-02-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Use compact mode by default on macOS
https://bugs.webkit.org/show_bug.cgi?id=168958
<rdar://problem/30748638>
Reviewed by Jon Lee.
We now use the compact layout mode by default on macOS.
* Modules/modern-media-controls/controls/layout-item.js: Remove the ReducedPadding trait.
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
(.media-controls.mac.inline.compact .time-label,): Vertically align the time label with
the scrubber in compact mode.
(.media-controls.mac.inline.compact .scrubber.slider): Correctly position the scrubber in
compact mode so that it's vertically aligned.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Remove handling of tight and
reduced padding traits since these do not apply to macOS anymore. We also notify the
scrubber of a layout trait change so that it may adjust its height.
* Modules/modern-media-controls/controls/scrubber.js:
(Scrubber):
(Scrubber.prototype.layoutTraitsDidChange): Adjust the height of the scrubber to match
compact layout traits.
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.get isSufficientlyWide): Adjust the minimum scrubber width for
TimeControl visibility to match compact layout traits.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits): Use the compact layout trait by default
on macOS and make the tight padding specific to iOS.
2017-02-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Adhere to tight padding on iOS
https://bugs.webkit.org/show_bug.cgi?id=168949
<rdar://problem/30746164>
Reviewed by Jon Lee.
We used to only support custom margins on macOS, to support this on iOS as
well, we promote the notification when the layoutTraits property is set to
MediaControls and expose a new protected method layoutTraitsDidChange() for
subclasses to implement. IOSInlineMediaControls now implements that method
and will use tighter margins for the TightPadding layout trait.
Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.layoutTraitsDidChange):
(IOSInlineMediaControls):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
(MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
(MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get layoutTraits):
(MediaControls.prototype.set layoutTraits):
(MediaControls.prototype.layoutTraitsDidChange):
2017-02-27 Youenn Fablet <youenn@apple.com>
[WebRTC] Support modern RTCStatsReport
https://bugs.webkit.org/show_bug.cgi?id=166916
<rdar://problem/30293780>
Reviewed by Alex Christensen.
Updating binding generator and IDL parser to handle maplike.
Covered by binding tests.
Added support for maplike binding from JS wrapper to DOM class.
The principle is to have the JSXX wrapper having a @backingMap slot containing a Map.
All maplike methods are forwarded to the corresponding Map methods.
The XX object is responsible to add key/value pairs using a helper routine.
The creation of the Map is done at creation of the JSXX wrapper.
DOM class is interacting with the map through DOMMapLike.
Extracted DOMGuarded from DOM promise implementation.
This allows reusing this code for DOMMapLike.
Covered by binding tests and manual tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCStatsReport.h:
(WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats):
(WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats):
(WebCore::RTCStatsReport::create):
(WebCore::RTCStatsReport::synchronizeBackingMap):
(WebCore::RTCStatsReport::backingMap):
(WebCore::RTCStatsReport::addStats):
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fromStdString):
(WebCore::fillRTCStats):
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMBindingInternals.js: Added.
(mapLikeForEach):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMGuardedObject.cpp: Added.
(WebCore::DOMGuardedObject::DOMGuardedObject):
(WebCore::DOMGuardedObject::~DOMGuardedObject):
(WebCore::DOMGuardedObject::clear):
(WebCore::DOMGuardedObject::contextDestroyed):
* bindings/js/JSDOMGuardedObject.h: Added.
(WebCore::DOMGuardedObject::isSuspended):
(WebCore::DOMGuardedObject::visitAggregate):
(WebCore::DOMGuardedObject::guardedObject):
(WebCore::DOMGuardedObject::globalObject):
(WebCore::DOMGuardedObject::isEmpty):
(WebCore::DOMGuarded::DOMGuarded):
(WebCore::DOMGuarded::guarded):
* bindings/js/JSDOMMapLike.cpp: Added.
(WebCore::getBackingMap):
(WebCore::initializeBackingMap):
(WebCore::createBackingMap):
(WebCore::forwardAttributeGetterToBackingMap):
(WebCore::forwardFunctionCallToBackingMap):
(WebCore::forwardForEachCallToBackingMap):
* bindings/js/JSDOMMapLike.h: Added.
(WebCore::DOMMapLike::set):
(WebCore::synchronizeBackingMap):
(WebCore::forwardSizeToMapLike):
(WebCore::forwardEntriesToMapLike):
(WebCore::forwardKeysToMapLike):
(WebCore::forwardValuesToMapLike):
(WebCore::forwardClearToMapLike):
(WebCore::forwardForEachToMapLike):
(WebCore::forwardHasToMapLike):
(WebCore::forwardAddToMapLike):
(WebCore::forwardDeleteToMapLike):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::promise):
(WebCore::DeferredPromise::reject):
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::resolve):
(WebCore::DeferredPromise::resolveWithNewlyCreated):
(WebCore::DeferredPromise::reject):
(WebCore::DeferredPromise::resolveWithCallback):
(WebCore::DeferredPromise::rejectWithCallback):
(WebCore::DeferredPromise::DeferredPromise):
(WebCore::DeferredPromise::deferred):
* bindings/js/WebCoreBuiltinNames.h:
* bindings/scripts/CodeGeneratorJS.pm:
(PrototypeFunctionCount):
(GeneratePropertiesHashTable):
(InterfaceNeedsIterator):
(GenerateImplementation):
(GenerateParametersCheck):
* bindings/scripts/IDLParser.pm:
(assert):
(parseAttributeOrOperationOrIterator):
(parseSerializer):
(parseAttributeOrOperationRest):
(parseAttribute):
(parseAttributeRest):
(parseOperationOrIterator):
(parseOptionalIterableInterface):
(parseMapLikeRest):
(parseMapLikeProperties):
(parseOperationRest):
(applyMemberList):
* bindings/scripts/test/JS/JSMapLike.cpp: Added.
* bindings/scripts/test/JS/JSMapLike.h: Added.
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: Added.
* bindings/scripts/test/JS/JSReadOnlyMapLike.h: Added.
* bindings/scripts/test/TestMapLike.idl: Added.
* bindings/scripts/test/TestReadOnlyMapLike.idl: Added.
2017-02-27 Mark Lam <mark.lam@apple.com>
Introduce a VM Traps mechanism and refactor Watchdog to use it.
https://bugs.webkit.org/show_bug.cgi?id=168842
Reviewed by Filip Pizlo.
No new tests needed because this is a re-implementation of existing functionality.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
(WebCore::WorkerScriptController::scheduleExecutionTermination):
2017-02-27 Andy Estes <aestes@apple.com>
[Cocoa] Rename FileMac.mm to FileCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=168947
Reviewed by Zalan Bujtas.
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
2017-02-27 Andy Estes <aestes@apple.com>
[iOS] Enable file replacement
https://bugs.webkit.org/show_bug.cgi?id=168907
<rdar://problem/22258242>
Reviewed by David Kilzer.
Covered by existing tests.
* fileapi/FileMac.mm:
(WebCore::File::shouldReplaceFile): Stop using Carbon and AppKit API for determining if a
file path is a file package. Use NSURL and CoreServices instead, which exist on Mac and iOS.
2017-02-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Use a solid background for <audio> controls on macOS
https://bugs.webkit.org/show_bug.cgi?id=168941
<rdar://problem/30744316>
Reviewed by Dean Jackson.
Use a solid background for <audio> elements on macOS, the same way we do on iOS.
Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html
* 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):
2017-02-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] StatusLabel should use similar properties to TimeLabel
https://bugs.webkit.org/show_bug.cgi?id=168938
<rdar://problem/30743185>
Reviewed by Dean Jackson.
Ensure we use the same styling properties for StatusLabel and TimeLabel.
Tests: media/modern-media-controls/status-label/status-label-ios.html
media/modern-media-controls/status-label/status-label-macos.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(.media-controls.ios.inline .time-label,):
(.media-controls.ios.inline .time-label): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.css:
(.media-controls.mac > .controls-bar .time-label,):
(.media-controls.mac > .controls-bar .time-label): Deleted.
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
2017-02-27 Myles C. Maxfield <mmaxfield@apple.com>
Rename ICU cursor iterator to caret iterator
https://bugs.webkit.org/show_bug.cgi?id=168206
Reviewed by Simon Fraser.
Mechanical find/replace.
No new tests because there is no behavior change.
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::nextOffset):
2017-02-27 Myles C. Maxfield <mmaxfield@apple.com>
Unprefix -webkit-line-break
https://bugs.webkit.org/show_bug.cgi?id=168213
Reviewed by Darin Adler.
We support the property as specced.
Test: fast/text/line-break-unprefixed.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::collectStyleForPresentationAttribute):
2017-02-27 Myles C. Maxfield <mmaxfield@apple.com>
Use RAII for ICU breaking iterators
https://bugs.webkit.org/show_bug.cgi?id=168203
Reviewed by Simon Fraser.
No new tests because there is no behavior change.
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::nextOffset):
2017-02-27 Basuke Suzuki <Basuke.Suzuki@am.sony.com>
[WinCairo][MiniBrowser] Add ca-bundle to display secure pages
https://bugs.webkit.org/show_bug.cgi?id=168486
Reviewed by Alex Christensen.
change the order of path location search to make it possible to
configure with environment variable because bundled ca-bundle is
always available now.
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::certificatePath):
2017-02-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Status text does not appear on iOS
https://bugs.webkit.org/show_bug.cgi?id=168918
<rdar://problem/30737644>
Reviewed by Dean Jackson.
We refactor the layout code out of MacOSInlineMediaControls and into a new
InlineLayoutSupport class which IOSInlineMediaControls uses as well. Now
both the macOS and iOS inline media controls run the same layout logic to
control whether the status label or scrubber should be displayed, and which
controls should be dropped due to space constraints.
Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html
* Modules/modern-media-controls/controls/inline-layout-support.js: Added.
(InlineLayoutSupport):
(InlineLayoutSupport.prototype.childrenAfterPerformingLayout):
* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.layout):
(IOSInlineMediaControls):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/js-files:
2017-02-27 Simon Fraser <simon.fraser@apple.com>
Add specification and status metadata to CSSProperties.json, and validate it
https://bugs.webkit.org/show_bug.cgi?id=168901
Reviewed by Darin Adler.
Annotate CSS properties with data about the WebKit development status, and
where they are specified. A property has a canonical specification reference,
but individual values may have a reference to a more recent spec.
Add a list of specifications to the JSON that properties reference by key.
Enhance check-webkit-style to validate the status and spec data.
* css/CSSProperties.json:
2017-02-27 Jiewen Tan <jiewen_tan@apple.com>
[CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
https://bugs.webkit.org/show_bug.cgi?id=168616
<rdar://problem/30167149>
Reviewed by Daniel Bates.
This patch adds IDL definitions for:
1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).
Test: credentials/idlharness.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentials/BasicCredential.cpp: Added.
(WebCore::BasicCredential::BasicCredential):
(WebCore::BasicCredential::~BasicCredential):
(WebCore::BasicCredential::type):
* Modules/credentials/BasicCredential.h: Added.
(WebCore::BasicCredential::id):
* Modules/credentials/BasicCredential.idl: Added.
* Modules/credentials/CredentialData.h: Added.
* Modules/credentials/CredentialData.idl: Added.
* Modules/credentials/PasswordCredential.cpp: Added.
(WebCore::PasswordCredential::PasswordCredential):
(WebCore::PasswordCredential::PasswordCredential):
Dummy constructors for now.
* Modules/credentials/PasswordCredential.h: Added.
(WebCore::PasswordCredential::create):
(WebCore::PasswordCredential::create):
(WebCore::PasswordCredential::setIdName):
(WebCore::PasswordCredential::idName):
(WebCore::PasswordCredential::setPasswordName):
(WebCore::PasswordCredential::passwordName):
(WebCore::PasswordCredential::setAdditionalData):
(WebCore::PasswordCredential::additionalData):
* Modules/credentials/PasswordCredential.idl: Added.
* Modules/credentials/SiteBoundCredential.cpp: Added.
(WebCore::SiteBoundCredential::SiteBoundCredential):
(WebCore::SiteBoundCredential::~SiteBoundCredential):
* Modules/credentials/SiteBoundCredential.h: Added.
(WebCore::SiteBoundCredential::name):
(WebCore::SiteBoundCredential::iconURL):
(WebCore::SiteBoundCredential::setOrigin):
(WebCore::SiteBoundCredential::origin):
* Modules/credentials/SiteBoundCredential.idl: Added.
* Modules/credentials/SiteBoundCredentialData.h: Added.
* Modules/credentials/SiteBoundCredentialData.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
2017-02-27 Jer Noble <jer.noble@apple.com>
[WebRTC] Fix remote audio rendering
https://bugs.webkit.org/show_bug.cgi?id=168898
Reviewed by Eric Carlson.
Test: webrtc/audio-peer-connection-webaudio.html
Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
correctly.
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::setFormat):
Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
its refCon a struct containing only the information it needs to perform its task. Because the
conversion may result in a different number of output samples than input ones, just ask to
generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
converted with a special return value.
* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::audioConverterFromABLCallback):
(WebCore::AudioSampleBufferList::copyFrom):
(WebCore::AudioSampleBufferList::convertInput): Deleted.
(WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
* platform/audio/mac/AudioSampleBufferList.h:
Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
a sample rate conversion to take into account that both the number of samples may have changed,
as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
ahead of the push operation, delay the next pull by the empty amount by rolling back the
m_outputSampleOffset. Introduce the same offset behavior during pull operations.
* platform/audio/mac/AudioSampleDataSource.h:
* platform/audio/mac/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
of time in order to wake up correctly at the beginning of the next cycle.
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
(WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
description (with the current system sample rate), rather than whatever is the current
input description.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::OnData):
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
incoming one to determine the sample rate, channel count, sample byte size, etc., to use
when delivering data upstream to libWebRTC.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
rate conversion rather than trying to duplicate all that code and use a CARingBuffer and
AudioConverter directly.
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):
(WebCore::WebAudioSourceProviderAVFObjC::prepare):
(WebCore::WebAudioSourceProviderAVFObjC::unprepare):
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
make sure m_enabled is initialized to a good value.
* testing/MockLibWebRTCPeerConnection.h:
2017-02-21 Jer Noble <jer.noble@apple.com>
AudioSampleDataSource should not exclusively lock its read and write threads.
https://bugs.webkit.org/show_bug.cgi?id=168646
Reviewed by Eric Carlson.
Locking the write thread causes the read thread to drop audio samples and generates audible
glitches, and the realtime audio thread backing the read thread should never block. There's
no real reason to lock these threads against one another here; they both rely on the
CARingBuffer to safely and simultaneously read and write data.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::setPaused):
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
(WebCore::AudioSampleDataSource::pullSamples):
* platform/audio/mac/AudioSampleDataSource.h:
2017-02-21 Jer Noble <jer.noble@apple.com>
AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
https://bugs.webkit.org/show_bug.cgi?id=168643
Reviewed by Eric Carlson.
Locking the write thread causes the read thread to drop audio samples and generates audible
glitches, and the realtime audio thread backing the read thread should never block. There's
no real reason to lock these threads against one another here; they both rely on the
AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
data.
The one piece which locks previously protected against unsafe access was during creation of
the audio unit. Without a lock, the audio unit could begin playback after the unit was
created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
against this possibility, create the unit, set the input and output descriptions, but only
assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
initialized.
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
(WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
(WebCore::AudioTrackPrivateMediaStreamCocoa::play):
(WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
(WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
(WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2017-02-27 Youenn Fablet <youenn@apple.com>
[WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
https://bugs.webkit.org/show_bug.cgi?id=168802
Reviewed by Jon Lee.
Covered by manual testing as mock sources do not hit the same code path.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::currentFrameCGImage):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2017-02-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Downloads attributes tests are failing
https://bugs.webkit.org/show_bug.cgi?id=168871
Reviewed by Michael Catanzaro.
Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
filenameFromHTTPContentDisposition().
Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename):
2017-02-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
https://bugs.webkit.org/show_bug.cgi?id=168820
<rdar://problem/30690281>
Reviewed by Jon Lee.
We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
event target when initiating a drag is the controls bar itself and not some of its content.
Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
starting over one of the controls and notice that no dragging occurs.
We also fix an issue where we wouldn't update the layout of the left container as its icon
buttons would load, which would cause the layout width of the left container to be incorrect
and the related tests to time out.
Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
(MacOSFullscreenMediaControls.prototype._handleMousedown):
2017-02-27 Alex Christensen <achristensen@webkit.org>
[libwebrtc] Enable WebRTC in some Production Builds
https://bugs.webkit.org/show_bug.cgi?id=168858
* Configurations/FeatureDefines.xcconfig:
2017-02-27 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] Clean up BitmapTextureGL construction
https://bugs.webkit.org/show_bug.cgi?id=168909
Reviewed by Carlos Garcia Campos.
Have the BitmapTextureGL constructor accept an rvalue reference pointer
to the GraphicsContext3D object. A static create() method is also added
to help with constructing these objects. Construction sites are updated
appropriately.
The BitmapTextureGL constructor is further cleaned up by moving default
member initializations together with the member declarations.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::BitmapTextureGL):
* platform/graphics/texmap/BitmapTextureGL.h:
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::createTexture):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::createTexture):
2017-02-27 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
https://bugs.webkit.org/show_bug.cgi?id=168906
Reviewed by Carlos Garcia Campos.
Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
TextureMapper class. These weren't modified anywhere in the code.
BitmapTexture::updateContents() still sets the image interpolation quality and
drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
InterpolationDefault and TextModeFill values.
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::TextureMapper): Deleted.
(WebCore::TextureMapper::~TextureMapper): Deleted.
* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
(WebCore::TextureMapper::setTextDrawingMode): Deleted.
(WebCore::TextureMapper::imageInterpolationQuality): Deleted.
(WebCore::TextureMapper::textDrawingMode): Deleted.
2017-02-26 Zan Dobersek <zdobersek@igalia.com>
[CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
https://bugs.webkit.org/show_bug.cgi?id=168903
Reviewed by Carlos Garcia Campos.
Remove the GraphicsContext pointer member from the TextureMapper class
since the getter and setter methods are not used anywhere.
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::TextureMapper):
* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::setGraphicsContext): Deleted.
(WebCore::TextureMapper::graphicsContext): Deleted.
2017-02-26 Myles C. Maxfield <mmaxfield@apple.com>
Stop compiling our own cursorMovementIterator()
https://bugs.webkit.org/show_bug.cgi?id=168211
Reviewed by David Hyatt.
Covered by existing tests.
Hook up the caret iterator.
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::nextOffset):
* rendering/RenderText.h:
2017-02-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r212942.
https://bugs.webkit.org/show_bug.cgi?id=168882
Made EWS very flaky (Requested by ap on #webkit).
Reverted changeset:
"[Modern Media Controls] Dragging controls in fullscreen on
macOS prevents scrubbing or interacting with controls"
https://bugs.webkit.org/show_bug.cgi?id=168820
http://trac.webkit.org/changeset/212942
2017-02-26 Chris Dumez <cdumez@apple.com>
HitTestResult's linkSuggestedFilename should sanitize download attribute
https://bugs.webkit.org/show_bug.cgi?id=168856
<rdar://problem/30683109>
Reviewed by Antti Koivisto.
HitTestResult's linkSuggestedFilename should sanitize download attribute.
This is used by the context menu's "Download Linked File" & "Download Linked
File As..." actions.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::linkSuggestedFilename):
* rendering/HitTestResult.h:
2017-02-25 Zalan Bujtas <zalan@apple.com>
Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
https://bugs.webkit.org/show_bug.cgi?id=168872
Reviewed by Simon Fraser.
SimpleLineLayout.cpp is for core functions only.
No change in functionality.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::printReason): Deleted.
(WebCore::SimpleLineLayout::printReasons): Deleted.
(WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
(WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
(WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutCoverage.cpp: Added.
(WebCore::SimpleLineLayout::printReason):
(WebCore::SimpleLineLayout::printReasons):
(WebCore::SimpleLineLayout::printTextForSubtree):
(WebCore::SimpleLineLayout::textLengthForSubtree):
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
* rendering/SimpleLineLayoutCoverage.h: Added.
2017-02-25 Zalan Bujtas <zalan@apple.com>
Text might wrap when its preferred logical width is used for sizing the containing block.
https://bugs.webkit.org/show_bug.cgi?id=168864
<rdar://problem/30690734>
Reviewed by Antti Koivisto.
In certain cases we end up measuring a text run in 2 different ways.
1. preferred width computation -> slow path FontCascade::width()
2. line breaking logic -> fast path FontCascade::widthForSimpleText()
FontCascade::width() and ::widthForSimpleText() might return different results for the same run even when
the individual glyph widths are measured to be the same. It's because they run diffrent set of
arithmetics on the float values and for certain values these arithmetics produce different results due to the floating point
precision.
Since RenderText::computePreferredLogicalWidths() currently forces us to use the slow path
(to retrieve fontfallback and glyph overflow information) the only alternative solution is to turn off the fast path
for all runs that have been already measured using the slow path (which would be just wasteful).
Test: fast/text/fast-run-width-vs-slow-run-width.html
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText): Mimics WidthIterator::applyFontTransforms. Use the same set of arithmetics here.
2017-02-24 Simon Fraser <simon.fraser@apple.com>
Improve how multiple codegen-properties are handled in CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=168867
Reviewed by Zalan Bujtas.
To make upcoming metadata storage easier, it's better if property entries in CSSProperties.json
are always hashes. One property (line-height) used an array, in order to represent settings for
two different build flags (ENABLE_TEXT_AUTOSIZING and !ENABLE_TEXT_AUTOSIZING).
Fix by making "codegen-properties" optionally be an array. The relevant item is selected in
removeInactiveCodegenProperties() and used to replace the array.
Sort @internalProprerties when generating code, otherwise the contents of isInternalCSSProperty()
are unstable (the order in @allNames is not stable because it's the keys in a hash).
* css/CSSProperties.json:
* css/makeprop.pl:
(matchEnableFlags):
(removeInactiveCodegenProperties):
(isPropertyEnabled):
2017-02-24 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Media elements initiated loads should set the initiatorType to their element name (video/audio)
https://bugs.webkit.org/show_bug.cgi?id=168680
Reviewed by Youenn Fablet.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
Pass in the element so it may be used as the initiator.
* html/HTMLVideoElement.h:
Export create() for TestWebKitAPI to use.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
(WebCore::MediaResourceLoader::contextDestroyed):
(WebCore::MediaResourceLoader::requestResource):
* loader/MediaResourceLoader.h:
Include the HTMLMediaElement as the initiator.
2017-02-24 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Gather timing information with reliable responseEnd time
https://bugs.webkit.org/show_bug.cgi?id=168351
Reviewed by Alex Christensen.
This patch replaces the unused `double finishTime` in ResourceLoader's
didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
allows the NetworkProcess to give complete timing information, and more
final metrics about the load, to WebCore. Currently this is only used
by ResourceTiming, but it will soon be used by Web Inspector as well.
We may also end up extending this to the didFail path as well, since it
is possible that we have some metrics for load failures.
At the same time we want to start moving away from the legacy path that
populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
It doesn't make sense to store this information on the ResourceResponse
for a few reasons: We don't want to store the metrics in our Network Cache and
not all of the load timing metrics have been populated yet (responseEnd).
In an effort to move off of this data we've renamed the accessor to
"deprecatedNetworkLoadMetrics". There are a few remaining clients
(ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
migrated separately from this patch.
Having both the legacy and new code paths adds a little bit of complexity.
One advantage of the new path is that the complete load timing data
(fetchStart -> dns -> connect -> request -> response -> responseEnd) can
be packaged together. The legacy path could not include a responseEnd, so
WebCore faked that value with its own timestamp. Having the fake responseEnd
caused issues as timestamps / clocks are different between processes. In order
for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
has the complete network timing metrics it checks isComplete(). If true
it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
it must fallback to the legacy value from LoadTiming. Once all of the
deprecatedNetworkLoadMetrics clients go away, we should always have the
complete data and this can be eliminated.
Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Rename NetworkLoadTiming -> NetworkLoadMetrics.
* page/PerformanceResourceTiming.cpp:
(WebCore::entryStartTime):
(WebCore::entryEndTime):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::nextHopProtocol):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
* page/PerformanceResourceTiming.h:
Mostly just updating names and types. This does however need to get the
correct endTime based on whether the NetworkLoadMetrics are complete
(meaning includes responseEnd) or not (legacy, use LoadTiming value).
* page/PerformanceResourceTiming.idl:
Add nextHopProtocol.
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::domainLookupStart):
(WebCore::PerformanceTiming::domainLookupEnd):
(WebCore::PerformanceTiming::connectStart):
(WebCore::PerformanceTiming::connectEnd):
(WebCore::PerformanceTiming::secureConnectionStart):
(WebCore::PerformanceTiming::requestStart):
(WebCore::PerformanceTiming::responseStart):
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
* page/PerformanceTiming.h:
Navigation Timing values still uses the NetworkLoadTiming values stored on
the DocumentLoader. This should be moved off of the deprecated path separately.
* platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::operator!=):
(WebCore::NetworkLoadMetrics::isComplete):
(WebCore::NetworkLoadMetrics::markComplete):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
Add protocolName and "complete" boolean.
* platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
(WebCore::timingValue):
(WebCore::copyTimingData):
(WebCore::setCollectsTimingData):
Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
Since we already have to modify all the clients this moves us to use the more
strongly typed units that are less ambiguous then "double". The rest of the
Performance API has already moved to these units.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/InspectorNetworkAgent.h:
Inspector was the only client of the finishTime, and since the value was
erratically coming from clients in different ways it was almost certainly
inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::didFinishLoading):
* Modules/fetch/FetchLoader.h:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::didFinishLoading):
* fileapi/FileReaderLoader.h:
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseNPTTime):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
(WebCore::DocumentThreadableLoader::notifyFinished):
(WebCore::DocumentThreadableLoader::didFinishLoading):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/DocumentThreadableLoader.h:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didFinishLoading):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::deliverResponseAndData):
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didFinishLoading):
(WebCore::ResourceLoader::didFinishLoadingOnePart):
* loader/ResourceLoader.h:
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::fromLoad):
(WebCore::ResourceTiming::fromSynchronousLoad):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::networkLoadMetrics):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::networkLoadTiming): Deleted.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFinishLoading):
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
* loader/WorkerThreadableLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
* loader/appcache/ApplicationCacheGroup.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setLoadFinishTime):
* loader/ios/QuickLook.mm:
(-[WebPreviewLoader connectionDidFinishLoading:]):
* page/EventSource.cpp:
(WebCore::EventSource::didFinishLoading):
* page/EventSource.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::didFinishLoading):
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didFinishLoading):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::crossThreadData):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::compare):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
(WebCore::ResourceResponseBase::encode):
(WebCore::ResourceResponseBase::decode):
(WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::WebCoreSynchronousLoader::didFinishLoading):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::calculateWebTimingInformations):
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::handleDataURL):
(WebCore::milisecondsSinceRequest): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::restartedCallback):
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::networkEventCallback):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::readCallback):
(WebCore::milisecondsSinceRequest): Deleted.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didFinishLoading):
* workers/WorkerScriptLoader.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
* xml/XMLHttpRequest.h:
Eliminate the unused finishTime double.
2017-02-24 Chris Dumez <cdumez@apple.com>
Unreviewed GTK build fix after r212965
* CMakeLists.txt:
2017-02-24 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r212944.
Caused a lot of failures on the debug bots
Reverted changeset:
"[Resource Timing] Gather timing information with reliable
responseEnd time"
https://bugs.webkit.org/show_bug.cgi?id=168351
http://trac.webkit.org/changeset/212944
2017-02-24 Chris Dumez <cdumez@apple.com>
Unreviewed, follow-up fix after r212972.
Fixes a few assertions on the debug build bots.
URL needs to be exactly the same as the parsed one given
that we are calling the ParsedURLString constructor.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2017-02-24 Zalan Bujtas <zalan@apple.com>
Simple line layout: Re-adjust paginated lines when block height changes.
https://bugs.webkit.org/show_bug.cgi?id=168838
<rdar://problem/30701233>
Reviewed by Antti Koivisto.
When the estimated block height is wrong, we issue an additional layout on the inline children
so that we get the pagination right (this layout is setChildNeedsLayout(MarkOnlyThis) only).
Since the height change only affects the struts and page breaks (and again, the relayoutChildren flag is false)
we don't need to re-layout the content, but instead we just need to re-adjust the pagination for the simple lines.
This patch also moves the pagination logic to SimpleLineLayoutPagination.cpp.
Not enabled yet.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Deleted.
(WebCore::SimpleLineLayout::computeLineBreakIndex): Deleted.
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak): Deleted.
(WebCore::SimpleLineLayout::setPageBreakForLine): Deleted.
(WebCore::SimpleLineLayout::updateMinimumPageHeight): Deleted.
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination): Deleted.
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::setIsPaginated):
(WebCore::SimpleLineLayout::Layout::setLineStruts):
* rendering/SimpleLineLayoutPagination.cpp: Added.
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::updateMinimumPageHeight):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
* rendering/SimpleLineLayoutPagination.h: Added.
2017-02-24 Jon Lee <jonlee@apple.com>
Alias "system-ui" for the System font name
https://bugs.webkit.org/show_bug.cgi?id=151493
Reviewed by Tim Horton and Joseph Pecoraro.
Updated existing tests.
* WebCore.xcodeproj/project.pbxproj: Add WebKitFontFamilyNames.in for
convenience.
* css/CSSValueKeywords.in: Add system-ui as a keyword.
* css/WebKitFontFamilyNames.in: Add system-ui.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase): Include "system-ui" as an
alias.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase): Ditto.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updateCachedSystemFontDescription): Update
serialization to "system-ui" from "-apple-system".
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::identifierForFamily):
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontFamily):
2017-02-24 Matt Rajca <mrajca@apple.com>
Media: notify clients when autoplay is denied
https://bugs.webkit.org/show_bug.cgi?id=168840
Reviewed by Alex Christensen.
Added API tests.
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
* page/AutoplayEvent.h: Added.
* page/ChromeClient.h:
2017-02-24 Basuke Suzuki <Basuke.Suzuki@am.sony.com>
curl: Improve errors by including the domain
https://bugs.webkit.org/show_bug.cgi?id=134340
Reviewed by Alex Christensen.
Added proper error domain to ResourceError created by
Curl problem.
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::ResourceHandleManager::dispatchSynchronousJob):
2017-02-24 Antoine Quint <graouts@apple.com>
[Modern Media Controls] <audio> controls should center in their container when the page is scaled
https://bugs.webkit.org/show_bug.cgi?id=168841
<rdar://problem/28612794>
Reviewed by Eric Carlson.
When dealing with <audio> elements, we vertically center the controls relative to their containing
media element such that if the controls visually overflow, they overflow equally above and below
to minimize the likelihood of overlap with surrounding elements.
Test: media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get shouldCenterControlsVertically):
(MediaControls.prototype.set shouldCenterControlsVertically):
(MediaControls.prototype.commitProperty):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get isAudio):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype._updateControlsSize):
2017-02-24 Alex Christensen <achristensen@webkit.org>
Non-special relative URLs should not ignore extra slashes
https://bugs.webkit.org/show_bug.cgi?id=168834
Reviewed by Sam Weinig.
Special authority ignore slashes state should, as its name implies,
only be reached by special URLs. See https://url.spec.whatwg.org/#relative-slash-state
Covered by newly passing web platform tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2017-02-24 Alexey Proskuryakov <ap@apple.com>
Build fix for newer clang
https://bugs.webkit.org/show_bug.cgi?id=168849
rdar://problem/30638741
Reviewed by Ryosuke Niwa.
* dom/Range.cpp: (WebCore::Range::toString): std::max(0, <unsigned>) is not meaningful,
and now triggers a warning.
2017-02-24 Chris Dumez <cdumez@apple.com>
Download attribute should be sanitized before being used as suggested filename
https://bugs.webkit.org/show_bug.cgi?id=168839
<rdar://problem/30683109>
Reviewed by Darin Adler.
Sanitize Download attribute before using it as a suggested filename for the download.
We rely on ResourceResponse's sanitizing of the suggested filename to do so, which has
the benefit of being consistent with downloads without the download attribute.
Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
* platform/network/ResourceResponseBase.h:
2017-02-24 Miguel Gomez <magomez@igalia.com>
[GTK] WebkitWebProcess crashes on exit on nvidia if threaded compositing is enabled
https://bugs.webkit.org/show_bug.cgi?id=165522
Reviewed by Carlos Garcia Campos.
Before destrying a GLContextGLX we need to set the default framebufer to avoid a bug
in some nvidia drivers. Ensure that we set the context as current before performing
that operation, and set the appropriate current context after doing so.
No new tests.
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::~GLContextGLX):
2017-02-24 Chris Dumez <cdumez@apple.com>
[iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
https://bugs.webkit.org/show_bug.cgi?id=168832
<rdar://problem/30697911>
Reviewed by Antti Koivisto.
Add LowPowerModeNotifier class to monitor low power mode state on iOS.
* WebCore.xcodeproj/project.pbxproj:
* platform/LowPowerModeNotifier.cpp: Added.
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
* platform/LowPowerModeNotifier.h: Added.
* platform/ios/LowPowerModeNotifierIOS.mm: Added.
(-[WebLowPowerModeObserver initWithNotifier:]):
(-[WebLowPowerModeObserver dealloc]):
(-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
(WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
(WebCore::notifyLowPowerModeChanged):
2017-02-24 Chris Dumez <cdumez@apple.com>
[Mac] Report domains using abnormally high memory usage via enhanced privacy logging
https://bugs.webkit.org/show_bug.cgi?id=168797
<rdar://problem/29964017>
Reviewed by Andreas Kling.
Report domains using abnormally high memory usage (> 2GB) via enhanced privacy
logging on Mac.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadResourceThreshold):
(WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
(WebCore::reportPageOverPostLoadCPUUsageThreshold): Deleted.
2017-02-24 Alex Christensen <achristensen@webkit.org>
.. should not remove windows drive letters in paths of file URLs
https://bugs.webkit.org/show_bug.cgi?id=168824
Reviewed by Youenn Fablet.
It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
It can't hurt to pass a few more web platform tests, though.
* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::shouldPopPath):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parse):
* platform/URLParser.h:
2017-02-24 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] Unreviewed buildfix after r212736.
* PlatformMac.cmake:
2017-02-24 John Wilander <wilander@apple.com>
Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
<rdar://problem/30352793>
<rdar://problem/30646710>
<rdar://problem/30660708>
Reviewed by Alex Christensen.
This patch only adds test infrastructure in WebCore.
Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
* loader/ResourceLoadObserver.h:
2017-02-23 Antoine Quint <graouts@apple.com>
[Modern Media Controls] No controls are shown for <audio preload="none">
https://bugs.webkit.org/show_bug.cgi?id=168800
<rdar://problem/30652142>
Reviewed by Eric Carlson.
A media element's currentSrc property will only be set when data has started
to load. In the case where preload="none" is used, regardless of whether a
source is specified, currentSrc would be the empty string and we wouldn't
show controls at all. Identifying whether a source is specified is a little
tricky because it could be specified in a variety of ways and dynamically
as well.
So instead we optimistically show controls always provided the "controls"
attribute is set.
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype._shouldShowStartButton):
(StartSupport):
2017-02-23 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Gather timing information with reliable responseEnd time
https://bugs.webkit.org/show_bug.cgi?id=168351
Reviewed by Alex Christensen.
This patch replaces the unused `double finishTime` in ResourceLoader's
didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
allows the NetworkProcess to give complete timing information, and more
final metrics about the load, to WebCore. Currently this is only used
by ResourceTiming, but it will soon be used by Web Inspector as well.
We may also end up extending this to the didFail path as well, since it
is possible that we have some metrics for load failures.
At the same time we want to start moving away from the legacy path that
populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
It doesn't make sense to store this information on the ResourceResponse
for a few reasons: We don't want to store the metrics in our Network Cache and
not all of the load timing metrics have been populated yet (responseEnd).
In an effort to move off of this data we've renamed the accessor to
"deprecatedNetworkLoadMetrics". There are a few remaining clients
(ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
migrated separately from this patch.
Having both the legacy and new code paths adds a little bit of complexity.
One advantage of the new path is that the complete load timing data
(fetchStart -> dns -> connect -> request -> response -> responseEnd) can
be packaged together. The legacy path could not include a responseEnd, so
WebCore faked that value with its own timestamp. Having the fake responseEnd
caused issues as timestamps / clocks are different between processes. In order
for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
has the complete network timing metrics it checks isComplete(). If true
it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
it must fallback to the legacy value from LoadTiming. Once all of the
deprecatedNetworkLoadMetrics clients go away, we should always have the
complete data and this can be eliminated.
Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Rename NetworkLoadTiming -> NetworkLoadMetrics.
* page/PerformanceResourceTiming.cpp:
(WebCore::entryStartTime):
(WebCore::entryEndTime):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::nextHopProtocol):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
* page/PerformanceResourceTiming.h:
Mostly just updating names and types. This does however need to get the
correct endTime based on whether the NetworkLoadMetrics are complete
(meaning includes responseEnd) or not (legacy, use LoadTiming value).
* page/PerformanceResourceTiming.idl:
Add nextHopProtocol.
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::domainLookupStart):
(WebCore::PerformanceTiming::domainLookupEnd):
(WebCore::PerformanceTiming::connectStart):
(WebCore::PerformanceTiming::connectEnd):
(WebCore::PerformanceTiming::secureConnectionStart):
(WebCore::PerformanceTiming::requestStart):
(WebCore::PerformanceTiming::responseStart):
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
* page/PerformanceTiming.h:
Navigation Timing values still uses the NetworkLoadTiming values stored on
the DocumentLoader. This should be moved off of the deprecated path separately.
* platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::operator!=):
(WebCore::NetworkLoadMetrics::isComplete):
(WebCore::NetworkLoadMetrics::markComplete):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
Add protocolName and "complete" boolean.
* platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
(WebCore::timingValue):
(WebCore::copyTimingData):
(WebCore::setCollectsTimingData):
Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
Since we already have to modify all the clients this moves us to use the more
strongly typed units that are less ambiguous then "double". The rest of the
Performance API has already moved to these units.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/InspectorNetworkAgent.h:
Inspector was the only client of the finishTime, and since the value was
erratically coming from clients in different ways it was almost certainly
inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::didFinishLoading):
* Modules/fetch/FetchLoader.h:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::didFinishLoading):
* fileapi/FileReaderLoader.h:
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseNPTTime):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishLoading):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
(WebCore::DocumentThreadableLoader::notifyFinished):
(WebCore::DocumentThreadableLoader::didFinishLoading):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/DocumentThreadableLoader.h:
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didFinishLoading):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFinishLoad):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
* loader/ResourceLoadNotifier.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::deliverResponseAndData):
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didFinishLoading):
(WebCore::ResourceLoader::didFinishLoadingOnePart):
* loader/ResourceLoader.h:
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::fromLoad):
(WebCore::ResourceTiming::fromSynchronousLoad):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::networkLoadMetrics):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::networkLoadTiming): Deleted.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFinishLoading):
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
* loader/WorkerThreadableLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoading):
* loader/appcache/ApplicationCacheGroup.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setLoadFinishTime):
* loader/ios/QuickLook.mm:
(-[WebPreviewLoader connectionDidFinishLoading:]):
* page/EventSource.cpp:
(WebCore::EventSource::didFinishLoading):
* page/EventSource.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::didFinishLoading):
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didFinishLoading):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::crossThreadData):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::compare):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
(WebCore::ResourceResponseBase::encode):
(WebCore::ResourceResponseBase::decode):
(WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::WebCoreSynchronousLoader::didFinishLoading):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::calculateWebTimingInformations):
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::handleDataURL):
(WebCore::milisecondsSinceRequest): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::restartedCallback):
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::networkEventCallback):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::readCallback):
(WebCore::milisecondsSinceRequest): Deleted.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didFinishLoading):
* workers/WorkerScriptLoader.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
* xml/XMLHttpRequest.h:
Eliminate the unused finishTime double.
2017-02-23 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls overflow when media element has border or padding
https://bugs.webkit.org/show_bug.cgi?id=168818
<rdar://problem/30689780>
Reviewed by Jon Lee.
We used to query the media element's layout size to compute the size of the media controls,
which would account for border and padding. Instead, we should use the size of the container,
at the root of the ShadowRoot, which will always match the size of the media.
Test: media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding.html
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container,):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsSize):
(MediaController.prototype._controlsWidth):
2017-02-23 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
https://bugs.webkit.org/show_bug.cgi?id=168820
<rdar://problem/30690281>
Reviewed by Jon Lee.
We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
event target when initiating a drag is the controls bar itself and not some of its content.
Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
starting over one of the controls and notice that no dragging occurs.
Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype._handleMousedown):
2017-02-23 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r211305): Masks on composited elements with preserve-3d broken
https://bugs.webkit.org/show_bug.cgi?id=168815
rdar://problem/30676846
Reviewed by Jon Lee.
r211305 moved the mask layer to be on the structural layer if there is one, to fix
masking backdrops. However, with preserve-3d the structural layer can be a CATransformLayer,
which doesn't take a mask, so limit the previous change to backdrops only.
Test: compositing/masks/mask-with-preserve-3d.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateMaskLayer):
2017-02-23 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Show "Loading" until playback starts
https://bugs.webkit.org/show_bug.cgi?id=168809
<rdar://problem/30687468>
Reviewed by Jon Lee.
We now display the "Loading" status as soon as we've started loading and
until we've obtained enough data to play. No test provided since we don't
have a way to specifically set networkState and readyState to the satisfactory
values.
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):
2017-02-23 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
https://bugs.webkit.org/show_bug.cgi?id=168801
<rdar://problem/30683453>
Reviewed by Eric Carlson.
We enforce a 50pt minimum layout height for <audio> elements. There is no way
for the page author to override this value since the min-height property is set
as !important in a <style> element contained in a ShadowRoot.
* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):
2017-02-23 Youenn Fablet <youenn@apple.com>
[WebRTC] Outgoing video quality is poor
https://bugs.webkit.org/show_bug.cgi?id=168778
<rdar://problem/30674673>
Reviewed by Eric Carlson.
Covered by manually ensuring the voice process thread is not spinning.
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: Setting the next call to max was not a good idea since the thread process is adding some value to it, making it a negative value.
2017-02-23 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction with a URL should navigate the page if the operation is not handled
https://bugs.webkit.org/show_bug.cgi?id=168798
<rdar://problem/30665969>
Reviewed by Tim Horton.
Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::stringForType):
* platform/mac/DragDataMac.mm:
2017-02-23 Youenn Fablet <youenn@apple.com>
[WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
https://bugs.webkit.org/show_bug.cgi?id=168796
Reviewed by Jer Noble.
Covered by manual testing.
Limiting RealtimeOutgoingAudioSource conversion to interleaving and float-to-integer.
Removed the sample rate conversion.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::libwebrtcAudioFormat):
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2017-02-23 Alex Christensen <achristensen@webkit.org>
Re-soft-link CoreVideo after r212906
https://bugs.webkit.org/show_bug.cgi?id=168803
Reviewed by Jer Noble.
CoreVideo should be soft linked to reduce startup time.
Linking against the framework just for a few symbols used in one file was the wrong solution.
* Configurations/WebCore.xcconfig:
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2017-02-23 Chris Dumez <cdumez@apple.com>
Report domains using abnormally high CPU usage via enhanced privacy logging
https://bugs.webkit.org/show_bug.cgi?id=168794
<rdar://problem/29964018>
Reviewed by Ryosuke Niwa.
Report domains using abnormally high CPU usage (> 20%) via enhanced privacy
logging.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadCPUUsageThreshold):
(WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
2017-02-23 Zalan Bujtas <zalan@apple.com>
Simple line layout: Adjust RunResolver::lineIndexForHeight with line struts.
https://bugs.webkit.org/show_bug.cgi?id=168783
<rdar://problem/30676449>
Reviewed by Antti Koivisto.
When there's a pagination gap between lines the simple lineIndex = y / lineHeight formula does not work anymore.
This patch takes the line gaps into account by offsetting the y position accordingly.
Not enabled yet.
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
2017-02-23 Alex Christensen <achristensen@webkit.org>
Fix iOS WebRTC build after r212812
https://bugs.webkit.org/show_bug.cgi?id=168790
Reviewed by Tim Horton.
* Configurations/WebCore.xcconfig:
2017-02-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Several layout tests trigger GStreamer-CRITICAL **: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed
https://bugs.webkit.org/show_bug.cgi?id=167016
Reviewed by Xabier Rodriguez-Calvar.
This is because we create AudioSourceProviderGStreamer objects that are never loaded. In the destructor the
AudioSourceProviderGStreamer calls gst_bin_get_by_name() on its m_audioSinkBin that is nullptr. We could simply
check m_audioSinkBin in the destructor, but I think it's better to simply not create
AudioSourceProviderGStreamer for nothing. MediaPlayerPrivateGStreamer should create the AudioSourceProvider on demand.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Do not create the AudioSourceProvider.
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Call ensureAudioSourceProvider() before using m_audioSourceProvider.
(WebCore::MediaPlayerPrivateGStreamer::ensureAudioSourceProvider): Create the AudioSourceProvider if needed.
(WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider): Ensure and return the m_audioSourceProvider.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2017-02-23 Tomas Popela <tpopela@redhat.com>
[GTK] Drag and drop is always moving the content even if copy is requested
https://bugs.webkit.org/show_bug.cgi?id=168424
Reviewed by Carlos Garcia Campos.
Drag and drop is always moving the content around even if the copy is
requested (i.e. by pressing the Control key).
Test: editing/pasteboard/drag-drop-copy-content.html
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::isCopyKeyDown):
2017-02-22 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Remove Yosemite-specific font lookup code
https://bugs.webkit.org/show_bug.cgi?id=168682
Reviewed by Zalan Bujtas.
No new tests because there is no behavior change.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformInvalidateFontCache):
(WebCore::acceptableChoice): Deleted.
(WebCore::betterChoice): Deleted.
(WebCore::desiredFamilyToAvailableFamilyMap): Deleted.
(WebCore::hasDesiredFamilyToAvailableFamilyMapping): Deleted.
(WebCore::rememberDesiredFamilyToAvailableFamilyMapping): Deleted.
(WebCore::toAppKitFontWeight): Deleted.
(WebCore::appkitWeightToFontWeight): Deleted.
(WebCore::toNSFontTraits): Deleted.
(WebCore::platformFontWithFamily): Deleted.
2017-02-22 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
https://bugs.webkit.org/show_bug.cgi?id=168755
<rdar://problem/30664484>
Reviewed by Dean Jackson.
We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
with an event type and target combination that was specifically registered in this class's scope.
We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
https://bugs.webkit.org/show_bug.cgi?id=168515.
Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.handleEvent):
(MacOSFullscreenMediaControls.prototype._handleMousedown):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.handleEvent):
(MacOSMediaControls):
2017-02-22 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Scrubber stops moving while scrubbing on macOS
https://bugs.webkit.org/show_bug.cgi?id=168518
<rdar://problem/30577637>
Reviewed by Dean Jackson.
As we start to scrub, controlValueWillStartChanging() is called on
ScrubberSupport and pauses the media if it's not already paused. This
causes the play/pause button to change icon and for layout() to be
called on MacOSInlineMediaControls. This in turns sets the .children
property on the .controlsBar and eventually yields a DOM manipulation
which re-inserts the scrubber's DOM hierarchy, causing stutters during
user interaction.
Our solution is to make the .children setter smarter about identifying
that the children list hasn't changed and that no DOM invalidation is
necessary.
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):
2017-02-22 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls bar may disappear while captions menu is visible
https://bugs.webkit.org/show_bug.cgi?id=168751
<rdar://problem/30663411>
Reviewed by Dean Jackson.
We now prevent the controls bar from fading out due to the auto-hide timer firing
when the tracks panel is up, and wait until the track panel is hidden before fading
the controls bar.
Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set userInteractionEnabled):
(ControlsBar.prototype._autoHideTimerFired):
2017-02-22 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Can't set the volume slider with macOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=168747
<rdar://problem/30605528>
Reviewed by Dean Jackson.
Only call super for events we haven't registered specifically in the context
of this class. Otherwise we'd invalidate the volume container visibility for
a "mousedown" event registered by the MacOSMediaControls, the super class.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.handleEvent):
2017-02-22 Antti Koivisto <antti@apple.com>
Replace SimpleLineLayout::Range by WTF::IteratorRange
https://bugs.webkit.org/show_bug.cgi?id=168742
Reviewed by Zalan Bujtas.
Kill a redundant custom type.
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForRect):
(WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
(WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::LineResolver::rangeForRect):
(WebCore::SimpleLineLayout::Range::Range): Deleted.
(WebCore::SimpleLineLayout::Range::begin): Deleted.
(WebCore::SimpleLineLayout::Range::end): Deleted.
2017-02-22 Simon Fraser <simon.fraser@apple.com>
Add the Web Authentication API as "Under Consideration".
* features.json:
2017-02-22 Zalan Bujtas <zalan@apple.com>
Simple line layout: Set the pagination strut on the flow when the first line does not fit the page.
https://bugs.webkit.org/show_bug.cgi?id=168738
<rdar://problem/30659469>
Reviewed by Antti Koivisto.
The pagination strut for the first line is tracked by the parent RenderBlockFlow and not by
the line itself (see RenderBlockFlow::adjustLinePositionForPagination()). Also renamed *PaginationStrut* to
*LineStrut* to make sure we don't confuse it with the block level strut.
Not enabled yet.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::hasLineStruts):
(WebCore::SimpleLineLayout::Layout::struts):
(WebCore::SimpleLineLayout::Layout::hasPaginationStruts): Deleted.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::computeFlowHeight):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2017-02-22 Youenn Fablet <youenn@apple.com>
[WebRTC] Disable libwebrtc stderr logging in release mode
https://bugs.webkit.org/show_bug.cgi?id=168734
Reviewed by Tim Horton.
No change of behavior.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads):
2017-02-22 Jer Noble <jer.noble@apple.com>
MediaStreamSourceNode never receives audio from MockRealtimeAudioSourceMac.
https://bugs.webkit.org/show_bug.cgi?id=168731
Reviewed by Eric Carlson.
Test: fast/mediastream/mock-media-source-webaudio.html
Because the audioSourceProvider can be created before the mock source is configured, explicitly configure the
source if necessary after creating the audioSourceProvider.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
2017-02-22 Chris Dumez <cdumez@apple.com>
Do not aggressively throttle DOM timers until they've reached their max nesting level
https://bugs.webkit.org/show_bug.cgi?id=168700
<rdar://problem/29808005>
Reviewed by Simon Fraser.
Do not aggressively throttle DOM timers until they've actually areached their max
nesting level (5). This overly aggressive throttling of non-nested timers is what
was causing Google Maps to use 100% CPU in background tabs for several minutes.
Test: fast/dom/timer-throttling-hidden-page-non-nested.html
* dom/Document.cpp:
(WebCore::Document::timerAlignmentInterval):
2017-02-22 Eric Carlson <eric.carlson@apple.com>
[MediaStream iOS] Respond to capture interruptions and notifications
https://bugs.webkit.org/show_bug.cgi?id=168610
Reviewed by Jer Noble.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Drive-by cleanup: don't create
a sample buffer display layer unless there is an active video track.
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Add static_asserts to ensure that
WebCore::InterruptionReason values map directly to AVCaptureSessionInterruptionReason values.
(WebCore::AVMediaCaptureSource::~AVMediaCaptureSource): Minor cleanup.
(WebCore::AVMediaCaptureSource::startProducingData): Start listening for notifications before
starting the session.
(WebCore::AVMediaCaptureSource::stopProducingData): Remove the notification observers before
stopping the session.
(WebCore::AVMediaCaptureSource::setupSession): Minor style cleanup.
(WebCore::AVMediaCaptureSource::captureSessionRuntimeError): New. When the error is AVErrorMediaServicesWereReset,
sometimes caused by a mediaserverd crash, try to restart the session one time.
(WebCore::AVMediaCaptureSource::captureSessionBeginInterruption): Store the interruption reason.
(WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Try to restart the session if
it was interrupted because the app went into multi-app layout mode.
(WebCore::sessionKVOProperties): Drive-by cleanup.
(-[WebCoreAVMediaCaptureSourceObserver initWithCallback:]):
(-[WebCoreAVMediaCaptureSourceObserver disconnect]):
(-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
(-[WebCoreAVMediaCaptureSourceObserver sessionRuntimeError:]):
(-[WebCoreAVMediaCaptureSourceObserver beginSessionInterrupted:]):
(-[WebCoreAVMediaCaptureSourceObserver endSessionInterrupted:]):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::initializeCapabilities): Not all AVCaptureSession preset strings
are available on all platforms so load with SOFT_LINK_POINTER_OPTIONAL and NULL check before use.
(WebCore::sizeForPreset): Ditto.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Ditto.
2017-02-22 Zalan Bujtas <zalan@apple.com>
Simple line layout: ensureLineBoxes for paginated content.
https://bugs.webkit.org/show_bug.cgi?id=168729
<rdar://problem/30654400>
Reviewed by Antti Koivisto.
This patch sets the layout state bits for paginated subtree layout, when we are switching
over from simple line runs to inline tree.
Not enabled yet.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderView.cpp:
(WebCore::RenderView::pushLayoutStateForPagination): LayoutUnit(1) is not the real height, it's just
an indicator that we've got paginated content.
* rendering/RenderView.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::isPaginated):
(WebCore::SimpleLineLayout::Layout::hasPaginationStruts):
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::computeFlowHeight):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2017-02-22 Per Arne Vollan <pvollan@apple.com>
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=168713
Reviewed by Brent Fulgham.
The include file <ANGLE/ShaderLang.h> is not found.
* testing/Internals.cpp:
2017-02-22 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] Fix issue with allowed systems extraction
https://bugs.webkit.org/show_bug.cgi?id=168717
Reviewed by Carlos Garcia Campos.
The allowed systems were not being extracted from the need-context
message because the loop was not stopping on the right condition.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::extractEventsAndSystemsFromMessage): Fix wrong
condition.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
Add better debug category.
2017-02-22 Antti Koivisto <antti@apple.com>
REGRESSION(r207669): Crash after mutating selector text
https://bugs.webkit.org/show_bug.cgi?id=168655
<rdar://problem/30632111>
Reviewed by Andreas Kling.
Test: fast/css/selector-text-mutation-crash.html
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::updateStyleResolver):
Protect against entering scheduleUpdate and wiping style resolver while updating it.
Extension stylesheets can trigger this.
(WebCore::Style::Scope::scheduleUpdate):
Clear the style resolver immediately if style sheet content changes. The resolver may
have data structures that point to the old sheet contents.
The resolver would get wiped anyway when the scheduled update actually occurs.
* style/StyleScope.h:
2017-02-08 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Move the track sizing algorithm to its own class
https://bugs.webkit.org/show_bug.cgi?id=167988
Reviewed by Manuel Rego Casasnovas.
This is about moving the track sizing algorithm code out of RenderGrid to a new class
GridTrackSizingAlgorithm, making RenderGrid more compact and easy to maintain. A nice side
effect of this patch is the removal of the GridSizingData structure as it is no longer
needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm
as private attribute members. The GridTrack class was also moved to the new file.
The algorithm execution starts with the call to run(). It's mandatory to call setup() before
any call to run() in order to properly configure the behaviour of the algorithm. You can
call setup() & run() multiple times for a single layout operation (normally twice, one for
columns and another one for rows). The algorithm uses a state machine to verify that the
client issues the calls in the proper order (i.e. first columns and then rows). After
finishing the layout, the client should call reset() to allow the algorithm to perform
cleanups and to prepare itself for another round of calls.
In order to implement the different behaviours of the algorithm depending on whether the
available size is definite or not, a strategy pattern was implemented in the
GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and
another one for indefinite ones.
We took advantage of this change to perform some renames of the track sizing algorithm
methods that were still using the names from the first versions of the specs. Not only that,
the original track sizing algorithm method (computeUsedBreadthOfGridTracks) was split in 4
different parts representing the 4 steps of the algorithm.
No new tests as this is about moving code and refactoring.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/GridTrackSizingAlgorithm.cpp: Added.
(WebCore::GridTrack::baseSize):
(WebCore::GridTrack::growthLimit):
(WebCore::GridTrack::setBaseSize):
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrack::growthLimitIfNotInfinite):
(WebCore::GridTrack::setTempSize):
(WebCore::GridTrack::growTempSize):
(WebCore::GridTrack::setGrowthLimitCap):
(WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize):
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
(WebCore::hasOverrideContainingBlockContentSizeForChild):
(WebCore::setOverrideContainingBlockContentSizeForChild):
(WebCore::flowAwareDirectionForChild):
(WebCore::overrideContainingBlockContentSizeForChild):
(WebCore::computeMarginLogicalSizeForChild):
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::setFreeSpace):
(WebCore::GridTrackSizingAlgorithm::rawGridTrackSize):
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithm::initialBaseSize):
(WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::GridTrackSizingAlgorithm::spanningItemCrossesFlexibleSizedTracks):
(WebCore::GridItemWithSpan::GridItemWithSpan):
(WebCore::GridItemWithSpan::gridItem):
(WebCore::GridItemWithSpan::span):
(WebCore::GridItemWithSpan::operator<):
(WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase):
(WebCore::shouldProcessTrackForTrackSizeComputationPhase):
(WebCore::trackSizeForTrackSizeComputationPhase):
(WebCore::updateTrackSizeForTrackSizeComputationPhase):
(WebCore::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
(WebCore::markAsInfinitelyGrowableForTrackSizeComputationPhase):
(WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::clampGrowthShareIfNeeded):
(WebCore::GridTrackSizingAlgorithm::distributeSpaceToTracks):
(WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
(WebCore::GridTrackSizingAlgorithm::gridTrackSize):
(WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize):
(WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth):
(WebCore::GridTrackSizingAlgorithm::findFrUnitSize):
(WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild):
(WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild):
(WebCore::IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
(WebCore::IndefiniteSizeStrategy::maximizeTracks):
(WebCore::normalizedFlexFraction):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::DefiniteSizeStrategy::minLogicalWidthForChild):
(WebCore::DefiniteSizeStrategy::maximizeTracks):
(WebCore::DefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
(WebCore::DefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::DefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
(WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
(WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks):
(WebCore::GridTrackSizingAlgorithm::advanceNextState):
(WebCore::GridTrackSizingAlgorithm::isValidTransition):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::run):
(WebCore::GridTrackSizingAlgorithm::reset):
(WebCore::GridTrackSizingAlgorithm::tracksAreWiderThanMinTrackBreadth):
(WebCore::GridTrackSizingAlgorithm::StateMachine::StateMachine):
(WebCore::GridTrackSizingAlgorithm::StateMachine::~StateMachine):
* rendering/GridTrackSizingAlgorithm.h: Added.
(WebCore::GridTrack::GridTrack):
(WebCore::GridTrack::infiniteGrowthPotential):
(WebCore::GridTrack::plannedSize):
(WebCore::GridTrack::setPlannedSize):
(WebCore::GridTrack::tempSize):
(WebCore::GridTrack::infinitelyGrowable):
(WebCore::GridTrack::setInfinitelyGrowable):
(WebCore::GridTrack::growthLimitCap):
(WebCore::GridTrack::growthLimitIsInfinite):
(WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize):
(WebCore::GridTrackSizingAlgorithmStrategy::GridTrackSizingAlgorithmStrategy):
(WebCore::GridTrackSizingAlgorithmStrategy::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithmStrategy::direction):
(WebCore::GridTrackSizingAlgorithmStrategy::findFrUnitSize):
(WebCore::GridTrackSizingAlgorithmStrategy::distributeSpaceToTracks):
(WebCore::GridTrackSizingAlgorithmStrategy::renderGrid):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::computeTrackBasedLogicalHeight):
(WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
(WebCore::GridTrack::GridTrack): Deleted.
(WebCore::GridTrack::baseSize): Deleted.
(WebCore::GridTrack::growthLimit): Deleted.
(WebCore::GridTrack::setBaseSize): Deleted.
(WebCore::GridTrack::setGrowthLimit): Deleted.
(WebCore::GridTrack::infiniteGrowthPotential): Deleted.
(WebCore::GridTrack::growthLimitIfNotInfinite): Deleted.
(WebCore::GridTrack::plannedSize): Deleted.
(WebCore::GridTrack::setPlannedSize): Deleted.
(WebCore::GridTrack::tempSize): Deleted.
(WebCore::GridTrack::setTempSize): Deleted.
(WebCore::GridTrack::growTempSize): Deleted.
(WebCore::GridTrack::infinitelyGrowable): Deleted.
(WebCore::GridTrack::setInfinitelyGrowable): Deleted.
(WebCore::GridTrack::setGrowthLimitCap): Deleted.
(WebCore::GridTrack::growthLimitCap): Deleted.
(WebCore::GridTrack::growthLimitIsInfinite): Deleted.
(WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): Deleted.
(WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Deleted.
(WebCore::RenderGrid::GridSizingData::GridSizingData): Deleted.
(WebCore::RenderGrid::GridSizingData::freeSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::availableSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::setAvailableSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::advanceNextState): Deleted.
(WebCore::RenderGrid::GridSizingData::isValidTransition): Deleted.
(WebCore::RenderGrid::GridSizingData::grid): Deleted.
(WebCore::RenderGrid::GridSizingData::setFreeSpace): Deleted.
(WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Deleted.
(WebCore::normalizedFlexFraction): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Deleted.
(WebCore::RenderGrid::computeFlexSizedTracksGrowth): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfMinLength): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Deleted.
(WebCore::RenderGrid::computeFlexFactorUnitSize): Deleted.
(WebCore::RenderGrid::findFlexFactorUnitSize): Deleted.
(WebCore::hasOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::setOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::RenderGrid::rawGridTrackSize): Deleted.
(WebCore::RenderGrid::gridTrackSize): Deleted.
(WebCore::RenderGrid::logicalHeightForChild): Deleted.
(WebCore::RenderGrid::minSizeForChild): Deleted.
(WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::RenderGrid::minContentForChild): Deleted.
(WebCore::RenderGrid::maxContentForChild): Deleted.
(WebCore::GridItemWithSpan::GridItemWithSpan): Deleted.
(WebCore::GridItemWithSpan::gridItem): Deleted.
(WebCore::GridItemWithSpan::span): Deleted.
(WebCore::GridItemWithSpan::operator<): Deleted.
(WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Deleted.
(WebCore::trackSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Deleted.
(WebCore::sortByGridTrackGrowthPotential): Deleted.
(WebCore::clampGrowthShareIfNeeded): Deleted.
(WebCore::RenderGrid::distributeSpaceToTracks): Deleted.
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Deleted.
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Deleted.
(WebCore::RenderGrid::gridAreaBreadthForChild): Deleted.
* rendering/RenderGrid.h:
2017-02-22 Per Arne Vollan <pvollan@apple.com>
[Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
https://bugs.webkit.org/show_bug.cgi?id=168711
Reviewed by Alex Christensen.
Add null pointer check.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
2017-02-22 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
https://bugs.webkit.org/show_bug.cgi?id=168662
Reviewed by Michael Catanzaro.
When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
doesn't implement buffered and always returns an empty PlatformTimeRanges.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
Reviewed by Alex Christensen.
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* Configurations/FeatureDefines.xcconfig:
2017-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix WinCairo build after r212703.
* platform/TextureMapper.cmake:
2017-02-21 Per Arne Vollan <pvollan@apple.com>
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.
https://bugs.webkit.org/show_bug.cgi?id=168601
rdar://problem/30583872
Reviewed by Simon Fraser.
Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin,
see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class,
where text is painted in three phases (fill, stroke, markers), where the order follows the
paint-order property. The linecap and linejoin properties are set on the graphics context before
rendering the text.
Tests: fast/css/paint-order.html
fast/css/paint-order-shadow.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::paintOrder):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPaintOrder):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::updateGraphicsContext):
* rendering/TextPaintStyle.h:
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::paintTypesForPaintOrder):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setPaintOrder):
(WebCore::RenderStyle::initialPaintOrder):
* rendering/style/RenderStyleConstants.h:
* rendering/style/SVGRenderStyleDefs.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::fillStrokeMarkers):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint):
2017-02-21 Joseph Pecoraro <pecoraro@apple.com>
[User Timing] Throw a SyntaxError for performance.measure if mark name is not found
https://bugs.webkit.org/show_bug.cgi?id=168707
Reviewed by Ryosuke Niwa.
Test: performance-api/performance-measure-name.html
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::findExistingMarkStartTime):
Instead of returning zero, throw a SyntaxError. This is more in line
with User Timing Level 1 and behavior in Window. This is an issue with
the Level 2 spec: https://github.com/w3c/user-timing/issues/21
2017-02-21 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed attempt to fix the Windows build.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::supportsSubpixelAntialiasedText):
2017-02-21 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r212737.
This change caused an existing LayoutTest to crash.
Reverted changeset:
"REGRESSION(r207669): Crash after mutating selector text"
https://bugs.webkit.org/show_bug.cgi?id=168655
http://trac.webkit.org/changeset/212737
2017-02-21 Chris Dumez <cdumez@apple.com>
REGRESSION (r207720): /more/conformance/conformance/quickCheckAPI-S_V.html test fails
https://bugs.webkit.org/show_bug.cgi?id=168632
<rdar://problem/30620129>
Reviewed by Darin Adler.
After r207720, the following WebGL conformance tests started failing:
- /more/conformance/conformance/quickCheckAPI-S_V.html
- /context/context-lost.html
We started throwing security errors in case where we did not before.
Chrome and Firefox are both passing these tests so our new behavior was not interoperable.
This patch reverts part of r207720 to restore our previous behavior.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
(WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement):
(WebCore::WebGLRenderingContextBase::validateHTMLVideoElement):
* html/canvas/WebGLRenderingContextBase.h:
2017-02-21 Dean Jackson <dino@apple.com>
No need for static attributes when creating a pixel format
https://bugs.webkit.org/show_bug.cgi?id=168688
<rdar://problem/30642256>
Reviewed by Myles Maxfield.
Just create the attributes when needed.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2017-02-20 Filip Pizlo <fpizlo@apple.com>
The collector thread should only start when the mutator doesn't have heap access
https://bugs.webkit.org/show_bug.cgi?id=167737
Reviewed by Keith Miller.
Added new tests in JSTests.
The WebCore changes involve:
- Refactoring around new header discipline.
- Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
* ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
* ForwardingHeaders/heap/IncrementalSweeper.h: Added.
* ForwardingHeaders/heap/MachineStackMarker.h: Added.
* ForwardingHeaders/heap/RunningScope.h: Added.
* bindings/js/CommonVM.cpp:
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::isReadableStreamDisturbed):
(WebCore::Internals::isGCRunning):
(WebCore::Internals::addGCFinalizationCallback):
(WebCore::Internals::stopSweeping):
(WebCore::Internals::startSweeping):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-20 Simon Fraser <simon.fraser@apple.com>
Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
https://bugs.webkit.org/show_bug.cgi?id=168620
<rdar://problem/30617772>
Reviewed by Tim Horton.
Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
PlatformCALayer, where it ultimately affects the layer contents format.
TileControllers are slightly special because we communicate with them via an Obj-C
WebTiledBackingLayer.
Test: compositing/contents-format/subpixel-antialiased-text-enabled.html
* page/Settings.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::supportsSubpixelAntialiasedText):
(WebCore::GraphicsLayer::setSupportsSubpixelAntialiasedText):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setSupportsSubpixelAntialiasedText):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateSupportsSubpixelAntialiasedText):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setWantsDeepColorBackingStore):
(WebCore::TileController::setSupportsSubpixelAntialiasedText):
(WebCore::TileController::setTilesOpaque):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::updateTileLayerProperties):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::supportsSubpixelAntialiasedText):
(PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText):
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
(PlatformCALayer::drawLayerContents):
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer drawsAsynchronously]):
(-[WebTiledBackingLayer setSupportsSubpixelAntialiasedText:]):
(-[WebTiledBackingLayer supportsSubpixelAntialiasedText]):
* platform/spi/cocoa/QuartzCoreSPI.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
2017-02-21 Chris Dumez <cdumez@apple.com>
REGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work
https://bugs.webkit.org/show_bug.cgi?id=168677
<rdar://problem/30640101>
Reviewed by Ryosuke Niwa.
Add quirk to initMouseEvent to unbreak iAd Producer.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEventQuirk):
* dom/MouseEvent.h:
* dom/MouseEvent.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::MacApplication::isIADProducer):
2017-02-21 Jer Noble <jer.noble@apple.com>
AudioSampleDataSource doesn't need to use the m_scratchBuffer on the pulling thread
https://bugs.webkit.org/show_bug.cgi?id=168640
Reviewed by Eric Carlson.
Rather than copying the pulled data into a scratch buffer, applying a volume transformation
and then copying back out, just do the volume transformation in-place in the destination
buffer.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC] Implement Incoming libwebrtc audio source support.
https://bugs.webkit.org/show_bug.cgi?id=167961
Reviewed by Eric Carlson.
Hook libwebrtc incoming audio source into WebCore audio rendering path.
Manually testing that muted sources produce data with zeros and unmuted sources provide data with non zeros.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::create):
(WebCore::streamDescription):
(WebCore::RealtimeIncomingAudioSource::OnData):
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
2017-02-21 Simon Fraser <simon.fraser@apple.com>
Fix ImageBitmap comment to not insert a <canvas>.
* features.json:
2017-02-21 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2017-02-21 Simon Fraser <simon.fraser@apple.com>
Add Media Streams and Capture to features.json.
* features.json:
2017-02-21 Jiewen Tan <jiewen_tan@apple.com>
Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
* features.json:
2017-02-21 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Add ReadableStreamBYOBRequest view getter
https://bugs.webkit.org/show_bug.cgi?id=168652
Reviewed by Youenn Fablet.
Implemented getter for ReadableStreamBYOBRequest view attribute.
Added 1 test checking that view length corresponds to autoAllocateChunkSize.
Also updated test expectations for W3C imported tests.
* Modules/streams/ReadableByteStreamInternals.js:
(isReadableStreamBYOBRequest): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(view): Added.
2017-02-21 Simon Fraser <simon.fraser@apple.com>
Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
* features.json:
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC] ICE candidates should be filtered according a policy
https://bugs.webkit.org/show_bug.cgi?id=168348
Reviewed by Alex Christensen.
Covered by manual tests. Should be covered in the future by layout tests with dedicated internals API.
Adding support for ICE candidate filtering at RTCPeerConnection level.
If ICE candidate filtering is on (by default), host candidates are stored and not sent immediately.
Reflexive candidates are purged from raddr information to not leak the host IP address.
Stored candidates may be advertised to the JS layer if RTCController is notified of a change of filtering policy.
To implement that, PeerConnectionBackend stores all filtered out candidates and RTCPeerConnection register
themselves to RTCController to get notifications of filtering policy changes.
Making RTCPeerConnection use setPendingActivity throughout its lifetime.
This ensures it does not get collected until the page is off or close() is called on the object.
Adding support for enumerating or not all interfaces at libwebrtc level.
This choice is done at creation of the peer connection.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::enableICECandidateFiltering):
(WebCore::PeerConnectionBackend::disableICECandidateFiltering):
(WebCore::filterICECandidate):
(WebCore::PeerConnectionBackend::newICECandidate):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCController.cpp: Added.
(WebCore::RTCController::remove):
(WebCore::RTCController::add):
(WebCore::RTCController::disableICECandidateFiltering):
(WebCore::RTCController::enableICECandidateFiltering):
* Modules/mediastream/RTCController.h: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::close):
(WebCore::RTCPeerConnection::rtcController):
(WebCore::RTCPeerConnection::registerToController):
(WebCore::RTCPeerConnection::unregisterFromController):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
* WebCore.xcodeproj/project.pbxproj:
* page/Page.h:
(WebCore::Page::rtcController):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2017-02-21 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, update WebCrypto API feature status.
* features.json:
2017-02-21 Simon Fraser <simon.fraser@apple.com>
Fix the bad JSON.
* features.json:
2017-02-21 Andreas Kling <akling@apple.com>
[iOS] WebKit1 should use shared memory pressure handler code.
<https://webkit.org/b/168653>
Reviewed by Antti Koivisto.
Remove iOS WebKit1 specific members and code from MemoryPressureHandler in favor
of using the same code that iOS WebKit2 and macOS WebKit uses.
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory): Add two cleanup calls that were only in the iOS WebView code.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::m_releaseMemoryBlock): Deleted.
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::respondToMemoryPressureCallback): Deleted.
(WebCore::MemoryPressureHandler::installMemoryReleaseBlock): Deleted.
(WebCore::MemoryPressureHandler::setReceivedMemoryPressure): Deleted.
(WebCore::MemoryPressureHandler::clearMemoryPressure): Deleted.
(WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage): Deleted.
(WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded): Deleted.
2017-02-21 Anders Carlsson <andersca@apple.com>
Fix two failing WebKit legacy tests
https://bugs.webkit.org/show_bug.cgi?id=168667
Reviewed by Tim Horton.
Handle the NSPasteboardTypeString type.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::addHTMLClipboardTypesForCocoaType):
2017-02-21 Simon Fraser <simon.fraser@apple.com>
Add Web Audio and Web MIDI to features.json.
* features.json:
2017-02-21 Antti Koivisto <antti@apple.com>
REGRESSION(r207669): Crash after mutating selector text
https://bugs.webkit.org/show_bug.cgi?id=168655
<rdar://problem/30632111>
Reviewed by Brent Fulgham.
Test: fast/css/selector-text-mutation-crash.html
* style/StyleScope.cpp:
(WebCore::Style::Scope::scheduleUpdate):
Clear the style resolver immediately if style sheet content changes. The resolver may
have data structures that point to the old sheet contents.
The resolver would get wiped anyway when the scheduled update actually occurs.
2017-02-21 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Add support for AES-CFB
https://bugs.webkit.org/show_bug.cgi?id=168344
<rdar://problem/20940221>
Reviewed by Brent Fulgham.
This patch adds support for AES-CFB. Operations of AES-CFB include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. This implementation follows a slightly old version
of WebCryptoAPI spec: https://www.w3.org/TR/2014/CR-WebCryptoAPI-20141211/#aes-cfb.
Tests: crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters.html
crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters.html
crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public.html
crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html
crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html
crypto/subtle/aes-cfb-generate-export-key-jwk-length-256.html
crypto/subtle/aes-cfb-generate-export-raw-key.html
crypto/subtle/aes-cfb-generate-key-encrypt-decrypt.html
crypto/subtle/aes-cfb-generate-key.html
crypto/subtle/aes-cfb-import-jwk-key-length-128.html
crypto/subtle/aes-cfb-import-jwk-key-length-192.html
crypto/subtle/aes-cfb-import-jwk-key-length-256.html
crypto/subtle/aes-cfb-import-key-decrypt.html
crypto/subtle/aes-cfb-import-key-encrypt.html
crypto/subtle/aes-cfb-import-key-unwrap-jwk-key.html
crypto/subtle/aes-cfb-import-key-unwrap-raw-key.html
crypto/subtle/aes-cfb-import-key-wrap-jwk-key.html
crypto/subtle/aes-cfb-import-key-wrap-raw-key.html
crypto/subtle/aes-cfb-import-raw-key.html
crypto/workers/subtle/aes-cfb-import-key-decrypt.html
crypto/workers/subtle/aes-cfb-import-key-encrypt.html
crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html
crypto/workers/subtle/aes-cfb-import-key-wrap-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Add CryptoAlgorithmAES_CFB.cpp,
change AesCbcParams.idl to AesCbcCfbParams.idl.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
Add support for AES-CFB.
* crypto/CryptoAlgorithm.h:
Include <wtf/Variant.h>.
* crypto/CryptoAlgorithmParameters.h:
Add support for AES-CFB.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_CFB):
(WebCore::CryptoAlgorithmAES_CFB::create):
(WebCore::CryptoAlgorithmAES_CFB::identifier):
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::generateKey):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
(WebCore::CryptoAlgorithmAES_CFB::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h: Added.
* crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
Add dummy support of AES_CFB for GTK+.
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::transformAES_CBC):
Drop conditional PLATFORM(COCOA).
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: Added.
(WebCore::transformAES_CFB):
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Add support for AES-CFB.
* crypto/parameters/AesCbcCfbParams.idl: Renamed from Source/WebCore/crypto/parameters/AesCbcParams.idl.
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
Since dictionaries AesCbcParams and AesCfbParams are essentially the same, I combine them together in our implementations.
2017-02-21 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the ToT iOS build
Adopt updated UIKit SPI and remove calls to the deprecated version.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard setItems:]):
2017-02-21 Per Arne Vollan <pvollan@apple.com>
[Win] WebView is not painting in accelerated compositing mode.
https://bugs.webkit.org/show_bug.cgi?id=168654
Reviewed by Brent Fulgham.
Initializing the uncommitted layer change flags to CoverageRectChanged in GraphicsLayerCA,
stops WebView painting in accelerated mode.
Covered by existing tests.
* platform/graphics/ca/GraphicsLayerCA.h:
2017-02-21 Jer Noble <jer.noble@apple.com>
Make logging in high-priority audio threads less expensive
https://bugs.webkit.org/show_bug.cgi?id=168639
Reviewed by Jon Lee.
Logging from inside a high-priority audio thread will make a number of calls to malloc, block, and
therefore cause audio glitches. Make this logging less expensive by dispatching to the main thread
before creating and outputting the log string.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/mac/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp.
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
2017-02-21 Jer Noble <jer.noble@apple.com>
Give the Mock audio input a "hum" to make drop-outs more detectable
https://bugs.webkit.org/show_bug.cgi?id=168641
Reviewed by Eric Carlson.
Add two helper functions to generate waveforms: addHum() and writeHum(). Use these methods
to create a bip-bop audio buffer which can be used to "blit" a portion the waveform into the
destination buffer during rendering. The background hum must be seamless across multiple
pull operations, so add the hum sound during rendering.
To ensure the waveform buffer is created, initialize the sampleRate to zero, then call
applySampleRate() with the desired default rate, 44.1kHz.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::writeHum):
(WebCore::addHum):
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSourceMac::render):
(WebCore::MockRealtimeAudioSourceMac::applySampleRate):
2017-02-21 Jer Noble <jer.noble@apple.com>
Make TrackPrivateBase ThreadSafeRefCounted, so that it can be retained in non-main threads
https://bugs.webkit.org/show_bug.cgi?id=168642
Reviewed by Eric Carlson.
AudioTrackPrivateMediaStreamCocoa has two entry points from background threads:
audioSamplesAvailable() and render(). Protect against being destroyed mid-execution by
retaining this for the duration of those methods.
* platform/graphics/TrackPrivateBase.h:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2017-02-21 Jer Noble <jer.noble@apple.com>
Pulling too quickly from an AudioSampleDataSource should increase the pre-buffer amount
https://bugs.webkit.org/show_bug.cgi?id=168645
Reviewed by Eric Carlson.
If a pull operation runs past the end of the buffered range of a CARingBuffer, the underrun
is zero-filled, causing an audible glitch. In this case, bias m_outputSampleOffset by the
amount of the underrun, which should keep the underrun from reoccurring.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
2017-02-21 Jer Noble <jer.noble@apple.com>
AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
https://bugs.webkit.org/show_bug.cgi?id=168635
Reviewed by Jon Lee.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
2017-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r212681): Crash when dragging links without a drag image
https://bugs.webkit.org/show_bug.cgi?id=168648
Reviewed by Tim Horton.
This happens in GTK+ port, because we don't use a drag image for links.
Fixes: editing/pasteboard/drop-link.html
editing/pasteboard/drop-text-without-selection.html
editing/pasteboard/files-during-page-drags.html
fast/events/content-changed-during-drop.html
fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
fast/events/drag-and-drop-link-into-focused-contenteditable.html
fast/events/drag-and-drop-link.html
fast/events/drag-in-frames.html
fast/events/drag-parent-node.html
fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html
* page/DragController.cpp:
(WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
returns nullptr.
2017-02-21 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r212699.
Internal build not ready
Reverted changeset:
"[WebRTC][Mac] Activate libwebrtc"
https://bugs.webkit.org/show_bug.cgi?id=167293
http://trac.webkit.org/changeset/212699
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
Remove ENABLE_THREADED_COMPOSITOR build option
https://bugs.webkit.org/show_bug.cgi?id=168606
Reviewed by Michael Catanzaro.
* platform/TextureMapper.cmake:
2017-02-20 Alex Christensen <achristensen@webkit.org>
Fix some 32-bit builds after r212699
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame):
Explicitly cast OSStatus to int for logging.
2017-02-20 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary PerformanceEntry virtual methods
https://bugs.webkit.org/show_bug.cgi?id=168633
Reviewed by Ryosuke Niwa.
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::isResource):
(WebCore::PerformanceEntry::isMark):
(WebCore::PerformanceEntry::isMeasure):
Implement based on the Type.
* page/PerformanceMark.h:
* page/PerformanceMeasure.h:
* page/PerformanceResourceTiming.h:
Remove virtual overrides.
2017-02-20 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
Reviewed by Alex Christensen.
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
2017-02-20 Joseph Pecoraro <pecoraro@apple.com>
ASSERTION FAILED: m_normalWorld->hasOneRef() under WorkerThread::stop
https://bugs.webkit.org/show_bug.cgi?id=168356
<rdar://problem/30592486>
Reviewed by Ryosuke Niwa.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::removeAllEventListeners):
Remove Performance object EventListeners.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):
(WebCore::WorkerGlobalScope::removeAllEventListeners):
(WebCore::WorkerGlobalScope::performance):
* workers/WorkerGlobalScope.h:
Remove Performance object EventListeners.
Also clear Performance early in destruction since its ContextDestructionObserver
destruction makes checks about the WorkerThread.
2017-02-20 Jer Noble <jer.noble@apple.com>
Local audio-only stream will not trigger playback to begin
https://bugs.webkit.org/show_bug.cgi?id=168412
Reviewed by Youenn Fablet.
Test: fast/mediastream/local-audio-playing-event.html
With video-bearing streams, the first video sample emitted from the stream causes the
readyState to move from HAVE_NOTHING to HAVE_ENOUGH_DATA. Wire up this same behavior for
audio-bearing streams. Add a MediaStreamTrackPrivate::Observer callback method
audioSamplesAvailable(), which gets passed up to MediaPlayerPrivateMediaStreamAVFObjC.
Because this callback may be (and probably will be) called on a background thread, run the
updateReadyState() task in a scheduledDeferredTask().
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSamplesAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
2017-02-20 Zalan Bujtas <zalan@apple.com>
Simple line layout: Implement absoluteQuadsForRange.
https://bugs.webkit.org/show_bug.cgi?id=168613
<rdar://problem/30614618>
Reviewed by Simon Fraser.
This patch ensures that the commonly used Range::getClientRects calls do not
throw us off of the simple line layout path.
Test: fast/dom/Range/simple-line-layout-getclientrects.html
* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteQuadsForRange):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange): Special case empty ranges with multiple empty runs.
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
* rendering/SimpleLineLayoutResolver.h:
2017-02-20 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r212685.
This change broke the 32-bit Sierra build.
Reverted changeset:
"Resource Load Statistics: Add alternate classification
method"
https://bugs.webkit.org/show_bug.cgi?id=168347
http://trac.webkit.org/changeset/212685
2017-02-20 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for constructors that have variadic parameters
https://bugs.webkit.org/show_bug.cgi?id=168614
Reviewed by Alex Christensen.
In preparation of removing some more custom bindings, move the constructor calling
code over to using GenerateParametersCheck completely. This required
- Removing special case of NamedConstructors automatically getting a Document passed
to them. The three named constructors that expected this have been updated to add
the required attributes.
- Add a version of the GenerateCallWith prologue for constructors.
- Remove now unnecessary argumentCount return value from GenerateParametersCheck.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateCallWithUsingReferences):
(GenerateCallWithUsingPointers):
(GenerateConstructorCallWithUsingPointers):
(GenerateCallWith):
(GenerateParametersCheck):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
Update results for more consistent placement of ScriptExecutionContext and Document
accessors, add UNLIKELY to context checks, and remove automatic Document passing
for NamedConstructors.
* html/HTMLAudioElement.idl:
* html/HTMLImageElement.idl:
* html/HTMLOptionElement.idl:
Add ConstructorCallWith=Document.
2017-02-20 John Wilander <wilander@apple.com>
Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
<rdar://problem/30352793>
Reviewed by Alex Christensen.
This patch only adds test infrastructure in WebCore.
Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
* loader/ResourceLoadObserver.h:
2017-02-20 Anders Carlsson <andersca@apple.com>
Use the new drag code path when dragging links
https://bugs.webkit.org/show_bug.cgi?id=168612
Reviewed by Tim Horton.
* editing/Editor.cpp:
(WebCore::Editor::copyURL):
Use userVisibleString instead of fillInUserVisibleForm.
(WebCore::Editor::pasteboardWriterURL):
New function that returns a PasteboardWriterData::URL for a given URL + title.
* editing/Editor.h:
Add new members.
* editing/mac/EditorMac.mm:
(WebCore::Editor::userVisibleString):
(WebCore::Editor::fillInUserVisibleForm): Deleted.
Add a getter instead of a function that fills in a struct member.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Add the new DragItem code path when dragging links.
* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::isEmpty):
Check for m_url as well.
(WebCore::PasteboardWriterData::setURL):
Set m_url.
* platform/PasteboardWriterData.h:
Add new members.
* platform/mac/PasteboardWriter.mm:
(WebCore::toUTI):
New helper function that returns an UTI from a pasteboard type.
(WebCore::createPasteboardWriter):
Handle converting URLs to the various pasteboard types.
2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com>
Add plumbing to the UI process for TextIndicatorData when computing the drag image
https://bugs.webkit.org/show_bug.cgi?id=168583
Work towards <rdar://problem/30313681>
Reviewed by Tim Horton.
Adds some additional arguments to drag image creation functions to allow platforms to specify TextIndicatorData
for a link or selection-based DragImage. This TextIndicatorData is an optional member of the DragImage, and is
propagated to the UI process via SetDragImage in the WebDragClient.
Additionally renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
No new tests, since there is no behavior change.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/Page.cpp:
(WebCore::Page::hasSelectionAtPosition):
(WebCore::Page::hasDataInteractionAtPosition): Deleted.
* page/Page.h:
* platform/DragImage.cpp:
(WebCore::createDragImageForSelection):
(WebCore::createDragImageForLink):
(WebCore::DragImage::operator=):
* platform/DragImage.h:
* platform/gtk/DragImageGtk.cpp:
(WebCore::createDragImageForLink):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageForLink):
2017-02-20 Brent Fulgham <bfulgham@apple.com>
Nullptr dereferences when stopping a load
https://bugs.webkit.org/show_bug.cgi?id=168608
<rdar://problem/29852056>
Reviewed by Ryosuke Niwa.
Don't attempt to notify a detached frame's load client that the load is
stopped.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoading): Check for null frame loader and
bypass dereferencing it.
2017-02-17 Anders Carlsson <andersca@apple.com>
Add a new drag code path and use it for dragging plain text
https://bugs.webkit.org/show_bug.cgi?id=168534
Reviewed by Geoffrey Garen.
The new code path is currently only used for plain text selection dragging.
* WebCore.xcodeproj/project.pbxproj:
* page/DragClient.h:
(WebCore::DragClient::useLegacyDragClient):
Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.
(WebCore::DragClient::beginDrag):
Add new empty member function.
* page/DragController.cpp:
(WebCore::dragImageAnchorPointForSelectionDrag):
Helper function that returns the anchor point for a selection drag image.
(WebCore::DragController::startDrag):
If we can use the new code path, set up a drag item with an image and pasteboard data.
(WebCore::DragController::beginDrag):
New function that calls out to the client.
* page/DragController.h:
Add new members.
* platform/DragItem.h:
Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.
* platform/mac/PasteboardWriter.h:
Rename createPasteboardWriting to createPasteboardWriter.
* platform/mac/PasteboardWriter.mm:
(WebCore::createPasteboardWriter):
Use the UTI pasteboard type.
2017-02-20 Alex Christensen <achristensen@webkit.org>
Fix libwebrtc build after r212644.
https://bugs.webkit.org/show_bug.cgi?id=168596
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
m_endpoint changed from a c++ reference to a WTF::Ref, so we need to use operator -> instead of .
2017-02-20 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Add ReadableByteStreamController byobRequest attribute
https://bugs.webkit.org/show_bug.cgi?id=168319
Reviewed by Youenn Fablet.
Added ReadableByteStreamController byobRequest attribute.
Added tests related to ReadableStreamBYOBRequest as a dedicated object
and also as an attribute of ReadableByteStreamController.
* CMakeLists.txt: Added new files.
* DerivedSources.cpp: Added new files.
* DerivedSources.make: Added new files.
* Modules/streams/ReadableByteStreamController.idl: Added byobRequest support.
* Modules/streams/ReadableByteStreamController.js: Added byobRequest support.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableStreamBYOBRequest): Added constructor.
* Modules/streams/ReadableStreamBYOBRequest.idl: Added.
* Modules/streams/ReadableStreamBYOBRequest.js: Added.
(respond): Not implemented yet.
(respondWithNewView): Not implemented yet.
(view): Not implemented yet.
* WebCore.xcodeproj/project.pbxproj: Added new files.
* bindings/js/JSDOMGlobalObject.cpp: Added ReadableStreamBYOBRequest support.
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
(WebCore::JSDOMGlobalObject::finishCreation):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSReadableStreamPrivateConstructors.cpp: Added ReadableStreamBYOBRequest support.
(WebCore::constructJSReadableByteStreamController):
(WebCore::constructJSReadableStreamBYOBRequest):
(WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
(WebCore::createReadableStreamBYOBRequestPrivateConstructor):
* bindings/js/JSReadableStreamPrivateConstructors.h: Added ReadableStreamBYOBRequest support.
* bindings/js/WebCoreBuiltinNames.h: Added ReadableStreamBYOBRequest support.
2017-02-20 Per Arne Vollan <pvollan@apple.com>
[Win] Custom scale factor is not applied in all cases.
https://bugs.webkit.org/show_bug.cgi?id=168117
Reviewed by Brent Fulgham.
We should not call the function deviceScaleFactorForWindow directly, since this
will return the system scale factor, and ignore the custom scale factor.
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
(WebCore::WKCACFViewLayerTreeHost::initializeContext):
(WebCore::WKCACFViewLayerTreeHost::resize):
(WebCore::WKCACFViewLayerTreeHost::setScaleFactor):
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
* platform/win/GDIUtilities.h:
(WebCore::makeScaledPoint):
* platform/win/PlatformMouseEventWin.cpp:
(WebCore::positionForEvent):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::show):
(WebCore::PopupMenuWin::wndProc):
* platform/win/PopupMenuWin.h:
2017-02-20 Jon Lee <jonlee@apple.com>
Fix build error for iOS. Unreviewed.
* platform/graphics/GraphicsContext3D.cpp: Move stub function into !PLATFORM(COCOA) instead of !PLATFORM(MAC).
2017-02-20 Jon Lee <jonlee@apple.com>
Unreviewed, rolling out r212639.
Have a fix for the linker error on iOS.
Reverted changeset:
"Unreviewed, rolling out r212637."
https://bugs.webkit.org/show_bug.cgi?id=168595
http://trac.webkit.org/changeset/212639
2017-02-20 Youenn Fablet <youenn@apple.com>
[WebRTC] Fix some memory leaks in libwebrtc binding code
https://bugs.webkit.org/show_bug.cgi?id=168596
Reviewed by Eric Carlson.
Covered by manual testing.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector): Using the libwebrtc way of creating such objects.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::create):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::PeerConnectionFactoryAndThreads::OnMessage):
2017-02-20 Alexey Proskuryakov <ap@apple.com>
Clean up how WebKit exports _WebCreateFragment
https://bugs.webkit.org/show_bug.cgi?id=168579
Reviewed by Dan Bernstein.
* editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
* editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.
2017-02-20 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r212637.
This change broke iOS builds.
Reverted changeset:
"Add 'webglcontextchanged' WebGLContextEvent"
https://bugs.webkit.org/show_bug.cgi?id=168595
http://trac.webkit.org/changeset/212637
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
Remove code under USE(GRAPHICS_SURFACE)
https://bugs.webkit.org/show_bug.cgi?id=168592
Reviewed by Michael Catanzaro.
This was only used by EFL port.
* platform/TextureMapper.cmake:
* platform/graphics/opengl/GLPlatformSurface.cpp: Removed.
* platform/graphics/surfaces/GLTransportSurface.cpp: Removed.
* platform/graphics/surfaces/GLTransportSurface.h: Removed.
* platform/graphics/surfaces/GraphicsSurface.cpp: Removed.
* platform/graphics/surfaces/GraphicsSurface.h: Removed.
* platform/graphics/surfaces/GraphicsSurfaceToken.h: Removed.
* platform/graphics/surfaces/egl/EGLConfigSelector.cpp: Removed.
* platform/graphics/surfaces/egl/EGLConfigSelector.h: Removed.
* platform/graphics/surfaces/egl/EGLContext.cpp: Removed.
* platform/graphics/surfaces/egl/EGLContext.h: Removed.
* platform/graphics/surfaces/egl/EGLHelper.cpp: Removed.
* platform/graphics/surfaces/egl/EGLHelper.h: Removed.
* platform/graphics/surfaces/egl/EGLSurface.cpp: Removed.
* platform/graphics/surfaces/egl/EGLSurface.h: Removed.
* platform/graphics/surfaces/egl/EGLXSurface.cpp: Removed.
* platform/graphics/surfaces/egl/EGLXSurface.h: Removed.
* platform/graphics/surfaces/glx/GLXConfigSelector.h: Removed.
* platform/graphics/surfaces/glx/GLXContext.cpp: Removed.
* platform/graphics/surfaces/glx/GLXContext.h: Removed.
* platform/graphics/surfaces/glx/GLXSurface.cpp: Removed.
* platform/graphics/surfaces/glx/GLXSurface.h: Removed.
* platform/graphics/surfaces/glx/X11Helper.cpp: Removed.
* platform/graphics/surfaces/glx/X11Helper.h: Removed.
* platform/graphics/texmap/TextureMapperBackingStore.cpp:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperPlatformLayer.h:
(WebCore::TextureMapperPlatformLayer::setClient):
* platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Removed.
* platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Removed.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
(WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
2017-02-20 Dean Jackson <dino@apple.com>
Add 'webglcontextchanged' WebGLContextEvent
https://bugs.webkit.org/show_bug.cgi?id=168595
<rdar://problem/30604254>
Reviewed by Antoine Quint.
Add a new event that is dispatched when the GraphicsContext3D
notices that the active GPU has changed.
Test: fast/canvas/webgl/webglcontextchangedevent.html
* dom/EventNames.h: Add 'webglcontextchanged'.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Dispatch the new event.
(WebCore::WebGLRenderingContextBase::simulateContextChanged): Tell the GraphicsContext3D to
pretend there was a GPU switch. This is called from Internals for testing.
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl: Export the interface so Internals can see it.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::simulateContextChanged): Tell the GraphicsContext3DManager
that it should pretend a GPU change has happened, which causes it to notify all the
active contexts.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3DManager::updateAllContexts): Tell the GraphicsContext3Ds
to tell their WebGLRenderingContexts to dispatch an event.
(WebCore::GraphicsContext3D::simulateContextChanged): Fake the display change.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::dispatchContextChangedNotification): Tell the WebGLRenderingContext
that a change has occurred, and that it should dispatch an event. This is a layering
violation which will need to be fixed (although with other communication from GC3D back
to WebGL).
* testing/Internals.cpp:
(WebCore::Internals::simulateWebGLContextChanged):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-19 Dean Jackson <dino@apple.com>
Activate/deactivate high performance GPU when requested
https://bugs.webkit.org/show_bug.cgi?id=168559
<rdar://problem/30592266>
Reviewed by Jon Lee.
Respect the high-performance powerPreference for WebGL, by managing an
object that enables the high-performance GPU. If a WebGL context wants
high-performance, and it is visible, then a manager class in GraphicsContext3D
creates and retains the object, causing all the WebGL contexts to move GPUs.
If all the high-performance contexts are not visible, such as in a background tab,
then the manager will release the object, allowing the GPU to power down.
The swapping back from the high-performance GPU happens on a timer, to make
sure we don't churn between GPUs if the user is swapping between a lot of tabs,
or windows.
Unfortunately testing this change properly requires hardware with
multiple GPUs. I plan to write an API test that fakes most of the
system interaction, such as occluding the page. An API test might
also be able to verify if the system has more than one GPU. Otherwise
I'll have to plumb everything through Internals.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::isHighPerformanceContext): Helper to detect if the GraphicsContext3D actually
used high-performance mode.
(WebCore::WebGLRenderingContextBase::create): Add logging if we are
actually overriding a high-performance request.
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): If we are high-performance,
then register for activity state changes.
(WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
(WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
(WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D): Call removeActivityStateChangeObserver
as the GC3D is destroyed.
(WebCore::WebGLRenderingContextBase::maybeRestoreContext): If the context was
restored successfully, and came back in high-performance, then we need
to listen for activity state changes as usual.
(WebCore::WebGLRenderingContextBase::activityStateDidChange): If we changed visibility,
tell the GC3D.
* html/canvas/WebGLRenderingContextBase.h: Class inherits ActivityStateChangeObserver.
* page/Settings.in: No longer force low-power everywhere.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::setContextVisibility): Empty implementation for non-Mac.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::powerPreferenceUsedForCreation): Tells clients what power preference
was actually used during creation (e.g. a single GPU system will use default, even if
they requested high-performance).
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Helper class to
look after all GraphicsContext3Ds.
(WebCore::GraphicsContext3DManager::hasTooManyContexts): We have a limit on the
number of contexts we can keep alive at any one time.
(WebCore::manager): Helper to return the static instance.
(WebCore::displayWasReconfigured): Send a message to all the contexts.
(WebCore::GraphicsContext3DManager::addContext):
(WebCore::GraphicsContext3DManager::removeContext):
(WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
(WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState): Check if the number
of contexts requiring high-performance means we need to enable/disable that GPU.
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Releases our
object that keeps the high-performance GPU on.
(WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Get rid of the first (oldest)
context. This code was in GC3D proper, but it made more sense here in the helper.
(WebCore::setPixelFormat): All contexts are created muxable now.
(WebCore::GraphicsContext3D::create): Use the manager.
(WebCore::GraphicsContext3D::GraphicsContext3D): Ditto.
(WebCore::GraphicsContext3D::~GraphicsContext3D): Add logging.
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Better logging.
(WebCore::GraphicsContext3D::updateCGLContext):
(WebCore::GraphicsContext3D::setContextVisibility): This is the responder to the
ActivityStateChanges in the WebGLRenderingContext.
(WebCore::activeContexts): Deleted.
(WebCore::addActiveContext): Deleted.
(WebCore::removeActiveContext): Deleted.
2017-02-20 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
https://bugs.webkit.org/show_bug.cgi?id=167693
Reviewed by Sergio Villar Senin.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridPosition):
(WebCore::isLayoutDependent):
(WebCore::resolveJustifySelfAuto):
(WebCore::isImplicitlyInheritedGridOrFlexProperty):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSGridAutoRepeatValue.cpp:
* css/CSSGridAutoRepeatValue.h:
* css/CSSGridLineNamesValue.cpp:
* css/CSSGridLineNamesValue.h:
* css/CSSGridTemplateAreasValue.cpp:
* css/CSSGridTemplateAreasValue.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSProperties.json:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isContentDistributionValue):
(WebCore::CSSValue::isGridLineNamesValue):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridAutoFlow):
(WebCore::StyleBuilderConverter::convertContentAlignmentData):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
* css/StyleResolver.cpp:
(WebCore::equivalentBlockDisplay):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridAutoFlow):
(WebCore::consumeGridTemplateAreas):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::consumeGridShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* dom/Document.cpp:
* dom/Document.h:
* dom/Position.cpp:
(WebCore::Position::isCandidate):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
* rendering/Grid.cpp:
* rendering/Grid.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::getFirstLetter):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::clearExtraInlineAndBlockOffests):
(WebCore::RenderBox::containingBlockLogicalWidthForContent):
(WebCore::RenderBox::containingBlockLogicalHeightForContent):
(WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::sizesLogicalWidthToFitContent):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalHeight):
(WebCore::RenderBox::createsNewFormattingContext):
(WebCore::logicalWidthIsResolvable):
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
(WebCore::RenderBox::hasDefiniteLogicalHeight):
* rendering/RenderBox.h:
(WebCore::RenderBox::isGridItem):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::alignChildren):
* rendering/RenderGrid.cpp:
* rendering/RenderGrid.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderGrid):
* rendering/style/GridArea.h:
* rendering/style/GridLength.h:
* rendering/style/GridPosition.h:
* rendering/style/GridPositionsResolver.cpp:
* rendering/style/GridPositionsResolver.h:
* rendering/style/GridTrackSize.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::isCSSGridLayoutEnabled):
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::gridItemRowEnd):
(WebCore::RenderStyle::setGridRowGap):
(WebCore::RenderStyle::initialGridItemRowEnd):
(WebCore::RenderStyle::isDisplayReplacedType):
(WebCore::RenderStyle::isDisplayGridBox):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleGridData.cpp:
* rendering/style/StyleGridData.h:
* rendering/style/StyleGridItemData.cpp:
* rendering/style/StyleGridItemData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setCSSGridLayoutEnabled):
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
https://bugs.webkit.org/show_bug.cgi?id=168375
Reviewed by Alex Christensen.
Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
set.
* platform/network/NetworkStorageSession.h:
* platform/network/soup/CookieStorageSoup.cpp:
(WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
(WebCore::stopObservingCookieChanges): Ditto.
(WebCore::cookieChangeCallbackMap): Deleted.
(WebCore::soupCookiesChanged): Deleted.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
(WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
(WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
(WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
(WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
(WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.
2017-02-19 Chris Dumez <cdumez@apple.com>
onbeforeunload event return value coercion is not per-spec
https://bugs.webkit.org/show_bug.cgi?id=168382
Reviewed by Darin Adler.
Update handling of value returned by onbeforeunload event listeners
to match Firefox and the specification:
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (step 4)
Namely, the following changes were made:
- Only set the event's returnValue attribute to the returned value if the attribute
value is the empty string (so as to not override the attribute value if it has
explicitly been set by JS).
- Cancel the event when the return value is not null by calling preventDefault().
Additionally, the following changes were made:
- Ask the user to confirm the navigation if the event was canceled, not just if the
returnValue attribute was set to a non-empty string.
as per:
- https://html.spec.whatwg.org/#prompt-to-unload-a-document (step 8)
Tests: fast/events/before-unload-return-string-conversion.html
imported/w3c/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html
* bindings/js/JSEventListener.cpp:
(WebCore::handleBeforeUnloadEventReturnValue):
(WebCore::JSEventListener::handleEvent):
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2017-02-19 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Call SoupNetworkSession::setShouldIgnoreTLSErrors when testRunner.setAllowsAnySSLCertificate() is called
https://bugs.webkit.org/show_bug.cgi?id=168571
Reviewed by Michael Catanzaro.
Fixes: http/tests/ssl/upgrade-origin-usage.html
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setAllowsAnySSLCertificate):
2017-02-18 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r212218): Assertion failures in and after parserRemoveChild
https://bugs.webkit.org/show_bug.cgi?id=168458
Reviewed by Antti Koivisto.
The bug was caused by parserRemoveChild not preceeding to remove oldChild even when
oldChild had been inserted elsewhere during unload evnets of the disconnected frames.
Fixed the bug by checking this condition and exiting early.
Also fixed various callers of parserRemoveChild to not call parserAppendChild when
the removed node had already been inserted elsewhere by scripts.
Tests: fast/parser/adoption-agency-unload-iframe-3.html
fast/parser/adoption-agency-unload-iframe-4.html
fast/parser/xml-error-unload-iframe.html
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been
inserted elsewhere while firing unload events. Also moved the call to
notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can
synchrnously fire a focus event.
(WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside
NoEventDispatchAssertion since adoptNode call here should never mutate DOM.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeReparentTask): Added an early exit when the node had already been
inserted elsewhere.
(WebCore::executeInsertAlreadyParsedChildTask): Ditto.
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases.
Exit early when insertErrorMessageBlock detached the parser (by author scripts).
(WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit.
2017-02-19 Chris Dumez <cdumez@apple.com>
<input type=color readonly> doesn't act per spec
https://bugs.webkit.org/show_bug.cgi?id=168421
<rdar://problem/30593185>
Reviewed by Ryosuke Niwa.
The 'readonly' attribute should not apply to <input type=color> as per the
HTML specification:
- https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
Chrome / Firefox and Edge already behave as per the specification.
Tests: fast/forms/color/input-color-disabled.html
fast/forms/color/input-color-readonly.html
* html/ColorInputType.cpp:
(WebCore::ColorInputType::handleDOMActivateEvent):
(WebCore::ColorInputType::didChooseColor):
2017-02-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r212466.
https://bugs.webkit.org/show_bug.cgi?id=168577
causes crashes on AArch64 on linux, maybe it's causing crashes
on iOS too (Requested by pizlo on #webkit).
Reverted changeset:
"The collector thread should only start when the mutator
doesn't have heap access"
https://bugs.webkit.org/show_bug.cgi?id=167737
http://trac.webkit.org/changeset/212466
2017-02-19 Zalan Bujtas <zalan@apple.com>
Simple line layout: Implement positionForPoint.
https://bugs.webkit.org/show_bug.cgi?id=168565
<rdar://problem/30593370>
Reviewed by Antti Koivisto.
With this patch, now we don't need to switch over to line box tree anymore when positionForPoint()
is called on a single RenderText content (which is the majority of the simple line content).
This patch also adds a new positionForPoint method which returns a Position object instead of VisiblePosition.
Some of the positionForPoint() callsites are only interested in the Position object so constructing a VisiblePosition
(which could potentially kick off a layout) is a waste. At this point the non-simple line layout codepath still constructs
a VisiblePosition and that should be addresses as part of webkit.org/b/168566.
Covered by existing tests.
* dom/Document.cpp:
(WebCore::Document::caretRangeFromPoint):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPoint):
* rendering/RenderBlockFlow.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::positionForPoint):
* rendering/RenderObject.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
* rendering/RenderText.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::positionForPoint):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::runForPoint):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::logicalLeft):
(WebCore::SimpleLineLayout::RunResolver::Run::logicalRight):
2017-02-19 Antti Koivisto <antti@apple.com>
Execute pending scripts asynchronously after stylesheet loads complete
https://bugs.webkit.org/show_bug.cgi?id=168367
rdar://problem/30561379
Reviewed by Andreas Kling.
The current synchronous execution is fragile and creates various problems.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::checkLoaded):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::notifyChildInserted):
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::removeChildren):
Remove various places where we would trigger delayed synchronous execution.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle):
Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
(WebCore::Document::didRemoveAllPendingStylesheet):
Call asynchronous script execution function.
* dom/Document.h:
(WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
(WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
(WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
(WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
Add a timer for executing pending scripts.
(WebCore::ScriptableDocumentParser::detach):
* dom/ScriptableDocumentParser.h:
(WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLLinkElement.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::detach):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::isLoadingInAPISense):
Stay in loading state if we have a pending script. This matches existing behavior.
* style/StyleScope.cpp:
(WebCore::Style::Scope::removePendingSheet):
* style/StyleScope.h:
2017-02-18 Chris Dumez <cdumez@apple.com>
<input type=range readonly> doesn't act per spec
https://bugs.webkit.org/show_bug.cgi?id=168422
<rdar://problem/30593189>
Reviewed by Ryosuke Niwa.
'readonly' attribute should not apply to <input type=range> as per the HTML
specification:
- https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
Firefox and Edge already behave as per the specification.
No new tests, updated existing tests.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
(WebCore::SliderThumbElement::willRespondToMouseClickEvents):
2017-02-18 Chris Dumez <cdumez@apple.com>
Recursive MessagePort.postMessage() calls causes tab to become unresponsive
https://bugs.webkit.org/show_bug.cgi?id=168548
<rdar://problem/29808005>
Reviewed by Darin Adler.
MessagePort::dispatchMessages() was getting messages one by one of the
channel's MessageQueue and firing the MessageEvent for each of them.
The issue is that we can get stuck in an infinite loop if the
MessageEvent handler posts a message on the same post.
To address the issue, we now takes all messages from the queue before
iterating over them to fire the event. This way, if new messages are
added to the queue in one of the MessageEvent handlers, they will not
be processed until the next event loop iteration, as is expected.
Test: fast/events/message-port-postMessage-recursive.html
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
* dom/MessagePortChannel.h:
(WebCore::MessagePortChannel::EventData::EventData):
* dom/default/PlatformMessagePortChannel.cpp:
(WebCore::MessagePortChannel::postMessageToRemote):
* dom/default/PlatformMessagePortChannel.h:
(WebCore::PlatformMessagePortChannel::MessagePortQueue::takeMessage):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::takeAllMessages):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
2017-02-18 Michael Catanzaro <mcatanzaro@igalia.com>
Remove COORDINATED_GRAPHICS_MULTIPROCESS
https://bugs.webkit.org/show_bug.cgi?id=168514
Reviewed by Darin Adler.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2017-02-17 Simon Fraser <simon.fraser@apple.com>
Allow properties in CSSProperties.json that don't trigger code generation
https://bugs.webkit.org/show_bug.cgi?id=168535
Reviewed by Sam Weinig.
In order to track the development of CSS properties that we have not yet implemented,
support '"skip-codegen" : true' in "codegen-properties".
Test by adding a few fill-related properties with this attribute.
* css/CSSProperties.json:
* css/makeprop.pl:
(isPropertyEnabled):
(addProperty):
2017-02-17 Brian Burg <bburg@apple.com>
Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
https://bugs.webkit.org/show_bug.cgi?id=168273
<rdar://problem/29949325>
Reviewed by Matt Baker.
Add the ability to dock Web Inspector to the left of the inspected view.
The frontend decides whether the Dock to Side button docks left or right
based on the current layout direction.
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::setAttachedWindow):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::requestSetDockSide):
2017-02-16 Simon Fraser <simon.fraser@apple.com>
Allow PlatformCALayers to specify that they want deep color backing store
https://bugs.webkit.org/show_bug.cgi?id=168495
Reviewed by Tim Horton.
Currently capable iOS devices get deep color backing store by virtue of a supports
check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
Future work will make layer contents format selection more complex, so express the need
for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
is needed to propagte the state to TileControllers.
The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
instead of RemoteLayerBackingStore looking at the properties of the screen directly.
Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
that we no longer use.
An iphone7 test verifies that page tiles, normal layers and tiled layers get the deep
color state set on them.
Test: tiled-drawing/ios/iphone7/compositing-layers-deep-color.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayer):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::canHaveBackingStore):
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setZoomedOutContentsScale):
(WebCore::TileController::setAcceleratesDrawing):
(WebCore::TileController::setWantsDeepColorBackingStore):
(WebCore::TileController::createTileLayer):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::updateTileLayerProperties):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::PlatformCALayerCocoa):
(PlatformCALayerCocoa::commonInit):
(PlatformCALayerCocoa::wantsDeepColorBackingStore):
(PlatformCALayerCocoa::setWantsDeepColorBackingStore):
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer setWantsDeepColorBackingStore:]):
(-[WebTiledBackingLayer wantsDeepColorBackingStore]):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::wantsDeepColorBackingStore):
(PlatformCALayerWin::setWantsDeepColorBackingStore):
(printLayer):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/spi/cocoa/QuartzCoreSPI.h:
2017-02-17 Jer Noble <jer.noble@apple.com>
Refactoring: Make sure to unprepare WebAudioSourceProviderAVFObjC when its owner is destroyed.
https://bugs.webkit.org/show_bug.cgi?id=168532
Reviewed by Youenn Fablet.
Because WebAudioSourceProviderAVFObjC has a back-pointer to the object which creted it, make
sure that back-pointer is invalidated once the creating object is destroyed by calling
WebAudioSOurceProviderAVFObjC::unprepare().
Drive-by Fix: In WebAudioSourceProviderAVFObjC::audioSamplesAvailable(), PlatformAudioData will
always be of the WebAudioBufferList type. If this ever becomes untrue, an invalid downcast will
be caught by downcast<>, so just remove the is<> check.
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::~MockRealtimeAudioSourceMac):
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::setClient):
(WebCore::WebAudioSourceProviderAVFObjC::unprepare):
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
2017-02-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve handling of <video> with only audio tracks
https://bugs.webkit.org/show_bug.cgi?id=167836
<rdar://problem/30255812>
Reviewed by Dean Jackson.
We now check for the availability of video tracks before considering a <video>
element is displaying an actual video file and turning auto-hide on. We also
check that we have video tracks before enabling the fullscreen button. This
brings the behavior of a <video> pointing to a resource with no video tracks
to be the same as an <audio> element.
Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get tracksToMonitor):
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
2017-02-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Toggle playback when clicking on the video on macOS
https://bugs.webkit.org/show_bug.cgi?id=168515
<rdar://problem/30577441>
Reviewed by Dean Jackson.
Listen to click events on the macOS media controls. Detect any clicks that were on the
background instead of the controls widgets themselves, and tell the delegate (MediaController)
about them.
Tests: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html
media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html
media/modern-media-controls/media-controller/media-controller-click-on-video-controls-should-not-pause.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype._handleMousedown):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.handleEvent):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.handleEvent):
(MacOSMediaControls):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.togglePlayback):
(MediaController.prototype.macOSControlsBackgroundWasClicked):
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.buttonWasPressed):
2017-02-17 Jer Noble <jer.noble@apple.com>
Refactoring: Remove AudioSourceObserverObjC and AudioCaptureSourceProviderObjC
https://bugs.webkit.org/show_bug.cgi?id=168520
Reviewed by Youenn Fablet.
Having AudioCaptureSourceProviderObjC as the type provided to WebAudioSourceProviderAVFObjC
(and only ever to WebAudioSourceProviderAVFObjC) makes it impossible for that class to add
an observer on RealtimeMediaSource, of which all classes inheriting from
WebAudioSourceProviderAVFObjC are subclasses. There is no need to treat
WebAudioSourceProviderAVFObjC as an "observer", since the only thing it will ever observe is
the object which created it and hold an explicit reference to it. So replace all instances
of the "observer" pattern with direct calls to the necessary (newly non-virtual) methods.
This allows WebAudioSourceProviderAVFObjC to register as an observer directly on
RealtimeMediaSource, to listen for audioSamplesAvailable() instead of process(), and remove
a lot of unnecessary conversion code and observer duplication.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::Observer::sourceStopped):
(WebCore::RealtimeMediaSource::Observer::sourceMutedChanged):
(WebCore::RealtimeMediaSource::Observer::sourceEnabledChanged):
(WebCore::RealtimeMediaSource::Observer::sourceSettingsChanged):
(WebCore::RealtimeMediaSource::Observer::preventSourceFromStopping):
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::shutdownCaptureSession):
(WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVAudioCaptureSource::addObserver): Deleted.
(WebCore::AVAudioCaptureSource::removeObserver): Deleted.
(WebCore::AVAudioCaptureSource::start): Deleted.
* platform/mediastream/mac/AudioCaptureSourceProviderObjC.h: Removed.
* platform/mediastream/mac/AudioSourceObserverObjC.h: Removed.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
(WebCore::MockRealtimeAudioSourceMac::reconfigure):
(WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
(WebCore::MockRealtimeAudioSourceMac::addObserver): Deleted.
(WebCore::MockRealtimeAudioSourceMac::removeObserver): Deleted.
(WebCore::MockRealtimeAudioSourceMac::start): Deleted.
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
(WebCore::RealtimeIncomingAudioSource::addObserver): Deleted.
(WebCore::RealtimeIncomingAudioSource::removeObserver): Deleted.
(WebCore::RealtimeIncomingAudioSource::start): Deleted.
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::create):
(WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::setClient):
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
(WebCore::WebAudioSourceProviderAVFObjC::process): Deleted.
2017-02-17 Antoine Quint <graouts@apple.com>
REGRESSION: Subtitles menu in media controls allows multiple items to be selected
https://bugs.webkit.org/show_bug.cgi?id=168168
<rdar://problem/30488605>
Reviewed by Dean Jackson.
Ensure that only a single audio track and a single text track can be selected
in the tracks panel at any given point.
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.tracksPanelSelectionDidChange):
(TracksSupport.prototype._sortedTrackList):
(TracksSupport):
2017-02-17 Jeremy Jones <jeremyj@apple.com>
Invalidate WebAVSampleBufferStatusChangeListener when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
https://bugs.webkit.org/show_bug.cgi?id=168488
Reviewed by Jer Noble.
Fixes periodically crashing test: fast/mediastream/MediaStream-video-element-track-stop.html
WebAVSampleBufferStatusChangeListener has an unretained referecne to MediaPlayerPrivateMediaStreamAVFObjC
that must be invaldated when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
2017-02-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve handling of live broadcast video
https://bugs.webkit.org/show_bug.cgi?id=168506
<rdar://problem/30432094>
Reviewed by Dean Jackson.
We improve the handling of live broadcast video by:
- checking that we have a media source before deciding to show the controls
bar and start button
- support a mode where neither the status text nor the scrubber is visible
in case we're still waiting on sufficient data to determine the video
time and we haven't really started loading data yet
- not showing time labels when we have an infinite duration
- ensuring the status label is left-aligned
Test: media/modern-media-controls/status-label/status-label-text-align.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
* Modules/modern-media-controls/controls/status-label.js:
(StatusLabel.prototype.get enabled):
(StatusLabel.prototype.set enabled):
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):
* Modules/modern-media-controls/media/time-labels-support.js:
(TimeLabelsSupport.prototype.syncControl):
(TimeLabelsSupport):
2017-02-17 Anders Carlsson <andersca@apple.com>
Begin overhauling the pasteboard implementation
https://bugs.webkit.org/show_bug.cgi?id=168525
Reviewed by Tim Horton.
Add a new PasteboardWriterData object. This object will hold data that is going
to be written to the pasteboard at some point. Currently it only supports plain text.
Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
into an object that conforms to NSPasteboardWriting.
The basic idea is that instead of doing a bunch of pasteboard operations,
we'll just package all the pasteboard data up into an object and ship it over to WebKit.
This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).
* WebCore.xcodeproj/project.pbxproj:
* platform/PasteboardWriterData.cpp: Added.
(WebCore::PasteboardWriterData::PasteboardWriterData):
(WebCore::PasteboardWriterData::~PasteboardWriterData):
(WebCore::PasteboardWriterData::isEmpty):
(WebCore::PasteboardWriterData::setPlainText):
* platform/PasteboardWriterData.h: Added.
* platform/mac/PasteboardWriter.h: Added.
* platform/mac/PasteboardWriter.mm: Added.
(WebCore::createPasteboardWriting):
* platform/spi/mac/NSPasteboardSPI.h: Added.
2017-02-17 Per Arne Vollan <pvollan@apple.com>
Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
https://bugs.webkit.org/show_bug.cgi?id=168044
rdar://problem/30165746
Reviewed by Simon Fraser.
This patch moves these styles out of svg, and sets the properties on video cues.
Tests: fast/css/parsing-paint-order.html
fast/css/parsing-stroke-linecap.html
fast/css/parsing-stroke-linejoin.html
fast/css/parsing-stroke-width.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::paintOrder):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
(WebCore::paintOrder): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::isValidCueStyleProperty):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
(WebCore::RenderStyle::paintTypesForPaintOrder):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setPaintOrder):
(WebCore::RenderStyle::paintOrder):
(WebCore::RenderStyle::initialPaintOrder):
(WebCore::RenderStyle::setCapStyle):
(WebCore::RenderStyle::capStyle):
(WebCore::RenderStyle::initialCapStyle):
(WebCore::RenderStyle::setJoinStyle):
(WebCore::RenderStyle::joinStyle):
(WebCore::RenderStyle::initialJoinStyle):
(WebCore::RenderStyle::strokeWidth):
(WebCore::RenderStyle::setStrokeWidth):
(WebCore::RenderStyle::hasVisibleStroke):
(WebCore::RenderStyle::setStrokeOpacity):
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):
(WebCore::SVGRenderStyle::paintTypesForPaintOrder): Deleted.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialBufferedRendering):
(WebCore::SVGRenderStyle::initialFillRule):
(WebCore::SVGRenderStyle::initialMaskType):
(WebCore::SVGRenderStyle::setBufferedRendering):
(WebCore::SVGRenderStyle::setFillRule):
(WebCore::SVGRenderStyle::setMaskType):
(WebCore::SVGRenderStyle::bufferedRendering):
(WebCore::SVGRenderStyle::fillRule):
(WebCore::SVGRenderStyle::strokeMiterLimit):
(WebCore::SVGRenderStyle::maskType):
(WebCore::SVGRenderStyle::hasStroke):
(WebCore::SVGRenderStyle::setBitDefaults):
(WebCore::SVGRenderStyle::InheritedFlags::operator==):
(WebCore::SVGRenderStyle::initialCapStyle): Deleted.
(WebCore::SVGRenderStyle::initialJoinStyle): Deleted.
(WebCore::SVGRenderStyle::initialPaintOrder): Deleted.
(WebCore::SVGRenderStyle::setCapStyle): Deleted.
(WebCore::SVGRenderStyle::setJoinStyle): Deleted.
(WebCore::SVGRenderStyle::setPaintOrder): Deleted.
(WebCore::SVGRenderStyle::capStyle): Deleted.
(WebCore::SVGRenderStyle::joinStyle): Deleted.
(WebCore::SVGRenderStyle::strokeWidth): Deleted.
(WebCore::SVGRenderStyle::paintOrder): Deleted.
(WebCore::SVGRenderStyle::hasVisibleStroke): Deleted.
(WebCore::SVGRenderStyle::setStrokeWidth): 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/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::strokeShape):
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::strokeShape):
(WebCore::RenderSVGPath::shapeDependentStrokeContains):
(WebCore::RenderSVGPath::shouldStrokeZeroLengthSubpath):
(WebCore::RenderSVGPath::zeroLengthLinecapPath):
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::strokeShape):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::strokeShape):
(WebCore::RenderSVGShape::fillStrokeMarkers):
(WebCore::RenderSVGShape::strokeWidth):
(WebCore::RenderSVGShape::hasSmoothStroke):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::strokeBoundingBox):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint):
(WebCore::SVGInlineTextBox::paintDecoration):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
2017-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Handle Settings::allowsAnySSLCertificate() in SSL sockets
https://bugs.webkit.org/show_bug.cgi?id=168521
Reviewed by Michael Catanzaro.
When Settings::allowsAnySSLCertificate() is enabled, connect to accept-certificate signal of the GTlsConnection
to always accept the certificates.
Fixes: http/tests/websocket/tests/hybi/simple-wss.html
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::wssConnectionAcceptCertificateCallback):
(WebCore::wssSocketClientEventCallback):
(WebCore::SocketStreamHandleImpl::create):
2017-02-17 Simon Fraser <simon.fraser@apple.com>
Fixed elements bounce when rubber-banding at the bottom of the page
https://bugs.webkit.org/show_bug.cgi?id=168493
rdar://problem/30567713
Reviewed by Tim Horton.
FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding,
by adding rubberBandBottom which is negative, rather than subtracting.
Log some more scrolling stuff.
Ironically, the existing test didn't test stick-to-viewport fixed position because
backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test
that sets this, to test both behaviors.
This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need
to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated().
Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::visibleDocumentRect):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorMac::commitTreeState):
2017-02-17 Simon Fraser <simon.fraser@apple.com>
REGRESSION (209396): Apple Pay buttons do not render
https://bugs.webkit.org/show_bug.cgi?id=168523
rdar://problem/30451563
Reviewed by Geoffrey Garen.
The new CSS parser mistakenly converted -apple-pay-button values to
-webkit-pay-button, breaking -webkit-appearance: -apple-pay-button.
Fix by excluding "-apple-pay" prefixed values from the conversion.
Test: fast/css/appearance-apple-pay-button.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAppleLegacyCssValueKeyword):
2017-02-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r212463.
https://bugs.webkit.org/show_bug.cgi?id=168526
Some crashes with GuardMalloc (Requested by anttik on
#webkit).
Reverted changeset:
"Execute pending scripts asynchronously after stylesheet loads
complete"
https://bugs.webkit.org/show_bug.cgi?id=168367
http://trac.webkit.org/changeset/212463
2017-02-16 Brent Fulgham <bfulgham@apple.com>
RenderView needs to be updated when FrameView changes
https://bugs.webkit.org/show_bug.cgi?id=168481
<rdar://problem/30339638>
Reviewed by Andreas Kling.
The state of the Document's RenderView can get out of sync with the Frame's FrameView.
We need a notification mechanism so that modifications to the Frame's view are properly
relayed to Document so that it can have a correct RenderView.
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInView): Create an updated render tree (if
one does not already exist).
(WebCore::Document::destroyRenderTree): Remove an incorrect ASSERT. We may enter this
code when the Frame uses 'setView(nullptr)', which happens during certain updates.
* dom/Document.h:
* page/Frame.cpp:
(WebCore::Frame::setView): Destroy the old render tree (if present) before switching to
the new view. Then notify the document that it is now the current document in the new view.
2017-02-17 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Fast replay on video hide/unhide on platforms with limited video buffer pools
https://bugs.webkit.org/show_bug.cgi?id=168505
Reviewed by Žan Doberšek.
The WebKit code isn't consuming the video samples when the video layer is hidden,
so the buffers aren't being returned to the pool and starve the decoder when the
buffer pool runs out of buffers (on platforms using a buffer pool and a custom
allocator, such as OMX on the Raspberry Pi 2). When the video layer is restored,
the pipeline tries to catch up and the user sees the video "going fast forward".
The added code "consumes" (removes and unrefs) the buffer in that case. However,
the sample isn't completely removed because it still holds important info (eg:
caps) needed for the proper operation of the video element.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2017-02-17 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Stop removing the fragment identifier from resource requests
https://bugs.webkit.org/show_bug.cgi?id=168509
Reviewed by Sergio Villar Senin.
I don't know why, but have always removed the fragment identifier from the URL when creating the SoupURI that
is passed to libsoup. Maybe it was a bug in a very old version of libsoup, but it doesn't look necessary anymore
and it's causing several layout test failures.
Fixes: http/tests/svg/svg-use-external.html
imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin-with-hash.html
imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin-with-hash.html
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::createSoupURI): Do not remove the fragment identifier from the URL.
2017-02-16 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Drop PassRefPtr from ArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=168455
Reviewed by Geoffrey Garen.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferView):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2017-02-16 Simon Fraser <simon.fraser@apple.com>
REGRESSION(r212439): Web Inspector Toolbar / Window appears broken
https://bugs.webkit.org/show_bug.cgi?id=168494
Reviewed by Joseph Pecoraro.
Missed one conversion from acceleratesDrawing to drawsAsynchronously, which
caused non-Whippet GrpahicsContext shadow drawing to happen unexpectedly.
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer drawsAsynchronously]):
(-[WebTiledBackingLayer acceleratesDrawing]): Deleted.
2017-02-16 Chris Dumez <cdumez@apple.com>
<input>.labels is empty if type changes from text->hidden->checkbox
https://bugs.webkit.org/show_bug.cgi?id=168358
Reviewed by Ryosuke Niwa.
We were invalidating LabelsNodeLists on 'for' attribute change.
We now also invalidate them of 'type' attribute change since
HTMLInputElements whose type is 'hidden' do not support labels.
No new tests, updated existing test.
* dom/Document.h:
* dom/LiveNodeList.h:
(WebCore::shouldInvalidateTypeOnAttributeChange):
* html/LabelsNodeList.cpp:
(WebCore::LabelsNodeList::LabelsNodeList):
2017-02-16 Michael Catanzaro <mcatanzaro@igalia.com>
Remove even more EFL from WebCore
https://bugs.webkit.org/show_bug.cgi?id=168485
Reviewed by Alex Christensen.
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::copy):
* platform/ContextMenuItem.h:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
* platform/graphics/PlatformDisplay.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setContentsToImage):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::ResourceError::timeoutError):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Deleted.
* platform/network/soup/SoupNetworkSession.h:
2017-02-16 Daniel Bates <dabates@apple.com>
Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
https://bugs.webkit.org/show_bug.cgi?id=168417
<rdar://problem/30541748>
Reviewed by Brent Fulgham.
Remove Chromium-specific code that was added in r125500 to call FrameLoaderClient::redirectDataToPlugin(nullptr)
in PluginDocument::detachFromPluginElement(). Calling redirectDataToPlugin() with nullptr was used by the
Chromium port to signify that the plugin document was being destroyed so that they could tear down their
plugin widget. And PluginDocument::detachFromPluginElement() is the only place that calls redirectDataToPlugin()
passing nullptr. No other port made use of this machinery and the Chromium port has long since been removed
from the Open Source WebKit Project. We should remove this code.
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::appendBytes): Pass the plugin widget by reference.
(WebCore::PluginDocument::detachFromPluginElement): Remove call to FrameLoaderClient::redirectDataToPlugin().
This call was only used by the Chromium port as means to be notified when the plugin document was being
destroyed. No other port made use of this notification or needed such a notification.
* loader/EmptyClients.cpp: Change argument of redirectDataToPlugin() from Widget* to Widget& to convey
that this function always takes a valid Widget. Also remove unnecessary argument name as the data type
of the argument and the name of the function sufficiently describes the purpose of the argument.
* loader/FrameLoaderClient.h: Ditto.
2017-02-16 Myles C. Maxfield <mmaxfield@apple.com>
font-weight in @font-face can cause a font to be downloaded even when it's not used
https://bugs.webkit.org/show_bug.cgi?id=168114
<rdar://problem/30301317>
Reviewed by Darin Adler.
There were two problems with our font loading code.
When we are in the middle of a download, we will use a special interstitial font,
and this special font has a flag set which will cause it to be invisible when it is
drawn. However, when we start using this font during the load, we give it a
unicode-range of U+0-0 which means that it will never be used, and fallback will
happen to other weights immediately.
The second problem with the font loading code is that this interstital font is just
Times. Times doesn't support every character, which means that if we are trying
to render some exotic character, we fall back to other weights. The solution here
is to use LastResort as the interstitial font, because it supports all characters.
Because its metrics are reasonable and we don't ever actually paint this
interstitial font, this choice is no worse than Times.
Tests: fast/text/font-style-download.html
fast/text/font-weight-download-2.html
fast/text/font-weight-download.html
fast/text/font-weight-fallback.html
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::font):
* css/CSSSegmentedFontFace.cpp:
(WebCore::appendFont):
(WebCore::CSSSegmentedFontFace::fontRanges):
(WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Deleted.
* platform/graphics/Font.h:
(WebCore::Font::widthForGlyph):
* platform/graphics/FontCache.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
2017-02-16 Alex Christensen <achristensen@webkit.org>
Remove EFL-specific files in Source.
Rubber-stamped by Anders Carlsson.
* editing/efl: Removed.
* page/efl: Removed.
* platform/audio/efl: Removed.
* platform/efl: Removed.
* platform/efl/DefaultTheme: Removed.
* platform/efl/DefaultTheme/widget: Removed.
* platform/efl/DefaultTheme/widget/button: Removed.
* platform/efl/DefaultTheme/widget/check: Removed.
* platform/efl/DefaultTheme/widget/combo: Removed.
* platform/efl/DefaultTheme/widget/entry: Removed.
* platform/efl/DefaultTheme/widget/progressbar: Removed.
* platform/efl/DefaultTheme/widget/radio: Removed.
* platform/efl/DefaultTheme/widget/scrollbar: Removed.
* platform/efl/DefaultTheme/widget/search: Removed.
* platform/efl/DefaultTheme/widget/search/cancel: Removed.
* platform/efl/DefaultTheme/widget/search/decoration: Removed.
* platform/efl/DefaultTheme/widget/search/field: Removed.
* platform/efl/DefaultTheme/widget/slider: Removed.
* platform/efl/DefaultTheme/widget/spinner: Removed.
* platform/gamepad/efl: Removed.
* platform/graphics/efl: Removed.
* platform/graphics/surfaces/efl: Removed.
* platform/network/efl: Removed.
2017-02-16 Simon Fraser <simon.fraser@apple.com>
Add WebUSB to features.json as a "Not Considering".
* features.json:
2017-02-16 Alex Christensen <achristensen@webkit.org>
Remove old URL parser
https://bugs.webkit.org/show_bug.cgi?id=168483
Reviewed by Tim Horton.
* platform/URL.cpp:
(WebCore::isSchemeFirstChar):
(WebCore::isSchemeChar):
(WebCore::URL::URL):
(WebCore::URL::setProtocol):
(WebCore::URL::setHost):
(WebCore::URL::removePort):
(WebCore::URL::setPort):
(WebCore::URL::setHostAndPort):
(WebCore::URL::setUser):
(WebCore::URL::setPass):
(WebCore::URL::setFragmentIdentifier):
(WebCore::URL::setQuery):
(WebCore::URL::setPath):
(WebCore::URL::serialize):
(WebCore::isUserInfoChar): Deleted.
(WebCore::isHostnameChar): Deleted.
(WebCore::isIPv6Char): Deleted.
(WebCore::isPathSegmentEndChar): Deleted.
(WebCore::appendASCII): Deleted.
(WebCore::findFirstOf): Deleted.
(WebCore::checkEncodedString): Deleted.
(WebCore::URL::init): Deleted.
(WebCore::appendEscapingBadChars): Deleted.
(WebCore::escapeAndAppendNonHierarchicalPart): Deleted.
(WebCore::copyPathRemovingDots): Deleted.
(WebCore::hasSlashDotOrDotDot): Deleted.
(WebCore::URL::parse): Deleted.
(WebCore::cannotBeABaseURL): Deleted.
(WebCore::isDefaultPortForScheme): Deleted.
(WebCore::hostPortIsEmptyButCredentialsArePresent): Deleted.
(WebCore::isNonFileHierarchicalScheme): Deleted.
(WebCore::isCanonicalHostnameLowercaseForScheme): Deleted.
(WebCore::findHostnamesInMailToURL): Deleted.
(WebCore::findHostnameInHierarchicalURL): Deleted.
(WebCore::encodeHostnames): Deleted.
(WebCore::encodeRelativeString): Deleted.
(WebCore::substituteBackslashes): Deleted.
* platform/URLParser.cpp:
(WebCore::URLParser::URLParser):
(WebCore::URLParser::setEnabled): Deleted.
(WebCore::URLParser::enabled): Deleted.
* platform/URLParser.h:
* platform/cf/URLCF.cpp:
(WebCore::URL::URL):
* platform/mac/URLMac.mm:
(WebCore::URL::URL):
2017-02-16 Anders Carlsson <andersca@apple.com>
Build fixes.
* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::createDraggingDataTransfer):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::createDraggingDataTransfer):
2017-02-16 Anders Carlsson <andersca@apple.com>
Remove EFL from WebCore
https://bugs.webkit.org/show_bug.cgi?id=168477
Reviewed by Brian Burg.
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::AccessibilityObject):
(WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
* crypto/CryptoKey.cpp:
* crypto/keys/CryptoKeyRSA.h:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* editing/Editor.cpp:
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::copyImage):
* editing/Editor.h:
* editing/FrameSelection.h:
* html/HTMLCanvasElement.cpp:
(WebCore::requiresAcceleratedCompositingForWebGL):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::port):
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::performURLImport):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* platform/ContextMenuItem.h:
* platform/Cursor.h:
* platform/DragData.h:
* platform/DragImage.h:
* platform/FileSystem.h:
* platform/LocalizedStrings.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypesForEncoding):
* platform/NotImplemented.h:
* platform/Pasteboard.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformMouseEvent.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/PlatformWheelEvent.h:
* platform/Widget.h:
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/Icon.h:
* platform/graphics/Image.h:
(WebCore::Image::getEvasObject): Deleted.
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
(WebCore::Extensions3DOpenGL::supportsExtension):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createForCurrentGLContext):
(WebCore::GraphicsContext3D::reshape):
(WebCore::GraphicsContext3D::createVertexArray):
(WebCore::GraphicsContext3D::deleteVertexArray):
(WebCore::GraphicsContext3D::isVertexArray):
(WebCore::GraphicsContext3D::bindVertexArray):
* platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
* platform/network/NetworkStateNotifier.h:
* platform/posix/FileSystemPOSIX.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffsetForBackwardDeletion):
* xml/XSLStyleSheetLibxslt.cpp:
* xml/XSLTExtensions.cpp:
* xml/XSLTProcessorLibxslt.cpp:
* xml/XSLTUnicodeSort.cpp:
2017-02-16 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add forced line layout info to coverage print.
https://bugs.webkit.org/show_bug.cgi?id=168470
Reviewed by Simon Fraser.
This is about potential vs. actual coverage:
Simple line layout potential coverage: 65.05%
Simple line layout actual coverage: 46.60%
Forced line layout blocks: 4 content length: 57(18.45%)
Not testable.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
2017-02-16 Anders Carlsson <andersca@apple.com>
Rename DataTransfer functions to indicate whether they are for dragging or dropping
https://bugs.webkit.org/show_bug.cgi?id=168478
Reviewed by Tim Horton.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::createForDrag):
(WebCore::DataTransfer::createForDrop):
(WebCore::DataTransfer::createForDragAndDrop): Deleted.
* dom/DataTransfer.h:
* page/DragController.cpp:
(WebCore::DragController::dragExited):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::tryDHTMLDrag):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingDataTransfer):
2017-02-16 Anders Carlsson <andersca@apple.com>
Rename EventHandler::freeDataTransfer to invalidateDataTransfer
https://bugs.webkit.org/show_bug.cgi?id=168472
Reviewed by Tim Horton.
The code doesn't necessarily free the data transfer object, so rename the member function
to reflect that. Also, get rid of a goto.
* page/EventHandler.cpp:
(WebCore::EventHandler::invalidateDataTransfer):
(WebCore::EventHandler::dragSourceEndedAt):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::freeDataTransfer): Deleted.
* page/EventHandler.h:
2017-02-16 Alex Christensen <achristensen@webkit.org>
Special URLs without a host are invalid
https://bugs.webkit.org/show_bug.cgi?id=168461
Reviewed by Tim Horton.
http://? should be invalid. This matches Chrome and the spec and the intent of my implementation
of URLParser which already fails with urls like http:// and this was just an oversight.
Covered by newly passing web platform tests. Updated API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2017-02-16 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add support for pagination.
https://bugs.webkit.org/show_bug.cgi?id=168355
<rdar://problem/30119769>
Reviewed by David Hyatt.
This patch adds basic support for paginated content including widows and orphans.
This is based on the normal line layout pagination logic. However there are 2 major
advantages here (and they allow us to have a much simpler logic):
1. all the lines are positioned by the time we start paginating them and
2. lines always have uniform heights.
This is not enabled yet.
* rendering/RenderBlockFlow.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
(WebCore::SimpleLineLayout::computeLineBreakIndex):
(WebCore::SimpleLineLayout::setPageBreakForLine):
(WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
(WebCore::SimpleLineLayout::updateMinimumPageHeight):
(WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::isPaginated):
(WebCore::SimpleLineLayout::Layout::struts):
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::computeFlowHeight):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2017-02-11 Filip Pizlo <fpizlo@apple.com>
The collector thread should only start when the mutator doesn't have heap access
https://bugs.webkit.org/show_bug.cgi?id=167737
Reviewed by Keith Miller.
Added new tests in JSTests and LayoutTests.
The WebCore changes involve:
- Refactoring around new header discipline.
- Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
* ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
* ForwardingHeaders/heap/IncrementalSweeper.h: Added.
* ForwardingHeaders/heap/MachineStackMarker.h: Added.
* ForwardingHeaders/heap/RunningScope.h: Added.
* bindings/js/CommonVM.cpp:
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::isReadableStreamDisturbed):
(WebCore::Internals::isGCRunning):
(WebCore::Internals::addGCFinalizationCallback):
(WebCore::Internals::stopSweeping):
(WebCore::Internals::startSweeping):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-16 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] remove toJSValueFromJsonWebKey from custom SubtleCrypto binding codes
https://bugs.webkit.org/show_bug.cgi?id=167026
Reviewed by Chris Dumez.
Covered by existing tests.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
(WebCore::toJSValueFromJsonWebKey): Deleted.
* crypto/JsonWebKey.h:
* crypto/JsonWebKey.idl:
* crypto/RsaOtherPrimesInfo.idl:
Change std::optional<String> to String in order to use toJS<IDLDictionary<JsonWebKey>>.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::importJwk):
Only check if key_ops contains all of the specified usages when key_ops field of jwk is present,
as per the specification: https://www.w3.org/TR/WebCryptoAPI/#aes-cbc-operations
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::importJwk):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
Accommodate the change from std::optional<String> to String.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::create):
Add a null check for p.
2017-02-16 Antti Koivisto <antti@apple.com>
Execute pending scripts asynchronously after stylesheet loads complete
https://bugs.webkit.org/show_bug.cgi?id=168367
rdar://problem/30561379
Reviewed by Andreas Kling.
The current synchronous execution is fragile and creates various problems.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::checkLoaded):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::notifyChildInserted):
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::removeChildren):
Remove various places where we would trigger delayed synchronous execution.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle):
Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
(WebCore::Document::didRemoveAllPendingStylesheet):
Call asynchronous script execution function.
* dom/Document.h:
(WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
(WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
(WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
(WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
Add a timer for executing pending scripts.
(WebCore::ScriptableDocumentParser::detach):
* dom/ScriptableDocumentParser.h:
(WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLLinkElement.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::detach):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::isLoadingInAPISense):
Stay in loading state if we have a pending script. This matches existing behavior.
* style/StyleScope.cpp:
(WebCore::Style::Scope::removePendingSheet):
* style/StyleScope.h:
2017-02-16 Anders Carlsson <andersca@apple.com>
Set the DHTML drag image in the DHTML type check
https://bugs.webkit.org/show_bug.cgi?id=168451
Reviewed by Wenson Hsieh.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
2017-02-16 Anders Carlsson <andersca@apple.com>
Begin removing EFL code from WebCore.
Rubber-stamped by Alex Christensen.
* PlatformEfl.cmake: Removed.
* editing/efl/EditorEfl.cpp: Removed.
* page/efl/DragControllerEfl.cpp: Removed.
* page/efl/EventHandlerEfl.cpp: Removed.
* platform/audio/efl/AudioBusEfl.cpp: Removed.
* platform/efl/CursorEfl.cpp: Removed.
* platform/efl/DefaultTheme/CMakeLists.txt: Removed.
* platform/efl/DefaultTheme/default.edc: Removed.
* platform/efl/DefaultTheme/widget/button/button.edc: Removed.
* platform/efl/DefaultTheme/widget/button/img_button_focus.png: Removed.
* platform/efl/DefaultTheme/widget/button/img_button_hover.png: Removed.
* platform/efl/DefaultTheme/widget/button/img_button_normal.png: Removed.
* platform/efl/DefaultTheme/widget/button/img_button_press.png: Removed.
* platform/efl/DefaultTheme/widget/check/check.edc: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_bg_disabled.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_bg_enabled.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_off.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_off_focus.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_off_hover.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_on.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_on_focus.png: Removed.
* platform/efl/DefaultTheme/widget/check/img_check_on_hover.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo.edc: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_focus.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_focus_button.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_focus_button_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_focus_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_hover.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_hover_button.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_hover_button_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_hover_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_normal.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_normal_button.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_normal_button_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_normal_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_press.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_press_button.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_press_button_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/combo_press_transparent.png: Removed.
* platform/efl/DefaultTheme/widget/combo/icon.png: Removed.
* platform/efl/DefaultTheme/widget/entry/entry.edc: Removed.
* platform/efl/DefaultTheme/widget/entry/img_focused.png: Removed.
* platform/efl/DefaultTheme/widget/entry/img_hovered.png: Removed.
* platform/efl/DefaultTheme/widget/entry/img_normal.png: Removed.
* platform/efl/DefaultTheme/widget/progressbar/bt_base.png: Removed.
* platform/efl/DefaultTheme/widget/progressbar/progressbar.edc: Removed.
* platform/efl/DefaultTheme/widget/progressbar/shelf_inset.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_bg_disabled.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_bg_enabled.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_off.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_off_focus.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_off_hover.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_on.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_on_focus.png: Removed.
* platform/efl/DefaultTheme/widget/radio/img_radio_on_hover.png: Removed.
* platform/efl/DefaultTheme/widget/radio/radio.edc: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Removed.
* platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png: Removed.
* platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png: Removed.
* platform/efl/DefaultTheme/widget/search/cancel/search_cancel.edc: Removed.
* platform/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png: Removed.
* platform/efl/DefaultTheme/widget/search/decoration/search_decoration.edc: Removed.
* platform/efl/DefaultTheme/widget/search/field/field_focused.png: Removed.
* platform/efl/DefaultTheme/widget/search/field/field_hovered.png: Removed.
* platform/efl/DefaultTheme/widget/search/field/field_normal.png: Removed.
* platform/efl/DefaultTheme/widget/search/field/search_field.edc: Removed.
* platform/efl/DefaultTheme/widget/slider/slider.edc: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_fill_h.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_fill_v.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_h.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_thumb_h.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_thumb_press_h.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_thumb_press_v.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_thumb_v.png: Removed.
* platform/efl/DefaultTheme/widget/slider/slider_v.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_bg.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_down_default.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_down_hover.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_down_pressed.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_up_default.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_up_hover.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/sp_up_pressed.png: Removed.
* platform/efl/DefaultTheme/widget/spinner/spinner.edc: Removed.
* platform/efl/DragDataEfl.cpp: Removed.
* platform/efl/DragImageEfl.cpp: Removed.
* platform/efl/EflInspectorUtilities.cpp: Removed.
* platform/efl/EflInspectorUtilities.h: Removed.
* platform/efl/EflKeyboardUtilities.cpp: Removed.
* platform/efl/EflKeyboardUtilities.h: Removed.
* platform/efl/EflScreenUtilities.cpp: Removed.
* platform/efl/EflScreenUtilities.h: Removed.
* platform/efl/ErrorsEfl.cpp: Removed.
* platform/efl/ErrorsEfl.h: Removed.
* platform/efl/EventLoopEfl.cpp: Removed.
* platform/efl/FileSystemEfl.cpp: Removed.
* platform/efl/LocalizedStringsEfl.cpp: Removed.
* platform/efl/MIMETypeRegistryEfl.cpp: Removed.
* platform/efl/MainThreadSharedTimerEfl.cpp: Removed.
* platform/efl/PasteboardEfl.cpp: Removed.
* platform/efl/PlatformKeyboardEventEfl.cpp: Removed.
* platform/efl/PlatformMouseEventEfl.cpp: Removed.
* platform/efl/PlatformScreenEfl.cpp: Removed.
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Removed.
* platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed.
* platform/efl/PlatformSpeechSynthesizerEfl.cpp: Removed.
* platform/efl/PlatformWheelEventEfl.cpp: Removed.
* platform/efl/ScrollbarThemeEfl.cpp: Removed.
* platform/efl/ScrollbarThemeEfl.h: Removed.
* platform/efl/SoundEfl.cpp: Removed.
* platform/efl/TemporaryLinkStubs.cpp: Removed.
* platform/efl/UserAgentEfl.cpp: Removed.
* platform/efl/WidgetEfl.cpp: Removed.
* platform/gamepad/efl/GamepadsEfl.cpp: Removed.
* platform/graphics/efl/CairoUtilitiesEfl.cpp: Removed.
* platform/graphics/efl/CairoUtilitiesEfl.h: Removed.
* platform/graphics/efl/EvasGLContext.cpp: Removed.
* platform/graphics/efl/EvasGLContext.h: Removed.
* platform/graphics/efl/EvasGLSurface.cpp: Removed.
* platform/graphics/efl/EvasGLSurface.h: Removed.
* platform/graphics/efl/GraphicsContext3DEfl.cpp: Removed.
* platform/graphics/efl/GraphicsContext3DPrivate.cpp: Removed.
* platform/graphics/efl/GraphicsContext3DPrivate.h: Removed.
* platform/graphics/efl/IconEfl.cpp: Removed.
* platform/graphics/efl/ImageBufferEfl.cpp: Removed.
* platform/graphics/efl/ImageEfl.cpp: Removed.
* platform/graphics/efl/IntPointEfl.cpp: Removed.
* platform/graphics/efl/IntRectEfl.cpp: Removed.
* platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp: Removed.
* platform/network/efl/NetworkStateNotifierEfl.cpp: Removed.
* rendering/RenderThemeEfl.cpp: Removed.
* rendering/RenderThemeEfl.h: Removed.
2017-02-16 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Support Resource Timing in Workers
https://bugs.webkit.org/show_bug.cgi?id=168086
<rdar://problem/30430117>
Reviewed by Alex Christensen.
Worker's load resources through the Document that loaded them. However,
their PerformanceResourceTiming entries should be added to the Performance
object inside the Worker context, not the Document's context.
This change adds an InitiatorContext to ResourceLoadOptions so that loaders
can determine if the load was initiated by the Document or a Worker. This
allows loaders to then know if the ResourceTiming data they collect should
be added to the Document's Performance object or forwarded on to the Worker's.
This adds a new ThreadableLoaderClient method intended only for the purpose
of adding the ResourceTiming information to the Worker's Performance object.
Unlike other ThreadableLoaderClient methods that are bridged and forwarded
on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
method never needs to be handled by clients and can be uniformly handled by
the WorkerThreadableLoader itself.
We also add a new ResourceTiming object that encapsulates all of the data
ultimately needed for a PerformanceResourceTimingEntry object. This allows
for all of the information to be gathered while loading on the Document
before serializing across to the Worker. That includes the Timing-Allow-Origin
check which uses the SecurityOrigin of the Worker.
This also modernizes and addresses issues in the Resource Timing implementation.
Better handling cases like loading from the Cache, Synchronous Loads, and
improving initiatorType information.
Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
performance-api/resource-timing-apis.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
New files.
* platform/network/NetworkLoadTiming.h:
(WebCore::NetworkLoadTiming::reset): Deleted.
We no longer need to reset.
* loader/ResourceTiming.cpp: Added.
(WebCore::passesTimingAllowCheck):
(WebCore::ResourceTiming::fromCache):
(WebCore::ResourceTiming::fromLoad):
(WebCore::ResourceTiming::fromSynchronousLoad):
(WebCore::ResourceTiming::ResourceTiming):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h: Added.
(WebCore::ResourceTiming::url):
(WebCore::ResourceTiming::initiator):
(WebCore::ResourceTiming::loadTiming):
(WebCore::ResourceTiming::networkLoadTiming):
(WebCore::ResourceTiming::allowTimingDetails):
(WebCore::ResourceTiming::overrideInitiatorName):
(WebCore::ResourceTiming::ResourceTiming):
Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
There are three static constructors indicating the different ways this object can
be constructed and the different data available at the time of construction.
* loader/ResourceLoaderOptions.h:
Add the new InitiatorContext, default to Document.
* loader/ThreadableLoaderClient.h:
(WebCore::ThreadableLoaderClient::didFinishTiming):
New client method only used by WorkerThreadableLoader.
* loader/WorkerThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
Add timing information to the Performance object when received. No need to inform clients.
* loader/DocumentThreadableLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
(WebCore::DocumentThreadableLoader::loadRequest):
Provide APIs to pass timing data on to a WorkerThreadableLoader.
Create ResourceTiming data for synchronous loads.
* loader/LoadTiming.h:
* loader/LoadTiming.cpp:
(WebCore::LoadTiming::isolatedCopy):
Add isolatedCopy to allow this data to be passed across to a Worker.
* loader/ResourceTimingInformation.h:
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):
(WebCore::ResourceTimingInformation::addResourceTiming):
(WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
Refactor to remove unused / unnecessary bits. Extract out some helpful code.
Changed this to match when Blink decides when to add or ignore entries, however
this may change over time.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::notifyDone):
(WebCore::SubresourceLoader::reportResourceTiming):
* loader/SubresourceLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::finishedTimingForWorkerLoad):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
Plumbing to report timing information to Worker if this resource was loaded for a Worker.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::initiatorName):
Store the initiator name on the CachedResource like other data added to the original
CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
cleans up other hacks that worked around this later on.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
Simply the creation of a ResourceTiming object for cache hits.
Report timing information to Worker if this resource was loaded for a Worker.
(WebCore::CachedResourceLoader::loadDone):
Eliminate this redundant point attempting to add a ResourceTiming entry.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::initiatorName):
Update to match the spec. The fallback is "other".
* page/Performance.h:
* page/Performance.cpp:
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::addResourceTiming):
Update to support PerformanceObservers.
Update to match spec (event should bubble).
* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::create):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::fetchStart):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
Construct with a ResourceTiming object containing all the data we need for the entry.
Update to match spec for what is required, should fallback, should be zero, etc.
(WebCore::passesTimingAllowCheck): Deleted.
Extracted this to ResourceTiming creation time in the loading context,
since this can't be determined on the Worker context without also having
all of the header information from each resource response.
* page/PerformanceResourceTiming.idl:
Expose to Workers!
2017-02-16 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Drop PassRefPtr in inspector/
https://bugs.webkit.org/show_bug.cgi?id=168420
Reviewed by Alex Christensen.
Use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
It drops some unnecessary null checks.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackCaller):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::PendingException::PendingException):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::consoleCountImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
(WebCore::InspectorInstrumentation::consoleTimeStampImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::consoleTimeStamp):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildInitiatorObject):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
* inspector/WebInjectedScriptManager.cpp:
(WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
* inspector/WebInjectedScriptManager.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessageTimerFired):
We dispatch appropriate addMessage function according to whether
`timer.stackTrace()` is nullptr.
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):
(WebCore::PageConsoleClient::messageWithTypeAndLevel):
(WebCore::PageConsoleClient::count):
(WebCore::PageConsoleClient::timeEnd):
(WebCore::PageConsoleClient::timeStamp):
* page/PageConsoleClient.h:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
(WebCore::WorkerConsoleClient::count):
(WebCore::WorkerConsoleClient::timeEnd):
(WebCore::WorkerConsoleClient::timeStamp):
* workers/WorkerConsoleClient.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::addMessage):
2017-02-16 Chris Fleizach <cfleizach@apple.com>
AX: Make form validation accessible on iOS
https://bugs.webkit.org/show_bug.cgi?id=168400
Reviewed by Chris Dumez.
Hide the popover content of form validation from accessibility (since its not interactable)
and instead announce the message.
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show):
2017-02-16 Simon Fraser <simon.fraser@apple.com>
Clean up use of some CALayer-related SPI
https://bugs.webkit.org/show_bug.cgi?id=168401
Reviewed by Tim Horton.
Use -setDrawsAsynchronously: rather than the old -setAcceleratesDrawing: SPI.
Remove CATiledLayer-related stuff from QuartzCoreSPI.h, since we don't use it any more.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::acceleratesDrawing):
(PlatformCALayerCocoa::setAcceleratesDrawing):
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer setDrawsAsynchronously:]): This override passes the state
onto the TileController.
(-[WebTiledBackingLayer setAcceleratesDrawing:]): Deleted.
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::LegacyTileGridTile):
* platform/spi/cocoa/QuartzCoreSPI.h:
2017-02-16 Yusuke Suzuki <utatane.tea@gmail.com>
Web Inspector: allow import() inside the inspector
https://bugs.webkit.org/show_bug.cgi?id=167457
Reviewed by Ryosuke Niwa.
When evaluating `import("...")`, we need the caller's context to resolve
the module specifier correctly. For example, if `import("./cocoa.js")` is
evaluated in the script "drinks/hot.js", this module name is resolved to
"drinks/cocoa.js". If the same import operator is evaluated in the script
"menu/all.js", the module specifier becomes "menu/cocoa.js".
Previously we reject the import operator if the caller does not have such
a context. These context is SourceOrigin and its ScriptFetcher. While they
are offered in the script tag and other code evaluations, the inspector
console does not offer that. These class are offered in the WebCore side
and we should not touch these classes in the JSC's inspector code.
Now we relax the above restriction. If the above caller information is not
offered, we fallback to the default one. In the web page, we use the page's
URL as the caller's source origin. This allows us to evaluate the import
operator in the inspector console.
And as of r167698, the console recognizes `await import("...")` form. We use
this to test this `import()` in the console functionality.
Test: inspector/controller/runtime-controller-import.html
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::importModule):
2017-02-16 Miguel Gomez <magomez@igalia.com>
[GTK] scroll with transparent background not repainted after scrollY >= 32768
https://bugs.webkit.org/show_bug.cgi?id=154283
Reviewed by Carlos Garcia Campos.
Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
not able to draw anything when using transformation matrices with values bigger than 32768. When
drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
draw anything in, which causes the reported transparent backgrounds.
The patch modifies the transformation matrices both from the current context and the pattern we
are painting, to avoid them to hold values that cannot stored in 16 bits.
There's still the possibility that this happens, but it would require using a pattern with a size
bigger than 32768.
Based on a previous patch by Gwang Yoon Hwang <yoon@igalia.com>.
Test: fast/backgrounds/background-repeat-long-scroll.html
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::drawPatternToCairoContext):
2017-02-16 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Images are never read from the clipboard
https://bugs.webkit.org/show_bug.cgi?id=168419
Reviewed by Sergio Villar Senin.
We write images in the clipboard, but we don't read them.
Fixes: editing/pasteboard/paste-image-using-image-data.html
* editing/Editor.cpp:
(WebCore::Editor::createFragmentForImageAndURL): Moved from EditorMac.mm since it's cross-platform code.
* editing/Editor.h:
* editing/gtk/EditorGtk.cpp:
(WebCore::createFragmentFromPasteboardData): Check if there's an image in the selection, and use
Editor::createFragmentForImageAndURL in that case.
* editing/mac/EditorMac.mm:
(WebCore::Editor::createFragmentForImageAndURL): Deleted.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::getClipboardContents): Check also if there's an image in the clipboard.
2017-02-15 Jer Noble <jer.noble@apple.com>
REGRESSION (r212311): NULL-dereference in HTMLMediaElement::prepareToPlay()
https://bugs.webkit.org/show_bug.cgi?id=168404
<rdar://problem/30547188>
Reviewed by Brian Weinstein.
Prior to r212311, m_player was always guaranteed to be initialized when calling
prepareToPlay(). r212311 began calling prepareToPlay() on a subsequent run-loop iteration
after creating m_player. So now check whether m_player is NULL before calling methods on it.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareToPlay):
2017-02-15 Eric Carlson <eric.carlson@apple.com>
[MediaStream] delete CaptureDeviceInfo struct
https://bugs.webkit.org/show_bug.cgi?id=168395
The CaptureDeviceInfo struct and CaptureDevice class were almost identical, so
add an "enabled" field to the later, delete the former, and switch all uses of
CaptureDeviceInfo to CaptureDevice.
Do some minor drive-by cleanup of AVCaptureDeviceManager::refreshCaptureDevices
and CaptureDeviceManager::captureDeviceFromDeviceID.
Reviewed by Sam Weinig.
No new tests, no behavior change.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): SourceKind -> DeviceType
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::CaptureDevice):
(WebCore::CaptureDevice::type): Renamed from kind.
(WebCore::CaptureDevice::setType):
(WebCore::CaptureDevice::enabled): Added.
(WebCore::CaptureDevice::setEnabled):
(WebCore::CaptureDevice::kind): Deleted.
(WebCore::CaptureDevice::setKind): Deleted.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::getSourcesInfo):
(CaptureDeviceManager::captureDeviceFromDeviceID): Don't call sourceWithUID.
(CaptureDeviceManager::bestSourcesForTypeAndConstraints):
(CaptureDeviceManager::sourceWithUID):
* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureDeviceManager::refreshCaptureDevices):
(WebCore::CaptureDeviceManager::refreshCaptureDeviceList): Deleted.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::captureDevices):
(WebCore::deviceIsAvailable):
(WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
(WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
(WebCore::AVCaptureDeviceManager::deviceConnected):
(WebCore::AVCaptureDeviceManager::deviceDisconnected):
(WebCore::AVCaptureDeviceManager::captureDeviceList): Deleted.
(WebCore::shouldConsiderDeviceInDeviceList): Deleted.
(WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Deleted.
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::audioDeviceInfo):
(WebCore::MockRealtimeMediaSource::videoDeviceInfo):
2017-02-15 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom conversion from FontFace code by using a Variant
https://bugs.webkit.org/show_bug.cgi?id=168384
Reviewed by Alex Christensen.
Match the font face spec and use a union rather than any in the FontFace constructor.
Test: Added additional cases to fast/text/font-face-javascript.html.
* css/FontFace.cpp:
(WebCore::FontFace::create):
* css/FontFace.h:
* css/FontFace.idl:
2017-02-15 Jer Noble <jer.noble@apple.com>
Disabled Media Sources should render black/silence
https://bugs.webkit.org/show_bug.cgi?id=168281
Reviewed by Eric Carlson.
Test: webrtc/video-disabled-black.html
Pass the enabled flag setting down from the MediaStreamTrackPrivate to its underlying
source, including RealtimeMediaSource and RealtimeOutgoingAudio/VideoSource. When either
enabled is cleared or muted is set, generate empty (black or silent) media, as opposed to
pausing media or (worse) continuing to send generated media.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setEnabled):
(WebCore::MediaStreamTrackPrivate::sourceEnabledChanged):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setEnabled):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::enabled):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::generateFrame):
2017-02-15 Wenson Hsieh <wenson_hsieh@apple.com>
Editing history scripts should not add the contenteditable attribute or override key events
https://bugs.webkit.org/show_bug.cgi?id=168389
<rdar://problem/30529945>
Reviewed by Dan Bernstein.
Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
events. These were initially added for compatibility with a test harness early on, and should have been removed
earlier.
* Scripts/DumpEditingHistory.js:
2017-02-15 Jer Noble <jer.noble@apple.com>
Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary
https://bugs.webkit.org/show_bug.cgi?id=168381
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2017-02-15 Anders Carlsson <andersca@apple.com>
Fix build.
* page/DragController.cpp:
(WebCore::DragController::doSystemDrag):
2017-02-15 Anders Carlsson <andersca@apple.com>
Modernize DragClient::startDrag somewhat
https://bugs.webkit.org/show_bug.cgi?id=168379
Reviewed by Tim Horton.
Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
instead of whether it's a link or not.
* loader/EmptyClients.cpp:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:
2017-02-15 Chris Dumez <cdumez@apple.com>
Expose Symbol.toPrimitive / valueOf on Location instances
https://bugs.webkit.org/show_bug.cgi?id=168295
Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
Expose Symbol.toPrimitive / valueOf on Location instances as per:
- https://html.spec.whatwg.org/#the-location-interface
Firefox and Chrome already comply with the specification.
Tests: fast/dom/location-valueOf-after-object-prototype-update.html
fast/dom/location-valueOf-after-object-prototype-update2.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2017-02-15 Aakash Jain <aakash_jain@apple.com>
Remove WebIOSEvent interface
https://bugs.webkit.org/show_bug.cgi?id=168368
Reviewed by Tim Horton.
* platform/ios/WebEvent.h: Removed WebIOSEvent.
2017-02-15 Chris Dumez <cdumez@apple.com>
[iOS] Form Validation Bubble should be sensitive to Dynamic Type
https://bugs.webkit.org/show_bug.cgi?id=168291
<rdar://problem/30508593>
Reviewed by Tim Horton.
Update ValidationBubble implementation on iOS to stop obeying the
minimum font size setting, given that this setting is not exposed
on iOS. Instead, we now rely on
[UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
will give us a font whose size obeys Dynamic Type [1] setting on iOS.
[1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
No new tests, no easily testable.
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
2017-02-15 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Drop PassRefPtr
https://bugs.webkit.org/show_bug.cgi?id=168320
Reviewed by Saam Barati.
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
Use Ref and pass it to SourceCode.
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated):
Pass reference.
2017-02-15 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][MSE][EME] Handle protection event also at decryptor level
https://bugs.webkit.org/show_bug.cgi?id=168316
Reviewed by Žan Doberšek.
So far in MSE pipeline we were handling the encryption events
only when they arrived at the demuxer but this won't work in any
kind of key renegotiation as the event will never arrive. Now we
connect to the element messages, check for the drm id and send it
to the private player for processing.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::appendPipelineElementMessageCallback):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleElementMessage):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2017-02-15 Zan Dobersek <zdobersek@igalia.com>
[EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
https://bugs.webkit.org/show_bug.cgi?id=168362
Reviewed by Xabier Rodriguez-Calvar.
In MediaKeys::setServerCertificate(), when the CDM implementation
doesn't support server certificates, it should resolve the promise
with the 'false' value, as mandated by the specification, and not
reject it.
A test case in mock-MediaKeys-setServerCertificate.html is updated.
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setServerCertificate):
2017-02-15 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
https://bugs.webkit.org/show_bug.cgi?id=168115
Reviewed by Darin Adler.
In r206014 HTTPHeaderMap::add() was updated to combine common headers with ',' instead of ", " to match the
fetch specification, but the uncommon headers are still combined with ", ".
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::add):
2017-02-14 Ryosuke Niwa <rniwa@webkit.org>
An assertion failure inside removeChildren
https://bugs.webkit.org/show_bug.cgi?id=168069
Reviewed by Brent Fulgham.
The bug was caused by notifyRemovePendingSheet executing scripts synchronously where it shouldn't.
Removed the call to notifyRemovePendingSheetIfNeeded in notifyChildNodeRemoved. Instead, invoke it
in its call sites when they're safe.
Test: http/tests/security/move-iframe-within-focus-handler-inside-removal.html
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::notifyChildInserted):
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::replaceAllChildren):
(WebCore::ContainerNode::removeChildren):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeRemoved):
2017-02-15 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Several tests are timing out after r212349
https://bugs.webkit.org/show_bug.cgi?id=168359
Reviewed by Žan Doberšek.
This is because they are failing the cross origin check. Those tests are not using WebKitWebSrc, but
GstFileSrc. I didn't consider the case of source not being a WebKitWebSrc.
Fixes several timeout instroduced in r212349.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin): Split the source check in two. First check if
it's nullptr, and return false. Then check if it's a WebKitWebSrc and return true if it isn't.
2017-02-14 Brent Fulgham <bfulgham@apple.com>
Revalidate URL after events that could trigger navigations
https://bugs.webkit.org/show_bug.cgi?id=168071
<rdar://problem/30450379>
Reviewed by Ryosuke Niwa.
When arbitary javascript runs during a load, we should revalidate
the URLs involved to make sure they are still valid.
Tests: http/tests/plugins/navigation-during-load-embed.html
http/tests/plugins/navigation-during-load.html
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget): Confirm we are still allowed to
load the URL after executing JS callbacks.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed): Split existing function into
existing protected method, and a new public method that checks a passed URL
for validity.
* html/HTMLFrameElementBase.h:
* html/HTMLFrameOwnerElement.h:
(WebCore::HTMLFrameOwnerElement::isURLAllowed):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget): Confirm we are still allowed to
load the URL after executing JS callbacks.
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame): Ditto.
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Implement MediaPlayerPrivate::hasSingleSecurityOrigin()
https://bugs.webkit.org/show_bug.cgi?id=168322
Reviewed by Žan Doberšek.
It currently returns true unconditionally. Add resolved-location property to WebKitWebSourceGStreamer to track
the resolved url returned by the server and use that from MediaPlayerPrivate to check if there was a cross
origin redirection.
Fixes: http/tests/security/canvas-remote-read-remote-video-redirect.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcFinalize):
(webKitWebSrcGetProperty):
(webKitWebSrcStart):
(webKitWebSrcQueryWithParent):
(webKitWebSrcGetUri):
(webKitWebSrcSetUri):
(StreamingClient::handleResponseReceived):
(ResourceHandleStreamingClient::wasBlocked):
(ResourceHandleStreamingClient::cannotShowURL):
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed, rolling out r211967.
Caused rendering issues in HiDPI
Reverted changeset:
"[GTK] scroll with transparent background not repainted after
scrollY >= 32768"
https://bugs.webkit.org/show_bug.cgi?id=154283
http://trac.webkit.org/changeset/211967
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Update cookie manager API to properly work with ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=168230
Reviewed by Michael Catanzaro.
Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
new libsoup API to support removing recently modified cookies.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::deleteAllCookiesModifiedSince):
2017-02-14 Joseph Pecoraro <pecoraro@apple.com>
[WebIDL] Improve serializer = { inherit }
https://bugs.webkit.org/show_bug.cgi?id=168293
Reviewed by Youenn Fablet.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
Expose a serialize() method on the interface.
(GenerateSerializerFunction):
(GenerateSerializerAttributesForInterface): Deleted.
Subclasses that have `serializer = { inherit }` can use
their parent's serialize() method to get the initial object.
We can now collapse everything back into a single function
because we only generate code for our own attributes.
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::serialize):
(WebCore::jsTestNodePrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::serialize):
(WebCore::jsTestObjPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerialization::serialize):
(WebCore::jsTestSerializationPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::JSTestSerializationInherit::serialize):
(WebCore::jsTestSerializationInheritPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerializationInherit.h:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::JSTestSerializationInheritFinal::serialize):
(WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
Updated results.
2017-02-14 Aakash Jain <aakash_jain@apple.com>
Move methods from WebCoreThread.h to WebCoreThreadInternal.h
https://bugs.webkit.org/show_bug.cgi?id=168326
Reviewed by Alexey Proskuryakov.
* platform/ios/wak/WebCoreThread.h: Move methods WebThreadRunLoop and WebThreadCurrentContext to WebCoreThreadInternal.h
* platform/ios/wak/WebCoreThreadInternal.h: Ditto.
* platform/ios/wak/WebCoreThreadRun.cpp: Removed WebCoreThread.h as it is already included by WebCoreThreadInternal.h
* platform/ios/wak/WKGraphics.mm: Included WebCoreThreadInternal.h, it subsequently includes WebCoreThread.h
* inspector/InspectorTimelineAgent.cpp: Ditto.
* page/mac/PageMac.mm: Ditto.
* platform/cf/MainThreadSharedTimerCF.cpp: Ditto.
* platform/cocoa/MemoryPressureHandlerCocoa.mm: Ditto.
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Ditto.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Ditto.
* bindings/js/CommonVM.cpp: included WebCoreThreadInternal.h
2017-02-14 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Support data interaction on links
https://bugs.webkit.org/show_bug.cgi?id=168331
<rdar://problem/30200837>
Reviewed by Tim Horton.
Adds support for data interaction on links at the WebCore layer, refactoring some drag-and-drop code on the Mac
along the way. Also adds two new TestWebKitAPI unit tests in DataInteractionTests.mm: LinkToInput and
BackgroundImageLinkToInput (see Tools/ChangeLog for more information).
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
Introduce platformAdjustDragImageForDeviceScaleFactor, and special-case drag images for links to anchor at the
bottom center.
* platform/DragImage.cpp:
(WebCore::platformAdjustDragImageForDeviceScaleFactor):
Scale the drag image up by the device scale factor. In WebDragClient, we scale the image back down to the
original size. It seems the reason we do this extra dance is because the image sizing heuristic in between
assumes that the image dimensions are for a non-retina device, but this work should really not be necessary if
we tweak the heuristic to account for deviceScaleFactor. We should address this in a separate patch.
* platform/DragImage.h:
* platform/graphics/Path.h:
2017-02-14 Basuke Suzuki <Basuke.Suzuki@am.sony.com>
[CURL] ResourceError created with error information should have default type Type::General
https://bugs.webkit.org/show_bug.cgi?id=168345
Reviewed by Alex Christensen.
ResourceError has separate implementaion for each platform
so that the interface should be same.
On CURL port, the constructor with error information has
different default value on `type` parameter. It is Type::Null but other implementaitons have Type::General.
This causes some ResourceError is created inconsistent.
* platform/network/curl/ResourceError.h:
(WebCore::ResourceError::ResourceError):
2017-02-14 Youenn Fablet <youennf@gmail.com>
[WebRTC] Add support for libwebrtc negotiation needed event
https://bugs.webkit.org/show_bug.cgi?id=168267
Reviewed by Eric Carlson.
Test: webrtc/negotiatedneeded-event-addStream.html
Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
This code handles the control of sending or not the negotiationneeded event.
Updating mock to use markAsNeedingNegotiation when streams are changed.
Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::isNegotiationNeeded):
(WebCore::PeerConnectionBackend::clearNegotiationNeededState):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::AddStream):
(WebCore::MockLibWebRTCPeerConnection::RemoveStream):
2017-02-14 Brady Eidson <beidson@apple.com>
Unreviewed followup to r212330 to fix Debug builds
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Add call to relaxAdoptionRequirement().
2017-02-14 Matt Rajca <mrajca@apple.com>
Website policies: iframes should respect the autoplay policy of the top-level document
https://bugs.webkit.org/show_bug.cgi?id=168333
Reviewed by Alex Christensen.
API tests were added.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
2017-02-14 Dean Jackson <dino@apple.com>
Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
https://bugs.webkit.org/show_bug.cgi?id=168339
<rdar://problem/30522092>
Reviewed by Simon Fraser.
Use a setting name that more clearly reflects what it is doing. It's not
preferring to use the low-power GPU, it's forcing it.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* page/Settings.in:
2017-02-14 Brady Eidson <beidson@apple.com>
Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
<rdar://problem/29899473> and https://bugs.webkit.org/show_bug.cgi?id=168337
Reviewed by Geoffrey Garen.
No new tests (Unable to find a reproduction).
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
2017-02-14 Youenn Fablet <youenn@apple.com>
[WebRTC] Remove obsolete WebRTC stats API
https://bugs.webkit.org/show_bug.cgi?id=167910
Reviewed by Alex Christensen.
No change of behavior as removed constructs are not functional.
Removing RTCStatsResponse which no longer exists and made RTCStatsReport an empty container for now.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::getStats):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCStatsReport.cpp:
(WebCore::RTCStatsReport::create): Deleted.
(WebCore::RTCStatsReport::RTCStatsReport): Deleted.
(WebCore::RTCStatsReport::names): Deleted.
(WebCore::RTCStatsReport::local): Deleted.
(WebCore::RTCStatsReport::remote): Deleted.
(WebCore::RTCStatsReport::addStatistic): Deleted.
* Modules/mediastream/RTCStatsReport.h:
(WebCore::RTCStatsReport::create):
(WebCore::RTCStatsReport::timestamp): Deleted.
(WebCore::RTCStatsReport::id): Deleted.
(WebCore::RTCStatsReport::type): Deleted.
(WebCore::RTCStatsReport::stat): Deleted.
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/RTCStatsResponse.cpp: Removed.
* Modules/mediastream/RTCStatsResponse.h: Removed.
* Modules/mediastream/RTCStatsResponse.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpoint::getStats):
* platform/mediastream/RTCStatsRequest.h: Removed.
* platform/mediastream/RTCStatsResponseBase.h: Removed.
2017-02-14 Karim H <karim@karhm.com>
Removed unused methods of WebCore::FileStream
https://bugs.webkit.org/show_bug.cgi?id=168025
Reviewed by Michael Catanzaro.
* fileapi/AsyncFileStream.cpp:
(WebCore::AsyncFileStream::openForWrite): Deleted.
(WebCore::AsyncFileStream::write): Deleted.
(WebCore::AsyncFileStream::truncate): Deleted.
* fileapi/AsyncFileStream.h:
* platform/FileStream.cpp:
(WebCore::FileStream::openForWrite): Deleted.
(WebCore::FileStream::write): Deleted.
(WebCore::FileStream::truncate): Deleted.
* platform/FileStream.h:
2017-02-14 Chris Dumez <cdumez@apple.com>
HTML Form Validation bubble should take minimum font size setting into consideration
https://bugs.webkit.org/show_bug.cgi?id=168271
<rdar://problem/29869869>
Reviewed by Simon Fraser.
HTML Form Validation bubble should take minimum font size setting into consideration
for better accessibility.
Test: fast/forms/validation-message-minimum-font-size.html
* platform/ValidationBubble.h:
(WebCore::ValidationBubble::create):
(WebCore::ValidationBubble::fontSize):
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):
Update the ValidationBubble constructor to take in Settings. For now, there is a
single setting that is the minimum font size and that is taken into account when
setting the font size of the validation bubble text.
2017-02-14 Eric Carlson <eric.carlson@apple.com>
[MediaStream] add navigator.getUserMedia for compatibility with legacy content
https://bugs.webkit.org/show_bug.cgi?id=168324
<rdar://problem/30513125>
Reviewed by Youenn Fablet.
Tests: fast/mediastream/argument-types.html
fast/mediastream/getusermedia.html
fast/mediastream/webkitGetUserMedia-shadowing-then.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl: Added.
* Modules/mediastream/NavigatorUserMedia.js: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/Navigator.idl:
2017-02-14 Chris Dumez <cdumez@apple.com>
Fallback to legacy type only when event is trusted
https://bugs.webkit.org/show_bug.cgi?id=168301
Reviewed by Ryosuke Niwa.
Fallback to legacy type only when event is trusted as per a recent
DOM specification change:
- https://github.com/whatwg/dom/issues/404
- https://github.com/whatwg/dom/pull/406
No new tests, rebaselined existing test.
* dom/EventTarget.cpp:
(WebCore::legacyType):
(WebCore::EventTarget::fireEventListeners):
2017-02-13 Dean Jackson <dino@apple.com>
Rename preferLowPowerToHighPerformance to powerPreference
https://bugs.webkit.org/show_bug.cgi?id=168269
<rdar://problem/30504444>
Reviewed by Chris Dumez.
Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
into a powerPreference enum taking three values. The implementation
of the enum is in GraphicsContext3DAttributes.
While the name and values have changed, there should be no change in
behaviour caused by this patch.
* html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
enum GraphicsContext3DPowerPreference.
* html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
* html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
* platform/WebGLStateTracker.cpp:
* platform/WebGLStateTracker.h: Update the state tracker to use the new
values.
* platform/graphics/GraphicsContext3DAttributes.h:
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
(WebCore::GraphicsContext3D::GraphicsContext3D):
2017-02-14 Youenn Fablet <youennf@gmail.com>
[WebRTC] Implement description getters for libwebrtc RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=168234
Reviewed by Alex Christensen.
Allows passing W3C webrtc tests.
Implementing localDescription/remoteDescription using libwebrtc backend.
current and pending description getters are made the same as local/remote getters for the moment.
This should be fixed when upgrading to latest libwebrtc revision.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::toSessionDescriptionType):
(WebCore::fromSessionDescriptionType):
(WebCore::fromSessionDescription):
(WebCore::LibWebRTCMediaEndpoint::localDescription):
(WebCore::LibWebRTCMediaEndpoint::remoteDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::localDescription):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2017-02-14 Jeremy Jones <jeremyj@apple.com>
When playing inline after fullscreen, set a flag instead of adding attribute plays inline, and use in requiresFullscreenForVideoPlayback.
https://bugs.webkit.org/show_bug.cgi?id=167815
rdar://problem/27685077
Reviewed by Jer Noble.
Test: media/media-fullscreen-loop-inline.html
When video is allowed to play inline after fullscreen. Looped video causes play state to update, which can send video back to fullscreen when
allowsInline is false. This change will set a new flag when allowsInlineMediaPlaybackAfterFullscreen allows inline playback that can be tested
in requiresFullscreenForVideoPlayback to prevent sending video back into fullscreen when video loops.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::isTemporarilyAllowingInlinePlaybackAfterFullscreen): Added.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2017-02-14 Jer Noble <jer.noble@apple.com>
Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
https://bugs.webkit.org/show_bug.cgi?id=168268
Reviewed by Eric Carlson.
Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html
Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
to their most recent definitions in the HTML5 spec.
Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
* Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
* Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/IDLParser.pm:
(parseUnionType):
* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::createForJSConstructor):
* html/HTMLMediaElement.cpp:
(WebCore::actionName):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::scheduleDelayedAction):
(WebCore::HTMLMediaElement::scheduleNextSourceChild):
(WebCore::HTMLMediaElement::pendingActionTimerFired):
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::load):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::mediaCanStart):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::loadInternal): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::srcObject):
* html/HTMLMediaElement.idl:
* platform/ContentType.h:
2017-02-14 Aakash Jain <aakash_jain@apple.com>
Remove unused WebThreadContextIsCurrent method from WebCoreThread.h
https://bugs.webkit.org/show_bug.cgi?id=168254
Reviewed by Dan Bernstein.
* platform/ios/wak/WebCoreThread.h: Removed unused WebThreadContextIsCurrent.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadContextIsCurrent): Deleted.
2017-02-14 Alexey Proskuryakov <ap@apple.com>
WebCore shouldn't export SystemMemory.h
https://bugs.webkit.org/show_bug.cgi?id=168285
Reviewed by Alex Christensen.
* WebCore.xcodeproj/project.pbxproj:
2017-02-13 Filip Pizlo <fpizlo@apple.com>
worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
https://bugs.webkit.org/show_bug.cgi?id=168277
Reviewed by Mark Lam.
Test: workers/sab/postMessage-transfer-type-error.html
This is a simple spec compliance change. The title says it all.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::create):
2017-02-14 Zan Dobersek <zdobersek@igalia.com>
HTMLMediaElement: WebKitMediaKeys member name should be prefixed
https://bugs.webkit.org/show_bug.cgi?id=168297
Reviewed by Xabier Rodriguez-Calvar.
Rename the LEGACY_ENCRYPTED_MEDIA m_mediaKeys variable to m_webkitMediaKeys
so that it contains the legacy prefix, just like the API. This will make
room for the MediaKeys member variable that will be implemented under
the ENCRYPTED_MEDIA guards.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCachedKeyForKeyId):
(WebCore::HTMLMediaElement::webkitSetMediaKeys):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::webkitKeys):
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Make DragImageRef a RefPtr instead of a plain pointer
https://bugs.webkit.org/show_bug.cgi?id=168296
Reviewed by Sergio Villar Senin.
Use RefPtr<cairo_surface_t> as DragImageRef for GTK+ port to avoid memory leaks.
* platform/DragImage.h:
* platform/gtk/DragImageGtk.cpp:
(WebCore::dragImageSize):
(WebCore::deleteDragImage):
(WebCore::scaleDragImage):
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
(WebCore::createDragImageIconForCachedImageFilename):
2017-02-14 Vanessa Chipirrás Navalón <vchipirras@igalia.com>
[GStreamer][MSE] Some GStreamer log messages are generated with the 'default' category
https://bugs.webkit.org/show_bug.cgi?id=168015
Reviewed by Xabier Rodriguez-Calvar.
The elements AppendPipeline, PlaybackPipeline, MediaSourceClientGstreamerMSE do not have
a defined Gstreamer log category, then the webkitmse category has been added to them.
WebKitMediaSourceGstreamer has its own category but was not declared at the beginning of
the .cpp file.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added webkitmse category.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
Added webkitmse category and gst header.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added webkitmse category.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
Added webkitmediasrc category.
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
CookieManager only works with the default session
https://bugs.webkit.org/show_bug.cgi?id=168229
Reviewed by Alex Christensen.
Update cookie observer API to use a std::function instead of a function pointer and make it work with multiple
sessions in the backends that support it.
* platform/network/CookieStorage.h:
* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::cookieChangeCallbackMap):
(WebCore::notifyCookiesChanged):
(WebCore::startObservingCookieChanges):
(WebCore::stopObservingCookieChanges):
* platform/network/mac/CookieStorageMac.mm:
(-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
(-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]):
(WebCore::startObservingCookieChanges):
(WebCore::stopObservingCookieChanges):
* platform/network/soup/CookieStorageSoup.cpp:
(WebCore::cookieChangeCallbackMap):
(WebCore::soupCookiesChanged):
(WebCore::startObservingCookieChanges):
(WebCore::stopObservingCookieChanges):
2017-02-13 Antoine Quint <graouts@apple.com>
REGRESSION: Update volume and scrubbing slider to match HI designs
https://bugs.webkit.org/show_bug.cgi?id=168170
<rdar://problem/28095266>
Reviewed by Dean Jackson.
We bring the designs of the control's background materials, scrubber and
volume slider up to spec.
The first important set of changes is that, on macOS, the materials and colors
were incorrect. Buttons and time labels now set a mix-blend-mode to correctly
appear vibrant against the media, and the controls bar, volume container
and tracks menu now use a new BackgroundTint node to correctly apply both
a backdrop-filter and blended tint above it.
The second important set of changes is the rendering of the sliders. Up to now
we would simply style the <input type="range"> track and thumb, applying solid
fills and strokes. We now draw sliders in two ways depending on the platform.
On macOS, we draw the whole slider with a <canvas> element with "mix-blend-mode"
set to "plus-lighter". On iOS, we draw the track as a <div> with "mix-blend-mode"
set to "plus-darker" and draw the fill (up to the thumb) in the <canvas> with
no blend mode to obtain a pure white color, finally the thumb is rendered by the
<input> element. We couldn't draw the pure white color with the track in the
same <canvas> due to the "plus-darker" blend mode.
Test: media/modern-media-controls/background-tint/background-tint.html
* Modules/modern-media-controls/controls/airplay-button.css:
(button.airplay.on):
* Modules/modern-media-controls/controls/background-tint.css: Added.
(.background-tint):
(.background-tint,):
(.background-tint > .blur):
(.background-tint > .tint):
* Modules/modern-media-controls/controls/background-tint.js: Added.
(BackgroundTint):
* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(.media-controls.ios.inline .scrubber.slider):
(.media-controls.ios.inline .scrubber.slider > div):
(.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
(.media-controls.ios.inline .scrubber.slider > .fill): Deleted.
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
(.media-controls.mac.inline.compact .volume-slider-container):
(.media-controls.mac.inline.compact .volume.slider):
(.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen > .controls-bar):
(.media-controls.mac.fullscreen > .controls-bar > .background-tint > div):
(.media-controls.mac.fullscreen .volume.slider):
(.media-controls.mac.fullscreen button.volume-up):
(.media-controls.mac.fullscreen button.rewind):
(.media-controls.mac.fullscreen button.forward):
(.media-controls.mac.fullscreen .buttons-container.right button):
(.media-controls.mac.fullscreen .scrubber):
(.media-controls.mac.fullscreen > .controls-bar button): Deleted.
(.media-controls.mac.fullscreen button.airplay): Deleted.
(.media-controls.mac.fullscreen button.aspect-ratio): Deleted.
(.media-controls.mac.fullscreen button.pip): Deleted.
(.media-controls.mac.fullscreen button.tracks): Deleted.
(.media-controls.mac.fullscreen button.fullscreen): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .scrubber.slider):
(.media-controls.mac.inline .volume-slider-container):
(.media-controls.mac.inline .volume-slider-container > .background-tint):
(.media-controls.mac.inline .volume-slider-container > .background-tint > div):
(.media-controls.mac.inline .volume.slider):
(.media-controls.mac.inline button): Deleted.
(.media-controls.mac.inline button:active): Deleted.
(.media-controls.mac.inline > .controls-bar button): Deleted.
(.media-controls.mac.inline > .controls-bar,): Deleted.
(.media-controls.mac.inline .volume-slider-container:before): Deleted.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/macos-media-controls.css: Added.
(.media-controls.mac button:active):
(.media-controls.mac > .controls-bar button):
(.media-controls.mac > .controls-bar .time-label):
(.media-controls.mac > .controls-bar .slider > canvas):
(.media-controls.mac > .controls-bar .slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/scrubber.css: Removed.
* Modules/modern-media-controls/controls/scrubber.js:
(Scrubber):
(Scrubber.prototype.get buffered):
(Scrubber.prototype.set buffered):
(Scrubber.prototype.draw):
(Scrubber.prototype._drawMacOS):
(Scrubber.prototype._drawiOS):
* Modules/modern-media-controls/controls/slider.css:
(.slider):
(.slider > canvas,):
(.slider > canvas):
(.slider > input):
(.slider > input,): Deleted.
(.slider > .fill): Deleted.
(.slider > input::-webkit-slider-thumb): Deleted.
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.set value):
(Slider.prototype.set width):
(Slider.prototype.commitProperty):
(Slider.prototype.layout):
(Slider.prototype.draw):
(Slider.prototype._handleInputEvent):
(Slider.prototype._handleChangeEvent):
(addRoundedRect):
(Slider.prototype._updateFill): Deleted.
* Modules/modern-media-controls/controls/start-button.css:
(button.start):
* Modules/modern-media-controls/controls/time-control.js:
* Modules/modern-media-controls/controls/time-label.css:
(.time-label):
* Modules/modern-media-controls/controls/tracks-panel.css:
(.tracks-panel):
(.tracks-panel > .background-tint > div):
(.tracks-panel > section):
(.tracks-panel > section:first-of-type):
(.tracks-panel > section > h3):
(.tracks-panel > section > ul):
(.tracks-panel > section > ul > li):
(.tracks-panel > section > ul > li:focus):
(.tracks-panel > section > ul > li.selected:before):
(.tracks-panel > section > ul > li.animated):
(.tracks-panel-section): Deleted.
(.tracks-panel-section:first-of-type): Deleted.
(.tracks-panel-section > h3): Deleted.
(.tracks-panel-section > ul): Deleted.
(.tracks-panel-section > ul > li): Deleted.
(.tracks-panel-section > ul > li:focus): Deleted.
(.tracks-panel-section > ul > li.selected:before): Deleted.
(.tracks-panel-section > ul > li.animated): Deleted.
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype._childrenFromDataSource):
(TracksPanel.prototype._childrenFromDataSource.): Deleted.
* Modules/modern-media-controls/controls/volume-slider.js:
(VolumeSlider):
(VolumeSlider.prototype.handleEvent):
(VolumeSlider.prototype.draw):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/scrubbing-support.js:
(ScrubbingSupport.prototype.get mediaEvents):
(ScrubbingSupport.prototype.syncControl):
(ScrubbingSupport):
2017-02-13 Alex Christensen <achristensen@webkit.org>
URLs with an invalid IPv4 address should be invalid
https://bugs.webkit.org/show_bug.cgi?id=168260
Reviewed by Tim Horton.
All URL hosts are fed through the IPv4 parser. https://webkit.org/ doesn't
look enough like an IPv4 address to be considered an invalid IPv4 address, so
we continue to the String host processing. http://127.0.0.257 does, though, and
according to https://url.spec.whatwg.org/#concept-ipv4-parser parsing that URL
should fail.
Covered by newly passing web platform tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:
2017-02-13 Dan Bernstein <mitz@apple.com>
Reverted r212275. It still breaks some Apple-internal builds.
* platform/spi/mac/TUCallSPI.h:
2017-02-13 Joseph Pecoraro <pecoraro@apple.com>
Address ESLint warnings in modern-media-controls
https://bugs.webkit.org/show_bug.cgi?id=168224
Reviewed by Alexey Proskuryakov.
* Modules/modern-media-controls/controls/controls-bar.js:
* Modules/modern-media-controls/controls/fullscreen-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
* Modules/modern-media-controls/controls/media-controls.js:
* Modules/modern-media-controls/controls/scheduler.js:
* Modules/modern-media-controls/controls/seek-button.js:
* Modules/modern-media-controls/controls/tracks-panel.js:
* Modules/modern-media-controls/controls/volume-slider.js:
* Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
* Modules/modern-media-controls/gesture-recognizers/pinch.js:
* Modules/modern-media-controls/media/fullscreen-support.js:
* Modules/modern-media-controls/media/media-controller.js:
* Modules/modern-media-controls/media/placard-support.js:
* Modules/modern-media-controls/media/status-support.js:
Address pedantic warnings.
2017-02-13 Dan Bernstein <mitz@apple.com>
Restored changes from r212210 in a way that does not break the build.
* platform/spi/mac/TUCallSPI.h:
2017-02-13 Zalan Bujtas <zalan@apple.com>
FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
https://bugs.webkit.org/show_bug.cgi?id=168251
<rdar://problem/30498102>
Reviewed by Antti Koivisto.
Covered by existing (perf)tests.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText):
2017-02-12 Brian Burg <bburg@apple.com>
Web Inspector: expose system user interface layout direction through InspectorFrontendHost
https://bugs.webkit.org/show_bug.cgi?id=168209
<rdar://problem/11573736>
Reviewed by Joseph Pecoraro.
Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
properly set the UI directionality from system settings in PageClient, this will get inherited
automatically by the Inspector's WebPage instance.
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
Expose the directionality to the frontend as "ltr" or "rtl" strings.
2017-02-13 Zalan Bujtas <zalan@apple.com>
Simple line layout: Do not measure runs with trailing whitespace when kerning and ligatures are off.
https://bugs.webkit.org/show_bug.cgi?id=168247
<rdar://problem/30497288>
Reviewed by Antti Koivisto.
The width of the run is supposed to be the same with or without the trailing whitespace.
Covered by performance test.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-02-13 Karim H <karim@karhm.com>
Added the other missing BSTR roles tag names.
https://bugs.webkit.org/show_bug.cgi?id=165545
Reviewed by Chris Fleizach.
Test: accessibility/win/bstr-elements-role.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::shouldReturnTagNameAsRoleForMSAA):
2017-02-13 Youenn Fablet <youennf@gmail.com>
[WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
https://bugs.webkit.org/show_bug.cgi?id=168250
Reviewed by Alex Christensen.
Covered by webrtc tests in LayoutTests and in web-platform-tests.
Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
That way, it can create real libwebrtc backends whenever requested by tests.
Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
In the future, we should make them no longer static.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
(WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
(WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
(WebCore::LibWebRTCProvider::factory):
(WebCore::LibWebRTCProvider::setPeerConnectionFactory):
(WebCore::createActualPeerConnection):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
* testing/Internals.cpp:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::useMockRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
(WebCore::releaseInNetworkThread):
(WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
(WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
(WebCore::MockLibWebRTCPeerConnection::CreateOffer):
(WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
2017-02-13 Anders Carlsson <andersca@apple.com>
Simplify DragController::startDrag
https://bugs.webkit.org/show_bug.cgi?id=168240
Reviewed by Tim Horton.
Use early returns instead of assigning to a variable that's returned at the end of the function.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
2017-02-13 Said Abou-Hallawa <sabouhallawa@apple.com>
The current frame of an image should not deleted if another frame is asynchronously being decoded
https://bugs.webkit.org/show_bug.cgi?id=167618
Reviewed by Simon Fraser.
Test: fast/images/animated-image-draw-while-decode.html
If the memory cache asks the BitmapImage to destroy all its frames while
the next frame is being decoded, a thread contention may happen. This can
happen when BitmapImage::draw() is called and the next frame is not ready
yet for drawing, so the current frame has to be drawn. This will invoke
a frame decoding in the same image from the drawing committing thread.
We can avoid that by destroying all the frames except the current frame if
the image is asynchronously decoding its frames. This should not add extra
memory overhead because building the image frame cache and then destroying
it, when needed, is an on-going process. The frames will be allocated and
decoded all the time and all of them can be destroyed except the current one.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
be responsible only for destroying a range of ImageFrames.
(WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
is ready to be rendered if the next frame is being decoded.
* platform/graphics/BitmapImage.h: Move a const from ImageFrameCache.h to BitmapImage.h.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::destroyDecodedData):
(WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Deleted.
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::destroyAllDecodedData):
(WebCore::ImageFrameCache::destroyAllDecodedDataExcludeFrame):
(WebCore::ImageFrameCache::destroyDecodedDataBeforeFrame):
Make ImageFrameCache be responsible for destroying a range of ImageFrames.
This range might include all the frames, all the frames but up to a specific
frame, or all the frames but exclude one frame in the middle.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::clear): No need to call clearFrameBufferCache() from clear().
The decision to call clearFrameBufferCache() or clear() is moved to
BitmapImage::destroyDecodedData().
(WebCore::ImageSource::destroyDecodedData): Deleted.
(WebCore::ImageSource::destroyDecodedDataIfNecessary): Deleted.
These functions are replaced by another set of functions in ImageSource.h.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::destroyAllDecodedData):
(WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
(WebCore::ImageSource::destroyDecodedDataBeforeFrame):
(WebCore::ImageSource::hasDecodingQueue):
These are new wrappers which call the corresponding ImageFrameCache functions.
2017-02-13 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Stop soft-linking CTRunGetBaseAdvancesAndOrigins()
https://bugs.webkit.org/show_bug.cgi?id=168256
Reviewed by Alex Christensen.
Use of this function is already behind a platform guard.
No new tests because there is no behavior change.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(SOFT_LINK): Deleted.
2017-02-13 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] WebInspector should indicate webkitSubtle is deprecated
https://bugs.webkit.org/show_bug.cgi?id=165913
<rdar://problem/30477222>
Reviewed by Joseph Pecoraro.
Covered by existing tests.
* page/Crypto.cpp:
(WebCore::Crypto::webkitSubtle):
2017-02-13 Simon Fraser <simon.fraser@apple.com>
Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
https://bugs.webkit.org/show_bug.cgi?id=168261
rdar://problem/30481079
Reviewed by Tim Horton.
Add CABackingStoreCollectBlocking() to QuartzCoreSPI.h, and fix files in WebCore
that do a framework include.
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
* platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
* platform/spi/cocoa/QuartzCoreSPI.h:
* platform/spi/mac/NSViewSPI.h:
2017-02-13 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: !m_bodyLoader
https://bugs.webkit.org/show_bug.cgi?id=166986
Reviewed by Sam Weinig.
Refactoring to make the unset/set pending activity part of body loader.
This allows ensuring to not forget to do that by simply deleting the body loader.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didFail):
(WebCore::FetchResponse::BodyLoader::BodyLoader):
(WebCore::FetchResponse::BodyLoader::~BodyLoader):
(WebCore::FetchResponse::stop):
* Modules/fetch/FetchResponse.h:
2017-02-13 Aakash Jain <aakash_jain@apple.com>
Remove unused WebCoreThreadSafe.h
https://bugs.webkit.org/show_bug.cgi?id=168236
Reviewed by Dan Bernstein.
* platform/ios/wak/WebCoreThreadSafe.h: Removed.
* WebCore.xcodeproj/project.pbxproj: Removed WebCoreThreadSafe.h
* platform/ios/wak/WebCoreThread.mm: Removed WebCoreThreadSafe.h and included WAKWindow.h directly
2017-02-13 Anders Carlsson <andersca@apple.com>
Fix iOS build.
* platform/ios/DragImageIOS.mm:
(WebCore::deleteDragImage):
2017-02-13 Sam Weinig <sam@webkit.org>
Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=168249
Reviewed by Dean Jackson.
Fix a FIXME and rename MediaQueryExp.h/cpp to match the class it contains, MediaQueryExpression.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/MediaQuery.h:
* css/MediaQueryEvaluator.h:
* css/MediaQueryExp.cpp: Removed.
* css/MediaQueryExp.h: Removed.
* css/MediaQueryExpression.cpp: Copied from Source/WebCore/css/MediaQueryExp.cpp.
* css/MediaQueryExpression.h: Copied from Source/WebCore/css/MediaQueryExp.h.
* css/parser/MediaQueryParser.h:
2017-02-13 Aakash Jain <aakash_jain@apple.com>
WAKResponder should be exported from WebCore
https://bugs.webkit.org/show_bug.cgi?id=168245
Reviewed by Dan Bernstein.
* platform/ios/wak/WAKResponder.h:
2017-02-13 Simon Fraser <simon.fraser@apple.com>
Log to the History Channel in a few more places
https://bugs.webkit.org/show_bug.cgi?id=168252
Reviewed by Brady Eidson.
*** Aliens ***
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState):
(WebCore::HistoryController::updateForReload):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleHistoryNavigation):
(WebCore::NavigationScheduler::timerFired):
(WebCore::NavigationScheduler::cancel):
* page/History.cpp:
(WebCore::History::go):
2017-02-13 Alex Christensen <achristensen@webkit.org>
Percent should be allowed in non-special URL hosts
https://bugs.webkit.org/show_bug.cgi?id=168255
Reviewed by Tim Horton.
In the last few weeks, the spec has consolidated its sets of code points.
Now forbidden host code points replace the old invalid host code points with
the modification that percents are allowed in non-special hosts because we
percent-encode non-ascii code points in non-special hosts.
See https://url.spec.whatwg.org/#concept-opaque-host-parser
Covered by newly passing web platform tests.
* platform/URLParser.cpp:
(WebCore::isC0Control):
(WebCore::isInUserInfoEncodeSet):
(WebCore::URLParser::hasForbiddenHostCodePoint):
(WebCore::URLParser::parseHostAndPort):
(WebCore::isInvalidDomainCharacter): Deleted.
(WebCore::URLParser::hasInvalidDomainCharacter): Deleted.
* platform/URLParser.h:
2017-02-13 Anders Carlsson <andersca@apple.com>
Fix Windows build.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::setDragImage):
2017-02-13 Alex Christensen <achristensen@webkit.org>
Fix Yosemite build after r211765
https://bugs.webkit.org/show_bug.cgi?id=168246
<rdar://problem/30494174>
Reviewed by Brady Eidson.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(SOFT_LINK):
2017-02-13 Anders Carlsson <andersca@apple.com>
Add a DragImage class that wraps a DragImageRef
https://bugs.webkit.org/show_bug.cgi?id=168131
Reviewed by Beth Dakin.
This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
various drag code paths possible. No functionality change.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::updateDragImage):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:
* platform/DragImage.cpp:
(WebCore::DragImage::DragImage):
(WebCore::DragImage::operator=):
(WebCore::DragImage::~DragImage):
* platform/DragImage.h:
* platform/Pasteboard.h:
* platform/StaticPasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
2017-02-13 Chris Dumez <cdumez@apple.com>
Regression(r211455): ASSERTION FAILED: frameView || pageCacheState() == InPageCache in com.apple.WebCore: WebCore::Document::destroyRenderTree
https://bugs.webkit.org/show_bug.cgi?id=168237
<rdar://problem/30494165>
Reviewed by Gavin Barraclough.
Drop bad assertion under document::destroyRenderTree() that was introduced in r211455.
The assertion seemed like a good idea but the issue is that CachedFrame::destroy()
reset's the document's pageCacheState before calling Document::prepareForDestruction().
No new tests, this fixes assertion hits on our bots.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
2017-02-13 Myles C. Maxfield <mmaxfield@apple.com>
Update custom line breaking iterators to the latest version of Unicode
https://bugs.webkit.org/show_bug.cgi?id=168182
Reviewed by Zalan Bujtas.
Clean up our breaking code to be more descriptive about the difference between
line-break: auto vs line-break: loose | normal | strict. The only difference is
that we have some hardcoded tables to speed up character iteration for
line-break: auto.
Tests: TestWebKitAPI WebKit2.LineBreaking
* rendering/BreakLines.h:
(WebCore::nextBreakablePosition):
(WebCore::nextBreakablePositionIgnoringNBSP):
(WebCore::nextBreakablePositionWithoutShortcut):
(WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
(WebCore::isBreakable):
(WebCore::nextBreakablePositionNonLoosely): Deleted.
(WebCore::nextBreakablePositionLoosely): Deleted.
(WebCore::nextBreakablePositionLoose): Deleted.
(WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
2017-02-13 Youenn Fablet <youenn@apple.com>
Remove @getUserMedia identifier
https://bugs.webkit.org/show_bug.cgi?id=168216
Reviewed by Sam Weinig.
No change of behavior.
* Modules/mediastream/MediaDevices.idl:
* bindings/js/WebCoreBuiltinNames.h:
2017-02-13 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Non-accelerated drawing is broken with HiDPI
https://bugs.webkit.org/show_bug.cgi?id=168128
Reviewed by Michael Catanzaro.
When device scale factor changes, the page notifies the page overlay controller about it. Then overlay root
layers are created to be notified about the device scale factor. That causes us to enter in accelerated
compositing mode, because the graphics layer factory is called. But the render layer compositor doesn't really
enter in accelerated mode, because there aren't page overlays, the accelerated mode is not forced and the website
doesn't require acceleration either. This leaves our drawing area in an inconsistent state, it thinks it's in AC
mode because it has a layer tree host, but without a root layer attached, so nothing is rendered. The page
overlay controller doesn't need to create the layers when device scale factor changes, when an overlay is
installed, layers will be created with the current device scale factor anyway.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::didChangeDeviceScaleFactor): Return early if not initialized yet.
2017-02-13 Csaba Osztrogonác <ossy@webkit.org>
REGRESSION(r210845) Build broken with ENABLE_MHTML disabled
https://bugs.webkit.org/show_bug.cgi?id=167771
Reviewed by Daniel Bates.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
2017-02-12 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
* platform/spi/mac/TUCallSPI.h: Reverted to r212210.
2017-02-12 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
* platform/spi/mac/TUCallSPI.h:
2017-02-12 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
* platform/spi/mac/TUCallSPI.h:
2017-02-12 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
* platform/spi/mac/NSMenuSPI.h: Replaced declaration of deprecated method with its current
equivalent.
2017-02-12 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
* platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
2017-02-12 Ryosuke Niwa <rniwa@webkit.org>
parserRemoveChild should unload subframes
https://bugs.webkit.org/show_bug.cgi?id=168151
Reviewed by Darin Adler.
Fix the bug that the adoption agency algorithm does not unload subframes as it disconnects nodes.
Also moved calls to nodeWillBeRemoved inside NoEventDispatchAssertion to expand on r211965.
Tests: fast/parser/adoption-agency-clear-focus-range.html
fast/parser/adoption-agency-unload-iframe-1.html
fast/parser/adoption-agency-unload-iframe-2.html
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom): Rewritten using idioms used in removeChildren and parserAppendChild.
Disconnect all subframes first since this can synchronously dispatch an unload event. Then update DOM ranges,
the focused element, and other states in the document.
Second, use the regular removeBetween, notifyChildNodeRemoved, childrenChanged sequence of calls to disconnect nodes
instead of a single call to removeDetachedChildren to properly disconnect child nodes since those nodes may have
already come live due to execution of synchronous scripts prior to the adoption agency algorithm has run, or in
response to the unload event we just dispatched.
Third, append these nodes using parserAppendChild to avoid dispatching mutation events.
(WebCore::willRemoveChild): Removed the call to nodeWillBeRemoved. It's now called within NoEventDispatchAssertion
in each call site of willRemoveChild and willRemoveChildren.
(WebCore::willRemoveChildren): Ditto.
(WebCore::ContainerNode::removeChild): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
(WebCore::ContainerNode::replaceAllChildren): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
(WebCore::ContainerNode::parserRemoveChild): Disconnect subframes and update document's states.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeTakeAllChildrenAndReparentTask): Add a release assert that new parent does not already have a parent.
2017-02-12 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r179497): Crash inside setAttributeNode
https://bugs.webkit.org/show_bug.cgi?id=168161
<rdar://problem/30451581>
Reviewed by Andreas Kling.
The bug was caused by setAttributeNode calling setAttributeInternal with the same element data as the one used
to call removeAttributeInternal despite of the fact removeAttributeInternal could have invoked arbitrary scripts
and mutated element's m_elementData.
Fixed the bug by calling with setAttributeInternal with the result of new invocation of ensureUniqueElementData().
Test: fast/dom/Attr/make-unique-element-data-while-replacing-attr.html
* dom/Element.cpp:
(WebCore::Element::setAttributeNode):
2017-02-12 Ryosuke Niwa <rniwa@webkit.org>
Rebaseline bindings tests after r212207.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2017-02-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Some -respondsToSelector: checks are unnecessary
https://bugs.webkit.org/show_bug.cgi?id=168183
Reviewed by Tim Horton.
* English.lproj/Localizable.strings: Removed a string that’s no longer needed after the
change to WebKit2/Platform/mac/MenuUtilities.mm.
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController): Removed check whether
LULookupDefinitionModule responds to +showDefinitionForTerm:relativeToRect:ofView:options:.
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): Changed to use
-[NEFilterSource setSourceAppIdentifier:], without checking, instead of
-setSourceAppBundleID:, which does not exist.
* platform/cocoa/ScrollController.mm:
(systemUptime): Deleted.
(WebCore::ScrollController::snapRubberBand): Use -[NSProcessInfo systemUptime] directly.
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove unnecessary check.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Replaced
-respondsToSelector: check with -isKindOfClass: check corresponding to the above cast.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): Removed unnecessary
check.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Removed unnecessary checks.
* platform/graphics/mac/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]): Ditto.
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::typeForEvent): Removed check whether NSMenu responds to +menuTypeForEvent: and
all code to handle that case that it doesn’t.
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController applicationDidResignActive:]): Removed check whether
NSWindow responds to -isOnActiveSpace.
(-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Removed check whether
NSApplication responds to -setPresentationOptions:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC updateIsPlaying:newPlaybackRate:]): Removed
unnecessary -respondsToSelector: check.
(-[WebVideoFullscreenInterfaceMacObjC setVideoDimensions:]): Ditto.
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): Ditto.
* platform/spi/cf/CFNetworkSPI.h: Moved declarations of
-[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] and
-[NSURLCache _CFURLCache] to the !USE(APPLE_INTERNAL_SDK) section.
* platform/spi/cocoa/NEFilterSourceSPI.h: Added declaration of NEFilterSource’
sourceAppIdentifier property to the !USE(APPLE_INTERNAL_SDK) section and deleted
unconditional declaration of sourceAppBundleID property, which doesn’t exist.
* platform/spi/cocoa/QuartzCoreSPI.h: Removed redundant declarations.
* platform/spi/ios/DataDetectorsUISPI.h: Moved declarations of DDDetectionController methods
from WebKit2/UIProcess/ios/{WKActionSheetAssistant,WKContentViewInteraction}.mm to here.
Removed an unused declaration.
* platform/spi/mac/LookupSPI.h: Moved redundant declarations into the
!USE(APPLE_INTERNAL_SDK) section.
* platform/spi/mac/NSMenuSPI.h: Changed to import NSMenu_Private.h when using the
Apple internal SDK. Cleaned up the declarations for the other case.
* platform/spi/mac/TUCallSPI.h: Changed to import TUCall_Strings.h when use the Apple
internal SDK.
2017-02-11 Sam Weinig <sam@webkit.org>
Remove the remaining functions out of JSDOMBinding
https://bugs.webkit.org/show_bug.cgi?id=168179
Reviewed by Darin Adler.
Move utility functions into more appropriate locations.
- Move hasIteratorMethod to runtime/IteratorOperations.h
- Move nonCachingStaticFunctionGetter to runtime/Lookup.h
- Move addImpureProperty to CommonVM
Remove toJS overload that took a Vector<T>. Replace it's usage
with toJS<IDLSequence<T>> usage. To make this work, added two
new types, IDLIDBKeyData and IDLIDBValue.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
Adopt JSDOMConvert infrastructure for conversions using new types.
* bindings/IDLTypes.h:
* bindings/js/JSDOMConvertIndexedDB.h:
(WebCore::JSConverter<IDLIDBKeyData>::convert):
(WebCore::JSConverter<IDLIDBValue>::convert):
Add new types for IDBKeyData and IDBValue.
* bindings/js/CommonVM.cpp:
(WebCore::addImpureProperty):
* bindings/js/CommonVM.h:
Move addImpureProperty here from JSDOMBinding.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyDataToScriptValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
Remove unused idbKeyDataToScriptValue, and group like functions
together.
* bindings/js/JSDOMBinding.cpp: Removed.
* bindings/js/JSDOMBinding.h:
(WebCore::nonCachingStaticFunctionGetter): Deleted.
(WebCore::toJS): Deleted.
Move/remove functions.
* bindings/js/JSDOMConvertUnion.h:
Update for move of hasIteratorMethod to runtime/IteratorOperations.h
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSHTMLDocumentCustom.cpp:
* bindings/js/JSLocationCustom.cpp:
Update for move of nonCachingStaticFunctionGetter to runtime/Lookup.h
* bindings/js/JSSubtleCryptoCustom.cpp:
Remove unneeded include of runtime/IteratorOperations.h
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadedFunctionOrConstructor):
Include runtime/IteratorOperations when needing to distinguish a sequence.
* html/HTMLDocument.cpp:
Replace include of JSDOMBinding.h with CommonVM.h for addImpureProperty.
2017-02-12 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Handle caps lock indicator in event modifiers
https://bugs.webkit.org/show_bug.cgi?id=168186
Reviewed by Michael Catanzaro.
Add helper function to check if caps lock is present in the given modifiers. We need this because in GDK
GDK_LOCK_MASK might be either CapsLock or ShiftLock in X11. We use this new method in all platform event
implementations to add the appropriate modifiers.
Fixes: fast/events/special-key-events-in-input-text.html
* platform/PlatformKeyboardEvent.h:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::modifiersForGdkKeyEvent):
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
2017-02-11 Sam Weinig <sam@webkit.org>
Remove custom bindings for XSLTProcessor.idl
https://bugs.webkit.org/show_bug.cgi?id=168174
Reviewed by Andreas Kling.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSXSLTProcessorCustom.cpp: Removed.
Remove file.
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringOrUndefined): Deleted.
* bindings/js/JSDOMBinding.h:
Remove now unused jsStringOrUndefined.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::setParameter):
(WebCore::XSLTProcessor::getParameter):
(WebCore::XSLTProcessor::removeParameter):
* xml/XSLTProcessor.idl:
Replace custom bindings bindings with early returns. One subtle difference
between the custom bindings and this, is that getParameter will return
jsNull() rather than jsUndefined() for null String returns. This matches
all other bindings.
2017-02-11 Olivier Blin <olivier.blin@softathome.com>
[GStreamer][MSE][EME] Fix decryptor assignment
https://bugs.webkit.org/show_bug.cgi?id=168122
Reviewed by Michael Catanzaro.
The new decryptor is a floating reference so we should not use the
adopt GRefPtr constructor, but use the regular assignment operator
that will sink the object (clear the floating flag).
This fixes assertions in debug build.
See previous pipeline fix in r210851 and WPE commit
06020b18831e1c0eead34e2c1a5a4b7d026c227d.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
Do not use adoptGRef(), it prevented the object from being sunk.
2017-02-11 Simon Fraser <simon.fraser@apple.com>
Avoid a redundant scroll to 0,0 when navigating back to a url with no fragment
https://bugs.webkit.org/show_bug.cgi?id=168177
Reviewed by Sam Weinig.
FrameView::scrollToFragment() is called from FrameLoader::scrollToFragmentWithParentBoundary()
when navigating within the page. If the URL had no fragment identifier, this code would
call into FrameView::scrollToAnchor() with an empty name, where maintainScrollPositionAtAnchor()
used the document as the anchor, thus scrolling to 0,0. Later, history().restoreScrollPositionAndViewState()
the restores the scroll position from history.
This scroll to 0,0 happened to be not visible to the page because of scroll event
coalescing, but it makes implementation of history.scrollRestoration harder, so avoid it
by just returning early from FrameView::scrollToFragment() if there is no fragment,
making sure to clear the document's CSSTarget.
* dom/Document.cpp:
(WebCore::Document::setCSSTarget):
* page/FrameView.cpp:
(WebCore::FrameView::scrollToFragment):
(WebCore::FrameView::scrollToAnchor):
2017-02-11 Chris Dumez <cdumez@apple.com>
Implement URL's toJSON()
https://bugs.webkit.org/show_bug.cgi?id=167979
Reviewed by Sam Weinig.
Implement URL's toJSON() as per:
- https://url.spec.whatwg.org/#dom-url-tojson
This is already supported by Firefox.
Also, drop URLUtils.idl as it is no longer in the specification.
Merge its content to DOMURL.idl as per the URL specification.
Finally, mark href attribute as stringifier and drop the toString()
operation to match the specification. This fixes a bug where our
toString property was not enumerable but should have been.
Tests: fast/url/url-tojson.html
imported/w3c/web-platform-tests/url/url-tojson.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* html/DOMURL.idl:
* html/URLUtils.h:
(WebCore::URLUtils<T>::toJSON):
* html/URLUtils.idl: Removed.
2017-02-11 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
https://bugs.webkit.org/show_bug.cgi?id=168163
Reviewed by Michael Catanzaro.
It's missing causing several HTML anchor download tests to fail because the suggested filename missed the
extension. This patch moves MIMETypeRegistry::appendFileExtensionIfNecessary() from the cocoa specific file to the
common file because it's not actually platform specific. MIMETypeRegistry::getPreferredExtensionForMIMEType() is
what platforms should implement.
Fixes: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
fast/dom/HTMLAnchorElement/anchor-download.html
fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Deleted.
* platform/efl/MIMETypeRegistryEfl.cpp:
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
* platform/gtk/MIMETypeRegistryGtk.cpp:
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2017-02-11 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update imageTitle translatable string.
To match mac port. Fixes fast/images/imageDocument-title.html.
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::imageTitle):
2017-02-10 John Wilander <wilander@apple.com>
Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
https://bugs.webkit.org/show_bug.cgi?id=167474
<rdar://problem/24681808>
<rdar://problem/24703286>
<rdar://problem/30290270>
This patch does the following:
1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
does not provide the right data store.
2. Introduces timeout for user interaction. A domain needs interaction every 30
days to stay in that category.
3. Adds grandfathered to the statistics model in preparation for grandfathering of
existing data records.
4. Adds test infrastructure to allow testing of the various rules in place for
data records removal.
5. Fixes various smaller bugs that were found as part of setting up the tests.
6. Regresses the data records removal counting. We need to come up with a thread
safe way of gathering removal statistics from more than one data store now
that we potentially interact with multiple stores.
7. Adds a first set of layout tests for resource load statistics.
Reviewed by Andy Estes.
Tests: http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html
http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html
http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html
* dom/Document.cpp:
(WebCore::Document::updateLastHandledUserGestureTimestamp):
This now calls ResourceLoadObserver::logUserInteraction() every time since
we want to keep track of the most recent user interaction.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::statisticsStore):
New getter used by WebResourceLoadStatisticsManager::resetToConsistentState().
(WebCore::reduceTimeResolutionToOneDay):
Convenience function.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
Reduces time resolution for privacy reasons.
(WebCore::ResourceLoadObserver::logUserInteraction):
(WebCore::ResourceLoadObserver::clearUserInteraction):
(WebCore::ResourceLoadObserver::hasHadUserInteraction):
(WebCore::ResourceLoadObserver::setPrevalentResource):
(WebCore::ResourceLoadObserver::isPrevalentResource):
(WebCore::ResourceLoadObserver::clearPrevalentResource):
(WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
(WebCore::ResourceLoadObserver::fireDataModificationHandler):
New functions that allow WebKitTestRunner to stage exact
statistics, fire the handler, and test the outcome.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString):
(WebCore::ResourceLoadStatistics::merge):
Support for statistics mostRecentUserInteraction, grandfathered, and
dataRecordsRemoved.
* loader/ResourceLoadStatistics.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
New function that allows WebKitTestRunner to test
aging out of user interaction.
(WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
Now takes into account the timestamp and ages
out user interaction.
(WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
Now makes use of ResourceLoadStatisticsStore::hasHadRecentUserInteraction().
* loader/ResourceLoadStatisticsStore.h:
2017-02-10 Sam Weinig <sam@webkit.org>
[WebIDL] Cleanup XMLHttpRequest's bindings
https://bugs.webkit.org/show_bug.cgi?id=168067
Reviewed by Chris Dumez.
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsOwnedStringOrNull): Deleted.
* bindings/js/JSDOMBinding.h:
Remove jsOwnedStringOrNull and inline it into it's one use
in JSXMLHttpRequestCustom.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::responseText):
(WebCore::SendFunctor::SendFunctor): Deleted.
(WebCore::SendFunctor::line): Deleted.
(WebCore::SendFunctor::column): Deleted.
(WebCore::SendFunctor::url): Deleted.
(WebCore::SendFunctor::operator()): Deleted.
(WebCore::JSXMLHttpRequest::send): Deleted.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLHttpRequest.h:
Remove custom send, replacing it with a single send implementation that
takes a variant.
* xml/XMLHttpRequest.idl:
Cleanup the IDL to better match the spec. Update correct types where trivial.
2017-02-10 Chris Dumez <cdumez@apple.com>
document.origin doesn't match spec
https://bugs.webkit.org/show_bug.cgi?id=168022
Reviewed by Sam Weinig.
Update document.origin to return the origin in the expected format:
- https://dom.spec.whatwg.org/#dom-document-origin
Change: "https_webkit.org_0 -> "https://webkit.org".
The new behavior matches Firefox and Chrome.
No new tests, updated existing tests.
* dom/Document.cpp:
(WebCore::Document::origin):
2017-02-10 Daniel Bates <dabates@apple.com>
Attempt to fix the build following <https://trac.webkit.org/changeset/212173>
(https://bugs.webkit.org/show_bug.cgi?id=166774)
* dom/Document.cpp:
(WebCore::Document::detachFromCachedFrame): Use ASSER_UNUSED() instead of ASSERT() since
the parameter cachedFrame is unused in non-debug build.
2017-02-10 Daniel Bates <dabates@apple.com>
Detach frame from document when entering page cache
https://bugs.webkit.org/show_bug.cgi?id=166774
<rdar://problem/29904368>
Reviewed by Chris Dumez.
When a page enters the page cache it is unnecessary for it to hold a reference to its
associated frame because subsequent interactions with the page do not need to make use
of it. Once a page exits the page cache we associate it with its frame.
* dom/Document.cpp:
(WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
(WebCore::Document::attachToCachedFrame): Added.
(WebCore::Document::detachFromCachedFrame): Added.
(WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
the former.
(WebCore::Document::hasEverCalledWindowOpen): Deleted.
(WebCore::Document::markHasCalledWindowOpen): Deleted.
(WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.
* dom/Document.h:
(WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
visibility from public to private and made this function inline.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
removed from the page when it was in the page cache as there is no need to restore such frames.
(WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
frame tree.
(WebCore::CachedFrame::CachedFrame): Detach from the frame.
(WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
(WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
detach the animation controller from the document as it is being destroyed. We have to do this here
because the document does not have a frame. And Document::prepareForDestruction() only calls
CSSAnimationController::detachFromDocument() if the document has a frame.
* history/CachedFrame.h:
* history/PageCache.cpp:
(WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
or has an opener as it is feasible to keep such pages in the page cache.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
page is not in- or about to enter- the page cache. A page in the page cache has finished loading
and its active DOM objects are suspended. Also fix style nit in comment.
(WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
function will be removed.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
(WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::openedByWindowOpen): Deleted.
* page/Page.h:
* page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.
2017-02-10 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=168054
Reviewed by Tim Horton.
When adding mask layers, there was an ordering dependency. There was a hack in GraphicsLayerCA::setVisibleAndCoverageRects()
to propagate m_intersectsCoverageRect to masks. However, if GraphicsLayerCA::setVisibleAndCoverageRects()
ran on the masked layer before the mask was added, nothing updated the "m_intersectsCoverageRect" state of the mask layer.
Fix by explicitly calling setVisibleAndCoverageRects() on the mask layer, passing the same rects and
viewport-constrained state as for its host layer (we already assume that their geometry matches).
Tested by compositing/masks/solid-color-masked.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
2017-02-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r212154, r212154, and r212156.
https://bugs.webkit.org/show_bug.cgi?id=168156
broke internal builds (Requested by smfr on #webkit).
Reverted changesets:
"Add a DragImage class that wraps a DragImageRef"
https://bugs.webkit.org/show_bug.cgi?id=168131
http://trac.webkit.org/changeset/212154
"Add a DragImage class that wraps a DragImageRef"
https://bugs.webkit.org/show_bug.cgi?id=168131
http://trac.webkit.org/changeset/212154
"Try to fix the iOS and Windows builds."
http://trac.webkit.org/changeset/212156
2017-02-10 Csaba Osztrogonác <ossy@webkit.org>
Fix the !ENABLE(WEBGL) build
https://bugs.webkit.org/show_bug.cgi?id=168112
Reviewed by Alex Christensen.
* html/canvas/WebGLRenderingContextBase.h:
2017-02-10 Youenn Fablet <youenn@apple.com>
[Fetch API] fetch fails when undefined is passed as headers
https://bugs.webkit.org/show_bug.cgi?id=168043
Reviewed by Geoffrey Garen.
Covered by updated test.
* Modules/fetch/FetchInternals.js:
(fillFetchHeaders): Exit early in case of undefined headers, since it is an optional parameter.
2017-02-10 Csaba Osztrogonác <ossy@webkit.org>
Fix the !ENABLE(WEB_TIMING) build
https://bugs.webkit.org/show_bug.cgi?id=168113
Reviewed by Alex Christensen.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
2017-02-10 Joseph Pecoraro <pecoraro@apple.com>
Update features.json for Performance Timing APIs
https://bugs.webkit.org/show_bug.cgi?id=168148
Reviewed by Simon Fraser.
* features.json:
2017-02-10 Anders Carlsson <andersca@apple.com>
Try to fix the iOS and Windows builds.
* platform/ios/DragImageIOS.mm:
(WebCore::deleteDragImage):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::setDragImage):
2017-02-10 Anders Carlsson <andersca@apple.com>
Add a DragImage class that wraps a DragImageRef
https://bugs.webkit.org/show_bug.cgi?id=168131
Reviewed by Beth Dakin.
This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
various drag code paths possible. No functionality change.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::updateDragImage):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:
* platform/DragImage.cpp:
(WebCore::DragImage::DragImage):
(WebCore::DragImage::operator=):
(WebCore::DragImage::~DragImage):
* platform/DragImage.h:
* platform/Pasteboard.h:
* platform/StaticPasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
2017-02-10 Simon Fraser <simon.fraser@apple.com>
Make sure the "inwindow" flag propagates to TiledBackings for masks and reflections
https://bugs.webkit.org/show_bug.cgi?id=168127
rdar://problem/30467120
Reviewed by Tim Horton.
Replace the special-case, but wrong, GraphicsLayer traversal in setIsInWindowIncludingDescendants()
which forgot to hit masks and replica layers with a generic traverse() function, which
is then used for setting 'inWindow' as well as resetting tracked repaints.
Tests: compositing/tiling/tiled-mask-inwindow.html
compositing/tiling/tiled-reflection-inwindow.html
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setIsInWindow):
(WebCore::GraphicsLayer::setReplicatedByLayer):
(WebCore::GraphicsLayer::traverse):
(WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): Deleted.
* platform/graphics/GraphicsLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
(WebCore::resetTrackedRepaintRectsRecursive): Deleted.
2017-02-09 Simon Fraser <simon.fraser@apple.com>
Tiled layers are sometimes left with some tiles when outside the viewport
https://bugs.webkit.org/show_bug.cgi?id=168104
rdar://problem/30459055
Reviewed by Tim Horton.
When the coverage rect of a TiledBacking goes from a non-empty rect to an empty rect, we
shouldn't just early return from TileGrid::revalidateTiles(), otherwise we are left with some
tiles. Run through the function as normal, which will remove all the tiles for an empty coverage rect.
Minor logging changes.
Test: tiled-drawing/tile-coverage-iframe-to-zero-coverage.html
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
2017-02-10 Zalan Bujtas <zalan@apple.com>
Mail hangs when removing multiple rows from large table.
https://bugs.webkit.org/show_bug.cgi?id=168103
<rdar://problem/30090186>
Reviewed by Ryosuke Niwa.
DeleteSelectionCommand::removeNode doesn't actually destroy table structure items,
but instead it removes their content. In order to be able to continue editing the table after
the delete, we need to ensure that its cells' width and height are > 0. Currently we issue layout on
each table item recursively.
This patch delays the layout until after we've finished with the entire subtree delete (10x progression).
Performance test added.
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::insertBlockPlaceholderForTableCellIfNeeded):
(WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
(WebCore::shouldRemoveContentOnly):
(WebCore::DeleteSelectionCommand::removeNode):
* editing/DeleteSelectionCommand.h:
2017-02-10 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Enable Resource Timing by default in Tests
https://bugs.webkit.org/show_bug.cgi?id=168145
Reviewed by Ryosuke Niwa.
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setResourceTimingEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
No longer needed for tests.
2017-02-10 Dan Bernstein <mitz@apple.com>
[Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
https://bugs.webkit.org/show_bug.cgi?id=168097
Reviewed by Tim Horton.
Added a userTriggered argument to FrameSelection::setSelectedRange so that WebKit2 can
indicate that changes should be agreed to by the delegate.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectedRange): If the change is user-triggered, check with
shouldChangeSelection.
* editing/FrameSelection.h:
2017-02-10 Jonathan Bedard <jbedard@apple.com>
Removing LayoutTestRelay
https://bugs.webkit.org/show_bug.cgi?id=165927
Reviewed by Daniel Bates.
Part 2
LayoutTestRelay uses SPI, since recent versions of the iOS SDK allow for installing apps on
simulators through simctl (iOS 10 and later), use this functionality instead.
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isDumpRenderTree): Update comment to reflect removal of LayoutTestRelay.
2017-02-10 Youenn Fablet <youenn@apple.com>
[WebRTC] Implement Outgoing libwebrtc audio source support
https://bugs.webkit.org/show_bug.cgi?id=168118
Reviewed by Eric Carlson.
No new automated tests as we need the audio rendering to work to test the whole loop.
Using an AudioSampleDataSource to convert the captured data to libwebrtc expected format.
Capturing and pushing data happens in the capture thread.
Pulling of converted data happens in libwebrtc thread.
Introducing LibWebRTCAudioFormat.h to centralize libwbebrtc expected audio format.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/WebAudioBufferList.cpp:
(WebCore::WebAudioBufferList::WebAudioBufferList): Missing initialization leads to assertion failure.
* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::copyFrom): In case of interleaved channels, there is one buffer but two channels.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamples):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
* platform/audio/mac/AudioSampleDataSource.h:
* platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Added.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::libwebrtcAudioFormat):
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2017-02-10 Ryosuke Niwa <rniwa@webkit.org>
HTMLConstructionSiteTask::Insert should never be called on a node with a parent
https://bugs.webkit.org/show_bug.cgi?id=168099
Reviewed by Sam Weinig.
insertAlreadyParsedChild always use HTMLConstructionSiteTask::InsertAlreadyParsedChild instead
of using HTMLConstructionSiteTask::Insert when fostering a child.
Also combine the step to take all children and re-parenting into a single task instead of
separately issuing TakeAllChildren and Reparent tasks.
No new tests since this is a refactoring.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::insert): Now asserts that the child node never have a parent.
(WebCore::executeInsertAlreadyParsedChildTask): Moved the code to remove the parent here.
(WebCore::executeTakeAllChildrenAndReparentTask): Renamed from executeTakeAllChildrenTask
now that this function also does the reparenting.
(WebCore::executeTask):
(WebCore::HTMLConstructionSite::reparent): Removed the variant only used with takeAllChildren.
(WebCore::HTMLConstructionSite::insertAlreadyParsedChild): Always use InsertAlreadyParsedChild
instead of calling fosterParent which uses Insert when fostering parents.
(WebCore::HTMLConstructionSite::takeAllChildrenAndReparent): Renamed from takeAllChildren.
* html/parser/HTMLConstructionSite.h:
(WebCore::HTMLConstructionSiteTask:Operation):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
2017-02-10 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make intercap property values serialize correctly
https://bugs.webkit.org/show_bug.cgi?id=168073
Reviewed by Zalan Bujtas.
Fix CSS value keywords to preserve case when the value contains capital
letters. Examples include optimizeSpeed, translateX, scaleY, etc.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EPointerEvents):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode):
(WebCore::CSSPrimitiveValue::operator EImageRendering):
(WebCore::CSSPrimitiveValue::operator EColorInterpolation):
(WebCore::CSSPrimitiveValue::operator EColorRendering):
(WebCore::CSSPrimitiveValue::operator EShapeRendering):
* css/MediaQueryEvaluator.cpp:
(WebCore::colorGamutEvaluate):
* css/SVGCSSValueKeywords.in:
* css/TransformFunctions.cpp:
(WebCore::transformOperationType):
(WebCore::transformsForValue):
* css/makevalues.pl:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseTransformTranslateArguments):
(WebCore::parseSimpleTransformValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTransformValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
2017-02-10 Zan Dobersek <zdobersek@igalia.com>
[EME] Implement MediaKeySession::load()
https://bugs.webkit.org/show_bug.cgi?id=168041
Reviewed by Xabier Rodriguez-Calvar.
Implement the MediaKeySession::load() method, tracing the steps as they
are defined in the EME specification. The only exception is step 8.3,
which requires additional facility that tracks currently open sessions
and provides information whether for a given session ID there's already
a MediaKeySession that's not yet been closed.
Session ID sanitization is done through the CDM::sanitizeSessionId()
method, which relays the task to the CDMPrivate implementation.
The CDMInstance::loadSession() virtual method is called with the session
type, sanitized ID, the Document's origin (in string form) and the
callback that's invoked upon completion of the task. The callback
checks whether the operation was successful, or examines the reason for
the load failure in case it wasn't, rejecting the promise in the latter
case either immediately or in the following task at the latest.
When the load was successful, the optional known keys, expiration time
and message are handled appropriately, and the promise is resolved.
MockCDM::sanitizeSessionId() implementation only treats
'valid-loaded-session' as a valid session ID.
MockCDMInstance::loadSession() implementation is kept slim for now, only
providing the 'license-renewal' message when invoking the passed-in
callback. Known keys and expiration time will also be tested once the
relevant MediaKeySession algorithms are implemented.
Test: media/encrypted-media/mock-MediaKeySession-load.html
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::sanitizeSessionId):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::load):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeSessionId):
(WebCore::MockCDMInstance::loadSession):
* testing/MockCDMFactory.h:
2017-02-10 Zan Dobersek <zdobersek@igalia.com>
[EME] Implement MediaKeySession::sessionClosed()
https://bugs.webkit.org/show_bug.cgi?id=168039
Reviewed by Xabier Rodriguez-Calvar.
Implement the 'session closed' algorithm for MediaKeySession by
following the specified steps. After this algorithm is run, the
session should be considered closed, which we track via the m_closed
member variable on the class. This is set to true before the promise
that's accessible through the 'closed' attribute is resolved.
Because the algorithm requires the CDM instance to store any record
of key usage when the session's type is 'persistent-usage-record', the
storeRecordOfKeyUsage() virtual method is added to the CDMInstance
interface. MockCDMInstance implementation is left unimplemented for now.
JSMediaKeySession::closed() accessor now has a custom implementation
that creates a deferred promise for that object if there's none yet, and
shares it with the wrapped class through the registerClosedPromise()
method, storing a reference to the promise in the m_closedPromise
member variable, or resolving the promise immediately if the session was
already closed.
Test cases added to media/encrypted-media/mock-MediaKeySession-close.html.
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::registerClosedPromise):
(WebCore::MediaKeySession::sessionClosed):
* Modules/encryptedmedia/MediaKeySession.h:
* bindings/js/JSMediaKeySessionCustom.cpp:
(WebCore::JSMediaKeySession::closed):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::storeRecordOfKeyUsage):
* testing/MockCDMFactory.h:
2017-02-10 Zan Dobersek <zdobersek@igalia.com>
[EME] Implement MediaKeySession::updateKeyStatuses(), MediaKeyStatusMap
https://bugs.webkit.org/show_bug.cgi?id=167888
Reviewed by Xabier Rodriguez-Calvar.
Implement MediaKeySession::updateKeyStatuses(), transforming the passed-in
KeyStatusVector into a Vector mapping the key IDs to MediaKeyStatus values.
A keystatuseschange event is fired on the MediaKeySession object afterwards.
The queueing of the task that runs the 'attemp to resume playback' on the
related HTMLMediaElement objects isn't done yet since that algorithm isn't
implemented yet.
The statuses Vector is stored on the MediaKeySession object. That Vector is
then exposed through the MediaKeyStatusMap object, each such object being
unique to one MediaKeySession object. The implementation of MediaKeyStatusMap
thus keeps a reference to the session object as long as that object is alive,
and queries the MediaKeySession::statuses() getter to access the Vector that
contains status information for all the key IDs.
MediaKeyStatusMap::Iterator object keeps a reference to the MediaKeyStatusMap
object and accesses the statuses by indexing into the status Vector of the
related MediaKeySession object.
CDMInstance::updateLicense() now accepts the session ID string as the first
argument, making it possible to specify which session should be updated.
MockCDMFactory::keysForSessionWithID() returns an optional reference to the
Vector value in the session map that lists all the key IDs that are being
stored for that session.
MockCDMInstance::updateLicense() now detects the 'keys-changed' entry in the
passed-in response data, and upon detecting that constructs a KeyStatusVector
object containing all the keys for that session. KeyStatus::Usable is returned
for each object at the moment, but this should be adjustable in the future
through additional parameters passed through the response data. The Vector
object is then passed to the callback and is then passed to the 'update key
statuses' algorithm in MediaKeySession.
Covered by a test case in media/encrypted-media/mock-MediaKeySession-update.html.
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::~MediaKeySession):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::updateKeyStatuses):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeyStatusMap.cpp:
(WebCore::MediaKeyStatusMap::MediaKeyStatusMap):
(WebCore::MediaKeyStatusMap::detachSession):
(WebCore::MediaKeyStatusMap::size):
(WebCore::keyIdsMatch):
(WebCore::MediaKeyStatusMap::has):
(WebCore::MediaKeyStatusMap::get):
(WebCore::MediaKeyStatusMap::Iterator::Iterator):
(WebCore::MediaKeyStatusMap::Iterator::next):
* Modules/encryptedmedia/MediaKeyStatusMap.h:
(WebCore::MediaKeyStatusMap::create):
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::keysForSessionWithID):
(WebCore::MockCDMInstance::updateLicense):
* testing/MockCDMFactory.h:
2017-02-09 Simon Fraser <simon.fraser@apple.com>
Improve IOSurfacePool logging
https://bugs.webkit.org/show_bug.cgi?id=168098
Reviewed by Tim Horton.
Pass a string to DUMP_POOL_STATISTICS so we can tell what's triggering the
logging.
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::takeSurface):
(WebCore::IOSurfacePool::addSurface):
(WebCore::IOSurfacePool::evict):
(WebCore::IOSurfacePool::collectionTimerFired):
(WebCore::IOSurfacePool::showPoolStatistics):
* platform/graphics/cg/IOSurfacePool.h:
2017-02-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r212040.
Broke build. I'm not surprised
Reverted changeset:
"[WebRTC][Mac] Activate libwebrtc"
https://bugs.webkit.org/show_bug.cgi?id=167293
http://trac.webkit.org/changeset/212040
2017-02-09 Chris Dumez <cdumez@apple.com>
[Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
https://bugs.webkit.org/show_bug.cgi?id=168077
<rdar://problem/30412595>
Reviewed by Alex Christensen.
Add utility function to MIMETypeRegistry that appends an extension to
a filename if necessary, based on a provided MIME type.
Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
http/tests/download/anchor-download-no-extension.html
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
* platform/MIMETypeRegistry.h:
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
2017-02-09 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
Reviewed by Alex Christensen.
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
2017-02-09 Philip Rogers <pdr@google.com>
SVG clip-path references can clip out later content
https://bugs.webkit.org/show_bug.cgi?id=164181
Reviewed by Said Abou-Hallawa.
RenderSVGResourceClipper can modify the GraphicsContext state (through the path-only
clipping codepath) so we need to ensure RenderLayer::setupClipPath saves the context
and its caller restores it back so later content is not clipped as well.
This patch is based on a chromium patch by fs@opera.com:
https://chromium.googlesource.com/chromium/src/+/b3f7e7d2c4afb3c7e5c7eb438ff5933cbe2109b3
Test: css3/masking/clip-path-reference-restore.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupClipPath): Add a GC save and return true to restore. Also switch to downcast instead of static_cast.
2017-02-09 Filip Pizlo <fpizlo@apple.com>
SharedArrayBuffer does not need to be in the transfer list
https://bugs.webkit.org/show_bug.cgi?id=168079
Reviewed by Geoffrey Garen and Keith Miller.
Tests: workers/sab/multi-memory-multi-buffer.html
workers/sab/multi-memory.html
workers/sab/no-transfer.html
workers/sab/postMessage-clones.html
workers/sab/sent-from-worker-no-transfer.html
workers/sab/sent-from-worker-transfer.html
The SAB API that we originally implemented required that SABs get put in transfer lists
when they are sent to workers.
The new SAB API that everyone is converging towards requires that you do not put the
SAB in the transfer list. That's supposed to be an error. Instead, anytime that a SAB
is part of any message to or from a dedicated worker then it is automatically shared.
The new API provides a lot more clarity about what is supposed to happen in contexts
that support transfering but don't support sharing.
Right now this patch allows both styles to work, but I hope we can disable the transfer
list capability soon.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:
(): Deleted.
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::trySerializeDetail):
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::trySerializeError):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::trySerializeData):
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::trySerializeState):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
2017-02-09 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r212025.
inDocument -> isConnected
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
(WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formElementIndex):
2017-02-09 Chris Dumez <cdumez@apple.com>
Make sure Event keeps its current target element alive
https://bugs.webkit.org/show_bug.cgi?id=167885
<rdar://problem/30376972>
Reviewed by Brent Fulgham.
Make sure Event keeps its current target element alive to avoid
crashes if it is accessed by JS after it has been garbage collected.
Test: fast/events/currentTarget-gc-crash.html
* dom/Event.cpp:
(WebCore::Event::setCurrentTarget):
* dom/Event.h:
(WebCore::Event::currentTarget):
2017-02-09 Ryosuke Niwa <rniwa@webkit.org>
Crash in render tree after dynamically mutating the slot value
https://bugs.webkit.org/show_bug.cgi?id=167502
Reviewed by Antti Koivisto.
The crash was caused by attributeChanged not destructing the render tree after an assigned element had been
removed from its slot. Since the style resolver can no longer find this element in the flat tree, we need to
delete its render object as if the element had been removed from the DOM tree.
Tests: fast/html/details-summary-slot.html
fast/shadow-dom/shadow-slot-attribute-change-crash.html
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
* html/HTMLSummaryElement.cpp:
(WebCore::SummarySlotElement): Added. Always use the default slot regardless of the slot attribute's value.
(WebCore::HTMLSummaryElement::create): Use SummarySlotElement
2017-02-09 Antti Koivisto <antti@apple.com>
Details element doesn't work correctly when mutating content between closing and opening
https://bugs.webkit.org/show_bug.cgi?id=167310
Reviewed by Ryosuke Niwa.
Tests: fast/html/details-close-modify-open.html
fast/shadow-dom/slot-remove-mutate-add.html
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::didChangeSlot):
Always reset the slot assignment when content is mutated.
2017-02-09 Chris Dumez <cdumez@apple.com>
Crash under FormSubmission::create()
https://bugs.webkit.org/show_bug.cgi?id=167200
<rdar://problem/30096323>
Reviewed by Darin Adler.
The issue is that FormSubmission::create() was iterating over
form.associatedElements() as was calling Element::appendFormData()
in the loop. HTMLObjectElement::appendFormData() was calling
pluginWidget(PluginLoadingPolicy::Load) which causes a synchronous
layout and can fire events (such as focus event) synchronously.
Firing those events synchronously allows the JS to modify the
form.associatedElements() vector we are currently iterating on.
To avoid this issue, we now call pluginWidget(PluginLoadingPolicy::DoNotLoad)
in HTMLObjectElement::appendFormData() as we are not allowed to fire
synchronous events at this point. I also added a security assertion
in FormSubmission::create() to catch cases where we fire JS events
while iterating over the form associated elements to more easily
notice these things in the future.
Test: fast/forms/formsubmission-appendFormData-crash.html
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::appendFormData):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
2017-02-09 Chris Dumez <cdumez@apple.com>
Crash under HTMLFormElement::registerFormElement()
https://bugs.webkit.org/show_bug.cgi?id=167162
Reviewed by Ryosuke Niwa.
didMoveToNewDocument() was re-registering FormAttributeTargetObserver
even if the element's inDocument was not set yet. As a result, it was
possible for FormAssociatedElement::resetFormOwner() to be called
when the element was in the tree but with its inDocument still being
false (because insertedInto() has not been called yet). This could
end up calling HTMLFormElement::registerFormElement() even though
the element is still recognized as detached. This is an issue because
HTMLFormElement::m_associatedElements's order and its corresponding
indexes (m_associatedElementsBeforeIndex / m_associatedElementsAfterIndex)
rely on the position of the element with regards to the form element
(before / inside / after).
To address the issue, we now only register the FormAttributeTargetObserver
in didMoveToNewDocument() if the inDocument flag is set to true. This
is similar to what is done at other call sites of
resetFormAttributeTargetObserver(). We also ignore the form content
attribute in HTMLFormElement::formElementIndex() if the element is
not connected.
As per the HTML specification [1], the form content attribute is only
taken if the element is connected (i.e. inDocument flag is true).
Note that FormAssociatedElement::findAssociatedForm() was already
ignoring the form content attribute if the element is disconnected.
[1] https://html.spec.whatwg.org/#reset-the-form-owner (step 3)
Test: fast/forms/registerFormElement-crash.html
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
Only call resetFormAttributeTargetObserver() if inDocument flag is set,
similarly to what is done at other call sites.
(WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
Add an assertion to make sure no one call this method on an element that
is not connected.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formElementIndex):
Ignore the form content attribute if the element is not connected, as
per the HTML specification [1].
2017-02-09 Antti Koivisto <antti@apple.com>
Tear down existing renderers when adding a shadow root.
https://bugs.webkit.org/show_bug.cgi?id=167117
Reviewed by Andreas Kling.
Adding a shadow root may cause children no longer be part of the flat tree. If they had renderers
tear down code would no longer reach them.
Test: fast/shadow-dom/attach-shadow-teardown.html
* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
Tear down existing render tree when adding a shadow root.
2017-02-09 Brent Fulgham <bfulgham@apple.com>
Handle synchronous layout when setting a selection range
https://bugs.webkit.org/show_bug.cgi?id=167092
<rdar://problem/30041640>
Reviewed by Antti Koivisto.
The 'innerTextElement' of a form control can change during layout due
to arbitrary JavaScript executing. Handle the case where the inner text
element has changed so that current render box height is while setting
a selection range.
Test: fast/forms/input-type-change-during-selection.html
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
2017-02-09 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2017-02-09 Brent Fulgham <bfulgham@apple.com>
Disconnect shadow children of root when detaching a frame
https://bugs.webkit.org/show_bug.cgi?id=166851
<rdar://problem/29930443>
Reviewed by Andy Estes.
If the root of the tree we are disconnecting has a shadow element, include it in the set of
things to disconnect.
Tests: fast/shadow-dom/shadow-at-root-during-disconnect.html
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::disconnectSubframes):
2017-02-09 Alexey Proskuryakov <ap@apple.com>
Remove unused WebThreadRunSync
https://bugs.webkit.org/show_bug.cgi?id=168024
Reviewed by Tim Horton.
* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/ios/wak/WebCoreThreadRun.h:
* platform/ios/wak/WebCoreThreadSystemInterface.cpp:
(InitWebCoreThreadSystemInterface):
2017-02-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r211802.
This change caused fast/regions/inline-block-inside-anonymous-
overflow-with-covered-controls.html to be a flaky failure.
Reverted changeset:
"[Modern Media Controls] Improve handling of <video> with only
audio tracks"
https://bugs.webkit.org/show_bug.cgi?id=167836
http://trac.webkit.org/changeset/211802
2017-02-09 Alex Christensen <achristensen@webkit.org>
Fix i386 libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=168038
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
DataChannelInterface::buffered_amount returns a uint64_t, and we want a size_t.
If this overflows, then we've run out of memory and crashed a long time ago.
2017-02-09 Andreas Kling <akling@apple.com>
Document::settings() should return a const Settings&.
<https://webkit.org/b/168061>
Reviewed by Geoffrey Garen.
- Make Document::settings() return a const reference.
- Added Document::mutableSettings() for all your non-const needs.
- Fixed up settings generator to produce const getters.
- Simplify a few settings() call sites that exposed themselves.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::shouldDiscloseApplePayCapability):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::canCallGetUserMedia):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources):
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/StyleResolver.h:
(WebCore::StyleResolver::settings):
* dom/Document.h:
(WebCore::Document::settings):
(WebCore::Document::mutableSettings):
* html/FTPDirectoryDocument.cpp:
(WebCore::createTemplateDocumentData):
* html/HTMLCanvasElement.cpp:
(WebCore::shouldEnableWebGL):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::updateDuringParsing):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
* page/make_settings.pl:
(printGetterAndSetter):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
2017-02-09 Jer Noble <jer.noble@apple.com>
Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
https://bugs.webkit.org/show_bug.cgi?id=168051
Reviewed by Eric Carlson.
Modify all the functions which take a (conceptually) read-only audio buffer const-correct.
Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
SetForScope.
* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::copyFrom):
* platform/audio/mac/AudioSampleBufferList.h:
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
* platform/audio/mac/AudioSampleDataSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2017-02-09 Jer Noble <jer.noble@apple.com>
Fix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=168063
Reviewed by Eric Carlson.
Make the format string match the types passed in (i.e., floats, not strings).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):
2017-02-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
https://bugs.webkit.org/show_bug.cgi?id=168060
Reviewed by Jer Noble.
No new tests, this avoids an occasional crash on the bots.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Don't assume
m_sampleBufferDisplayLayer is valid.
2017-02-09 Chris Dumez <cdumez@apple.com>
Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
https://bugs.webkit.org/show_bug.cgi?id=167964
Reviewed by Youenn Fablet.
Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
after the following WebIDL spec change:
- https://github.com/heycam/webidl/issues/96
This aligns our behavior with other browsers as the spec has been updated to match
the majority.
No new tests, rebaselined existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterfaceConstructor::prototypeForStructure):
2017-02-09 Miguel Gomez <magomez@igalia.com>
[GTK] scroll with transparent background not repainted after scrollY >= 32768
https://bugs.webkit.org/show_bug.cgi?id=154283
Reviewed by Carlos Garcia Campos.
Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
not able to draw anything when using transformation matrices with values bigger than 32768. When
drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
draw anything in, which causes the reported transparent backgrounds.
The patch modifies the transformation matrices both from the current context and the pattern we
are painting, to avoid them to hold values that cannot stored in 16 bits.
There's still the possibility that this happens, but it would require using a pattern with a size
bigger than 32768.
Based on a previous patch by Gwang Yoon Hwang <yoon@igalia.com>.
No new tests.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::drawPatternToCairoContext):
2017-02-09 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r211965.
* dom/Document.cpp:
(WebCore::Document::adoptNode): inDocument -> isConnected
2017-02-09 Ryosuke Niwa <rniwa@webkit.org>
Adopting a child node of a script element can run script
https://bugs.webkit.org/show_bug.cgi?id=167318
Reviewed by Darin Adler.
The bug was caused by ScriptElement::childrenChanged indiscriminately running the script.
Do this only if some node has been inserted as spec'ed:
https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model
"The script element is connected and a node or document fragment is inserted into
the script element, after any script elements inserted at that time."
Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate
non-contents child such as text and element being removed or inserted. New behavior matches that of
Gecko and Chrome as well as the latest HTML5 specification.
Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees
internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII
object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's
ensureCustomFontData used to completely disable this assertion but we no longer have to do this either.
To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with
the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks
isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent
held by EventAllowedScope.
Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed
Tests: fast/html/script-must-not-run-when-child-is-adopted.html
fast/html/script-must-not-run-when-child-is-removed.html
* dom/CharacterData.cpp:
(WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded
and insertBeforeCommon as done elsewhere.
(WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here.
(WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion.
(WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion.
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into
NoEventDispatchAssertion.
(WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely.
(WebCore::dispatchChildRemovalEvents): Ditto.
* dom/ContainerNode.h:
(WebCore::ContainerNode::ChildChange::isInsertion): Added.
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against
insertionPoint since EventAllowedScope checks against the root node.
* dom/Document.cpp:
(WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else
remove() had resulted in an exception before calling TreeScope::adoptIfNeeded.
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
* dom/NoEventDispatchAssertion.h:
(WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node.
If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider
the event dispatch to be forbidden.
(WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted.
(WebCore::NoEventDispatchAssertion::restoreDropped): Deleted.
(WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of
a given node as "safe" for the purpose of checking isEventDispatchForbidden.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain
of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated
RAII object, and each instance remembers prior instance.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given
node is a descendent of any node held by instances of EventAllowedScope.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function
for isAllowedNode.
* dom/Node.cpp:
(WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes.
(WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running
arbitrary author scripts can, indeed, result dispatch any events.
* dom/ScriptElement.h:
* html/HTMLElement.cpp:
(WebCore::textToFragment): Made this a static local function and not return an exception since there
is no way appendChild called in this function can throw an exception.
(WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by
HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on
a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts.
Because of the precise-ness of this check, this does not disable the assertion for "this" element.
HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark
the shadow tree into which the fragment is inserted safe.
(WebCore::HTMLElement::setOuterText):
* html/HTMLElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::childrenChanged):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText).
* html/track/VTTCue.cpp:
(WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since
the VTT tree is never exposed to author scripts.
(WebCore::VTTCue::updateDisplayTree): Ditto.
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on
the new SVG document we just created instead of disabling for all DOM trees.
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::childrenChanged):
2017-02-09 Andreas Kling <akling@apple.com>
Document should always have a Settings.
<https://webkit.org/b/120172>
Reviewed by Antti Koivisto.
Since a Document can't move between Frames, and it's either frameless
or partnered with a Frame provided at construction time, we know that
it will never need to switch between different Settings objects either.
Give Document a Ref<Settings> that contains either the Frame's Settings
or a default-constructed Settings object if frameless.
Document::settings() is promoted to a reference getter.
The bulk of this patch is removing now-unnecessary null checks.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::isEnabledBySettings):
* Modules/plugins/QuickTimePluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::isEnabledBySettings):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::isEnabledBySettings):
* Modules/plugins/YouTubePluginReplacement.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestScriptWithCache):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources):
(WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fallbackFontCount):
(WebCore::CSSFontSelector::fallbackFontAt):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertResize):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontFamily):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::defaultStyleForElement):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::checkForGenericFamilyChange):
(WebCore::StyleResolver::initializeFontStyle):
* css/StyleResolver.h:
(WebCore::StyleResolver::settings):
(WebCore::StyleResolver::documentSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setReadyState):
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::defaultCharsetForLegacyBindings):
(WebCore::Document::recalcStyle):
(WebCore::Document::implicitClose):
(WebCore::Document::minimumLayoutDelay):
(WebCore::Document::setDomain):
(WebCore::Document::audioPlaybackRequiresUserGesture):
(WebCore::Document::videoPlaybackRequiresUserGesture):
(WebCore::Document::storageBlockingStateDidChange):
(WebCore::Document::isTelephoneNumberParsingEnabled):
(WebCore::Document::initSecurityContext):
(WebCore::Document::initDNSPrefetch):
(WebCore::Document::getCachedLocale):
(WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox):
(WebCore::Document::settings): Deleted.
* dom/Document.h:
(WebCore::Document::settings):
* dom/Element.cpp:
(WebCore::subpixelMetricsEnabled):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::pageUserSheet):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
* dom/make_names.pl:
(printConstructorInterior):
* editing/Editor.cpp:
* editing/markup.cpp:
(WebCore::createMarkupInternal):
* html/FTPDirectoryDocument.cpp:
(WebCore::createTemplateDocumentData):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setActive):
(WebCore::HTMLAnchorElement::sendPings):
(WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::canEmbedJava):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::shouldEnableWebGL):
(WebCore::HTMLCanvasElement::shouldAccelerate):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submitImplicitly):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::updateImageControls):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::sourceURI):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
(WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
(WebCore::HTMLMediaElement::mediaPlayerNetworkInterfaceName):
(WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
(WebCore::HTMLMediaElement::doesHaveAttribute):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::HTMLVideoElement):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
(WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
(WebCore::MediaElementSession::allowsPictureInPicture):
(WebCore::MediaElementSession::maximumMediaSourceBufferSize):
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize):
(WebCore::Style::fontSizeForKeyword):
(WebCore::Style::legacyFontSizeForPixelSize):
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):
2017-02-09 Antti Koivisto <antti@apple.com>
Use all cacheable speculatively loaded responses
https://bugs.webkit.org/show_bug.cgi?id=168052
Reviewed by Andreas Kling.
* platform/network/CacheValidation.cpp:
(WebCore::isStatusCodeCacheableByDefault):
(WebCore::isStatusCodePotentiallyCacheable):
Moved here from WebKit2.
* platform/network/CacheValidation.h:
2017-02-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
https://bugs.webkit.org/show_bug.cgi?id=168016
Reviewed by Youenn Fablet.
No new tests, existing tests updated.
* WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
* DerivedSources.make: Ditto.
* CMakeLists.txt: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* WebCore.xcodeproj/project.pbxproj:
* page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
2017-02-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear
https://bugs.webkit.org/show_bug.cgi?id=168049
<rdar://problem/30442660>
Reviewed by Eric Carlson.
Calling elementAtPoint() on the Document will not return an element in the ShadowRoot,
we need to call it on the ShadowRoot. So we now iterate over ancestors of the controls
bar to find the ShadowRoot, if any, and check whether the tapped element is contained
within the controls bar. We only fade the controls bar out if the tapped element is
outside of the controls bar hierarchy.
Test: media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.gestureRecognizerStateDidChange):
2017-02-09 Jer Noble <jer.noble@apple.com>
Configure MockRealtimeAudioSourceMac to generate stereo audio
https://bugs.webkit.org/show_bug.cgi?id=168027
Reviewed by Eric Carlson.
Update MockRealtimeAudioSourceMac to generate stereo audio.
First, because the pattern of creating a AudioBufferList structure (with all it's quirks and
weird requirements) was repeated multiple places, add a new wrapper around ABL called
WebAudioBufferList which takes care of correctly initializing the ABL structure and manages
the lifetime of its data members.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/PlatformAudioData.h: Added.
(WebCore::PlatformAudioData::kind):
* platform/audio/WebAudioBufferList.cpp: Added.
(WebCore::WebAudioBufferList::WebAudioBufferList):
(WebCore::WebAudioBufferList::buffers):
(WebCore::WebAudioBufferList::bufferCount):
(WebCore::WebAudioBufferList::buffer):
* platform/audio/WebAudioBufferList.h: Added.
(WebCore::WebAudioBufferList::list):
(WebCore::WebAudioBufferList::operator AudioBufferList&):
(WebCore::WebAudioBufferList::kind):
(isType):
Then update existing code to work in terms of WebAudioBufferList:
* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::AudioSampleBufferList):
(WebCore::AudioSampleBufferList::mixFrom):
(WebCore::AudioSampleBufferList::copyFrom):
(WebCore::AudioSampleBufferList::copyTo):
(WebCore::AudioSampleBufferList::reset):
(WebCore::AudioSampleBufferList::configureBufferListForStream): Deleted.
* platform/audio/mac/AudioSampleBufferList.h:
(WebCore::AudioSampleBufferList::bufferList):
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamples):
* platform/audio/mac/AudioSampleDataSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
Finally, actually update MockRealtimeAudioSource to emit stereo samples. Importantly, set
the correct values for the m_streamFormat; mBytesPerFrame and mBytesPerPacket are not
multiplied by the channelCount. When generating audio, write to both channels of data.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
(WebCore::MockRealtimeAudioSourceMac::reconfigure):
(WebCore::MockRealtimeAudioSourceMac::render):
2017-02-09 Antti Koivisto <antti@apple.com>
Nullptr crash under styleForFirstLetter
https://bugs.webkit.org/show_bug.cgi?id=167756
rdar://problem/30029354
Reviewed by Zalan Bujtas.
Don't know how we get here. Paper over the crash.
* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):
Use parent first line style if we compute null style for the first letter renderer.
2017-02-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear
https://bugs.webkit.org/show_bug.cgi?id=168047
<rdar://problem/30441939>
Reviewed by Eric Carlson.
The controls bar auto-hide behavior is disabled for <audio> elements, but on iOS we have
a TapGestureRecognizer to identify when controls are tapped to toggle controls visibility.
This gesture recognizer would be on at all times, but it should only be enabled when
fadesToIdle is set to true.
Test: media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set fadesWhileIdle):
2017-02-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] <audio> element does not show any background on iOS
https://bugs.webkit.org/show_bug.cgi?id=168046
<rdar://problem/30441872>
Reviewed by Eric Carlson.
Use a solid gray background for <audio> elements on iOS.
Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(:host(audio) .media-controls.ios.inline > .controls-bar:before):
2017-02-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls fail to instantiate in an XHTML document
https://bugs.webkit.org/show_bug.cgi?id=168045
<rdar://problem/30290095>
Reviewed by Eric Carlson.
Always use valid HTML and XHTML strings when creating HTML elements.
Test: media/modern-media-controls/media-controller/media-controller-in-xhtml.xhtml
* Modules/modern-media-controls/controls/button.js:
(Button):
* Modules/modern-media-controls/controls/buttons-container.js:
* Modules/modern-media-controls/controls/controls-bar.js:
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
* Modules/modern-media-controls/controls/media-controls.js:
* Modules/modern-media-controls/controls/slider.js:
* Modules/modern-media-controls/controls/status-label.js:
* Modules/modern-media-controls/controls/time-control.js:
* Modules/modern-media-controls/controls/time-label.js:
* Modules/modern-media-controls/controls/tracks-panel.js:
2017-02-09 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix typo in comment
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocument):
2017-02-09 Andreas Kling <akling@apple.com>
Disallow accelerated rendering for ginormous 2D canvases.
<https://webkit.org/b/167968>
<rdar://problem/30119483>
Reviewed by Antti Koivisto.
Add a "maximumAccelerated2dCanvasSize" setting that defaults to 5120x2880
which is the 5K resolution for 16:9.
Also added a way to include the "accelerates drawing" flag in layer tree dumps.
Test: compositing/canvas/accelerated-canvas-compositing-size-limit.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::shouldAccelerate):
* page/Frame.h:
* page/Settings.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayerClient.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-09 Antti Koivisto <antti@apple.com>
Remove most cases of #if ENABLE(CACHE_PARTITIONING)
https://bugs.webkit.org/show_bug.cgi?id=167990
Reviewed by Sam Weinig.
We'll just return empty string for the partition if partitioning is not enabled.
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::url):
(WebCore::CachedResource::cachePartition):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setDomainForCachePartition):
* loader/cache/CachedResourceRequest.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequestImpl):
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::removeResourcesWithOrigin):
(WebCore::MemoryCache::removeResourcesWithOrigins):
(WebCore::MemoryCache::getOriginsWithCache):
(WebCore::MemoryCache::originsWithCache):
* loader/cache/MemoryCache.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::domainForCachePartition):
* page/SecurityOrigin.h:
* platform/SchemeRegistry.cpp:
(WebCore::cachePartitioningSchemes):
(WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
* platform/SchemeRegistry.h:
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
(WebCore::ResourceRequestBase::setCachePartition):
(WebCore::ResourceRequestBase::partitionName):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::cachePartition):
(WebCore::ResourceRequestBase::setDomainForCachePartition):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::cachePartition): Deleted.
(WebCore::ResourceRequest::setCachePartition): Deleted.
(WebCore::ResourceRequest::setDomainForCachePartition): Deleted.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::partitionName): Deleted.
(WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): Deleted.
* platform/network/cf/ResourceResponse.h:
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
2017-02-09 Ryosuke Niwa <rniwa@webkit.org>
Add Web Bluetooth as Not Considering
https://bugs.webkit.org/show_bug.cgi?id=168042
Reviewed by Yusuke Suzuki.
Add Web Bluetooth as a feature not being considered to be implemented in WebKit.
* features.json:
2017-02-08 Simon Fraser <simon.fraser@apple.com>
Put names on more UIViews for ease of debugging
https://bugs.webkit.org/show_bug.cgi?id=168035
Reviewed by Tim Horton.
Name the page overlay layers.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::createRootLayersIfNeeded):
(WebCore::PageOverlayController::installPageOverlay):
2017-02-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211912.
https://bugs.webkit.org/show_bug.cgi?id=168034
http/tests/media/media-stream/disconnected-frame-permission-
denied.html should be updated (Requested by youenn on
#webkit).
Reverted changeset:
"[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
https://bugs.webkit.org/show_bug.cgi?id=168016
http://trac.webkit.org/changeset/211912
2017-02-08 Youenn Fablet <youennf@gmail.com>
HTML Link elements should load data URLs as same origin
https://bugs.webkit.org/show_bug.cgi?id=168032
<rdar://problem/30275036>
Reviewed by Alex Christensen.
Test: fast/dom/data-url-css-link-element-cors-active.html
Making CSS data URLs resources considered as same origin when loaded through link elements.
In the future, we should consider remove the data URL same origin flag and fully align with the fetch and HTML spec.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
2017-02-08 Sam Weinig <sam@webkit.org>
REGRESSION (r193286): Promise chain no longer prevent UI refresh
<rdar://problem/28062149>
https://bugs.webkit.org/show_bug.cgi?id=161291
Reviewed by Geoffrey Garen.
Add new subtest to js/dom/Promise.html
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::append):
(WebCore::MicrotaskQueue::remove):
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* dom/Microtasks.h:
The microtask queue needs to be completely drained, even of new microtasks added while
the previous task was run. Remove the m_tasksAppendedDuringMicrotaskCheckpoint as it is
no longer needed.
2017-02-08 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
https://bugs.webkit.org/show_bug.cgi?id=168016
Reviewed by Youenn Fablet.
No new tests, existing tests updated.
* WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
* DerivedSources.make: Ditto.
* CMakeLists.txt: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* WebCore.xcodeproj/project.pbxproj:
* page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.
2017-02-08 Chris Dumez <cdumez@apple.com>
Use smaller tiles in windows that are not active to facilitate App Napping
https://bugs.webkit.org/show_bug.cgi?id=167997
<rdar://problem/30358835>
Reviewed by Simon Fraser.
Use smaller / non-adaptative tiles in windows that are not active to facilitate
App Napping after <https://trac.webkit.org/r197594>.
Test: compositing/tiling/non-active-window-tiles-size.html
* page/FrameView.cpp:
(WebCore::FrameView::contentsResized):
(WebCore::FrameView::addedOrRemovedScrollbar):
(WebCore::FrameView::computeScrollability):
(WebCore::FrameView::updateTiledBackingAdaptiveSizing):
(WebCore::FrameView::unobscuredContentSizeChanged):
(WebCore::FrameView::setViewExposedRect):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::setActivityState):
(WebCore::Page::isWindowActive):
* page/Page.h:
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setTileSizeUpdateDelayDisabledForTesting):
(WebCore::TileController::notePendingTileSizeChange):
* platform/graphics/ca/TileController.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::disableTileSizeUpdateDelay):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-08 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r211907.
Broke the build
Reverted changeset:
"[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
https://bugs.webkit.org/show_bug.cgi?id=168016
http://trac.webkit.org/changeset/211907
2017-02-08 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
https://bugs.webkit.org/show_bug.cgi?id=168016
Reviewed by Youenn Fablet.
No new tests, existing tests updated.
* WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
* DerivedSources.make: Ditto.
* CMakeLists.txt: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* WebCore.xcodeproj/project.pbxproj:
2017-02-08 Wenson Hsieh <wenson_hsieh@apple.com>
Add kUTTypeUTF8PlainText and kUTTypeJPEG to the list of compatible content types in DragData
https://bugs.webkit.org/show_bug.cgi?id=167942
<rdar://problem/30315079>
Reviewed by Tim Horton.
Adds UTI types for dragging UTF8 plain text and JPEG images to the list of supported types in DragDataMac.mm.
Also handles reading these types in PasteboardMac.mm. I verified manually with a test app that if a platform
NSView vends only UTF8 plaintext or JPEG images when dragging, WebKit is able to read the contents of the
pasteboard as text and an image, respectively.
New TestWebKitAPI tests in DragAndDropPasteboardTests.mm.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsCompatibleContent):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
2017-02-08 Said Abou-Hallawa <sabouhallawa@apple.com>
getIntersectionList always returns empty NodeList until layout is complete
https://bugs.webkit.org/show_bug.cgi?id=81423
Reviewed by Simon Fraser.
Layout needs to be forced before trying to figure out which SVGElements
intersect with a given SVGRect. We do the same thing in the DOM API
Element::getBoundingClientRect().
Test: svg/custom/intersection-list-before-layout.html
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getIntersectionList):
2017-02-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Implement reduced and tight padding modes
https://bugs.webkit.org/show_bug.cgi?id=167933
<rdar://problem/30396994>
Reviewed by Dean Jackson.
The design specs for modern media controls mandate the following for inline media controls:
- controls at or below 300pt width use a 12pt left margin for the left buttons container,
and a 12pt right margin for the right buttons container, and 16pth button margin inside
both containers ("reduced padding mode").
- when dropping at or below 120pt width, controls use an 8pt left margin for
the left buttons container, and an 8pt right margin for the right buttons container, and
12pt button margin inside both containers and a shorter bar (25pt) ("compact mode").
- in the case of audio controls, at 400pt or less, controls switch to 12pt margins and
button margins for both buttons containers ("tight padding mode").
The "compact" mode was already implemented as a dedicated MacOSInlineMediaControls subclass.
Since we now have a more generic need to vary the metrics used for inline media controls on
macOS, we add new features to MacOSInlineMediaControls to support varying metrics based on
the controls' "layoutTraits" property.
So MediaController is changed such that it knows to use the new TightPadding and ReducedPadding
layout traits based on the conditions defined above, and _updateControlsIfNeeded() is changed
to set the "layoutTraits" property on the controls whenever called, which in our case is most
relevantly a "resize" event on the shadow root or a TrackEvent on the video tracks (to determine
when we're possibly changing between a video and audio file).
As a result, the "layoutTraits" setter is called on MacOSInlineMediaControls, which updates
the metrics for the various buttons containers, but also notifies the buttons contained
within that layout traits may have changed, since some buttons support a "compact" appearance
that is shorter and require a different image file. To that end, IconButton has been updated
so that it may be notified of a layout traits change through a new layoutTraitsDidChange()
method, that checks whether the current layout traits differ from those last used when loading
the icon.
Tests: media/modern-media-controls/icon-button/icon-button-change-layout-traits.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html
media/modern-media-controls/media-controller/media-controller-compact.html
media/modern-media-controls/media-controller/media-controller-reduced-padding.html
media/modern-media-controls/media-controller/media-controller-tight-padding.html
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.set iconName):
(IconButton.prototype.layoutTraitsDidChange):
(IconButton.prototype._loadImage):
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.js: Removed.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.get layoutTraits):
(MacOSInlineMediaControls.prototype.set layoutTraits):
(MacOSInlineMediaControls.prototype._matchLayoutTraits):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._controlsClassForLayoutTraits):
(MediaController.prototype._shouldFadeBetweenControls): Deleted.
(MediaController.prototype._controlsClass): Deleted.
* WebCore.xcodeproj/project.pbxproj:
2017-02-08 Aakash Jain <aakash_jain@apple.com>
Move private methods from WKGraphics.h to a separate header file
https://bugs.webkit.org/show_bug.cgi?id=167996
Reviewed by Alexey Proskuryakov.
* platform/ios/wak/WKGraphicsInternal.h: Added.
* WebCore.xcodeproj/project.pbxproj: Added WKGraphicsInternal.h
* platform/ios/wak/WKGraphics.h: Moved methods to WKGraphicsInternal.h
* platform/graphics/mac/GraphicsContextMac.mm: Included new header file.
* platform/ios/wak/WKGraphics.mm: Same.
2017-02-08 Brady Eidson <beidson@apple.com>
Opt-out iBooks from synchronous willSendRequest on iOS.
<rdar://problem/30129966> and https://bugs.webkit.org/show_bug.cgi?id=168006
Reviewed by Brent Fulgham.
No new tests (Not a testable behavior change at this time).
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::synchronousWillSendRequestEnabled): iBooks never gets synchronous willSendRequest:
2017-02-08 Sam Weinig <sam@webkit.org>
Split JSDOMConstructor.h/cpp up by class
https://bugs.webkit.org/show_bug.cgi?id=167958
Reviewed by Tim Horton.
Splits JSDOMConstructor up by class.
- Renames DOMConstructorObject to JSDOMConstructorBase.
- Renames DOMConstructorWithDocument to JSDOMConstructorWithDocument.
- Renames DOMConstructorJSBuiltinObject to JSDOMBuiltinConstructorBase.
- Renames JSBuiltinConstructor to JSDOMBuiltinConstructor.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add new files.
* bindings/js/JSDOMBinding.h:
(WebCore::propertyNameToString): Deleted.
(WebCore::propertyNameToAtomicString): Deleted.
* bindings/js/JSDOMBuiltinConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMBuiltinConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
* bindings/js/JSDOMBuiltinConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConstructor.cpp: Removed.
* bindings/js/JSDOMConstructor.h: Remove all classes other than JSDOMConstructor.
* bindings/js/JSDOMConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
* bindings/js/JSDOMConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConstructorNotConstructable.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConstructorWithDocument.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
* bindings/js/JSDOMConstructorWithDocument.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMNamedConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConvertStrings.h:
(WebCore::propertyNameToString):
(WebCore::propertyNameToAtomicString):
Move these here from JSDOMBinding.
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
* bindings/js/JSStorageCustom.cpp:
* bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
(WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/scripts/CodeGeneratorJS.pm:
(GetConstructorTemplateClassName):
(GenerateConstructorDeclaration):
Update includes/names.
* dom/StaticRange.cpp:
(WebCore::StaticRange::~StaticRange):
* dom/StaticRange.h:
Add out-of-line destructor, so Node.h does not have to be included.
2017-02-08 Joseph Pecoraro <pecoraro@apple.com>
Initialize the main RunLoop in iOS WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=167953
Reviewed by Alexey Proskuryakov.
* platform/ios/wak/WebCoreThread.mm:
(StartWebThread):
Initialize the main runloop on the main thread during iOS WebKit initialization.
2017-02-08 Aakash Jain <aakash_jain@apple.com>
Move private methods from WKContentObservation.h to a separate header file
https://bugs.webkit.org/show_bug.cgi?id=167998
Reviewed by Alexey Proskuryakov.
* WebCore.xcodeproj/project.pbxproj: Added WKContentObservationInternal.h
* platform/ios/wak/WKContentObservationInternal.h: Added.
* platform/ios/wak/WKContentObservation.h: Moved methods to WKContentObservationInternal.h
* platform/ios/wak/WKContentObservation.cpp: Included new header file.
* page/DOMTimer.cpp: Same.
* page/DOMWindow.cpp: Same.
* style/RenderTreeUpdater.cpp: Same.
2017-02-08 Youenn Fablet <youenn@apple.com>
RTCPeerConnection constructor can take null as input
https://bugs.webkit.org/show_bug.cgi?id=167992
Reviewed by Chris Dumez.
Covered by updated test.
RTCPeerConnection takes an optional Dictionary as input.
As per https://heycam.github.io/webidl/#es-dictionary, null is converted to an empty dictionary.
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
2017-02-08 Andreas Kling <akling@apple.com>
No need for CachedFrame to detach custom scrollbars.
<https://webkit.org/b/167995>
Reviewed by Sam Weinig.
Custom scrollbars have already been torn down with the rest of the render tree
by the time we're creating a CachedFrame.
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
2017-02-08 Zalan Bujtas <zalan@apple.com>
Simple line layout: Fix printReason for unsupported overflow values.
https://bugs.webkit.org/show_bug.cgi?id=168000
Reviewed by Simon Fraser.
Not testable.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):
2017-02-08 Aakash Jain <aakash_jain@apple.com>
Remove WebCoreObjCDeallocWithWebThreadLock from header file
https://bugs.webkit.org/show_bug.cgi?id=167987
Reviewed by Alexey Proskuryakov.
* platform/ios/wak/WebCoreThread.mm: Added WebCoreObjCDeallocWithWebThreadLock.
* platform/ios/wak/WebCoreThreadMessage.h: Removed WebCoreObjCDeallocWithWebThreadLock.
2017-02-08 Aakash Jain <aakash_jain@apple.com>
Move WKMouseInRect to WAKView.mm
https://bugs.webkit.org/show_bug.cgi?id=167989
Reviewed by Alexey Proskuryakov.
* platform/ios/wak/WAKAppKitStubs.h: Removed WKMouseInRect.
* platform/ios/wak/WAKAppKitStubs.m:
(WKMouseInRect): Deleted.
* platform/ios/wak/WAKView.mm:
(-[WAKView mouse:inRect:]): Added the logic of WKMouseInRect here instead of separate function call.
2017-02-08 Aakash Jain <aakash_jain@apple.com>
Remove unused method WebCore::PluginData::pluginNameForMimeType
https://bugs.webkit.org/show_bug.cgi?id=167986
Reviewed by Anders Carlsson.
* plugins/PluginData.cpp:
(WebCore::PluginData::pluginNameForWebVisibleMimeType): Deleted.
* plugins/PluginData.h: Removed pluginNameForWebVisibleMimeType.
2017-02-08 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Fix translatable form validation messages
https://bugs.webkit.org/show_bug.cgi?id=167984
Reviewed by Michael Catanzaro.
Most of them are just wrong. Use the same mesages than mac, which also makes some tests pass.
Fixes: fast/forms/validation-message-maxLength.html
fast/forms/validationMessage.html
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::validationMessageValueMissingText):
(WebCore::validationMessageValueMissingForCheckboxText):
(WebCore::validationMessageValueMissingForFileText):
(WebCore::validationMessageValueMissingForMultipleFileText):
(WebCore::validationMessageValueMissingForRadioText):
(WebCore::validationMessageValueMissingForSelectText):
(WebCore::validationMessageTypeMismatchText):
(WebCore::validationMessageTypeMismatchForEmailText):
(WebCore::validationMessageTypeMismatchForMultipleEmailText):
(WebCore::validationMessageTypeMismatchForURLText):
(WebCore::validationMessagePatternMismatchText):
(WebCore::validationMessageTooShortText):
(WebCore::validationMessageTooLongText):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::validationMessageStepMismatchText):
(WebCore::validationMessageBadInputForNumberText):
2017-02-08 Chris Dumez <cdumez@apple.com>
Add support for enhanced privacy diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167948
<rdar://problem/30385112>
Reviewed by Antti Koivisto.
Add new logDiagnosticMessageWithEnhancedPrivacy() method to DiagnosticLoggingClient
that is used for enhanced privacy logging. Start using this new API to log domains
that are visited.
* loader/EmptyClients.cpp:
* loader/FrameLoader.cpp:
(WebCore::logNavigation):
(WebCore::FrameLoader::loadWithDocumentLoader):
* page/DiagnosticLoggingClient.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::domainVisitedKey):
* page/DiagnosticLoggingKeys.h:
2017-02-08 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Critical warnings when media player is destroyed
https://bugs.webkit.org/show_bug.cgi?id=167981
Reviewed by Xabier Rodriguez-Calvar.
It can happen that the source doesn't have a parent when we try to disconnect the element-added signal.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
2017-02-08 Miguel Gomez <magomez@igalia.com>
[GTK] Reduce TiledBackingStore tile coverage when on memory pressure state
https://bugs.webkit.org/show_bug.cgi?id=167980
Reviewed by Carlos Garcia Campos.
Use a smaller coverAreaMultiplier in the TiledBackingStore when in memory pressure situation, to reduce
the amount of tiles created.
No new tests.
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::createTilesIfNeeded):
(WebCore::TiledBackingStore::createTiles):
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
2017-02-08 Zan Dobersek <zdobersek@igalia.com>
[EME] Implement MediaKeySession::remove()
https://bugs.webkit.org/show_bug.cgi?id=167870
Reviewed by Xabier Rodriguez-Calvar.
Implement MediaKeySession::remove() as outlined in the specification.
The CDMInstance::removeSessionData() virtual method is added. CDMInstance
implementors should remove any session data stored for the session that's
represented by the passed-in session ID and session type.
Once the session data is removed, the passed-in callback should be invoked
by the CDMInstance object so that MediaKeySession can immediately queue a
task in which it updates key statuses and expiration, reject the promise if
the data removal failed, or enqueue any license-release message and finally
successfully resolve the promise.
MockCDMFactory gains the removeKeysFromSessionWithID() method that purges
the keys for a given session ID. The method is called from
MockCDMInstance::removeSessionData() implementation, which passes the
removed keys to the RemoveSessionDataCallback, along with a license-release
message that is checked in the tests. The key removal itself isn't tested
yet because the MediaKeySession's `update key statuses` algorithm isn't
implemented yet.
Test: media/encrypted-media/mock-MediaKeySession-remove.html
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::remove):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::removeKeysFromSessionWithID):
(WebCore::MockCDMInstance::removeSessionData):
* testing/MockCDMFactory.h:
2017-02-08 Zan Dobersek <zdobersek@igalia.com>
[EME] Implement MediaKeySession::close()
https://bugs.webkit.org/show_bug.cgi?id=167869
Reviewed by Xabier Rodriguez-Calvar.
Implement MediaKeySession::close() as outlined in the specification.
The CDMInstance::closeSession() virtual method, when called, should
close the session that's represented by the passed-in session ID on
the CDMInstance implementor object. That's the same session ID that
the CDMInstance object passes to the MediaKeySession class through
the callback that's provided to the updateLicense call.
The CloseSessionCallback, passed to CDMInstance::closeSession(),
should be invoked by the CDMInstance implementor once the session
is closed. When that is invoked, another task is queued for the
MediaKeySession object that runs the `session closed` algorithm
and resolves the promise.
MockCDMInstance::closeSession() is defined to remove the session
from the MockCDMFactory object and invoke the CloseSessionCallback.
Test: media/encrypted-media/mock-MediaKeySession-close.html
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::close):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::closeSession):
* testing/MockCDMFactory.h:
2017-02-08 Zan Dobersek <zdobersek@igalia.com>
[EME] Alias CDMInstance enums to the specification-defined enums
https://bugs.webkit.org/show_bug.cgi?id=167896
Reviewed by Sam Weinig.
Simplify the enums in the CDMInstance class by simply aliasing them
to the EME specification-defined enums. CDMInstance::KeyStatus and
CDMInstance::MessageType were already direct copies of the
MediaKeyStatus and MediaKeyMessageType enums, while the
CDMInstance::LicenseType had the members as MediaKeySessionType,
but with slightly different names.
No changes in behavior.
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::update):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::requestLicense):
2017-02-07 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r210740): [GTK] 2.15 broke embedded videos in GNOME's yelp app
https://bugs.webkit.org/show_bug.cgi?id=167887
Reviewed by Michael Catanzaro.
Update the m_renderingCanBeAccelerated when accelerated rendering state changes.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2017-02-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Handle extended colors in cairo and texture mapper backends
https://bugs.webkit.org/show_bug.cgi?id=167943
Reviewed by Michael Catanzaro.
Fixes: css3/color/backgrounds-and-borders.html
css3/color/box-shadows.html
css3/color/canvas.html
css3/color/composited-solid-backgrounds.html
css3/color/text.html
* platform/graphics/Color.cpp:
(WebCore::premultipliedARGBFromColor): Handle the case of color being extended.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::setSourceRGBAFromColor): Ditto.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::fillRectWithColor): Use isVisible() instead of alpha().
(WebCore::GraphicsContext::drawEllipse): Ditto.
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA): Handle the case of color being extended.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawNumber): Ditto.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::blendWithOpacity): Ditto.
(WebCore::TextureMapperLayer::paintSelf): Use isVisible() instead of alpha().
(WebCore::TextureMapperLayer::computeOverlapRegions): Ditto.
2017-02-07 Wenson Hsieh <wenson_hsieh@apple.com>
WebItemProviderPasteboard should use -registerLoadHandlersToItemProvider: when creating a new UIItemProvider
https://bugs.webkit.org/show_bug.cgi?id=167918
<rdar://problem/30382347>
Reviewed by Tim Horton.
Adopts SPI in WebItemProviderPasteboard for object types that the platform knows how to serialize. Since we use
-createObjectOfClass: to initialize data when reading off of the pasteboard, we need to match the format that
objects conforming to UIItemProviderReading will expect. Thus, for all given objects that conform to
UIItemProviderWriting, we have them register themselves to the item provider.
We register other UTI types due to the fact that PlatformPasteboardIOS does not care about the specific
pasteboard used. This should not be necessary, however, since data written to the WebItemProviderPasteboard
should never need to be read by an actual UIPasteboard. This will be refactored in a future patch to add a
special type of WebItemProviderPasteboard-aware PlatformPasteboard.
Also fixes some reference counting issues in WebItemProviderPasteboard by changing the array of _itemProviders
to be a RetainPtr.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard itemProviders]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard numberOfItems]):
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
(-[WebItemProviderPasteboard dealloc]): Deleted.
2017-02-06 Ryosuke Niwa <rniwa@webkit.org>
WebContent process repeatedly jetsams on BuzzFeed's Another Round page
https://bugs.webkit.org/show_bug.cgi?id=167830
<rdar://problem/30187368>
Reviewed by Simon Fraser.
The jetsams on https://www.buzzfeed.com/anotherround were caused by WebKit creating the backing store
for every iframe's layer on the page regardless of whether they're in the viewport or not.
This was caused by GraphicsLayerCA's setVisibleAndCoverageRects not setting CoverageRectChanged on
m_uncommittedChanges on the very first call. Fixed the bug by initializing m_uncommittedChanges
to always have CoverageRectChanged so that the coverage rect would get updated properly.
Unfortunately, no new tests since somehow the backing store doesn't get created inside the test runner.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA):
2017-02-07 Youenn Fablet <youennf@gmail.com>
[WebRTC] LibWebRTCEndpoint should not own objects that should be destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=167816
Reviewed by Alex Christensen.
Tests: webrtc/libwebrtc/release-while-creating-offer.html
webrtc/libwebrtc/release-while-getting-stats.html
webrtc/libwebrtc/release-while-setting-local-description.html
Moving AV sources, stats promises, ICE candidates from LibWebRTCEndpoint to LibWebRTCPeerConnectionBackend.
This allows ensuring these are destroyed in the main thread.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::getStats):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
(WebCore::LibWebRTCMediaEndpoint::getStats):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(WebCore::LibWebRTCMediaEndpoint::addIceCandidate):
(WebCore::LibWebRTCMediaEndpoint::isStopped):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::~LibWebRTCPeerConnectionBackend):
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::LibWebRTCPeerConnectionBackend::iceCandidateSucceeded):
(WebCore::LibWebRTCPeerConnectionBackend::iceCandidateFailed):
(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::LibWebRTCPeerConnectionBackend::addAudioSource):
(WebCore::LibWebRTCPeerConnectionBackend::addVideoSource):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer):
(WebCore::releaseInNetworkThread):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileCreatingOffer::CreateOffer):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileGettingStats::GetStats):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription):
(WebCore::MockLibWebRTCPeerConnectionReleasedInNetworkThreadWhileSettingDescription::SetLocalDescription):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:
2017-02-07 Myles C. Maxfield <mmaxfield@apple.com>
[Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of ComplexTextController
https://bugs.webkit.org/show_bug.cgi?id=167927
Reviewed by Brent Fulgham.
This patch simply moves some functions around to enable the Win, GTK, and EFL ports to compile the
platform-independent pieces of ComplexTextController. Those parts of ComplexTextController have
some dependencies which were previously only available on the Cocoa ports; however, those
dependencies are easily created or moved from elsewhere. The next step is to populate the
ComplexTextController::collectComplexTextRunsForCharacters() function for DirectWrite and HarfBuzz.
Once that is done, UniscribeController and HarfBuzzShaper can be deleted.
Adds ComplexTextController TestWebKitAPI tests to the Win and GTK ports.
* CMakeLists.txt: Everyone can compile the platform-independent piece of ComplexTextController.
* PlatformEfl.cmake: Add the HarfBuzz-specific piece.
* PlatformGTK.cmake: Ditto.
* PlatformWin.cmake: Add the DirectWrite-specific piece.
* platform/graphics/ComplexTextController.cpp:
(WebCore::TextLayoutDeleter::operator()): ComplexTextController shouldn't be enabled yet for Win,
GTK, or EFL.
(WebCore::FontCascade::createLayout): Ditto.
(WebCore::FontCascade::width): Ditto.
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved shared code to the shared
file.
* platform/graphics/Font.cpp:
(WebCore::Font::noSynthesizableFeaturesFont): Default implementation for other ports.
(WebCore::Font::variantCapsSupportsCharacterForSynthesis): Ditto.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence): Ditto.
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Ditto.
(WebCore::FontCascade::createLayout): Deleted. Moved to ComplexTextController.
(WebCore::TextLayoutDeleter::operator()): Deleted. Ditto.
* platform/graphics/FontCascade.h: fontForCombiningCharacterSequence() should exist on all ports.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Ditto.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Added.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
HarfBuzz-specific piece of ComplexTextController.
* platform/graphics/mac/ComplexTextControllerCoreText.mm: Moved constructors to shared file.
* platform/graphics/win/ComplexTextControllerDirectWrite.cpp: Added.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
Direct Write-specific piece of ComplexTextController.
* platform/graphics/win/FontWin.cpp:
(WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
2017-02-07 Alex Christensen <achristensen@webkit.org>
Revert r166597
https://bugs.webkit.org/show_bug.cgi?id=167951
Reviewed by Andreas Kling.
* platform/spi/cf/CFNetworkSPI.h:
Remove now-unused SPI declaration.
2017-02-07 Sam Weinig <sam@webkit.org>
Try to fix the windows build.
* bindings/js/ReadableStreamDefaultController.cpp:
2017-02-07 Youenn Fablet <youennf@gmail.com>
[WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
https://bugs.webkit.org/show_bug.cgi?id=167939
Reviewed by Sam Weinig.
Test: webrtc/no-port-zero-in-upd-candidates.html
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): Adding a way to create one real PC in WTR environment.
2017-02-07 Sam Weinig <sam@webkit.org>
Update bindings tests results for additional include.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2017-02-07 Sam Weinig <sam@webkit.org>
Try to fix the windows build.
* bindings/js/JSDOMConvertNumbers.h:
2017-02-07 Alex Christensen <achristensen@webkit.org>
Fix libwebrtc build after r211728
https://bugs.webkit.org/show_bug.cgi?id=167821
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::processNewSample):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData): Deleted.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
(WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData): Deleted.
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2017-02-07 Tim Horton <timothy_horton@apple.com>
Remove accidentally-added (in r211409) patch reject file
* bindings/scripts/test/JS/JSTestSerialization.cpp.rej: Removed.
2017-02-07 Sam Weinig <sam@webkit.org>
JSDOMConvert is too big. Split it up!
https://bugs.webkit.org/show_bug.cgi?id=167806
Rubber-stamped by Geoff Garen.
Split JSDOMConvert up roughly by IDL type. Some are grouped for convenience, e.g. all the
string types are together, all the numeric types are together. Also moved helpers from
JSDOMBinding to their respective JSDOMConvertFoo header. For now, JSDOMConvert.h as an
umbrella of all the sub headers, but it will be removed, and the code generator taught
to include the right header in a subsequent patch.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
* bindings/js/IDBBindingUtilities.cpp:
* bindings/js/IDBBindingUtilities.h:
Remove toJS that takes a std::optional<IDBKeyPath>, it was unused, and update date code
to only call valueToDate once, and pass things by reference.
* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
Move most of the conversion helpers into their respective JSDOMConvertFoo header.
* bindings/js/JSDOMConvert.h:
Leave for now, just has includes of all the broken out headers.
* bindings/js/JSDOMConvertAny.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertBase.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertBoolean.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertBufferSource.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertCallbacks.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertDate.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConvertDate.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertDictionary.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertEnumeration.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertEventListener.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertIndexedDB.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertInterface.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertJSON.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertNull.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertNullable.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertNumbers.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConvertNumbers.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertObject.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertRecord.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertSequences.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertSerializedScriptValue.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertStrings.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConvertStrings.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertUnion.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertVariadic.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertWebGL.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/js/JSDOMConvertXPathNSResolver.h: Copied from Source/WebCore/bindings/js/JSDOMConvert.h.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
Add include of JSDOMConvertVariadic.h rather than JSDOMConvert.
* bindings/js/JSCryptoCustom.cpp:
* bindings/js/JSCryptoOperationData.cpp:
* bindings/js/JSImageDataCustom.cpp:
* bindings/js/ReadableStreamDefaultController.h:
* bindings/js/WebCoreTypedArrayController.cpp:
* html/canvas/WebGLAny.cpp:
* platform/mac/SerializedPlatformRepresentationMac.mm:
Add includes for specific JSDOMConvert header now that helpers have
been moved their from JSDOMBinding.h
2017-02-07 Sam Weinig <sam@webkit.org>
Remove unnecessary exports on inline functions. They were causing build failures
with some compilers.
* Modules/mediasource/SampleMap.h:
(WebCore::PresentationOrderSampleMap::begin):
(WebCore::PresentationOrderSampleMap::end):
(WebCore::PresentationOrderSampleMap::rbegin):
(WebCore::PresentationOrderSampleMap::rend):
(WebCore::DecodeOrderSampleMap::begin):
(WebCore::DecodeOrderSampleMap::end):
(WebCore::DecodeOrderSampleMap::rbegin):
(WebCore::DecodeOrderSampleMap::rend):
(WebCore::SampleMap::sizeInBytes):
(WebCore::SampleMap::decodeOrder):
(WebCore::SampleMap::presentationOrder):
(WebCore::SampleMap::addRange):
(WebCore::SampleMap::SampleMap): Deleted.
2017-02-07 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, manual roll out of r211777
https://bugs.webkit.org/show_bug.cgi?id=167457
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::importModule):
2017-02-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Deadlock when media player is destroyed
https://bugs.webkit.org/show_bug.cgi?id=167861
Reviewed by Michael Catanzaro.
The problem is that we are calling notifyOne() for the draw mutex without taking the lock.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2017-02-07 Zan Dobersek <zdobersek@igalia.com>
MediaSourceClientGStreamerMSE: wrap FastMalloc-ed memory into pipeline-bound GstBuffers
https://bugs.webkit.org/show_bug.cgi?id=167928
Reviewed by Xabier Rodriguez-Calvar.
The buffers created in MediaSourceClientGStreamerMSE can be large enough in size
that repetitive allocations can cause larger heap fragmentation in different libc
allocators. To avoid that occurrence, we should simply use FastMalloc to allocate
memory for these buffers.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):
2017-02-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Handle media durations of an hour or more gracefully
https://bugs.webkit.org/show_bug.cgi?id=167882
<rdar://problem/29601260>
Reviewed by Eric Carlson.
We add a new "labelsMayDisplayTimesOverAnHour" to TimeControl so that time labels
to the left and right of the scrubber may have extra room to display to account for
the extra "xx:" characters that may appear. We don't lay the time out dynamically
such that we don't see layout jumps as the times shown in the labels go around
the hour mark.
We also refactor the ElapsedTimeSupport and RemainingTimeSupport in a single
TimeLabelsSupport class which updates both elapsed and remaining time labels
and sets the "labelsMayDisplayTimesOverAnHour" on the TimeControl should a
"durationchange" happen to make the media duration reach or go past the hour mark.
Tests: http/tests/media/modern-media-controls/time-labels-support/long-time.html
media/modern-media-controls/time-control/time-control-labels-may-display-times-over-an-hour.html
media/modern-media-controls/time-labels-support/elapsed-time.html
media/modern-media-controls/time-labels-support/remaining-time.html
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.get labelsMayDisplayTimesOverAnHour):
(TimeControl.prototype.set labelsMayDisplayTimesOverAnHour):
(TimeControl.prototype.set width):
* Modules/modern-media-controls/controls/time-label.css:
(.time-label):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/elapsed-time-support.js: Removed.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/time-labels-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js.
(TimeLabelsSupport.prototype.get control):
(TimeLabelsSupport.prototype.syncControl):
(TimeLabelsSupport):
* WebCore.xcodeproj/project.pbxproj:
2017-02-06 Per Arne Vollan <pvollan@apple.com>
Read stroke width of subtitles from MediaAccessibility framework.
https://bugs.webkit.org/show_bug.cgi?id=167871
<rdar://problem/29265906>
Reviewed by Brent Fulgham.
Read MACaptionFontAttributeStrokeWidth from CTFontDescriptorRef.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::strokeWidth):
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
* page/CaptionUserPreferencesMediaAF.h:
* platform/cf/MediaAccessibilitySoftLink.cpp:
* platform/cf/MediaAccessibilitySoftLink.h:
2017-02-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve handling of <video> with only audio tracks
https://bugs.webkit.org/show_bug.cgi?id=167836
<rdar://problem/30255812>
Reviewed by Dean Jackson.
We now check for the availability of video tracks before considering a <video>
element is displaying an actual video file and turning auto-hide on. We also
check that we have video tracks before enabling the fullscreen button. This
brings the behavior of a <video> pointing to a resource with no video tracks
to be the same as an <audio> element.
Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get tracksToMonitor):
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
2017-02-07 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableByteStreamController enqueue()
https://bugs.webkit.org/show_bug.cgi?id=167786
Reviewed by Youenn Fablet.
Implemented ReadableByteStreamController enqueue() method. Also replaced
@queue by an Array instead of a dedicated queue object (said object is
useful for ReadableStreamDefaultController, but not for ReadableByteStreamController).
Added 8 tests to cover newly added code as well as code that was previously unreachable.
* Modules/streams/ReadableByteStreamController.js:
(enqueue): Implemented as defined by spec.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Updated @queue.
(readableByteStreamControllerCancel): Updated @queue.
(readableByteStreamControllerError): Updated @queue.
(readableByteStreamControllerPull): Updated @queue.
(readableByteStreamControllerEnqueue): Added.
(readableByteStreamControllerEnqueueChunkToQueue): Added.
* Modules/streams/ReadableStreamInternals.js:
(readableStreamFulfillReadRequest): Added (used at different places).
2017-02-07 Chris Dumez <cdumez@apple.com>
Object.preventExtensions() on a Location object should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=167917
Reviewed by Alex Christensen.
Object.preventExtensions() on a Location object should throw a TypeError:
- https://html.spec.whatwg.org/#location-preventextensions
- https://www.ecma-international.org/ecma-262/7.0/index.html#sec-object.preventextensions
Firefox already implements this.
No new tests, rebaselined existing tests.
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::preventExtensions):
2017-02-07 Yusuke Suzuki <utatane.tea@gmail.com>
Web Inspector: allow import() inside the inspector
https://bugs.webkit.org/show_bug.cgi?id=167457
Reviewed by Ryosuke Niwa.
When evaluating `import("...")`, we need the caller's context to resolve
the module specifier correctly. For example, if `import("./cocoa.js")` is
evaluated in the script "drinks/hot.js", this module name is resolved to
"drinks/cocoa.js". If the same import operator is evaluated in the script
"menu/all.js", the module specifier becomes "menu/cocoa.js".
Previously we reject the import operator if the caller does not have such
a context. These context is SourceOrigin and its ScriptFetcher. While they
are offered in the script tag and other code evaluations, the inspector
console does not offer that. These class are offered in the WebCore side
and we should not touch these classes in the JSC's inspector code.
Now we relax the above restriction. If the above caller information is not
offered, we fallback to the default one. In the web page, we use the page's
URL as the caller's source origin. This allows us to evaluate the import
operator in the inspector console.
And as of r167698, the console recognizes `await import("...")` form. We use
this to test this `import()` in the console functionality.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::importModule):
2017-02-07 Myles C. Maxfield <mmaxfield@apple.com>
Move platform-independent parts of ComplexTextController out of mac/ subfolder
https://bugs.webkit.org/show_bug.cgi?id=167922
Reviewed by Jon Lee.
Just a mechanical git mv, and updating the Xcode projects.
No new tests because there is no behavior change.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ComplexTextController.cpp: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.cpp.
* platform/graphics/ComplexTextController.h: Renamed from Source/WebCore/platform/graphics/mac/ComplexTextController.h.
2017-02-06 Carlos Garcia Campos <cgarcia@igalia.com>
Overlay scrolling with iframe-s broken
https://bugs.webkit.org/show_bug.cgi?id=165056
Reviewed by Antonio Gomes.
Mouse press events for overlay scrollbars are ignored if there's a subframe under the scrollbar. This doesn't
happen with normal scrollbars, because the subframe is not really under the scrollbar, so events are always
correctly passed to the scrollbar. With overlay scrollbars, the hit test detects the scrollbar, but events are
always passed first to the subframe. Scrollbars are correctly updated on hover though, because
handleMouseMoveEvent checks the presence of scrollbars before checking for subframes and move events are
actually passed to both, the scrollbar and the subframe. Overlay scrollbars should always take precedence over
subframes to handle mouse press events, so we should check first if mouse is over a scrollbar and never pass the
event to a subframe in that case. Another problem is that the cursor is not updated either when the overlay
scrollbar is hovered and there's a subframe. This is because in handleMouseMoveEvent we pass the event to both
the scrollbar and subframe but we never update the cursor when a suframe was found. So, here again we need to make
an exception for scrollbars and upate the cursor when mouse is over the scrollbar even if a subframe was found.
Test: fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent): Move the scrollbar check before the subframe check.
(WebCore::EventHandler::handleMouseMoveEvent): Update the cursor when hovering a scrollbar even if a subframe
was found.
(WebCore::EventHandler::updateLastScrollbarUnderMouse): Use an enum instead of a boolean for setLast parameter.
* page/EventHandler.h:
2017-02-06 Chris Dumez <cdumez@apple.com>
Symbols exposed on cross-origin Window / Location objects should be configurable
https://bugs.webkit.org/show_bug.cgi?id=167920
Reviewed by Ryosuke Niwa.
Symbols exposed on cross-origin Window / Location objects should be configurable:
- https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-) (Step 1)
Firefox behaves as per specification.
No new tests, rebaselined existing test.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):
2017-02-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Do not use RunLoop when dispatching inspector GC event
https://bugs.webkit.org/show_bug.cgi?id=167683
<rdar://problem/30167791>
Reviewed by Brian Burg.
Covered by existing tests.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Add new file.
* inspector/PageHeapAgent.cpp:
(WebCore::PageHeapAgent::PageHeapAgent):
(WebCore::PageHeapAgent::enable):
(WebCore::PageHeapAgent::disable):
* inspector/PageHeapAgent.h:
Extend WebHeapAgent.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Use WebHeapAgent.
* inspector/WebHeapAgent.cpp: Added.
(WebCore::SendGarbageCollectionEventsTask::SendGarbageCollectionEventsTask):
(WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
(WebCore::SendGarbageCollectionEventsTask::reset):
(WebCore::SendGarbageCollectionEventsTask::timerFired):
(WebCore::WebHeapAgent::WebHeapAgent):
(WebCore::WebHeapAgent::~WebHeapAgent):
(WebCore::WebHeapAgent::disable):
(WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
(WebCore::WebHeapAgent::dispatchGarbageCollectionEventsAfterDelay):
* inspector/WebHeapAgent.h:
Move the defered event dispatch from InspectorHeapAgent here where a RunLoop is guarenteed.
2017-02-06 Joseph Pecoraro <pecoraro@apple.com>
ExtendedColor leaks seen on leaks bot
https://bugs.webkit.org/show_bug.cgi?id=167912
Reviewed by Alexey Proskuryakov.
* platform/graphics/Color.cpp:
(WebCore::Color::operator=):
Before overwriting m_colorData, we must deref the extended color inside it.
2017-02-06 Simon Fraser <simon.fraser@apple.com>
Re-land r210095 (avoid a tile revalidation on scale change)
https://bugs.webkit.org/show_bug.cgi?id=167866
Reviewed by Tim Horton.
r210095 was rolled out in r211230 but now that all TileControllers unparent
offscreen tiles, we can roll it back it.
Also add more Tiling logging.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::validationPolicyAsString):
(WebCore::TileGrid::setScale):
(WebCore::TileGrid::prepopulateRect):
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::ensureTilesForRect):
2017-02-06 Myles C. Maxfield <mmaxfield@apple.com>
Migrate ComplexTextController to use platform-independent types
https://bugs.webkit.org/show_bug.cgi?id=167833
Reviewed by Brent Fulgham.
ComplexTextController will eventually be used on all ports to perform complex text layout.
This is a mechanical patch which migrates the shared parts of ComplexTextController away from
using CoreGraphics and CoreFoundation types in favor of WebCore/platform types. Eventually,
ComplexTextController will get moved to PAL but there is a layering violation (TextLayout) to
fix first.
No new tests because there is no behavior change.
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBufferAdvance::GlyphBufferAdvance):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
(WebCore::advanceByCombiningCharacterSequence):
(WebCore::ComplexTextController::ComplexTextRun::indexAt):
(WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
(WebCore::ComplexTextController::advance):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::create):
(WebCore::ComplexTextController::ComplexTextRun::stringLength):
(WebCore::ComplexTextController::ComplexTextRun::indexBegin):
(WebCore::ComplexTextController::ComplexTextRun::indexEnd):
(WebCore::ComplexTextController::ComplexTextRun::endOffsetAt):
(WebCore::ComplexTextController::ComplexTextRun::glyphs):
(WebCore::ComplexTextController::ComplexTextRun::growInitialAdvanceHorizontally):
(WebCore::ComplexTextController::ComplexTextRun::initialAdvance):
(WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
(WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
(WebCore::ComplexTextController::glyphOrigin):
(WebCore::ComplexTextController::ComplexTextRun::createForTesting): Deleted.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(SOFT_LINK):
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2017-02-06 Brent Fulgham <bfulgham@apple.com>
Correct File Path Handling in SecurityOrigin and FileSystem
https://bugs.webkit.org/show_bug.cgi?id=167894
<rdar://problem/30380080>
Reviewed by Alexey Proskuryakov.
Roll out the URL decoding being done in the FileSystem class (added in Bug 167894), and instead ensure that
SecurityOrigin properly handles file URLs, and only passes valid file strings to the FileSystem interface.
Tested by FileSystemTests and SecurityOriginTests in TestWebKitAPI.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin): Initialize m_filePath using the url's fileSystemPath, not
the %-encoded 'path' property.
(WebCore::SecurityOrigin::canDisplay): Pass the 'fileSystemPath' to 'filesHaveSameVolume', rather than
the %-encoded 'path' property.
* page/SecurityOrigin.h:
* platform/FileSystem.cpp:
(WebCore::filesHaveSameVolume): Do not use 'decodeURLEscapeSequences' in 'filesHaveSameVolume'.
2017-02-06 Andy Estes <aestes@apple.com>
[Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
https://bugs.webkit.org/show_bug.cgi?id=167908
Reviewed by Sam Weinig.
Kept the Mac-only functions in FileSystemMac.mm and moved the rest into FileSystemCocoa.mm.
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/FileSystemCocoa.mm: Copied from Source/WebCore/platform/mac/FileSystemMac.mm.
* platform/mac/FileSystemMac.mm:
(-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]): Moved to FileSystemCocoa.mm.
(WebCore::homeDirectoryPath): Ditto.
(WebCore::openTemporaryFile): Ditto.
(WebCore::moveFile): Ditto.
(WebCore::getVolumeFreeSpace): Ditto.
2017-02-06 Eric Carlson <eric.carlson@apple.com>
[MediaStream Mac] Remove some unused code
https://bugs.webkit.org/show_bug.cgi?id=167913
Reviewed by Jer Noble.
No new tests, no functional change.
* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
(WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
(WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
(WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo): Deleted.
(WebCore::AVCaptureSessionInfo::supportsVideoSize): Deleted.
(WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
2017-02-06 Youenn Fablet <youennf@gmail.com>
Allow some schemes to opt-out of CORS
https://bugs.webkit.org/show_bug.cgi?id=167795
Reviewed by Alex Christensen.
Test: http/tests/security/bypassing-cors-checks-for-extension-urls.html
Adding the possibility to opt out of CORS for DocumentThreadableLoader clients (fetch and XHR).
This is made specific to the case of user extension URLs for pages running user scripts.
Introducing a boolean flag in Page for that purpose.
Introducing a helper routine in SchemeRegistry to centralize the various user script extension schemes.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* page/Frame.cpp:
(WebCore::Frame::injectUserScripts):
* page/Page.h:
(WebCore::Page::setAsRunningUserScripts):
(WebCore::Page::isRunningUserScripts):
* platform/SchemeRegistry.cpp:
(WebCore::SchemeRegistry::isUserExtensionScheme):
* platform/SchemeRegistry.h:
* testing/Internals.cpp:
(WebCore::Internals::setAsRunningUserScripts):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-06 Chris Dumez <cdumez@apple.com>
Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects
https://bugs.webkit.org/show_bug.cgi?id=167647
<rdar://problem/30339489>
Reviewed by Sam Weinig.
Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects:
- https://html.spec.whatwg.org/#windowproxy-ownpropertykeys [1]
- https://html.spec.whatwg.org/#crossoriginownpropertykeys-(-o-) [2]
- https://html.spec.whatwg.org/#crossoriginproperties-(-o-) [3]
In particular, the following changes were made:
- Location:
- We now return the following symbols as well: @@toStringTag, @@hasInstance,
@@isConcatSpreadable as per [2].
- Window:
- We now return the following symbols as well: @@toStringTag, @@hasInstance,
@@isConcatSpreadable as per [2].
- We now return the indices of the child browsing contexts as per [1].
- We now return the names of the child browsing contexts as per [3].
No new tests, updated / rebaselined existing tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
Index properties should be configurable as per:
- https://html.spec.whatwg.org/#windowproxy-getownproperty (step 2.5)
(WebCore::inScope):
(WebCore::addScopedChildrenNames):
(WebCore::addCrossOriginPropertyNames):
(WebCore::addScopedChildrenIndexes):
(WebCore::addCrossOriginOwnPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::addCrossOriginPropertyNames):
(WebCore::addCrossOriginOwnPropertyNames):
(WebCore::JSLocation::getOwnPropertyNames):
2017-02-06 Yoav Weiss <yoav@yoav.ws>
http/tests/preload/dynamic_removing_preload.html fails to test what it should
https://bugs.webkit.org/show_bug.cgi?id=167792
Reviewed by Ryosuke Niwa.
Cancel the link preload resource load when the link element is removed from the DOM.
No new tests, but unskipping an existing test: http/tests/preload/dynamic_removing_preload.html
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom): Call m_linkLoader.cancelLoad().
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::cancelLoad): Clear m_preloadResourceClient.
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::clearResource): Call m_resource->cancelLoad().
* loader/SubresourceLoader.cpp:
(WebCore::LinkPreloadResourceClient::didFinishLoading): Change ASSERT to exempt cancelled loads.
2017-02-06 Alex Christensen <achristensen@webkit.org>
More build fixes after r211751
https://bugs.webkit.org/show_bug.cgi?id=166998
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::applyAuthenticationToRequest):
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):
2017-02-06 Alex Christensen <achristensen@webkit.org>
Fix non-cocoa builds after r211751.
https://bugs.webkit.org/show_bug.cgi?id=166998
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::applyAuthenticationToRequest):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::applyAuthenticationToRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
2017-02-06 Alex Christensen <achristensen@webkit.org>
credentials should be partitioned by main document domain
https://bugs.webkit.org/show_bug.cgi?id=166998
rdar://problem/22901123
Reviewed by Brady Eidson.
Covered by http/tests/security/credentials-iframes.html
Also added http/tests/security/credentials-from-different-domains.html to verify existing behavior without iframes.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* dom/Document.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::domainForCachePartition):
Return emptyString instead of a null String because it is used as a key in a HashMap, and hashing null strings dereferences null.
* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
* page/SocketProvider.h:
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::set):
(WebCore::CredentialStorage::get):
(WebCore::CredentialStorage::remove):
* platform/network/CredentialStorage.h:
Partition credentials.
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/soup/SocketStreamHandleImpl.h:
2017-02-06 Simon Fraser <simon.fraser@apple.com>
Safari pages are blank sometimes (missing tiles)
https://bugs.webkit.org/show_bug.cgi?id=167904
Reviewed by Tim Horton.
After r211683 we failed to udpate the "inWindow" flag on the page tiled layer, because
usingTiledBacking() on GraphicsLayer confusingly was false for the page tiled layer.
Fix by removing usingTiledBacking() entirely, and checking for tiledBacking(),
looking at the layer type when necessary.
Tested by tiled-drawing/tiled-backing-in-window.html
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): This is the bug fix.
(WebCore::GraphicsLayer::getDebugBorderInfo):
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::usingTiledBacking): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::changeLayerTypeTo):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::willDestroyLayer):
(WebCore::RenderLayerBacking::compositingLayerType):
* rendering/RenderLayerCompositor.cpp: A bit more logging.
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::attachRootLayer):
2017-02-06 Said Abou-Hallawa <sabouhallawa@apple.com>
Change the CSS animation timer a to be little more than 60fps to ensure we hit that frame rate
https://bugs.webkit.org/show_bug.cgi?id=167825
Reviewed by Simon Fraser.
The system timer fires little bit slower than 60fps. This might cause the
frame to be missed and hence it can lower the frame rate significantly. The
rAF timer was set to 15ms for the same reason. So set the repeated CSS
animation timer also to 15ms.
* page/animation/CSSAnimationController.cpp:
2017-02-06 Jer Noble <jer.noble@apple.com>
Playback stalls when a SourceBuffer append causes frame eviction
https://bugs.webkit.org/show_bug.cgi?id=167834
Reviewed by Eric Carlson.
Test: PerformanceTests/Media/MSERemoveCodedFrames.html
Optimize searching through SampleMap by presentationTime.
Many of the methods exposed by PresentationOrderSampleMap used the bare std::equal_range,
lower_bound, or upper_bound methods. Unlike those methods exposed on std::map, the bare
search methods perform a linear O(n) search, rather than a the binary O(log(n)) search used
by std::map. Rewrite those methods using the bare methods in terms of the std::map search
methods.
Drive-by fix: rename findSampleOnOrAfterPresentationTime to
findSampleStartingOnOrAfterPresentationTime to make the behavior of the method more
explicit.
* Modules/mediasource/SampleMap.cpp:
(WebCore::PresentationOrderSampleMap::findSampleContainingPresentationTime):
(WebCore::PresentationOrderSampleMap::findSampleStartingOnOrAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::reverseFindSampleBeforePresentationTime):
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimes):
(WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRange):
(WebCore::PresentationOrderSampleMap::findSampleOnOrAfterPresentationTime): Deleted.
* Modules/mediasource/SampleMap.h:
(WebCore::PresentationOrderSampleMap::begin):
(WebCore::PresentationOrderSampleMap::end):
(WebCore::PresentationOrderSampleMap::rbegin):
(WebCore::PresentationOrderSampleMap::rend):
(WebCore::DecodeOrderSampleMap::begin):
(WebCore::DecodeOrderSampleMap::end):
(WebCore::DecodeOrderSampleMap::rbegin):
(WebCore::DecodeOrderSampleMap::rend):
(WebCore::SampleMap::SampleMap):
(WebCore::SampleMap::sizeInBytes):
(WebCore::SampleMap::decodeOrder):
(WebCore::SampleMap::presentationOrder):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBuffer::removeCodedFrames):
(WebCore::SourceBuffer::reenqueueMediaForTime):
* WebCore.xcodeproj/project.pbxproj:
2017-02-06 Said Abou-Hallawa <sabouhallawa@apple.com>
Rename AnimationController to CSSAnimationController
https://bugs.webkit.org/show_bug.cgi?id=167829
Reviewed by Simon Fraser.
AnimationController is a very generic name. The current function of this
class is CSS animation.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty):
* dom/Document.cpp:
* history/CachedFrame.cpp:
* page/Frame.cpp:
(WebCore::Frame::Frame):
* page/Frame.h:
(WebCore::Frame::animation):
* page/FrameView.cpp:
* page/Page.cpp:
* page/animation/AnimationBase.cpp:
* page/animation/CSSAnimationController.cpp: Renamed from Source/WebCore/page/animation/AnimationController.cpp.
(WebCore::AnimationPrivateUpdateBlock::AnimationPrivateUpdateBlock):
(WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock):
(WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::~CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
(WebCore::CSSAnimationControllerPrivate::clear):
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
(WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher):
(WebCore::CSSAnimationControllerPrivate::addEventToDispatch):
(WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
(WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
(WebCore::CSSAnimationControllerPrivate::animationTimerFired):
(WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer):
(WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
(WebCore::CSSAnimationControllerPrivate::suspendAnimations):
(WebCore::CSSAnimationControllerPrivate::resumeAnimations):
(WebCore::CSSAnimationControllerPrivate::animationsAreSuspendedForDocument):
(WebCore::CSSAnimationControllerPrivate::detachFromDocument):
(WebCore::CSSAnimationControllerPrivate::suspendAnimationsForDocument):
(WebCore::CSSAnimationControllerPrivate::resumeAnimationsForDocument):
(WebCore::CSSAnimationControllerPrivate::startAnimationsIfNotSuspended):
(WebCore::CSSAnimationControllerPrivate::setAllowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
(WebCore::CSSAnimationControllerPrivate::endAnimationUpdate):
(WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
(WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation):
(WebCore::CSSAnimationControllerPrivate::numberOfActiveAnimations):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle):
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle):
(WebCore::CSSAnimationControllerPrivate::styleAvailable):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::startTimeResponse):
(WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll):
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll):
(WebCore::CSSAnimationControllerPrivate::scrollWasUpdated):
(WebCore::CSSAnimationController::CSSAnimationController):
(WebCore::CSSAnimationController::~CSSAnimationController):
(WebCore::CSSAnimationController::cancelAnimations):
(WebCore::CSSAnimationController::updateAnimations):
(WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
(WebCore::CSSAnimationController::computeExtentOfAnimation):
(WebCore::CSSAnimationController::notifyAnimationStarted):
(WebCore::CSSAnimationController::pauseAnimationAtTime):
(WebCore::CSSAnimationController::numberOfActiveAnimations):
(WebCore::CSSAnimationController::pauseTransitionAtTime):
(WebCore::CSSAnimationController::isRunningAnimationOnRenderer):
(WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer):
(WebCore::CSSAnimationController::isSuspended):
(WebCore::CSSAnimationController::suspendAnimations):
(WebCore::CSSAnimationController::resumeAnimations):
(WebCore::CSSAnimationController::allowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationController::setAllowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationController::serviceAnimations):
(WebCore::CSSAnimationController::animationsAreSuspendedForDocument):
(WebCore::CSSAnimationController::detachFromDocument):
(WebCore::CSSAnimationController::suspendAnimationsForDocument):
(WebCore::CSSAnimationController::resumeAnimationsForDocument):
(WebCore::CSSAnimationController::startAnimationsIfNotSuspended):
(WebCore::CSSAnimationController::beginAnimationUpdate):
(WebCore::CSSAnimationController::endAnimationUpdate):
(WebCore::CSSAnimationController::supportsAcceleratedAnimationOfProperty):
(WebCore::CSSAnimationController::wantsScrollUpdates):
(WebCore::CSSAnimationController::scrollWasUpdated):
(WebCore::CSSAnimationController::hasAnimations):
* page/animation/CSSAnimationController.h: Renamed from Source/WebCore/page/animation/AnimationController.h.
(WebCore::AnimationUpdateBlock::AnimationUpdateBlock):
(WebCore::AnimationUpdateBlock::~AnimationUpdateBlock):
* page/animation/CSSAnimationControllerPrivate.h: Renamed from Source/WebCore/page/animation/AnimationControllerPrivate.h.
(WebCore::CSSAnimationControllerPrivate::hasAnimations):
(WebCore::CSSAnimationControllerPrivate::isSuspended):
(WebCore::CSSAnimationControllerPrivate::setBeginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::allowsNewAnimationsWhileSuspended):
(WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates):
(WebCore::CSSAnimationControllerPrivate::scrollPosition):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::singleton):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::CompositeAnimation):
* page/animation/CompositeAnimation.h:
(WebCore::CompositeAnimation::create):
(WebCore::CompositeAnimation::animationController):
* page/animation/ImplicitAnimation.cpp:
* page/animation/KeyframeAnimation.cpp:
* page/ios/FrameIOS.mm:
* platform/graphics/GraphicsLayer.h:
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
(WebCore::RenderObject::animation):
* testing/Internals.cpp:
2017-02-06 Zalan Bujtas <zalan@apple.com>
Simple line layout: Use simplified text measuring when possible.
https://bugs.webkit.org/show_bug.cgi?id=167843
<rdar://problem/30364907>
Reviewed by Antti Koivisto.
This patch adds a simplified version of text width measuring.
Certain type of text runs (no spacing etc) only require a subset of what we
currently do in FontCascade::width().
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText):
* platform/graphics/FontCascade.h:
* platform/graphics/WidthCache.h:
(WebCore::WidthCache::add):
(WebCore::WidthCache::addSlowCase):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):
* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):
(WebCore::RenderText::setRenderedText):
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring):
* rendering/RenderText.h:
(WebCore::RenderText::canUseSimplifiedTextMeasuring):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-02-06 Carlos Garcia Campos <cgarcia@igalia.com>
Resource usage overlay should ignore mouse events outside bounds by default
https://bugs.webkit.org/show_bug.cgi?id=167874
Reviewed by Andreas Kling.
It's overriding the default causing that the first click after the overlay is shown is always handled by the
overlay even when clicked outside bounds. It should only be set false while dragging.
* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::initialize):
2017-02-06 Antti Koivisto <antti@apple.com>
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Node::invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=167878
rdar://problem/30251840
Reviewed by Andreas Kling.
Speculative fix.
We are trying to invalidate a null node from ~PostResolutionCallbackDisabler. Looks like the only way
this could happen is if HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition is called
with null 'this'. There is one place where this might happen.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachRootLayer): Add null check.
2017-02-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r211722.
This change introduced a LayoutTest failure on mac-wk2.
Reverted changeset:
"[Modern Media Controls] Improve handling of <video> with only
audio tracks"
https://bugs.webkit.org/show_bug.cgi?id=167836
http://trac.webkit.org/changeset/211722
2017-02-06 Eric Carlson <eric.carlson@apple.com>
[MediaStream Mac] Stop using AVSampleBufferAudioRenderer
https://bugs.webkit.org/show_bug.cgi?id=167821
Reviewed by Jer Noble.
* WebCore.xcodeproj/project.pbxproj: Add new files.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal): Don't assume the first timestamp from the
render proc after a pause is zero.
Stop using an audio renderer for each audio track. No audio renderers means we don't need to use
an AVSampleBufferRenderSynchronizer.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener invalidate]): No more audio renderers.
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Pause
audio tracks explicitly.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSourceProvider): Remove the existing code,
it was incorrect and not thread safe.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers): No more audio renderers.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): No more render synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start each audio track.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Pause each audio track.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Pass the command to each audio track.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::streamTime): No more render synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Don't handle audio samples.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Update for audio track class change. No
more render synchronizer.
(-[WebAVSampleBufferStatusChangeListener beginObservingRenderer:]): Deleted.
(-[WebAVSampleBufferStatusChangeListener stopObservingRenderer:]): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSample): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForAudioData): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createAudioRenderer): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyAudioRenderer): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyAudioRenderers): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rendererStatusDidChange): Deleted.
* platform/mediastream/AudioTrackPrivateMediaStream.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate): add/removeObserver takes a reference,
not a pointer.
(WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate): Ditto.
(WebCore::MediaStreamTrackPrivate::videoSampleAvailable): Renamed from sourceHasMoreMediaData.
(WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::addObserver): Take a reference, not a pointer.
(WebCore::RealtimeMediaSource::removeObserver): Ditto.
(WebCore::RealtimeMediaSource::videoSampleAvailable): Renamed from mediaDataUpdated.
(WebCore::RealtimeMediaSource::audioSamplesAvailable): New.
(WebCore::RealtimeMediaSource::stop): Drive-by cleanup.
(WebCore::RealtimeMediaSource::requestStop): Ditto.
(WebCore::RealtimeMediaSource::mediaDataUpdated): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::AVAudioCaptureSource):
(WebCore::AVAudioCaptureSource::addObserver):
(WebCore::AVAudioCaptureSource::shutdownCaptureSession):
(WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Call videoSampleAvailable, not mediaDataUpdated.
Render audio with a CoreAudio output unit.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: Added.
(WebCore::AudioTrackPrivateMediaStreamCocoa::AudioTrackPrivateMediaStreamCocoa):
(WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
(WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
(WebCore::AudioTrackPrivateMediaStreamCocoa::play):
(WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
(WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
(WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit):
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::sourceStopped):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):
(WebCore::AudioTrackPrivateMediaStreamCocoa::inputProc):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h: Added.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::alignTo16Bytes):
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
(WebCore::MockRealtimeAudioSourceMac::reconfigure): Minor cleanup.
(WebCore::MockRealtimeAudioSourceMac::render): Ditto.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Call videoSampleAvailable, not mediaDataUpdated.
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::provideInput): Use a mutex. Get rid of m_writeAheadCount,
it is always 0.
(WebCore::WebAudioSourceProviderAVFObjC::prepare): Use a lock.
(WebCore::WebAudioSourceProviderAVFObjC::unprepare): Ditto.
(WebCore::WebAudioSourceProviderAVFObjC::process): Ditto.
* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::renderInterval): Decrease the render interval.
2017-02-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add a backdrop filter to the start button on macOS
https://bugs.webkit.org/show_bug.cgi?id=167879
<rdar://problem/30375174>
Reviewed by Eric Carlson.
Add a backdrop filter to the start button on macOS.
Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-start-button-style.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline > button.start > div):
2017-02-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Bring fullscreen controls up to spec
https://bugs.webkit.org/show_bug.cgi?id=167875
<rdar://problem/29611222>
Reviewed by Eric Carlson.
We update the fullscreen PiP icon to have the correct size and add two new buttons
around the volume slider, "volume-down" to bring the volume to 0 and "volume-up"
to bring the volume to 1.
To accomodate the new volume buttons, we move the volume slider inside an additional
ButtonsContainer object, along with the two new buttons.
Tests: media/modern-media-controls/volume-down-support/volume-down-support.html
media/modern-media-controls/volume-up-support/volume-up-support.html
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen button.volume-down):
(.media-controls.mac.fullscreen button.volume-up):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
* Modules/modern-media-controls/controls/volume-down-button.js: Added.
(VolumeDownButton):
* Modules/modern-media-controls/controls/volume-slider.js:
(VolumeSlider):
* Modules/modern-media-controls/controls/volume-up-button.js: Added.
(VolumeUpButton):
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png:
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png:
* Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png: Added.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/volume-down-support.js: Added.
(VolumeDownSupport.prototype.get control):
(VolumeDownSupport.prototype.buttonWasPressed):
(VolumeDownSupport):
* Modules/modern-media-controls/media/volume-up-support.js: Added.
(VolumeUpSupport.prototype.get control):
(VolumeUpSupport.prototype.buttonWasPressed):
(VolumeUpSupport):
* WebCore.xcodeproj/project.pbxproj:
2017-02-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve handling of <video> with only audio tracks
https://bugs.webkit.org/show_bug.cgi?id=167836
<rdar://problem/30255812>
Reviewed by Dean Jackson.
We now check for the availability of video tracks before considering a <video>
element is displaying an actual video file and turning auto-hide on. We also
check that we have video tracks before enabling the fullscreen button. This
brings the behavior of a <video> pointing to a resource with no video tracks
to be the same as an <audio> element.
Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get tracksToMonitor):
(ControlsVisibilitySupport.prototype._updateControls):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
2017-02-06 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r211681
https://bugs.webkit.org/show_bug.cgi?id=167096
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
Include some necessary GLES headers.
2017-02-05 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction fails in Safari splitscreen mode when dropping into a contenteditable
https://bugs.webkit.org/show_bug.cgi?id=167862
<rdar://problem/30368405>
Reviewed by Tim Horton.
Adds a counter to WebItemProviderPasteboard that can incremented, decremented, and queried by clients.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard hasPendingOperation]):
(-[WebItemProviderPasteboard incrementPendingOperationCount]):
(-[WebItemProviderPasteboard decrementPendingOperationCount]):
2017-02-05 Simon Fraser <simon.fraser@apple.com>
Remove unparentsOffscreenTiles logic in TileController
https://bugs.webkit.org/show_bug.cgi?id=167823
Reviewed by Tim Horton.
Give all TileGrids the "unparents offscreen tiles" behavior. This was enabled for
only the page tiles in WK2 on Mac and iOS, but there's no reason to not use it for
tiled composited layers also.
Also use more modern C++ idioms in a few places.
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::ensureTilesForRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
2017-02-05 Antoine Quint <graouts@apple.com>
[Modern Media Controls] PiP button is not visible with a live broadcast video
https://bugs.webkit.org/show_bug.cgi?id=167794
<rdar://problem/30348790>
Reviewed by Dean Jackson.
We were only listening to the "loadedmetadata", "error", "webkitpresentationmodechanged"
and "webkitcurrentplaybacktargetiswirelesschanged" events to invalidate the enabled state
for the PiP button. We also need to check availability of video tracks, which we already
did for fullscreen, which is quite similar.
So we now listen to "addtrack", "removetrack" and "change" events on the media.videoTracks
property, which correctly invalidates the PiP button when the first video track becomes
available or the last video track is removed.
Since a couple of other MediaControllerSupport subclasses (FullscreenSupport and TracksSupport)
would also listen to those events on various track types, we add a new "tracksToMonitor"
property on MediaControllerSupport which subclasses can override to provide a list of tracks
that should listen to those events. This removes the need for dedicated construction and
destruction time in MediaControllerSupport subclasses that need to listen to events on
tracks rather than the media itself.
Test: http/tests/media/modern-media-controls/pip-support/pip-support-live-broadcast.html
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport):
(FullscreenSupport.prototype.get tracksToMonitor):
(FullscreenSupport.prototype.destroy): Deleted.
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport):
(MediaControllerSupport.prototype.destroy):
(MediaControllerSupport.prototype.get tracksToMonitor):
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.get tracksToMonitor):
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport):
(TracksSupport.prototype.get tracksToMonitor):
(TracksSupport.prototype.destroy): Deleted.
2017-02-05 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Time labels may wrap instead of displaying on a single line
https://bugs.webkit.org/show_bug.cgi?id=167835
<rdar://problem/30340534>
Reviewed by Dean Jackson.
No text in modern media controls is expected to wrap, so let's prevent any wrapping.
Test: media/modern-media-controls/time-label/time-label-white-space-nowrap.html
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
2017-02-04 Simon Fraser <simon.fraser@apple.com>
Clean up how GraphicsLayer's "inWindow" state is set, and fix some issues with Page Overlays
https://bugs.webkit.org/show_bug.cgi?id=167850
Reviewed by Tim Horton.
RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants() walked the RenderLayer
tree to set the GraphicsLayer's "inWindow" state. This had the problem of skipping non-primary
GraphicsLayers. We also never did this work for page overlay layers.
Fix by giving GraphicsLayers a recursive function that sets the inWindow state, and call that
from RenderLayerCompositor::setIsInWindow() and PageOverlayController.
PageOverlayController also needs to implement tiledBackingUsageChanged so that tiled backings
created dynamically get the correct in-window state.
Page overlays also had some serious issues in MiniBrowser, in that they disappeared on reload,
and on hide/show web view. This was because the overlay root layers were re-parented, but
addChild() for each overlay's layer wasn't called. Clean up by replacing willAttachRootLayer() followed
by viewOverlayRootLayer()/documentOverlayRootLayer() with single calls that set up the layers,
update the inWindow state, and return the layer.
Make it possible to dump tile caches in page overlay tests.
Make showGraphicsLayers() always dump page overlay layers (source of much confusion).
Test: pageoverlay/overlay-remove-reinsert-view.html
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::documentOverlayRootLayer):
(WebCore::PageOverlayController::viewOverlayRootLayer):
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::tiledBackingUsageChanged):
(WebCore::PageOverlayController::willAttachRootLayer): Deleted.
* page/PageOverlayController.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setIsInWindowIncludingDescendants):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants): Deleted.
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
(WebCore::Internals::layerTreeAsText):
(WebCore::Internals::pageOverlayLayerTreeAsText):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::layerTreeAsText):
* testing/MockPageOverlayClient.h:
2017-02-05 Zalan Bujtas <zalan@apple.com>
Simple line layout: Use RenderText::canUseSimpleFontCodePath() only as a hint.
https://bugs.webkit.org/show_bug.cgi?id=167853
<rdar://problem/30367302>
Reviewed by Simon Fraser.
Apparently RenderText::canUseSimpleFontCodePath() only checks if the string is qualified for
the simple font code path. However certain css properties could still force us to use the complex
path.
In most cases, we still do only one string traversal thanks to TextRun::setCharacterScanForCodePath().
Test: fast/text/simple-line-layout-simple-text-but-complex-font-path.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText):
2017-02-05 Zan Dobersek <zdobersek@igalia.com>
Move TextureMapper-specific logic out of GraphicsContext3DPrivate
https://bugs.webkit.org/show_bug.cgi?id=167096
Reviewed by Alex Christensen.
Move the TextureMapper-specific functionality in GraphicsContext3DPrivate into a
separate class. The new TextureMapperGC3DPlatformLayer class inherits from the
class that's aliased to the PlatformLayer type, like GraphicsContext3DPrivate did
before.
In GraphicsContext3D, the new m_texmapLayer member variable of the
std::unique_ptr<TextureMapperGC3DPlatformLayer> type is used for configurations
that enable TextureMapper, largely the same way the GraphicsContext3DPrivate
object was used before. The remaining code in GraphicsContext3DPrivate is left
unchanged to keep it working for other ports.
No new tests -- no change in behavior.
* platform/TextureMapper.cmake:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate): Deleted.
(WebCore::GraphicsContext3DPrivate::proxy): Deleted.
(WebCore::GraphicsContext3DPrivate::swapBuffersIfNeeded): Deleted.
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper): Deleted.
* platform/graphics/GraphicsContext3DPrivate.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::platformLayer):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createForCurrentGLContext):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Copied from Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp.
(WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
(WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
(WebCore::TextureMapperGC3DPlatformLayer::makeContextCurrent):
(WebCore::TextureMapperGC3DPlatformLayer::platformContext):
(WebCore::TextureMapperGC3DPlatformLayer::proxy):
(WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded):
(WebCore::TextureMapperGC3DPlatformLayer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h.
(WebCore::TextureMapperGC3DPlatformLayer::renderStyle):
2017-02-05 Zalan Bujtas <zalan@apple.com>
Simple line layout: Bail out from Simple Line Layout on surrogate pairs.
https://bugs.webkit.org/show_bug.cgi?id=167840
<rdar://problem/30364784>
Reviewed by Myles C. Maxfield.
Surrogate pairs require special line breaking logic.
Test: fast/text/simple-line-layout-no-surrogate-pairs.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForCharacter):
(WebCore::SimpleLineLayout::canUseForText): Checking against special characters is faster than
checking against glyphs. Reverse their order.
(WebCore::SimpleLineLayout::printReason):
2017-02-04 Joseph Pecoraro <pecoraro@apple.com>
Static Analyzer: WebCoreNSURLExtras.mm: Potential leak of memory pointed to by 'allBytesBuffer'
https://bugs.webkit.org/show_bug.cgi?id=167849
Reviewed by Sam Weinig.
Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:883:20: warning: Potential leak of memory pointed to by 'allBytesBuffer'
return nil;
^~~
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::dataForURLComponentType):
Free the potentially malloc'd buffer before the early return.
2017-02-04 Chris Dumez <cdumez@apple.com>
Unreviewed, fix mistake in comment added in r211569.
* history/PageCache.cpp:
(WebCore::PageCache::removeAllItemsForPage):
2017-02-04 Yoav Weiss <yoav@yoav.ws>
Fix memory issues related to preload eviction.
https://bugs.webkit.org/show_bug.cgi?id=167838
Reviewed by Andreas Kling.
This avoids removing resources from m_preloads during the iteration
by creating a second HashSetList containing the remaining link preloads.
No new tests but this will fix crashes on the leak bots.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::clearPreloads):
2017-02-04 Zalan Bujtas <zalan@apple.com>
Simple line layout: Skip 16bit specific checks on 8bit content.
https://bugs.webkit.org/show_bug.cgi?id=167831
<rdar://problem/30361948>
Reviewed by Antti Koivisto and Myles C. Maxfield.
Skip various checks on 8bit content.
Covered by existing tests.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForCharacter):
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForFontAndText):
2017-02-03 Zalan Bujtas <zalan@apple.com>
Simple line layout: Remove redundant codepath check.
https://bugs.webkit.org/show_bug.cgi?id=167827
<rdar://problem/30361850>
Reviewed by Myles C. Maxfield.
FontCascade::codePath() iterates through the entire text. It's rather wasteful to do twice.
No change in functionality.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::printReason):
2017-02-03 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r204858): Synthetic bold text in vertical writing mode is rotated away from original text
https://bugs.webkit.org/show_bug.cgi?id=167826
<rdar://problem/28193222>
Reviewed by Zalan Bujtas.
When drawing vertical text, the rotation is not reset between successive paint calls. We implement
synthetic bold by drawing text twice, which means that the second draw call was getting rotated
twice. This was an oversight in r204858.
Test: fast/text/synthetic-bold-vertical-text.html
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showGlyphsWithAdvances):
2017-02-03 Joseph Pecoraro <pecoraro@apple.com>
Performance Timing: Convert WTF::MonotonicTime and WTF::Seconds
https://bugs.webkit.org/show_bug.cgi?id=167768
Reviewed by Geoffrey Garen.
The public APIs still return double (DOMHighResTimeStamp), which
is milliseconds since a time origin:
https://w3c.github.io/hr-time/#dom-domhighrestimestamp
* loader/LoadTiming.cpp:
(WebCore::LoadTiming::secondsSinceStartTime):
(WebCore::LoadTiming::monotonicTimeToPseudoWallTime):
(WebCore::LoadTiming::markStartTime):
(WebCore::LoadTiming::addRedirect):
(WebCore::LoadTiming::monotonicTimeToZeroBasedDocumentTime): Deleted.
* loader/LoadTiming.h:
(WebCore::LoadTiming::markUnloadEventStart):
(WebCore::LoadTiming::markUnloadEventEnd):
(WebCore::LoadTiming::markRedirectStart):
(WebCore::LoadTiming::markRedirectEnd):
(WebCore::LoadTiming::markFetchStart):
(WebCore::LoadTiming::setResponseEnd):
(WebCore::LoadTiming::markLoadEventStart):
(WebCore::LoadTiming::markLoadEventEnd):
(WebCore::LoadTiming::startTime):
(WebCore::LoadTiming::unloadEventStart):
(WebCore::LoadTiming::unloadEventEnd):
(WebCore::LoadTiming::redirectStart):
(WebCore::LoadTiming::redirectEnd):
(WebCore::LoadTiming::fetchStart):
(WebCore::LoadTiming::responseEnd):
(WebCore::LoadTiming::loadEventStart):
(WebCore::LoadTiming::loadEventEnd):
(WebCore::LoadTiming::redirectCount):
(WebCore::LoadTiming::referenceMonotonicTime):
(WebCore::LoadTiming::referenceWallTime):
Use MonotonicTime and WallTime for timestamps and references.
* dom/Document.cpp:
(WebCore::Document::setReadyState):
(WebCore::Document::finishedParsing):
(WebCore::Document::monotonicTimestamp):
* dom/DocumentTiming.h:
(WebCore::DocumentTiming::DocumentTiming): Deleted.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::dataReceived):
* loader/DocumentLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::performance):
Use new types instead of raw doubles.
* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::now):
(WebCore::Performance::reduceTimeResolution):
(WebCore::Performance::addResourceTiming):
* page/Performance.h:
Do time arithmatic with WTF::Time classes.
This clarifies that we reduce our timestamps to 100us
resolution instead of the maximum 5us allowed by the spec.
* page/PerformanceResourceTiming.cpp:
(WebCore::monotonicTimeToDOMHighResTimeStamp):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
* page/PerformanceResourceTiming.h:
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
(WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
(WebCore::toIntegerMilliseconds): Deleted.
* page/PerformanceTiming.h:
Do time arithmatic with WTF::Time classes.
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:
Pass time origin as MonotonicTime.
* workers/Worker.cpp:
(WebCore::Worker::create):
(WebCore::Worker::notifyFinished):
* workers/Worker.h:
Rename creation timestamp member. This matches Document's m_documentCreationTime.
2017-02-03 Jeremy Jones <jeremyj@apple.com>
WK1 mouse events are missing movementX and movementY for pointerlock.
https://bugs.webkit.org/show_bug.cgi?id=167775
rdar://problem/30343810
Reviewed by Alexey Proskuryakov.
pointer-lock/mouse-event-delivery.html
Improve mouse-event-delivery.html test to mouse move and check for valid movementX and movementY.
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): WK1 plumb throuhg movementX and movementY
2017-02-03 Simon Fraser <simon.fraser@apple.com>
Correctly set the "inWindow" flag for TileControllers that aren't the page tiles, and clarify "usingTiledBacking" logic
https://bugs.webkit.org/show_bug.cgi?id=167774
Reviewed by Tim Horton.
RenderLayerBacking had some very confusing "usingTiledCacheLayer" uses.
Its member variable, m_usingTiledCacheLayer, really meant "m_isMainFrameLayerWithTiledBacking" so make it so.
It had a usingTiledBacking(), which returned the same thing, which this patch replaces with isMainFrameLayerWithTiledBacking().
The fact that usingTiledBacking() was only true for the page tiled layer tripped up
RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants(), which would only ever call setIsInWindow()
on the page tiled layer. These changes fix that.
Also make a way for tests to unparent the web view via UIScriptController, and dump out the "in window"
status of TileBackings when dumping tile caches.
Test: tiled-drawing/tiled-backing-in-window.html
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/TileController.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computePageTiledBackingCoverage):
(WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
(WebCore::RenderLayerBacking::setTiledBackingHasMargins):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::shouldClipCompositedBounds):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateRootLayerConfiguration):
(WebCore::RenderLayerBacking::paintsIntoWindow):
(WebCore::computeTileCoverage): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
(WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing):
(WebCore::RenderLayerCompositor::documentUsesTiledBacking):
2017-02-03 Zalan Bujtas <zalan@apple.com>
Simple line layout: Bail out from Simple Line Layout when the primary font is insufficient.
https://bugs.webkit.org/show_bug.cgi?id=167820
<rdar://problem/30359685>
Reviewed by Myles C. Maxfield.
Currently simple line layout requires the primary font to have all the glyps for the content.
Test: fast/text/simple-line-layout-do-not-support-unicode-range.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::printReason):
2017-02-03 Jer Noble <jer.noble@apple.com>
ASSERT in HTMLMediaElement::~HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=167818
Reviewed by Brent Fulgham.
Test: media/audio-dealloc-crash.html
HTMLMediaElement's MediaElementSession can nominate the HTMLMediaElement itself
to become the playback controls session from inside the HTMLMediaElement destructor. Protect
against this by clearing out the session before calling updatePlaybackControlsManager().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
2017-02-03 Daniel Bates <dabates@apple.com>
[Mac][WK2] Add SPI to override the Content Security Policy of a page
https://bugs.webkit.org/show_bug.cgi?id=167810
<rdar://problem/30102568>
Reviewed by Anders Carlsson.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Apply the embedding client's override Content Security
Policy to the document if one exists.
* loader/FrameLoaderClient.h: Add function overrideContentSecurityPolicy() that a FrameLoaderClient
can override to provide a custom Content Security Policy for a document (defaults: null string - no policy).
As its name implies, the policy returned by overrideContentSecurityPolicy() will define the Content
Security Policy for the document, overriding any subsequently received Content Security Policy for
the document.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom): Only copy policies from the specified ContentSecurityPolicy
object if our policy was not specified by the embedding client.
(WebCore::ContentSecurityPolicy::didReceiveHeader): Set ContentSecurityPolicy::m_hasAPIPolicy to true
when we receive an API policy from the embedding client (ContentSecurityPolicy::PolicyFrom::API). An
API policy must be defined before a policy received from a document. Do not process a received header
if we already have an API policy as the API policy overrides all other policies.
* page/csp/ContentSecurityPolicy.h:
2017-02-03 Chris Dumez <cdumez@apple.com>
Drop Mac App Store workaround for window.getComputedStyle()
https://bugs.webkit.org/show_bug.cgi?id=166891
<rdar://problem/28282452>
Reviewed by Sam Weinig.
Drop Mac App Store workaround for window.getComputedStyle() now that
<rdar://problem/28020681> has been fixed.
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/DOMWindow.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::MacApplication::isAppStore): Deleted.
2017-02-03 Chris Dumez <cdumez@apple.com>
Dismiss HTML form validation popover when pressing Escape key
https://bugs.webkit.org/show_bug.cgi?id=167716
<rdar://problem/29872943>
Reviewed by Simon Fraser.
Dismiss any visible HTML form validation popover when pressing
the Escape key.
Test: fast/forms/validation-bubble-escape-key-dismiss.html
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
* page/ValidationMessageClient.h:
2017-02-03 Jeremy Jones <jeremyj@apple.com>
Pointer lock events should be delivered directly to the target element
https://bugs.webkit.org/show_bug.cgi?id=167134
rdar://problem/30268004
Reviewed by Dean Jackson.
pointer-lock/mouse-event-delivery.html: Enabled for mac, added wheel event tests.
When pointer is locked on an element, route mouse events directly to the target element, instead of
doing the normal event disptach.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::isLocked): Added.
(WebCore::PointerLockController::dispatchLockedWheelEvent): Added.
* page/PointerLockController.h:
2017-02-03 Yoav Weiss <yoav@yoav.ws>
Avoid evicting link preload resources when parsing is done.
https://bugs.webkit.org/show_bug.cgi?id=167415
Reviewed by Ryosuke Niwa.
Currently all preloads (speculative and link preload) are being cleared when the document has finished parsing.
When it comes to link preloads, it can result in resources being cleared before the page had a chance to use them. (e.g. resources
that are preloaded in order to be loaded through script after DOMContentLoaded)
This patch fixes that by marking link preload resources as such, so that they can be handled separately inside clearPreloads().
As this fix also exposed an issue with load cancelation with invalid hrefs (which tests were passing before due to the preloads
being cleared), said issue is also fixed by clearing previousely preloaded resources if an invalid link preload is later detected.
Test: http/tests/preload/not_evicting_preload_at_onload.html
* dom/Document.cpp:
(WebCore::Document::finishedParsing): Only clear speculative preloads when parsing is finished.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded): Set request flag indicating link preload.
(WebCore::LinkLoader::loadLink): Clear previousely preloaded resource to cancel their load.
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::clearResource): Call cancelLoad() when the client is cleared.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isLinkPreload):
(WebCore::CachedResource::setLinkPreload):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Initialize m_isLinkPreload with the request's value.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::~CachedResourceLoader):
(WebCore::CachedResourceLoader::requestResource): Mirror the request link preload flag to the resource if it's fetched from cache.
(WebCore::CachedResourceLoader::clearPreloads): Add a "speculative only" mode, which doesn't clear link preloads.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::isLinkPreload):
(WebCore::CachedResourceRequest::setIsLinkPreload):
2017-02-03 Zalan Bujtas <zalan@apple.com>
Simple line layout: Removing adjacent trailing whitespace runs should not crash.
https://bugs.webkit.org/show_bug.cgi?id=167803
<rdar://problem/30337368>
Reviewed by Antti Koivisto.
In case of adjacent collapsed whitespace fragments, the length of these fragments (TextFragmentIterator::TextFragment)
do not necessarily equal the length of the final runs (SimpleLineLayout::Run).
This patch removes the dependency on the length and switches over to using the position information instead.
Test: fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
2017-02-03 Brent Fulgham <bfulgham@apple.com>
Correct memory leak in MediaConstraints
https://bugs.webkit.org/show_bug.cgi?id=167744
<rdar://problem/30331444>
Reviewed by Anders Carlsson.
ConstraintHolder returns a reference to an object created by operator new. When the
returned value is assigned or stored in Vector or other containers we leak memory.
Instead, this value should just be returned as a regular object so that the return
value optimization can make sure memory is properly (and efficiently) used.
Tested by existing mediastream tests.
* platform/mediastream/MediaConstraints.h:
(WebCore::FlattenedConstraint::ConstraintHolder::create): Return by value.
(WebCore::FlattenedConstraint::ConstraintHolder::~ConstraintHolder): Don't attempt to
delete memory that was moved away.
(WebCore::FlattenedConstraint::ConstraintHolder::ConstraintHolder): Add Move constructor.
2017-02-03 Chris Dumez <cdumez@apple.com>
Fix bad assertion under HTMLTreeBuilder::processStartTagForInBody()
https://bugs.webkit.org/show_bug.cgi?id=167799
<rdar://problem/30237241>
Reviewed by Brent Fulgham.
Fix bad assertion under HTMLTreeBuilder::processStartTagForInBody() that was
expecting the root element to be an <html> element when parsing a <frameset>.
While this assertion is true in theory and as per the specification, it does
not hold in WebKit when parsing a DocumentFragment. This is because WebKit
has an optimization causing us to have a DocumentFragment as root element
when parsing a fragment. See the following constructor:
"HTMLTreeBuilder(HTMLDocumentParser&, DocumentFragment&, Element&, ParserContentPolicy, const HTMLParserOptions&)"
which has the following code:
"""
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-html-fragments
// For efficiency, we skip step 5 ("Let root be a new html element with no attributes") and instead use the DocumentFragment as a root node.
m_tree.openElements().pushRootNode(HTMLStackItem::create(fragment));
"""
Update the assertion to expect a DocumentFragment as root element when parsing
a fragment, and keep expecting an <html> element otherwise.
Test: fast/parser/fragment-with-frameset-crash.html
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
2017-02-03 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Skip back button is visible with a live broadcast video
https://bugs.webkit.org/show_bug.cgi?id=167793
Reviewed by Eric Carlson.
We shouldn't be showing the skip back button when a live broadcast video is playing.
We now listen to the "durationchange" event to determine when we have an inifinite-duration
video and disable the skip button in that case.
Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-live-broadcast.html
* Modules/modern-media-controls/media/skip-back-support.js:
(SkipBackSupport.prototype.get mediaEvents):
(SkipBackSupport.prototype.syncControl):
(SkipBackSupport):
2017-02-03 Alex Christensen <achristensen@webkit.org>
URLParser: implement forbidden host code points for non-special URLs
https://bugs.webkit.org/show_bug.cgi?id=167779
Reviewed by Chris Dumez.
Covered by newly passing web platform tests.
* platform/URLParser.cpp:
(WebCore::isC0Control):
(WebCore::isForbiddenHostCodePoint):
(WebCore::URLParser::parseHostAndPort):
In non-special URL hosts such as customprotocol://strange%host
don't accept characters that are part of the URL grammar and would be forbidden
in a special URL host, like https://not[allowed
This was recently added to the spec in https://github.com/whatwg/url/issues/214
2017-02-03 Per Arne Vollan <pvollan@apple.com>
The CSS property -webkit-text-stroke is not applied on captions.
https://bugs.webkit.org/show_bug.cgi?id=167687
Reviewed by Brent Fulgham.
Add style to list of valid properties for cue.
Test: media/track/track-css-stroke-cues.html
* css/StyleResolver.cpp:
(WebCore::StyleResolver::isValidCueStyleProperty):
2017-02-03 Alex Christensen <achristensen@webkit.org>
Align URL setters with spec for URLs that cannot be a base URL
https://bugs.webkit.org/show_bug.cgi?id=167783
Reviewed by Chris Dumez.
Setting things like credentials on mailto URLs doesn't make sense.
It's forbidden by the spec.
Covered by newly passing web platform tests.
* html/URLUtils.h:
(WebCore::URLUtils<T>::setUsername):
(WebCore::URLUtils<T>::setPassword):
(WebCore::URLUtils<T>::setHost):
(WebCore::URLUtils<T>::setHostname):
(WebCore::URLUtils<T>::setPort):
(WebCore::URLUtils<T>::setPathname):
* platform/URL.cpp:
(WebCore::URL::serialize):
* platform/URL.h:
(WebCore::URL::cannotBeABaseURL):
2017-02-03 Eric Carlson <eric.carlson@apple.com>
[Mac] Add classes to manage audio samples
https://bugs.webkit.org/show_bug.cgi?id=167739
Reviewed by Jer Noble.
No new tests, this code isn't used yet.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/mac/AudioSampleBufferList.cpp: Added.
(WebCore::AudioSampleBufferList::create):
(WebCore::AudioSampleBufferList::AudioSampleBufferList):
(WebCore::AudioSampleBufferList::~AudioSampleBufferList):
(WebCore::AudioSampleBufferList::setSampleCount):
(WebCore::AudioSampleBufferList::applyGain):
(WebCore::AudioSampleBufferList::mixFrom):
(WebCore::AudioSampleBufferList::copyFrom):
(WebCore::AudioSampleBufferList::copyTo):
(WebCore::AudioSampleBufferList::reset):
(WebCore::AudioSampleBufferList::zero):
(WebCore::AudioSampleBufferList::zeroABL):
(WebCore::AudioSampleBufferList::convertInput):
(WebCore::AudioSampleBufferList::audioConverterCallback):
(WebCore::AudioSampleBufferList::configureBufferListForStream):
* platform/audio/mac/AudioSampleBufferList.h: Added.
(WebCore::AudioSampleBufferList::streamDescription):
(WebCore::AudioSampleBufferList::bufferList):
(WebCore::AudioSampleBufferList::sampleCapacity):
(WebCore::AudioSampleBufferList::sampleCount):
(WebCore::AudioSampleBufferList::timestamp):
(WebCore::AudioSampleBufferList::hostTime):
(WebCore::AudioSampleBufferList::setTimes):
(WebCore::AudioSampleBufferList::audioBufferListSizeForStream):
* platform/audio/mac/AudioSampleDataSource.cpp: Added.
(WebCore::AudioSampleDataSource::create):
(WebCore::AudioSampleDataSource::AudioSampleDataSource):
(WebCore::AudioSampleDataSource::~AudioSampleDataSource):
(WebCore::AudioSampleDataSource::setPaused):
(WebCore::AudioSampleDataSource::setupConverter):
(WebCore::AudioSampleDataSource::setInputFormat):
(WebCore::AudioSampleDataSource::setOutputFormat):
(WebCore::AudioSampleDataSource::hostTime):
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamples):
* platform/audio/mac/AudioSampleDataSource.h: Added.
(WebCore::AudioSampleDataSource::setVolume):
(WebCore::AudioSampleDataSource::volume):
(WebCore::AudioSampleDataSource::setMuted):
(WebCore::AudioSampleDataSource::muted):
2017-02-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the buidl after r211631.
I added the OS(LINUX) ifdef to the wrong file by mistake.
* page/ResourceUsageThread.h:
* page/linux/ResourceUsageThreadLinux.cpp:
2017-02-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add initial implementation of resource usage overlay
https://bugs.webkit.org/show_bug.cgi?id=167731
Reviewed by Michael Catanzaro.
Add an implementation of ResourceUsageOverlay and ResourceUsageThread for Linux systems.
* PlatformGTK.cmake: Add new new files to compilation.
* page/Page.cpp:
(WebCore::Page::setResourceUsageOverlayVisible): Do not create the page overlay if accelerated compositing is
not enabled.
* page/ResourceUsageOverlay.h:
* page/linux/ResourceUsageOverlayLinux.cpp: Added.
(WebCore::cpuUsageString):
(WebCore::formatByteNumber):
(WebCore::gcTimerString):
(WebCore::ResourceUsageOverlay::platformInitialize):
(WebCore::ResourceUsageOverlay::platformDestroy):
* page/linux/ResourceUsageThreadLinux.cpp: Added.
(WebCore::cpuPeriod):
(WebCore::cpuUsage):
(WebCore::ResourceUsageThread::platformThreadBody):
2017-02-03 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Store preloaded media in webkit's cache
https://bugs.webkit.org/show_bug.cgi?id=119477
Reviewed by Xabier Rodriguez-Calvar.
Files cached on disk by MediaPlayerPrivateGStreamer are deleted only when the player is closed. If the
WebProcess crashed, they're just left there in the cache directory. This patch changes the location
of those temporary files to a proper temporary directory (/var/tmp, as those files aren't actually
reusable, so they don't belong to a cache directory, and /tmp is a bad place because it's RAM-based on
some distros), unlinks (deletes) them right after creation and also deletes any other stalled temporary
file on the old legacy cache directory.
There's no API in GstPlaybin to control the temporary file location, so we do it manually by locating
the GstDownloadBuffer element in the pipeline as soon as it's created, reconfiguring it with the right
temporary file path and deleting the file as soon as it's created.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Stop listening to element-added.
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback): Look for GstDownloadBuffer.
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): Remove the file after creation.
(WebCore::MediaPlayerPrivateGStreamer::purgeOldDownloadFiles): Delete legacy files.
(WebCore::MediaPlayerPrivateGStreamer::sourceChanged): Listen to element-added signals on GstUriDecodeBin.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: New reference to GstDownloadBuffer.
2017-02-03 Antti Koivisto <antti@apple.com>
WebContent crash when pasting into input fields at com.apple.WebCore: WebCore::ResourceRequestBase::url const + 9
https://bugs.webkit.org/show_bug.cgi?id=167787
rdar://problem/29168795
Reviewed by Andreas Kling.
No test, don't know how to get here.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::crossfadeBlend): Null check.
2017-02-03 Alberto Garcia <berto@igalia.com>
JSDOMWindowBase.cpp doesn't build if the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=167785
Reviewed by Carlos Garcia Campos.
r211403 moved GetCallerGlobalObjectFunctor from JSDOMBinding.cpp
to JSDOMWindowBase.cpp, but forgot to include bytecode/CodeBlock.h
in the latter file.
This breaks the build if the JIT is disabled because the headers
that would include ClodeBlock.h indirectly are guarded by
ENABLE(JIT).
* bindings/js/JSDOMWindowBase.cpp:
2017-02-02 Andreas Kling <akling@apple.com>
[Mac] In-process memory pressure monitor for WebContent processes AKA websam
<https://webkit.org/b/167491>
<rdar://problem/30116072>
Reviewed by Antti Koivisto.
Add a new timer-based memory pressure monitor that checks the process memory
footprint every 30 seconds and reacts to changes by setting a MemoryUsagePolicy.
There are four MemoryUsagePolicy values:
- Unrestricted (below 1GB)
- Conservative (above 1GB)
- Strict (above 2GB)
- Panic (above 4GB, or 3GB if 32-bit)
For Strict and above, the old-style "isUnderMemoryPressure()" API will return true.
Transitioning to a higher policy will cause memory pressure handlers to run:
At Strict, we run the "non-critical" memory pressure handler, then carry on.
At Panic, we run the "critical" memory pressure handler. If that fails to recover
enough memory to bring us back below 4GB, we may kill the process:
A process is eligible to get killed for using too much memory if:
- It's not visible on screen (i.e it's a background tab.)
- It's not playing audio.
- It has not performed a main frame navigation in the last hour.
Before killing the process, an exit-time callback will run. This patch installs such
a callback that prints out some time-of-death statistics about C++ and JavaScript memory
usage to hopefully help understand what was soaking up all the memory.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setState):
* page/MainFrame.cpp:
(WebCore::MainFrame::didCompleteLoad):
* page/MainFrame.h:
* page/MemoryRelease.cpp:
(WebCore::pageCount):
(WebCore::logMemoryStatisticsAtTimeOfDeath):
(WebCore::didExceedMemoryLimitAndFailedToRecover):
(WebCore::processIsEligibleForMemoryKill):
* page/MemoryRelease.h:
* page/ResourceUsageThread.h:
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::MemoryPressureHandler):
(WebCore::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
(WebCore::toString):
(WebCore::thresholdForPolicy):
(WebCore::policyForFootprint):
(WebCore::MemoryPressureHandler::measurementTimerFired):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setMemoryKillCallback):
(WebCore::MemoryPressureHandler::setProcessIsEligibleForMemoryKillCallback):
(WebCore::MemoryPressureHandler::isUnderMemoryPressure):
2017-02-02 Alex Christensen <achristensen@webkit.org>
URLParser: Fix parsing invalid IPv4 addresses with non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=167773
<rdar://problem/30221102>
Reviewed by Ryosuke Niwa.
If an invalid IPv4 address contains the first syntaxViolation (difference between input and canonicalized URL),
an iterator is used to calculate how far we have parsed in the input string to copy all the syntax-violation-free
characters into a Vector. If a URL contains only ASCII that doesn't contain anything percent-encoded in the host,
there is a fast path to parse ASCII hosts. All my existing invalid IPv4 tests followed this path.
If there is a non-ASCII character, we need to use an iterator to the original string instead of an iterator
to the string after converting the input string's host to ASCII.
Covered by a new API test which used to RELEASE_ASSERT.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:
2017-02-02 Wenson Hsieh <wenson_hsieh@apple.com>
CrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::URL::host const + 9
https://bugs.webkit.org/show_bug.cgi?id=167766
<rdar://problem/30132707>
Reviewed by Chris Dumez.
The mainframe's document pointer may be null when tearing down a page upon navigation to a page that is in the
page cache. If this triggers a GC sweep, we will attempt to reload touch bar media controls, which (as a part of
the media controller heuristic) checks the mainframe's document URL to see if quirks should be enabled. This
assumes that the mainframe's document exists, which is not a safe assumption if page navigation is occurring. As
such, we need a null check for the mainframe's document in needsPlaybackControlsManagerQuirk().
No test, as we were unable to reproduce this crash.
* html/HTMLMediaElement.cpp:
(WebCore::needsPlaybackControlsManagerQuirk):
2017-02-02 Chris Dumez <cdumez@apple.com>
Suspend SVG animations in hidden pages
https://bugs.webkit.org/show_bug.cgi?id=167763
<rdar://problem/29986313>
Reviewed by Simon Fraser.
Suspend SVG animations in hidden pages to save power, similarly to what
we already do for another types of animations.
Test: svg/animations/animations-paused-page-non-visible.html
* page/Page.cpp:
(WebCore::setSVGAnimationSuspended):
(WebCore::Page::setIsVisibleInternal):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::pauseAnimations):
(WebCore::SVGDocumentExtensions::unpauseAnimations):
* svg/SVGDocumentExtensions.h:
(WebCore::SVGDocumentExtensions::areAnimationsPaused):
* testing/Internals.cpp:
(WebCore::Internals::areSVGAnimationsPaused):
* testing/Internals.h:
* testing/Internals.idl:
2017-02-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211596 and r211605.
https://bugs.webkit.org/show_bug.cgi?id=167767
This change broke certain build configurations (Requested by
ryanhaddad on #webkit).
Reverted changesets:
"[Mac] Add classes to manage audio samples"
https://bugs.webkit.org/show_bug.cgi?id=167739
http://trac.webkit.org/changeset/211596
"Unreviewed speculative build fix."
http://trac.webkit.org/changeset/211605
2017-02-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed speculative build fix.
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::setupConverter):
(WebCore::AudioSampleDataSource::pushSamples):
2017-02-02 Alex Christensen <achristensen@webkit.org>
Build libwebrtc and dependencies with Xcode
https://bugs.webkit.org/show_bug.cgi?id=167758
Reviewed by Dean Jackson.
* WebCore.xcodeproj/project.pbxproj:
2017-02-02 Chris Dumez <cdumez@apple.com>
{}.toString.call(crossOriginWindow) should return "[object Object]"
https://bugs.webkit.org/show_bug.cgi?id=167701
<rdar://problem/30330797>
Reviewed by Keith Miller.
{}.toString.call() to should "[object Object] for cross origin
Window / Location objects. This new behavior is consistent with
Firefox and Chrome.
No new tests, rebaselined existing tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toStringName):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::toStringName):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/IDLAttributes.txt:
* page/DOMWindow.idl:
* page/Location.idl:
2017-02-02 Wenson Hsieh <wenson_hsieh@apple.com>
Drag images should be anchored to the mouse location
https://bugs.webkit.org/show_bug.cgi?id=167690
<rdar://problem/30295261>
Reviewed by Enrica Casucci.
Adds logic to compute the mouse anchor point. This is a point in the unit square indicating where the drag
origin is relative to the bounds of the drag image. There is no behavior change, since this anchor point is not
used by any client yet; this patch only computes and vends this information from WebCore.
* loader/EmptyClients.cpp:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:
* platform/DragImage.h:
2017-02-02 Eric Carlson <eric.carlson@apple.com>
[Mac] Add classes to manage audio samples
https://bugs.webkit.org/show_bug.cgi?id=167739
Reviewed by Jer Noble.
No new tests, this code isn't used yet.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/mac/AudioSampleBufferList.cpp: Added.
(WebCore::AudioSampleBufferList::create):
(WebCore::AudioSampleBufferList::AudioSampleBufferList):
(WebCore::AudioSampleBufferList::~AudioSampleBufferList):
(WebCore::AudioSampleBufferList::setSampleCount):
(WebCore::AudioSampleBufferList::applyGain):
(WebCore::AudioSampleBufferList::mixFrom):
(WebCore::AudioSampleBufferList::copyFrom):
(WebCore::AudioSampleBufferList::copyTo):
(WebCore::AudioSampleBufferList::reset):
(WebCore::AudioSampleBufferList::zero):
(WebCore::AudioSampleBufferList::zeroABL):
(WebCore::AudioSampleBufferList::convertInput):
(WebCore::AudioSampleBufferList::audioConverterCallback):
(WebCore::AudioSampleBufferList::configureBufferListForStream):
* platform/audio/mac/AudioSampleBufferList.h: Added.
(WebCore::AudioSampleBufferList::streamDescription):
(WebCore::AudioSampleBufferList::bufferList):
(WebCore::AudioSampleBufferList::sampleCapacity):
(WebCore::AudioSampleBufferList::sampleCount):
(WebCore::AudioSampleBufferList::timestamp):
(WebCore::AudioSampleBufferList::hostTime):
(WebCore::AudioSampleBufferList::setTimes):
(WebCore::AudioSampleBufferList::audioBufferListSizeForStream):
* platform/audio/mac/AudioSampleDataSource.cpp: Added.
(WebCore::AudioSampleDataSource::create):
(WebCore::AudioSampleDataSource::AudioSampleDataSource):
(WebCore::AudioSampleDataSource::~AudioSampleDataSource):
(WebCore::AudioSampleDataSource::setPaused):
(WebCore::AudioSampleDataSource::setupConverter):
(WebCore::AudioSampleDataSource::setInputFormat):
(WebCore::AudioSampleDataSource::setOutputFormat):
(WebCore::AudioSampleDataSource::hostTime):
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamples):
* platform/audio/mac/AudioSampleDataSource.h: Added.
(WebCore::AudioSampleDataSource::setVolume):
(WebCore::AudioSampleDataSource::volume):
(WebCore::AudioSampleDataSource::setMuted):
(WebCore::AudioSampleDataSource::muted):
2017-02-02 Joseph Pecoraro <pecoraro@apple.com>
Support Performance API (performance.now(), UserTiming) in Workers
https://bugs.webkit.org/show_bug.cgi?id=167717
Reviewed by Ryosuke Niwa.
Tests: performance-api/performance-mark-name.html
performance-api/performance-now-api.html
performance-api/performance-now-time-origin-in-worker.html
performance-api/user-timing-apis.html
* CMakeLists.txt:
* DerivedSources.make:
New files.
* page/DOMWindow.idl:
* page/GlobalPerformance.idl:
* workers/WorkerGlobalScope.idl:
Add partial interface for performance attribute.
* page/Performance.idl:
* page/PerformanceEntry.idl:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.idl:
* page/PerformanceObserver.idl:
* page/PerformanceObserverEntryList.idl:
Expose these to Workers.
* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::contextDestroyed):
* page/Performance.h:
Use the EventQueue variant that works with any ScriptExectionContext.
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::PerformanceObserver):
Get the Performance base in a Worker context.
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::mark):
Only reject legacy special mark names in a Window, not a Worker.
(WebCore::UserTiming::findExistingMarkStartTime):
Simple implementation returns 0 as the start time in Workers. The spec
is currently imprecise here, but it does not have the unusual
PerformanceTiming behavior in a Window which is part of User Timing 1.
* workers/Worker.cpp:
(WebCore::Worker::create):
(WebCore::Worker::notifyFinished):
* workers/Worker.h:
Record the moment of Worker creation.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::performance):
* workers/WorkerGlobalScope.h:
Construct the Performance object with the moment of creation (timeOrigin).
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
Pass the moment of creation (timeOrigin) through to WorkerGlobalScope creation.
2017-02-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211579.
https://bugs.webkit.org/show_bug.cgi?id=167753
Caused mediastream crashes. (Requested by bfulgham_ on
#webkit).
Reverted changeset:
"Correct memory leak in MediaConstraints"
https://bugs.webkit.org/show_bug.cgi?id=167744
http://trac.webkit.org/changeset/211579
2017-02-02 Chris Dumez <cdumez@apple.com>
Rename Node::inDocument() to isConnected()
https://bugs.webkit.org/show_bug.cgi?id=167743
Reviewed by Sam Weinig.
Rename Node::inDocument() to isConnected() to match the DOM specification more closely:
- https://dom.spec.whatwg.org/#connected
2017-02-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Provide a compact mode for when the controls are small
https://bugs.webkit.org/show_bug.cgi?id=167746
<rdar://problem/29565842>
Reviewed by Dean Jackson.
When the macOS inline media controls become too narrow to display both the volume and fullscreen
buttons in their right container (width < 242), we switch to a compact mode where the controls bar
is shorter and the buttons smaller.
To facilitate this, we provide a new subclass of MacOSInlineMediaControls called MacOSCompactInlineMediaControls
which changes some of the layout properties of the buttons to have shorter margins around buttons.
We also added a new "Compact" LayoutTrait and improved IconService to provide specific icons
for this mode for the buttons that can exist in compact mode.
To correctly implement the design, we needed to add a way to provide different margins around the
left and right edges of the container, so the "padding" property is now split between "leftMargin"
and "rightMargin", and to make property naming cleaner, the "margin" property which specifies the
space between each button in a container is now called "buttonMargin". We also set the default
values for those properties to be 24 (instead of 0) which are the most widely used values, requiring
less customization.
Tests: media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-buttons-styles.html
media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-constructor.html
media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-controls-bar-styles.html
media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-layout.html
media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-volume-styles.html
media/modern-media-controls/media-controller/media-controller-toggle-compact-mode.html
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.layout): Refactor the "margin" and "padding" properties into
"leftMargin", "rightMargin" and "buttonMargin".
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage): Fix a small bug that would prevent the image source
change to occur after changing the "iconName" property should the previous and new icons
share the same metrics, which is the case for the "play" and "pause" icons in compact mode.
* Modules/modern-media-controls/controls/icon-service.js: Add support for compact variants.
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
* Modules/modern-media-controls/controls/ios-inline-media-controls.js: Adopt new margin defaults.
* Modules/modern-media-controls/controls/layout-item.js: Add the new "Compact" LayoutTrait.
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: Added.
(.media-controls.mac.inline.compact > .controls-bar):
(.media-controls.mac.inline.compact button.play-pause):
(.media-controls.mac.inline.compact button.skip-back):
(.media-controls.mac.inline.compact .scrubber.slider):
(.media-controls.mac.inline.compact button.mute):
(.media-controls.mac.inline.compact button.fullscreen):
(.media-controls.mac.inline.compact .time-label,):
(.media-controls.mac.inline.compact .volume-slider-container):
(.media-controls.mac.inline.compact .volume.slider):
(.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.js: Added.
(MacOSCompactInlineMediaControls):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: Adopt new margin defaults.
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js: Adopt new margin defaults
and make the _leftContainer and _rightContainer properties public such that the MacOSCompactInlineMediaControls
subclass may customize them without accessing a private property.
(MacOSInlineMediaControls.prototype.layout):
(MacOSInlineMediaControls.prototype.showTracksPanel):
* Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/play-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/play-compact@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-compact@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-compact@2x.png: Added.
* Modules/modern-media-controls/js-files: Add the new files so they are concatenated by the build script.
* Modules/modern-media-controls/media/media-controller.js: Toggle compact mode if controls
are below the 242px width threshold.
(MediaController.prototype.get layoutTraits):
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._shouldFadeBetweenControls):
(MediaController.prototype._updateControlsSize):
(MediaController.prototype._controlsWidth):
(MediaController.prototype._controlsClass):
(MediaController):
* WebCore.xcodeproj/project.pbxproj: Add new files and perform some cleanup so that the
project accurately lists all the existing project files and remove some older ones.
2017-02-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211571 and r211582.
https://bugs.webkit.org/show_bug.cgi?id=167751
This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571
"Unreviewed attempt to fix the Windows build after r211571."
http://trac.webkit.org/changeset/211582
2017-02-02 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix the Windows build after r211571.
* platform/MemoryPressureHandler.cpp:
(WebCore::thresholdForPolicy):
(WebCore::policyForFootprint):
2017-02-02 Brent Fulgham <bfulgham@apple.com>
Correct memory leak in MediaConstraints
https://bugs.webkit.org/show_bug.cgi?id=167744
<rdar://problem/30331444>
Reviewed by Anders Carlsson.
ConstraintHolder returns a reference to an object created by operator new. When the
returned value is assigned or stored in Vector or other containers we leak memory.
Instead, this value should just be returned as a regular object so that the return
value optimization can make sure memory is properly (and efficiently) used.
* platform/mediastream/MediaConstraints.h:
(WebCore::FlattenedConstraint::ConstraintHolder::create): Return by value.
2017-02-02 Andreas Kling <akling@apple.com>
[Mac] In-process memory pressure monitor for WebContent processes AKA websam
<https://webkit.org/b/167491>
<rdar://problem/30116072>
Reviewed by Antti Koivisto.
Add a new timer-based memory pressure monitor that checks the process memory
footprint every 30 seconds and reacts to changes by setting a MemoryUsagePolicy.
There are four MemoryUsagePolicy values:
- Unrestricted (below 1GB)
- Conservative (above 1GB)
- Strict (above 2GB)
- Panic (above 4GB, or 3GB if 32-bit)
For Strict and above, the old-style "isUnderMemoryPressure()" API will return true.
Transitioning to a higher policy will cause memory pressure handlers to run:
At Strict, we run the "non-critical" memory pressure handler, then carry on.
At Panic, we run the "critical" memory pressure handler. If that fails to recover
enough memory to bring us back below 4GB, we may kill the process:
A process is eligible to get killed for using too much memory if:
- It's not visible on screen (i.e it's a background tab.)
- It's not playing audio.
- It has not performed a main frame navigation in the last hour.
Before killing the process, an exit-time callback will run. This patch installs such
a callback that prints out some time-of-death statistics about C++ and JavaScript memory
usage to hopefully help understand what was soaking up all the memory.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setState):
* page/MainFrame.cpp:
(WebCore::MainFrame::didCompleteLoad):
* page/MainFrame.h:
* page/MemoryRelease.cpp:
(WebCore::pageCount):
(WebCore::logMemoryStatisticsAtTimeOfDeath):
(WebCore::didExceedMemoryLimitAndFailedToRecover):
(WebCore::processIsEligibleForMemoryKill):
* page/MemoryRelease.h:
* page/ResourceUsageThread.h:
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::MemoryPressureHandler):
(WebCore::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
(WebCore::toString):
(WebCore::thresholdForPolicy):
(WebCore::policyForFootprint):
(WebCore::MemoryPressureHandler::measurementTimerFired):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setMemoryKillCallback):
(WebCore::MemoryPressureHandler::setProcessIsEligibleForMemoryKillCallback):
(WebCore::MemoryPressureHandler::isUnderMemoryPressure):
2017-02-02 Chris Dumez <cdumez@apple.com>
[Crash] com.apple.WebKit.WebContent at WebKit: WebKit::WebPage::fromCorePage()
https://bugs.webkit.org/show_bug.cgi?id=167738
<rdar://problem/30229990>
Reviewed by Andreas Kling.
Upon destruction of a Page, we destroy the BackForwardClient, which is supposed
to keep track of HistoryItems associated to this particular page and remove them
from the PageCache. Given the crash trace, the issue seems to be that some
HistoryItems associated with the Page sometimes linger in the PageCache *after*
the Page has been destroyed, which leads to crashes later on when pruning the
PageCache.
In order to make the process more robust, this patch refactors the code so that
the Page is now in charge of removing all its associated HistoryItems from the
PageCache instead of relying on the BackForwardClient. Also, instead of having
the Page keep track of which HistoryItems are associated with it (which is
error prone), we now scan all PageCache entries instead to find which ones are
associated with the Page. While this is in theory slower, this is much safer
and in practice not an issue because the PageCache usually has 3-5 entries.
No new tests, could not reproduce.
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
* history/CachedPage.h:
(WebCore::CachedPage::page):
* history/PageCache.cpp:
(WebCore::PageCache::removeAllItemsForPage):
* history/PageCache.h:
* page/Page.cpp:
(WebCore::Page::~Page):
2017-02-02 Antti Koivisto <antti@apple.com>
Column progression wrong after enabling pagination on RTL document
https://bugs.webkit.org/show_bug.cgi?id=167733
<rdar://problem/29012252>
Reviewed by Zalan Bujtas.
Column progression depends on document direction but was not updated when direction changed.
Test: fast/multicol/pagination/pagination-dynamic-rtl.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
Update column styles if document direction changes.
2017-02-02 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME][GStreamer] Fixed decryptor selection
https://bugs.webkit.org/show_bug.cgi?id=167588
Reviewed by Žan Doberšek.
GStreamer selected a decryptor automatically but we need to be
able to tell it which decryptor we want because one file can be
encrypted with more than one system and the one we want to use can
depend on what the user tells us.
Now when the demuxer is about to select the demuxer, it runs a
GstContext query with the events, which are forwarded through the
EME api to the application, which will answer the the
generateKeyRequest and then we can instruct the demuxer to select
the one we tell it, not the one that is selected automatically. If
the demuxer has already a preferred decryptor, the codepath will
be similar to the older one.
Something that is also fixed is the report of the keyneeded event,
which will contain all pssh boxes as requested by the spec.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Intercept
the event and handle it.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
Initialize the CDM session.
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
Unlock the protection condition just in case and set CDM to null.
(WebCore::extractEventsAndSystemsFromMessage): Access the events
and accepted key systems coming at the message from the demuxer.
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
Handle the protection event not as an element event but as a
context request. It also concatenates all the initdatas in case
there is more than one. The event is sent in the main thread and
the current one blocks until a timeout is hit or the
generateKeyRequest is called.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
Check if the event was already handled and if not, run the need
key event.
(WebCore::MediaPlayerPrivateGStreamerBase::receivedGenerateKeyRequest):
Notify the that the query arrived so that we can unlock the
demuxer thread.
(WebCore::keySystemIdToUuid): Translates ids to uuids, meaning
the ones coming from JS to the ones coming from the media engine.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Attributes and methods.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webkit_media_clear_key_decrypt_class_init):
(webKitMediaClearKeyDecryptorRequestDecryptionKey): Deleted.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
Added the ui and uuid.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not rely
on the subclass, just forward the event to the pipeline inside a message.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
Remove unused function signature.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::appendPipelineNeedContextMessageCallback): Renamed from
appendPipelineElementMessageCallback.
(WebCore::AppendPipeline::AppendPipeline): Connect to the
need-context message instead of the element one.
(WebCore::AppendPipeline::dispatchPendingDecryptionKey):
Dispatches the drm-cypher message if there is one pending.
(WebCore::AppendPipeline::dispatchDecryptionKey): Dispatches the
drm-cypher.
(WebCore::AppendPipeline::handleNeedContextSyncMessage): Handles
the need-context event instead of the element one.
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
Dispatches the key to the pipeline if there's any pending.
(WebCore::appendPipelineElementMessageCallback): Deleted.
(WebCore::AppendPipeline::handleElementMessage): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h: New methods
and attributes.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey):
Use the dispatchDecryptionKey method of the AppendPipeline.
2017-02-02 Joseph Pecoraro <pecoraro@apple.com>
Removed unused EventHandler members
https://bugs.webkit.org/show_bug.cgi?id=167723
Reviewed by Yusuke Suzuki.
* page/EventHandler.cpp:
(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleWheelEvent):
* page/EventHandler.h:
Remove unused members.
* editing/FrameSelection.cpp:
* html/HTMLTextAreaElement.cpp:
* rendering/RenderObject.cpp:
* rendering/RenderSlider.cpp:
Remove unnecessary includes.
2017-02-02 Joseph Pecoraro <pecoraro@apple.com>
Removed unused m_navigationStart from NavigatorGamepad
https://bugs.webkit.org/show_bug.cgi?id=167722
Reviewed by Yusuke Suzuki.
* Modules/gamepad/NavigatorGamepad.cpp:
(WebCore::NavigatorGamepad::NavigatorGamepad):
(WebCore::NavigatorGamepad::from):
* Modules/gamepad/NavigatorGamepad.h:
(WebCore::NavigatorGamepad::navigationStart): Deleted.
2017-02-02 Yongjun Zhang <yongjun_zhang@apple.com>
In iOS, we should take background assertion when accessing localstorage databases.
https://bugs.webkit.org/show_bug.cgi?id=165478
Move WebSQLiteDatabaseTrackerClient from WebKitLegacy to WebCore so that it can be accessible from
WebKit1 and WebKit2. Previously, to avoid dependencies on UIKit, WebKitLegacy introduced several
global methods for UIKit to setup the start/end background task blocks on runtime (WebKitSetStartBackgroundTaskBlock,
WebKitSetInvalidWebBackgroundTaskIdentifier and WebKitSetEndBackgroundTaskBlock). Since we have to
move the background task handling to WebCore, to avoid adding WebCore dependencies on UIKit, this
patch introdues a new WebCore class WebBackgroundTaskController which holds the start/end background
task blocks. The existing WebKitSetStartBackgroundTaskBlock and WebKitSetEndBackgroundTaskBlock methods
in WebKit1 will use WebBackgroundTaskController to store the blocks set by UIKit.
Reviewed by Brady Eidson.
No new test since this is code refactoring.
* WebCore.xcodeproj/project.pbxproj: Add a new class WebBackgroundTaskController to the project. Also move
WebSQLiteDatabaseTrackerClient from WebKitLegacy to WebCore.
* platform/ios/WebBackgroundTaskController.h: Use properties to hold the blocks for starting or ending background tasks.
* platform/ios/WebBackgroundTaskController.mm:
(+[WebBackgroundTaskController sharedController]):
(-[WebBackgroundTaskController dealloc]):
(-[WebBackgroundTaskController startBackgroundTaskWithExpirationHandler:]): Start a background task with a expiration handler;
to start the background task, we will use backgroundTaskStartBlock set up by UIKit.
(-[WebBackgroundTaskController endBackgroundTaskWithIdentifier:]): Call backgroundTaskEndBlack to end a background task.
* platform/ios/WebSQLiteDatabaseTrackerClient.h: Copied from Source/WebKit/ios/Storage/WebSQLiteDatabaseTrackerClient.h.
* platform/ios/WebSQLiteDatabaseTrackerClient.mm: Copied from Source/WebKit/ios/Storage/WebSQLiteDatabaseTrackerClient.mm.
(WebCore::WebSQLiteDatabaseTrackerClient::sharedWebSQLiteDatabaseTrackerClient): Make WebSQLiteDatabaseTrackerClient a singleton.
(WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
(WebCore::WebSQLiteDatabaseTrackerClient::~WebSQLiteDatabaseTrackerClient):
(WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction): Use a utility class WebDatabaseTransactionBackgroundTaskController
to schedule database transaction background task.
(WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction): Use WebDatabaseTransactionBackgroundTaskController to stop
databas transaction background task.
(transactionBackgroundTaskIdentifierLock: Moved from Source/WebKit/mac/Storage/WebDatabaseManager.mm.
(setTransactionBackgroundTaskIdentifier): Ditto.
(getTransactionBackgroundTaskIdentifier): Ditto.
(+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]): Ditto.
(+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]): Ditto.
2017-02-01 Zan Dobersek <zdobersek@igalia.com>
[EME] Implement MediaKeySession::update()
https://bugs.webkit.org/show_bug.cgi?id=167636
Reviewed by Xabier Rodriguez-Calvar.
Implement the MediaKeySession::update() method by following the steps as
they are described in the specification.
In order to sanitize the passed-in response data, CDM::sanitizeResponse()
is added. It passes the SharedBuffer object by reference to the CDMPrivate
interface implementor, which returns a SharedBuffer object containing
sanitized response data.
CDMInstance::updateLicense() virtual method is added to perform the license
update for some specific CDMInstance object. After the update the CDMInstance
invokes the callback that's passed to updateLicense(), providing information
about session being closed, changed keys or expiration value, any message
that has to be enqueued, and whether the update was successful.
After that callback is invoked, MediaKeySession::update() goes on to handle
all the provided information in a future task, finally resolving the promise
(or rejecting it beforehand in case of any failure during response handling
or license update).
Three algorithms that can be invoked from MediaKeySession::update() (key
status update, expiration update and session closure) will be implemented
separately. Placeholder methods are provided until then.
MockCDM::sanitizeResponse() and MockCDMInstance::updateLicense() are
implemented for testing purposes. For now only the response sanitization
and sanitized response format are checked there. Key status update,
expiration update and session closure should be tested once the
implementations for those algorithms are added.
Test: media/encrypted-media/mock-MediaKeySession-update.html
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::sanitizeResponse):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::updateKeyStatuses):
(WebCore::MediaKeySession::updateExpiration):
(WebCore::MediaKeySession::sessionClosed):
* Modules/encryptedmedia/MediaKeySession.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeResponse):
(WebCore::MockCDMInstance::updateLicense):
* testing/MockCDMFactory.h:
2017-02-01 Eric Carlson <eric.carlson@apple.com>
[Mac] Update CARingBuffer class
https://bugs.webkit.org/show_bug.cgi?id=167656
<rdar://problem/30318329>
Unreviewed fix the 32-bit build after r211539.
* platform/audio/mac/CAAudioStreamDescription.cpp:
(WebCore::CAAudioStreamDescription::CAAudioStreamDescription):
2017-02-01 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] With visual viewports, a fixed bottom bar can be clipped out when the keyboard is visible
https://bugs.webkit.org/show_bug.cgi?id=167710
rdar://problem/30100286
Reviewed by Wenson Hsieh.
Add a bit of logging to show when RLC decides to not composite a fixed element which
is out of bounds.
Test: fast/visual-viewport/ios/bottom-bar-with-keyboard.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
2017-02-01 Eric Carlson <eric.carlson@apple.com>
[Mac] Update CARingBuffer class
https://bugs.webkit.org/show_bug.cgi?id=167656
Unreviewed build fix after r211539.
* platform/audio/mac/CAAudioStreamDescription.cpp:
(WebCore::CAAudioStreamDescription::CAAudioStreamDescription): Initialize a variable to fix
release builds.
2017-02-01 Eric Carlson <eric.carlson@apple.com>
[Mac] Update CARingBuffer class
https://bugs.webkit.org/show_bug.cgi?id=167656
Reviewed by Jer Noble.
API test CARingBufferTest added.
* WebCore.xcodeproj/project.pbxproj: Add headers to framework so they can be used from the API test.
* platform/audio/AudioStreamDescription.h: Add Int32.
* platform/audio/mac/CAAudioStreamDescription.cpp:
(WebCore::CAAudioStreamDescription::CAAudioStreamDescription):
(WebCore::CAAudioStreamDescription::~CAAudioStreamDescription):
(WebCore::CAAudioStreamDescription::format): Support Int32.
(WebCore::CAAudioStreamDescription::operator==): Make inline.
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::CARingBuffer): Move initializers into class declaration.
(WebCore::CARingBuffer::allocate): Use flush method, get allocation info from a CAAudioStreamDescription.
(WebCore::FetchABL): Add a mode parameter to allow samples to replace or mix into destination.
(WebCore::CARingBuffer::flush): New.
(WebCore::CARingBuffer::fetch): Add mode parameter.
(WebCore::CARingBuffer::~CARingBuffer): Deleted.
* platform/audio/mac/CARingBuffer.h:
(WebCore::CARingBuffer::~CARingBuffer):
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::prepare): Use new CARingBuffer constructor.
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::prepare): Use new CARingBuffer constructor
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.
2017-02-01 Zalan Bujtas <zalan@apple.com>
Simple line layout: Move TextFragmentIterator::runWidth to ::textWidth.
https://bugs.webkit.org/show_bug.cgi?id=167705
<rdar://problem/30314393>
Reviewed by Antti Koivisto.
We also don't need to compute logicalHeight for logicalLeft/right since the
cases where it matters (floating boxes) are not supported by simple line layout.
Covered by existing test.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::updateLineConstrains):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth): Deleted.
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-02-01 Jer Noble <jer.noble@apple.com>
Fix compilation error under recent clang update
https://bugs.webkit.org/show_bug.cgi?id=167707
Reviewed by Eric Carlson.
Include TypedArrayInlines.h to fix a "missing symbol" link error when compiling under a recent clang update.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2017-02-01 Joseph Pecoraro <pecoraro@apple.com>
Performance Timeline: Prepare for Worker support
https://bugs.webkit.org/show_bug.cgi?id=167633
Reviewed by Ryosuke Niwa.
Remove references to Document/Frame in Performance. Instead use
ScriptExecutionContext and pass in the time origin / SecurityOrigin
where it is relevant. No tests should change this is just refactoring.
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::performance):
* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::now):
(WebCore::Performance::reduceTimeResolution):
(WebCore::Performance::navigation):
(WebCore::Performance::timing):
(WebCore::Performance::addResourceTiming):
(WebCore::Performance::scriptExecutionContext): Deleted.
* page/Performance.h:
* page/Performance.idl:
* page/PerformanceResourceTiming.cpp:
(WebCore::monotonicTimeToDOMHighResTimeStamp):
(WebCore::passesTimingAllowCheck):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::redirectStart):
(WebCore::PerformanceResourceTiming::redirectEnd):
(WebCore::PerformanceResourceTiming::fetchStart):
(WebCore::PerformanceResourceTiming::domainLookupStart):
(WebCore::PerformanceResourceTiming::domainLookupEnd):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
(WebCore::PerformanceResourceTiming::secureConnectionStart):
(WebCore::PerformanceResourceTiming::requestStart):
(WebCore::PerformanceResourceTiming::responseStart):
(WebCore::PerformanceResourceTiming::responseEnd):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
(WebCore::monotonicTimeToDocumentMilliseconds): Deleted.
(WebCore::PerformanceResourceTiming::initiatorType): Deleted.
(WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds): Deleted.
* page/PerformanceResourceTiming.h:
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::findExistingMarkStartTime):
2017-02-01 Chris Dumez <cdumez@apple.com>
REGRESSION(r205136): {}.toString.call(crossOriginWindow) should not throw
https://bugs.webkit.org/show_bug.cgi?id=167681
<rdar://problem/30301117>
Reviewed by Mark Lam.
As per https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-):
"""
If P is @@toStringTag, @@hasInstance, or @@isConcatSpreadable, then return
PropertyDescriptor{ [[Value]]: undefined, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
"""
We now implement this behavior instead of throwing.
Test: http/tests/security/symbols-cross-origin.html
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):
2017-02-01 Brent Fulgham <bfulgham@apple.com>
Correct "filesHaveSameVolume" predicate
https://bugs.webkit.org/show_bug.cgi?id=167696
<rdar://problem/30298722>
Reviewed by David Kilzer.
We are passing %-encoded strings to the underlying operating system's file system APIs.
This doesn't work. Instead, we need to present a decoded version of the file path
that matches what the system APIs expect.
Tested by new TestWebKitAPI Test.
* platform/FileSystem.cpp:
(WebCore::filesHaveSameVolume): Make sure the file paths we give to the underlying
operating system are not percent encoded.
* platform/FileSystem.h: Export 'filesHaveSameVolume' for use by testing system.
2017-02-01 Antoine Quint <graouts@apple.com>
[mac-wk1] LayoutTest media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=165319
<rdar://problem/30284104>
Reviewed by Dean Jackson.
Running media/controls/track-menu.html before media/modern-media-controls/tracks-support/tracks-
support-click-track-in-panel.html makes that test time out in all test runs. The root of the issue
is that animations are suspended by media/controls/track-menu.html with a call to
internals.suspendAnimations(), and that state isn't reset with a call to internals.resumeAnimations().
Then, media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html fails because
the selection animation for the tracks panel menu item that is clicked never completes and the delegate
to notify that an item in the tracks panel was selected is never fired, which leads to the test failure.
We change Internals::suspendAnimations() and Internals::resumeAnimations() to only affect the current
document, rather than calling into AnimationController::suspendAnimations() which would do just that,
but also set a Frame-wide flag that would prevent further animations from running, even in a subsequent
document load.
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Ensure the document that is about to be destroyed is no longer
associated with an AnimationController.
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::ensureCompositeAnimation): Update the animation's suspend state in case
the document its renderer is associated with is suspended. This is required since previously CompositeAnimations
would set their suspend state in their constructor, based on the Frame-wide suspended state, but there is no
document to use as a basis to query its suspended state in that constructor.
(WebCore::AnimationControllerPrivate::animationsAreSuspendedForDocument):
(WebCore::AnimationControllerPrivate::detachFromDocument):
(WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
(WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
(WebCore::AnimationControllerPrivate::startAnimationsIfNotSuspended):
(WebCore::AnimationController::animationsAreSuspendedForDocument):
(WebCore::AnimationController::detachFromDocument):
* page/animation/AnimationController.h:
* page/animation/AnimationControllerPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::animationsAreSuspended):
(WebCore::Internals::suspendAnimations):
(WebCore::Internals::resumeAnimations):
2017-02-01 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed build fix after r211488.
* accessibility/AXObjectCache.h: Removed property svn:executable.
2017-02-01 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix.
* html/HTMLMediaElement.h: Removed property svn:executable.
2017-02-01 Jer Noble <jer.noble@apple.com>
NULL-deref crash in TextTrack::removeCue()
https://bugs.webkit.org/show_bug.cgi?id=167615
Reviewed by Eric Carlson.
Test: http/tests/media/track-in-band-hls-metadata-crash.html
Follow-up to r211401. When passing around a reference to an object, the assumption is that
the caller is retaining the underlying object. This breaks down for
InbandDataTextTrack::removeDataCue(), which releases its own ownership of the cue object,
then passes the reference to that object to its superclass to do further remove steps. The
retain count of the cue can thus drop to zero within the scope of
InbandTextTrack::removeCue(). Use "take" semantics to remove the cue from the
m_incompleteCueMap without releasing ownership, and pass a reference to that retained object
on to removeCue(), guaranteeing that the cue will not be destroyed until after the
romeveDataCue() method returns.
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::removeDataCue):
2017-02-01 Nan Wang <n_wang@apple.com>
AX: Incorrect range from index and length in text controls when there are newlines
https://bugs.webkit.org/show_bug.cgi?id=167677
<rdar://problem/30300099>
Reviewed by Chris Fleizach.
When there are newlines in text controls, the VisiblePosition that is created
from the index could be wrong. Because the index doesn't include the information
regarding a position's affinity. Fixed it by using CharacterOffset instead, since
it doesn't require that information.
Test: accessibility/mac/range-for-contenteditable-newline.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::nextCharacterOffset):
(WebCore::AXObjectCache::characterOffsetForIndex):
2017-02-01 Timothy Hatcher <timothy@hatcher.name>
AXObjectCache is missing two functions at link time when !HAVE(ACCESSIBILITY)
https://bugs.webkit.org/show_bug.cgi?id=167691
Reviewed by Chris Fleizach.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::recomputeDeferredIsIgnored): Added empty stub.
(WebCore::AXObjectCache::performDeferredIsIgnoredChange): Added empty stub.
2017-02-01 Timothy Hatcher <timothy@hatcher.name>
HTMLMediaElement.h fails to build when ENABLE(MEDIA_CONTROLS_SCRIPT) is false
https://bugs.webkit.org/show_bug.cgi?id=167689
Reviewed by Joseph Pecoraro.
* html/HTMLMediaElement.h: Move mediaControlsHost() into the ENABLE(MEDIA_CONTROLS_SCRIPT)
block that is just above it to match m_mediaControlsHost.
2017-02-01 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableByteStreamController pull()
https://bugs.webkit.org/show_bug.cgi?id=167593
Reviewed by Youenn Fablet.
Implemented pull() method for ReadableByteStreamController. Also updated
pendingPullIntos attribute, which was a more complex object than necessary
(an array is enough).
Added 2 tests that allow covering most of new code. Code not yet tested will
become reachable as the rest of the spec is implemented (new tests will then
be added).
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Updated pendingPullIntos.
(readableByteStreamControllerCancel): Updated pendingPullIntos.
(readableByteStreamControllerClose): Updated pendingPullIntos.
(readableByteStreamControllerHandleQueueDrain): Added.
(readableByteStreamControllerPull): Added.
2017-02-01 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] qtdemux: Update the tfdt patch to the version finally accepted upstream
https://bugs.webkit.org/show_bug.cgi?id=166529
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline): Don't use the "always-honor-tfdt" property
in qtdemux anymore.
2017-02-01 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, build fix for macOS and iOS ports, part 2
Annotate the function with static.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::rejectToPropagateNetworkError):
2017-02-01 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, build fix for macOS and iOS ports
* bindings/js/ModuleFetchFailureKind.h: Renamed from Source/ModuleFetchFailureKind.h.
2017-02-01 Yusuke Suzuki <utatane.tea@gmail.com>
Propagate networking errors correctly for import() operator
https://bugs.webkit.org/show_bug.cgi?id=167501
Reviewed by Ryosuke Niwa.
We use the promise chain inside the module loader pipeline.
The problem is that,
1. The errors of loading module scripts are propagated through the promise's rejection.
2. Some module related errors like syntax error (when scanning module dependencies) are
reported at loading time (evaluating time). These errors are propagated through the
promise rejections and dumped to the console. LoadableModuleScript set catch handler
for that and print these errors to the console for ScriptElement.
3. Some of errors are already reported to the console. For example, networking errors
are reported by the CachedModuleLoader.
4. But there is no way to distinguish between (2) and (3) at the catch handler.
Previously, we propagate the special symbol for the already reported errors to distinguish
that. This was OK because these errors cannot be catched by the user code. However,
recent `import()` call needs to expose these errors to the user code. So now, accidentally,
the special purpose symbol is exposed.
Instead of propagating the special symbol, this patch just propagates the errors. But these
error objects are annotated with the private symbol. So these errors can be distinguished
from the other ones.
Currently, we do not have the way to expose the error details to the client of the
CachedScript. So we just report the error with the failed / canceled. This should be
more descriptive error messages in the separate patch[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=167553
Tests: http/tests/security/mixedContent/import-insecure-script-in-iframe.html
js/dom/modules/import-not-found-error.html
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::resolveWithCallback):
(WebCore::DeferredPromise::rejectWithCallback):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::moduleLoaderAlreadyReportedErrorSymbol): Deleted.
(WebCore::ScriptController::moduleLoaderFetchingIsCanceledSymbol): Deleted.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::rejectToPropagateNetworkError):
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/WebCoreBuiltinNames.h:
2017-01-31 Wenson Hsieh <wenson_hsieh@apple.com>
Regression (Safari 10.1): Pressing Return in a contenteditable no longer inserts a line break under certain conditions
https://bugs.webkit.org/show_bug.cgi?id=167525
<rdar://problem/30270210>
Reviewed by Ryosuke Niwa.
Test: fast/events/input-events-insert-newlines-after-mutation.html
Reverts an unintended change made while refactoring code for input events that caused input events to be
dispatched immediately rather than on the scoped queue. Normally, input events are dispatched in
CompositeEditCommand::apply after the end of the scope, but TypingCommands may fire input events *from within*
the scope by calling typingAddedToOpenCommand.
Instead, TypingCommands should always dispatch events
synchronously after the end of the scoped queue in CompositeEditCommand::apply, but this is a riskier change
than we should currently allow, so we should revert to our old behavior for the time being.
* editing/Editor.cpp:
2017-01-31 Zalan Bujtas <zalan@apple.com>
Simple line layout: Do not assert on zero length/width trailing whitespace.
https://bugs.webkit.org/show_bug.cgi?id=167679
Reviewed by Simon Fraser.
It's valid to have an zero length/width trailing whitespace.
Covered by existing tests.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace): Zero length -> nothing to do.
Zero width with length > 0 (font-size: 0) -> remove trailing run.
2017-01-31 Alex Christensen <achristensen@webkit.org>
Fix debug libwebrtc build after r211439
https://bugs.webkit.org/show_bug.cgi?id=167572
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
(WebCore::LibWebRTCAudioModule::OnMessage):
2017-01-31 Zalan Bujtas <zalan@apple.com>
Simple line layout: Collect fragments in LineState only when needed for post-processing.
https://bugs.webkit.org/show_bug.cgi?id=167655
<rdar://problem/30290592>
Reviewed by Antti Koivisto.
The fragments we need to keep around for basic line breaking are the last and last non-whitespace fragments.
However in certain cases such as text-align: justify, we have to traverse the entire line
at post-processing which requires all the fragments on the current line.
This patch speeds up the basic line handling by using m_fragment list only for the special cases.
It improves PerformanceTests/Layout/simple-line-layout-non-repeating-text.html by ~7% (local measurement)
median: 114.25 runs/s -> median: 122.16 runs
Covered by existing tests.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::setNeedsAllFragments):
(WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace):
(WebCore::SimpleLineLayout::LineState::lastFragment):
(WebCore::SimpleLineLayout::LineState::expansionOpportunityCount):
(WebCore::SimpleLineLayout::LineState::isEmpty):
(WebCore::SimpleLineLayout::LineState::endPositionForCollapsedFragment):
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Track uncompleted width.
(WebCore::SimpleLineLayout::LineState::revertToLastCompleteFragment):
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
(WebCore::SimpleLineLayout::removeTrailingWhitespace):
(WebCore::SimpleLineLayout::updateLineConstrains): Set the slow path for text-align: justify.
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
(WebCore::SimpleLineLayout::createTextRuns):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isValid):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::length):
2017-01-31 Chris Dumez <cdumez@apple.com>
com.apple.WebKit.WebContent.Development crashed in com.apple.WebCore: WebCore::FrameView::didDestroyRenderTree
https://bugs.webkit.org/show_bug.cgi?id=167665
<rdar://problem/30241193>
Reviewed by Andreas Kling.
When destroying a PageCache entry, we would call Document::prepareFromDestruction()
which would destroy the render tree and then call FrameView::didDestroyRenderTree().
We would sometimes hit the ASSERT(m_widgetsInRenderTree.isEmpty()) assertion in
didDestroyRenderTree(). This indicates that there are still RenderWidgets associated
with the FrameView even though we claim we already destroyed the render tree.
The reason for this is that, in the PageCache context, the top document's frame is
reused on navigation and may not be associated with a new document that is currently
displayed, has a render tree (and possible RenderWidgets). The solution proposed is
to stop calling FrameView::didDestroyRenderTree() in Document::prepareFromDestruction()
if the frame's document is not |this|. This happens when the document is destroyed
while in PageCache. We do not want to mess with the frame / frameview in this case
since they are no longer associated to the present document anymore.
No new tests, already covered by existing tests which currently crash flakily.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
2017-01-31 Sam Weinig <sam@webkit.org>
Remove unused/rarely used bindings helpers
https://bugs.webkit.org/show_bug.cgi?id=167648
Reviewed by Anders Carlsson.
* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
(WebCore::jsString): Deleted.
(WebCore::jsStringOrUndefined): Deleted.
(WebCore::finiteInt32Value): Deleted.
(WebCore::toJS): Deleted.
Remove unused functions. The toJS overrides can be replaced with their
modern JSDOMConvert counterparts.
* bindings/js/JSDOMExceptionHandling.h:
(WebCore::toJS): Deleted.
(WebCore::toJSNewlyCreated): Deleted.
Remove unused functions.
* bindings/js/JSDOMIterator.h:
Add more specific include of JSDOMConvert.h to fix compile.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject):
Create the Symbol directly, instead of using the toJS override.
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
Use JSDOMConvert toJS function.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::retrieveResponse):
Use JSDOMConvert toJS functions.
* bindings/js/ScriptController.h:
Add missing forward declaration of URL.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::resolve):
Create the Symbol directly, instead of using the toJS override.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
Use JSDOMConvert toJS functions.
2017-01-31 Wenson Hsieh <wenson_hsieh@apple.com>
WebItemProviderPasteboard should be robust when UIItemProvider fails to initialize an object
https://bugs.webkit.org/show_bug.cgi?id=167663
<rdar://problem/30294240>
Reviewed by Tim Horton.
Adds a nil check for the result of -createObjectOfClass:error:.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):
2017-01-31 Keith Rollin <krollin@apple.com>
Variable used after it's been WTFMove'd
https://bugs.webkit.org/show_bug.cgi?id=167658
Reviewed by Chris Dumez.
Rather than WTFMoving the variable as part of passing it to a function
that takes an RValue-ref, call copyRef to provide the RValue-ref. This
preserves the original variable for later use in the function.
No new tests -- this issue was found by inspection. It's not apparent
what the side-effect of this bug is or how a test would verify it.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveDataOrBuffer):
2017-01-31 Anders Carlsson <andersca@apple.com>
Apple Pay button does nothing on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=167664
rdar://problem/30273885
Reviewed by Sam Weinig.
Separate line item validation into convertAndValidateTotal and convertAndValidate. The former
works on totals (which require an amount), and the latter works on regular line items that do not require an amount
if the item type is "pending".
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidateTotal):
(WebCore::convertAndValidate):
Only check the amount if the type is not pending.
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
Call convertAndValidateTotal for totals.
2017-01-31 Youenn Fablet <youenn@apple.com>
[WebRTC] Add a libwebrtc AudioModule specific to WebKit
https://bugs.webkit.org/show_bug.cgi?id=167572
Reviewed by Alex Christensen.
To be covered by webrtc audio tests.
Adding an AudioModule to circumvent the default LibWebRTC Audio Module which does the audio directly.
The implementation of the AudioModule is restricted to enable fueling the incoming audio tracks with incoming data.
Code inspired from https://chromium.googlesource.com/chromium/src/+/master/remoting/protocol/webrtc_audio_module.h
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp: Added.
(WebCore::LibWebRTCAudioModule::LibWebRTCAudioModule):
(WebCore::LibWebRTCAudioModule::RegisterAudioCallback):
(WebCore::LibWebRTCAudioModule::OnMessage):
(WebCore::LibWebRTCAudioModule::StartPlayout):
(WebCore::LibWebRTCAudioModule::StopPlayout):
(WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
(WebCore::LibWebRTCAudioModule::PollFromSource):
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::ThreadMessageData::ThreadMessageData):
(WebCore::initializePeerConnectionFactoryAndThreads):
2017-01-31 Jessie Berlin <jberlin@webkit.org>
Build fix.
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::takeFindStringFromSelection):
(WebCore::Editor::replaceNodeFromPasteboard):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingDataTransfer):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::createForCopyAndPaste):
(WebCore::Pasteboard::createForDragAndDrop):
2017-01-31 Eric Carlson <eric.carlson@apple.com>
[Mac] Add an audio stream description class
https://bugs.webkit.org/show_bug.cgi?id=167639
Reviewed by Youenn Fablet.
No new tests, the new class is not used yet.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/AudioStreamDescription.h: Added.
(WebCore::AudioStreamDescription::isPCM):
* platform/audio/mac/CAAudioStreamDescription.cpp: Added.
(WebCore::CAAudioStreamDescription::CAAudioStreamDescription):
(WebCore::CAAudioStreamDescription::platformDescription):
(WebCore::CAAudioStreamDescription::format):
(WebCore::toCAAudioStreamDescription):
(WebCore::CAAudioStreamDescription::operator==):
(WebCore::operator==):
* platform/audio/mac/CAAudioStreamDescription.h: Added.
(WebCore::operator!=):
(WebCore::CAAudioStreamDescription::bytesPerFrame):
(WebCore::CAAudioStreamDescription::bytesPerPacket):
(WebCore::CAAudioStreamDescription::formatFlags):
(WebCore::CAAudioStreamDescription::operator==):
(WebCore::CAAudioStreamDescription::operator!=):
(WebCore::CAAudioStreamDescription::streamDescription):
2017-01-31 Youenn Fablet <youenn@apple.com>
RTCPeerConnection methods can take dictionaries as input
https://bugs.webkit.org/show_bug.cgi?id=167590
Reviewed by Alex Christensen.
Test: webrtc/rtcpeerconnection-error-messages.html
Made addIceCandidate/setRemoteDescription/setLocalDescription take either dictionaries or objects as parameter.
Spec only mandates this for addIceCandidate, but sites may be using the old version for setRemoteDescription and setLocalDescription.
Updated RTCPeerConnection methods error messages.
* Modules/mediastream/RTCPeerConnection.js:
(getLocalStreams):
(getStreamById):
(addStream):
(createOffer):
(createAnswer):
(setLocalDescription):
(setRemoteDescription):
(addIceCandidate):
(getStats):
* Modules/mediastream/RTCPeerConnectionInternals.js:
2017-01-31 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r209411): Scrolling to a fragment identifier in overflow:scroll inside position:fixed no longer works
https://bugs.webkit.org/show_bug.cgi?id=167630
rdar://problem/30091558
Reviewed by Zalan Bujtas.
r209411 added special handling for scrolling inside position:fixed, but cut off all scrolling, breaking
overflow:scroll inside position:fixed. Fix by only handling the position:fixed case when we get to
the root layer, which is where we scroll the document.
Test: fast/overflow/scroll-anchor-in-overflow-in-position-fixed.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::getRectToExpose):
2017-01-31 Zan Dobersek <zdobersek@igalia.com>
[EME] InitDataRegistry should use base64url encoding and decoding for keyids
https://bugs.webkit.org/show_bug.cgi?id=167592
Reviewed by Jer Noble.
In InitDataRegistry, WTF::base64URLEncode() and WTF::base64URLDecode() should
be used to encode and decode the 'keyids' initialization data format, as
required by the relevant specification.
https://w3c.github.io/encrypted-media/format-registry/initdata/keyids.html#format
Relevant test case was added to media/encrypted-media/mock-MediaKeySession-generateRequest.html.
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids):
(WebCore::sanitizeKeyids):
2017-01-31 Joseph Pecoraro <pecoraro@apple.com>
Performance Timeline: Add serializer to PerformanceEntry
https://bugs.webkit.org/show_bug.cgi?id=167632
Reviewed by Ryosuke Niwa.
Test: performance-api/performance-timeline-serializers.html
* page/PerformanceEntry.idl:
2017-01-31 Chris Fleizach <cfleizach@apple.com>
AX: enable search predication for iOS
https://bugs.webkit.org/show_bug.cgi?id=167558
<rdar://problem/30251367>
Reviewed by Joanmarie Diggs.
Move the code to support accessibility searching into a shared place so it can be used by iOS.
Test: accessibility/ios-simulator/ios-search-predicate.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityFindMatchingObjects:]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray):
(createAccessibilitySearchKeyMap):
(accessibilitySearchKeyForString):
(accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilitySearchKeyMap): Deleted.
(accessibilitySearchKeyForString): Deleted.
(accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute): Deleted.
(convertToNSArray): Deleted.
2017-01-30 Joseph Pecoraro <pecoraro@apple.com>
[WebIDL] Add support for inherit serializer attribute
https://bugs.webkit.org/show_bug.cgi?id=167274
Reviewed by Darin Adler.
Support for serializer { inherit }, which will be used by Resource Timing.
https://heycam.github.io/webidl/#idl-serializers
* bindings/scripts/CodeGenerator.pm:
(GetInterfaceForAttribute):
(IsSerializableAttribute):
Determine if an attribute is serializable at generation time so we can
verify types. This allows us to support typedefs. We don't yet support
serializing an attribute that is itself a serializable interface.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
(GenerateSerializerAttributesForInterface):
Generate inherited attributes first, then generate our own list.
Explicitly provided attribute names are expected to be serializable,
so produce an error if they are not.
* bindings/scripts/IDLParser.pm:
(parseSerializationAttributes):
Update parsing of serializer attributes to allow for multiple
special strings. The spec does not precisely define where the
special "attribute" keyword is allowed.
(applyMemberList):
(isSerializableAttribute): Deleted.
Move serializable attribute checking to generation.
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp: Added.
* bindings/scripts/test/JS/JSTestSerializationInherit.h: Added.
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: Added.
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: Added.
The toJSON implementations are the most interesting.
* bindings/scripts/test/TestSerialization.idl:
Extend this test for typedefed attributes that are serializable.
Change TestNode (a serializable Interface) to TestException (an
unserializable Interface) for expected behavior of an
unserializable attribute.
* bindings/scripts/test/TestSerializationInherit.idl:
Test for { inherit, attribute }.
* bindings/scripts/test/TestSerializationInheritFinal.idl:
Test for { inherit, attribute_names... }, and multi-level inherit.
2017-01-30 Joseph Pecoraro <pecoraro@apple.com>
Implement PerformanceObserver
https://bugs.webkit.org/show_bug.cgi?id=167546
<rdar://problem/30247959>
Reviewed by Ryosuke Niwa.
This implements PerformanceObserver from Performance Timeline Level 2:
https://w3c.github.io/performance-timeline/
Tests: performance-api/performance-observer-api.html
performance-api/performance-observer-basic.html
performance-api/performance-observer-callback-mutate.html
performance-api/performance-observer-callback-task.html
performance-api/performance-observer-entry-sort.html
performance-api/performance-observer-exception.html
performance-api/performance-observer-nested.html
performance-api/performance-observer-order.html
performance-api/performance-observer-periodic.html
performance-api/performance-timeline-api.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
New files.
* page/Performance.h:
* page/Performance.cpp:
(WebCore::Performance::mark):
(WebCore::Performance::measure):
(WebCore::Performance::registerPerformanceObserver):
(WebCore::Performance::unregisterPerformanceObserver):
(WebCore::Performance::queueEntry):
Register PerformanceObservers with the Performance object.
When new PerformanceEntries are created (Mark and Measure
right now) check them against observers.
* page/PerformanceEntry.cpp:
(WebCore::PerformanceEntry::PerformanceEntry):
(WebCore::PerformanceEntry::typeForEntryTypeString):
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::type):
Give PerformanceEntry a convenience enum for easy comparison
and to know if it is one of the built-in known types (which the
PerformanceObserver API takes into account).
* page/PerformanceObserver.cpp: Added.
(WebCore::PerformanceObserver::PerformanceObserver):
(WebCore::PerformanceObserver::observe):
(WebCore::PerformanceObserver::disconnect):
(WebCore::PerformanceObserver::queueEntry):
(WebCore::PerformanceObserver::deliver):
* page/PerformanceObserver.h:
(WebCore::PerformanceObserver::create):
(WebCore::PerformanceObserver::typeFilter):
- TypeErrors on observe bad behavior
- Completely replace types filter on observe
- Handle register and unregister
- Handle calling the callback
* page/PerformanceObserverCallback.idl: Added.
* page/PerformanceObserverEntryList.cpp: Added.
(WebCore::PerformanceObserverEntryList::PerformanceObserverEntryList):
(WebCore::PerformanceObserverEntryList::getEntries):
(WebCore::PerformanceObserverEntryList::getEntriesByType):
(WebCore::PerformanceObserverEntryList::getEntriesByName):
* page/PerformanceObserverEntryList.h:
(WebCore::PerformanceObserverEntryList::create):
* page/PerformanceObserverEntryList.idl: Added.
Implement sorting and filtering of entries.
* page/PerformanceObserver.idl: Added.
* page/PerformanceObserverCallback.h:
(WebCore::PerformanceObserverCallback::~PerformanceObserverCallback):
Mostly autogenerated.
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::mark):
(WebCore::UserTiming::measure):
* page/PerformanceUserTiming.h:
Update these to return the entry so it can be passed on to
any interested PerformanceObservers.
2017-01-30 Youenn Fablet <youenn@apple.com>
[WebRTC] getStats does not support legacy callback
https://bugs.webkit.org/show_bug.cgi?id=167617
Reviewed by Alex Christensen.
Covered by updated tests.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
(WebCore::RTCPeerConnection::privateGetStats): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnection.js:
(addIceCandidate):
(getStats): Deleted.
2017-01-30 Sam Weinig <sam@webkit.org>
JSDOMBinding is too big. Split it up!
https://bugs.webkit.org/show_bug.cgi?id=167601
Reviewed by Darin Adler.
Splits JSDOMBinding.h/cpp up a bit by splitting out:
- JSDOMBindingCaller.h
- JSDOMBindingSecurity.h/cpp
- JSDOMExceptionHandling.h/cpp
- JSDOMWrapperCache.h/cpp
Also:
- Moves all constructor objects to JSDOMConstructor.h/cpp,
- Moves special DOMWindow accessors to JSDOMWindowBase.
- Deletes unused CallbackFunction.h/cpp
* CMakeLists.txt:
* Modules/webdatabase/Database.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CallbackFunction.cpp: Removed.
* bindings/js/CallbackFunction.h: Removed.
* bindings/js/DOMConstructorWithDocument.h: Removed.
* bindings/js/JSCryptoCustom.cpp:
* bindings/js/JSCustomXPathNSResolver.cpp:
* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMBindingCaller.h: Copied from Source/WebCore/bindings/js/JSDOMBinding.h.
* bindings/js/JSDOMBindingSecurity.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMBindingSecurity.h: Copied from Source/WebCore/bindings/js/JSDOMBinding.h.
* bindings/js/JSDOMConstructor.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMConstructor.h:
* bindings/js/JSDOMConvert.h:
* bindings/js/JSDOMExceptionHandling.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMExceptionHandling.h: Copied from Source/WebCore/bindings/js/JSDOMBinding.h.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::callerDOMWindow): Moved from JSDOMBinding.h
(WebCore::activeDOMWindow): Moved from JSDOMBinding.h
(WebCore::firstDOMWindow): Moved from JSDOMBinding.h
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDOMWindowProperties.cpp:
* bindings/js/JSDOMWrapperCache.cpp: Copied from Source/WebCore/bindings/js/JSDOMBinding.cpp.
* bindings/js/JSDOMWrapperCache.h: Copied from Source/WebCore/bindings/js/JSDOMBinding.h.
* bindings/js/JSEventTargetCustom.h:
* bindings/js/JSHTMLElementCustom.cpp:
* bindings/js/JSLocationCustom.cpp:
* bindings/js/JSMutationObserverCustom.cpp:
* bindings/js/JSSQLStatementErrorCallbackCustom.cpp:
* bindings/js/JSStorageCustom.cpp:
* bindings/js/JSWorkerCustom.cpp:
* bindings/js/JSXPathNSResolverCustom.cpp:
* bindings/js/ScheduledAction.cpp:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptController.h:
* bindings/js/ScriptGlobalObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/StructuredClone.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateCallWith):
(GenerateParametersCheck):
(GenerateCallbackImplementationContent):
(NativeToJSValue):
* bridge/objc/WebScriptObject.mm:
* html/HTMLFrameElementBase.cpp:
* html/HTMLVideoElement.cpp:
* inspector/InspectorController.cpp:
* inspector/InspectorDOMAgent.cpp:
* inspector/PageScriptDebugServer.cpp:
* inspector/WorkerScriptDebugServer.cpp:
2017-01-30 Andy Estes <aestes@apple.com>
[QuickLook] FrameLoaderClient should return the new QuickLookHandleClient it creates
https://bugs.webkit.org/show_bug.cgi?id=167625
Reviewed by Andreas Kling.
QuickLookHandleClients were being created by QuickLookHandle calling
FrameLoaderClient::didCreateQuickLookHandle() then having the FrameLoaderClient create a new
QuickLookHandleClient and set it using QuickLookHandle::setClient().
Since all FrameLoaderClient::didCreateQuickLookHandle() does is create a new
QuickLookHandleClient, this patch changes the FrameLoaderClient function to return the new
QuickLookHandleClient directly and removes the API from QuickLookHandle to set a client.
This also removes previewFileName() and previewUTI() from QuickLookHandle and instead passes
these as arguments to the FrameLoaderClient.
No change in behavior. Covered by existing tests.
* loader/EmptyClients.cpp: Added an implementation of createQuickLookHandleClient() that
returns nullptr.
* loader/FrameLoaderClient.h: Declared createQuickLookHandleClient() and removed
didCreateQuickLookHandle().
* loader/ios/QuickLook.h: Removed setClient(), previewFileName(), and previewUTI().
* loader/ios/QuickLook.mm: Removed testingOrEmptyClient().
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:quickLookHandle:]): Set _client
to testingClient() if it exists, otherwise set it to the client returned by
FrameLoaderClient::createQuickLookHandleClient() it non-null, otherwise set it to
emptyClient().
(testingOrEmptyClient): Deleted.
(-[WebPreviewLoader setClient:]): Deleted.
(-[WebPreviewLoader converter]): Deleted.
(WebCore::QuickLookHandle::setClient): Deleted.
(WebCore::QuickLookHandle::previewFileName): Deleted.
(WebCore::QuickLookHandle::previewUTI): Deleted.
2017-01-30 Jer Noble <jer.noble@apple.com>
NULL-deref crash in TextTrack::removeCue()
https://bugs.webkit.org/show_bug.cgi?id=167615
Reviewed by Eric Carlson.
It's possible for a track to be removed which was never actually added to the cue list.
Specifically, if an in-band track with a negative start or end time was parsed, it would
have been rejected by TextTrack::addCue(). When it comes time to flush those in-band cues,
TextTrack::m_cues will still be NULL. Rather than ASSERT in this case, we should revert the
behavior added in r210319 and throw an exception.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::removeCue):
2017-01-30 Andreas Kling <akling@apple.com>
Fix CMSampleBuffer leak in MediaSampleAVFObjC::createNonDisplayingCopy().
<https://webkit.org/b/167621>
Reviewed by Andy Estes.
We were failing to adopt the CMSampleBuffer after copying it. Seen on leaks bot.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy):
2017-01-30 Andy Estes <aestes@apple.com>
[QuickLook] QLPreviewConverter and QuickLookHandle have different lifetime requirements
https://bugs.webkit.org/show_bug.cgi?id=167609
Reviewed by Andreas Kling.
Currently, QuickLookHandles are owned by DocumentLoader so that the underlying
QLPreviewConverter stays alive to service subresource requests. However, the QuickLookHandle
itself only needs to live long enough to handle the main resource load. And in a follow-on
patch we will need to create QLPreviewConverters independent of QuickLookHandle.
This patch moves ownership of QuickLookHandle from DocumentLoader to ResourceLoader. It also
creates a C++ wrapper around QLPreviewConverter and teaches QuickLookHandle to transfer
ownership of the wrapper to DocumentLoader once the main resource conversion is complete.
No change in behavior. Covered by existing tests.
* WebCore.xcodeproj/project.pbxproj: Added PreviewConverter.{h,mm}.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setPreviewConverter): Renamed from setQuickLookHandle().
(WebCore::DocumentLoader::previewConverter): Renamed from quickLookHandle().
(WebCore::DocumentLoader::setQuickLookHandle): Renamed to setPreviewConverter().
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::quickLookHandle): Renamed to quickLookHandle().
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal): Changed to call PreviewConverter::safeRequest().
(WebCore::ResourceLoader::isQuickLookResource): Changed to check if m_quickLookHandle is null.
(WebCore::ResourceLoader::didCreateQuickLookHandle): Deleted.
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreateQuickLookHandleForResponse): Changed to access m_quickLookHandle.
(WebCore::SubresourceLoader::didReceiveResponse): Ditto.
(WebCore::SubresourceLoader::didReceiveData): Ditto.
(WebCore::SubresourceLoader::didReceiveBuffer): Ditto.
(WebCore::SubresourceLoader::didFinishLoading): Ditto.
(WebCore::SubresourceLoader::didFail): Ditto.
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::finishLoading): Wrapped the call to ResourceLoader::isQuickLookResource() in USE(QUICK_LOOK).
* loader/ios/QuickLook.h: Renamed m_converter to m_previewLoader.
* loader/ios/QuickLook.mm: Renamed WebPreviewConverter to WebPreviewLoader.
(WebCore::registerQLPreviewConverterIfNeeded): Created a PreviewConverter instead of a QLPreviewConverter.
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:quickLookHandle:]): Ditto.
(-[WebPreviewLoader appendDataArray:]): Accessed the QLPreviewConverter from the PreviewConverter.
(-[WebPreviewLoader finishedAppending]): Ditto.
(-[WebPreviewLoader failed]): Ditto.
(-[WebPreviewLoader converter]): Renamed from platformConverter. Returns a pointer to the PreviewConverter.
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): Moved _converter to DocumentLoader.
(-[WebPreviewLoader connection:didFailWithError:]): Created a PreviewConverter instead of a QLPreviewConverter.
(WebCore::QuickLookHandle::QuickLookHandle): Called FrameLoaderClient::didCreateQuickLookHandle() instead of going through FrameLoader.
(WebCore::QuickLookHandle::didReceiveData): Renamed m_converter to m_previewLoader.
(WebCore::QuickLookHandle::didReceiveBuffer): Ditto.
(WebCore::QuickLookHandle::didFinishLoading): Ditto.
(WebCore::QuickLookHandle::didFail): Ditto.
(WebCore::QuickLookHandle::setClient): Ditto.
(WebCore::QuickLookHandle::previewFileName): Ditto.
(WebCore::QuickLookHandle::previewUTI): Ditto.
(WebCore::QuickLookHandle::willSendRequest): Deleted.
* platform/ios/QuickLookSoftLink.h: Removed soft-linking of QLPreviewConverter and kQLPreviewOptionPasswordKey.
* platform/ios/QuickLookSoftLink.mm: Ditto.
* platform/network/ios/PreviewConverter.h: Added.
(WebCore::PreviewConverter::platformConverter): Added. Returns the underlying QLPreviewConverter.
* platform/network/ios/PreviewConverter.mm: Added.
(WebCore::optionsWithPassword): Creates a dictionary with the kQLPreviewOptionPasswordKey option set if password is non-null.
(WebCore::PreviewConverter::PreviewConverter): Added constructors for the delegate/response and data/uti cases.
(WebCore::PreviewConverter::safeRequest): Wraps -[QLPreviewConverter safeRequestForRequest:].
(WebCore::PreviewConverter::previewRequest): Wraps -[QLPreviewConverter previewRequest].
(WebCore::PreviewConverter::previewResponse): Wraps -[QLPreviewConverter previewResponse].
(WebCore::PreviewConverter::previewFileName): Wraps -[QLPreviewConverter previewFileName].
(WebCore::PreviewConverter::previewUTI): Wraps -[QLPreviewConverter previewUTI].
2017-01-30 Chris Dumez <cdumez@apple.com>
Drop legacy Attributes.isId attribute
https://bugs.webkit.org/show_bug.cgi?id=167603
Reviewed by Ryosuke Niwa.
Drop legacy Attributes.isId attribute.
This attribute is not in the specification:
- https://dom.spec.whatwg.org/#interface-attr
Both Firefox and Chrome currently do not expose this attribute.
No new tests, rebaselined existing test.
* dom/Attr.cpp:
* dom/Attr.h:
* dom/Attr.idl:
2017-01-30 Zalan Bujtas <zalan@apple.com>
Simple line layout: Small tweaks to improve performance.
https://bugs.webkit.org/show_bug.cgi?id=167611
<rdar://problem/30274294>
Reviewed by Simon Fraser.
This is ~10% progression on the attached test case (paragraphs with non-redundant content).
median: 102.08 runs/s -> median: 114.25 runs/s
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):
(WebCore::SimpleLineLayout::FlowContents::FlowContents):
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-01-30 Chris Dumez <cdumez@apple.com>
Drop legacy constants on Event interface
https://bugs.webkit.org/show_bug.cgi?id=167602
Reviewed by Sam Weinig.
Drop legacy constants on Event interface:
MOUSEDOWN, MOUSEUP, MOUSEOVER, MOUSEOUT, MOUSEMOVE, MOUSEDRAG,
CLICK, DBLCLICK, KEYDOWN, KEYUP, KEYPRESS, DRAGDROP, FOCUS,
BLUR, SELECT, and CHANGE.
Those constants are not used for anything, they are not in the
specification and Chrome / Firefox do not have them.
No new tests, rebaselined existing test.
* dom/Event.idl:
2017-01-30 Simon Fraser <simon.fraser@apple.com>
[iOS] position:fixed inside touch-scrollable overflow is mispositioned
https://bugs.webkit.org/show_bug.cgi?id=167604
rdar://problem/29500273
Reviewed by Zalan Bujtas.
For layers inside touch-scrollable overflow, RenderLayerBacking::computeParentGraphicsLayerRect() needs
to account for the offset from the ancestor compositing layer's origin, to handle scrollable elements with
box-shadow, for example.
Also make the compositing log output a little easier to read.
Test: compositing/scrolling/fixed-inside-scroll.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
2017-01-30 Jer Noble <jer.noble@apple.com>
NULL-deref crash at PlatformMediaSession::endInterruption
https://bugs.webkit.org/show_bug.cgi?id=167595
Reviewed by Eric Carlson.
Use the same, NULL-aware forEachSession() iterator rather than iterating over m_sessions directly.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::beginInterruption):
(WebCore::PlatformMediaSessionManager::endInterruption):
2017-01-30 Myles C. Maxfield <mmaxfield@apple.com>
Correct spacing regression on inter-element complex path shaping on some fonts
https://bugs.webkit.org/show_bug.cgi?id=166013
Reviewed by Simon Fraser.
This patch brings the implementation of ComplexTextController in-line with the
design at https://trac.webkit.org/wiki/ComplexTextController. Previously,
ComplexTextController had a few problems:
- The total width computed by ComplexTextController didn't match the width if
you iterated over the entire string and added up the advances
- FontCascade::getGlyphsAndAdvancesForComplexText() tried to compensate for
the above by construing the concepts of paint advances as distinct from layout
advances
- Initial advances were considered part of layout sometimes and part of painting
other times, depending on which function reports the information
- For RTL runs, the wrong origin was added to the initial advance, and the origin
should have been subtracted instead of added
This patch exhaustively updates every function in ComplexTextController to be
consistent with the design linked to above. This design solves all of these
problems.
Tests: ComplexTextControllerTest.InitialAdvanceWithLeftRunInRTL
ComplexTextControllerTest.InitialAdvanceInRTL
ComplexTextControllerTest.InitialAdvanceWithLeftRunInLTR
ComplexTextControllerTest.InitialAdvanceInLTR
ComplexTextControllerTest.InitialAdvanceInRTLNoOrigins
ComplexTextControllerTest.LeadingExpansion
ComplexTextControllerTest.VerticalAdvances
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::setLeadingExpansion): Deleted. No longer necessary.
(WebCore::GlyphBuffer::leadingExpansion): Deleted. Ditto.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::adjustSelectionRectForComplexText): Removed use of
unnecessary leadingExpansion().
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText): This function needs
to compute paint advances, which means that it can't base this information off
of layout advances. This function uses the trick mentioned at the end of the
above link to compute the paint offset of an arbitrary glyph in the middle of
an RTL run.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::computeExpansionOpportunity): Refactored for
testing.
(WebCore::ComplexTextController::ComplexTextController): Ditto.
(WebCore::ComplexTextController::finishConstruction): Ditto.
(WebCore::ComplexTextController::offsetForPosition): This function operates on
layout advances, and the initial layout advance is already added into the
m_adjustedBaseAdvances vector by adjustGlyphsAndAdvances(). Therefore, there is
no need to add it again here.
(WebCore::ComplexTextController::advance): This function had completely busted
logic about the relationship between initial advances and the first origin in
each run. Because of the fortunate choice of only representing layout advances
in m_adjustedBaseAdvances, this entire block can be removed and the raw paint
initial advance can be reported to the GlyphBuffer. Later in the function, we
have to update the logic about how to compute a paint advance given a layout
advance and some origins. In particular, there are two tricky pieces here: 1.
The layout advance for the first glyph is equal to (initial advance - first
origin + first Core Text advance, so computing the paint offset must cancel out
the initial layout offset, and 2. the last paint advance in a run must actually
end up at the position of the first glyph in the next run, so the next run's
initial advance must be queried.
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Previously, we
represented an initial advance of a successive run by just adding it to the
previous run's last advance. However, this is incompatible with the new model
presented in the link above, so we remove this section. We also have to add in
the logic that the layout advance for the first glyph is equal to the formula
presented above.
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::initialAdvance): Adjust comment
to reflect reality.
(WebCore::ComplexTextController::leadingExpansion): Deleted.
2017-01-30 Simon Fraser <simon.fraser@apple.com>
Fixed elements should not rubber-band in WK2, nor remain at negative offsets
https://bugs.webkit.org/show_bug.cgi?id=167484
rdar://problem/29453068
Reviewed by Dean Jackson.
There were various problems with the layout rect computation:
1. It ignored the scrollBehaviorForFixedElements() which we use to avoid rubber-banding fixed
elements in WK2, but allow in WK1, so make use of that.
2. Sometimes layouts/paints of fixed elements would be triggered when coalesced calls to
AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() failed to
copy the layoutViewportOrigin to the scheduled update.
3. The layout viewport could be left with a negative top/left after rubber-banding.
Also add a way to do unconstrained scrollTo(), so that a test can call window.scrollTo(-10, -10) to
simulate rubberbanding.
Tests: fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html
fast/visual-viewport/rubberbanding-viewport-rects.html
* page/FrameView.cpp:
(WebCore::FrameView::computeLayoutViewportOrigin): Handle ScrollBehaviorForFixedElements, incorporating it
into logic that clamps layoutViewportOrigin between min/max when rubberbanding is not allowed, or not in progress.
(WebCore::FrameView::updateLayoutViewport): Pass in scrollBehaviorForFixedElements().
(WebCore::FrameView::visibleDocumentRect): The clamping here was preventing the visible rect from
escaping the document bounds, which caused fixed elements to bounce with rubber-banding, so remove the clamping,
and fix the logic to allow rubber-banding while taking headers and footers into account.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): layoutViewportOrigin has to
be pushed onto the scheduled update, just like scroll position.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition): Pass in m_behaviorForFixed.
* platform/ScrollView.cpp:
(WebCore::ScrollView::ScrollView):
(WebCore::ScrollView::adjustScrollPositionWithinRange):
(WebCore::ScrollView::setScrollOffset):
* platform/ScrollView.h:
(WebCore::ScrollView::setAllowsUnclampedScrollPositionForTesting):
(WebCore::ScrollView::allowsUnclampedScrollPosition):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setAllowUnclampedScrollPosition):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2017-01-30 Wenson Hsieh <wenson_hsieh@apple.com>
Web content process crashes when initiating a drag on a very large image
https://bugs.webkit.org/show_bug.cgi?id=167564
Reviewed by Beth Dakin.
If we begin dragging an image element that is too large to show the cached image for, we will show an image file
icon instead of the cached image. This may return null if createDragImageIconForCachedImageFilename is
unimplemented, so in the meantime, we should not assume that dragImage will always exist before calling into
doSystemDrag in doImageDrag and bail from the drag operation if that is the case.
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
2017-01-30 Chris Dumez <cdumez@apple.com>
Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
https://bugs.webkit.org/show_bug.cgi?id=167536
Reviewed by Darin Adler.
Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
instead of a string. The value needs to be numeric and the current API is error-prone.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
* loader/EmptyClients.cpp:
* page/DiagnosticLoggingClient.h:
2017-01-30 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rollout r211235 Pointer lock events should be delivered directly to the target element.
The LayoutTest for this change is frequently failing.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::isLocked): Deleted.
(WebCore::PointerLockController::dispatchLockedWheelEvent): Deleted.
* page/PointerLockController.h:
2017-01-30 Antoine Quint <graouts@apple.com>
LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167254
<rdar://problem/30259293>
Reviewed by Dean Jackson.
When we would identify that we need to prolong an existing auto-hide timer, when the previous
auto-hide timer was marked as non-cancelable, calling _cancelAutoHideTimer() would not actually
cancel the previous timer, which would let it fire and hide the controls bar. We now have two
methods, _cancelAutoHideTimer() which always cancels the current auto-hide timer, and
_cancelNonEnforcedAutoHideTimer() which is used from all other existing call sites, which only
cancels the current auto-hide timer if it was marked as cancelable. This, and revised timing in
the test itself, make media/modern-media-controls/media-controller/media-controller-auto-hide-
mouse-leave-after-play.html a lot more reliable.
We also make a small drive-by fix where we ensure the "autoHideDelay" property is set first so
that setting other members which may set a timer do not used an undefined value for the auto-hide
timer delay.
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set visible):
(ControlsBar.prototype.handleEvent):
(ControlsBar.prototype._cancelNonEnforcedAutoHideTimer):
(ControlsBar.prototype._cancelAutoHideTimer):
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r202615?): [GStreamer] ASSERTION FAILED: isMainThread() in WebCore::BuiltinResourceHandleConstructorMap& WebCore::builtinResourceHandleConstructorMap()
https://bugs.webkit.org/show_bug.cgi?id=167003
Reviewed by Michael Catanzaro.
Add a way to create a ResourceHandle for a given SoupNetworkSession and use it in the GStreamer streaming client
to ensure both the session and the handle are created and destroyed in the secondary thread. This way we also
avoid using the default session for downloading HLS fragments.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(ResourceHandleStreamingClient::ResourceHandleStreamingClient): Create a SoupNetworkSession and pass it to ResourceHandle::create().
* platform/network/ResourceHandle.h: Add create and constructor to receive a SoupNetworkSession.
* platform/network/ResourceHandleInternal.h: Add SoupNetworkSession member.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandleInternal::soupSession): Return the SoupNetworkSession if not nullptr.
(WebCore::ResourceHandle::create): Create a ResourceHandle without trying to use any builtin constructor and
using the given SoupNetworkSession.
(WebCore::ResourceHandle::ResourceHandle): Set the SoupNetworkSession if early request validations didn't fail.
2017-01-30 Youenn Fablet <youennf@gmail.com>
[WebRTC] Add support for libwebrtc data channel
https://bugs.webkit.org/show_bug.cgi?id=167489
Reviewed by Alex Christensen.
Partially covered by webrtc/datachannel/basic.html but not yet enabled on bots.
Introducing LibWebRTCDataChannelHandler as the integration layer between WebCore (RTCDataChannel)
and libwebrtc (DataChannelObserver).
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::bufferedAmount):
(WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: Added.
(WebCore::LibWebRTCDataChannelHandler::~LibWebRTCDataChannelHandler):
(WebCore::LibWebRTCDataChannelHandler::setClient):
(WebCore::LibWebRTCDataChannelHandler::sendStringData):
(WebCore::LibWebRTCDataChannelHandler::sendRawData):
(WebCore::LibWebRTCDataChannelHandler::close):
(WebCore::LibWebRTCDataChannelHandler::OnStateChange):
(WebCore::LibWebRTCDataChannelHandler::OnMessage):
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
(): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createDataChannelHandler):
* dom/EventNames.h:
* platform/mediastream/RTCDataChannelHandler.h:
* platform/mediastream/RTCDataChannelHandlerClient.h:
* platform/mock/RTCDataChannelHandlerMock.h:
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
Several web timing tests crash in GTK+ and AppleWin bots
https://bugs.webkit.org/show_bug.cgi?id=167577
Reviewed by Ryosuke Niwa.
The problem is that entry is used in both the key, to get name, and in the value with WTFMove. So, the name is
invalidated by the move. It could be fixed by simply copying the name, instead of using entry->name, but I think
that code could be simplified using HashMap::ensure and then we don't need any string copy, nor even the static
insertPerformanceEntry().
Fix crashes in several imported/w3c/web-platform-tests/user-timing/ tests.
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::mark):
(WebCore::UserTiming::measure):
(WebCore::insertPerformanceEntry): Deleted.
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Crash in GraphicsContext3D::deleteTexture when destroying TextureMapperPlatformLayerProxy
https://bugs.webkit.org/show_bug.cgi?id=167575
Reviewed by Žan Doberšek.
We should clear all the buffers on invalidate to ensure we don't have textures alive after CoordinatedGraphicsScene::purgeGLResources().
Fix crash in media/video-poster-background.html.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear current, pending and all used buffers.
2017-01-29 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Crash on WebCore::GLContext::version()
https://bugs.webkit.org/show_bug.cgi?id=167559
Reviewed by Michael Catanzaro.
Fixes crashes in several media tests.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear m_compositorThreadUpdateTimer and call the update function.
2017-01-29 Nan Wang <n_wang@apple.com>
AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work
https://bugs.webkit.org/show_bug.cgi?id=166955
Reviewed by Ryosuke Niwa.
Created a new version of Range::collectSelectionRect() that returns rects for each
line, so that Speak Selection doesn't need to handle searching for soft line breaks.
Also added a variant of findPlainText to search for the closest matched range to the given position.
Test: editing/text-iterator/range-of-string-closest-to-position.html
* dom/Range.cpp:
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines):
(WebCore::Range::collectSelectionRects):
* dom/Range.h:
* editing/TextIterator.cpp:
(WebCore::findPlainTextMatches):
(WebCore::updateSearchBuffer):
(WebCore::findIteratorOptions):
(WebCore::rangeMatches):
(WebCore::findClosestPlainText):
(WebCore::findPlainText):
(WebCore::findPlainTextOffset): Deleted.
* editing/TextIterator.h:
* editing/htmlediting.h:
* testing/Internals.cpp:
(WebCore::Internals::rangeOfStringNearLocation):
* testing/Internals.h:
* testing/Internals.idl:
2017-01-29 Andy Estes <aestes@apple.com>
[QuickLook] Add a WebPreference to enable saving QuickLook documents in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=167563
<rdar://problem/30253207>
Reviewed by Andreas Kling.
* loader/ios/QuickLook.h: Removed unused declarations.
(WebCore::QuickLookHandle::firstRequestURL): Deleted.
* loader/ios/QuickLook.mm:
(WebCore::removeQLPreviewConverterForURL): Stopped deleting the temporary file here; that's
now done in QuickLookDocumentWriter.
(addQLPreviewConverterWithFileForURL): Changed from an exported function to a static
function since it's now only called inside QuickLook.mm.
(WebCore::QuickLookHandle::QuickLookHandle): Stopped initializing m_firstRequestURL.
(WebCore::addQLPreviewConverterWithFileForURL): Deleted.
(WebCore::qlPreviewConverterFileNameForURL): Deleted.
(WebCore::qlPreviewConverterUTIForURL): Deleted.
(WebCore::QuickLookHandle::previewRequestURL): Deleted.
(WebCore::QuickLookHandle::converter): Deleted.
2017-01-29 Zalan Bujtas <zalan@apple.com>
Simple line layout: PerformanceTests/Layout/simple-line-layout-innertext.html regressed at r211108
https://bugs.webkit.org/show_bug.cgi?id=167562
Reviewed by Antti Koivisto.
Apparently RunResolver::Run::constructStringForHyphenIfNeeded() is in a superhot codepath.
The Run should not have any additional members anyway, so let's construct the hyphenated
string on demand.
Progression on simple-line-layout-innertext.html is from ~34runs/sec back to ~50runs/sec.
Covered by existing text.
* rendering/RenderTreeAsText.cpp:
(WebCore::writeSimpleLine):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::Run):
(WebCore::SimpleLineLayout::RunResolver::Run::textWithHyphen):
(WebCore::SimpleLineLayout::RunResolver::Run::text):
(WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded): Deleted.
* rendering/SimpleLineLayoutResolver.h:
2017-01-28 Tim Horton <timothy_horton@apple.com>
Don't flash a tap highlight for the entirety of an editable WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167486
<rdar://problem/30193996>
Reviewed by Dan Bernstein.
* dom/Document.h:
Export.
2017-01-28 Wenson Hsieh <wenson_hsieh@apple.com>
Check USE(APPLE_INTERNAL_SDK) instead of specific headers when importing from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=167555
Reviewed by Dan Bernstein.
Instead of guarding #import <WebKitAdditions/*> on the existence of the imported file, consult
USE(APPLE_INTERNAL_SDK) instead.
* page/ios/EventHandlerIOS.mm:
* platform/ios/DragImageIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/mac/DragDataMac.mm:
2017-01-28 Yoav Weiss <yoav@yoav.ws>
Add Link Preload as an off-by-default experimental feature menu item.
https://bugs.webkit.org/show_bug.cgi?id=167201
Reviewed by Ryosuke Niwa.
Removed the explicit setting of the Link Preload experimental feature,
as it is now on by default for testing.
No new tests as this just removes methods from settings.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2017-01-28 Joseph Pecoraro <pecoraro@apple.com>
Fix typo in error message
https://bugs.webkit.org/show_bug.cgi?id=167554
Reviewed by Sam Weinig.
* bindings/scripts/CodeGenerator.pm:
(GetEnumByType):
2017-01-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
https://bugs.webkit.org/show_bug.cgi?id=167552
<rdar://problem/29601646>
Reviewed by Eric Carlson.
In the case of media documents, there is a built-in behavior, implemented in MediaDocument::defaultEventHandler(),
that toggles playback when clicking or double-clicking the video. We disable this behavior by adding a "click" event
handler on the entire media shadow root and calling "preventDefault()".
Test: media/modern-media-controls/media-documents/click-on-video-should-not-pause.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._containerWasClicked):
2017-01-28 Dan Bernstein <mitz@apple.com>
[Xcode] Clean up PAL and WebCore’s build settings a little
https://bugs.webkit.org/show_bug.cgi?id=167292
Reviewed by Sam Weinig.
* Configurations/Base.xcconfig: Simplified the definition of
GCC_WARN_64_TO_32_BIT_CONVERSION, removed the unused build setting PREBINDING, removed
a duplicate definition of GCC_GENERATE_DEBUGGING_SYMBOLS, and removed definitions specific
to OS X versions that are no longer supported.
* Configurations/DebugRelease.xcconfig: Removed definitions specific to OS X versions
that are no longer supported.
2017-01-28 Zalan Bujtas <zalan@apple.com>
Resolve beforeChild's render tree position before calling addChildIgnoringContinuation.
https://bugs.webkit.org/show_bug.cgi?id=167540
<rdar://problem/30126535>
Reviewed by Simon Fraser.
Use the actual render tree position for the beforeChild when inside a flow thread.
Test: fast/multicol/assert-on-continuation-with-spanner.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
2017-01-28 Andreas Kling <akling@apple.com>
Avoid synchronous style recalc in dispatchUnloadEvents().
<https://webkit.org/b/167551>
Reviewed by Antti Koivisto.
It shouldn't be necessary to force a synchronous style resolution in an unloading document.
This call has been here since the import of KHTMLPart.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchUnloadEvents):
2017-01-28 Andreas Kling <akling@apple.com>
REGRESSION(r196383): Automatic shrink-to-fit of RuleSet no longer works.
<https://webkit.org/b/167543>
Reviewed by Antti Koivisto.
Re-enable the automatic shrink-to-fit optimization in RuleSet.
This was disabled accidentally, which I discovered while investigating
the memory footprint of extension stylesheets.
* css/RuleSet.h:
2017-01-28 Antti Koivisto <antti@apple.com>
Give scripts 'high' load priority
https://bugs.webkit.org/show_bug.cgi?id=167550
Reviewed by Andreas Kling.
For historical reasons it is currently 'medium', same as web fonts and some other non-parsing blocking things.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType):
2017-01-28 Joseph Pecoraro <pecoraro@apple.com>
Add User Timing Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=167542
<rdar://problem/22746307>
Reviewed by Ryosuke Niwa.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::performanceTimelineEnabled):
* page/Performance.idl:
* page/PerformanceEntry.idl:
Make a better RuntimeEnabledFeature named "PerformanceTiming" which
is enabled if either UserTiming or ResourceTiming is enabled. This
will then expose the APIs that are only useful when at least one of
the APIs are available.
* page/PerformanceEntry.cpp:
(WebCore::PerformanceEntry::name): Deleted.
(WebCore::PerformanceEntry::entryType): Deleted.
(WebCore::PerformanceEntry::startTime): Deleted.
(WebCore::PerformanceEntry::duration): Deleted.
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::name):
(WebCore::PerformanceEntry::entryType):
(WebCore::PerformanceEntry::startTime):
(WebCore::PerformanceEntry::duration):
Inline simple accessors.
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::measure):
Fix a bug introduced by ExceptionOr refactoring.
(WebCore::UserTiming::clearMarks):
(WebCore::UserTiming::clearMeasures):
(WebCore::clearPerformanceEntries):
(WebCore::clearPeformanceEntries): Deleted.
Fix method name typo.
2017-01-27 Dan Bernstein <mitz@apple.com>
Ignore Xcode’s project.xcworkspace and userdata directories in this new project like we do
in other projects.
* PAL/PAL.xcodeproj: Added property svn:ignore.
2017-01-27 Andy Estes <aestes@apple.com>
Fix the iOS build when USE(QUICK_LOOK) is disabled.
* testing/Internals.cpp:
(WebCore::Internals::setQuickLookPassword):
* testing/Internals.h:
2017-01-27 Yusuke Suzuki <utatane.tea@gmail.com>
setTimeout / setInterval's string execution should inherit SourceOrigin correctly
https://bugs.webkit.org/show_bug.cgi?id=167097
Reviewed by Darin Adler.
Tests: js/dom/modules/import-from-set-interval.html
js/dom/modules/import-from-set-timeout.html
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
2017-01-27 Yusuke Suzuki <utatane.tea@gmail.com>
Merge CachedModuleScript and LoadableModuleScript
https://bugs.webkit.org/show_bug.cgi?id=167500
Reviewed by Darin Adler.
CachedModuleScript becomes duplicate with LoadableModuleScript.
And CachedModuleScript does not offer any meaningful functionality
to LoadableModuleScript.
This patch merges CachedModuleScript to LoadableModuleScript.
No behavior change.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CachedModuleScript.cpp: Removed.
* bindings/js/CachedModuleScript.h: Removed.
* bindings/js/CachedModuleScriptClient.h: Removed.
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::loadModuleScript):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScript):
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptController.h:
* dom/LoadableModuleScript.cpp:
(WebCore::LoadableModuleScript::create):
(WebCore::LoadableModuleScript::LoadableModuleScript):
(WebCore::LoadableModuleScript::~LoadableModuleScript):
(WebCore::LoadableModuleScript::isLoaded):
(WebCore::LoadableModuleScript::error):
(WebCore::LoadableModuleScript::wasCanceled):
(WebCore::LoadableModuleScript::notifyLoadCompleted):
(WebCore::LoadableModuleScript::notifyLoadFailed):
(WebCore::LoadableModuleScript::notifyLoadWasCanceled):
(WebCore::LoadableModuleScript::execute):
(WebCore::LoadableModuleScript::load):
(WebCore::LoadableModuleScript::notifyFinished): Deleted.
* dom/LoadableModuleScript.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::executeModuleScript):
* dom/ScriptElement.h:
2017-01-27 Michael Saboff <msaboff@apple.com>
JSCustomElementInterface::invokeCallback can be called with a null callback because Weak<>
https://bugs.webkit.org/show_bug.cgi?id=167522
Reviewed by Filip Pizlo.
Added all provided callbacks to the global object with a private name the same way
that the constructor was added. This will keep these callbacks from being GC'ed.
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
2017-01-27 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Prepare ComplexTextController for unit testing
https://bugs.webkit.org/show_bug.cgi?id=167493
Reviewed by Simon Fraser.
Addressing post-review comments from Simon Fraser.
* platform/graphics/FontCascade.h:
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::createForTesting):
* platform/graphics/mac/ComplexTextControllerCoreText.h:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2017-01-27 Simon Fraser <simon.fraser@apple.com>
Element with a backdrop-filter and a mask may not correctly mask the backdrop
https://bugs.webkit.org/show_bug.cgi?id=167456
rdar://problem/29320059
Reviewed by Antoine Quint.
If a layer had a backdrop filter, but also corner radii that triggered using a mask layer,
then the call to updateClippingStrategy() in GraphicsLayerCA::updateBackdropFiltersRect() would
set the backdrop layer's mask, but GraphicsLayerCA::updateMaskLayer() would promptly then set
the mask layer back to nil.
Fix by having GraphicsLayerCA::updateMaskLayer() put the mask on the structural layer, if there
is one. We always have a structural layer with backdrops, so this will mask both the layer
and the backdrop.
Test: css3/filters/backdrop/backdrop-filter-uneven-corner-radii.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateMaskLayer):
* platform/graphics/mac/WebLayer.mm:
(-[CALayer _descriptionWithPrefix:]): Dump the mask layer.
2017-01-27 Chris Dumez <cdumez@apple.com>
Fix remaining bad uses of logDiagnosticMessageWithValue()
https://bugs.webkit.org/show_bug.cgi?id=167526
Reviewed by Alex Christensen.
Drop unused keys, add new ones.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
(WebCore::DiagnosticLoggingKeys::userZoomActionKey):
(WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
(WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
(WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
(WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
(WebCore::DiagnosticLoggingKeys::userKey): Deleted.
(WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
(WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.
* page/DiagnosticLoggingKeys.h:
2017-01-27 Myles C. Maxfield <mmaxfield@apple.com>
Proclaim that we are considering font-display, rhythmic sizing, and text decoration level 4
https://bugs.webkit.org/show_bug.cgi?id=167340
Reviewed by Saam Barati.
* features.json:
2017-01-27 Chris Dumez <cdumez@apple.com>
Fix diagnostic logging under loader/
https://bugs.webkit.org/show_bug.cgi?id=167512
Reviewed by Alex Christensen.
Fix diagnostic logging under loader/. We should not be using logDiagnosticLoggingWithValue()
without a numeric value.
* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::logMemoryCacheResourceRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::logRevalidation):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
(WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
(WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
(WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
(WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):
* page/DiagnosticLoggingKeys.h:
2017-01-27 Chris Dumez <cdumez@apple.com>
Fix diagnostic logging in media code
https://bugs.webkit.org/show_bug.cgi?id=167510
Reviewed by Alex Christensen.
Fix diagnostic logging in media code. It should not use logDiagnosticMessageWithValue()
with a non-numeric value.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updatePlayState):
2017-01-27 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Prepare ComplexTextController for unit testing
https://bugs.webkit.org/show_bug.cgi?id=167493
Reviewed by Dean Jackson.
ComplexTextController has three phases:
1. Interrogate Core Text about some text
2. Compute layout advances and paint advances from the information retrieved from
Core Text
3. Iterate through the layout advances or paint advances.
This patch tests phases 2 and 3 by chopping ComplexTextController between
phases 1 and 2, and injecting foreign metrics from a unit test. These metrics
have been gathered from real-world uses; however, a layout test is not appropriate
because the fonts which produced these metrics are not licensed appropriately.
The tests can enforce the correct behavior by using ComplexTextController's
public API.
This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=166013.
However, the fix for that bug is quite large, so I've split out this smaller piece
to ease the reviewing burden. The tests I've added are disabled for now (because
they fail), but will be enabled by the fix to that bug.
No new tests because there is no behavior change.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontCascade.h:
* platform/graphics/FontDescription.h:
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextController):
(WebCore::ComplexTextController::finishConstruction):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::createForTesting):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2017-01-27 Zalan Bujtas <zalan@apple.com>
Simple line layout: Do not bail out on -webkit-line-box-contain: block glyphs unless text overflows vertically.
https://bugs.webkit.org/show_bug.cgi?id=167481
<rdar://problem/30180150>
Reviewed by Antti Koivisto.
Since -webkit-line-box-contain: glyphs requires variable line height support, we can use simple line layout
only when each line happen to have the same height ('block' property value is set, glyphs do not overflow the block line height).
Test: fast/text/simple-line-layout-line-box-contain-glyphs.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):
2017-01-27 Chris Dumez <cdumez@apple.com>
Fix PageCache diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167508
Reviewed by Sam Weinig.
Fix PageCache diagnostic logging. It should not call logDiagnosticMessageWithValue()
with a non-numeric value. Use logDiagnosticMessage() instead.
* history/PageCache.cpp:
(WebCore::logPageCacheFailureDiagnosticMessage):
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
(WebCore::DiagnosticLoggingKeys::successKey): Deleted.
(WebCore::DiagnosticLoggingKeys::failureKey): Deleted.
* page/DiagnosticLoggingKeys.h:
2017-01-27 Devin Rousso <dcrousso+webkit@gmail.com>
Styles should not show background-repeat-x/y, or -webkit-mask-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167255
Reviewed by Joseph Pecoraro.
Test: inspector/css/css-property.html
* css/makeprop.pl:
(addProperty):
Add a generated function `isInternalCSSProperty` that checks the given CSSPropertyID against
a derived list of properties from CSSProperties.json with "internal-only".
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties):
Only pass CSS property payloads to the frontend if they are not internal.
2017-01-27 Antti Koivisto <antti@apple.com>
Implement Cache-control: immutable
https://bugs.webkit.org/show_bug.cgi?id=167497
Reviewed by Chris Dumez.
Cache-control value 'immutable' indicates that a subresource does not change and so does not need to be
revalidated on a normal reload. This can significantly speed up reloads and reduce network traffic.
It is has been implemented in Firefox and is already used by Facebook.
https://tools.ietf.org/html/draft-mcmanus-immutable-00
https://hacks.mozilla.org/2017/01/using-immutable-caching-to-speed-up-the-web/
This patch implements Cache-control: immutable for memory cache only. A disk cache implementation
doesn't seem necessary as the resource is basically always expected to be in memory cache on reload.
Immutable is only supported for https as suggested by the draft specification (and Gecko implementation).
Test: http/tests/cache/cache-control-immutable-http.html
http/tests/cache/cache-control-immutable-https.html
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::makeRevalidationDecision):
On normal reloads (CachePolicyRevalidate) of https resources check for 'Cache-control: immutable'.
If the resource is not expired don't revalidate it.
* platform/network/CacheValidation.cpp:
(WebCore::parseCacheControlDirectives):
* platform/network/CacheValidation.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::cacheControlContainsImmutable):
* platform/network/ResourceResponseBase.h:
2017-01-27 Youenn Fablet <youennf@gmail.com>
[WebRTC] Use MediaEndPointPeerConnection if not using libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167504
Reviewed by Alex Christensen.
No change of behavior.
* Modules/mediastream/MediaEndpointPeerConnection.cpp: If libwebrtc, we should use libwebrtc peer connection backend.
2017-01-27 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r211238.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::visitChildren):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::visitChildren):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::visitChildren):
2017-01-25 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Move Grid class out of RenderGrid
https://bugs.webkit.org/show_bug.cgi?id=167418
Reviewed by Antti Koivisto.
The RenderGrid should be able to use different implementations of
the Grid class. The latter is big enough to be in its own file. That
would help on the effort of moving the grid track sizing algorithm
out of RenderGrid too.
No new tests required as we're just moving code.
* CMakeLists.txt:
* rendering/Grid.cpp: Added.
(WebCore::Grid::Grid):
(WebCore::Grid::numTracks):
(WebCore::Grid::ensureGridSize):
(WebCore::Grid::insert):
(WebCore::Grid::setSmallestTracksStart):
(WebCore::Grid::smallestTrackStart):
(WebCore::Grid::gridItemArea):
(WebCore::Grid::setGridItemArea):
(WebCore::Grid::setAutoRepeatTracks):
(WebCore::Grid::autoRepeatTracks):
(WebCore::Grid::setAutoRepeatEmptyColumns):
(WebCore::Grid::setAutoRepeatEmptyRows):
(WebCore::Grid::hasAutoRepeatEmptyTracks):
(WebCore::Grid::isEmptyAutoRepeatTrack):
(WebCore::Grid::autoRepeatEmptyTracks):
(WebCore::Grid::gridItemSpan):
(WebCore::Grid::setNeedsItemsPlacement):
(WebCore::GridIterator::GridIterator):
(WebCore::GridIterator::nextGridItem):
(WebCore::GridIterator::isEmptyAreaEnough):
(WebCore::GridIterator::nextEmptyGridArea):
* rendering/Grid.h: Added.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::Grid::numTracks): Deleted.
(WebCore::RenderGrid::Grid::ensureGridSize): Deleted.
(WebCore::RenderGrid::Grid::insert): Deleted.
(WebCore::RenderGrid::Grid::setSmallestTracksStart): Deleted.
(WebCore::RenderGrid::Grid::smallestTrackStart): Deleted.
(WebCore::RenderGrid::Grid::gridItemArea): Deleted.
(WebCore::RenderGrid::Grid::setGridItemArea): Deleted.
(WebCore::RenderGrid::Grid::setAutoRepeatTracks): Deleted.
(WebCore::RenderGrid::Grid::autoRepeatTracks): Deleted.
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyColumns): Deleted.
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyRows): Deleted.
(WebCore::RenderGrid::Grid::hasAutoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::Grid::isEmptyAutoRepeatTrack): Deleted.
(WebCore::RenderGrid::Grid::autoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::Grid::gridItemSpan): Deleted.
(WebCore::RenderGrid::Grid::setNeedsItemsPlacement): Deleted.
(WebCore::RenderGrid::GridIterator::GridIterator): Deleted.
(WebCore::RenderGrid::GridIterator::nextGridItem): Deleted.
(WebCore::RenderGrid::GridIterator::isEmptyAreaEnough): Deleted.
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea): Deleted.
* rendering/RenderGrid.h:
2017-01-27 Yusuke Suzuki <utatane.tea@gmail.com>
Implement dynamic-import for WebCore
https://bugs.webkit.org/show_bug.cgi?id=166926
Reviewed by Ryosuke Niwa.
This patch introduces browser side dynamic-import implementation.
The dynamic-import is new ES feature which is now stage 3.
The JSC shell already implements it.
The dynamic-import allows us to kick module loading in a dynamic manner.
For example, you can write,
await module = import(`${HOST}/hello.js`);
The dynamic `import` operator (this is not a function) returns a promise with
module namespace object if the module loading succeeds. Otherwise, it returns
a rejected promise.
And importantly, this feature allows us to kick module loading from classic script.
Previously, module loading can be only used from <script type="module"> tag. And
all the module loading is done statically.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CachedModuleScriptLoader.cpp:
(WebCore::CachedModuleScriptLoader::load):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::create):
(WebCore::CachedScriptFetcher::requestModuleScript):
requestModuleScript function is used only when loading a new module script.
So, LoadableClassicScript should use requestScriptWithCache to load itself.
We pass String() for cross origin mode for null cross origin attribute as
specified.
(WebCore::CachedScriptFetcher::requestScriptWithCache):
* bindings/js/CachedScriptFetcher.h:
(WebCore::CachedScriptFetcher::CachedScriptFetcher):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderImportModule):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScript):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::resolveModuleSpecifier):
Extract the part of resolving module specifier to a static function to use
it in ScriptModuleLoader::resolve and ScriptModuleLoader::importModule.
(WebCore::ScriptModuleLoader::resolve):
(WebCore::rejectPromise):
(WebCore::ScriptModuleLoader::importModule):
New hook moduleLoaderImportModule is implemented. This hook is called when
`import` operator is used. This hook is responsible to
1. resolve the module name to obtain module specifier. (like, resolve the
relative URL to get absolute URL.)
2. kick module loading with the resolved specifier.
When resolving the module name, the referrer information is needed.
For example, "./script.js" will be resolved to "http://example.com/script.js" if
the referrer module specifier is "http://example.com/".
If `import("./script.js")` is executed in the classic script
src="http://example.com/test.js", it starts loading "http://example.com/script.js".
So the information of the caller of `import` operator is necessary here.
This appropriate referrer is propagated by SourceOrigin.
* bindings/js/ScriptModuleLoader.h:
* dom/InlineClassicScript.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::load):
* dom/LoadableClassicScript.h:
* dom/LoadableModuleScript.h:
* dom/LoadableScript.h:
(WebCore::LoadableScript::LoadableScript):
(WebCore::LoadableScript::isClassicScript): Deleted.
(WebCore::LoadableScript::isModuleScript): Deleted.
* dom/ScriptElement.h:
* dom/ScriptElementCachedScriptFetcher.cpp: Copied from Source/WebCore/dom/InlineClassicScript.h.
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript):
This requestModuleScript will be used when the script tag (or modules imported from the script tag) uses `import` operator.
In classic scripts, `crossorigin` mode always becomes "omit" while module scripts
propagate the original `crossorigin` value.
* dom/ScriptElementCachedScriptFetcher.h: Copied from Source/WebCore/bindings/js/CachedScriptFetcher.h.
(WebCore::ScriptElementCachedScriptFetcher::crossOriginMode):
(WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
2017-01-26 Chris Dumez <cdumez@apple.com>
Revert r210474 it is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=167487
Reviewed by Daniel Bates.
Revert r210474 it is no longer needed after r211254.
* dom/Document.cpp:
(WebCore::Document::canNavigate):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::handleClick):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::loadFrameRequest):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
2017-01-26 Youenn Fablet <youennf@gmail.com>
[WebRTC] Implement WebRTC PeerConnection backend based on libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167289
Reviewed by Alex Christensen.
Introducing an initial implementation of WebRTC peer connection backend based on LibWebRTC.
This is done behind a compilation flag which is off by default, until the implementation is ready.
The backend implements the PeerConnectionBackend API.
The implementation is split into LibWebRTCPeerConnectionBackend which contains mostly generic code and
passes the real work to LibWebRTCMediaEndpoint.
The latter class is implementing the API using LibWebRTC.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: Added.
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
(WebCore::sessionDescriptionType):
(WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::addPendingIceCandidates):
(WebCore::streamId):
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
(WebCore::LibWebRTCMediaEndpoint::getStats):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
(WebCore::signalingState):
(WebCore::LibWebRTCMediaEndpoint::OnSignalingChange):
(WebCore::trackId):
(WebCore::createMediaStreamTrack):
(WebCore::LibWebRTCMediaEndpoint::addStream):
(WebCore::LibWebRTCMediaEndpoint::OnAddStream):
(WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
(WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
(WebCore::LibWebRTCMediaEndpoint::stop):
(WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
(WebCore::iceConnectionState):
(WebCore::LibWebRTCMediaEndpoint::OnIceConnectionChange):
(WebCore::LibWebRTCMediaEndpoint::OnIceGatheringChange):
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidatesRemoved):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionSucceeded):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionSucceeded):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: Added.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: Added.
(WebCore::createLibWebRTCPeerConnectionBackend):
(WebCore::libWebRTCProvider):
(WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
(WebCore::configurationFromMediaEndpointConfiguration):
(WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
(WebCore::LibWebRTCPeerConnectionBackend::doCreateAnswer):
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::LibWebRTCPeerConnectionBackend::markAsNeedingNegotiation):
(WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::createDataChannelHandler):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: Added.
* WebCore.xcodeproj/project.pbxproj:
2017-01-26 Chris Dumez <cdumez@apple.com>
Crash when navigating back to a page in PacheCache when one of its frames has been removed
https://bugs.webkit.org/show_bug.cgi?id=167421
<rdar://problem/30188490>
Reviewed by Darin Adler.
Disallow page caching of a page if:
1. The main window has an opener (i.e. it was opened via window.open)
2. It has ever used window.open()
This is because allowing page caching in this case would allow such
windows to script each other even after one of them entered Page
Cache. Allowing this is dangerous and easily causes crashes.
This is a short term workaround until we find a better solution to
the problem. One issue is this workaround is that navigating back
to a page that has an opener or used window.open() will not longer
get the page from PageCache. As a result, state may be lost upon
navigating back. However, we never guarantee that pages get page
cached, and Chrome does not have a PageCache.
Tests: fast/history/page-cache-after-window-open.html
fast/history/page-cache-back-navigation-crash.html
fast/history/page-cache-with-opener.html
* dom/Document.cpp:
(WebCore::Document::hasEverCalledWindowOpen):
(WebCore::Document::markHasCalledWindowOpen):
* dom/Document.h:
* history/PageCache.cpp:
(WebCore::canCachePage):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey):
(WebCore::DiagnosticLoggingKeys::hasOpenerKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::openedByWindowOpen):
* page/Page.h:
* page/Settings.in:
2017-01-26 Youenn Fablet <youennf@gmail.com>
[WebRTC] Add a LibWebRTC mock for testing
https://bugs.webkit.org/show_bug.cgi?id=167429
Reviewed by Alex Christensen.
Covered by updated tests although feature is behind a flag, off by default.
MockLibWebRTCPeerConnection will allow us testing the code above the WebRTC implementation above LibWebRTC,
without reyling on it and controlling the way that the peer connections will behave.
Adding support for mock factory to create real peer connections in case where we want to do full testing through the local loopback.
Tests: fast/mediastream/getUserMedia-webaudio.html
webrtc/datachannel/basic.html
webrtc/video.html
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::useMockRTCPeerConnectionFactory):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockLibWebRTCPeerConnection.cpp: Added.
(WebCore::useMockRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionForIceCandidates::MockLibWebRTCPeerConnectionForIceCandidates):
(WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
(WebCore::MockLibWebRTCPeerConnectionForIceConnectionState::MockLibWebRTCPeerConnectionForIceConnectionState):
(WebCore::MockLibWebRTCPeerConnectionForIceConnectionState::gotLocalDescription):
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreateLocalMediaStream):
(WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
(WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
(WebCore::MockLibWebRTCPeerConnection::CreateDataChannel):
(WebCore::MockLibWebRTCPeerConnection::AddStream):
(WebCore::MockLibWebRTCPeerConnection::RemoveStream):
(WebCore::MockLibWebRTCPeerConnection::CreateOffer):
(WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
* testing/MockLibWebRTCPeerConnection.h: Added.
(WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
(WebCore::MockLibWebRTCPeerConnection::MockLibWebRTCPeerConnection):
(WebCore::MockLibWebRTCPeerConnection::local_streams):
(WebCore::MockLibWebRTCPeerConnection::remote_streams):
(WebCore::MockLibWebRTCPeerConnection::CreateDtmfSender):
(WebCore::MockLibWebRTCPeerConnection::GetStats):
(WebCore::MockLibWebRTCPeerConnection::local_description):
(WebCore::MockLibWebRTCPeerConnection::remote_description):
(WebCore::MockLibWebRTCPeerConnection::AddIceCandidate):
(WebCore::MockLibWebRTCPeerConnection::RegisterUMAObserver):
(WebCore::MockLibWebRTCPeerConnection::signaling_state):
(WebCore::MockLibWebRTCPeerConnection::ice_connection_state):
(WebCore::MockLibWebRTCPeerConnection::ice_gathering_state):
(WebCore::MockLibWebRTCPeerConnection::StopRtcEventLog):
(WebCore::MockLibWebRTCPeerConnection::Close):
(WebCore::MockLibWebRTCPeerConnection::gotLocalDescription):
(WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
(WebCore::MockLibWebRTCAudioTrack::MockLibWebRTCAudioTrack):
(WebCore::MockLibWebRTCVideoTrack::MockLibWebRTCVideoTrack):
(WebCore::MockLibWebRTCDataChannel::MockLibWebRTCDataChannel):
(WebCore::MockLibWebRTCPeerConnectionFactory::create):
2017-01-26 Jeremy Jones <jeremyj@apple.com>
Page should be able to request pointer lock without user gesture if it relinquished it without a user gesture
https://bugs.webkit.org/show_bug.cgi?id=167126
Reviewed by Jon Lee.
Enabled pointer-lock/locked-element-removed-from-dom.html for WK2.
Not enable in WK1 because of https://bugs.webkit.org/show_bug.cgi?id=167127
This change allows a page to lock the pointer again without a user gesture if it was unlocked by
the page and not by the user. See https://www.w3.org/TR/2016/REC-pointerlock-20161027/ 5.1 Methods
* page/PointerLockController.cpp:
When a document acquires pointer lock with a user gesture, that document is allowed to request pointer lock again
until the user takes an action to end pointer lock. We know it is a user action because user actions always
call requestPointerUnlockAndForceCursorVisible().
When the page requests a pointer unlock (via requestPointerUnlock), that document is allowed to continue to relock
the page. This continues until there is either an unlock request form the user
via requestPointerUnlockAndForceCursorVisible or a didLosePointerLock without a pointer unlock request.
(WebCore::PointerLockController::PointerLockController):
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
(WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
(WebCore::PointerLockController::elementRemoved):
(WebCore::PointerLockController::documentDetached):
(WebCore::PointerLockController::didAcquirePointerLock):
(WebCore::PointerLockController::didLosePointerLock):
(WebCore::PointerLockController::clearElement):
* page/PointerLockController.h:
2017-01-26 Andy Estes <aestes@apple.com>
[QuickLook] REGRESSION (WebKit2): Requests are made to invalid x-apple-ql-id: URLs
https://bugs.webkit.org/show_bug.cgi?id=167453
Reviewed by Brent Fulgham.
Requests to x-apple-ql-id: URLs should be filtered by
-[QLPreviewConverter safeRequestForRequest:]. This method checks that the URL is one of the
ones generated for the current preview, and changes it to "about:" if it isn't.
WebCore::safeQLURLForDocumentURLAndResourceURL() was responsible for finding the
QLPreviewConverter instance to use by looking it up in an NSMutableDictionary using the
document URL as a key. In WebKit1, this dictionary was populated by the
QuickLookHandleClient when new QuickLookHandles were created, but the WebKit2
QuickLookHandleClient never did this. As a result, requests to invalid URLs were not being
rewritten.
An easy way to load a QuickLook document with invalid URLs is to create an HTML file with a
Microsoft Office extension (e.g. .xls); QuickLook, iWork, and Office support opening HTML
files with Office document extensions. In r207155 we applied a Content Security Policy to
QuickLook documents that only allows x-apple-ql-id: resources to load. This blocked
cross-origin requests from loading, but same-origin requests to URLs that weren't generated
by QLPreviewConverter were still allowed to load.
This change blocks these URLs by calling -[QLPreviewConverter safeRequestForRequest:] in a
way that works for both WebKit1 and WebKit2.
After implementing QuickLook for WebKit2, we found a bug when loading HTML-as-Office
documents (webkit.org/b/135651) that presented as a nil MIME type in the preview
NSURLResponse returned by QLPreviewConverter. Unfortunately r172159 papered over the actual
bug by failing to load previews with nil MIME types.
The real issue was that we were asking for the preview response before QuickLook had
received enough data to determine a MIME type, so this change also removes the bad fix from
r172159 and instead waits until QuickLook has converted the document to ask for its preview
response. This restores the ability to load HTML files with Office document extensions.
These two fixes are combined in a single patch because I don't know how to create an invalid
QuickLook URL for testing without loading an HTML-as-Office document.
Test: quicklook/invalid-ql-id-url.html
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal): Called
QuickLookHandle::willSendRequest() if m_documentLoader has a QuickLookHandle.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load): Removed the call to
WebCore::safeQLURLForDocumentURLAndResourceURL().
* loader/ios/QuickLook.h: Removed safeQLURLForDocumentURLAndResourceURL() and declared
QuickLookHandle::willSendRequest().
* loader/ios/QuickLook.mm: Removed _previewResponse and _hasFailed ivars from
WebPreviewConverter.
(-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]): Stopped
setting _previewResponse.
(-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Only emptied _bufferedDataArray
if we haven't already called -_sendDidReceiveResponseIfNecessary; removed the check for a
nil _previewResponse MIME type; accessed -[QLPreviewConverter previewResponse] now that the
document has been converted and asserted its MIME type is non-nil.
(-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Removed _hasFailed check.
(-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
(isQuickLookPasswordError): Moved the check for password failure errors to here from
-connection:didFailWithError: for better readability.
(-[WebPreviewConverter connection:didFailWithError:]): Removed _hasFailed check and used
more early returns.
(WebCore::QuickLookHandle::willSendRequest): Filtered the request through
-[QLPreviewConverter safeRequestWithRequest:] if the request URL's scheme is x-apple-ql-id:.
(WebCore::safeQLURLForDocumentURLAndResourceURL): Deleted.
2017-01-26 Keith Miller <keith_miller@apple.com>
classInfo should take a VM so it is not materialized from the object on each call
https://bugs.webkit.org/show_bug.cgi?id=167424
Rubber Stamped by Michael Saboff.
Previously, classInfo() would get the VM from the target's
MarkedBlock. Most callers already have a VM on hand, so it is
wasteful to compute the VM from the marked block every time. This
patch refactors some of the most common callers of classInfo(),
jsDynamicCast and inherits to take a VM as well.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::JSCommandLineAPIHost::getEventListeners):
(WebCore::JSCommandLineAPIHost::databaseId):
(WebCore::JSCommandLineAPIHost::storageId):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier):
(WebCore::createRsaKeyGenParams):
* bindings/js/JSCryptoCustom.cpp:
(WebCore::JSCrypto::getRandomValues):
* bindings/js/JSCryptoOperationData.cpp:
(WebCore::cryptoOperationDataFromJSValue):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToDate):
(WebCore::reportException):
(WebCore::retrieveErrorMessage):
* bindings/js/JSDOMBinding.h:
(WebCore::castThisValue):
(WebCore::toPossiblySharedArrayBufferView):
(WebCore::toUnsharedArrayBufferView):
(WebCore::toPossiblySharedInt8Array):
(WebCore::toPossiblySharedInt16Array):
(WebCore::toPossiblySharedInt32Array):
(WebCore::toPossiblySharedUint8Array):
(WebCore::toPossiblySharedUint8ClampedArray):
(WebCore::toPossiblySharedUint16Array):
(WebCore::toPossiblySharedUint32Array):
(WebCore::toPossiblySharedFloat32Array):
(WebCore::toPossiblySharedFloat64Array):
(WebCore::toUnsharedInt8Array):
(WebCore::toUnsharedInt16Array):
(WebCore::toUnsharedInt32Array):
(WebCore::toUnsharedUint8Array):
(WebCore::toUnsharedUint8ClampedArray):
(WebCore::toUnsharedUint16Array):
(WebCore::toUnsharedUint32Array):
(WebCore::toUnsharedFloat32Array):
(WebCore::toUnsharedFloat64Array):
(WebCore::toRefNativeArray):
* bindings/js/JSDOMConstructor.h:
(WebCore::JSDOMConstructorNotConstructable<JSClass>::finishCreation):
(WebCore::JSDOMConstructor<JSClass>::finishCreation):
(WebCore::JSDOMNamedConstructor<JSClass>::finishCreation):
(WebCore::JSBuiltinConstructor<JSClass>::finishCreation):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::Converter<IDLXPathNSResolver<T>>::convert):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::finishCreation):
(WebCore::JSDOMGlobalObject::scriptExecutionContext):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
(WebCore::IteratorTraits>::finishCreation):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowWebKit):
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::finishCreation):
(WebCore::JSDOMWindowShell::toWrapped):
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSDocumentCustom.cpp:
(WebCore::cachedDocumentWrapper):
(WebCore::JSDocument::createTouchList):
* bindings/js/JSDynamicDowncast.h:
(WebCore::JSDynamicCastTrait::cast):
(WebCore::JSDynamicCastTrait<JSNode>::cast):
(WebCore::JSDynamicCastTrait<JSElement>::cast):
(WebCore::JSDynamicCastTrait<JSDocument>::cast):
(WebCore::JSDynamicCastTrait<JSEvent>::cast):
(WebCore::jsDynamicDowncast):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
(WebCore::jsEventTargetCast):
* bindings/js/JSEventTargetCustom.h:
(WebCore::BindingCaller<JSEventTarget>::callOperation):
* bindings/js/JSExceptionBase.cpp:
(WebCore::toExceptionBase):
* bindings/js/JSExceptionBase.h:
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems):
(WebCore::JSInspectorFrontendHost::showContextMenu):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):
(WebCore::JSNode::removeChild):
(WebCore::JSNode::appendChild):
(WebCore::JSNode::pushEventHandlerScope):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamDefaultReader):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::startReadableStream):
(WebCore::JSReadableStreamSource::start):
(WebCore::pullReadableStream):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toCryptoKey):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionSignPromise):
(WebCore::jsSubtleCryptoFunctionVerifyPromise):
(WebCore::jsSubtleCryptoFunctionDigestPromise):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
(WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
* bindings/js/JSTrackCustom.cpp:
(WebCore::toTrack): Deleted.
* bindings/js/JSTrackCustom.h:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::JSWebKitSubtleCrypto::encrypt):
(WebCore::JSWebKitSubtleCrypto::decrypt):
(WebCore::JSWebKitSubtleCrypto::sign):
(WebCore::JSWebKitSubtleCrypto::verify):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::wrapKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::finishCreation):
(WebCore::toJSDedicatedWorkerGlobalScope):
(WebCore::toJSWorkerGlobalScope):
* bindings/js/JSWorkerGlobalScopeBase.h:
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
* bindings/js/JSXPathNSResolverCustom.cpp:
(WebCore::JSXPathNSResolver::toWrapped):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/ScriptState.cpp:
(WebCore::domWindowFromExecState):
(WebCore::scriptExecutionContextFromExecState):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::isArray):
(WebCore::CloneSerializer::isMap):
(WebCore::CloneSerializer::isSet):
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readArrayBufferView):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::transferArrayBuffers):
(WebCore::SerializedScriptValue::create):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBuffer):
(WebCore::structuredCloneArrayBufferView):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateOverloadedFunctionOrConstructor):
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceName::finishCreation):
(WebCore::jsInterfaceNameConstructor):
(WebCore::setJSInterfaceNameConstructor):
(WebCore::JSInterfaceName::toWrapped):
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObject::finishCreation):
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute):
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::setJSTestActiveDOMObjectConstructor):
(WebCore::JSTestActiveDOMObject::toWrapped):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactions::finishCreation):
(WebCore::BindingCaller<JSTestCEReactions>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactions>::castForOperation):
(WebCore::jsTestCEReactionsConstructor):
(WebCore::setJSTestCEReactionsConstructor):
(WebCore::JSTestCEReactions::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactions.h:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifier::finishCreation):
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation):
(WebCore::jsTestCEReactionsStringifierConstructor):
(WebCore::setJSTestCEReactionsStringifierConstructor):
(WebCore::JSTestCEReactionsStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructor::finishCreation):
(WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
(WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation):
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::finishCreation):
(WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation):
(WebCore::jsTestCustomNamedGetterConstructor):
(WebCore::setJSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::finishCreation):
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::finishCreation):
(WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute):
(WebCore::jsTestEventConstructorConstructor):
(WebCore::setJSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::finishCreation):
(WebCore::BindingCaller<JSTestEventTarget>::castForOperation):
(WebCore::jsTestEventTargetConstructor):
(WebCore::setJSTestEventTargetConstructor):
(WebCore::JSTestEventTarget::toWrapped):
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::finishCreation):
(WebCore::BindingCaller<JSTestException>::castForAttribute):
(WebCore::jsTestExceptionConstructor):
(WebCore::setJSTestExceptionConstructor):
(WebCore::JSTestException::toWrapped):
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::finishCreation):
(WebCore::jsTestGenerateIsReachableConstructor):
(WebCore::setJSTestGenerateIsReachableConstructor):
(WebCore::JSTestGenerateIsReachable::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute):
(WebCore::BindingCaller<JSTestGlobalObject>::castForOperation):
(WebCore::jsTestGlobalObjectConstructor):
(WebCore::setJSTestGlobalObjectConstructor):
(WebCore::JSTestGlobalObject::toWrapped):
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::finishCreation):
(WebCore::BindingCaller<JSTestInterface>::castForAttribute):
(WebCore::BindingCaller<JSTestInterface>::castForOperation):
(WebCore::jsTestInterfaceConstructor):
(WebCore::setJSTestInterfaceConstructor):
(WebCore::JSTestInterface::toWrapped):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
(WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterable::finishCreation):
(WebCore::BindingCaller<JSTestIterable>::castForOperation):
(WebCore::jsTestIterableConstructor):
(WebCore::setJSTestIterableConstructor):
(WebCore::JSTestIterable::toWrapped):
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::finishCreation):
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute):
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation):
(WebCore::jsTestJSBuiltinConstructorConstructor):
(WebCore::setJSTestJSBuiltinConstructorConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListener::finishCreation):
(WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation):
(WebCore::jsTestMediaQueryListListenerConstructor):
(WebCore::setJSTestMediaQueryListListenerConstructor):
(WebCore::JSTestMediaQueryListListener::toWrapped):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructor::finishCreation):
(WebCore::jsTestNamedConstructorConstructor):
(WebCore::setJSTestNamedConstructorConstructor):
(WebCore::JSTestNamedConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::finishCreation):
(WebCore::BindingCaller<JSTestNode>::castForAttribute):
(WebCore::BindingCaller<JSTestNode>::castForOperation):
(WebCore::jsTestNodeConstructor):
(WebCore::setJSTestNodeConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::finishCreation):
(WebCore::BindingCaller<JSTestObj>::castForAttribute):
(WebCore::BindingCaller<JSTestObj>::castForOperation):
(WebCore::jsTestObjConstructor):
(WebCore::setJSTestObjConstructor):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
(WebCore::JSTestObj::toWrapped):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::construct):
(WebCore::JSTestOverloadedConstructors::finishCreation):
(WebCore::jsTestOverloadedConstructorsConstructor):
(WebCore::setJSTestOverloadedConstructorsConstructor):
(WebCore::JSTestOverloadedConstructors::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequence::finishCreation):
(WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltins::finishCreation):
(WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation):
(WebCore::jsTestOverrideBuiltinsConstructor):
(WebCore::setJSTestOverrideBuiltinsConstructor):
(WebCore::JSTestOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerialization::finishCreation):
(WebCore::BindingCaller<JSTestSerialization>::castForAttribute):
(WebCore::BindingCaller<JSTestSerialization>::castForOperation):
(WebCore::jsTestSerializationConstructor):
(WebCore::setJSTestSerializationConstructor):
(WebCore::JSTestSerialization::toWrapped):
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::finishCreation):
(WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute):
(WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForOperation):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
(WebCore::JSTestSerializedScriptValueInterface::toWrapped):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::finishCreation):
(WebCore::BindingCaller<JSTestTypedefs>::castForAttribute):
(WebCore::BindingCaller<JSTestTypedefs>::castForOperation):
(WebCore::jsTestTypedefsConstructor):
(WebCore::setJSTestTypedefsConstructor):
(WebCore::JSTestTypedefs::toWrapped):
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bridge/c/CRuntimeObject.cpp:
(JSC::Bindings::CRuntimeObject::finishCreation):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CRuntimeMethod::finishCreation):
(JSC::Bindings::CInstance::invokeMethod):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/objc/ObjCRuntimeObject.mm:
(JSC::Bindings::ObjCRuntimeObject::finishCreation):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject setValue:forKey:]):
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
* bridge/objc/objc_instance.mm:
(ObjCRuntimeMethod::finishCreation):
(ObjcInstance::invokeMethod):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::finishCreation):
(JSC::Bindings::callObjCFallbackObject):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::finishCreation):
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::finishCreation):
(JSC::RuntimeMethod::lengthGetter):
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::finishCreation):
(JSC::Bindings::callRuntimeObject):
(JSC::Bindings::callRuntimeConstructor):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::canAccessInspectedScriptState):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
(WebCore::InspectorDOMAgent::scriptValueAsNode):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::subtype):
(WebCore::WebInjectedScriptHost::isHTMLAllCollection):
* inspector/WebInjectedScriptHost.h:
2017-01-26 Dean Jackson <dino@apple.com>
WebGL content in Safari sticks to GPU that it was started on, sometimes causing extra battery drain and difficulty interacting with UI
https://bugs.webkit.org/show_bug.cgi?id=167477
<rdar://problem/29956321>
Reviewed by Tim Horton.
We were not implementing the recommended approach to properly handle
GPU switching, causing some contexts to remain on a GPU and slow
down the machine's UI. It also could stop the discrete GPU from
turning off.
Register for CGL's display reconfiguration notification, so that we
can alert any active CGLContexts and cause them to update.
The code change here doesn't lend itself to automated testing because
it is specific to hardware with multiple GPUs, relies on some separate
tools to detect which GPU is active, and an external method of triggering
a GPU switch. It's best tested by the manual workflow in Radar.
* platform/graphics/GraphicsContext3D.h: Add a macOS-specific update
call.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::displayWasReconfigured): The callback for display reconfigurations.
(WebCore::addActiveContext): Helper to keep track of active contexts, so we
can register/unregister the callback when necessary.
(WebCore::removeActiveContext):
(WebCore::GraphicsContext3D::create): Use the new helpers.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::updateCGLContext): Tell the CGLContextRef to update.
2017-01-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r210328.
https://bugs.webkit.org/show_bug.cgi?id=167476
Blocking bug is fixed <rdar://problem/29957753> (Requested by
keith_miller on #webkit).
Reverted changeset:
"Disable smooth playhead animation for main content media in
the Touch Bar"
https://bugs.webkit.org/show_bug.cgi?id=166715
http://trac.webkit.org/changeset/210328
2017-01-26 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: iOS: Memory timeline shows impossible values for Page size (underflowed)
https://bugs.webkit.org/show_bug.cgi?id=167468
<rdar://problem/30099051>
Reviewed by Andreas Kling.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize):
This value matches the sysctl value we were attempting to access, and is
the most appropriate when dealing with mach APIs, as we are using here.
2017-01-26 Jer Noble <jer.noble@apple.com>
Autoplay muted videos stop playback of any streaming app in the background
https://bugs.webkit.org/show_bug.cgi?id=163993
<rdar://problem/29020431>
Reviewed by Eric Carlson.
Added test in TestWebKitAPI, WebKit1.AudioSessionCategoryIOS.
Previously, we would set the audio session category to "playback" if there was a media-
element-type media session, and if there was a session capable of playing audio. But because
this was an "or" operation, we would incorrectly set the category to "playback" if there was
a video element incapable of rendering audio (due to being muted, without an audio track,
etc.), and also a session capable of producing audio, such as WebAudio.
With this change, this turns into an "and" operation; there must be a media element capable
of rendering audio in order to switch the audio session category to "playback".
Additionally, we no longer cache the value of "canProduceAudio()"; it's queried directly
whenever updateSessionState() is called.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon):
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::presentationType):
(WebCore::HTMLMediaElement::characteristics):
(WebCore::HTMLMediaElement::canProduceAudio):
* html/HTMLMediaElement.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::activeAudioSessionRequired):
(WebCore::PlatformMediaSession::canProduceAudio):
(WebCore::PlatformMediaSession::canProduceAudioChanged):
(WebCore::PlatformMediaSession::setCanProduceAudio): Deleted.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSessionClient::canProduceAudio):
(WebCore::PlatformMediaSession::canProduceAudio): Deleted.
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):
2017-01-26 Filip Pizlo <fpizlo@apple.com>
EventTarget should visit the JSEventListeners using visitAdditionalChildren
https://bugs.webkit.org/show_bug.cgi?id=167462
Reviewed by Michael Saboff.
No new tests because this is already caught by existing testing. This would show up as ASSERTs
in debug, and we suspect it might be at fault for null deref crashes.
Previously, EventTarget would have its event listeners visited by its subclasses' visitChildren
methods. Every subclass of EventTarget would call EventTarget's visitJSEventListeners. For
example, this means that if JSFoo has seven classes between it and JSEventTarget in the JSCell
class hierarchy, then JSFoo::visitChildren would end up calling visitJSEventListeners seven extra
times.
Also, the weird way that visitJSEventListeners was called meant that it was not part of the GC's
output constraint processing. This meant that it would not be called when the GC tried to
terminate. So, if something about the event listener changes during a GC cycle, the GC would
potentially fail to mark one of the references.
Both problems can be solved by simply moving the call to visitJSEventListeners into
visitAdditionalChildren.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitAdditionalChildren):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::visitAdditionalChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* dom/EventTarget.idl:
2017-01-26 Andy Estes <aestes@apple.com>
[QuickLook] Create temporary files with NSFileProtectionCompleteUnlessOpen
https://bugs.webkit.org/show_bug.cgi?id=167455
<rdar://problem/12499118>
Reviewed by David Kilzer.
Add the NSFileProtectionKey attribute with value NSFileProtectionCompleteUnlessOpen to
temporary directories created for QuickLook files. Also:
1. Stop calling -[NSFileManager _web_pathWithUniqueFilenameForPath:], since the temporary
directory is already unique and only one file will be placed inside it.
2. Create the temporary file with -[NSFileManager _web_createFileAtPath:contents:attributes:]
instead of with -[NSFileManager _web_createFileAtPathWithIntermediateDirectories:contents:attributes:directoryAttributes:],
since the intermediate directories were already created by createTemporaryDirectory().
3. Explicitly set the temporary directory's attributes with
-[NSFileManager setAttributes:ofItemAtPath:error:].
4. Append the lastPathComponent of fileName to downloadDirectory to ensure fileName isn't
really a relative path.
* loader/ios/QuickLook.h: Stopped declaring QLFileAttributes() and QLDirectoryAttributes().
* loader/ios/QuickLook.mm:
(WebCore::temporaryFileAttributes): Renamed from QLFileAttributes().
(WebCore::temporaryDirectoryAttributes): Renamed from QLDirectoryAttributes().
(WebCore::createTemporaryFileForQuickLook):
(WebCore::QLFileAttributes): Deleted.
(WebCore::QLDirectoryAttributes): Deleted.
* platform/spi/cocoa/NSFileManagerSPI.h: Declared -_web_createFileAtPath:contents:attributes:
and removed declarations for -_web_createFileAtPathWithIntermediateDirectories:contents:attributes:directoryAttributes:
and -_web_pathWithUniqueFilenameForPath:
2017-01-26 Jeremy Jones <jeremyj@apple.com>
Pointer lock events should be delivered directly to the target element
https://bugs.webkit.org/show_bug.cgi?id=167134
Reviewed by Jon Lee.
pointer-lock/mouse-event-delivery.html: Enabled for mac, added wheel event tests.
When pointer is locked on an element, route mouse events directly to the target element, instead of
doing the normal event disptach.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::isLocked): Added.
(WebCore::PointerLockController::dispatchLockedWheelEvent): Added.
* page/PointerLockController.h:
2017-01-26 Chris Dumez <cdumez@apple.com>
Fix CPU / Memory diagnostic logging in PerformanceMonitor
https://bugs.webkit.org/show_bug.cgi?id=167469
<rdar://problem/30220959>
Reviewed by Alex Christensen.
Fix CPU / Memory diagnostic logging in PerformanceMonitor to use logDiagnosticMessage()
instead of logDiagnosticMessageWithValue(). logDiagnosticMessageWithValue() should only
be used with numeric values but we already take care of the bucketing on our side.
* page/DiagnosticLoggingClient.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingCPUUsageKey):
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingMemoryUsageKey):
(WebCore::DiagnosticLoggingKeys::postPageLoadCPUUsageKey):
(WebCore::DiagnosticLoggingKeys::postPageLoadMemoryUsageKey):
(WebCore::DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLoggingKey):
(WebCore::DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLoggingKey):
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingKey): Deleted.
(WebCore::DiagnosticLoggingKeys::postPageLoadKey): Deleted.
(WebCore::DiagnosticLoggingKeys::memoryUsageKey): Deleted.
* page/DiagnosticLoggingKeys.h:
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
(WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
(WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage):
2017-01-26 Brady Eidson <beidson@apple.com>
Gamepads: Some DPads are still not exposed in the HID backend.
rdar://problem/30217518 and https://bugs.webkit.org/show_bug.cgi?id=167465
Reviewed by Alex Christensen.
No new tests (Currently unable to test HID backend directly)
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::maybeAddButton): Allow GenericDesktop paged elements that are DPads to be buttons.
2017-01-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r210095.
https://bugs.webkit.org/show_bug.cgi?id=167464
broke tiling on mac (Requested by thorton on #webkit).
Reverted changeset:
"TileGrid revalidates tiles twice during flush, first with
wrong visible rect"
https://bugs.webkit.org/show_bug.cgi?id=166406
http://trac.webkit.org/changeset/210095
2017-01-26 Chris Dumez <cdumez@apple.com>
Fix WebGL diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167463
<rdar://problem/30216981>
Reviewed by Alex Christensen.
Fix WebGL diagnostic logging so that it no longer uses logDiagnosticMessageWithValue().
This is because the value apparently needs to be numeric on Mac.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey):
(WebCore::WebCore::DiagnosticLoggingKeys::webGLStateKey):
(WebCore::DiagnosticLoggingKeys::stateKey): Deleted.
(WebCore::DiagnosticLoggingKeys::handlesContextLossKey): Deleted.
(WebCore::WebCore::DiagnosticLoggingKeys::webGLKey): Deleted.
* page/DiagnosticLoggingKeys.h:
2017-01-26 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add support for -webkit-hyphenate-limit-lines
https://bugs.webkit.org/show_bug.cgi?id=167446
<rdar://problem/30194030>
Reviewed by Antti Koivisto.
Now we can set the limit on the number of lines that a word can split across through hyphenation.
Tests: fast/text/simple-line-layout-hyphen-limit-lines.html
fast/text/simple-line-layout-hyphen-limit-lines2.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen): The right side of the split has +1 on the wrapping counter.
2017-01-26 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for recognizing data interaction gestures in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=167444
Reviewed by Beth Dakin.
Minor tweaks to pasteboard code to support data interaction.
* WebCore.xcodeproj/project.pbxproj:
* platform/PlatformPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::PlatformPasteboard):
If the pasteboard is the special data interaction type, use the shared item provider pasteboard; otherwise,
fall back to the general pasteboard.
(WebCore::PlatformPasteboard::getTypes):
Actually populate the list of available types using available pasteboardTypes.
(WebCore::PlatformPasteboard::write):
Add UTF8 plaintext type (kUTTypeUTF8PlainText) when vending data representations of rich text.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
Move off of deprecated methods when retrieving and supplying data to the item provider pasteboard.
* platform/spi/ios/UIKitSPI.h:
2017-01-26 Matt Rajca <mrajca@apple.com>
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390
Reviewed by Alex Christensen.
The API is tested.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
* page/ChromeClient.h:
2017-01-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] ASSERTION FAILED: !g_object_is_floating(ptr) in adoptGRef(GstContext* ptr)
https://bugs.webkit.org/show_bug.cgi?id=167458
Reviewed by Xabier Rodriguez-Calvar.
GstContext is a mini_object, not a GObject. Therefore it shouldn't (and can't) be checked for floatingness.
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef): Removed incorrect assertion.
2017-01-26 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add support for -webkit-hyphenate-limit-after and -webkit-hyphenate-limit-before
https://bugs.webkit.org/show_bug.cgi?id=167439
<rdar://problem/30180184>
Reviewed by Antti Koivisto.
Implement pre and post hyphen length constrains for simple line layout.
Tests: fast/text/simple-line-layout-hyphen-limit-after.html
fast/text/simple-line-layout-hyphen-limit-before.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): Same as normal line layout default values.
(WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-01-26 Brady Eidson <beidson@apple.com>
Gamepad support shows wrong values for PS4 controllers (D-pad is missing).
<rdar://problem/29578619> and https://bugs.webkit.org/show_bug.cgi?id=165588
Reviewed by Alex Christensen.
No new tests (Currently unable to test HID backend directly)
DPads report their HID type as "a button", but their HID usage is "Hatswitch".
This patch adds a new element type that maps a "hatswitch" value to 4 additional buttons.
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::initElements):
(WebCore::HIDGamepad::initElementsFromArray):
(WebCore::HIDGamepad::maybeAddButton):
(WebCore::HIDGamepad::maybeAddDPad):
(WebCore::HIDGamepad::maybeAddAxis):
(WebCore::fillInButtonValues):
(WebCore::HIDGamepad::valueChanged):
* platform/gamepad/mac/HIDGamepad.h:
(WebCore::HIDGamepadElement::isDPad):
(WebCore::HIDGamepadDPad::HIDGamepadDPad):
(WebCore::HIDGamepadDPad::normalizedValue):
2017-01-26 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
https://bugs.webkit.org/show_bug.cgi?id=167160
<rdar://problem/29612318>
Reviewed by Dean Jackson.
When we toggle visibility of the controls bar, we notify the hosting media controls and in the case of the
macOS inline media controls, we update the controls layout which would have failed to run last time it tried
due to the controls bar being hidden.
Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set visible):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.controlsBarVisibilityDidChange):
2017-01-26 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] Unreviewed speculative buildfix after r211161.
https://bugs.webkit.org/show_bug.cgi?id=167294
* PlatformMac.cmake:
2017-01-26 Zan Dobersek <zdobersek@igalia.com>
ImageBufferCairo: cairo_image_surface should use bmalloc-allocated memory
https://bugs.webkit.org/show_bug.cgi?id=165751
Reviewed by Carlos Garcia Campos.
Allocate the underlying memory for cairo_image_surface objects through FastMalloc.
This way we can steer such large allocations away from the default libc allocator.
Objects of this class can create Cairo surfaces that need as much as 4MB of memory
for the underlying pixel buffer. Allocating such objects through the default
libc allocator can lead to increased memory usage because of non-optimal allocation
strategy in libc. In contrast, bmalloc performs large allocations by directly using
mmap() to reserve the necessary memory.
The improvements can be significant. On nytimes.com, with the threaded version of
the CoordinatedGraphics system, the memory consumption can drop by roughly 20%.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer): Zero-allocate the necessary memory via FastMalloc.
Tie that memory lifetime to the lifetime of the surface by using
cairo_surface_set_user_data() with the specific user data key.
2017-01-26 Miguel Gomez <magomez@igalia.com>
[GTK] WebProcess from WebKitGtk+ 2.15.3 SIGSEVs in WebCore::GraphicsContext3D::drawArrays(unsigned int, int, int) at Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:740
https://bugs.webkit.org/show_bug.cgi?id=167296
Reviewed by Sergio Villar Senin.
Use a VBO to pass the vertex data when using the stencil for clipping. Passing a custom array without
using an VBO is deprecated when using OpenGL >= 3.0 and a Core profile.
No behaviour change, no new tests.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::beginClip):
2017-01-25 Ryosuke Niwa <rniwa@webkit.org>
Crash under DOMSelection::deleteFromDocument()
https://bugs.webkit.org/show_bug.cgi?id=167232
Reviewed by Chris Dumez.
The crash was caused by DOMSelection's deleteFromDocument() mutating contents inside the user-agent
shadow tree of an input element when the text field is readonly. Fixed the bug by exiting early
whenever the selection is inside a shadow tree since getSelection().getRangeAt(0) always returns
a range outside the input element or any shadow tree for that matter.
New behavior matches that of Gecko. The working draft spec of which I'm the editor states that
deleteFromDocument() must invoke Range's deleteContents() on the associated range, which is
the collapsed range returned by getSelection().getRangeAt(0) in the spec:
https://www.w3.org/TR/2016/WD-selection-api-20160921/#widl-Selection-deleteFromDocument-void
And Range's deleteContents() immediately terminates in step 1 when start and end are identical:
https://dom.spec.whatwg.org/commit-snapshots/6b7621282c2e3b222ac585650e484abf4c0a416b/
Note that Range's DOM mutating methods are not available inside an user-agent shadow tree because
WebKit never returns a Range whose end boundary points are inside the tree to author scripts.
Editing commands (ones executable from document.execCommand) that mutate DOM like this check whether
the content is editable or not. Since VisibleSelection's validate() function makes sure the selection
is either entirely within or outside of an root editable element (editing host in the W3C spec lingo),
editing commands should never mutate a random node inside an user-agent shadow tree.
Test: editing/selection/deleteFromDocument-shadow-tree-crash.html
* page/DOMSelection.cpp:
(WebCore::DOMSelection::deleteFromDocument):
2017-01-25 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r211193.
This change broke internal builds.
Reverted changeset:
"Notify clients when the user plays media otherwise prevented
from autoplaying"
https://bugs.webkit.org/show_bug.cgi?id=167390
http://trac.webkit.org/changeset/211193
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Add infrastructure to support data interaction in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=167443
Reviewed by Simon Fraser.
Adds support in WebCore to determine whether there is interactive data at a given position. No new tests, since
there should be no behavior change yet.
* page/EventHandler.h:
* page/Page.cpp:
(WebCore::Page::hasDataInteractionAtPosition):
* page/Page.h:
2017-01-25 Matt Rajca <mrajca@apple.com>
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390
Reviewed by Alex Christensen.
The API is tested.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
* page/ChromeClient.h:
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor drag and drop implementation on Mac
https://bugs.webkit.org/show_bug.cgi?id=167427
Reviewed by Enrica Casucci.
Refactors some code around drag and drop on Mac, and cleans up some other related code as needed. This patch
should result in no behavior change.
* dom/DataTransfer.cpp:
* page/EventHandler.cpp:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::eventLoopHandleMouseDragged):
* page/mac/EventHandlerMac.mm:
* platform/DragImage.cpp:
* platform/Pasteboard.h:
* platform/ios/DragImageIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/mac/DragDataMac.mm:
(rtfPasteboardType):
(rtfdPasteboardType):
(stringPasteboardType):
(urlPasteboardType):
(htmlPasteboardType):
(colorPasteboardType):
(pdfPasteboardType):
(tiffPasteboardType):
(WebCore::DragData::DragData):
(WebCore::DragData::containsColor):
(WebCore::DragData::containsFiles):
(WebCore::DragData::numberOfFiles):
(WebCore::DragData::asFilenames):
(WebCore::DragData::containsPlainText):
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::containsPromise):
(WebCore::DragData::asURL):
* platform/mac/DragImageMac.mm:
2017-01-25 Youenn Fablet <youenn@apple.com>
[WebRTC] Add support for incoming and outgoing libwebrtc audio tracks
https://bugs.webkit.org/show_bug.cgi?id=167438
Reviewed by Eric Carlson.
RealtimeIncomingAudioSource consumes audio buffers given by libwebrtc.
RealtimeOutgoingAudioSource consumes audio buffers from WebCore tracks (capture typically) and feeds libwebrtc with them.
To be covered by Layout/mock tests once LibWebRTC peer connection will be added.
These are only skeletons right now, the conversion between WebCore and LibWebRTC data is not yet implemented.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp: Added.
(WebCore::RealtimeIncomingAudioSource::create):
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::OnData):
(WebCore::RealtimeIncomingAudioSource::startProducingData):
(WebCore::RealtimeIncomingAudioSource::stopProducingData):
(WebCore::RealtimeIncomingAudioSource::capabilities):
(WebCore::RealtimeIncomingAudioSource::settings):
(WebCore::RealtimeIncomingAudioSource::supportedConstraints):
(WebCore::RealtimeIncomingAudioSource::addObserver):
(WebCore::RealtimeIncomingAudioSource::removeObserver):
(WebCore::RealtimeIncomingAudioSource::start):
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h: Added.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: Added.
(WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h: Added.
2017-01-25 Youenn Fablet <youenn@apple.com>
[WebRTC] Add support for libwebrtc video incoming and outgoing video tracks
https://bugs.webkit.org/show_bug.cgi?id=167432
Reviewed by Eric Carlson.
Not covered by tests right now, this will be covered by layout/mock tests.
RealtimeIncomingVideoSource consumes video frames given by libwebrtc.
RealtimeOutgoingVideoSource consumes video frames from WebCore tracks (capture typically) and feeds libwebrtc with them.
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: Added.
(WebCore::RealtimeIncomingVideoSource::create):
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::startProducingData):
(WebCore::RealtimeIncomingVideoSource::stopProducingData):
(WebCore::RealtimeIncomingVideoSource::OnFrame):
(WebCore::RealtimeIncomingVideoSource::processNewSample):
(WebCore::drawImage):
(WebCore::RealtimeIncomingVideoSource::currentFrameImage):
(WebCore::RealtimeIncomingVideoSource::paintCurrentFrameInContext):
(WebCore::RealtimeIncomingVideoSource::capabilities):
(WebCore::RealtimeIncomingVideoSource::settings):
(WebCore::RealtimeIncomingVideoSource::supportedConstraints):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h: Added.
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: Added.
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::GetStats):
(WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
(WebCore::RealtimeOutgoingVideoSource::RemoveSink):
(WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h: Added.
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce an item-provider-based pasteboard wrapper
https://bugs.webkit.org/show_bug.cgi?id=167410
Reviewed by Enrica Casucci.
Introduces WebItemProviderPasteboard, a pasteboard-like object backed by a number of item providers. No new
tests, since there is no behavior change.
* WebCore.xcodeproj/project.pbxproj:
* platform/ios/AbstractPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
* platform/ios/WebItemProviderPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
* platform/ios/WebItemProviderPasteboard.mm: Added.
(isRichTextType):
(isStringType):
(isURLType):
(isColorType):
(isImageType):
(+[WebItemProviderPasteboard sharedInstance]):
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard dealloc]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard numberOfItems]):
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard changeCount]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
* platform/spi/ios/UIKitSPI.h:
2017-01-25 Konstantin Tokarev <annulen@yandex.ru>
Removed leftovers of pre-2015 VisualStudio support
https://bugs.webkit.org/show_bug.cgi?id=167434
Reviewed by Alex Christensen.
No new tests needed.
* platform/graphics/filters/FEConvolveMatrix.cpp: Replaced MSC_VER
usage with COMPILER(MSVC)
2017-01-25 Youenn Fablet <youenn@apple.com>
Fixing typos in r211161
https://bugs.webkit.org/show_bug.cgi?id=167433
Reviewed by Alex Christensen.
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2017-01-25 Simon Fraser <simon.fraser@apple.com>
Revert r210882, removing support for background-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167223
Reviewed by Myles C. Maxfield.
Followup from r211149; I missed part of the patch when committing.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
2017-01-25 Youenn Fablet <youennf@gmail.com>
[WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
https://bugs.webkit.org/show_bug.cgi?id=167294
Reviewed by Alex Christensen.
Introducing LibWebRTCMacros.h which should be included before any libwebrtc header.
Introducing LibWebRTCProvider as the abstraction allowing to suport WK1 and WK2 libwebrtc-based WebRTC endpoints.
It will create a libwebrtc peerconnection object differently in WK1 and WK2 as networking will be done differently.
LibWebRTCUtils contains routines used by WK1 and WK2 RTC providers to create the libwebrtc peerconnection object
and implement the necessary functionalities for it.
Updating PageConfiguration accordingly.
* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::libWebRTCProvider):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* platform/mediastream/libwebrtc/LibWebRTCMacros.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCProvider.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
(WebCore::staticFactoryAndThreads):
(WebCore::ThreadMessageData::ThreadMessageData):
(WebCore::PeerConnectionFactoryAndThreads::OnMessage):
(WebCore::callOnWebRTCNetworkThread):
(WebCore::initializePeerConnectionFactoryAndThreads):
(WebCore::initializeLibWebRTCInternalsWithSocketServer):
(WebCore::peerConnectionFactory):
(WebCore::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for named pasteboards, pasteboard strategies and platform pasteboards
https://bugs.webkit.org/show_bug.cgi?id=167404
Reviewed by Enrica Casucci.
Refactors some pasteboard-related code to plumb the name of the pasteboard across from WebCore to the client
layer. No new tests, because there should be no change in behavior.
* platform/DragData.h:
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::clear):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::types):
2017-01-25 Antoine Quint <graouts@apple.com>
LayoutTest media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167253
Reviewed by Jon Lee.
An IconButton loads its image asynchronously and waits for its load to obtain metrics. Once that happens,
its layout delegate needs to be notified that it needs a new layout. The test was a flaky failure because
the images would sometime load prior to layout, and sometime after, which would cause a failure. The test
is now robust with a controls layout happening after all buttons had loaded.
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage):
(IconButton):
2017-01-25 Timothy Hatcher <timothy@hatcher.name>
Fix the !HAVE(ACCESSIBILITY) build by properly instantiating AXObjectCache member timers.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::AXObjectCache):
2017-01-25 Chris Dumez <cdumez@apple.com>
Measure how common it is for content to deal with WebGL context loss
https://bugs.webkit.org/show_bug.cgi?id=166866
<rdar://problem/30171195>
Reviewed by Alex Christensen.
Add diagnostic logging to measure how common it is for sites to handle
WebGL context loss via the webglcontextlost & webglcontextrestored
events.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
* html/canvas/WebGLRenderingContextBase.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::noKey):
(WebCore::DiagnosticLoggingKeys::yesKey):
(WebCore::DiagnosticLoggingKeys::handlesContextLossKey):
* page/DiagnosticLoggingKeys.h:
2017-01-25 Simon Fraser <simon.fraser@apple.com>
Revert r210882, removing support for background-repeat-x/y
https://bugs.webkit.org/show_bug.cgi?id=167223
Reviewed by Myles Maxfield.
CSSPropertyBackgroundRepeatX and CSSPropertyBackgroundRepeatY only exist to make it easier
to parse CSSPropertyBackgroundRepeat as if it were a shorthand; they were never intended to
be web-exposed. r210882 mistakenly expose them to the web, so undo that patch, and annotate
the properties in CSSProperties.json with a flag which indicates their special status.
In addition, remove background-repeat-x/y from the list of properties allowed in video cues,
since these are not valid properties.
* css/CSSProperties.json:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::isValidCueStyleProperty):
* css/makeprop.pl:
(addProperty):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
2017-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
https://bugs.webkit.org/show_bug.cgi?id=165656
Reviewed by Michael Catanzaro.
Also return the base error code from PlatformDisplayX11::supportsXDamage().
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXDamage):
* platform/graphics/x11/PlatformDisplayX11.h:
2017-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix 32 bit build after r211140.
Include glib-object.h instead of forward declaring GType.
* platform/network/soup/SoupNetworkSession.h:
2017-01-25 Miguel Gomez <magomez@igalia.com>
[GTK] The inspector is broken when AC support is disabled
https://bugs.webkit.org/show_bug.cgi?id=165237
Reviewed by Carlos Garcia Campos.
Ensure that PageOverlayController destroys its root GraphicsLayers when leaving AC. They
will be recreated if we enter AC again, avoiding a crash because the layers don't belong to
the appropriate compositor. Also, don't append the document overlay layers if we are not
in compositing mode.
No new tests added.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::willDetachRootLayer):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::detachRootLayer):
2017-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Custom protocols don't work in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=167236
Reviewed by Sergio Villar Senin.
Add static method to set the global custom protocols request type and setup method to add the feature to the session.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setCustomProtocolRequestType):
(WebCore::SoupNetworkSession::setupCustomProtocols):
* platform/network/soup/SoupNetworkSession.h:
2017-01-25 Ryosuke Niwa <rniwa@webkit.org>
collectMatchingElementsInFlatTree should not find elements inside an user agent shadow tree
https://bugs.webkit.org/show_bug.cgi?id=167409
Reviewed by Antti Koivisto.
The bug was caused by collectMatchingElementsInFlatTree including elements inside an user agent shadow tree
even though it shouldn't. Fixed the bug by checking that condition.
Also added matchingElementInFlatTree to find the first element matching a selector as opposed to all,
again, only exposed in a world which forces all shadow trees to be accessible.
* page/DOMWindow.cpp:
(WebCore::selectorQueryInFrame):
(WebCore::DOMWindow::collectMatchingElementsInFlatTree):
(WebCore::DOMWindow::matchingElementInFlatTree):
* page/DOMWindow.h:
* page/DOMWindow.idl:
2017-01-24 Alex Christensen <achristensen@webkit.org>
REGRESSION (r208902): URLWithUserTypedString returns nil with file URLs
https://bugs.webkit.org/show_bug.cgi?id=167402
<rdar://problem/29896656>
Reviewed by Ryosuke Niwa.
Covered by a new API test.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNameWithRange):
uidna_IDNToASCII succeeds when length is 0.
uidna_nameToASCII fails when length is 0.
This causes bad things to happen with file URLs, which have no host, so their host length is 0.
This makes us match behavior before r208902.
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=167394
Reviewed by Ryosuke Niwa.
All of the Performance Timing specifications are highly coupled.
So let make WEB_TIMING encompass them all:
- High Resolution Time (window.performance)
- Performance Timeline (PerformanceEntry, PerformanceObserver)
- Navigation Timing ("navigation" entries)
- Resource Timing ("resource" entries)
- User Timing ("mark" / "measure" entries)
We can then turn on and off individual pieces as runtime features,
such as Resource Timing, User Timing, and Performance Observer.
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add User Timing files that are now included in WEB_TIMING builds.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setUserTimingEnabled):
(WebCore::RuntimeEnabledFeatures::userTimingEnabled):
Add a runtime feature for user timing. Disabled by default.
* Configurations/FeatureDefines.xcconfig:
* PAL/Configurations/FeatureDefines.xcconfig:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* page/Performance.cpp:
(WebCore::Performance::getEntries):
(WebCore::Performance::getEntriesByType):
(WebCore::Performance::getEntriesByName):
(WebCore::Performance::mark):
(WebCore::Performance::clearMarks):
(WebCore::Performance::measure):
(WebCore::Performance::clearMeasures):
(WebCore::Performance::webkitMark): Deleted.
(WebCore::Performance::webkitClearMarks): Deleted.
(WebCore::Performance::webkitMeasure): Deleted.
(WebCore::Performance::webkitClearMeasures): Deleted.
* page/Performance.h:
* page/Performance.idl:
* page/PerformanceMark.h:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.h:
* page/PerformanceMeasure.idl:
* page/PerformanceUserTiming.cpp:
* page/PerformanceUserTiming.h:
Convert USER_TIMING to WEB_TIMING.
Drop webkit prefixed legacy names.
2017-01-24 Antoine Quint <graouts@apple.com>
LayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=167311
Reviewed by Dean Jackson.
Ensure we have a chance to start the transition (on the next frame) before registering for an event
tracking its completion.
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.hide):
2017-01-24 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Avoid IOSurface readback for snapshot creation
https://bugs.webkit.org/show_bug.cgi?id=167397
rdar://problem/30174873
Reviewed by Tim Horton.
Export sinkIntoImage().
* platform/graphics/cocoa/IOSurface.h:
2017-01-24 Brent Fulgham <bfulgham@apple.com>
Bug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
https://bugs.webkit.org/show_bug.cgi?id=167392
<rdar://problem/30074665>
Reviewed by Brady Eidson.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay): Exclude the new check when building on iOS.
2017-01-24 Andreas Kling <akling@apple.com>
Add memory footprint reporting using diagnostic logging.
<https://webkit.org/b/167285>
<rdar://problem/30151767>
Reviewed by Chris Dumez.
Add some basic logging of physical memory footprint post-load and post-backgrounding.
The logging works similarly to the CPU usage logging, though with slightly longer
delays to allow the measurement to stabilize.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::memoryUsageKey):
(WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::physicalFootprint):
* page/PerformanceLogging.h:
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::PerformanceMonitor):
(WebCore::PerformanceMonitor::didFinishLoad):
(WebCore::PerformanceMonitor::activityStateChanged):
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
(WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
* page/PerformanceMonitor.h:
* page/Settings.h:
(WebCore::Settings::isPostLoadMemoryUsageMeasurementEnabled):
(WebCore::Settings::isPostBackgroundingMemoryUsageMeasurementEnabled):
* page/cocoa/PerformanceLoggingCocoa.mm:
(WebCore::PerformanceLogging::physicalFootprint):
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Remove always true unsafePluginPastingEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167360
Reviewed by Andreas Kling.
Setting added by Chromium and never used by other ports.
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* page/Settings.in:
2017-01-24 Anders Carlsson <andersca@apple.com>
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167391
rdar://problem/29857388
Reviewed by Sam Weinig.
* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Remove an unused variable.
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
subframes that contain plug-ins.
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Clean up Performance IDL interfaces so they are easier to read
https://bugs.webkit.org/show_bug.cgi?id=167378
Reviewed by Sam Weinig.
* page/Performance.idl:
* page/PerformanceEntry.idl:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.idl:
Update spec links and use a typedef to match specs.
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::workerStart):
* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.idl:
Add the workerStart property which always returns 0 for non-workers.
2017-01-24 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add support for hyphen: auto.
https://bugs.webkit.org/show_bug.cgi?id=167297
<rdar://problem/30119463>
Reviewed by Antti Koivisto.
Implement hyphen: auto for simple line layout.
Tests: fast/text/simple-line-hyphens-with-text-align.html
fast/text/simple-line-hyphens-with-word-letter-spacing.html
* platform/text/Hyphenation.h:
(WebCore::enoughWidthForHyphenation):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeSimpleLine):
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Inherit the hyphen attribute from the
run-to-be-appended. Ensure that we don't append additional runs when the last run has hyphen.
(WebCore::SimpleLineLayout::splitFragmentToFitLine): Before calling into the lastHyphenPosition() we need to
ensure that the hyphen would surely fit (even on the splitting position).
(WebCore::SimpleLineLayout::createLineRuns): Probe hypenation for overhanging non-whitespace runs.
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Run::Run):
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::Segment::toSegmentPosition):
(WebCore::SimpleLineLayout::FlowContents::Segment::toRenderPosition):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::Run):
(WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded):
(WebCore::SimpleLineLayout::RunResolver::Run::text):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::hasHyphen):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition): We only check the actual run for hyphenation ignoring
the neighboring runs. This might need to be changed in the future.
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
* rendering/line/BreakingContext.h:
(WebCore::tryHyphenating):
2017-01-24 Matt Rajca <mrajca@apple.com>
Pass down website autoplay policies to media elements
https://bugs.webkit.org/show_bug.cgi?id=167355
Reviewed by Alex Christensen.
Autoplay policies can be specified at the global web view preferences level or on a per-page
basis during navigation. This patch ensures that policies specified on a per-page basis hold
precedence over global policies. If no policies are specified during navigation, global
policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
explicitly specify web view defaults should be used.
* dom/Document.cpp:
(WebCore::Document::audioPlaybackRequiresUserGesture):
(WebCore::Document::videoPlaybackRequiresUserGesture):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::playInternal):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::audioPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::setAudioPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::videoPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::setVideoPlaybackRequiresUserGesture):
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Remove always true selectionIncludesAltImageText setting
https://bugs.webkit.org/show_bug.cgi?id=167358
Reviewed by Alex Christensen.
* editing/Editor.cpp:
(WebCore::Editor::selectedTextForDataTransfer):
* page/Settings.in:
2017-01-24 Daniel Bates <dabates@apple.com>
StringView.split() should use an iterator design pattern instead of allocating a Vector
https://bugs.webkit.org/show_bug.cgi?id=163225
Reviewed by Darin Adler.
Update code to use the new iterator-style StringView.split().
* platform/URLParser.cpp:
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Remove always true openGLMultisamplingEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167364
Reviewed by Sam Weinig.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* page/Settings.in:
2017-01-24 Miguel Gomez <magomez@igalia.com>
[GTK] Do not paint non composited content into the window when using the threaded compositor
https://bugs.webkit.org/show_bug.cgi?id=167367
Reviewed by Carlos Garcia Campos.
When using the threaded compositor we need to send the non composited content for compositing as well,
not painting it directly into the window.
No new tests.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintsIntoWindow):
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Remove always true allowCustomScrollbarInMainFrame setting
https://bugs.webkit.org/show_bug.cgi?id=167362
Reviewed by Andreas Kling.
Setting added by Chromium and never used by other ports.
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
* page/Settings.in:
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Remove always true syncXHRInDocumentsEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167359
Reviewed by Alex Christensen.
Setting added by Chromium and never used by other ports.
* page/Settings.in:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Remove always true antialiased2dCanvasEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167361
Reviewed by Andreas Kling.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer):
* page/Settings.in:
2017-01-15 Yusuke Suzuki <utatane.tea@gmail.com>
Add the support for nomodule attribute on script element
https://bugs.webkit.org/show_bug.cgi?id=166987
Reviewed by Sam Weinig.
As discussed on https://github.com/whatwg/html/pull/2261, we should have
the way to suppress classic script execution when our user agent have
modules support. With such a feature, developers can write the code like,
<script type="module" src="./app.js"></script>
<script nomodule src="./bundled-app.js"></script>
In the above code, if the user agent does not support modules, the bundled-app.js
will be executed. On the other hand, if the user agent supports modules, we should
ignore the script tag which has the `nomodule` attribute.
This way allows us to support the legacy browsers while using modules.
In WebKit, we already support modules. Thus, we should ignore the classic script
attributed `nomodule`.
We also rename asyncAttributeValue and deferAttributeValue to hasAsyncAttribute and
hasDeferAttribute.
Tests: js/dom/modules/nomodule-has-no-effect-on-module-inline.html
js/dom/modules/nomodule-has-no-effect-on-module-src.html
js/dom/modules/nomodule-prevents-execution-classic-script-inline.html
js/dom/modules/nomodule-prevents-execution-classic-script-src.html
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
* dom/ScriptElement.h:
* html/HTMLAttributeNames.in:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::hasAsyncAttribute):
(WebCore::HTMLScriptElement::hasDeferAttribute):
(WebCore::HTMLScriptElement::hasNoModuleAttribute):
(WebCore::HTMLScriptElement::asyncAttributeValue): Deleted.
(WebCore::HTMLScriptElement::deferAttributeValue): Deleted.
* html/HTMLScriptElement.h:
* html/HTMLScriptElement.idl:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::hasAsyncAttribute):
(WebCore::SVGScriptElement::hasDeferAttribute):
(WebCore::SVGScriptElement::hasNoModuleAttribute):
(WebCore::SVGScriptElement::asyncAttributeValue): Deleted.
(WebCore::SVGScriptElement::deferAttributeValue): Deleted.
* svg/SVGScriptElement.h:
2017-01-23 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide a way to trigger a Garbage Collection
https://bugs.webkit.org/show_bug.cgi?id=167345
<rdar://problem/30102853>
Reviewed by Timothy Hatcher.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Include a HeapAgent so we can do Heap.gc on Workers.
2017-01-23 Joseph Pecoraro <pecoraro@apple.com>
Cleanup WEB_TIMING code
https://bugs.webkit.org/show_bug.cgi?id=167339
Reviewed by Alex Christensen.
Stylistic cleanup to WEB_TIMING related code.
* bindings/js/JSPerformanceEntryCustom.cpp:
* loader/ResourceTimingInformation.cpp:
* loader/ResourceTimingInformation.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* page/Performance.cpp:
(WebCore::Performance::getEntries):
(WebCore::Performance::getEntriesByType):
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::isResourceTimingBufferFull):
* page/Performance.h:
* page/PerformanceMark.h:
* page/PerformanceMeasure.h:
* page/PerformanceNavigation.h:
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
* page/PerformanceResourceTiming.h:
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::documentLoader):
(WebCore::PerformanceTiming::documentTiming):
(WebCore::PerformanceTiming::loadTiming):
* page/PerformanceTiming.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
2017-01-23 Alex Christensen <achristensen@webkit.org>
URLParser should fail to parse percent-encoded invalid UTF-8 sequences
https://bugs.webkit.org/show_bug.cgi?id=167330
<rdar://problem/29319962>
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::containsOnlyASCII):
(WebCore::URLParser::parseHostAndPort):
If UTF-8 decoding fails after percent-decoding the host, fail to parse.
This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215
2017-01-23 Alex Christensen <achristensen@webkit.org>
Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
https://bugs.webkit.org/show_bug.cgi?id=167317
<rdar://problem/29526875>
Reviewed by Sam Weinig.
This is currently being added to the URL spec in https://github.com/whatwg/url/issues/212
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Only add a slash if there wasn't one if the URL has a special scheme.
This new behavior matches the old behavior of URL::parse.
2017-01-23 Joseph Pecoraro <pecoraro@apple.com>
Convert langAttributeAwareFormControlUIEnabled to a Setting
https://bugs.webkit.org/show_bug.cgi?id=167279
Reviewed by Sam Weinig.
* dom/Document.cpp:
(WebCore::Document::getCachedLocale):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
Convert to use Settings instead of RuntimeEnabledFeatures.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled): Deleted.
* page/Settings.in:
Move to Settings.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Remove the manual interface for the RuntimeEnabledFeature.
An identical interface is generated from Settings.in!
2017-01-20 Anders Carlsson <andersca@apple.com>
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167268
rdar://problem/29857388
Reviewed by Sam Weinig.
* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Call PluginInfoProvider::refresh instead.
(WebCore::Page::clearPluginData):
Add new setter.
* page/Page.h:
Declare new members.
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Put the logic to clear plug-in data and reload frames here.
* plugins/PluginInfoProvider.h:
Add new members.
2017-01-23 Jer Noble <jer.noble@apple.com>
REGRESSION (r208149): Video details does not apear and missing scrubber in Control Center
https://bugs.webkit.org/show_bug.cgi?id=167233
Reviewed by Alex Christensen.
Test: In TestWebKitAPI, NowPlayingControlsTests.NowPlayingControlsIOS
In r208149, we introduced a new media type, Video, and renamed the old type to
VideoAudio (to be able to distinguish between video-with-audio and silent-video).
But we missed one place where that type needs to be renamed.
For testing purposes, overload methods from PlatformMediaSessionManager which WebKit2 uses
to report the current now playing session and it's information.
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2017-01-23 Chris Dumez <cdumez@apple.com>
REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
https://bugs.webkit.org/show_bug.cgi?id=167308
<rdar://problem/30144964>
Unreviewed, do a partial revert of r211033 to fix assertion.
No new tests, already covered by:
fullscreen/exit-full-screen-iframe.html
* dom/Document.cpp:
(WebCore::Document::webkitExitFullscreen):
* page/ChromeClient.h:
2017-01-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] asserting on unknown locale for hyphenation is wrong
https://bugs.webkit.org/show_bug.cgi?id=167312
Reviewed by Carlos Garcia Campos.
The fact that we hit the assert on a test called 'hyphenation-unknown-locale' is already
a strong indication we should not have it. In addition to that, Carlos Lopez pointed out
a similar assert was removed from the Mac codepaths when the test was introduced.
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::lastHyphenLocation): early return when a locale that is not available is provided
for hyphenation, instead of asserting.
2017-01-23 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix the iOS build after r211033.
* dom/Node.cpp:
(WebCore::Node::defaultEventHandler):
2017-01-23 Joseph Pecoraro <pecoraro@apple.com>
Remove allowWindowOpenWithoutUserGesture setting
https://bugs.webkit.org/show_bug.cgi?id=167301
Reviewed by Darin Adler.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
* page/Settings.in:
2017-01-22 Carlos Garcia Campos <cgarcia@igalia.com>
Database file not removed for origins after deleting all databases
https://bugs.webkit.org/show_bug.cgi?id=167281
Reviewed by Darin Adler.
When DatabaseTracker::deleteDatabasesModifiedSince() is called with a min time, all databases for every origin
are deleted. For each origin if all databases are removed DatabaseTracker::deleteOrigin() is called to remove
also the origin database file. However, DatabaseTracker::deleteOrigin() returns early if the origin doesn't have
databases and in this particular case it never has databases, because we have just removed them.
This will be covered by GTK+ unit tests.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Instead of removing the databases while iterating
them, add the ones to be removed to a vector. If after the iteration all databases should be removed call
DatabaseTracker::deleteOrigin() to ensure both the databases and the database file are removed for the origin,
otherwhise call DatabaseTracker::deleteDatabase() for every database to delete.
2017-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Update Safari version in user agent
https://bugs.webkit.org/show_bug.cgi?id=167290
Reviewed by Carlos Garcia Campos.
Update Safari version from 10 to 11.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2017-01-20 Darin Adler <darin@apple.com>
Remove PassRefPtr from "page" directory of WebCore, also deploy references
https://bugs.webkit.org/show_bug.cgi?id=167224
Reviewed by Chris Dumez.
* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch): Use DOMWindow::document instead of
scriptExecutionContext.
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::databaseExceededQuota): Pass a reference.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
Pass a reference.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot): Pass a reference.
* dom/Document.cpp:
(WebCore::Document::childrenChanged): Pass a reference. Also made the
didReceiveDocType code unconditional instead of iOS-only.
(WebCore::Document::platformSuspendOrStopActiveDOMObjects): Ditto.
(WebCore::Document::updateViewportArguments): Ditto.
(WebCore::Document::setFocusedElement): Ditto.
(WebCore::Document::createDOMWindow): Ditto.
(WebCore::Document::takeDOMWindowFrom): Ditto.
(WebCore::Document::requestFullScreenForElement): Ditto.
(WebCore::Document::webkitExitFullscreen): Ditto.
* dom/Element.cpp:
(WebCore::Element::focus): Ditto.
(WebCore::Element::blur): Ditto.
(WebCore::Element::dispatchFocusEvent): Ditto.
(WebCore::Element::dispatchBlurEvent): Ditto.
* dom/Node.cpp:
(WebCore::Node::defaultEventHandler): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executePrint): Ditto.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setFocusedElementIfNeeded): Ditto.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore): Ditto.
(WebCore::CachedFrame::CachedFrame): Ditto.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::handleDOMActivateEvent): Ditto.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable): Ditto.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isKeyboardFocusable): Pass a reference,
and also rewrote to use && for clarity.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen): Pass a reference.
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler): Ditto.
(WebCore::SpinButtonElement::releaseCapture): Ditto.
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler): Ditto.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu): Ditto.
(WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): Ditto.
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::createPopupMenu): Updated to take reference.
(WebCore::EmptyChromeClient::createSearchPopupMenu): Ditto.
(WebCore::EmptyChromeClient::createColorChooser): Ditto.
* loader/EmptyClients.h: Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm): Pass a reference.
(WebCore::FrameLoader::commitProvisionalLoad): Ditto.
(WebCore::FrameLoader::closeAndRemoveChild): Take a reference.
(WebCore::FrameLoader::detachFromParent): Pass a reference.
(WebCore::FrameLoader::dispatchBeforeUnloadEvent): Ditto.
(WebCore::createWindow): Ditto.
* loader/FrameLoader.h: Updated for the above.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNewWindowPolicy): Pass a reference.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota): Ditto.
* loader/appcache/ApplicationCacheGroup.h: Return a reference from origin.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): Take a reference.
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
Ditto.
(WebCore::ApplicationCacheStorage::store): Pass a reference.
(WebCore::ApplicationCacheStorage::checkOriginQuota): Updated since origin
now returns areference.
* loader/appcache/ApplicationCacheStorage.h: Updated for the above.
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::generateMHTMLData): Pass a reference.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isKeyboardFocusable): Ditto.
* page/Chrome.cpp:
(WebCore::Chrome::Chrome): Moved initialization of data members to the
class definition.
(WebCore::Chrome::contentsSizeChanged): Take a reference.
(WebCore::Chrome::createWindow): Ditto.
(WebCore::Chrome::runBeforeUnloadConfirmPanel): Ditto.
(WebCore::Chrome::runJavaScriptAlert): Ditto.
(WebCore::Chrome::runJavaScriptConfirm): Ditto.
(WebCore::Chrome::runJavaScriptPrompt): Ditto.
(WebCore::Chrome::setStatusbarText): Ditto.
(WebCore::Chrome::print): Ditto.
(WebCore::Chrome::createColorChooser): Ditto.
(WebCore::Chrome::createPopupMenu): Ditto.
(WebCore::Chrome::createSearchPopupMenu): Ditto.
(WebCore::Chrome::didReceiveDocType): Ditto. Also made unconditional, but
empty for non-iOS platforms.
(WebCore::Chrome::registerPopupOpeningObserver): Take a reference.
(WebCore::Chrome::unregisterPopupOpeningObserver): Ditto.
* page/Chrome.h: Updated for the above.
* page/ChromeClient.h: Take references. Also updated some arguments from
Node to Element.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent): Take a reference.
(WebCore::ContextMenuController::showContextMenu): Ditto.
(WebCore::ContextMenuController::maybeCreateContextMenu): Ditto. Also use
make_unique instead of unique_ptr plus new.
(WebCore::openNewWindow): Ditto.
(WebCore::insertUnicodeCharacter): Ditto.
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
(WebCore::ContextMenuController::showContextMenuAt): Ditto.
(WebCore::ContextMenuController::showImageControlsMenu): Ditto.
* page/ContextMenuController.h: Updated for the above.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired): Pass a reference.
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer): Take Ref&& instead of
PassRefPtr.
(WebCore::DOMWindow::adjustWindowRect): Use a reference.
(WebCore::DOMWindow::allowPopUp): Ditto. Also rewrite to use || instead
of successive if statements.
(WebCore::DOMWindow::canShowModalDialog): Ditto.
(WebCore::DOMWindow::DOMWindow): Ditto.
(WebCore::DOMWindow::didSecureTransitionTo): Ditto.
(WebCore::DOMWindow::registerProperty): Ditto.
(WebCore::DOMWindow::unregisterProperty): Ditto.
(WebCore::DOMWindow::postMessageTimerFired): Merge with the function
immediately followed, called only from here.
(WebCore::DOMWindow::dispatchMessageEventWithOriginCheck): Deleted.
(WebCore::DOMWindow::print): Pass a reference.
(WebCore::DOMWindow::alert): Ditto.
(WebCore::DOMWindow::confirm): Ditto.
(WebCore::DOMWindow::prompt): Ditto.
(WebCore::DOMWindow::setStatus): Ditto.
(WebCore::DOMWindow::setDefaultStatus): Ditto.
(WebCore::DOMWindow::moveBy): Ditto.
(WebCore::DOMWindow::moveTo): Ditto.
(WebCore::DOMWindow::resizeBy): Ditto.
(WebCore::DOMWindow::resizeTo): Ditto.
(WebCore::DOMWindow::clearTimeout): Ditto.
(WebCore::DOMWindow::incrementScrollEventListenersCount): Ditto.
(WebCore::DOMWindow::decrementScrollEventListenersCount): Ditto.
(WebCore::DOMWindow::showModalDialog): Ditto.
* page/DOMWindow.h: Updated for the above. ALso made functions private
and final.
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::DOMWindowProperty): Pass a reference.
(WebCore::DOMWindowProperty::~DOMWindowProperty): Ditto.
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): Ditto.
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): Ditto.
* page/DebugPageOverlays.cpp:
(WebCore::RegionOverlay::create): Return RefPtr instead of PassRefPtr.
(WebCore::RegionOverlay::~RegionOverlay): Pass a reference.
(WebCore::DebugPageOverlays::showRegionOverlay): Ditto.
(WebCore::DebugPageOverlays::hideRegionOverlay): Ditto.
* page/DragController.cpp:
(WebCore::DragController::dragExited): Pass a reference.
(WebCore::DragController::performDragOperation): Ditto.
(WebCore::DragController::concludeEditDrag): Ditto.
(WebCore::DragController::tryDHTMLDrag): Ditto.
* page/EventHandler.cpp: Replaced OptionalCursor with std::optional<Cursor>.
(WebCore::EventHandler::updateCursor): Refactor into two functions so we
can share more code with selectCursor.
(WebCore::EventHandler::selectCursor): Updated to use std::optional.
(WebCore::EventHandler::handleMouseMoveEvent): Use the new updateCursor.
(WebCore::EventHandler::startPanScrolling): Use a reference.
(WebCore::EventHandler::updateDragAndDrop): Ditto.
(WebCore::EventHandler::cancelDragAndDrop): Ditto.
(WebCore::EventHandler::performDragAndDrop): Ditto.
(WebCore::EventHandler::setCapturingMouseEventsElement): Take a raw pointer
instead of a PassRefPtr.
(WebCore::EventHandler::dispatchMouseEvent): Use a reference.
(WebCore::EventHandler::updateDragStateAfterEditDragIfNeeded): Ditto.
(WebCore::EventHandler::isKeyboardOptionTab): Ditto.
(WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult): Ditto.
(WebCore::EventHandler::tabsToLinks): Ditto.
* page/EventHandler.h: Updated for the above.
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedFrame): Take pointer instead
of PassRefPtr.
(WebCore::FocusController::setFocusedElement): Take reference instead of
PassRefPtr.
* page/FocusController.h: Updated for the above changes.
* page/FrameTree.cpp:
(WebCore::FrameTree::transferChild): Deleted. Unused function.
(WebCore::FrameTree::appendChild): Merged with the following function
since it's now only used here. Take reference instead of PassRefPtr.
(WebCore::FrameTree::actuallyAppendChild): Deleted.
(WebCore::FrameTree::removeChild): Take reference instead of pointer.
Use move instead of trickier swap.
* page/FrameTree.h: Updated for the above.
* page/FrameView.cpp:
(WebCore::FrameView::setContentsSize): Use a reference.
* page/MainFrame.cpp:
(WebCore::MainFrame::dropChildren): Ditto.
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator): Ditto.
* page/PageOverlay.cpp:
(WebCore::PageOverlay::fadeAnimationTimerFired): Ditto.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::installPageOverlay): Take reference
instead of PassRefPtr.
(WebCore::PageOverlayController::uninstallPageOverlay): Take reference
intead of pointer.
* page/PageOverlayController.h: Updated for the above.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::PageSerializer): Moved most initialization to the
class definition.
(WebCore::PageSerializer::serialize): Use reference.
(WebCore::PageSerializer::serializeFrame): Use initializer list instead of
constructor for resource.
(WebCore::PageSerializer::serializeCSSStyleSheet): Ditto.
(WebCore::PageSerializer::addImageToResources): Ditto.
* page/PageSerializer.h: Removed constructors from PageSerializer::Resource
struct since structures don't really need them. Updated for the above.
Changed SerializerMarkupAccumulator into a nested class.
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::startTimeCompareLessThan): Use const RefPtr&
instead of PassRefPtr to compare RefPtr in place.
* page/PerformanceUserTiming.cpp:
(WebCore::insertPerformanceEntry): Take Ref&& instead of PassRefPtr.
* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): Use refrence.
(WebCore::ResourceUsageOverlay::initialize): Ditto.
* page/animation/AnimationBase.h: Removed unneeded include.
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear): Use reference.
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): Ditto.
(WebCore::AnimationControllerPrivate::addEventToDispatch): Use the
append function instead of a hand-written alternative.
(WebCore::AnimationControllerPrivate::addElementChangeToDispatch):
Take a reference rather than a Ref&& since no caller is passing ownership.
* page/animation/AnimationControllerPrivate.h: Updated for the above.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Return RefPtr instead of PassRefPtr.
(WebCore::blendFilter): Ditto.
(WebCore::crossfadeBlend): Ditto.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions): Updated to use
animationForProperty, which returns a raw pointer.
(WebCore::CompositeAnimation::animationForProperty): Renamed from
getAnimationForProperty and changed to return raw pointer instead
of PassRefPtr.
* page/animation/CompositeAnimation.h: Updated for the above.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::onAnimationEnd): Use animationForProperty.
(WebCore::ImplicitAnimation::sendTransitionEvent): Pass reference.
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::sendAnimationEvent): Ditto.
* page/efl/EventHandlerEfl.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Take reference.
(WebCore::EventHandler::createDraggingDataTransfer): Return Ref.
* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Ditto.
(WebCore::EventHandler::createDraggingDataTransfer): Ditto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tabsToAllFormControls): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingDataTransfer): Ditto.
(WebCore::EventHandler::tabsToAllFormControls): Ditto.
(WebCore::EventHandler::platformPrepareForWheelEvents): Ditto.
* page/mac/ServicesOverlayController.h: Take Ref&& for ranges instead
of PassRefPtr. Use references.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::createForSelection): Ditto.
(WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto.
(WebCore::ServicesOverlayController::Highlight::Highlight): Ditto.
(WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): Ditto.
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto.
(WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto.
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::handleClick): Ditto.
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
Take a reference instead of PassRefPtr.
(WebCore::TextIndicatorWindow::setTextIndicator): Updated for the above.
* page/scrolling/AsyncScrollingCoordinator.h: Use Ref&& and RefPtr intead
of PsasRefPtr.
* page/scrolling/ScrollLatchingState.cpp:
(WebCore::ScrollLatchingState::ScrollLatchingState): Initialize data members
in class definition.
(WebCore::ScrollLatchingState::setWheelEventElement): Use raw pointer instead
of PassRefPtr.
(WebCore::ScrollLatchingState::setPreviousWheelScrolledElement): Use raw
pointer instead of RefPtr&&.
(WebCore::ScrollLatchingState::setScrollableContainer): Use raw pointer instead
of PassRefPtr.
* page/scrolling/ScrollLatchingState.h: Updated for the above.
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::cloneAndReset): Use Ref instead of PassRefPtr.
(WebCore::ScrollingStateNode::appendChild): Use Ref&& instead of PassRefPtr.
* page/scrolling/ScrollingStateNode.h: Updated for the above.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode): Use Ref instead of PassRefPtr.
(WebCore::ScrollingStateTree::attachNode): Updated for the abve.
(WebCore::ScrollingStateTree::commit): Ditto.
* page/scrolling/ScrollingStateTree.h: Ditto.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode): Use reference.
* page/scrolling/ScrollingTree.h: Return Ref instead of PassRefPtr.
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::appendChild): Take Ref&& instead of PassRefPtr.
(WebCore::ScrollingTreeNode::removeChild): Take reference instead of pointer.
* page/scrolling/ScrollingTreeNode.h: Updated for the above.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::ThreadedScrollingTree): Take reference
instead of pointer.
* page/scrolling/ThreadedScrollingTree.h: Updated for the above.
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
(WebCore::ScrollingCoordinatorIOS::ScrollingCoordinatorIOS): Pass reference.
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::create): Take a reference.
(WebCore::ScrollingTreeIOS::ScrollingTreeIOS): Ditto.
(WebCore::ScrollingTreeIOS::createScrollingTreeNode): Return Ref instead of
PassRefPtr.
* page/scrolling/ios/ScrollingTreeIOS.h: Updated for the above.
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac): Use reference.
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::create): Take a reference.
(ScrollingTreeMac::ScrollingTreeMac): Ditto.
(ScrollingTreeMac::createScrollingTreeNode): Return a Ref instead of a
PassRefPtr.
* page/scrolling/mac/ScrollingTreeMac.h: Updated for the above.
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Take reference.
(WebCore::EventHandler::createDraggingDataTransfer): Return Ref.
* platform/Cursor.h: Rearranged the header a bit. Got rid of the explicit
copy constructor, assignment operator, and destructor. Using the ones
that the compiler automatically generates will work for all platforms and
we then also get move constructor and move assignment operator.
* platform/efl/CursorEfl.cpp:
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
* platform/gtk/CursorGtk.cpp:
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
* platform/win/CursorWin.cpp:
(WebCore::SharedCursor::SharedCursor): Moved this here from the header
since it is only used within this file.
(WebCore::SharedCursor::create): Ditto.
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
Pass reference.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking): Get to FrameView
through the render tree itself, rather than through the frame.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForHeader): Use reference.
(WebCore::RenderLayerCompositor::updateLayerForFooter): Ditto.
(WebCore::RenderLayerCompositor::attachRootLayer): Ditto.
(WebCore::RenderLayerCompositor::detachRootLayer): Ditto.
* rendering/RenderMenuList.cpp:
(RenderMenuList::showPopup): Ditto.
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult): Ditto.
(WebCore::RenderSearchField::showPopup): Ditto.
(WebCore::RenderSearchField::valueChanged): Ditto.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::isKeyboardFocusable): Ditto.
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::installOverlay): Ditto.
(WebCore::MockPageOverlayClient::uninstallAllOverlays): Ditto.
2017-01-22 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Unify FontPlatformData's hashing and equality operators
https://bugs.webkit.org/show_bug.cgi?id=167061
Reviewed by Darin Adler.
On iOS, we were using CFEqual() and CFHash(), while on macOS
we were using pointer hashing and pointer equality. Instead,
we should be consistent about these operators.
Right now, FontPlatformData holds two internal CTFontRefs, and
switching to these higher-level CFEqual() and CFHash()
functions is required for eliminating one of these two
internal font objects.
No new tests because there is no behavior change.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::platformIsEqual):
(WebCore::cascadeToLastResortAttributesDictionary):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::hash):
2017-01-20 Dean Jackson <dino@apple.com>
[WebGL] Do not allow GPU muxing on some old Mac hardware
https://bugs.webkit.org/show_bug.cgi?id=167259
<rdar://problem/30060378>
Reviewed by Simon Fraser and Darin Adler.
Some old Macbook Pro models should never use the
integrated GPU for WebGL, because they are unstable
when swapping between that and the discrete GPU.
Unfortunately this hardware configuration isn't in our
testing infrastructure, so it was confirmed manually.
Meanwhile, our existing tests make sure this patch
doesn't break anything elsewhere.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::attachToAppleGraphicsControl): Helper function
to get a mach port that talks to Apple's Graphics Control
system.
(WebCore::hasMuxCapability): Decides whether a system
can do live GPU switching, based on whether or not it
has a muxable GPU, and if that GPU is not the old hardware
we know is problematic.
(WebCore::hasMuxableGPU): Helper to return the static hasMuxCapability value.
(WebCore::setPixelFormat): Only request the integrated card when the
GPU is muxable.
2017-01-22 Don Olmstead <don.olmstead@am.sony.com> and Myles C. Maxfield <mmaxfield@apple.com>
Introducing the Platform Abstraction Layer (PAL)
https://bugs.webkit.org/show_bug.cgi?id=143358
Reviewed by Alex Christensen.
In order to enforce layering and promote testability, WebCore/platform files
should be compiled in their own project. This new project can enforce layering
and can be tested with unit tests in addition to layout tests.
The name of this new project is the Platform Abstraction Layer, or "PAL."
This comprises of a new directory in WebCore which will be the destination
for files migrated from WebCore/platform. This new folder, and its associated
project, will maintain layering invariants. These invariants are enforced at
build-time by setting the #include path for PAL to not include the rest of
WebCore (which is the same layering enforcement mechanism for WTF). Files will
be migrated into this new target/directory piece-by-piece, and the migration
of a file will be performed as soon as it can be migrated without violating
layering.
Within WebCore, files should include PAL files using the convention
#include <pal/foo.h>. Symbols within PAL are placed within a new top-level
namespace, "PAL," and therefore when used should be referred to as PAL::Foo.
The first set of files to move into the new platform is the crypto/ subdirectory
because it is both simple but also includes platform-dependent files.
No new tests because there is no behavior change.
* CMakeLists.txt:
* Configurations/WebCore.xcconfig: Add PAL to the include path
* PAL/Configurations/Base.xcconfig: Added.
* PAL/Configurations/DebugRelease.xcconfig: Added.
* PAL/Configurations/PAL.xcconfig: Added. Sets up some PAL-specific
variables.
* PAL/Configurations/FeatureDefines.xcconfig: Added.
* PAL/Configurations/Version.xcconfig: Added.
* PAL/PAL.xcodeproj/project.pbxproj: Added. New project file.
* PAL/config.h: Added. Simplified from WebCore/config.h.
* PAL/pal/CMakeLists.txt: Added.
* PAL/pal/PlatformEfl.cmake: Added.
* PAL/pal/PlatformGTK.cmake: Added.
* PAL/pal/PlatformMac.cmake: Added.
* PAL/pal/PlatformWin.cmake: Added.
* PAL/pal/crypto/CryptoDigest.h: Renamed from Source/WebCore/platform/crypto/CryptoDigest.h.
* PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: Renamed from Source/WebCore/platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp.
* PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: Renamed from Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp.
* PAL/pal/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/platform/crypto/gnutls/CryptoDigestGnuTLS.cpp.
* PAL/pal/crypto/win/CryptoDigestWin.cpp: Renamed from Source/WebCore/platform/crypto/win/CryptoDigestWin.cpp.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj: Create a project link so WebCore
knows that it needs to build PAL as a dependency.
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest): Update #include and namespace.
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest): Ditto.
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest): Ditto.
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest): Ditto.
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest): Ditto.
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm): Ditto.
(WebCore::signRSASSA_PKCS1_v1_5): Ditto.
(WebCore::verifyRSASSA_PKCS1_v1_5): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::computeContentSecurityPolicySHA256Hash): Ditto.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::toCryptoDigestAlgorithm): Ditto.
(WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Ditto.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::computeCertificateHash): Ditto.
2017-01-22 Zan Dobersek <zdobersek@igalia.com>
[GStreamer] Clear out m_appsinkCaps in AppendPipeline::appsinkCapsChanged() before using outPtr()
https://bugs.webkit.org/show_bug.cgi?id=167165
Reviewed by Carlos Garcia Campos.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkCapsChanged): Replace the gst_caps_replace() call
with a simple comparison and, in case the current appsink caps differ from the caps
on the sink's pad, move the reference to the latter into the m_appsinkCaps member
variable. This removes the use of GRefPtr<>::outPtr() which asserted in debug
configurations in the case of m_appsinkCaps not being null.
2017-01-21 Chris Dumez <cdumez@apple.com>
JavaScript for-of does not work on a lot of collection types (e.g. HTMLCollection)
https://bugs.webkit.org/show_bug.cgi?id=167091
Reviewed by Darin Adler.
As per the Web IDL specification [1], https://heycam.github.io/webidl/#es-iterator
an interface should get an iterator if it has:
- an indexed property getter and an integer-typed attribute named "length".
We now comply with this part of the Web IDL specification. This adds an iterator
to the following interfaces:
- AudioTrackList, ClientRectList, CSSRuleList, CSSStyleDeclaration, CSSValueList,
MimeTypeArray, WebKitNamedFlowCollection, Plugin, PluginArray, DOMStringList,
FileList, HTMLAllCollection, HTMLCollection, HTMLFormElement, HTMLOptionsCollection,
HTMLSelectElement, MediaList, NamedNodeMap, SourceBufferList, StyleSheetList,
TextTrackCueList, TextTrackList, TouchList, VideoTrackList, VTTRegionList.
As a result, it is now possible to use `for ... of` for those types.
Tests: fast/dom/FileList-iterator.html
fast/dom/collection-iterators.html
fast/dom/document-all-undefined.html
fast/events/touch/ios/touchlist-iterator.html
* bindings/scripts/CodeGeneratorJS.pm:
(GetAttributeWithName):
(InterfaceNeedsIterator):
(GenerateImplementation):
(addIterableProperties):
2017-01-21 Chris Dumez <cdumez@apple.com>
innerText should replace existing text node
https://bugs.webkit.org/show_bug.cgi?id=167116
Reviewed by Darin Adler.
Update setInnerText() to use ContainerNode::replaceAllChildren()
instead of replaceChildrenWithText(). replaceAllChildren() is
implemented as per specification:
- https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
- https://dom.spec.whatwg.org/#concept-node-replace-all
As a result, we now correctly remove existing children before
inserting the new one.
No new tests, updated existing one.
* editing/markup.cpp:
(WebCore::replaceChildrenWithText): Deleted.
* editing/markup.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):
2017-01-21 Chris Dumez <cdumez@apple.com>
AccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification coalescing
https://bugs.webkit.org/show_bug.cgi?id=167286
<rdar://problem/30133211>
Reviewed by Ryosuke Niwa.
AccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification
coalescing. This patch fixes the issue.
No new tests, updated existing test.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textChanged):
2017-01-21 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed, rolling out r211012.
It caused a lot of crashes in the network process
Reverted changeset:
"[SOUP] Custom protocols don't work in private browsing mode"
https://bugs.webkit.org/show_bug.cgi?id=167236
http://trac.webkit.org/changeset/211012
2017-01-20 Joseph Pecoraro <pecoraro@apple.com>
Remove never changing IndexedDB RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=167278
Reviewed by Darin Adler.
This RuntimeEnabledFeature flag is always true and there are
no existing ways to change it. So lets just remove it.
* Modules/indexeddb/DOMWindowIndexedDatabase.idl:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBOpenDBRequest.idl:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBVersionChangeEvent.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIndexedDBEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::indexedDBEnabled): Deleted.
2017-01-20 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Custom protocols don't work in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=167236
Reviewed by Sergio Villar Senin.
Add static method to set the global custom protocols request type and setup method to add the feature to the session.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setCustomProtocolRequestType):
(WebCore::SoupNetworkSession::setupCustomProtocols):
* platform/network/soup/SoupNetworkSession.h:
2017-01-20 Matt Rajca <mrajca@apple.com>
Record whether a media element was prevented from playing without user interaction
https://bugs.webkit.org/show_bug.cgi?id=167214
Reviewed by Eric Carlson.
This state will be used to notify clients when a user explicitly starts playback
of a media element that was prevented from autoplaying.
Tests will be added after a WebKit callback API is added.
* WebCore.xcodeproj/project.pbxproj:
* dom/SuccessOr.h: Added.
(WebCore::SuccessOr::SuccessOr):
(WebCore::SuccessOr::operator bool):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):
* html/MediaElementSession.h:
2017-01-20 Brady Eidson <beidson@apple.com>
Require a button press on a gamepad for them to be exposed to the DOM.
<rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
Reviewed by Alex Christensen.
Test: gamepad/gamepad-visibility-1.html
* Modules/gamepad/GamepadManager.cpp:
(WebCore::GamepadManager::platformGamepadInputActivity):
* Modules/gamepad/GamepadManager.h:
* platform/gamepad/GamepadProvider.cpp:
(WebCore::GamepadProvider::dispatchPlatformGamepadInputActivity):
* platform/gamepad/GamepadProvider.h:
(WebCore::GamepadProvider::~GamepadProvider): Deleted.
(WebCore::GamepadProvider::isMockGamepadProvider): Deleted.
* platform/gamepad/GamepadProviderClient.h:
* platform/gamepad/cocoa/GameControllerGamepad.h:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
(WebCore::GameControllerGamepad::setupAsGamepad):
* platform/gamepad/cocoa/GameControllerGamepadProvider.h:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
(WebCore::GameControllerGamepadProvider::gamepadHadInput):
(WebCore::GameControllerGamepadProvider::inputNotificationTimerFired):
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::valueChanged):
* platform/gamepad/mac/HIDGamepad.h:
* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::valuesChanged):
(WebCore::HIDGamepadProvider::inputNotificationTimerFired):
* platform/gamepad/mac/HIDGamepadProvider.h:
* testing/MockGamepadProvider.cpp:
(WebCore::MockGamepadProvider::setMockGamepadButtonValue):
(WebCore::MockGamepadProvider::gamepadInputActivity):
* testing/MockGamepadProvider.h:
2017-01-20 Joseph Pecoraro <pecoraro@apple.com>
Cleanup RuntimeEnabledFeatures
https://bugs.webkit.org/show_bug.cgi?id=167228
Reviewed by Simon Fraser.
RuntimeEnabledFeatures::reset() is bad for tests. It was getting called
after the TestRunners had set up all the Settings and RuntimeEnabledFeatures
they expected, so it was clearing the "consistent state" set by TestRunners.
Cleanup within RuntimeEnabledFeatures:
- Initialize all members.
- Remove unused features.
- Remove reset() no longer used.
- Document features that do not change (potentially removable).
- Document features that are not used but have APIs (use or remove later).
- Drop webkit prefix for these internal only apis.
- Move things around a bit to make it more readable.
- Enable the Fetch API by default (WebKit levels all were enabling it).
Cleanup within Internals:
- Move all RuntimeEnabledFeature toggling to InternalSettings
- Save and restore these RuntimeEnabledFeatures in InternalSettings
* Modules/mediastream/MediaStreamEvent.idl:
* Modules/mediastream/NavigatorMediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCIceCandidate.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpTransceiver.idl:
* Modules/mediastream/RTCSessionDescription.idl:
* Modules/mediastream/RTCTrackEvent.idl:
Canonical usage is to start with a capital letter.
* dom/EventNames.in:
No port has API/SPI to disable this feature at runtime and the default is
to have the feature enabled, so this is no different from the runtime flag.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
These features were always enabled and not toggleable. So drop the runtime
feature check.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled): Deleted.
Nobody calls this method. Drop it.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::reset):
(WebCore::RuntimeEnabledFeatures::javaScriptI18NAPIEnabled): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled):
(WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled):
(WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
(WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):
(WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
(WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
(WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled):
(WebCore::RuntimeEnabledFeatures::shadowDOMEnabled):
(WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
(WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
(WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
(WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
(WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled):
(WebCore::RuntimeEnabledFeatures::customElementsEnabled):
(WebCore::RuntimeEnabledFeatures::setModernMediaControlsEnabled):
(WebCore::RuntimeEnabledFeatures::modernMediaControlsEnabled):
(WebCore::RuntimeEnabledFeatures::setIndexedDBEnabled):
(WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled):
(WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled):
(WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
(WebCore::RuntimeEnabledFeatures::setLocalStorageEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::localStorageEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setSessionStorageEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::sessionStorageEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebkitNotificationsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webkitNotificationsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setApplicationCacheEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::applicationCacheEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebkitIndexedDBEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webkitIndexedDBEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::touchEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setTouchEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setDeviceMotionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::deviceMotionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::deviceMotionEventEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::ondevicemotionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setJavaScriptI18NAPIEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webkitGetUserMediaEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webkitMediaStreamEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webkitRTCPeerConnectionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
(WebCore::InternalSettings::setResourceTimingEnabled):
(WebCore::InternalSettings::setLinkPreloadEnabled):
(WebCore::InternalSettings::setCSSGridLayoutEnabled):
(WebCore::InternalSettings::setWebGL2Enabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::setLinkPreloadSupport): Deleted.
(WebCore::Internals::setCSSGridLayoutEnabled): Deleted.
(WebCore::Internals::webGL2Enabled): Deleted.
(WebCore::Internals::setWebGL2Enabled): Deleted.
(WebCore::Internals::setResourceTimingSupport): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
Move toggling of RuntimeEnabledFeatures to InternalSettings and
properly remember to save and restore them in Internals.
2017-01-20 Alex Christensen <achristensen@webkit.org>
Add debugging code to compare URLParser with URL::parse
https://bugs.webkit.org/show_bug.cgi?id=167267
Reviewed by Brady Eidson.
* platform/URLParser.cpp:
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
2017-01-20 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210778.
This change caused multiple LayoutTests to crash.
Reverted changeset:
"[Cocoa] Unify FontPlatformData's hashing and equality
operators"
https://bugs.webkit.org/show_bug.cgi?id=167061
http://trac.webkit.org/changeset/210778
2017-01-20 Joseph Pecoraro <pecoraro@apple.com>
Remove outdated ENABLE(CSP_NEXT) build flag
https://bugs.webkit.org/show_bug.cgi?id=167252
Reviewed by Brent Fulgham.
* Configurations/FeatureDefines.xcconfig:
* dom/Document.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::reset):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled): Deleted.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled): Deleted.
* page/csp/ContentSecurityPolicy.h:
2017-01-20 Zalan Bujtas <zalan@apple.com>
Simple line layout: Add support for non-breaking space character.
https://bugs.webkit.org/show_bug.cgi?id=167250
<rdar://problem/30119638>
Reviewed by Antti Koivisto.
Do not bail out on noBreakSpace character.
The line breaking logic already takes noBreakSpace characters into account.
(except the peculiar "-webkit-nbsp-mode: space" mode)
Covered by existing test cases.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):
2017-01-20 Antoine Quint <graouts@apple.com>
Web Animations should be off by default and enabled as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=167115
<rdar://problem/30048963>
Reviewed by Joseph Pecoraro.
Conditionalize the existing parts of the Web Animations API so that they may be
toggled at runtime.
* animation/Animatable.idl:
* animation/AnimationEffect.idl:
* animation/AnimationTimeline.idl:
* animation/DocumentAnimation.idl:
* animation/DocumentTimeline.idl:
* animation/KeyframeEffect.idl:
* animation/WebAnimation.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::reset):
* page/RuntimeEnabledFeatures.h:
2017-01-20 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn modern media controls on by default
https://bugs.webkit.org/show_bug.cgi?id=165668
Reviewed by Dean Jackson.
Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
media/modern-media-controls/pip-support/ipad/pip-support-tap.html
media/modern-media-controls/placard-support/ipad/placard-support-pip.html
media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
Fix an error which may be triggered prior to Sierra where we would assume the presentation
mode API was avaiable when it might not be, which caused a few tests to fail.
We also ensure that we always inject the UA styles for legacy media controls as otherwise
toggling from modern media controls to legacy media controls would not inject those styles.
To facilitate this we add a dedicated method for modern media controls styles in RenderTheme
that is only used in the case of modern media controls when the shadow root asks for the styles
to inject in the shadow root.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::shadowRootCSSText):
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::modernMediaControlsStyleSheet):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsStyleSheet):
(WebCore::RenderThemeIOS::modernMediaControlsStyleSheet):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::modernMediaControlsStyleSheet):
2017-01-19 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r206156): Animated images are repeated one extra iteration than the value which is saved in the image file
https://bugs.webkit.org/show_bug.cgi?id=167174
Reviewed by Simon Fraser.
Before r206156, BitmapImage::repetitionCount() used to return zero for
the case loopCount = 1, -1 for loopCount = Infinity and loopCount for
all other cases. Having repetitionCount() return zero for loopCount = 1
makes the condition if (++m_repetitionsComplete > repetitionCount())
break the animation loop after one iteration. But it was wrong for all
loopCount > 1. It was causing an extra iteration to be played for the
animated image. After r206156, BitmapImage::repetitionCount() returns
loopCount for all cases loopCount != Infinity. Keeping the same condition
causes the extra iteration to be played even for loopCount = 1.
Test: fast/images/animated-image-loop-count.html
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::internalStartAnimation):
2017-01-19 Chris Dumez <cdumez@apple.com>
iterable<> should be enabled on WK1
https://bugs.webkit.org/show_bug.cgi?id=167221
<rdar://problem/30108531>
Reviewed by Youenn Fablet.
* Modules/fetch/FetchHeaders.idl:
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* bindings/scripts/test/TestNode.idl:
* bindings/scripts/test/TestObj.idl:
* css/FontFaceSet.idl:
* dom/NodeList.idl:
2017-01-19 Zalan Bujtas <zalan@apple.com>
Simple line layout: Extend coverage for justified content.
https://bugs.webkit.org/show_bug.cgi?id=167219
<rdar://problem/30108391>
Reviewed by Antti Koivisto.
Add support for general punctuation characters (0x2010, 0x2027) and latin characters including Extended-B.
Test: fast/text/simple-line-layout-with-justified-punctuation.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText):
(WebCore::SimpleLineLayout::canUseForFontAndText):
2017-01-19 Alex Christensen <achristensen@webkit.org>
Construct URLSearchParams from array or object
https://bugs.webkit.org/show_bug.cgi?id=166973
Reviewed by Sam Weinig.
Covered by newly passing web platform tests.
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::URLSearchParams):
(WebCore::URLSearchParams::create):
(WebCore::URLSearchParams::get):
(WebCore::URLSearchParams::has):
(WebCore::URLSearchParams::sort):
(WebCore::URLSearchParams::set):
(WebCore::URLSearchParams::getAll):
(WebCore::URLSearchParams::remove):
(WebCore::URLSearchParams::Iterator::next):
* html/URLSearchParams.h:
(WebCore::URLSearchParams::create):
(WebCore::URLSearchParams::pairs):
(WebCore::URLSearchParams::operator const Vector<std::pair<String, String>>&): Deleted.
* html/URLSearchParams.idl:
* platform/URLParser.cpp:
(WebCore::URLParser::serialize):
* platform/URLParser.h:
2017-01-19 Jer Noble <jer.noble@apple.com>
CRASH at WebCore::TrackListBase::remove
https://bugs.webkit.org/show_bug.cgi?id=167217
Reviewed by Brent Fulgham.
Test: media/media-source/media-source-error-crash.html
In very specific conditions, a HTMLMediaElement backed by a MediaSource can try to remove
the same track from its track list twice. If there are two SourceBuffers attached to a
HTMLMediaElement, and one has not yet been initialized, when the second fails to parse an
appended buffer after receiving an initialization segment, the HTMLMediaElement will remove
all its tracks in mediaLoadingFailed(), then MediaSource object itself will attempt remove
the same track in removeSourceBuffer().
Solving this the safest way possible: bail early from TrackListBase if asked to remove a
track which the list does not contain.
* html/track/TrackListBase.cpp:
(TrackListBase::remove):
2017-01-19 Andy Estes <aestes@apple.com>
[iOS] Move the PDF password view into its own class for reuse
https://bugs.webkit.org/show_bug.cgi?id=167192
Reviewed by Tim Horton.
* English.lproj/Localizable.strings: Updated the failure alert strings to not be specific to PDFs.
2017-01-19 Chris Dumez <cdumez@apple.com>
Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
https://bugs.webkit.org/show_bug.cgi?id=167215
<rdar://problem/29885052>
Reviewed by Andreas Kling.
Make sure HTML validation bubble gets dismissed when its associated
element's frame gets detached and that we do not crash.
Tests: fast/forms/validation-message-detached-iframe.html
fast/forms/validation-message-detached-iframe2.html
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* page/ValidationMessageClient.h:
2017-01-19 Chris Dumez <cdumez@apple.com>
Implement per activity state CPU usage reporting using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167163
<rdar://problem/30058349>
Reviewed by Andreas Kling.
Implement per activity state CPU usage reporting using diagnostic logging.
* WebCore.xcodeproj/project.pbxproj:
* page/ActivityState.h:
* page/ChromeClient.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::nonVisibleStateKey):
(WebCore::DiagnosticLoggingKeys::visibleNonActiveStateKey):
(WebCore::DiagnosticLoggingKeys::visibleAndActiveStateKey):
(WebCore::DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLogginKey):
(WebCore::DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLogginKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::isUtilityPageChromeClient):
(WebCore::Page::Page):
(WebCore::Page::~Page):
(WebCore::Page::didStartProvisionalLoad):
(WebCore::Page::didFinishLoad):
(WebCore::Page::isUtilityPage):
(WebCore::Page::setActivityState):
(WebCore::Page::setIsVisibleInternal):
* page/Page.h:
(WebCore::Page::activityState):
(WebCore::Page::isUtilityPage):
* page/PerformanceMonitor.cpp: Added.
(WebCore::activityStateForCPUSampling):
(WebCore::PerformanceMonitor::PerformanceMonitor):
(WebCore::PerformanceMonitor::didStartProvisionalLoad):
(WebCore::PerformanceMonitor::didFinishLoad):
(WebCore::PerformanceMonitor::activityStateChanged):
(WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
(WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage):
(WebCore::PerformanceMonitor::measurePerActivityStateCPUUsage):
(WebCore::stringForCPUSamplingActivityState):
(WebCore::PerformanceMonitor::measureCPUUsageInActivityState):
* page/PerformanceMonitor.h: Copied from Source/WebCore/page/ActivityState.h.
* page/Settings.cpp:
* page/Settings.h:
(WebCore::Settings::isPostLoadCPUUsageMeasurementEnabled):
(WebCore::Settings::isPostBackgroundingCPUUsageMeasurementEnabled):
(WebCore::Settings::isPerActivityStateCPUUsageMeasurementEnabled):
2017-01-19 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Variation fonts are erroneously disabled on iOS
https://bugs.webkit.org/show_bug.cgi?id=167172
Reviewed by Simon Fraser.
OpenSource builders don't seem to understand sdk=embedded*.
* Configurations/FeatureDefines.xcconfig:
2017-01-19 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r210918.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestObj.cpp:
2017-01-19 Andreas Kling <akling@apple.com>
ScriptExecutionContext::topOrigin() should return a reference.
<https://webkit.org/b/167190>
Reviewed by Sam Weinig.
There is always a topOrigin() SecurityOrigin, so make it return a reference
and remove some unnecessary null-checks exposed by this change.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::canCallApplePaySessionAPIs):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedConfiguration):
(WebCore::CDM::getConsentStatus):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::topLevelDocumentOrigin):
(WebCore::canCallGetUserMedia):
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setDomainForCachePartition):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::canAccessDatabase):
(WebCore::SecurityOrigin::canAccessSessionStorage):
(WebCore::SecurityOrigin::canAccessPluginStorage):
(WebCore::SecurityOrigin::canAccessApplicationCache):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:
2017-01-19 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Provide API to set proxy settings
https://bugs.webkit.org/show_bug.cgi?id=128674
Reviewed by Michael Catanzaro.
Add SoupNetworkProxySettings struct to store proxy settings.
* platform/network/soup/SoupNetworkProxySettings.h: Added.
(WebCore::SoupNetworkProxySettings::SoupNetworkProxySettings):
(WebCore::SoupNetworkProxySettings::operator=):
(WebCore::SoupNetworkProxySettings::isEmpty):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Setup the proxy if user provided proxy settings.
(WebCore::SoupNetworkSession::setupProxy): Set the proxy-resolver property of the SoupSession according to the
global SoupNetworkProxySettings.
(WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Update the global SoupNetworkProxySettings with
values from environment.
(WebCore::SoupNetworkSession::setProxySettings): Set the global SoupNetworkProxySettings.
* platform/network/soup/SoupNetworkSession.h:
2017-01-18 Sam Weinig <sam@webkit.org>
[WebIDL] Records should preserve javascript object order
https://bugs.webkit.org/show_bug.cgi?id=167189
Reviewed by Alex Christensen.
Instead of modeling IDL records as HashMaps, use a Vector
of KeyValuePairs, to all preserving the iteration order.
* Modules/webdatabase/SQLResultSetRowList.cpp:
(WebCore::SQLResultSetRowList::item):
* Modules/webdatabase/SQLResultSetRowList.h:
Return a Vector rather than a HashMap.
* bindings/IDLTypes.h:
Change underlying type to be a Vector<KeyValuePair<K, V>>.
* bindings/js/JSDOMConvert.h:
Update conversion for new implementation type. For conversion
to JSValue, allow any type that can has an iterator of keyValuePairs.
* testing/TypeConversions.h:
(WebCore::TypeConversions::testLongRecord):
(WebCore::TypeConversions::setTestLongRecord):
(WebCore::TypeConversions::testNodeRecord):
(WebCore::TypeConversions::setTestNodeRecord):
(WebCore::TypeConversions::testSequenceRecord):
(WebCore::TypeConversions::setTestSequenceRecord):
* testing/TypeConversions.idl:
Update test IDL to use functions, since the spec mandates that
records can't be used with attributes.
2017-01-18 Alex Christensen <achristensen@webkit.org>
Implement URLSearchParams's sort()
https://bugs.webkit.org/show_bug.cgi?id=167154
Reviewed by Sam Weinig.
Test: imported/w3c/web-platform-tests/url/urlsearchparams-sort.html
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::sort):
* html/URLSearchParams.h:
* html/URLSearchParams.idl:
2017-01-18 Yoav Weiss <yoav@yoav.ws>
Add Link header support for preload.
https://bugs.webkit.org/show_bug.cgi?id=165521
Reviewed by Alex Christensen.
This patch adds Link header support for preload, by adding a Link
header parser, and calling it from FrameLoader::receivedFirstData.
Test: http/tests/preload/download_resources_from_header.php
* CMakeLists.txt: Add LinkHeader files.
* WebCore.xcodeproj/project.pbxproj: Add LinkHeader files.
* loader/FrameLoader.cpp:
(WebCore::receivedFirstData): Trigger Link based preloading by calling loadLinksFromHeader.
* loader/LinkHeader.cpp: Added.
(WebCore::isWhitespace):
(WebCore::isValidURLChar):
(WebCore::isValidParameterNameChar):
(WebCore::isValidParameterValueEnd):
(WebCore::isValidParameterValueChar):
(WebCore::isExtensionParameter):
(WebCore::parseURL):
(WebCore::invalidParameterDelimiter):
(WebCore::validFieldEnd):
(WebCore::parseParameterDelimiter):
(WebCore::paramterNameFromString):
(WebCore::parseParameterName):
(WebCore::skipQuotesIfNeeded):
(WebCore::parseParameterValue):
(WebCore::LinkHeader::setValue):
(WebCore::findNextHeader):
(WebCore::LinkHeader::LinkHeader):
(WebCore::LinkHeaderSet::LinkHeaderSet):
(WebCore::LinkHeaderSet::init):
* loader/LinkHeader.h: Added.
(WebCore::LinkHeader::url):
(WebCore::LinkHeader::rel):
(WebCore::LinkHeader::as):
(WebCore::LinkHeader::mimeType):
(WebCore::LinkHeader::media):
(WebCore::LinkHeader::crossOrigin):
(WebCore::LinkHeader::valid):
(WebCore::LinkHeaderSet::begin):
(WebCore::LinkHeaderSet::end):
(WebCore::LinkHeaderSet::operator[]):
(WebCore::LinkHeaderSet::size):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Loads link preload directives that arrive from Link headers.
(WebCore::LinkLoader::preloadIfNeeded): Add return value.
* loader/LinkLoader.h:
* platform/network/HTTPHeaderNames.in: Add "Link" as a header name.
2017-01-18 Filip Pizlo <fpizlo@apple.com>
JSSegmentedVariableObject and its subclasses should have a sane destruction story
https://bugs.webkit.org/show_bug.cgi?id=167193
Reviewed by Saam Barati.
No new tests because no new behavior.
JSSegmentedVariableObjects now get to have a sane destruction story. This means switching
subspace types for the DOM's global object subspace.
* bindings/js/WebCoreJSClientData.cpp:
(WebCore::JSVMClientData::JSVMClientData):
* bindings/js/WebCoreJSClientData.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
2017-01-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210848.
This change introduced media-related LayoutTest failures and
crashes on macOS.
Reverted changeset:
"[Modern Media Controls] Turn modern media controls on by
default"
https://bugs.webkit.org/show_bug.cgi?id=165668
http://trac.webkit.org/changeset/210848
2017-01-18 Alex Christensen <achristensen@webkit.org>
Fix CFURLConnection build on Mac
https://bugs.webkit.org/show_bug.cgi?id=167168
Reviewed by Andy Estes.
This is old code, and it hurts to do this, but I need this working to compare with Windows
to get the ResourceHandleCFURLConnectionDelegateWithOperationQueue working so we can make
loading asynchronous in WebCore.
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* platform/network/cf/AuthenticationCF.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::clearOrUpdateNSURLRequest):
Moved from iOS-specific file. It's needed on Mac using CFURLConnection, too.
* platform/network/ios/ResourceRequestIOS.mm:
(WebCore::ResourceRequest::clearOrUpdateNSURLRequest): Deleted.
2017-01-18 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r210531): Broke local resource loads from custom local protocols
https://bugs.webkit.org/show_bug.cgi?id=167058
Reviewed by Brent Fulgham.
Allow local protocols to access resources on different volumes unless the protocol is
"file".
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay):
2017-01-18 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
* platform/spi/cocoa/IOSurfaceSPI.h:
2017-01-18 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Variation fonts without variations specified are not rendered as if the default variations were specified
https://bugs.webkit.org/show_bug.cgi?id=166672
<rdar://problem/29779119>
<rdar://problem/29848883>
Reviewed by Simon Fraser.
CoreText has a bug (<rdar://problem/29859207>) where variation fonts without
a specified variation value are rendered as if the minimum value is specified,
rather than the default value. The solution is to apply default values where
they are omitted.
Test: fast/text/variations/advances.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::defaultVariationValues):
(WebCore::fontIsSystemFont):
(WebCore::preparePlatformFont):
2017-01-18 Myles C. Maxfield <mmaxfield@apple.com>
background-repeat-x doesn't work
https://bugs.webkit.org/show_bug.cgi?id=166997
Reviewed by Simon Fraser.
During the creation of the new CSS parser, we accidentally forgot
to hook up background-repeat-x and background-repeat-y.
Tests: fast/backgrounds/background-repeat-x-y-parse.html
fast/backgrounds/background-repeat-x-y.html
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
2017-01-18 Andy Estes <aestes@apple.com>
[QuickLook] Support password-protected documents
https://bugs.webkit.org/show_bug.cgi?id=167153
<rdar://problem/28544527>
Reviewed by Alex Christensen.
Added support for previewing password-protected documents. If a document is
password-protected, QLPreviewConverter will call -connection:didFailWithError: with an error
code of kQLReturnPasswordProtected. When this happens, QuickLookHandle will ask the client
for a password, create a new QLPreviewConverter with the password specified in an options
dictionary, and replay the buffered input data into the converter. QLPreviewConverter will
then send the converted document data to its delegate as usual.
Password entry UI will be added later; this patch implements the necessary QuickLookHandle
logic and adds support for testing.
Test: quicklook/password-protected.html
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/ios/QuickLook.h: Declared setClientForTesting().
* loader/ios/QuickLook.mm:
(testingClient): Created a static RefPtr to hold the testing client.
(testingOrEmptyClient): Returns the testing client if it's set, otherwise returns the empty client.
(-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]):
Initialized _client to testingOrEmptyClient(), stored the ResourceResponse's nsURLResponse()
in _originalResponse, and initialized _bufferedDataArray.
(-[WebPreviewConverter setClient:]): Ignore the new client if there is already a testing client.
(-[WebPreviewConverter appendDataArray:]): Stored the data array in _bufferedDataArray.
(-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Cleared _bufferedDataArray.
(-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Changed the
UNUSED_PARAM() to an ASSERT_UNUSED().
(-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
(-[WebPreviewConverter connection:didFailWithError:]): If the error code is
kQLReturnPasswordProtected and the domain is QuickLookErrorDomain, request a password from
the client then create a new QLPreviewConverter with the password specified in the options dictionary.
(WebCore::QuickLookHandle::setClientForTesting): Set testingClient() to the specified client.
* platform/ios/QuickLookSoftLink.h: Soft-linked kQLPreviewOptionPasswordKey.
* platform/ios/QuickLookSoftLink.mm: Ditto.
* platform/network/ios/QuickLookHandleClient.h:
(WebCore::QuickLookHandleClient::supportsPasswordEntry): Added. Tells QuickLookHandle
whether the client supports password entry.
(WebCore::QuickLookHandleClient::didRequestPassword): Added. Asks the client to specify a
password in the completionHandler lambda.
* platform/spi/ios/QuickLookSPI.h: Declared kQLReturnPasswordProtected for the public SDK
and asserted that its value is 4.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset the MockQuickLookHandleClient password
to the empty string and uninstalled the testing client.
(WebCore::Internals::setQuickLookPassword): Installed the testing client and set a password
on the MockQuickLookHandleClient.
* testing/Internals.h:
* testing/Internals.idl: Defined Internals.setQuickLookPassword().
* testing/MockQuickLookHandleClient.cpp: Added.
(WebCore::MockQuickLookHandleClient::singleton): Returned a shared MockQuickLookHandleClient.
(WebCore::MockQuickLookHandleClient::didRequestPassword): Dispatched a lambda on the
main-or-Web-thread run loop to call the completionHandler with the specified password.
This simulates the delay that would happen when prompting the user for a password.
* testing/MockQuickLookHandleClient.h: Added.
2017-01-18 Youenn Fablet <youenn@apple.com>
[Streams API] ReadableStream generic reader constructor does not need to call ReadableStream getReader
https://bugs.webkit.org/show_bug.cgi?id=167137
Reviewed by Xabier Rodriguez-Calvar.
Test: streams/shadowing-getReader.html
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamDefaultReader): Using private constructor instead of getReader.
2017-01-18 Youenn Fablet <youenn@apple.com>
Reject fetch promise in case of ReadableStream upload
https://bugs.webkit.org/show_bug.cgi?id=167145
Reviewed by Alex Christensen.
Covered by rebased tests.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract): Storing the fact that body data is represented as a ReadableStream.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isReadableStream):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch): Rejecting if request body data is a ReadableStream.
2017-01-18 Andreas Kling <akling@apple.com>
Document::securityOrigin() should return a reference.
<https://webkit.org/b/167124>
Reviewed by Sam Weinig.
The security origin is always initialized by the Document constructor
through Document::initSecurityContext(), so it's effectively always present.
Make it return a reference and remove unnecessary null checks exposed by this.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::canCallApplePaySessionAPIs):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedConfiguration):
(WebCore::CDM::getConsentStatus):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::canCallGetUserMedia):
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::allowDatabaseAccess):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientOrigin):
* bindings/js/JSDOMBinding.cpp:
(WebCore::canAccessDocument):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::collectIsolatedContexts):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::canAccessRules):
* css/RuleSet.cpp:
(WebCore::RuleSet::addRulesFromSheet):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::setCSSStyleSheet):
* dom/Document.cpp:
(WebCore::canAccessAncestor):
(WebCore::Document::findUnsafeParentScrollPropagationBoundary):
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
(WebCore::Document::origin):
(WebCore::Document::domain):
(WebCore::Document::setDomain):
(WebCore::Document::storageBlockingStateDidChange):
(WebCore::Document::initSecurityContext):
(WebCore::Document::initDNSPrefetch):
(WebCore::Document::topOrigin):
* dom/Document.h:
(WebCore::Document::securityOrigin):
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSecureTransitionTo):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::canEmbedJava):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::securityOrigin):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isSafeToLoadURL):
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::storageId):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
(WebCore::InspectorIndexedDBAgent::requestDatabase):
(WebCore::InspectorIndexedDBAgent::requestData):
(WebCore::InspectorIndexedDBAgent::clearObjectStore):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
(WebCore::InspectorPageAgent::buildObjectForFrame):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::DocumentThreadableLoader::securityOrigin):
* loader/DocumentWriter.cpp:
(WebCore::canReferToParentFrameEncoding):
* loader/EmptyClients.cpp:
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoader.cpp:
(WebCore::shouldClearWindowName):
(WebCore::FrameLoader::outgoingOrigin):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
* loader/FrameLoaderClient.h:
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::isMixedContent):
(WebCore::MixedContentChecker::canDisplayInsecureContent):
(WebCore::MixedContentChecker::canRunInsecureContent):
(WebCore::MixedContentChecker::checkFormForMixedContent):
* loader/MixedContentChecker.h:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleRedirect):
(WebCore::NavigationScheduler::scheduleLocationChange):
(WebCore::NavigationScheduler::scheduleRefresh):
* loader/NavigationScheduler.h:
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):
* loader/ResourceLoadInfo.cpp:
(WebCore::ResourceLoadInfo::isThirdParty):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::pluginIsLoadable):
(WebCore::SubframeLoader::createJavaAppletWidget):
(WebCore::SubframeLoader::loadSubframe):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
(WebCore::CachedResourceRequest::updateForAccessControl):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setOrigin):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
(WebCore::DOMWindow::postMessage):
(WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
(WebCore::DOMWindow::isSameSecurityOriginAsMainFrame):
(WebCore::DOMWindow::crossDomainAccessErrorMessage):
(WebCore::DOMWindow::isInsecureScriptAccess):
* page/DragController.cpp:
(WebCore::DragController::dragExited):
(WebCore::DragController::tryDocumentDrag):
(WebCore::DragController::tryDHTMLDrag):
(WebCore::DragController::startDrag):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/Location.cpp:
(WebCore::Location::ancestorOrigins):
(WebCore::Location::reload):
* page/Navigator.cpp:
(WebCore::Navigator::javaEnabled):
* page/Page.cpp:
(WebCore::Page::showAllPlugins):
* page/PerformanceResourceTiming.cpp:
(WebCore::passesTimingAllowCheck):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccess):
(WebCore::SecurityOrigin::canRequest):
(WebCore::SecurityOrigin::canReceiveDragData):
(WebCore::SecurityOrigin::canAccessStorage):
(WebCore::SecurityOrigin::isSameOriginAs):
(WebCore::SecurityOrigin::equal):
(WebCore::SecurityOrigin::isSameSchemeHostPort):
* page/SecurityOrigin.h:
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::equal):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::stripURLForUseInReport):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::checkShapeImageOrigin):
* replay/ReplayInputCreationMethods.cpp:
(WebCore::InitialNavigation::createFromPage):
* replay/ReplayInputDispatchMethods.cpp:
(WebCore::InitialNavigation::dispatch):
* storage/Storage.cpp:
(WebCore::Storage::isDisabledByPrivateBrowsing):
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::setApplicationCacheOriginQuota):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::shouldAllowExternalLoad):
2017-01-18 Ryan Haddad <ryanhaddad@apple.com>
Remove WEBCORE_EXPORT from newly inlined functions after r210845.
Unreviewed build fix.
* loader/DocumentLoader.h:
2017-01-18 Per Arne Vollan <pvollan@apple.com>
Crash when changing video subtitles.
https://bugs.webkit.org/show_bug.cgi?id=167159
Reviewed by Xabier Rodriguez-Calvar.
Add null pointer check.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::removeDisplayTree):
2017-01-18 Youenn Fablet <youenn@apple.com>
[Fetch API] Update content-type in case of form data
https://bugs.webkit.org/show_bug.cgi?id=167143
Reviewed by Alex Christensen.
Covered by rebased test.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract): Adding a space to the content-type in case of form data.
2017-01-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GStreamer] media source tests crashing
https://bugs.webkit.org/show_bug.cgi?id=167158
Reviewed by Carlos Garcia Campos.
This fixes several media source tests which are asserting on debug builds,
such as:
- fast/history/page-cache-removed-source-buffer.html
- imported/w3c/web-platform-tests/media-source/
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline): do not adopt the GStPipeline
upon creation. A regular assignment will do the right thing, sinking the
floating ref.
2017-01-18 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn modern media controls on by default
https://bugs.webkit.org/show_bug.cgi?id=165668
Reviewed by Dean Jackson.
Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
media/modern-media-controls/pip-support/ipad/pip-support-tap.html
media/modern-media-controls/placard-support/ipad/placard-support-pip.html
media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
Fix an error which may be triggered prior to Sierra where we would assume the presentation
mode API was avaiable when it might not be, which caused a few tests to fail.
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
2017-01-18 Miguel Gomez <magomez@igalia.com>
[GTK] [TextureMapper] [GLES2] Draw repeated patterns for NPOT textures manually
https://bugs.webkit.org/show_bug.cgi?id=167118
Reviewed by Žan Doberšek.
When using GLES2 without the GL_OES_texture_npot extension, some implementations fail to properly
draw repeated patters from a texture (using GL_REPEAT). For those cases, perform the repetition
manually using the shader.
Covered by existent tests.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::driverSupportsNPOTTextures):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
* platform/graphics/texmap/TextureMapperShaderProgram.h:
2017-01-15 Darin Adler <darin@apple.com>
Remove PassRefPtr from "loader" directory of WebCore
https://bugs.webkit.org/show_bug.cgi?id=167055
Reviewed by Alex Christensen.
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Pass a reference.
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply): Ditto.
(WebCore::EditCommandComposition::reapply): Ditto.
(WebCore::CompositeEditCommand::ensureComposition): Return a reference.
(WebCore::CompositeEditCommand::applyCommandToComposite): Use a reference.
* editing/CompositeEditCommand.h: Updated for above changes.
* editing/Editor.cpp:
(WebCore::Editor::unappliedEditing): Take a reference instead of a PassRefPtr.
(WebCore::Editor::reappliedEditing): Ditto.
* editing/Editor.h: Updated for above changes. Also changed the
FragmentAndResources resources vector to hold Ref instead of RefPtr.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::createFragmentAndAddResources): Updated for change to
FragmentAndResources.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::readWebArchive): Pass a reference.
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readWebArchive): Pass a reference.
* history/PageCache.cpp:
(WebCore::canCacheFrame): Use a reference.
* html/FileInputType.cpp:
(WebCore::FileInputType::handleDOMActivateEvent): Pass references.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::formMethod): Use auto.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission): Updated to use a return
values for textFieldValues intsead of an out argument with getTextFieldValues.
(WebCore::HTMLFormElement::textFieldValues): Renamed from getTextFieldValues
and changed to use a return value instead of an out argument.
(WebCore::HTMLFormElement::submit): Pass a reference.
(WebCore::HTMLFormElement::requestAutocomplete): Pass a Ref&&.
* html/HTMLFormElement.h: Updated for above changes.
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser): Use a reference.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process): Pass a reference.
(WebCore::HTMLLinkElement::setCSSStyleSheet): Use auto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource): Use a reference.
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus): Use a reference,
also update for struct-style member names withou m_ prefix.
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests): Ditto.
(WebCore::InspectorApplicationCacheAgent::getManifestForFrame): Ditto.
(WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame): Ditto.
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache): Ditto.
(WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources): Ditto.
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): Ditto.
* inspector/InspectorApplicationCacheAgent.h: Updated for above changes.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::updateApplicationCacheStatusImpl): Take a reference.
* inspector/InspectorInstrumentation.h: Updated for the above.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader): Move much initialization to class definition.
(WebCore::DocumentLoader::originalRequest): Moved to header to make it inline.
(WebCore::DocumentLoader::originalRequestCopy): Ditto.
(WebCore::DocumentLoader::request): Ditto.
(WebCore::DocumentLoader::url): Ditto.
(WebCore::DocumentLoader::stopLoading): Pass a reference.
(WebCore::DocumentLoader::willSendRequest): Updated to take a raw pointer instead of a
PassRefPtr.
(WebCore::DocumentLoader::commitData): Call shouldUseMainResourceEncoding instead of
special casing WebArchive.
(WebCore::DocumentLoader::maybeCreateArchive): Pass references.
(WebCore::DocumentLoader::setArchive): Take Ref&& instead of PassRefPtr.
(WebCore::DocumentLoader::addAllArchiveResources): Take a reference instead
of a pointer.
(WebCore::DocumentLoader::popArchiveForSubframe): Return RefPtr instead of
PassRefPtr.
(WebCore::DocumentLoader::subresource): Ditto.
(WebCore::DocumentLoader::subresources): Return a Vector<Ref> instead of a
Vector<RefPtr>.
(WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): Use move
instead of swap.
(WebCore::DocumentLoader::scheduleArchiveLoad): Use shouldLoadFromArchiveOnly
instead of a special case for each type of archive.
(WebCore::DocumentLoader::originalURL): Moved to header to make it inline.
(WebCore::DocumentLoader::responseURL): Ditto.
(WebCore::DocumentLoader::documentURL): Call shouldUseMainResourceURL instead of
special casing WebArchive.
(WebCore::DocumentLoader::responseMIMEType): Moved to header to make it inline.
(WebCore::DocumentLoader::currentContentType): Ditto.
(WebCore::DocumentLoader::contentFilter): Ditto.
(WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Pass a reference.
(WebCore::DocumentLoader::getIconDataForIconURL): Ditto.
(WebCore::DocumentLoader::dispatchOnloadEvents): Use a reference.
(WebCore::DocumentLoader::unreachableURL): Moved to header to make it inline.
* loader/DocumentLoader.h: Updated for the above.
* loader/EmptyClients.cpp: Updated for changes to client interfaces.
* loader/EmptyClients.h: Ditto.
* loader/FormState.cpp:
(WebCore::FormState::FormState): Take references instead of PassRefPtr, also
take Vector&& instead of Vector& when we want to take ownership and use move
instead of swap to do that.
(WebCore::FormState::create): Ditto.
* loader/FormState.h: Updated for the above. Also changed return values to be
references instead of pointers and members to be Ref instead of RefPtr.
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::Attributes::parseMethodType): Updated for change
to the Method enumeration.
(WebCore::FormSubmission::Attributes::copyFrom): Deleted.
(WebCore::FormSubmission::FormSubmission): Use Ref&& instead of PassRefPtr.
(WebCore::FormSubmission::create): Use reference instead of pointer and
raw pointer instead of PassRefPtr. Also copy attributes using copy constructor
instead of an explicit copyFrom function.
(WebCore::FormSubmission::requestURL): Updated for change to the Method
enumeration.
(WebCore::FormSubmission::populateFrameLoadRequest): Ditto.
* loader/FormSubmission.h: Updated for the above changes. Made the Attributes
class copyable, since we copy it. Changed some functions to return references
instead of pointers and use Ref instead of RefPtr for data members.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm): Updated for changes to FormSubmission
and FormState.
(WebCore::FrameLoader::receivedFirstData): Ditto.
(WebCore::FrameLoader::loadFrameRequest): Ditto.
(WebCore::FrameLoader::loadResourceSynchronously): Ditto.
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
* loader/FrameLoaderClient.h: Use references, pointers, RefPtr, and Ref
instead of PassRefPtr. Removed unused empty dispatchDidFailToStartPlugin.
* loader/HistoryController.cpp:
(WebCore::HistoryController::pushState): Take RefPtr&& instead of PassRefPtr.
(WebCore::HistoryController::replaceState): Ditto.
* loader/HistoryController.h: Updated for the above.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement): Pass a reference.
* loader/NavigationScheduler.cpp: Use refernces and Ref&& instead of
pointers and PassRefPtr.
(WebCore::ScheduledNavigation::ScheduledNavigation): Added an overload
that sests m_shouldOpenExternalURLsPolicy.
* loader/NavigationScheduler.h: Updated for the above.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start): Use and pass references.
(WebCore::ResourceLoader::willSendRequest): Ditto.
(WebCore::ResourceLoader::didReceiveResponse): Ditto.
(WebCore::ResourceLoader::didFail): Ditto.
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::createJavaAppletWidget): Return RefPtr instead
of PassRefPtr. Pass references instead of pointers.
(WebCore::SubframeLoader::loadOrRedirectSubframe): Ditto.
(WebCore::SubframeLoader::loadSubframe): Ditto.
(WebCore::SubframeLoader::document): Deleted. This was never really the
correct idiom for getting the appropriate document; hiding the dependency
on m_frame wasn't paing off.
(WebCore::SubframeLoader::loadPlugin): Pass reference instead of pointer.
(WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank): Eliminated
unneeded null checking and complexity due to going through the document
instead of the frame for this check.
* loader/SubframeLoader.h: Updated for the above.
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::ApplicationCache): Moved data member
initialization to the class definition.
(WebCore::ApplicationCache::~ApplicationCache): Pass a reference instead
of a pointer.
(WebCore::ApplicationCache::isComplete): Ditto.
(WebCore::ApplicationCache::setManifestResource): Take Ref&& instead of
PassRefPtr.
(WebCore::ApplicationCache::addResource): Ditto.
(WebCore::ApplicationCache::removeResource): Deleted. Was unused.
* loader/appcache/ApplicationCache.h: Updated for above changes.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::ApplicationCacheGroup): Moved most
member initialization to the class definition.
(WebCore::ApplicationCacheGroup::~ApplicationCacheGroup): Pass a reference.
(WebCore::ApplicationCacheGroup::cacheForMainRequest): Removed
unnecessary preflight for removeFragmentIdentifier, which efficiently
does nothing if there is no identifier. Use early return.
(WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest): More of
the same.
(WebCore::ApplicationCacheGroup::selectCache): Ditto, also take a reference,
and use event names instead of a special enumeration to poast events.
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL): Ditto.
(WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Ditto.
(WebCore::ApplicationCacheGroup::failedLoadingMainResource): Ditto.
(WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Ditto.
(WebCore::ApplicationCacheGroup::cacheDestroyed): Ditto.
(WebCore::ApplicationCacheGroup::stopLoadingInFrame): Ditto.
(WebCore::ApplicationCacheGroup::setNewestCache): Use Ref&& instead of
PassRefPtr.
(WebCore::ApplicationCacheGroup::makeObsolete): More of the same.
(WebCore::ApplicationCacheGroup::update): Ditto.
(WebCore::ApplicationCacheGroup::abort): Ditto.
(WebCore::ApplicationCacheGroup::didReceiveResponse): Ditto.
(WebCore::ApplicationCacheGroup::didFinishLoading): Ditto.
(WebCore::ApplicationCacheGroup::didFail): Ditto.
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Ditto.
(WebCore::ApplicationCacheGroup::manifestNotFound): Ditto.
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Ditto.
(WebCore::ApplicationCacheGroup::startLoadingEntry): Ditto.
(WebCore::ApplicationCacheGroup::deliverDelayedMainResources): Use a modern
for loop.
(WebCore::ApplicationCacheGroup::addEntry): Use auto and simplify logic
for adding.
(WebCore::ApplicationCacheGroup::associateDocumentLoaderWithCache): Update since
function result is a reference.
(WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback):
Use auto.
(WebCore::ApplicationCacheGroup::postListenerTask): Take event type instead of
taking a special enumeration.
* loader/appcache/ApplicationCacheGroup.h: Updated for the above.
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::ApplicationCacheHost): Move most member
initialization to the class definition.
(WebCore::ApplicationCacheHost::~ApplicationCacheHost): Use reference.
(WebCore::ApplicationCacheHost::selectCacheWithoutManifest): Ditto.
(WebCore::ApplicationCacheHost::selectCacheWithManifest): Ditto.
(WebCore::ApplicationCacheHost::mainResourceDataReceived): Ditto.
(WebCore::ApplicationCacheHost::failedLoadingMainResource): Ditto.
(WebCore::ApplicationCacheHost::finishedLoadingMainResource): Ditto.
(WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect): Ditto.
(WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse): Ditto.
(WebCore::ApplicationCacheHost::createFileURL): Ditto.
(WebCore::ApplicationCacheHost::maybeLoadSynchronously): Ditto.
(WebCore::ApplicationCacheHost::notifyDOMApplicationCache): Take event
type instead of special enumeration.
(WebCore::ApplicationCacheHost::stopLoadingInFrame): Use reference.
(WebCore::ApplicationCacheHost::stopDeferringEvents): Updated to use
event types instead of special enumeration and also repaired possible
edge case where code in event handler somehow triggers additional events.
(WebCore::ApplicationCacheHost::resourceList): Renamed from fillResourceList
and changed to return a vector instead of populating one.
(WebCore::ApplicationCacheHost::applicationCacheInfo): Tweak coding style a bit.
(WebCore::createApplicationCacheEvent): Factored this helper out of
dispatchDOMEvent so we can use Ref instead of RefPtr.
(WebCore::ApplicationCacheHost::dispatchDOMEvent): Updated to recent event type
rather than receiving an event id and mapping it to a type.
(WebCore::ApplicationCacheHost::setApplicationCache): Take RefPtr&& instead of
PassRefPtr.
(WebCore::ApplicationCacheHost::update): Pass a reference.
(WebCore::ApplicationCacheHost::swapCache): Ditto.
(WebCore::ApplicationCacheHost::abort): Ditto.
* loader/appcache/ApplicationCacheHost.h: Updated for the above.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup): Pass a Ref instead of RefPtr.
(WebCore::ApplicationCacheStorage::cacheGroupForURL): Ditto.
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): Ditto.
(WebCore::ApplicationCacheStorage::cacheGroupDestroyed): Take a reference.
(WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete): Ditto.
(WebCore::ApplicationCacheStorage::storeNewestCache): Ditto.
(WebCore::ApplicationCacheStorage::loadCache): Return RefPtr instead of PassRefPtr.
(WebCore::ApplicationCacheStorage::deleteCacheGroup): Pass a reference.
* loader/appcache/ApplicationCacheStorage.h: Updated for the above.
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::DOMApplicationCache): Take a reference.
(WebCore::DOMApplicationCache::toEventType): Deleted.
* loader/appcache/DOMApplicationCache.h: Updated for the above. Made most
members private.
* loader/archive/Archive.cpp:
(WebCore::Archive::clearAllSubframeArchives): Use a set for the logic that
prevents us from walking the same archive more than once, rather than using
a vector. Left it recursive, though.
* loader/archive/Archive.h: Git rid of the type function, replacing it with
three functions for the four different policies we currently have about the
different archive types. Changed functions to take Ref&& instead of PassRefPtr
and return const Vector<Ref>& instead of const Vector<RefPtr>&, changing the
data members to match.
* loader/archive/ArchiveFactory.cpp:
(WebCore::createArchiveMIMETypesMap): Factored this out of the archiveMIMETypes
function so we don't need a boolean. Also use ASCIILiteral.
(WebCore::archiveMIMETypes): Updated to se the above.
* loader/archive/ArchiveResourceCollection.cpp:
(WebCore::ArchiveResourceCollection::addAllResources): Take a reference.
(WebCore::ArchiveResourceCollection::popSubframeArchive): Return RefPtr instead
of PassRefPtr.
* loader/archive/ArchiveResourceCollection.h: Updated for the above.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createPropertyListRepresentation): Use auto and
fewer local variables, more references for argument types and return values.
(WebCore::LegacyWebArchive::createResourceResponseFromPropertyListData): Ditto.
(WebCore::LegacyWebArchive::createResource): Ditto.
(WebCore::LegacyWebArchive::create): Ditto.
(WebCore::LegacyWebArchive::extract): Ditto.
(WebCore::LegacyWebArchive::type): Deleted.
(WebCore::LegacyWebArchive::rawDataRepresentation): More of the same.
(WebCore::LegacyWebArchive::createFromSelection): Ditto.
* loader/archive/cf/LegacyWebArchive.h: Updated for the above. Also marked the
class final and added overrides for the four new policy member functions.
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::create): Pass references.
(WebCore::MHTMLArchive::generateMHTMLData): Return RefPtr instead of
PassRefPtr.
* loader/archive/mhtml/MHTMLArchive.h: Updated for the above. Also marked the
class final and added overrides for the four new policy member functions.
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::parseArchiveWithHeader): Pass Ref instead of RefPtr
to setMainResource and addSubframeArchive.
(WebCore::MHTMLParser::addResourceToArchive): Ditto.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet): Return RefPtr instead
of PassRefPtr.
* loader/cache/CachedCSSStyleSheet.h: Updated for the above.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setInitiator): Take a reference instead of a
PassRefPtr.
* loader/cache/CachedResourceRequest.h: Updated for the above.
* loader/cocoa/DiskCacheMonitor.h: Removed. This is a duplicate, unused copy
of DiskCacheMonitorCocoa.h.
* loader/cocoa/DiskCacheMonitorCocoa.h: Removed unneeded exporting and virtual
member functions, made more things private, and changed return type to RefPtr
instead of PassRefPtr.
* loader/cocoa/DiskCacheMonitorCocoa.mm:
(WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
Changed return type to RefPtr instead of PassRefPtr.
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::setIconDataForIconURL): Take raw pointer instead of
PassRefPtr.
(WebCore::IconDatabase::getOrCreateIconRecord): Return Ref instead of PassRefPtr.
(WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase): Return RefPtr
instead of PassRefPtr.
* loader/icon/IconDatabase.h: Updated for the above. Also marked functions final
instead of override.
* loader/icon/IconDatabaseBase.h: Ditto.
* loader/icon/PageURLRecord.cpp:
(WebCore::PageURLRecord::PageURLRecord): Moved initialization to the header.
(WebCore::PageURLRecord::~PageURLRecord): Wrote code here instead of calling
setIconRecord(nullptr).
(WebCore::PageURLRecord::setIconRecord): Take RefPtr&& instead of PassRefPtr.
* loader/icon/PageURLRecord.h: Updatd for the above.
* page/Chrome.cpp:
(WebCore::Chrome::runOpenPanel): Updated to take two references.
* page/Chrome.h: Ditto.
* page/ChromeClient.h: ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::applicationCache): Pass a reference.
(WebCore::DOMWindow::setLocation): Ditto.
(WebCore::DOMWindow::createWindow): Ditto.
(WebCore::DOMWindow::open): Ditto.
* page/EditorClient.h: Changed arguments to references instead of PassRefPtr.
* page/History.cpp:
(WebCore::History::stateObjectAdded): Pass an rvalue reference.
* page/Location.cpp:
(WebCore::Location::reload): Pass reference instead of pointer.
(WebCore::Location::setLocation): Ditto.
* platform/URL.cpp:
(WebCore::URL::setFragmentIdentifier): Take a StringView rather than
a String, which is more flexible for callers. Also eliminated an unneeded
string allocation when the old string had a fragment that is being replaced.
* platform/URL.h: Updated for the above.
* replay/ReplayInputDispatchMethods.cpp:
(WebCore::InitialNavigation::dispatch): Pass reference.
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::requestImageResource): Ditto.
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::loadFont): Ditto.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateExternalDocument): Ditto.
2017-01-16 Filip Pizlo <fpizlo@apple.com>
Make opaque root scanning truly constraint-based
https://bugs.webkit.org/show_bug.cgi?id=165760
Reviewed by Geoffrey Garen.
No new tests yet. I think that writing tests for this is a big investigation:
https://bugs.webkit.org/show_bug.cgi?id=165808
Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
very well. It's super confusing.
This change makes it so that visitAdditionalChildren can become a GC constraint that
executes as part of the fixpoint. This changes all WebCore visitAdditionalChildren into
output constraints by using new JSC API for Subspaces and MarkingConstraints.
* ForwardingHeaders/heap/MarkedAllocatorInlines.h: Added.
* ForwardingHeaders/heap/MarkedBlockInlines.h: Added.
* ForwardingHeaders/heap/MarkingConstraint.h: Added.
* ForwardingHeaders/heap/SubspaceInlines.h: Added.
* ForwardingHeaders/heap/VisitingTimeout.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
(WebCore::writeBarrierOpaqueRootSlow): Deleted.
* bindings/js/CommonVM.h:
(WebCore::writeBarrierOpaqueRoot): Deleted.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::finishCreation):
(WebCore::JSDOMGlobalObject::scriptExecutionContext):
* bindings/js/JSDOMWrapper.cpp:
(WebCore::outputConstraintSubspaceFor):
(WebCore::globalObjectOutputConstraintSubspaceFor):
* bindings/js/JSDOMWrapper.h:
* bindings/js/WebCoreJSClientData.cpp: Added.
(WebCore::JSVMClientData::JSVMClientData):
(WebCore::JSVMClientData::~JSVMClientData):
(WebCore::JSVMClientData::getAllWorlds):
(WebCore::initNormalWorldClientData):
* bindings/js/WebCoreJSClientData.h:
(WebCore::JSVMClientData::outputConstraintSpace):
(WebCore::JSVMClientData::globalObjectOutputConstraintSpace):
(WebCore::JSVMClientData::forEachOutputConstraintSpace):
(WebCore::JSVMClientData::JSVMClientData): Deleted.
(WebCore::JSVMClientData::~JSVMClientData): Deleted.
(WebCore::JSVMClientData::getAllWorlds): Deleted.
(WebCore::initNormalWorldClientData): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):
2017-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r210834
https://bugs.webkit.org/show_bug.cgi?id=165668
It introduced dozens of test timeouts.
Reverted changeset:
"[Modern Media Controls] Turn modern media controls on by default"
https://bugs.webkit.org/show_bug.cgi?id=165668
http://trac.webkit.org/changeset/210834
2017-01-17 Zalan Bujtas <zalan@apple.com>
Remove positionOutsideContainingSpecialElement
https://bugs.webkit.org/show_bug.cgi?id=167150
Reviewed by Antti Koivisto.
It is not used anymore.
No change in functionality.
* editing/htmlediting.cpp:
(WebCore::isFirstVisiblePositionInSpecialElement): Deleted.
(WebCore::isLastVisiblePositionInSpecialElement): Deleted.
(WebCore::positionOutsideContainingSpecialElement): Deleted.
* editing/htmlediting.h:
2017-01-17 Chris Dumez <cdumez@apple.com>
Unreviewed, fix nits found after landing r210833.
https://bugs.webkit.org/show_bug.cgi?id=167065
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::replaceAllChildren):
* dom/ContainerNode.h:
2017-01-17 Andreas Kling <akling@apple.com>
WidthCache should be off while under memory pressure.
<https://webkit.org/b/167141>
Reviewed by Antti Koivisto.
Since we empty all the WidthCaches when we come under memory pressure, we shouldn't
repopulate them until the pressure has gone away.
* platform/graphics/WidthCache.h:
(WebCore::WidthCache::add):
2017-01-17 Antti Koivisto <antti@apple.com>
Persist derived data
https://bugs.webkit.org/show_bug.cgi?id=167136
Reviewed by Andreas Kling.
* loader/LoaderStrategy.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didRetrieveDerivedDataFromCache):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::options):
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache):
* loader/SubresourceLoader.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::didRetrieveDerivedDataFromCache):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::defaultCachedResourceOptions):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::cacheBodyKey):
(WebCore::ResourceResponseBase::setCacheBodyKey):
(WebCore::ResourceResponseBase::encode):
(WebCore::ResourceResponseBase::decode):
2017-01-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn modern media controls on by default
https://bugs.webkit.org/show_bug.cgi?id=165668
Reviewed by Dean Jackson.
Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
media/modern-media-controls/pip-support/ipad/pip-support-tap.html
media/modern-media-controls/placard-support/ipad/placard-support-pip.html
media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
Fix an error which may be triggered prior to Sierra where we would assume the presentation
mode API was avaiable when it might not be, which caused a few tests to fail.
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
2017-01-17 Chris Dumez <cdumez@apple.com>
Document title changed twice when setting document.title
https://bugs.webkit.org/show_bug.cgi?id=167065
Reviewed by Darin Adler.
Setting document.title would call the document title to be set twice
first to the empty string and then to the new title. This is because
setting document.title is equivalent to setting title.textContent [1],
which first removes all children and then inserts the new one [2], and
we call updateTitle() for each step. This is because
HTMLTitleElement::childrenChanged() is called twice (once for the
removal of the existing children, and a second time when the new child
is inserted), and childrenChanged() calls document::titleElementTextChanged().
Since no JS event is fired between those 2 mutations, it is safe (i.e. non
observable from JS) to update the title only once after both mutations have
taken place. To achieve this, add a new replaceAllChildren() function
which implements [3]. This replaceAllChildren() has the benefit of
calling ContainerNode::childrenChanged() only once, after both mutations
have taken place, thus avoiding unnecessary work. This fixes the issue
when setting the title and should be performance-positive in general.
[1] https://html.spec.whatwg.org/#document.title
[2] https://dom.spec.whatwg.org/#dom-node-textcontent
[3] https://dom.spec.whatwg.org/#concept-node-replace-all
Test: fast/dom/Node/textContent-mutationEvents.html
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::notifyChildInserted):
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::replaceAllChildren):
(WebCore::ContainerNode::rebuildSVGExtensionsElementsIfNecessary):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::updateTreeAfterInsertion):
* dom/ContainerNode.h:
Add new replaceAllChildrenWith() function which implements [3]
in a way that calls ContainerNode::childrenChanged() only once.
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
Deal with new AllChildrenReplaced ChildChange type.
* dom/Node.cpp:
(WebCore::Node::setTextContent):
Call replaceAllChildrenWith() as per the specification:
- https://dom.spec.whatwg.org/#dom-node-textcontent
* dom/Range.cpp:
(WebCore::Range::surroundContents):
Call replaceAllChildrenWith(nullptr) as per the specification:
- https://dom.spec.whatwg.org/#dom-range-surroundcontents
2017-01-17 Joseph Pecoraro <pecoraro@apple.com>
ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
https://bugs.webkit.org/show_bug.cgi?id=116551
<rdar://problem/13949830>
Reviewed by Alex Christensen.
* Configurations/FeatureDefines.xcconfig:
2017-01-17 Zalan Bujtas <zalan@apple.com>
Editing nested RTL-LTR content makes the process unresponsive.
https://bugs.webkit.org/show_bug.cgi?id=167140
rdar://problem/29057611
Reviewed by Ryosuke Niwa.
Break out of the loop if we keep coming back to the same position.
This is a workaround for the underlying editing/position bug -> webkit.org/b/167138.
Test: editing/rtl-to-ltr-editing-word-move-spin.html
* editing/VisibleUnits.cpp:
(WebCore::visualWordPosition):
2017-01-16 Filip Pizlo <fpizlo@apple.com>
JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
https://bugs.webkit.org/show_bug.cgi?id=167066
Reviewed by Keith Miller and Michael Saboff.
No new tests because no new behavior.
It's now necessary to avoid jsCast in destructors and finalizers. This was an easy
rule to introduce because this used to always be the rule.
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::finalize):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::destroy):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2017-01-17 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary includes
https://bugs.webkit.org/show_bug.cgi?id=167114
Reviewed by Alex Christensen.
2017-01-17 Andreas Kling <akling@apple.com>
Kill the presentation attribute cache.
<https://webkit.org/b/119542>
Reviewed by Antti Koivisto.
This cache was added to placate some old page cycler test that was measuring load times
on pages captured in 2000. That content is not super relevant anymore, and I think
we can live without this cache.
* dom/StyledElement.cpp:
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
(WebCore::presentationAttributeCache): Deleted.
(WebCore::PresentationAttributeCacheCleaner::PresentationAttributeCacheCleaner): Deleted.
(WebCore::PresentationAttributeCacheCleaner::didHitPresentationAttributeCache): Deleted.
(WebCore::PresentationAttributeCacheCleaner::cleanCache): Deleted.
(WebCore::presentationAttributeCacheCleaner): Deleted.
(WebCore::StyledElement::clearPresentationAttributeCache): Deleted.
(WebCore::attributeNameSort): Deleted.
(WebCore::StyledElement::makePresentationAttributeCacheKey): Deleted.
(WebCore::computePresentationAttributeCacheHash): Deleted.
* dom/StyledElement.h:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
2017-01-17 Filip Pizlo <fpizlo@apple.com>
Unreviewed, roll out http://trac.webkit.org/changeset/210821
It was causing crashes.
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::finalize):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::destroy):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2017-01-17 Joseph Pecoraro <pecoraro@apple.com>
Crash when closing tab with debugger paused
https://bugs.webkit.org/show_bug.cgi?id=161746
<rdar://problem/15607819>
Reviewed by Brian Burg and Brent Fulgham.
* page/Page.h:
(WebCore::Page::incrementNestedRunLoopCount):
(WebCore::Page::decrementNestedRunLoopCount):
(WebCore::Page::insideNestedRunLoop):
Keep track of whether or not this Page is inside of a nested run loop.
Currently the only nested run loop we know about is EventLoop used
by Web Inspector when debugging JavaScript.
(WebCore::Page::whenUnnested):
Callback that can be called when we are no longer inside of a nested
run loop.
(WebCore::Page::~Page):
Ensure we are not in a known nested run loop when destructing, since
that could be unsafe.
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
Increment and decrement as we go into or leave the nested runloop.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectedPageDestroyed):
(WebCore::InspectorController::disconnectAllFrontends):
Rework destruction to allow disconnectAllFrontends to happen earlier
if necessary. WebKit clients may use this to disconnect remote
frontends when closing a Page.
2017-01-16 Filip Pizlo <fpizlo@apple.com>
JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
https://bugs.webkit.org/show_bug.cgi?id=167066
Reviewed by Keith Miller and Michael Saboff.
No new tests because no new behavior.
It's now necessary to avoid jsCast in destructors and finalizers. This was an easy
rule to introduce because this used to always be the rule.
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::finalize):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::destroy):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2017-01-17 Miguel Gomez <magomez@igalia.com>
REGRESSION(r208997): [GLX] Google maps labels broken when using glXCreateContextAttribsARB
https://bugs.webkit.org/show_bug.cgi?id=166489
Reviewed by Žan Doberšek.
The format GL_ALPHA that can be used in WebGL's texImage2D and texSubImage2D functions is deprecated
in the OpenGL layer when using a core profile. Due to this, when using core, we need to transform
that parameter into something supported by OpenGL.
What we do is to use a texture with just GL_RED format (that allows a single color component) to
store the alpha values, and then configure the texture to swizzle red and alpha when accessing the
pixel components.
No new tests added.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::texImage2D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::texSubImage2D):
2017-01-17 Tomas Popela <tpopela@redhat.com>
Unreviewed build fix for the Release build with enabled logging
* html/MediaElementSession.cpp:
* html/track/InbandGenericTextTrack.cpp:
2017-01-17 Zan Dobersek <zdobersek@igalia.com>
MediaKeySession: use existing 'message' event name
https://bugs.webkit.org/show_bug.cgi?id=167095
Reviewed by Sam Weinig.
When dispatching the 'message' event in MediaKeySession::enqueueMessage(),
use the messageEvent member that's provided by the EventNames object. This
removes the need for a custom static AtomicString object.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::enqueueMessage):
(WebCore::messageEventName): Deleted.
2017-01-16 Joseph Pecoraro <pecoraro@apple.com>
Remove the REQUEST_ANIMATION_FRAME flag
https://bugs.webkit.org/show_bug.cgi?id=156980
<rdar://problem/25906849>
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
* dom/Document.h:
* dom/RequestAnimationFrameCallback.idl:
* dom/ScriptedAnimationController.cpp:
* dom/ScriptedAnimationController.h:
* loader/EmptyClients.h:
* page/Chrome.cpp:
* page/Chrome.h:
* page/ChromeClient.h:
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/FrameView.cpp:
* page/FrameView.h:
* page/animation/AnimationController.cpp:
* page/animation/AnimationController.h:
* page/animation/AnimationControllerPrivate.h:
* platform/HostWindow.h:
* platform/ScrollAnimationSmooth.h:
* testing/Internals.cpp:
2017-01-16 Andy Estes <aestes@apple.com>
[QuickLook] QLPreviewConverter should be owned by its delegate
https://bugs.webkit.org/show_bug.cgi?id=167104
Reviewed by Andreas Kling.
Instead of having QuickLookHandle own both the QLPreviewConverter and its delegate, have it
just own the delegate and have the delegate own the QLPreviewConverter.
No change in behavior. Covered by existing tests.
* loader/ios/QuickLook.h:
(WebCore::QuickLookHandle::converter): Moved out-of-line.
* loader/ios/QuickLook.mm: Renamed WebPreviewConverterDelegate to WebPreviewConverter, and
gave it ownership of the QLPreviewConverter, QuickLookHandleClient, and preview response.
(-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]):
Added a ResourceResponse parameter.
(-[WebPreviewConverter setClient:]): Moved from QuickLookHandle::setClient().
(-[WebPreviewConverter appendDataArray:]): Moved from QuickLookHandle::didReceiveDataArray().
(-[WebPreviewConverter finishedAppending]): Moved from QuickLookHandle::didFinishLoading().
(-[WebPreviewConverter failed]): Moved from QuickLookHandle::didFail().
(-[WebPreviewConverter platformConverter]): Added to return the QLPreviewConverter.
(-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Used _previewResponse directly.
(WebCore::QuickLookHandle::~QuickLookHandle): Removed unneeded logging.
(WebCore::QuickLookHandle::didReceiveData): Called -[WebPreviewConverter appendDataArray:].
(WebCore::QuickLookHandle::didReceiveBuffer): Ditto.
(WebCore::QuickLookHandle::didFinishLoading): Called -[WebPreviewConverter finishedAppending].
(WebCore::QuickLookHandle::didFail): Called -[WebPreviewConverter failed].
(WebCore::QuickLookHandle::setClient): Called -[WebPreviewConverter setClient:].
(WebCore::QuickLookHandle::previewFileName): Retrieved the QLPreviewConverter via
-[WebPreviewConverter platformConverter].
(WebCore::QuickLookHandle::previewUTI): Ditto.
(WebCore::QuickLookHandle::previewRequestURL): Ditto.
(WebCore::QuickLookHandle::converter): Ditto.
(WebCore::QuickLookHandle::didReceiveDataArray): Deleted.
(WebCore::QuickLookHandle::previewResponse): Deleted.
2017-01-16 Antti Koivisto <antti@apple.com>
CrashTracer: com.apple.WebKit.WebContent at JavaScriptCore: WTF::StringImpl::containsOnlyWhitespace
https://bugs.webkit.org/show_bug.cgi?id=167106
<rdar://problem/24457632>
Reviewed by Tim Horton.
Speculative fix.
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Test before casting to Text.
2017-01-16 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Implementing baseline positioning for grid containers
https://bugs.webkit.org/show_bug.cgi?id=165063
Reviewed by Darin Adler and Sergio Villar Senin.
Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines
The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.
Tests: fast/css-grid-layout/grid-baseline-margins.html
fast/css-grid-layout/grid-baseline-must-respect-grid-order.html
fast/css-grid-layout/grid-baseline.html
* rendering/RenderGrid.cpp:
(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderGrid::isInlineBaselineAlignedChild):
(WebCore::RenderGrid::baselinePosition):
(WebCore::RenderGrid::firstLineBaseline):
(WebCore::RenderGrid::inlineBlockBaseline):
* rendering/RenderGrid.h:
2017-01-16 Andy Estes <aestes@apple.com>
[QuickLook] Do some cleanup in QuickLookHandle
https://bugs.webkit.org/show_bug.cgi?id=166864
Reviewed by Darin Adler.
* loader/ios/QuickLook.h: Stopped including QuickLookHandleClient.h and forward-declared
instead; changed setClient() to take a Ref<QuickLookHandleClient>&&; renamed nsResponse() to
previewResponse(); changed QuickLookHandle() to take a ResourceLoader& and const
ResourceResponse&; gave m_delegate a stronger type; removed unused m_quicklookFileHandle;
initialized m_finishedLoadingDataIntoConverter to false.
(WebCore::QuickLookHandle::firstRequestURL): Stopped exporting.
(WebCore::QuickLookHandle::setClient): Moved definition out-of-line.
* loader/ios/QuickLook.mm: Renamed WebResourceLoaderQuickLookDelegate to
WebPreviewConverterDelegate and stopped conforming to NSURLConnectionDelegate and
WebCoreResourceLoaderDelegate; removed @property quickLookHandle and initialized
_quickLookHandle in the initializer instead.
(-[WebPreviewConverter initWithResourceLoader:quickLookHandle:]): Changed to take references
to resourceLoader and quickLookHandle.
(-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Stopped checking for a nil
_quickLookHandle, since it is never nil.
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Deleted.
QLPreviewConverter never calls this method.
(-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Stopped checking for a
nil _resourceLoader, since it is never nil.
(-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
(-[WebPreviewConverter connection:didFailWithError:]): Ditto.
(WebCore::emptyClient): Changed to return a reference.
(WebCore::QuickLookHandle::QuickLookHandle): Moved creation of the delegate,
firstRequestURL, and response to here from QuickLookHandle::create(). Called
ResourceLoader::didCreateQuickLookHandle() here instead of in QuickLookHandle::create().
(WebCore::QuickLookHandle::create): Used std::make_unique to create the QuickLookHandle.
(WebCore::QuickLookHandle::didFinishLoading): Set m_finishedLoadingDataIntoConverter to true
instead of YES.
(WebCore::QuickLookHandle::setClient): Moved the client rvalue reference into m_client.
(WebCore::QuickLookHandle::~QuickLookHandle): Stopped clearing m_converter and calling
-detachHandle.
(WebCore::QuickLookHandle::previewRequestURL): Used dot syntax.
(WebCore::QuickLookHandle::previewResponse): Renamed from nsResponse().
2017-01-16 Simon Fraser <simon.fraser@apple.com>
Remove CSSPropertyNames.in from the project. It's not used any more,
now that we generate files from CSSProperties.json.
* WebCore.xcodeproj/project.pbxproj:
2017-01-16 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Accept-language could be set twice in a row for the default context
https://bugs.webkit.org/show_bug.cgi?id=167089
Reviewed by Žan Doberšek.
If NetworkStorageSession doesn't have a SoupNetworkSession yet, we are creating it only to set the
languages. Since we already set the global value, the languages will be set when the SoupNetworkSession is
created later. This is not a big deal for the language property, but it will be for proxies after bug #128674.
Since NetworkStorageSession::soupNetworkSession() it's actually getting or creating the SoupNetworkSession, this
patch renames it as NetworkStorageSession::getOrCreateSoupNetworkSession() and now
NetworkStorageSession::soupNetworkSession() returns a pointer without creating the SoupNetworkSession, so it can
be nullptr. This can now be used to only use the default SoupNetworkSession when it has already been created.
* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::soupNetworkSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
* platform/network/soup/DNSSoup.cpp:
(WebCore::DNSResolveQueue::updateIsUsingProxy): Ditto.
(WebCore::DNSResolveQueue::platformResolve): Ditto.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): This is the old soupNetworkSession(), now renamed.
(WebCore::NetworkStorageSession::soupNetworkSession): Return a pointer with the current value of m_session that
now can be nullptr.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::sessionFromContext): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
2017-01-16 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Fix handling of accept language property
https://bugs.webkit.org/show_bug.cgi?id=166969
Reviewed by Michael Catanzaro.
Add SoupNetworkSession::setInitialAcceptLanguages() static method and update setAcceptLanguages to receive the
string already built from the languages vector. Now the SoupNetworkSession saves that value globally that
is always used when creating new sessions.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession): Remove workaround.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): If initial accept languages were set, apply them to the newly created context.
(WebCore::SoupNetworkSession::setInitialAcceptLanguages): Just save the given value globally.
(WebCore::SoupNetworkSession::setAcceptLanguages): It receives now the string, so just set it to the session.
* platform/network/soup/SoupNetworkSession.h:
2017-01-15 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] SoupNetworkSession constructor should be explicit
https://bugs.webkit.org/show_bug.cgi?id=167069
Reviewed by Darin Adler.
* platform/network/soup/SoupNetworkSession.h:
2017-01-15 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection
https://bugs.webkit.org/show_bug.cgi?id=167039
Reviewed by Darin Adler.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSHTMLFrameElementCustom.cpp: Removed.
* bindings/js/JSHTMLInputElementCustom.cpp: Removed.
* bindings/js/JSHTMLMediaElementCustom.cpp: Removed.
Remove files.
* html/HTMLOptionsCollection.idl:
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength): Deleted.
Remove custom setLength. The bindings generator can handle this now.
* html/HTMLFrameElement.idl:
Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLFrameElementBase.h:
Add implementation of setLocation.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::selectionStartForBindings):
(WebCore::HTMLInputElement::setSelectionStartForBindings):
(WebCore::HTMLInputElement::selectionEndForBindings):
(WebCore::HTMLInputElement::setSelectionEndForBindings):
(WebCore::HTMLInputElement::selectionDirectionForBindings):
(WebCore::HTMLInputElement::setSelectionDirectionForBindings):
(WebCore::HTMLInputElement::setSelectionRangeForBindings):
* html/HTMLInputElement.h:
* html/HTMLInputElement.idl:
Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setControllerForBindings):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::controllerForBindings):
* html/HTMLMediaElement.idl:
Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setLength):
Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping.
2017-01-15 Tim Horton <timothy_horton@apple.com>
De-duplicate more (nearly) identical code in Editor(Mac|IOS).mm
https://bugs.webkit.org/show_bug.cgi?id=167063
Reviewed by Dan Bernstein.
No new tests, just refactoring.
* editing/Editor.h:
Adjust to fontAttributesForSelectionStart returning a RetainPtr.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
Make use of more Obj-C literals (for NSNumber).
(WebCore::Editor::fontAttributesForSelectionStart):
Merge this from EditorMac and EditorIOS. There are a number of attributes
that are currently only extracted on Mac, and it's not clear why (and
probably should be shared).
(WebCore::Editor::stringSelectionForPasteboard):
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText):
Merge these functions from EditorMac and EditorIOS. The iOS implementation
was missing a reasonable bug fix from r161925.
(WebCore::Editor::createFragmentAndAddResources):
Merge this from EditorMac and EditorIOS. The Mac implementation was missing
a reasonable bug fix from r203482.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontAttributesForSelectionStart): Deleted.
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted.
(WebCore::Editor::createFragmentAndAddResources): Deleted.
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontAttributesForSelectionStart): Deleted.
(WebCore::Editor::stringSelectionForPasteboard): Deleted.
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted.
(WebCore::Editor::createFragmentAndAddResources): Deleted.
2017-01-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Unify FontPlatformData's hashing and equality operators
https://bugs.webkit.org/show_bug.cgi?id=167061
Reviewed by Darin Adler.
On iOS, we were using CFEqual() and CFHash(), while on macOS
we were using pointer hashing and pointer equality. Instead,
we should be consistent about these operators.
Right now, FontPlatformData holds two internal CTFontRefs, and
switching to these higher-level CFEqual() and CFHash()
functions is required for eliminating one of these two
internal font objects.
No new tests because there is no behavior change.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::platformIsEqual):
(WebCore::cascadeToLastResortAttributesDictionary):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::hash):
2017-01-15 Andreas Kling <akling@apple.com>
FrameView shouldn't keep dangling pointers into dead render trees.
<https://webkit.org/b/167011>
Reviewed by Antti Koivisto.
Added some pretty paranoid assertions to FrameView that verify all of its raw pointers
into the render tree are gone after the render tree has been destroyed.
They immediately caught two bugs, also fixed in this patch.
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::willDestroyRenderTree):
(WebCore::FrameView::didDestroyRenderTree): Added these two callbacks for before/after
Document tears down its render tree. The former clears the layout root, and detaches
custom scrollbars. The latter contains a bunch of sanity assertions that pointers into
the now-destroyed render tree are gone.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree): Notify FrameView before/after teardown.
* page/animation/AnimationController.h:
* page/animation/AnimationController.cpp:
(WebCore::AnimationController::hasAnimations): Added a helper to check if there are
any composite animations around, as these contain raw pointers to renderers.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::RenderElement::willBeDestroyed): Moved slow repaint object unregistration
from willBeRemovedFromTree() to willBeDestroyed(). The willBeRemovedFromTree() callback
is skipped as an optimization during full tree teardown, but willBeDestroyed() always
gets called. This fixes a bug where we'd fail to remove dangling pointers.
2017-01-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Unify font fallback between macOS and iOS for when the font-family list is exhausted
https://bugs.webkit.org/show_bug.cgi?id=167056
Reviewed by Darin Adler.
When performing font fallback, each item in the font-family list is examined.
If no appropriate fonts are found, WebKit asks the system for an appropriate
font. As of a few years ago, both macOS and iOS used platform calls to
produce a font; however, each platform used a different platform call. This
patch migrates both platforms to use a shared function which uses only
one of the platform calls (which means the other platform call is never used).
There are still some behavior differences between macOS and iOS (which are now
hidden behind a PLATFORM() guard), but I'd like to minimize and eliminate these
in the future. Using a shared function is a step toward this goal.
No new tests because there is no behavior change.
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::lookupFallbackFont):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::getSystemFontFallbackForCharacters): Deleted.
(WebCore::platformLookupFallbackFont): Deleted.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformLookupFallbackFont): Deleted.
2017-01-14 Chris Dumez <cdumez@apple.com>
Report CPU usage of tabs after they become non-visible using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167019
<rdar://problem/30019773>
Reviewed by Darin Adler.
Report CPU usage of tabs after they become non-visible using diagnostic logging.
We start measure CPU usage 5 seconds after a tab goes to the background, for 5
minutes and report how much CPU the tab used during those 5 minutes. We will
not log if the tab gets closed or moved to the foreground during those 5
minutes.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::didStartProvisionalLoad):
(WebCore::Page::didFinishLoad):
(WebCore::foregroundCPUUsageToDiagnosticLogginKey):
(WebCore::Page::measurePostLoadCPUUsage):
(WebCore::backgroundCPUUsageToDiagnosticLogginKey):
(WebCore::Page::measurePostBackgroundingCPUUsage):
(WebCore::Page::setIsVisibleInternal):
* page/Page.h:
* page/Settings.cpp:
(WebCore::Settings::isPostBackgroundingCPUUsageMeasurementEnabled):
* page/Settings.h:
2017-01-14 Tim Horton <timothy_horton@apple.com>
De-duplicate some (nearly) identical code in Editor(Mac|IOS).mm
https://bugs.webkit.org/show_bug.cgi?id=167062
Reviewed by Dan Bernstein.
No new tests, just refactoring.
* editing/Editor.cpp:
(WebCore::Editor::fontForSelection):
(WebCore::Editor::styleForSelectionStart):
(WebCore::Editor::adjustedSelectionRange):
* editing/Editor.h:
Move these three functions to Editor and unguard them, because they're
not Cocoa specific.
* platform/spi/cocoa/NSAttributedStringSPI.h:
Move some iOS-only NSAttributedString IPI (so no Internal SDK switch)
to NSAttributedStringSPI.h.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::selectionInWebArchiveFormat):
(WebCore::Editor::replaceSelectionWithAttributedString):
(WebCore::Editor::createFragmentForImageResourceAndAddResource):
(WebCore::Editor::dataInRTFDFormat):
(WebCore::Editor::dataInRTFFormat):
Move these six functions here.
selectionInWebArchiveFormat and replaceSelectionWithAttributedString are
entirely identical; writeSelectionToPasteboard and createFragment...
both have slightly suspicious-looking differences that I left intact
and wrote comments about (especially createFragment..., the other one
is somewhat explicable). The two dataInRTF(D)Format functions used to
be static functions, but for now are required from both EditorCocoa
and Editor(Mac|IOS), so we'll make them static member functions.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontForSelection): Deleted.
(WebCore::Editor::selectionInWebArchiveFormat): Deleted.
(WebCore::dataInRTFDFormat): Deleted.
(WebCore::dataInRTFFormat): Deleted.
(WebCore::Editor::writeSelectionToPasteboard): Deleted.
(WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
(WebCore::Editor::replaceSelectionWithAttributedString): Deleted.
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection): Deleted.
(WebCore::Editor::selectionInWebArchiveFormat): Deleted.
(WebCore::dataInRTFDFormat): Deleted.
(WebCore::dataInRTFFormat): Deleted.
(WebCore::Editor::writeSelectionToPasteboard): Deleted.
(WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
(WebCore::Editor::replaceSelectionWithAttributedString): Deleted.
2017-01-14 Zalan Bujtas <zalan@apple.com>
Small code cleanup after r210760
https://bugs.webkit.org/show_bug.cgi?id=167047
Reviewed by Sam Weinig.
No change in functionality.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
2017-01-14 Zalan Bujtas <zalan@apple.com>
Renderers should have a simple way to access Settings.
https://bugs.webkit.org/show_bug.cgi?id=167048
Now that RenderObjects can never outlive the Page, we can just access the Settings
through Page instead of Document::settings/Frame::settings.
Reviewed by Andreas Kling.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret):
(WebCore::RenderBlock::shouldPaintSelectionGaps):
* rendering/RenderBlockFlow.cpp:
(WebCore::needsAppleMailPaginationQuirk):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::RenderElement::shouldRespectImageOrientation):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::flattenFrameSet):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::flattenFrame):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildIgnoringContinuation):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled):
(WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
(WebCore::RenderLayer::hasAcceleratedTouchScrolling):
(WebCore::RenderLayer::getRectToExpose):
(WebCore::RenderLayer::overhangAmount):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::shouldAggressivelyRetainTiles):
(WebCore::RenderLayerBacking::shouldTemporarilyRetainTileCohorts):
(WebCore::RenderLayerBacking::useGiantTiles):
(WebCore::RenderLayerBacking::startAnimation):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer):
(WebCore::RenderLayerCompositor::requiresContentShadowLayer):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
* rendering/RenderObject.h:
(WebCore::RenderObject::settings):
* rendering/RenderText.cpp:
(WebCore::SecureTextTimer::restart):
* rendering/RenderView.cpp:
(WebCore::RenderView::clientLogicalWidthForFixedPosition):
(WebCore::RenderView::clientLogicalHeightForFixedPosition):
(WebCore::RenderView::paintBoxDecorations):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
2017-01-14 Chris Dumez <cdumez@apple.com>
Align the innerText setter with the HTML spec and Gecko
https://bugs.webkit.org/show_bug.cgi?id=160971
Reviewed by Alex Christensen.
Align the innerText setter and createContextualFragment() with the
HTML specification and Gecko. In particular, they no longer throw
when the context element is a void element. This behavior was there
to match an old IE behavior but Edge dropped this behavior.
Test: fast/dom/br-set-outerText.html
* dom/Element.cpp:
* dom/Element.h:
* editing/markup.cpp:
(WebCore::createContextualFragment):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):
(WebCore::HTMLElement::setOuterText):
2017-01-13 Joseph Pecoraro <pecoraro@apple.com>
Remove ENABLE(DETAILS_ELEMENT) guards
https://bugs.webkit.org/show_bug.cgi?id=167042
Reviewed by Alex Christensen.
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::setIsExpanded):
* html/HTMLDetailsElement.cpp:
* html/HTMLDetailsElement.idl:
* html/HTMLSummaryElement.cpp:
* html/HTMLTagNames.in:
* html/shadow/DetailsMarkerControl.cpp:
* rendering/RenderDetailsMarker.cpp:
* rendering/RenderDetailsMarker.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isDetailsMarker):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
2017-01-13 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r210753.
https://bugs.webkit.org/show_bug.cgi?id=166730
* platform/WebGLStateTracker.h:
WTF::Function apparently needs to explicitly be differentiated from JSC::Attribute Function in PropertySlot.h.
2017-01-13 Brent Fulgham <bfulgham@apple.com>
Potential nullptr dereference in RenderLayer::updateLayerPosition()
https://bugs.webkit.org/show_bug.cgi?id=167036
<rdar://problem/30023019>
Reviewed by Dean Jackson.
A value was being used without nullptr checking, even though it had been checked for null a
few lines prior.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition): Add missing nullptr check.
2017-01-11 Darin Adler <darin@apple.com>
Remove PassRefPtr from more of "platform"
https://bugs.webkit.org/show_bug.cgi?id=166809
Reviewed by Sam Weinig.
* CMakeLists.txt: Removed DeviceMotionClientMock.cpp.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
Added now-needed include.
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
Pass a reference instead of a pointer.
* Modules/speech/SpeechSynthesisUtterance.h: Tweaks, msade a few things
more private and final.
* bindings/js/JSDOMConvert.h:
(WebCore::Detail::getPtrOrRef): Removed no-longer-needed const_cast.
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::wrapped): Ditto.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::~ScriptModuleLoader): Ditto.
* css/BasicShapeFunctions.cpp:
(WebCore::convertToLengthSize): Updated for LengthSize struct.
(WebCore::convertToCenterCoordinate): Ditto.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createPositionListForLayer): Take a reference.
(WebCore::getBorderRadiusCornerValues): Updated for LengthSize struct.
(WebCore::getBorderRadiusCornerValue): Ditto.
(WebCore::getBorderRadiusShorthandValue): Ditto.
(WebCore::fillSizeToCSSValue): Ditto.
(WebCore::ComputedStyleExtractor::propertyValue): Updated many properties
since the layer properties now return references rather than pointers.
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::CachedGeneratedImage::image): Removed
no-longer-needed const_cast.
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::item): Ditto.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::init): Updated for LengthSize struct.
* css/CSSStyleRule.h: Removed no-longer-needed const_cast.
* css/CSSToStyleMap.cpp:
(WebCore::convertToLengthSize): Updated for LengthSize struct.
* css/FontFace.cpp:
(WebCore::FontFace::family): Removed no-longer-needed const_cast.
(WebCore::FontFace::style): Ditto.
(WebCore::FontFace::weight): Ditto.
(WebCore::FontFace::unicodeRange): Ditto.
(WebCore::FontFace::variant): Ditto.
(WebCore::FontFace::featureSettings): Ditto.
* css/LengthFunctions.cpp:
(WebCore::sizeForLengthSize): Added.
(WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
* css/LengthFunctions.h: Added sizeForLengthSize.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::paintOrder): Cut down on creation of unused objects.
We now create only what we actually use.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertRadius): Updated for
LengthSize struct.
(WebCore::StyleBuilderConverter::convertShapeValue): Pass references
when creating ShapeValue.
* css/StyleBuilderCustom.h:
(WebCore::forwardInheritedValue): Added. This set of overloaded
functions allows us to use move semantics for some types, but copy
them when inheriting. Doing it with special cases here allows us to
resolve this without adding overloads someone might be tempted to
call outside the style builder, and without adding special cases to
the JSON file for each property.
(WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion):
Add WTFMove as needed to work with rvalue references.
(WebCore::StyleBuilderCustom::applyValueSize): Ditto.
(WebCore::StyleBuilderCustom::applyInheritTextIndent): Ditto.
(WebCore::StyleBuilderCustom::applyValueTextIndent): Ditto.
(WebCore::StyleBuilderCustom::applyInheritLineHeight): Ditto.
(WebCore::StyleBuilderCustom::applyValueLineHeight): Ditto.
(WebCore::StyleBuilderCustom::applyInheritClip): Ditto.
(WebCore::StyleBuilderCustom::applyValueClip): Ditto.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::cacheBorderAndBackground): Use
references instead of pointers.
(WebCore::StyleResolver::applyMatchedProperties): Ditto.
(WebCore::StyleResolver::applyProperty): Update for changes to the
custom property data in RenderStyle.
* css/makeprop.pl: Use auto quite a bit more in the generated code.
Updated special cases for layers to expect references. Added a WTFMove
so we can get move semantics for converted values that come out in
an optional. Added call to forwardInheritedValue (see above).
* dom/Document.cpp:
(WebCore::Document::pageSizeAndMarginsInPixels): Use auto and update
since LengthSize is a struct.
* dom/EventPath.cpp:
(WebCore::EventPath::computePathUnclosedToTarget): Use auto.
* dom/LiveNodeList.h:
(WebCore::LiveNodeList::ownerNode): Removed no-longer-needed const_cast.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source): Removed unneeded static_cast.
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector): Tweaked formatting.
* dom/Range.h:
(WebCore::Range::ownerDocument): Removed no-longer-needed const_cast.
* dom/RegisteredEventListener.h:
(WebCore::RegisteredEventListener::callback): Ditto.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner): Ditto.
* html/HTMLCollection.h:
(WebCore::HTMLCollection::ownerNode): Ditto.
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::node): Ditto.
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused): Cut down on the number
of different functions here. Also use reference rather than pointer.
* inspector/PageScriptDebugServer.h: Updated for above change.
* loader/HistoryController.cpp:
(WebCore::HistoryController::recursiveSetProvisionalItem): Removed
no-longer-needed const_cast.
(WebCore::HistoryController::recursiveGoToItem): Ditto.
* page/Frame.cpp:
(WebCore::Frame::ownerRenderer): Use auto. Let the is<> function do null
checking for us.
(WebCore::Frame::frameForWidget): Take a reference rather than a pointer.
* page/Frame.h: Updated for the above.
* page/FrameView.cpp:
(WebCore::FrameView::invalidateRect): Use Chrome directly instead of using
HostWindow. HostWindow is an abstraction for the platform layer, and there
is no good reason to use it here.
(WebCore::FrameView::scheduleAnimation): Ditto.
(WebCore::FrameView::graphicsLayerForPlatformWidget): Updated to use reference
when calling RenderWidget::find.
(WebCore::FrameView::scrollContentsFastPath): Use Chrome instead of HostWindow.
(WebCore::FrameView::hostWindow): Use early return.
(WebCore::FrameView::updateScrollCorner): Removed unneeded call through to base
class function, which was empty.
(WebCore::FrameView::hasCustomScrollbars): Updated since the children set now
contains Ref rather than RefPtr.
(WebCore::FrameView::parentFrameView): Use early return.
(WebCore::FrameView::updateWidgetPositions): Use reference instead of pointer.
* page/FrameView.h: Use final instead of override. Remove now-unneeded const_cast.
* page/Page.cpp:
(WebCore::Page::pluginViews): Updated since the children set now contains
Ref rather than RefPtr.
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Updated for LengthSize struct.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::fireAnimationEventsIfNeeded): Updated for changes to
the types in animation function members.
(WebCore::AnimationBase::timeToNextService): Ditto.
(WebCore::AnimationBase::progress): Ditto.
(WebCore::AnimationBase::getElapsedTime): Ditto.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Updated for LengthSize struct.
(WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Updated since we now
use rvalue references and move semantics when setting length properties.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame): Tweaked to
use auto, pass references.
* platform/KeyedCoding.h: Return RefPtr instead of PassRefPtr.
* platform/LengthBox.h: Added a constructor that moves the lengths in, rather
than always copying them.
* platform/LengthSize.cpp:
(WebCore::operator<<): Updated since LengthSize is a struct.
* platform/LengthSize.h: Turned LengthSize into a struct and removed all the
getter and setter code.
* platform/PlatformSpeechSynthesis.h: Removed. Unused.
* platform/PlatformSpeechSynthesisUtterance.cpp:
(WebCore::PlatformSpeechSynthesisUtterance::create): Return Ref rather than PassRefPtr.
(WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance): Take
a reference. Initialize data members in class definition.
* platform/PlatformSpeechSynthesisUtterance.h: Updated for the above.
* platform/PlatformSpeechSynthesisVoice.cpp:
(WebCore::PlatformSpeechSynthesisVoice::create): Return Ref rather than PassRefPtr.
* platform/PlatformSpeechSynthesisVoice.h: Updated for the above.
* platform/ScrollView.cpp:
(WebCore::ScrollView::addChild): Take a reference rather than a PassRefPtr.
(WebCore::ScrollView::setHasScrollbarInternal): Updated for change to addChild
(WebCore::ScrollView::scrollContentsFastPath): Deleted. This was never called,
so made it pure virtual.
(WebCore::ScrollView::frameRectsChanged): Use a modern for loop.
(WebCore::ScrollView::clipRectChanged): Ditto.
(WebCore::ScrollView::updateScrollCorner): Deleted. This was empty so made it pure
virtual and changed FrameView to not call it.
(WebCore::ScrollView::setParentVisible): Use a modern for loop.
(WebCore::ScrollView::show): Ditto.
(WebCore::ScrollView::hide): Ditto.
* platform/ScrollView.h: Changed the children set to contain Ref instead of RefPtr.
Changed functions that were never overridden to either be final or non-virtual,
Changed functions that were never called to be pure virtual.
* platform/Theme.h:
(WebCore::Theme::minimumControlSize): Updated for LengthSize struct.
* platform/animation/Animation.h: Changed timingFunction and trigger to return
raw pointers instead of PassRefPtr. Changed setTimingFunction and setTrigger to
take RefPtr&& and Ref&& instead of PassRefPtr. CHanged initialTimingfunction and
initialTrigger to return Ref.
* platform/animation/AnimationList.cpp: Removed redundant check in FILL_UNSET_PROPERTY.
(WebCore::AnimationList::AnimationList): Use modern for loop, reserveInitialCapacity,
and uncheckedAppend.
* platform/animation/AnimationList.h: Changed append to take Ref&& instead of PassRefPtr.
changed vecto to contain Ref instead of RefPtr. Added move constructor and assignment
operator.
* platform/animation/AnimationTrigger.h:
(WebCore::AutoAnimationTrigger::clone): Return Ref instead of PassRefPtr.
(WebCore::AutoAnimationTrigger::create): Ditto.
(WebCore::AutoAnimationTrigger::clone): Ditto.
(WebCore::ScrollAnimationTrigger::create): Ditto.
(WebCore::ScrollAnimationTrigger::clone): Ditto.
* platform/animation/TimingFunction.h:
(WebCore::LinearTimingFunction::create): Return Ref instead of PassRefPtr.
(WebCore::CubicBezierTimingFunction::create): Ditto.
(WebCore::CubicBezierTimingFunction::defaultTimingFunction): Return a reference
instead of a pointer.
(WebCore::CubicBezierTimingFunction::createReversed): Return Ref instead of PassRefPtr.
(WebCore::CubicBezierTimingFunction::clone): Ditto.
(WebCore::StepsTimingFunction::create): Ditto.
(WebCore::StepsTimingFunction::clone): Ditto.
(WebCore::SpringTimingFunction::create): Ditto.
(WebCore::SpringTimingFunction::clone): Ditto.
* platform/audio/AudioBus.h:
(WebCore::AudioBus::channel): Removed no-longer-needed const_cast.
* platform/cf/KeyedEncoderCF.cpp:
(WebCore::KeyedEncoderCF::finishEncoding): Return RefPtr instead of PassRefPtr.
* platform/cf/KeyedEncoderCF.h: Use final instead of override. Made even more
private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
* platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed include of PassRefPtr.h.
* platform/glib/KeyedEncoderGlib.cpp:
(WebCore::KeyedEncoderGlib::finishEncoding): Return RefPtr instead of PassRefPtr.
* platform/glib/KeyedEncoderGlib.h: Use final instead of override. Made even more
private. Changed return value of finishEncoding to Ref instead of PassRefPtr.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::outsetSizeForBlur): Simplified, removing unnecessary floating point math.
(WebCore::FilterOperations::FilterOperations): Deleted. Let the compiler generate this.
(WebCore::FilterOperations::operator=): Deleted. Let the compiler generate this.
(WebCore::FilterOperations::operator==): Streamlined.
(WebCore::FilterOperations::operationsMatch): Ditto.
(WebCore::FilterOperations::hasReferenceFilter): Ditto.
(WebCore::FilterOperations::hasOutsets): Ditto.
(WebCore::FilterOperations::outsets): Ditto.
(WebCore::FilterOperations::hasFilterThatAffectsOpacity): Ditto.
(WebCore::FilterOperations::hasFilterThatMovesPixels): Ditto.
* platform/graphics/filters/FilterOperations.h: Updated for above changes.
* platform/graphics/FontCache.h: Removed included of PassRefPtr.h.
* platform/graphics/FontPlatformData.h: Tweaked formatting. Removed nesting
from #if since our formatting makes it hard to see nesting. Let the compiler
generate the default move and copy constructors and assignemnt operators except
in the USE(FREETYPE) case.
* platform/graphics/GraphicsLayer.h:
(WebCore::AnimationValue::AnimationValue): Updated since clone now returns a Ref
rather than a RefPtr.
(WebCore::FloatAnimationValue::FloatAnimationValue): Deleted. Let the compiler
generate the copy constructor without defining it explicitly.
(WebCore::TransformAnimationValue::TransformAnimationValue): Use a modern for
loop, reserveInitialCapacity, and unchecked append. Also tell the compiler to
generate the move constructor, since the special work is only needed for the
copy constructor.
(WebCore::FilterAnimationValue::FilterAnimationValue): Ditto.
(WebCore::KeyframeValueList::KeyframeValueList): Ditto.
* platform/graphics/LegacyCDMSession.h: Removed include of PassRefPtr.h.
* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline): Updated
for LengthSize struct.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF): Take a reference.
Don't bother setting m_client since we never use it.
(WebCore::CDMSessionAVFoundationCF::generateKeyRequest): Clean up code a bit
by using auto a lot more.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Added include
that is now needed since it was removed from the base class. Tidied the class
up a bit, marking it final, making everything private, taking a reference, and
removing an unused data member, m_client.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createSession): Pass a reference.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
added include of WTFString.h, now needed because of removing an unneeded
include from another header file.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated): Updated since trigger
is a raw pointer now.
(WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): Updated to
return a reference rather than a pointer.
(WebCore::GraphicsLayerCA::setAnimationEndpoints): Updated for the above change.
(WebCore::GraphicsLayerCA::setAnimationKeyframes): Ditto.
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Ditto.
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Ditto.
(WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): Ditto.
(WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): Ditto.
* platform/graphics/ca/GraphicsLayerCA.h: Ditto.
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:]): CHanged argument to be a
RefPtr&& instead of a PassRefPtr.
* platform/mac/ThemeMac.mm:
(WebCore::sizeFromNSControlSize): Updated for LenghtSize struct.
(WebCore::checkboxSize): Ditto.
(WebCore::radioSize): Ditto.
(WebCore::ThemeMac::controlSize): Ditto.
(WebCore::ThemeMac::minimumControlSize): Ditto.
* platform/mac/WidgetMac.mm:
(WebCore::Widget::setFocus): Updated to pass a reference.
* platform/mock/DeviceMotionClientMock.cpp: Removed. Unused.
* platform/mock/DeviceMotionClientMock.h: Removed. Unused.
* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor): Return a Ref instead of a PassRefPtr.
(WebCore::loadSharedCursor): Ditto.
(WebCore::loadCursorByName): Ditto.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::output): Removed a no-longer-needed const_cast.
(WebCore::FilterEffectRenderer::outputRect): Ditto.
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::chooseInterpolationQuality): Tweaked formatting.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintFillLayers): Updated to take a reference. Also
used a vector to iterate the linked list in reverse order instead of recursion.
(WebCore::InlineFlowBox::paintFillLayer): Take a reference.
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h: Updated for the above.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers): Use auto a bit.
(WebCore::RenderBox::getBackgroundPaintedExtent): Use reference for the layers.
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect): Ditto.
(WebCore::RenderBox::backgroundHasOpaqueTopLayer): Ditto.
(WebCore::RenderBox::paintMaskImages): Ditto.
(WebCore::RenderBox::maskClipRect): Ditto.
(WebCore::RenderBox::paintFillLayers): Ditto.
(WebCore::RenderBox::paintFillLayer): Ditto.
(WebCore::layersUseImage): Ditto.
(WebCore::RenderBox::repaintLayerRectsForImage): Ditto.
* rendering/RenderBox.h: Updated for the above.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Use reference for
the layers.
(WebCore::RenderBoxModelObject::calculateFillTileSize): Ditto.
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ditto.
(WebCore::RenderBoxModelObject::getGeometryForBackgroundImage): Ditto.
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground): Ditto.
* rendering/RenderBoxModelObject.h: Updated for the above.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement): Use references for the layers.
(WebCore::RenderElement::adjustStyleDifference): Ditto.
(WebCore::RenderElement::updateFillImages): Ditto.
(WebCore::RenderElement::setStyle): Use RenderStyle::replace to replace the
old style with the new style, and get the old one out at the same time.
(WebCore::RenderElement::styleDidChange): Use references for the layers.
(WebCore::mustRepaintFillLayers): Ditto.
(WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto.
* rendering/RenderElement.h: Updated for the above.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
Refactor so we don't need so many functions in RenderStyle.
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle): Ditto.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar): Pass widget as reference to addChild.
Also did a few other tweaks and used more specific types.
* rendering/RenderLayerBacking.cpp:
(WebCore::canCreateTiledImage): Updated since layers are references.
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar): Pass widget as reference to addChild.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell): Updated to use
references for layers.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle): Use WTFMove to pass a LengthBox.
(WebCore::RenderTheme::isControlStyled): Updated since LengthSize is a struct,
more WTFMove, change since layers are ferences.
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::adjustSizeConstraints): Update for Length and
LengthSize changes.
(WebCore::RenderThemeEfl::paintThemePart): Use reference instead of pointer.
(WebCore::RenderThemeEfl::applyPartDescriptionFallback): Update for Length and
LengthSize changes.
(WebCore::RenderThemeEfl::applyPartDescription): Ditto.
(WebCore::RenderThemeEfl::adjustCheckboxStyle): Ditto.
(WebCore::RenderThemeEfl::adjustRadioStyle): Ditto.
* rendering/RenderThemeGtk.cpp:
(WebCore::borderRadiiFromStyle): Update for Length and LengthSize changes.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustCheckboxStyle): Update for Length and
LengthSize changes.
(WebCore::RenderThemeIOS::isControlStyled): Ditto.
(WebCore::RenderThemeIOS::adjustRadioStyle): Ditto.
(WebCore::RenderThemeIOS::adjustRoundBorderRadius): Ditto.
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Ditto.
(WebCore::RenderThemeIOS::adjustSliderTrackStyle): Ditto.
(WebCore::RenderThemeIOS::adjustSliderThumbSize): Ditto.
* rendering/RenderWidget.cpp:
(WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): Use move
insteead of swap and modern for loop instead of iterators.
(WebCore::moveWidgetToParentSoon): Take a reference instead of a pointer.
(WebCore::RenderWidget::setWidget): Update for above change.
(WebCore::RenderWidget::find): Take a reference instead of a pointer.
* rendering/RenderWidget.h: Updated for above changes.
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::reset): Updated since Length is passed as
rvalue reference now.
* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::getMathMLStyle): Updated since mathMLStyle returns
a reference.
(WebCore::MathMLStyle::resolveMathMLStyleTree): Ditto.
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::mathMLStyle): Removed no-longer needed const_cast,
changed to return a reference rather than a pointer.
(WebCore::RenderMathMLTable::mathMLStyle): Ditto.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::fractionParameters): Updated since mathMLStyle
returns a reference.
(WebCore::RenderMathMLFraction::stackParameters): Ditto.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle): Ditto.
(WebCore::RenderMathMLOperator::shouldMoveLimits): Ditto.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::verticalParameters): Ditto.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
* rendering/style/BasicShapes.cpp:
(WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
* rendering/style/BorderData.h:
(WebCore::BorderData::BorderData): Ditto.
(WebCore::BorderData::hasBorderRadius): Ditto.
* rendering/style/ContentData.cpp:
(WebCore::ContentData::clone): Updated member names.
* rendering/style/ContentData.h: Ditto.
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::computeSlices): Use initializer lists so we get
move optimization without requiring explicit WTFMove.
* rendering/style/DataRef.h:
(WebCore::DataRef::DataRef): Removed no-longer needed const_cast.
(WebCore::DataRef::replace): Added. This function is like Ref::replace, and
can be used to put a new value in and get an old value out without running into
the rule Ref has about not being reused once it becomes null because of being
moved out of. This function is a lot like std::exchange.
(WebCore::DataRef::operator const T&): Added operator so we can use these
as references without any function call in read-only contexts.
(WebCore::DataRef::get): Changed to return a reference rather than pointer.
(WebCore::DataRef::access): Ditto.
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeValue::timingFunction): Updated since timingFunction
returns a raw pointer.
(WebCore::KeyframeList::~KeyframeList): Removed unneeded call to clear,
which does things that are redundant since we are about to destroy all the
data members.
(WebCore::KeyframeList::operator==): Tweaked codign style a bit.
* rendering/style/NinePieceImage.h: Updated most functions in this class
for the changes to DataRef.
* rendering/style/RenderStyle.cpp: Updated nearly every function in this
class for the changes to DataRef, to eliminate the peculiar naming and use
our standard data member naming, m_memberName in a class, and memberName in a
struct or struct-like class for publicly accessible members, to pass, take,
and return more references and rvalue references, and to use modern for loops.
Other changes listed below function by function.
(WebCore::RenderStyle::defaultStyle): Use NeverDestroyed instead of allocating
on the heap.
(WebCore::RenderStyle::RenderStyle): Added a new constructor that performs
the replace operation, using a combination of DataRef::replace and std::exchange.
(WebCore::RenderStyle::replace): Added. Calls the above constructor.
(WebCore::RenderStyle::setScrollSnapType): Use SET_NESTED_VAR so we get equality
checks on this property, for the normal efficiency benefit.
(WebCore::RenderStyle::setDashboardRegion): Moved this here from the header.
(WebCore::RenderStyle::appendContent): Deleted.
(WebCore::RenderStyle::setContent): Refactored this set of functions to simplify.
* rendering/style/RenderStyle.h: Updated most functions as mentioned above.
Also updated macros to use the do/while(0) technique. Removed the long list of
friend classes with the elaborate comments; turned out none needed friendship
despite the comments. Made more things private. Moved large functions out of the
class definition.
(WebCore::RenderStyle::getTextShadowExtent): Deleted.
(WebCore::RenderStyle::getTextShadowHorizontalExtent): Deleted.
(WebCore::RenderStyle::getTextShadowVerticalExtent): Deleted.
(WebCore::RenderStyle::aspectRatio): Deleted.
(WebCore::RenderStyle::alignContentPosition): Deleted.
(WebCore::RenderStyle::alignContentDistribution): Deleted.
(WebCore::RenderStyle::alignContentOverflowAlignment): Deleted.
(WebCore::RenderStyle::alignItemsPosition): Deleted.
(WebCore::RenderStyle::alignItemsOverflowAlignment): Deleted.
(WebCore::RenderStyle::alignSelfPosition): Deleted.
(WebCore::RenderStyle::alignSelfOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyContentPosition): Deleted.
(WebCore::RenderStyle::justifyContentDistribution): Deleted.
(WebCore::RenderStyle::justifyContentOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyItemsPosition): Deleted.
(WebCore::RenderStyle::justifyItemsOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyItemsPositionType): Deleted.
(WebCore::RenderStyle::justifySelfPosition): Deleted.
(WebCore::RenderStyle::justifySelfOverflowAlignment): Deleted.
(WebCore::RenderStyle::setAlignContentPosition): Deleted.
(WebCore::RenderStyle::setAlignContentOverflow): Deleted.
(WebCore::RenderStyle::setAlignContentDistribution): Deleted.
(WebCore::RenderStyle::setAlignItemsOverflow): Deleted.
(WebCore::RenderStyle::setAlignSelfOverflow): Deleted.
(WebCore::RenderStyle::setJustifyContentOverflow): Deleted.
(WebCore::RenderStyle::setJustifyContentDistribution): Deleted.
(WebCore::RenderStyle::setJustifyItemsPosition): Deleted.
(WebCore::RenderStyle::setJustifyItemsOverflow): Deleted.
(WebCore::RenderStyle::setJustifyItemsPositionType): Deleted.
(WebCore::RenderStyle::setJustifySelfPosition): Deleted.
(WebCore::RenderStyle::setJustifySelfOverflow): Deleted.
(WebCore::RenderStyle::noninheritedFlagsMemoryOffset): Deleted.
* rendering/style/SVGRenderStyle.cpp: Similar changes to RenderStyle.cpp above.
* rendering/style/SVGRenderStyle.h: Ditto.
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::create): Take a Ref&& instead of a RefPtr.
(WebCore::ShapeValue::ShapeValue): Ditto.
* rendering/style/StyleBackgroundData.cpp: Update data member names.
* rendering/style/StyleBackgroundData.h: Ditto; make them public and remove the
getter functions.
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue): Removed no-longer-needed const_cast.
* rendering/style/StyleCustomPropertyData.h: Update data member names.
(WebCore::StyleCustomPropertyData::operator==): Removed unnecessary reference
count churn.
(WebCore::StyleCustomPropertyData::setCustomPropertyValue): Take an rvalue
reference.
(WebCore::StyleCustomPropertyData::getCustomPropertyValue): Deleted.
(WebCore::StyleCustomPropertyData::values): Deleted.
(WebCore::StyleCustomPropertyData::hasCustomProperty): Deleted.
(WebCore::StyleCustomPropertyData::containsVariables): Deleted.
(WebCore::StyleCustomPropertyData::setContainsVariables): Deleted.
* rendering/style/StyleFilterData.cpp: Update data member names.
* rendering/style/StyleFilterData.h: Ditto.
* rendering/style/StyleFlexibleBoxData.cpp: Ditto.
* rendering/style/StyleFlexibleBoxData.h: Ditto.
* rendering/style/StyleGridData.cpp: Ditto.
* rendering/style/StyleGridData.h: Ditto.
* rendering/style/StyleGridItemData.cpp: Ditto.
* rendering/style/StyleGridItemData.h: Ditto.
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::cssValue): Removed no-longer-needed const_cast.
(WebCore::StyleGeneratedImage::imageSize): Ditto.
(WebCore::StyleGeneratedImage::image): Ditto.
* rendering/style/StyleInheritedData.cpp: Update data member names.
* rendering/style/StyleInheritedData.h: Ditto.
* rendering/style/StyleRareInheritedData.cpp: Ditto.
* rendering/style/StyleRareInheritedData.h: Ditto.
* rendering/style/StyleMultiColData.cpp: Ditto.
* rendering/style/StyleMultiColData.h: Ditto.
* rendering/style/StyleRareNonInheritedData.cpp: Ditto.
* rendering/style/StyleRareNonInheritedData.h: Ditto.
* rendering/style/StyleTransformData.cpp: Ditto.
* rendering/style/StyleTransformData.h: Ditto.
* rendering/style/StyleVisualData.cpp: Ditto.
* rendering/style/StyleVisualData.h: Ditto.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingResources): Update since layers are references.
2017-01-13 Chris Dumez <cdumez@apple.com>
[WK2] Add diagnostic logging to measure WebGL usage
https://bugs.webkit.org/show_bug.cgi?id=166730
<rdar://problem/29883469>
Reviewed by Alex Christensen.
Add diagnostic logging to measure high performance WebGL usage. We report
at regular intervals in which WebGL state Safari is:
- Inactive
- ActiveInForegroundTab
- ActiveInBackgroundTabOnly
This should give us an estimate of:
- What % of the time is Safari using high performance graphics
- What % of this time is only due to background tabs
No new tests, no Web-facing behavior change.
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
* html/canvas/WebGLRenderingContextBase.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::inactiveKey):
(WebCore::DiagnosticLoggingKeys::activeInForegroundTabKey):
(WebCore::DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey):
(WebCore::DiagnosticLoggingKeys::stateKey):
(WebCore::WebCore::DiagnosticLoggingKeys::webGLKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::webGLStateTracker):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* platform/WebGLStateTracker.cpp: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
(WebCore::WebGLStateTracker::WebGLStateTracker):
(WebCore::m_stateChangeHandler):
(WebCore::WebGLStateTracker::updateWebGLState):
* platform/WebGLStateTracker.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
* platform/graphics/GraphicsContext3DAttributes.h:
2017-01-13 Brent Fulgham <bfulgham@apple.com>
Avoid nullptr frame dereference when scrollTo is called on a disconnected DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=167030
<rdar://problem/29995070>
Reviewed by Dean Jackson.
Correct DOMWindow::scrollTo to match all other functions in the class so that the it
checks that the current frame is valid before attempting to use it.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollTo):
2017-01-13 Jer Noble <jer.noble@apple.com>
Use a strong reference when calling callOnMainThread to schedule events in AudioScheduledSourceNode.
https://bugs.webkit.org/show_bug.cgi?id=166983
Reviewed by Brent Fulgham.
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):
* Modules/webaudio/AudioScheduledSourceNode.h:
2017-01-12 Jer Noble <jer.noble@apple.com>
Protect MediaPlayer from being destroyed mid-load()
https://bugs.webkit.org/show_bug.cgi?id=166976
Reviewed by Eric Carlson.
It's possible for a message sent by MediaPlayer to HTMLMediaElement to cause
MediaPlayer to be destroyed before MediaPlayer::load() completes. We have
previously protected against this same problem in HTMLMediaElement::loadResource()
by ref'ing at the beginning of the function and deref'ing on exit. To do the
same in MediaPlayer, it must become RefCounted.
To keep the same semantics about m_client in MediaPlayer (always available without
requiring a null-check), make a new static MediaPlayerClient object which can
replace the real (HTMLMediaElement) client when the MediaPlayer is invalidated.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::createMediaPlayer):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::nullMediaPlayerClient):
(WebCore::MediaPlayer::create):
(WebCore::MediaPlayer::MediaPlayer):
(WebCore::MediaPlayer::invalidate):
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::inMediaDocument):
(WebCore::MediaPlayer::fullscreenMode):
(WebCore::MediaPlayer::requestedRate):
(WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
(WebCore::MediaPlayer::networkStateChanged):
(WebCore::MediaPlayer::readyStateChanged):
(WebCore::MediaPlayer::volumeChanged):
(WebCore::MediaPlayer::muteChanged):
(WebCore::MediaPlayer::timeChanged):
(WebCore::MediaPlayer::sizeChanged):
(WebCore::MediaPlayer::repaint):
(WebCore::MediaPlayer::durationChanged):
(WebCore::MediaPlayer::rateChanged):
(WebCore::MediaPlayer::playbackStateChanged):
(WebCore::MediaPlayer::firstVideoFrameAvailable):
(WebCore::MediaPlayer::characteristicChanged):
(WebCore::MediaPlayer::cachedKeyForKeyId):
(WebCore::MediaPlayer::keyNeeded):
(WebCore::MediaPlayer::mediaKeysStorageDirectory):
(WebCore::MediaPlayer::referrer):
(WebCore::MediaPlayer::userAgent):
(WebCore::MediaPlayer::graphicsDeviceAdapter):
(WebCore::MediaPlayer::cachedResourceLoader):
(WebCore::MediaPlayer::createResourceLoader):
(WebCore::MediaPlayer::addAudioTrack):
(WebCore::MediaPlayer::removeAudioTrack):
(WebCore::MediaPlayer::addTextTrack):
(WebCore::MediaPlayer::removeTextTrack):
(WebCore::MediaPlayer::addVideoTrack):
(WebCore::MediaPlayer::removeVideoTrack):
(WebCore::MediaPlayer::outOfBandTrackSources):
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
(WebCore::MediaPlayer::handlePlaybackCommand):
(WebCore::MediaPlayer::sourceApplicationIdentifier):
(WebCore::MediaPlayer::preferredAudioCharacteristics):
(WebCore::MediaPlayer::doesHaveAttribute):
(WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
(WebCore::MediaPlayer::getRawCookies):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::platformVolumeConfigurationRequired):
(WebCore::MediaPlayer::client):
2017-01-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream, Mac] Add mock audio source
https://bugs.webkit.org/show_bug.cgi?id=166974
Reviewed by Jer Noble.
Add a mock audio source for testing media streams.
No new tests, updated webaudio/mediastreamaudiosourcenode.html.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
* platform/mediastream/mac/AVAudioCaptureSource.h:
(WebCore::AVAudioCaptureSource::Observer::~Observer): Deleted.
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::addObserver):
(WebCore::AVAudioCaptureSource::removeObserver):
(WebCore::AVAudioCaptureSource::start):
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h: Added.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: Added.
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac):
(WebCore::MockRealtimeAudioSource::createMuted):
(WebCore::MockRealtimeAudioSourceMac::addObserver):
(WebCore::MockRealtimeAudioSourceMac::removeObserver):
(WebCore::MockRealtimeAudioSourceMac::start):
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
(WebCore::MockRealtimeAudioSourceMac::reconfigure):
(WebCore::MockRealtimeAudioSourceMac::render):
(WebCore::MockRealtimeAudioSourceMac::applySampleRate):
(WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::create):
(WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):
(WebCore::WebAudioSourceProviderAVFObjC::setClient):
(WebCore::WebAudioSourceProviderAVFObjC::startProducingData): Deleted.
(WebCore::WebAudioSourceProviderAVFObjC::stopProducingData): Deleted.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
(WebCore::MockRealtimeAudioSource::stopProducingData):
(WebCore::MockRealtimeAudioSource::elapsedTime):
(WebCore::MockRealtimeAudioSource::tick):
* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::render):
(WebCore::MockRealtimeAudioSource::renderInterval):
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): Deleted.
2017-01-13 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for DeviceMotionEvent and DeviceOrientationEvent
https://bugs.webkit.org/show_bug.cgi?id=167006
Reviewed by Geoffrey Garen.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDeviceMotionEventCustom.cpp: Removed.
* bindings/js/JSDeviceOrientationEventCustom.cpp: Removed.
Remove Custom bindings files.
* dom/DeviceMotionData.cpp:
(WebCore::DeviceMotionData::create):
(WebCore::DeviceMotionData::DeviceMotionData):
(WebCore::DeviceMotionData::Acceleration::create): Deleted.
(WebCore::DeviceMotionData::Acceleration::Acceleration): Deleted.
(WebCore::DeviceMotionData::RotationRate::create): Deleted.
(WebCore::DeviceMotionData::RotationRate::RotationRate): Deleted.
* dom/DeviceMotionData.h:
(WebCore::DeviceMotionData::Acceleration::create):
(WebCore::DeviceMotionData::Acceleration::x):
(WebCore::DeviceMotionData::Acceleration::y):
(WebCore::DeviceMotionData::Acceleration::z):
(WebCore::DeviceMotionData::Acceleration::Acceleration):
(WebCore::DeviceMotionData::RotationRate::create):
(WebCore::DeviceMotionData::RotationRate::alpha):
(WebCore::DeviceMotionData::RotationRate::beta):
(WebCore::DeviceMotionData::RotationRate::gamma):
(WebCore::DeviceMotionData::RotationRate::RotationRate):
(WebCore::DeviceMotionData::interval):
(WebCore::DeviceMotionData::Acceleration::canProvideX): Deleted.
(WebCore::DeviceMotionData::Acceleration::canProvideY): Deleted.
(WebCore::DeviceMotionData::Acceleration::canProvideZ): Deleted.
(WebCore::DeviceMotionData::RotationRate::canProvideAlpha): Deleted.
(WebCore::DeviceMotionData::RotationRate::canProvideBeta): Deleted.
(WebCore::DeviceMotionData::RotationRate::canProvideGamma): Deleted.
(WebCore::DeviceMotionData::canProvideInterval): Deleted.
Re-work using std::optional rather than an explicit bool/value pair.
* dom/DeviceMotionEvent.cpp:
(WebCore::convert):
(WebCore::DeviceMotionEvent::acceleration):
(WebCore::DeviceMotionEvent::accelerationIncludingGravity):
(WebCore::DeviceMotionEvent::rotationRate):
(WebCore::DeviceMotionEvent::interval):
(WebCore::DeviceMotionEvent::initDeviceMotionEvent):
* dom/DeviceMotionEvent.h:
Implement IDL interface. For now, we have duplicate structs for
Acceleration and RotationRate (one here, one in DeviceMotionData)
which can be consolidated in the future.
* dom/DeviceMotionEvent.idl:
Add dictionaries for Acceleration and RotationRate, and update IDL to
specify the correct nullability of attributes and arguments.
* dom/DeviceOrientationData.cpp:
(WebCore::DeviceOrientationData::create):
(WebCore::DeviceOrientationData::DeviceOrientationData):
(WebCore::DeviceOrientationData::alpha): Deleted.
(WebCore::DeviceOrientationData::beta): Deleted.
(WebCore::DeviceOrientationData::gamma): Deleted.
(WebCore::DeviceOrientationData::absolute): Deleted.
(WebCore::DeviceOrientationData::canProvideAlpha): Deleted.
(WebCore::DeviceOrientationData::canProvideBeta): Deleted.
(WebCore::DeviceOrientationData::canProvideGamma): Deleted.
(WebCore::DeviceOrientationData::compassHeading): Deleted.
(WebCore::DeviceOrientationData::compassAccuracy): Deleted.
(WebCore::DeviceOrientationData::canProvideCompassHeading): Deleted.
(WebCore::DeviceOrientationData::canProvideCompassAccuracy): Deleted.
(WebCore::DeviceOrientationData::canProvideAbsolute): Deleted.
* dom/DeviceOrientationData.h:
(WebCore::DeviceOrientationData::create):
(WebCore::DeviceOrientationData::alpha):
(WebCore::DeviceOrientationData::beta):
(WebCore::DeviceOrientationData::gamma):
(WebCore::DeviceOrientationData::compassHeading):
(WebCore::DeviceOrientationData::compassAccuracy):
(WebCore::DeviceOrientationData::absolute):
Re-work using std::optional rather than an explicit bool/value pair.
* dom/DeviceOrientationEvent.cpp:
(WebCore::DeviceOrientationEvent::alpha):
(WebCore::DeviceOrientationEvent::beta):
(WebCore::DeviceOrientationEvent::gamma):
(WebCore::DeviceOrientationEvent::compassHeading):
(WebCore::DeviceOrientationEvent::compassAccuracy):
(WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
(WebCore::DeviceOrientationEvent::absolute):
* dom/DeviceOrientationEvent.h:
Implement IDL interface.
* dom/DeviceOrientationEvent.idl:
Update IDL to specify the correct nullability of attributes and arguments.
* platform/ios/DeviceMotionClientIOS.mm:
(WebCore::DeviceMotionClientIOS::motionChanged):
* platform/ios/DeviceOrientationClientIOS.mm:
(WebCore::DeviceOrientationClientIOS::orientationChanged):
Update for use of std:optional.
2017-01-13 Zan Dobersek <zdobersek@igalia.com>
[GStreamer] Cache the accelerated capability of MediaPlayerClient in MediaPlayerPrivateGStreamerBase
https://bugs.webkit.org/show_bug.cgi?id=167015
Reviewed by Jer Noble.
In MediaPlayerPrivateGStreamerBase, avoid continuously querying the MediaPlayerClient
object about the accelerated compositing capabilities. Instead, cache this information
when creating the video sink (which is most affected by this information anyway), storing
it in a new protected boolean member variable in the MediaPlayerPrivateGStreamerBase class.
All calls to MediaPlayerClient::mediaPlayerRenderingCanBeAccelerated() and
MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled() are replaced by tests
on the value of this new member variable.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2017-01-13 Chris Dumez <cdumez@apple.com>
Report post-page load CPU usage using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=166950
<rdar://problem/30014496>
Reviewed by Alex Christensen.
Shortly after page load (5 seconds), we measure the WebContent process'
CPU usage over 10 seconds and report the percentage back via release
logging. We also log the percentage using diagnostic logging using the
following buckets:
- Below 10%
- 10 to 20%
- 20 to 40%
- 60 to 80%
- Over 80%
The logging works on both Mac and iOS. I verified that I get results
consistent with Activity Monitor or top.
No new tests, no Web-facing behavior change, only extra logging.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::postPageLoadKey):
(WebCore::DiagnosticLoggingKeys::cpuUsageKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::didFinishLoad):
(WebCore::cpuUsageToDiagnosticLogginKey):
(WebCore::Page::measurePostLoadCPUUsage):
* page/Page.h:
* page/Settings.cpp:
(WebCore::Settings::isPostLoadCPUUsageMeasurementEnabled):
* page/Settings.h:
* platform/CPUTime.cpp: Added.
(WebCore::getCPUTime):
(WebCore::CPUTime::percentageCPUUsageSince):
* platform/CPUTime.h: Added.
* platform/cocoa/CPUTimeCocoa.mm: Added.
(WebCore::timeValueToMicroseconds):
(WebCore::getCPUTime):
2017-01-13 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r210677.
https://bugs.webkit.org/show_bug.cgi?id=167007
Caused many layout test timeouts on GTK+ bots
Reverted changeset:
"Protect MediaPlayer from being destroyed mid-load()"
https://bugs.webkit.org/show_bug.cgi?id=166976
http://trac.webkit.org/changeset/210677
2017-01-13 Konstantin Tokarev <annulen@yandex.ru>
Added preprocessor guard for iOS-specific piece of code in GraphicsContext3DOpenGL
https://bugs.webkit.org/show_bug.cgi?id=167005
Reviewed by Alex Christensen.
Variable "boundFrameBuffer" is used only in iOS-specific code
No new tests needed.
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2017-01-13 Eric Carlson <eric.carlson@apple.com>
REGRESSION (r210621): [mac-wk2] LayoutTest fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html timing out
https://bugs.webkit.org/show_bug.cgi?id=166980
Unreviewed, fix test broken by r210621.
No new tests, updated fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
and results.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
Drive-by fix: null-check parent.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Do nothing if the layer
has changed since the KVO notification.
2017-01-13 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Simplify cookie storage handling
https://bugs.webkit.org/show_bug.cgi?id=166967
Reviewed by Sergio Villar Senin.
We currently have a global cookie storage, and several create() methods in SoupNetworkSession to create sessions
with different cookie jars. This could be simplified by moving the cookie storage handling to
NetworkStorageSession and removing all create() methods from SoupNetworkSession. This patch also removes the
default SoupNetworkSession in favor of using the default NetworkStorageSession.
* platform/network/NetworkStorageSession.h: Add a default cookie storage to be used when the
NetworkStorageSession doesn't have a platform soup session.
* platform/network/soup/CookieJarSoup.cpp: Remove the global cookie storage handling.
(WebCore::setCookiesFromDOM): Use NetworkStorageSession::cookieStorage() instead.
(WebCore::cookiesForSession): Ditto.
(WebCore::cookiesEnabled): Check the policy instead like all other ports do, since now we will always have a
default shared cookie jar.
(WebCore::getRawCookies): Use NetworkStorageSession::cookieStorage() instead.
(WebCore::deleteCookie): Ditto.
(WebCore::addCookie): Ditto.
(WebCore::getHostnamesWithCookies): Ditto.
(WebCore::deleteCookiesForHostnames): Ditto.
(WebCore::deleteAllCookies): Ditto.
* platform/network/soup/CookieJarSoup.h: Removed.
* platform/network/soup/CookieStorageSoup.cpp:
(WebCore::soupCookiesChanged): Use the cookie storage from the NetworkStorageSession::defaultStorageSession().
(WebCore::startObservingCookieChanges): Ditto.
(WebCore::stopObservingCookieChanges): Ditto.
* platform/network/soup/DNSSoup.cpp:
(WebCore::DNSResolveQueue::updateIsUsingProxy): Get the SoupSession from the NetworkStorageSession::defaultStorageSession().
(WebCore::DNSResolveQueue::platformResolve): Ditto.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Create a new SoupNetworkSession without
providing a cookie storage to ensure it creates its own private one.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Ditto.
(WebCore::NetworkStorageSession::soupNetworkSession): Create the SoupNetworkSession on demand passing the global
shared cookie storage.
(WebCore::NetworkStorageSession::cookieStorage): Return the cookie storage from the SoupNetworkSession if we
have one, otherwise create the global shared one and return it.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::sessionFromContext): Get the SoupSession from the NetworkStorageSession::defaultStorageSession().
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Remove all create methods and the unused constructor that
receives a SoupSession. Allow to pass a nullptr SoupCookieJar and create one in such case.
* platform/network/soup/SoupNetworkSession.h:
2017-01-12 Tim Horton <timothy_horton@apple.com>
Keyboard accessory bar can appear on top of full-screen video
https://bugs.webkit.org/show_bug.cgi?id=166902
<rdar://problem/29668223>
Reviewed by Darin Adler.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
Increase the full-screen video window level to one above the keyboard,
to ensure that the video is never obscured by the keyboard or its
accessory views.
2017-01-12 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary includes of Page.h
https://bugs.webkit.org/show_bug.cgi?id=166996
Reviewed by Yusuke Suzuki.
* Modules/plugins/QuickTimePluginReplacement.mm:
* Modules/plugins/YouTubePluginReplacement.cpp:
* Modules/webdatabase/Database.cpp:
* Modules/webdatabase/DatabaseTracker.cpp:
* Modules/webdriver/NavigatorWebDriver.cpp:
* accessibility/AccessibilityNodeObject.cpp:
* dom/Range.cpp:
* dom/ScriptElement.cpp:
* dom/ViewportArguments.cpp:
* html/HTMLBodyElement.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLDocument.cpp:
* html/HTMLFormControlElementWithState.cpp:
* html/HTMLImageElement.cpp:
* html/HTMLLinkElement.cpp:
* html/PluginDocument.cpp:
* inspector/InspectorApplicationCacheAgent.cpp:
* loader/LoadTiming.cpp:
* loader/cache/CachedImage.cpp:
* loader/cache/CachedResource.cpp:
* page/DeviceController.cpp:
* page/TextIndicator.cpp:
* page/efl/DragControllerEfl.cpp:
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/ios/PasteboardIOS.mm:
* platform/ios/ScrollAnimatorIOS.mm:
* platform/ios/WidgetIOS.mm:
* platform/mac/PasteboardMac.mm:
* platform/network/mac/ResourceHandleMac.mm:
* platform/win/MainThreadSharedTimerWin.cpp:
* platform/win/PasteboardWin.cpp:
* platform/win/PlatformScreenWin.cpp:
* platform/win/WidgetWin.cpp:
* rendering/InlineBox.cpp:
* rendering/RenderAttachment.cpp:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderIFrame.cpp:
* rendering/RenderInline.cpp:
* rendering/RenderReplaced.cpp:
* rendering/RenderTextControlSingleLine.cpp:
* rendering/RootInlineBox.cpp:
* rendering/svg/RenderSVGResourceFilter.cpp:
* rendering/svg/SVGRenderingContext.cpp:
* style/StyleScope.cpp:
* svg/SVGDocumentExtensions.cpp:
* svg/graphics/SVGImageCache.cpp:
* xml/XSLTProcessor.cpp:
* xml/parser/XMLDocumentParserLibxml2.cpp:
2017-01-12 Chris Dumez <cdumez@apple.com>
Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=166995
Reviewed by Jer Noble.
Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
as some people are having trouble building without it.
* Configurations/FeatureDefines.xcconfig:
2017-01-12 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210680.
This change caused LayoutTest timeouts and assertion failures.
Reverted changeset:
"Use GenericEventQueue rather than callOnMainThread to
schedule events in AudioScheduledSourceNode."
https://bugs.webkit.org/show_bug.cgi?id=166983
http://trac.webkit.org/changeset/210680
2017-01-12 Chris Dumez <cdumez@apple.com>
[iOS] HTML form validation popover sometimes does not go away
https://bugs.webkit.org/show_bug.cgi?id=166990
<rdar://problem/29985957>
Reviewed by Tim Horton.
The issue was that [UIViewController presentViewController:] is asynchronous
and that we sometimes tried to call [m_popoverController dismissViewControllerAnimated:]
before presentViewController had completed. This is something that UIKit does
not handle nicely and the popover just stays visible even though we have
asked for the controller to be dismissed and destroyed the ValidationBubble
object.
To address the issue, I made ValidationBubble RefCounted and make sure the
ValidationBubble object stays alive at least until the completion handler for
[UIViewController presentViewController:] has been called. This is done via
protecting the object using a RefPtr<> and capturing it in the lambda.
Because dismissViewControllerAnimated is called in the destructor, it is no
longer possible to call dismissViewControllerAnimated before the call to
presentViewController has completed.
No new tests, no easily testable since the popover was staying visible
after being destroyed (held on by UIKit).
* platform/ValidationBubble.h:
(WebCore::ValidationBubble::create):
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show):
2017-01-12 Andreas Kling <akling@apple.com>
[iOS] Purge GraphicsServices font cache on memory warning.
<https://webkit.org/b/154343>
Reviewed by Antti Koivisto.
The GS font cache was retaining CSS fonts after we stopped using them.
Call SPI to release them on memory pressure. This is one of multiple
steps necessary to actually free the fonts.
* Configurations/WebCore.xcconfig:
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
* platform/spi/ios/GraphicsServicesSPI.h:
2017-01-12 Chris Dumez <cdumez@apple.com>
Unreviewed EFL/GTK build fix after r210684.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2017-01-12 Brady Eidson <beidson@apple.com>
REGRESSION (r209977): Crash in UniqueIDBDatabase::executeNextDatabaseTask.
https://bugs.webkit.org/show_bug.cgi?id=166984
Reviewed by Alex Christensen.
No new tests (Unable to reproduce, speculative fix).
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): If we're not already prefetching for this cursor,
starting doing so after holding a protector ref.
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): If we're now done prefetching for this cursor,
schedule the protector ref to be destroyed on the main thread.
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2017-01-12 Youenn Fablet <youenn@apple.com>
Make ApplicationCacheHost::maybeLoadSynchronously more robust
https://bugs.webkit.org/show_bug.cgi?id=165192
Reviewed by Alex Christensen.
No change of behavior.
Currently, in case out parameter "data" is not null and shouldLoadResourceFromApplicationCache returns false and resource is null, we might dereference a null pointer when calling maybeLoadSynchronously.
We refactor the code to ensure that this case cannot happen anymore.
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::bufferFromResource):
(WebCore::ApplicationCacheHost::maybeLoadSynchronously):
2017-01-12 Alex Christensen <achristensen@webkit.org>
Update style of ResourceHandleInternal
https://bugs.webkit.org/show_bug.cgi?id=166952
Reviewed by Andreas Kling.
No change in behavior. Just un-indent and use initializer lists.
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
(WebCore::ResourceHandleInternal::client):
2017-01-12 Jer Noble <jer.noble@apple.com>
Use GenericEventQueue rather than callOnMainThread to schedule events in AudioScheduledSourceNode.
https://bugs.webkit.org/show_bug.cgi?id=166983
Reviewed by Brent Fulgham.
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
(WebCore::AudioScheduledSourceNode::finish):
* Modules/webaudio/AudioScheduledSourceNode.h:
2017-01-12 Youenn Fablet <youenn@apple.com>
OneDrive application crashes upon launch
https://bugs.webkit.org/show_bug.cgi?id=166975
Reviewed by Brady Eidson.
Checking whether load is terminated just after calling ResourceLoader::willSendRequestInternal.
The reason is that delegate call may actually cancel the load at that point.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
2017-01-12 Jer Noble <jer.noble@apple.com>
Protect MediaPlayer from being destroyed mid-load()
https://bugs.webkit.org/show_bug.cgi?id=166976
Reviewed by Eric Carlson.
It's possible for a message sent by MediaPlayer to HTMLMediaElement to cause
MediaPlayer to be destroyed before MediaPlayer::load() completes. We have
previously protected against this same problem in HTMLMediaElement::loadResource()
by ref'ing at the beginning of the function and deref'ing on exit. To do the
same in MediaPlayer, it must become RefCounted.
To keep the same semantics about m_client in MediaPlayer (always available without
requiring a null-check), make a new static MediaPlayerClient object which can
replace the real (HTMLMediaElement) client when the MediaPlayer is invalidated.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::createMediaPlayer):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::nullMediaPlayerClient):
(WebCore::MediaPlayer::create):
(WebCore::MediaPlayer::MediaPlayer):
(WebCore::MediaPlayer::invalidate):
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::inMediaDocument):
(WebCore::MediaPlayer::fullscreenMode):
(WebCore::MediaPlayer::requestedRate):
(WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
(WebCore::MediaPlayer::networkStateChanged):
(WebCore::MediaPlayer::readyStateChanged):
(WebCore::MediaPlayer::volumeChanged):
(WebCore::MediaPlayer::muteChanged):
(WebCore::MediaPlayer::timeChanged):
(WebCore::MediaPlayer::sizeChanged):
(WebCore::MediaPlayer::repaint):
(WebCore::MediaPlayer::durationChanged):
(WebCore::MediaPlayer::rateChanged):
(WebCore::MediaPlayer::playbackStateChanged):
(WebCore::MediaPlayer::firstVideoFrameAvailable):
(WebCore::MediaPlayer::characteristicChanged):
(WebCore::MediaPlayer::cachedKeyForKeyId):
(WebCore::MediaPlayer::keyNeeded):
(WebCore::MediaPlayer::mediaKeysStorageDirectory):
(WebCore::MediaPlayer::referrer):
(WebCore::MediaPlayer::userAgent):
(WebCore::MediaPlayer::graphicsDeviceAdapter):
(WebCore::MediaPlayer::cachedResourceLoader):
(WebCore::MediaPlayer::createResourceLoader):
(WebCore::MediaPlayer::addAudioTrack):
(WebCore::MediaPlayer::removeAudioTrack):
(WebCore::MediaPlayer::addTextTrack):
(WebCore::MediaPlayer::removeTextTrack):
(WebCore::MediaPlayer::addVideoTrack):
(WebCore::MediaPlayer::removeVideoTrack):
(WebCore::MediaPlayer::outOfBandTrackSources):
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
(WebCore::MediaPlayer::handlePlaybackCommand):
(WebCore::MediaPlayer::sourceApplicationIdentifier):
(WebCore::MediaPlayer::preferredAudioCharacteristics):
(WebCore::MediaPlayer::doesHaveAttribute):
(WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
(WebCore::MediaPlayer::getRawCookies):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::platformVolumeConfigurationRequired):
(WebCore::MediaPlayer::client):
2017-01-12 Sam Weinig <sam@webkit.org>
Update bindings test results.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):
(WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
(WebCore::JSTestEventTarget::getOwnPropertyNames):
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::put):
(WebCore::JSTestInterface::putByIndex):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::getOwnPropertySlot):
(WebCore::JSTestObj::getOwnPropertySlotByIndex):
(WebCore::JSTestObj::getOwnPropertyNames):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
(WebCore::JSTestOverrideBuiltins::getOwnPropertySlotByIndex):
(WebCore::JSTestOverrideBuiltins::getOwnPropertyNames):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2017-01-12 Zan Dobersek <zdobersek@igalia.com>
[GTK] WebKitWebProcess at 100% CPU loading hyphenation dictionaries
https://bugs.webkit.org/show_bug.cgi?id=165601
Reviewed by Carlos Garcia Campos.
In HyphenationLibHyphen, retrieve the canonicalized absolute pathname of the dictionary file
in order to avoid storing symbolic links as the target files for specific locales. libhyphen
distributes its dictionary files by linking a set of similar locales files to a single file.
Not resolving those symbolic links means we'll be opening a single file via multiple
HyphenationDictionary objects, which is far from optimal.
To add insult to injury, these HyphenationDictionary objects were stored in a TinyLRUCache
with a slim capacity of 4. This meant that while already loading one single file through
multiple symlinks, because of continuous eviciton from this LRU cache the same symlinks
continued to be processed, in some cases resulting in opening the same dictionary file
hundreds or thousands of times. The capacity of this TinyLRUCache is increased to 32
to keep the amount of open libhyphen dictionaries capped at some reasonable number.
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanDirectoryForDicionaries):
2017-01-12 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Make the grid sizing data persistent through layouts
https://bugs.webkit.org/show_bug.cgi?id=166883
Reviewed by Darin Adler and Manuel Rego Casasnovas.
We want to keep the grid sizing data structures through different
layouts. This will allow to optimize some operations, reusing
these data while still valid. Additionally, operations like
determining the baseline position when the grid container is under
an inline formatting context need these data once the grid has
been laid out.
This patch controls the sizing data validity and make the data
structures persistent after layout.
Tests: fast/css-grid-layout/grid-add-item-with-positioned-items.html
fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item.html
fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html
fast/css-grid-layout/grid-item-change-order-auto-flow.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange): Evaluate if the style change made the grid data invalid.
(WebCore::RenderBox::updateGridPositionAfterStyleChange): Evaluate if the style change made the grid data invalid.
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::setNeedsItemsPlacement): The grid must execute the items placement logic before continue processing the layout.
(WebCore::RenderGrid::addChild): Mark the grid data as dirty.
(WebCore::RenderGrid::removeChild): Mark the grid data as dirty.
(WebCore::RenderGrid::styleDidChange): Evaluate grid data validity.
(WebCore::RenderGrid::explicitGridDidResize): Mark the grid data as dirty.
(WebCore::RenderGrid::namedGridLinesDefinitionDidChange): Mark the grid data as dirty.
(WebCore::RenderGrid::layoutBlock): We don't need to clear the grid data anymore.
(WebCore::RenderGrid::dirtyGrid): Clearing the grid data and mark is as needing to execute the items placement logic.
(WebCore::RenderGrid::trackSizesForComputedStyle): Assert we don't need to perform the items placement logic.
(WebCore::RenderGrid::paintChildren): Assert we don't need to perform the items placement logic.
* rendering/RenderGrid.h:
(WebCore::RenderGrid::clear): Deleted.
2017-01-12 Chris Dumez <cdumez@apple.com>
[iOS] Implement support for KeyboardEvent.code
https://bugs.webkit.org/show_bug.cgi?id=166932
<rdar://problem/29972518>
Reviewed by Darin Adler.
Implement support for KeyboardEvent.code on iOS.
No new tests, updated existing test.
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::codeForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2017-01-12 Sam Weinig <sam@webkit.org>
[WebIDL] Autogenerate named getters
https://bugs.webkit.org/show_bug.cgi?id=166835
Reviewed by Alex Christensen.
* Modules/mediastream/RTCStatsResponse.idl:
Update type to be nullable, since generator expects that for now.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCustomSQLStatementErrorCallback.cpp: Removed.
* bindings/js/JSDOMMimeTypeArrayCustom.cpp: Removed.
* bindings/js/JSDOMNamedFlowCollectionCustom.cpp: Removed.
* bindings/js/JSDOMPluginArrayCustom.cpp: Removed.
* bindings/js/JSDOMPluginCustom.cpp: Removed.
* bindings/js/JSNamedNodeMapCustom.cpp: Removed.
* bindings/js/JSRTCStatsResponseCustom.cpp: Removed.
* bindings/js/JSStyleSheetListCustom.cpp: Removed.
Remove deleted files.
* bindings/js/JSSQLStatementErrorCallbackCustom.cpp:
Renamed from Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp for consistency.
* bindings/IDLTypes.h:
(WebCore::IDLNullable::nullValue):
(WebCore::IDLNullable::isNullValue):
(WebCore::IDLNullable::extractValueFromNullable):
Add Nullable traits for IDLNullable, that call down to the underlying type. This allows
us to more easily tests for nullability without stripping the IDLNullable off.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate): Deleted.
(WebCore::JSDOMStringMap::getOwnPropertyNames): Deleted.
Remove overriden getOwnPropertySlot and getOwnPropertyNames.
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::nameGetter): Deleted.
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::nameGetter): Deleted.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::nameGetter): Deleted.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Deleted.
Remove custom name getters.
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setItem):
(WebCore::HTMLSelectElement::setLength):
(WebCore::HTMLSelectElement::setOption): Deleted.
* html/HTMLSelectElement.h:
Add implementation of HTMLSelectElement::setItem() that does properly
removes if the option is null. Re-implement selectElementIndexSetter to
use it and switch conversion code to use JSDOMConvert.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateIndexedGetter):
(GenerateNamedGetter):
Extract typed getter generation into their own functions.
(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertySlotBodyByIndex):
Extract getOwnPropertySlotBody / getOwnPropertySlotBodyByIndex generation
into their own functions. Add support for generating name getters.
(GenerateGetOwnPropertyNames):
Extract getOwnPropertyNames generation into its own function, adding support
for respecting the LegacyUnenumerableNamedProperties attribute and switching
the default to not include named properties in the enumerated names.
(GeneratePut):
(GeneratePutByIndex):
Extract put / putByIndex generators into their own functions in preparation
of supporting namedSetters in the future.
(GetIndexedSetterFunction):
(GetNamedSetterFunction):
(GetNamedDeleterFunction):
Add helper getter functions to extract named/index setter/deleters.
(InstanceOverridesPut):
Add helper predicate to determine if an interface needs an implementation
of put.
(GenerateHeader):
Place custom helper functions (e.g. nameGetter/putDelegate/etc.) together
in the generated header.
(GenerateImplementation):
(GenerateCallbackImplementationContent):
Replace inline generation with calls to the new helper generator functions.
(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(NativeToJSValue):
Remove unused inFunctionCall parameter, and add new suppressExceptionCheck
parameter, which is used for nameGetters.
* bindings/scripts/IDLAttributes.txt:
Add LegacyUnenumerableNamedProperties.
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::namedItem):
(WebCore::StyleSheetList::getNamedItem): Deleted.
* css/StyleSheetList.h:
* css/StyleSheetList.idl:
Rename getNamedItem to namedItem, and make it return a CSSStyleSheet*
which is what the bindings specify.
* dom/DOMNamedFlowCollection.idl:
Add LegacyUnenumerableNamedProperties to match existing behavior.
* dom/DOMStringMap.h:
Switch from typedef to type alias.
* dom/DOMStringMap.idl:
Remove CustomEnumerateProperty and JSCustomGetOwnPropertySlotAndDescriptor
and add the getter. Also add the missing setter and deleter commented out.
* dom/DatasetDOMStringMap.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::supportedPropertyNames):
(WebCore::DatasetDOMStringMap::names): Deleted.
Rename names to supportedPropertyNames to support the bindings.
(WebCore::DatasetDOMStringMap::item):
(WebCore::DatasetDOMStringMap::namedItem):
Add namedItems (to support the bindings), and rework item to return
an optional rather than using a bool out parameter.
* dom/NamedNodeMap.idl:
Add LegacyUnenumerableNamedProperties matching the spec.
* html/HTMLAllCollection.idl:
Add CustomNamedGetter and LegacyUnenumerableNamedProperties. Update signatures
to match the spec. Commenting out ones not implemented yet.
* html/HTMLCollection.idl:
Add LegacyUnenumerableNamedProperties matching the spec.
* html/HTMLFormControlsCollection.idl:
Add CustomNamedGetter. Update signature of the getter to match the spec.
The reason this can't be generated yet is that we don't have a good strategy
for functions with differing return types that shadow each other.
* html/HTMLFormElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::namedItem):
(WebCore::HTMLFormElement::supportedPropertyNames):
Add implementation of namedItem and stub of supportedPropertyNames.
* html/HTMLFormElement.idl:
Add LegacyUnenumerableNamedProperties and remove CustomNamedGetter. Update
the signatures to match the spec.
* page/DOMWindow.idl:
Add LegacyUnenumerableNamedProperties matching the spec.
* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPlugin.idl:
* plugins/DOMPluginArray.idl:
Add LegacyUnenumerableNamedProperties and add nullability to return types.
2017-01-12 Said Abou-Hallawa <sabouhallawa@apple.com>
[iOS][WK1] Fix initialization of CADisplayLink::preferredFramesPerSecond
https://bugs.webkit.org/show_bug.cgi?id=166956
Reviewed by Tim Horton.
Set this option to 60fps instead of leaving set to the default.
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
(-[WebDisplayLinkHandler initWithMonitor:]):
2017-01-12 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, build fix for macOS ports
https://bugs.webkit.org/show_bug.cgi?id=166925
* WebCore.xcodeproj/project.pbxproj:
2017-01-12 Yusuke Suzuki <utatane.tea@gmail.com>
Implement InlineClassicScript
https://bugs.webkit.org/show_bug.cgi?id=166925
Reviewed by Ryosuke Niwa.
As of r210585, ScriptFetcher functionality is decoupled from ScriptElement.
This patch is a further cleanup. We introduce InlineClassicScript, which is
similar to LoadableClassicScript / LoadableModuleScript. And we move ScriptFetcher
functionality from LoadableScript to CachedScriptFetcher, which is the base
class of InlineClassicScript and LoadableScript.
And we start setting this CachedScriptFetcher to the member of JSC::SourceOrigin.
This allows us to examine the ScriptFetcher from the SourceOrigin.
When dynamic-import operator is called, we need to get the ScriptFetcher from the
caller script SourceOrigin since the subsequent module loading needs to know the
metadata about fetching and ScriptFetcher delivers it.
No behavior change.
* CMakeLists.txt:
* bindings/js/CachedModuleScript.cpp:
(WebCore::CachedModuleScript::load):
* bindings/js/CachedModuleScript.h:
* bindings/js/CachedModuleScriptLoader.cpp:
(WebCore::CachedModuleScriptLoader::create):
(WebCore::CachedModuleScriptLoader::CachedModuleScriptLoader):
(WebCore::CachedModuleScriptLoader::load):
* bindings/js/CachedModuleScriptLoader.h:
* bindings/js/CachedScriptFetcher.cpp: Copied from Source/WebCore/dom/LoadableScript.cpp.
(WebCore::CachedScriptFetcher::requestScriptWithCache):
* bindings/js/CachedScriptFetcher.h: Copied from Source/JavaScriptCore/runtime/SourceOrigin.h.
(WebCore::CachedScriptFetcher::CachedScriptFetcher):
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::create):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
(WebCore::makeSource): Deleted.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::loadModuleScript):
* bindings/js/ScriptController.h:
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
(WebCore::ScriptSourceCode::m_url):
* dom/InlineClassicScript.cpp: Added.
(WebCore::InlineClassicScript::create):
* dom/InlineClassicScript.h: Added.
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::execute):
* dom/LoadableScript.cpp:
(WebCore::LoadableScript::requestScriptWithCache): Deleted.
* dom/LoadableScript.h:
(WebCore::LoadableScript::LoadableScript):
(): Deleted.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executePendingScript):
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::runScript):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::endElementNs):
2017-01-11 Eric Carlson <eric.carlson@apple.com>
[MediaStream, Mac] Render media stream audio buffers
https://bugs.webkit.org/show_bug.cgi?id=159836
<rdar://problem/27380390>
Reviewed by Jer Noble.
No new tests, it isn't possible to test audio rendering directly. A follow-up patch will
add a mock audio source that will enable audio testing.
* platform/cf/CoreMediaSoftLink.cpp: Include new functions used.
* platform/cf/CoreMediaSoftLink.h:
* WebCore.xcodeproj/project.pbxproj: Remove references to the deleted previews.
* platform/Logging.h: Add MediaCaptureSamples.
* platform/MediaSample.h: Add outputPresentationTime and outputDuration.
* platform/cf/CoreMediaSoftLink.cpp: Add CMSampleBufferGetOutputDuration, CMSampleBufferGetOutputPresentationTimeStamp,
CMTimeConvertScale, CMTimebaseGetEffectiveRate, CMAudioSampleBufferCreateWithPacketDescriptions,
CMSampleBufferSetDataBufferFromAudioBufferList, CMSampleBufferSetDataReady,
CMAudioFormatDescriptionCreate, CMClockGetHostTimeClock, and CMClockGetTime.
* platform/cf/CoreMediaSoftLink.h:
Create and use an AVSampleBufferAudioRenderer each audio stream track, when it is available,
to render for audio samples. Store the offset between the first sample received from a track's
output presentation and the synchronizer time so we can adjust sample timestamps to be
relative to the synchronizer's timeline regardless of their source. Remove the use of source
previews because not all sources will have them.
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
Add an ObjC helper to catch renderer status changes.
(-[WebAVSampleBufferStatusChangeListener initWithParent:]):
(-[WebAVSampleBufferStatusChangeListener dealloc]):
(-[WebAVSampleBufferStatusChangeListener invalidate]):
(-[WebAVSampleBufferStatusChangeListener beginObservingLayer:]):
(-[WebAVSampleBufferStatusChangeListener stopObservingLayer:]):
(-[WebAVSampleBufferStatusChangeListener beginObservingRenderer:]):
(-[WebAVSampleBufferStatusChangeListener stopObservingRenderer:]):
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeOldSamplesFromPendingQueue):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::addSampleToPendingQueue):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForAudioData):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createAudioRenderer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyAudioRenderer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyAudioRenderers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSourceProvider):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rendererStatusDidChange):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForMediaData): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::internalSetVolume): Deleted.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::outputPresentationTime): New.
(WebCore::MediaSampleAVFObjC::outputDuration): New.
(WebCore::MediaSampleAVFObjC::dump): Log outputPresentationTime.
* platform/mediastream/AudioTrackPrivateMediaStream.h: Add timelineOffset.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setEnabled): No more m_preview.
(WebCore::MediaStreamTrackPrivate::endTrack): Ditto.
(WebCore::MediaStreamTrackPrivate::preview): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::preview): Deleted.
* platform/mediastream/RealtimeMediaSourcePreview.h: Removed.
* platform/mediastream/VideoTrackPrivateMediaStream.h: Add timelineOffset.
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::updateSettings):
(WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Pass the
sample buffer up the chain.
(WebCore::AVAudioSourcePreview::create): Deleted.
(WebCore::AVAudioSourcePreview::AVAudioSourcePreview): Deleted.
(WebCore::AVAudioSourcePreview::invalidate): Deleted.
(WebCore::AVAudioSourcePreview::play): Deleted.
(WebCore::AVAudioSourcePreview::pause): Deleted.
(WebCore::AVAudioSourcePreview::setEnabled): Deleted.
(WebCore::AVAudioSourcePreview::setVolume): Deleted.
(WebCore::AVAudioSourcePreview::updateState): Deleted.
(WebCore::AVAudioCaptureSource::createPreview): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaSourcePreview): Deleted.
(WebCore::AVMediaCaptureSource::createWeakPtr): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource): No more preview.
(WebCore::AVMediaCaptureSource::reset):
(WebCore::AVMediaCaptureSource::preview): Deleted.
(WebCore::AVMediaCaptureSource::removePreview): Deleted.
(WebCore::AVMediaSourcePreview::AVMediaSourcePreview): Deleted.
(WebCore::AVMediaSourcePreview::~AVMediaSourcePreview): Deleted.
(WebCore::AVMediaSourcePreview::invalidate): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Don't set the "display immediately" attachment.
(WebCore::AVVideoSourcePreview::create): Deleted.
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview): Deleted.
(WebCore::AVVideoSourcePreview::backgroundLayerBoundsChanged): Deleted.
(WebCore::AVVideoSourcePreview::invalidate): Deleted.
(WebCore::AVVideoSourcePreview::play): Deleted.
(WebCore::AVVideoSourcePreview::pause): Deleted.
(WebCore::AVVideoSourcePreview::setPaused): Deleted.
(WebCore::AVVideoSourcePreview::setEnabled): Deleted.
(WebCore::AVVideoCaptureSource::createPreview): Deleted.
(-[WebCoreAVVideoCaptureSourceObserver setParent:]): Deleted.
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): Deleted.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Use a more typical video
time scale. Set the sample decode time.
(WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage): Use a static for colorspace
instead of fetching it for every frame.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp: Add outputPresentationTime and outputDuration.
2017-01-11 Youenn Fablet <youenn@apple.com>
Remove request.formData property until it gets implemented
https://bugs.webkit.org/show_bug.cgi?id=166920
<rdar://problem/29971105>
Reviewed by Chris Dumez.
Covered by rebased tests.
* Modules/fetch/FetchBody.idl:
2017-01-11 Ryan Haddad <ryanhaddad@apple.com>
Reverting r210598, r210597, and r210591 to fix the iOS simulator build.
https://bugs.webkit.org/show_bug.cgi?id=166672
Unreviewed build fix.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontIsSystemFont): Deleted.
2017-01-11 Andreas Kling <akling@apple.com>
Crash when WebCore's GC heap grows way too large.
<https://webkit.org/b/166875>
<rdar://problem/27896585>
Reviewed by Mark Lam.
Cap the common WebCore VM at 4 GB of live JavaScript heap objects.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
2017-01-11 Nan Wang <n_wang@apple.com>
AX: role=treeitem accessible name not spoken to VoiceOver macOS when using string contained inside element
https://bugs.webkit.org/show_bug.cgi?id=164950
<rdar://problem/29337573>
Reviewed by Chris Fleizach.
From the spec: https://www.w3.org/TR/wai-aria-practices/#TreeView
The element with role treeitem missing a label is labeled by its child elements.
Test: accessibility/mac/aria-tree-item-name.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeText):
2017-01-11 Brent Fulgham <bfulgham@apple.com>
[GTK] Unreviewed build fix after r210600.
* platform/glib/FileSystemGlib.cpp:
(WebCore::getFileDeviceId): Attempting to use proper API here.
2017-01-11 Brent Fulgham <bfulgham@apple.com>
[GTK] Unreviewed build fix after r210599.
* platform/glib/FileSystemGlib.cpp:
(WebCore::getFileDeviceId): Revise for new signature.
2017-01-11 Myles C. Maxfield <mmaxfield@apple.com>
ASSERTION FAILED: run->m_stop > 0 in *WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment
https://bugs.webkit.org/show_bug.cgi?id=166030
Reviewed by Ryosuke Niwa.
Ordinarily, we don't process empty BiDi runs (because we filter them out).
However, when using isolates, we invoke extra machinery to create a
placeholder BiDi run, and replace it with the runs for the isolate. The
isolate's runs, though, can be empty, and rather than just deleting the
placeholder run, we will keep it around so that the m_logicallyLastRun is
still valid. This means that it is possible when all is said and done to
have empty runs, and computeInlineDirectionPositionsForSegment() needs to
not ASSERT() in this case.
Test: fast/text/bidi-isolate-empty-run.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2017-01-11 Brent Fulgham <bfulgham@apple.com>
File scheme should not allow access of a resource on a different volume.
https://bugs.webkit.org/show_bug.cgi?id=158552
<rdar://problem/15307582>
Reviewed by Alex Christensen.
Revise SecurityOrigin to prevent files from one storage device (volume) from accessing content
on a different storage device (volume) unless universal access is enabled.
Pass the current file device as part of the NSURLRequest so that CFNetwork can reject loads
where the device changes in the midst of a load.
Also properly reflect that SecurityOrigin is never null by passing as a reference,
rather than as a pointer.
Tests: Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccess): Pass argument as reference.
(WebCore::SecurityOrigin::canDisplay): Add check that files share the same volume.
(WebCore::SecurityOrigin::isSameSchemeHostPort): Pass argument as reference.
* page/SecurityOrigin.h:
* platform/FileSystem.cpp:
(WebCore::filesHaveSameVolume): Added.
* platform/FileSystem.h:
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): If loading a file URL, tell CFNetwork
the storage device at the time of the start of the load so we can trigger a failure if this
changes during the load operation.
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::getFileDeviceId): Added.
* platform/win/FileSystemWin.cpp:
(WebCore::getFileDeviceId): Added.
2017-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Testing fix after r210597
https://bugs.webkit.org/show_bug.cgi?id=166672
Unreviewed.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
2017-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Testing fix after r210591
https://bugs.webkit.org/show_bug.cgi?id=166672
Unreviewed.
Fixes fast/text/trak-optimizeLegibility.html and
fast/text/system-font-features.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontIsSystemFont):
(WebCore::preparePlatformFont):
2017-01-11 Chris Dumez <cdumez@apple.com>
Iterating over URLSearchParams does not work
https://bugs.webkit.org/show_bug.cgi?id=166921
<rdar://problem/29970907>
Reviewed by Alex Christensen.
Make URLSearchParams iterable, as per:
- https://url.spec.whatwg.org/#urlsearchparams
Test: fast/dom/DOMURL/searchparams-iterable.html
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::Iterator::next):
(WebCore::URLSearchParams::Iterator::Iterator):
* html/URLSearchParams.h:
(WebCore::URLSearchParams::createIterator):
* html/URLSearchParams.idl:
2017-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Variation fonts without variations specified are not rendered as if the default variations were specified
https://bugs.webkit.org/show_bug.cgi?id=166672
<rdar://problem/29779119>
<rdar://problem/29848883>
Reviewed by Simon Fraser.
CoreText has a bug (<rdar://problem/29859207>) where variation fonts without
a specified variation value are rendered as if the minimum value is specified,
rather than the default value. The solution is to apply default values where
they are omitted.
Test: fast/text/variations/advances.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
2017-01-11 Ryan Haddad <ryanhaddad@apple.com>
Attempt to fix the Windows build after r210588.
Unreviewed build fix.
* bindings/js/JSBindingsAllInOne.cpp:
2017-01-11 Sam Weinig <sam@webkit.org>
Address some feedback from r210567.
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Fix typo. robost -> robust.
2017-01-10 Sam Weinig <sam@webkit.org>
Rename JSCustomSQLStatementErrorCallback.cpp to JSSQLStatementErrorCallbackCustom.cpp
https://bugs.webkit.org/show_bug.cgi?id=166913
Reviewed by Alex Christensen.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCustomSQLStatementErrorCallback.cpp: Removed.
* bindings/js/JSSQLStatementErrorCallbackCustom.cpp: Copied from Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp.
Rename to match conventions.
2017-01-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210571.
This change broke the 32-bit macOS build and caused LayoutTest
failures.
Reverted changeset:
"File scheme should not allow access of a resource on a
different volume."
https://bugs.webkit.org/show_bug.cgi?id=158552
http://trac.webkit.org/changeset/210571
2017-01-11 Yusuke Suzuki <utatane.tea@gmail.com>
Decouple module loading initiator from ScriptElement
https://bugs.webkit.org/show_bug.cgi?id=166888
Reviewed by Saam Barati and Ryosuke Niwa.
Previously, we use ScriptElement (JSElement for ScriptElement) as the module loading initiator.
This element is used to transfer the metadata like charset throughout the module pipeline.
As a result, our module loader in the browser side is tightly coupled with ScriptElement.
It is not good since it prevent us from using the module loader in the non-DOM environment like
Web Workers.
So we decouple the necessary informations from ScriptElement. We move these information to
LoadableScript. And we use JSScriptFetcher to transfer LoadableScript through the JS implemented
module loader pipeline. We select LoadableScript instead of LoadableModuleScript since this initiator
information will be leveraged even in classic scripts once we implement the dynamic import.
No behavior change.
* ForwardingHeaders/runtime/JSScriptFetcher.h: Copied from Source/WebCore/dom/LoadableScript.cpp.
* ForwardingHeaders/runtime/ScriptFetcher.h: Copied from Source/WebCore/dom/LoadableScript.cpp.
* bindings/js/CachedModuleScript.cpp:
(WebCore::CachedModuleScript::create):
(WebCore::CachedModuleScript::load):
(WebCore::CachedModuleScript::CachedModuleScript): Deleted.
* bindings/js/CachedModuleScript.h:
Now we can merge CachedModuleScript to LoadableScript. But we do not do this in this patch since
we focus on decoupling the initiator information from ScriptElement.
(WebCore::CachedModuleScript::nonce): Deleted.
(WebCore::CachedModuleScript::crossOriginMode): Deleted.
* bindings/js/CachedModuleScriptLoader.cpp:
(WebCore::CachedModuleScriptLoader::load):
* bindings/js/CachedModuleScriptLoader.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderResolve):
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::loadModule):
(WebCore::JSMainThreadExecState::linkAndEvaluateModule):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::loadModuleScript):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScript):
* bindings/js/ScriptController.h:
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
* bindings/js/ScriptModuleLoader.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::~LoadableClassicScript):
(WebCore::LoadableClassicScript::isLoaded):
(WebCore::LoadableClassicScript::error):
(WebCore::LoadableClassicScript::wasCanceled):
(WebCore::LoadableClassicScript::notifyFinished):
(WebCore::LoadableClassicScript::load):
* dom/LoadableClassicScript.h:
* dom/LoadableModuleScript.cpp:
(WebCore::LoadableModuleScript::create):
(WebCore::LoadableModuleScript::LoadableModuleScript):
(WebCore::LoadableModuleScript::load):
* dom/LoadableModuleScript.h:
* dom/LoadableScript.cpp:
(WebCore::LoadableScript::requestScriptWithCache):
* dom/LoadableScript.h:
(WebCore::LoadableScript::LoadableScript):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestClassicScript):
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executeModuleScript):
(WebCore::ScriptElement::requestScriptWithCacheForModuleScript): Deleted.
(WebCore::ScriptElement::requestScriptWithCache): Deleted.
* dom/ScriptElement.h:
2017-01-11 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] Use smart pointers and modernize code in WebKitWebAudioSourceGStreamer
https://bugs.webkit.org/show_bug.cgi?id=166886
Reviewed by Xabier Rodriguez-Calvar.
This patch doesn't change the behavior, so it's covered by existing Web Audio tests. It replaces pointers with
smart pointers, uses WTF::Vector instead of GSList and simplifies the code to map/unmap GstBuffers.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcConstructed):
(webKitWebAudioSrcFinalize):
(webKitWebAudioSrcLoop):
(webKitWebAudioSrcChangeState):
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::derefGPtr<GstBufferList>):
(WTF::adoptGRef):
(WTF::refGPtr<GstBufferPool>):
(WTF::derefGPtr<GstBufferPool>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::mapGstBuffer):
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(StreamingClient::createReadBuffer):
2017-01-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r182947.
https://bugs.webkit.org/show_bug.cgi?id=166922
Caused huge memory leak see https://webkit.org/b/166884
(Requested by KaL on #webkit).
Reverted changeset:
"[GStreamer] Silent WebAudio buffers support"
https://bugs.webkit.org/show_bug.cgi?id=143869
http://trac.webkit.org/changeset/182947
2017-01-11 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed, rolling out r210579.
That was not the right fix
Reverted changeset:
"Unreviewed GTK buildfix after r210571."
http://trac.webkit.org/changeset/210579
2017-01-11 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build after r210571.
Add getFileDeviceId implementation to FileSystemGlib.cpp.
* platform/glib/FileSystemGlib.cpp:
(WebCore::getFileDeviceId):
2017-01-11 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed GTK buildfix after r210571.
* PlatformGTK.cmake:
2017-01-10 Yusuke Suzuki <utatane.tea@gmail.com>
Implement JSSourceCode to propagate SourceCode in module pipeline
https://bugs.webkit.org/show_bug.cgi?id=166861
Reviewed by Saam Barati.
Now SourceOrigin is correctly propagated through the module pipeline.
So the error reported by http/tests/security/contentSecurityPolicy/module-eval-blocked-expected.html
is updated.
* ForwardingHeaders/runtime/JSSourceCode.h: Added.
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::resolveWithCallback):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::notifyFinished):
2017-01-10 Brent Fulgham <bfulgham@apple.com>
File scheme should not allow access of a resource on a different volume.
https://bugs.webkit.org/show_bug.cgi?id=158552
<rdar://problem/15307582>
Reviewed by Alex Christensen.
Revise SecurityOrigin to prevent files from one storage device (volume) from accessing content
on a different storage device (volume) unless universal access is enabled.
Pass the current file device as part of the NSURLRequest so that CFNetwork can reject loads
where the device changes in the midst of a load.
Also properly reflect that SecurityOrigin is never null by passing as a reference,
rather than as a pointer.
Tests: Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccess): Pass argument as reference.
(WebCore::SecurityOrigin::passesFileCheck): Add check that file URLs refer to files in
the same storage volume.
(WebCore::SecurityOrigin::canDisplay): Add check that files share the same volume.
(WebCore::SecurityOrigin::isSameSchemeHostPort): Pass argument as reference.
* page/SecurityOrigin.h:
* platform/FileSystem.cpp:
(WebCore::filesHaveSameVolume): Added.
* platform/FileSystem.h:
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): If loading a file URL, tell CFNetwork
the storage device at the time of the start of the load so we can trigger a failure if this
changes during the load operation.
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::getFileDeviceId): Added.
* platform/win/FileSystemWin.cpp:
(WebCore::getFileDeviceId): Added.
2017-01-10 Sam Weinig <sam@webkit.org>
[WebIDL] Remove most of the custom bindings for the WebGL code
https://bugs.webkit.org/show_bug.cgi?id=166834
Reviewed by Alex Christensen.
Removes all but one custom getter (getExtension) from the WebGL code.
* Modules/indexeddb/IDBKeyRange.idl:
Replace use of non-standard type, with new OverrideIDLType extended attribute, allowing us
to stay more consistent with the IDL files spec's provide.
* WebCore.xcodeproj/project.pbxproj:
Move JSWebGL2RenderingContextCustom to the GC/Wrapping only group.
* bindings/IDLTypes.h:
Add IDLWebGLAny, and simplify IDLIDBKey to not be templatized.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLLong>::convert):
(WebCore::Converter<IDLFloat>::convert):
(WebCore::Converter<IDLUnrestrictedFloat>::convert):
(WebCore::Converter<IDLDouble>::convert):
(WebCore::Converter<IDLUnrestrictedDouble>::convert):
Add overloads of convert that convert a double to the numeric type.
(WebCore::Detail::GenericSequenceConverter::convert):
Add optimized specialization for JSArrays that does not use the iterator protocol.
(WebCore::Detail::NumericSequenceConverter::convert):
Add an even more optimized specialization for numeric types, which checks to see
if the array's butterfly has an optimized shape, and extracts the numeric values
from that.
(WebCore::Detail::SequenceConverter::convert):
(WebCore::Detail::SequenceConverter<IDLLong>::convert):
(WebCore::Detail::SequenceConverter<IDLFloat>::convert):
(WebCore::Detail::SequenceConverter<IDLUnrestrictedFloat>::convert):
(WebCore::Detail::SequenceConverter<IDLDouble>::convert):
(WebCore::Detail::SequenceConverter<IDLUnrestrictedDouble>::convert):
Select the right specialization based on type.
(WebCore::Converter<IDLSequence<T>>::convert):
(WebCore::Converter<IDLFrozenArray<T>>::convert):
Rename converter to be more accurate.
(WebCore::JSConverter<IDLWebGLAny>::convert):
Added. Calls through to converter in WebGLAny.h. We should replace this with a
call to the IDLUnion JSConverter when feasible.
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::getInternalformatParameter): Deleted.
(WebCore::JSWebGL2RenderingContext::getQueryParameter): Deleted.
(WebCore::JSWebGL2RenderingContext::getSamplerParameter): Deleted.
(WebCore::JSWebGL2RenderingContext::getSyncParameter): Deleted.
(WebCore::JSWebGL2RenderingContext::getIndexedParameter): Deleted.
(WebCore::JSWebGL2RenderingContext::getActiveUniformBlockParameter): Deleted.
(WebCore::JSWebGL2RenderingContext::getActiveUniformBlockName): Deleted.
Remove unnecessary custom functions.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::objectParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Deleted.
(WebCore::JSWebGLRenderingContextBase::getBufferParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getProgramParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getRenderbufferParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getShaderParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Deleted.
(WebCore::JSWebGLRenderingContextBase::getTexParameter): Deleted.
(WebCore::JSWebGLRenderingContextBase::getUniform): Deleted.
(WebCore::JSWebGLRenderingContextBase::getVertexAttrib): Deleted.
(WebCore::toNumberVector): Deleted.
(WebCore::functionForUniform): Deleted.
(WebCore::dataFunctionf): Deleted.
(WebCore::dataFunctioni): Deleted.
(WebCore::dataFunctionMatrix): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform1fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform1iv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform2fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform2iv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform3fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform3iv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform4fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniform4iv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniformMatrix2fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniformMatrix3fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::uniformMatrix4fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::vertexAttrib1fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::vertexAttrib2fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::vertexAttrib3fv): Deleted.
(WebCore::JSWebGLRenderingContextBase::vertexAttrib4fv): Deleted.
Remove unnecessary custom functions.
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
Remove specialization of IDBKey.
* bindings/scripts/CodeGeneratorJS.pm:
(GetBaseIDLType):
(GetIDLType):
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
(NativeToJSValue):
Allow IDL files to override the type of signature using a new OverrideIDLType
extended attribute. Currently this only works conversion to JS, but could be
extended to support more.
* bindings/scripts/IDLAttributes.txt:
Add OverrideIDLType.
* html/canvas/WebGL2RenderingContext.idl:
Add OverrideIDLType=IDLWebGLAny annotations to remove the need for custom functions.
* html/canvas/WebGLAny.cpp:
(WebCore::convertToJSValue):
(WebCore::toJS): Deleted.
* html/canvas/WebGLAny.h:
Rename the toJS function to convertToJSValue to avoid a template specialization issue.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
Update signature to match IDL, replacing bool return value plus out parameter with an
optional return value. Modernize the code a bit.
(WebCore::WebGLRenderingContextBase::uniform2f):
(WebCore::WebGLRenderingContextBase::uniform3f):
(WebCore::WebGLRenderingContextBase::uniform4f):
(WebCore::WebGLRenderingContextBase::uniform1i):
(WebCore::WebGLRenderingContextBase::uniform3i):
(WebCore::WebGLRenderingContextBase::uniform4i):
(WebCore::WebGLRenderingContextBase::uniform1fv):
(WebCore::WebGLRenderingContextBase::uniform2fv):
(WebCore::WebGLRenderingContextBase::uniform3fv):
(WebCore::WebGLRenderingContextBase::uniform4fv):
(WebCore::WebGLRenderingContextBase::uniform1iv):
(WebCore::WebGLRenderingContextBase::uniform2iv):
(WebCore::WebGLRenderingContextBase::uniform3iv):
(WebCore::WebGLRenderingContextBase::uniform4iv):
(WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
(WebCore::WebGLRenderingContextBase::vertexAttrib4f):
(WebCore::WebGLRenderingContextBase::vertexAttrib1fv):
(WebCore::WebGLRenderingContextBase::vertexAttrib2fv):
(WebCore::WebGLRenderingContextBase::vertexAttrib3fv):
(WebCore::WebGLRenderingContextBase::vertexAttrib4fv):
(WebCore::WebGLRenderingContextBase::validateUniformParameters):
(WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
(WebCore::WebGLRenderingContextBase::vertexAttribfvImpl):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::TypedList::TypedList):
(WebCore::WebGLRenderingContextBase::TypedList::data):
(WebCore::WebGLRenderingContextBase::TypedList::length):
Re-order/group to match order in the IDL file. Remove overloads taking a pointer and
length, and replace it by having the main function take a specialized TypedList. TypedList
allows the bindings to pass the correct Variant type, but then the code to only think in
terms of the data() and length() functions.
* html/canvas/WebGLRenderingContextBase.idl:
Remove [Custom] annotations and re-order/group to match the spec. Update types of uniform*fv/iv
functions to take typedef'd unions.
2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
:active and :hover states may not be updated across slots
https://bugs.webkit.org/show_bug.cgi?id=166881
<rdar://problem/29944582>
Reviewed by Antti Koivisto.
The bug was caused by updateHoverActiveState not updating :hover and :active states on elements
when nodes are assigned to slots because they were walking up the tree using parentOrShadowHostElement
and parentNode. Fixed the bug by using parentElementInComposedTree instead since :hover and :active
states need to be updated in accordance with the render tree, which is created from the "flat tree"
or the "composed tree" in WebKit's terminology (this is old terminology in the spec).
Tests: fast/shadow-dom/clear-active-state-in-shadow.html
fast/shadow-dom/hover-over-nested-slotted-content.html
* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState): Fixed the bug.
* dom/Node.cpp:
(WebCore::Node::parentElementInComposedTree): Added.
* dom/Node.h:
2017-01-10 Keith Rollin <krollin@apple.com>
Missing logging in IconLoader::startLoading
https://bugs.webkit.org/show_bug.cgi?id=166904
Reviewed by Sam Weinig.
The LOG_ERROR in startLoading references 'resourceRequest', which has
been WTF::Moved as part of a preceding function call. As such, the
logging statement doesn't print out a possibly useful URL. Fix this by
making a copy of the URL before it's affected by the Move.
No new tests -- change only affects logging code.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
2017-01-10 Wenson Hsieh <wenson_hsieh@apple.com>
Implement "proximity" scroll snapping
https://bugs.webkit.org/show_bug.cgi?id=135994
<rdar://problem/18162418>
Reviewed by Dean Jackson.
Adds support for proximity scroll snapping. To do this, we introduce scroll offset ranges, a list of scroll
offset ranges that are plumbed alongside the list of scroll snap offsets. Similar to a snap offset, a snap
offset range contains scroll offsets on which scrolling is allowed to come to a rest within a scroll snapping
container. However, unlike normal snap offsets, scrolling may only come to rest within a snap offset range if
the predicted scroll offset already lies within the range. The new algorithm for selecting a target scroll snap
position given a destination offset is now:
- If the scroll destination lies within a snap offset range, return the scroll destination
- Otherwise, compute the nearest lower/upper snap offsets and lower/upper snap offset ranges
- If scrolling ended with no velocity, return the nearest snap offset
- If scrolling ended with positive velocity, choose the upper snap offset only if there is no snap offset
range in between the scroll destination and the snap offset; else, choose the lower snap offset
- If scrolling ended with negative velocity, choose the lower snap offset only if there is no snap offset
range in between the scroll destination and the snap offset; else, choose the upper snap offset
The extra rule accounting for scroll offset ranges in between the scroll destination and a potential snap offset
handles the corner case where the user scrolls with momentum very lightly away from a snap offset, such that the
predicted scroll destination is still within proximity of the snap offset. In this case, the regular (mandatory
scroll snapping) behavior would be to snap to the next offset in the direction of momentum scrolling, but
instead, it is more intuitive to return to the original snap position.
We also move scrolling prediction logic into ScrollingMomentumCalculator and adopt the platform
_NSScrollingMomentumCalculator's destinationOrigin property when computing the predicted scroll destination.
Previously, we were simply multiplying by an empirically-derived constant to approximate the scroll destination,
but now that we are supporting proximity scroll snapping, we need more exact scroll destinaton prediction in
order to make sure that scrolling to a snap offset range feels natural.
Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-then-proximity.html
tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe.html
tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-overflow.html
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
Make boilerplate changes to plumb lists of horizontal and vertical snap offset ranges alongside the lists of
horizontal and vertical snap offsets.
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::snapOffsetRangesToString):
(WebCore::indicesOfNearestSnapOffsetRanges):
(WebCore::indicesOfNearestSnapOffsets):
(WebCore::adjustAxisSnapOffsetsForScrollExtent):
(WebCore::computeAxisProximitySnapOffsetRanges):
(WebCore::updateSnapOffsetsForScrollableArea):
(WebCore::closestSnapOffset):
Adjust the snap offset selection algorithm to take snap offset ranges into account. See above for more details.
Additionally, augment snap offset update logic to emit snap offset ranges for proximity scroll snapping. To do
this, we run the following steps on the final list of processed snap offsets:
- Compute the proximity distance, which (for now) is arbitrarily 0.3 * the length or width of the scroll snap
port, depending on whether scroll snapping is taking place in the X or Y axis.
- For each pair of adjacent snap offsets, if they are more than 2 * proximity distance away from each other,
emit a snap offset range starting from (lower snap offset + proximity distance) and ending on (upper snap
offset + proximity distance).
* page/scrolling/AxisScrollSnapOffsets.h:
(WebCore::closestSnapOffset): Deleted.
* page/scrolling/ScrollSnapOffsetsInfo.h:
Introduce ScrollSnapOffsetsInfo, a struct which contains data relevant to scroll snapping. This includes
vertical and horizontal snap offsets, as well as vertical and horizontal snap offset ranges. Snap offset ranges
consist of a vector of ranges of scroll offsets.
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingMomentumCalculator.cpp:
(WebCore::projectedInertialScrollDistance):
(WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
(WebCore::ScrollingMomentumCalculator::setRetargetedScrollOffset):
(WebCore::ScrollingMomentumCalculator::predictedDestinationOffset):
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::ScrollingMomentumCalculator::setPlatformMomentumScrollingPredictionEnabled):
(WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
(WebCore::BasicScrollingMomentumCalculator::linearlyInterpolatedOffsetAtProgress):
(WebCore::BasicScrollingMomentumCalculator::initializeInterpolationCoefficientsIfNecessary):
(WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
* page/scrolling/ScrollingMomentumCalculator.h:
(WebCore::ScrollingMomentumCalculator::retargetedScrollOffset):
(WebCore::ScrollingMomentumCalculator::retargetedScrollOffsetDidChange):
Currently, the ScrollingMomentumCalculator is responsible for taking an initial position, initial velocity, and
target position and animating the scroll offset from the initial to target position. Now, we refactor the
ScrollingMomentumCalculator interface to no longer take a target offset upon initialization, and instead compute
the predicted scroll destination given initial position and velocity; clients of the ScrollingMomentumCalculator
then use this predicted scroll destination to compute a retargeted scroll offset and then call
setRetargetedScrollOffset on the calculator, which sets up an animation curve to the new retargeted offset. This
allows both the AppKit-based scrolling momentum calculator and platform-invariant momentum calculator to be used
interchangeably, while still allowing them to compute a destination offset from initial parameters of the
scroll.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setHorizontalSnapOffsets):
(WebCore::ScrollingStateScrollingNode::setVerticalSnapOffsets):
(WebCore::ScrollingStateScrollingNode::setHorizontalSnapOffsetRanges):
(WebCore::ScrollingStateScrollingNode::setVerticalSnapOffsetRanges):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::horizontalSnapOffsets):
(WebCore::ScrollingStateScrollingNode::verticalSnapOffsets):
(WebCore::ScrollingStateScrollingNode::horizontalSnapOffsetRanges):
(WebCore::ScrollingStateScrollingNode::verticalSnapOffsetRanges):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets):
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets):
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges):
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges):
Add more boilerplate support for snap offset ranges.
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::ScrollingMomentumCalculator::setPlatformMomentumScrollingPredictionEnabled):
(WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
(WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
(WebCore::ScrollingMomentumCalculatorMac::predictedDestinationOffset):
(WebCore::ScrollingMomentumCalculatorMac::retargetedScrollOffsetDidChange):
(WebCore::ScrollingMomentumCalculatorMac::animationDuration):
(WebCore::ScrollingMomentumCalculatorMac::requiresMomentumScrolling):
(WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
Hook into AppKit momentum scroll offset prediction.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::convertToLayoutUnits):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ensureSnapOffsetsInfo):
(WebCore::ScrollableArea::horizontalSnapOffsets):
(WebCore::ScrollableArea::horizontalSnapOffsetRanges):
(WebCore::ScrollableArea::verticalSnapOffsetRanges):
(WebCore::ScrollableArea::verticalSnapOffsets):
(WebCore::ScrollableArea::setHorizontalSnapOffsets):
(WebCore::ScrollableArea::setVerticalSnapOffsets):
(WebCore::ScrollableArea::setHorizontalSnapOffsetRanges):
(WebCore::ScrollableArea::setVerticalSnapOffsetRanges):
(WebCore::ScrollableArea::clearHorizontalSnapOffsets):
(WebCore::ScrollableArea::clearVerticalSnapOffsets):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalSnapOffsets): Deleted.
(WebCore::ScrollableArea::verticalSnapOffsets): Deleted.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::processWheelEventForScrollSnap):
Fix an issue where initial scrolling velocity would be set to zero at the end of a drag gesture.
(WebCore::ScrollController::updateScrollSnapState):
(WebCore::ScrollController::updateScrollSnapPoints):
(WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset):
* platform/cocoa/ScrollSnapAnimatorState.h:
(WebCore::ScrollSnapAnimatorState::snapOffsetsForAxis):
(WebCore::ScrollSnapAnimatorState::snapOffsetRangesForAxis):
(WebCore::ScrollSnapAnimatorState::setSnapOffsetsAndPositionRangesForAxis):
(WebCore::ScrollSnapAnimatorState::setSnapOffsetsForAxis): Deleted.
* platform/cocoa/ScrollSnapAnimatorState.mm:
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset):
(WebCore::projectedInertialScrollDistance): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* testing/Internals.cpp:
(WebCore::Internals::setPlatformMomentumScrollingPredictionEnabled):
Add a new hook for layout tests to force scrolling momentum calculators to use the platform-invariant momentum
scrolling prediction heuristic instead of the platform-dependent one.
(WebCore::Internals::scrollSnapOffsets):
* testing/Internals.h:
* testing/Internals.idl:
2017-01-10 Chris Dumez <cdumez@apple.com>
Make Event.initEvent()'s first parameter mandatory
https://bugs.webkit.org/show_bug.cgi?id=166894
Reviewed by Alex Christensen.
Make Event.initEvent()'s first parameter mandatory. As per the
specification, all parameters should be mandatory and we are
currently dicussing the possibility of making them optional in
the specification. However, having the first parameter optional
makes little sense as it would set the event's type to the string
"undefined".
Test: fast/events/initEvent-parameters.html
* dom/Event.idl:
2017-01-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r210537.
https://bugs.webkit.org/show_bug.cgi?id=166903
This change introduced JSC test failures (Requested by
ryanhaddad on #webkit).
Reverted changeset:
"Implement JSSourceCode to propagate SourceCode in module
pipeline"
https://bugs.webkit.org/show_bug.cgi?id=166861
http://trac.webkit.org/changeset/210537
2017-01-10 Chris Dumez <cdumez@apple.com>
REGRESSION(r189555): ImageDocument title no longer includes the size of the image
https://bugs.webkit.org/show_bug.cgi?id=166876
<rdar://problem/29939970>
Reviewed by Ryosuke Niwa.
Add a code comment to clarify fix that was made in r210536.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
2017-01-10 Jer Noble <jer.noble@apple.com>
Add support for MediaKeys.generateRequest().
https://bugs.webkit.org/show_bug.cgi?id=166880
Reviewed by Xabier Rodriguez-Calvar.
Test: media/encrypted-media/mock-MediaKeySession-generateRequest.html
Implement MediaKeySession::generateRequest(). This requires some additions
to CDM, CDMPrivate, and CDMInstance to support platform adoption and to
implement mock support for testing. Additionally, add an InitDataRegistry
object which can sanitize and extract key data from various initData types.
(At the moment, only the "keyids" initData type is implemented.)
Drive-by fixes: Change all instances of initDataType from String -> AtomicString.
Add "const" flags to all CDMPrivate methods that might be called from a const
reference.
* CMakeLists.txt:
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::supportsInitDataType):
(WebCore::CDM::sanitizeInitData):
(WebCore::CDM::supportsInitData):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/InitDataRegistry.cpp: Added.
(WebCore::extractKeyIDsKeyids):
(WebCore::sanitizeKeyids):
(WebCore::sanitizeCenc):
(WebCore::extractKeyIDsCenc):
(WebCore::sanitizeWebM):
(WebCore::extractKeyIDsWebM):
(WebCore::InitDataRegistry::shared):
(WebCore::InitDataRegistry::InitDataRegistry):
(WebCore::InitDataRegistry::sanitizeInitData):
(WebCore::InitDataRegistry::extractKeyIDs):
(WebCore::InitDataRegistry::registerInitDataType):
* Modules/encryptedmedia/InitDataRegistry.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::messageEventName):
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::enqueueMessage):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setServerCertificate):
* WebCore.xcodeproj/project.pbxproj:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::addKeysToSessionWithID):
(WebCore::MockCDMFactory::setSupportedDataTypes):
(WebCore::MockCDM::supportsInitDataType):
(WebCore::MockCDM::supportsConfiguration):
(WebCore::MockCDM::supportsConfigurationWithRestrictions):
(WebCore::MockCDM::supportsSessionTypeWithConfiguration):
(WebCore::MockCDM::supportsRobustness):
(WebCore::MockCDM::distinctiveIdentifiersRequirement):
(WebCore::MockCDM::persistentStateRequirement):
(WebCore::MockCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable):
(WebCore::MockCDM::supportsInitData):
(WebCore::MockCDMInstance::setServerCertificate):
(WebCore::MockCDMInstance::requestLicense):
* testing/MockCDMFactory.h:
(WebCore::MockCDMFactory::supportedDataTypes):
(WebCore::MockCDMFactory::hasSessionWithID):
(WebCore::MockCDMFactory::removeSessionWithID):
(WebCore::MockCDMFactory::setSupportedDataTypes): Deleted.
2017-01-10 Jer Noble <jer.noble@apple.com>
Add support for MediaKeys.createSession().
https://bugs.webkit.org/show_bug.cgi?id=166796
Reviewed by Eric Carlson.
Test: media/encrypted-media/mock-MediaKeys-createSession.html
Implement MediaKeys::createSession(). This requires some additions to
CDM, CDMPrivate, and CDMInstance to support platform adoption and to
implement mock support for testing. Because the CDMInstance will now
be shared between MediaKeys and MediaKeySession, it cannot be a unique_ptr.
Make CDMInterface ref-counted and store it as a Ref.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::createInstance):
(WebCore::CDM::supportsSessions):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::create):
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::sessionId):
(WebCore::MediaKeySession::expiration):
(WebCore::MediaKeySession::keyStatuses):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeySessionType.idl:
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
(WebCore::MediaKeySystemAccess::createMediaKeys):
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::MediaKeys):
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/MediaKeys.h:
(WebCore::MediaKeys::create):
* Modules/encryptedmedia/MediaKeys.idl:
2017-01-10 Jer Noble <jer.noble@apple.com>
Add support for MediaKeys.setServerCertificate()
https://bugs.webkit.org/show_bug.cgi?id=166772
Reviewed by Darin Adler.
Test: media/encrypted-media/mock-MediaKeys-setServerCertificate.html
Implement MediaKeys::setServerCertificate(). This requires some additions
to CDM, CDMPrivate, and CDMInstance to support platform adoption and to
implement mock support for testing.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::supportsServerCertificates):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setServerCertificate):
* Modules/encryptedmedia/MediaKeys.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::supportsServerCertificates):
(WebCore::MockCDMInstance::setServerCertificate):
* testing/MockCDMFactory.h:
(WebCore::MockCDMFactory::supportsServerCertificates):
(WebCore::MockCDMFactory::setSupportsServerCertificates):
* testing/MockCDMFactory.idl:
2017-01-10 Youenn Fablet <youenn@apple.com>
CachedScript cloning does not clone encodedSize
https://bugs.webkit.org/show_bug.cgi?id=166865
Reviewed by Darin Adler.
Covered by updated test.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setBodyDataFrom): set encoded size based on being cloned resource.
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):
(WebCore::CachedScript::setBodyDataFrom): Making use of CachedResource::setBodyDataFrom for complete cloning.
2017-01-10 Zan Dobersek <zdobersek@igalia.com>
Unreviewed. Remove the unused gReadyStateTimerInterval global from
the MediaPlayerPrivateGStreamerMSE implementation file as it's only
springing up a compiler warning.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2017-01-10 Zan Dobersek <zdobersek@igalia.com>
[CoordinatedGraphics] TextureMapperPlatformLayerProxy is constantly getting activated
https://bugs.webkit.org/show_bug.cgi?id=166856
Reviewed by Michael Catanzaro.
When CoordinatedGraphicsLayer::setContentsNeedsDisplay() is called, currently with
the threaded CoordinatedGraphics mode the platform layer is marked for synchronizing.
This means that at flush-time this layer swaps the buffer of the wrapped platform
layer and updates the layer state to indicate that the underlying
TextureMapperPlatformLayerProxy object has to be activated on the composition thread.
This current logic results in the TextureMapperPlatformLayerProxy object being
reactivated for every display request that arrives via setContentsNeedsDisplay().
This is pretty wasteful since this activation heap-allocates a RunLoop::Timer object
which internally also locks up the GLib main context to attach a new source, and
that's only after the source on the previous RunLoop::Timer was detached before
that RunLoop::Timer was destroyed.
To avoid this, CoordinatedGraphicsLayer::setContentsNeedsDisplay() sets a new flag,
m_shouldUpdatePlatformLayer. During flush, this flag is checked in
CoordinatedGraphicsLayer::updatePlatformLayer(), with the buffer swap performed in
case it's set. CoordinatedGraphicsLayer::syncPlatformLayer() now only sets the
platform layer proxy object for that layer's state.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
(WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2017-01-10 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Use WTF::Function in TextureMapperPlatformLayerProxy
https://bugs.webkit.org/show_bug.cgi?id=166853
Reviewed by Michael Catanzaro.
Use WTF::Function in the TextureMapperPlatformLayerProxy, instead of
the std::function bloat.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread):
(WebCore::TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2017-01-10 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] TextureMapperPlatformLayerProxy::swapBuffers() should hold the lock throughout invocation
https://bugs.webkit.org/show_bug.cgi?id=166852
Reviewed by Michael Catanzaro.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::swapBuffer): Append to previous buffer
to the m_usedBuffers Vector while the object's lock is held. Everywhere else the
m_usedBuffers Vector is used under the lock, no reason to not do the same here.
2017-01-09 Yusuke Suzuki <utatane.tea@gmail.com>
Implement JSSourceCode to propagate SourceCode in module pipeline
https://bugs.webkit.org/show_bug.cgi?id=166861
Reviewed by Saam Barati.
Now SourceOrigin is correctly propagated through the module pipeline.
So the error reported by http/tests/security/contentSecurityPolicy/module-eval-blocked-expected.html
is updated.
* ForwardingHeaders/runtime/JSSourceCode.h: Added.
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::resolveWithCallback):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::notifyFinished):
2017-01-09 Chris Dumez <cdumez@apple.com>
REGRESSION(r189555): ImageDocument title no longer includes the size of the image
https://bugs.webkit.org/show_bug.cgi?id=166876
<rdar://problem/29939970>
Reviewed by Tim Horton.
ImageDocument title no longer included the size of the image after r189555.
This is because Document::setTitle() is a no-op if the document does not
have a <head> element. To address the issue, we now include a <head>
element in ImageDocuments so that their title element properly gets added
to it.
Test: fast/images/imageDocument-title.html
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
2017-01-09 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: newLogicalTop >= logicalTop in WebCore::RenderBlockFlow::getClearDelta
https://bugs.webkit.org/show_bug.cgi?id=151202
<rdar://problem/27711822>
Reviewed by Myles C. Maxfield.
FindNextFloatLogicalBottomAdapter uses LayoutUnit::max() to flag m_nextLogicalBottom uninitialized.
However LayoutUnit::max() can also be a valid value for m_nextLogicalBottom.
FindNextFloatLogicalBottomAdapter::nextLogicalBottom() returns 0 instead of the actual value when
it sees m_nextLogicalBottom uninitialized. In certain cases, it confuses the caller and we end up
with a runaway loop.
Test: fast/block/float/assert-when-line-has-not-enough-space-left.html
* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
(WebCore::FindNextFloatLogicalBottomAdapter::highValue):
(WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom):
(WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom):
(WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
2017-01-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210531.
This change broke the 32-bit macOS build and caused LayoutTest
failures.
Reverted changeset:
"File scheme should not allow access of a resource on a
different volume."
https://bugs.webkit.org/show_bug.cgi?id=158552
http://trac.webkit.org/changeset/210531
2017-01-09 Chris Dumez <cdumez@apple.com>
[iOS] Drop VNodeTracker
https://bugs.webkit.org/show_bug.cgi?id=166868
<rdar://problem/29937587>
Reviewed by Andreas Kling.
Drop VNodeTracker on iOS. This was introduced a while back to try and
address vnode exhaustion issues in long running page load tests.
However, there was no evidence that the VNodeTracker functionality
helped so there is little point in keeping the extra code complexity.
* WebCore.xcodeproj/project.pbxproj:
* platform/SharedBuffer.h:
* platform/VNodeTracker.cpp: Removed.
* platform/VNodeTracker.h: Removed.
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::SharedBuffer):
* platform/cocoa/VNodeTrackerCocoa.cpp: Removed.
2017-01-09 Brent Fulgham <bfulgham@apple.com>
File scheme should not allow access of a resource on a different volume.
https://bugs.webkit.org/show_bug.cgi?id=158552
<rdar://problem/15307582>
Reviewed by Alex Christensen.
Revise SecurityOrigin to prevent files from one storage device (volume) from accessing content
on a different storage device (volume) unless universal access is enabled.
Pass the current file device as part of the NSURLRequest so that CFNetwork can reject loads
where the device changes in the midst of a load.
Also properly reflect that SecurityOrigin is never null by passing as a reference,
rather than as a pointer.
Tests: Tools/TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccess): Pass argument as reference.
(WebCore::SecurityOrigin::passesFileCheck): Add check that file URLs refer to files in
the same storage volume.
(WebCore::SecurityOrigin::canDisplay): Add check that files share the same volume.
(WebCore::SecurityOrigin::isSameSchemeHostPort): Pass argument as reference.
* page/SecurityOrigin.h:
* platform/FileSystem.cpp:
(WebCore::filesHaveSameVolume): Added.
* platform/FileSystem.h:
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): If loading a file URL, tell CFNetwork
the storage device at the time of the start of the load so we can trigger a failure if this
changes during the load operation.
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::getFileDeviceId): Added.
* platform/win/FileSystemWin.cpp:
(WebCore::getFileDeviceId): Added.
2017-01-09 Tim Horton <timothy_horton@apple.com>
Unindenting text inside a blockquote can result in the text being reordered
https://bugs.webkit.org/show_bug.cgi?id=166813
Reviewed by Darin Adler and Ryosuke Niwa.
Test: editing/execCommand/unindent-nested-blockquote-with-inner-div.html
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):
Start splitting the tree at the beginning of the content being unindented,
not at the containing block flow element, which could e.g. contain other
elements (or even other blockquotes).
2017-01-09 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Prototype dynamic-import
https://bugs.webkit.org/show_bug.cgi?id=165724
Reviewed by Saam Barati.
We do not set a handler for import for now.
So dynamic import feature is only enabled in the JSC shell right now.
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
2017-01-09 Youenn Fablet <youennf@gmail.com>
Merging ThreadableLoader redundant options on filtering responses
Merge OpaqueResponseBodyPolicy and ResponseFilteringPolicy ThreadableLoader options
https://bugs.webkit.org/show_bug.cgi?id=166843
Reviewed by Darin Adler.
Covered by existing tests.
Removing OpaqueResponseBodyPolicy option.
When ResponseFilteringPolicy is set to Enable, the body is filtered out in DocumentThreadableLoader.
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse): Implementing body filtering based on ResponseFilteringPolicy option.
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
* loader/ThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::LoaderTaskOptions::LoaderTaskOptions):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
2017-01-09 Daniel Bates <dabates@apple.com>
Evaluating window named element may return wrong result
https://bugs.webkit.org/show_bug.cgi?id=166792
<rdar://problem/29801059>
Reviewed by Chris Dumez.
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
2017-01-09 Chris Dumez <cdumez@apple.com>
REGRESSION(r178955): Touching Settings.in doesn't cause JSInternalSettingsGenerated.cpp to be updated on first build
https://bugs.webkit.org/show_bug.cgi?id=166814
Reviewed by Darin Adler.
Stop using .INTERMEDIATE in DerivedSources.make was it seems to break dependency
chains for some reason. We started using .INTERMEDIATE for scripts that generate
several targets when run a single time. It avoided running the script several
times (once per target) unnecessarily, and fixed issues with parallel builds.
To address the same issue without using .INTERMEDIATE, we now use pattern rules
(i.e. rules that have '%'). As per the documentation [1]:
"Pattern rules may have more than one target. Unlike normal rules, this does not
act as many different rules with the same prerequisites and recipe. If a pattern
rule has multiple targets, make knows that the rule’s recipe is responsible for
making all of the targets. The recipe is executed only once to make all the
targets".
We are therefore solving the same problem as with .INTERMEDIATE. However, I have
confirmed that using pattern rules does not break dependency chains. For example,
modifying Settings.in re-generates both InternalSettingsGenerated.idl *and*
JSInternalSettingsGenerated.cpp.
[1] https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html#Pattern-Intro
* DerivedSources.make:
2017-01-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r210493 and r210495.
https://bugs.webkit.org/show_bug.cgi?id=166842
Causes makeprops.pl to run on every build (Requested by smfr
on #webkit).
Reverted changesets:
"Avoid triggering rebuilds for minor changes of
CSSProperties.json"
https://bugs.webkit.org/show_bug.cgi?id=166810
http://trac.webkit.org/changeset/210493
"Avoid triggering rebuilds for minor changes of
CSSProperties.json"
https://bugs.webkit.org/show_bug.cgi?id=166810
http://trac.webkit.org/changeset/210495
2017-01-06 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Should support key and code properties on keyboard events
https://bugs.webkit.org/show_bug.cgi?id=166759
Reviewed by Carlos Garcia Campos.
This change fixes a bunch of tests which are currently failing, such as:
- fast/events/arrow-keys-on-body.html
- fast/events/constructors/keyboard-event-constructor.html
- fast/events/key-events-in-input-button.html
- fast/events/key-events-in-input-text.html
- fast/events/keyboardevent-code.html
- fast/events/keyboardevent-key.html
* platform/PlatformKeyboardEvent.h:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode): match web key value
to GDK key symbol.
(WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode): match web key code
to hardware code as reported by GDK.
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): add web key value and
code to the keyboard event upon creation.
2017-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WebProcess from WebKitGtk+ 2.15.2 SIGSEGVs in std::unique_ptr<SoupBuffer, WTF::GPtrDeleter<SoupBuffer> >::get() const () at /usr/include/c++/6/bits/unique_ptr.h:305
https://bugs.webkit.org/show_bug.cgi?id=165848
Reviewed by Michael Catanzaro.
In r208881 several locks were added to ImageDecoder to prevent frameBufferAtIndex() from being called by multiple
threads at the same time, but I forgot isSizeAvailable() also calls frameBufferAtIndex(). However, what we
really need to protect is the GIFImageDecoder, to never allow decoding from more than one thread at the same
time. This patch reverts r208881 and adds a lock to GIFImageDecoder::decode() instead.
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::decode):
* platform/image-decoders/gif/GIFImageDecoder.h:
2017-01-09 Alejandro G. Castro <alex@igalia.com>
[OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
https://bugs.webkit.org/show_bug.cgi?id=165316
Reviewed by Philippe Normand.
Fixed the ended support of the video element in the OWR player and
fixed the videoTracks support. Now the OW player properly adds and
removes the audio and video tracks. Added the getSettings support
to the mediastream interface. Solved also the size handling in
some of the enable/muted situations.
Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.
* platform/GStreamer.cmake: Added the new
RealtimeMediaSourceOwr.cpp with the new code handling the
settings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
Release the new video and audio maps that creates a relationship
of the mediastream tracks with the mediatracks of the video element.
(WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
false when we start playing.
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
tracks to the player so that the videoTracks API returns it, and
add an entry in the map to be able to restore it using the
mediastream track.
(WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
Move some part of the stop function to this one in order to use it
in pause method and avoid changing the video selection in that
case.
(WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
function disableMediaTracks and we also change teh selected
videoTrack.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
videoTrack reset the size and the selected element. In case there
is no media playing we Make sure we set the ended variable to true
and call the timeChange to modify the state of the player.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
Handle properly the situation when the user changed the enabled
value, we disable the media.
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
size of the source.
(WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
to make sure we return a size even when the sample is not ready
for gst.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
Added the ended attribute and the maps.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
realtime video and audio sources classes, this new classes
implement the settings of each type of media element.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
Use the new audio and video source classes instead of the general
one in order to handle the settings properly.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
(WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
subclass and return the new currentSettings attribute.
(WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
subclass initialization of the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
initialize the settings before returning the value. Implemented in
the subclass.
(WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
Added to initialize the supported settings of the
media. Implemented in the subclass.
(WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
file, implemented using the initialize functions of the subclass
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
this new class to handle the settings of the video elements. The
class initializes the settings and the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
this new class to handle the settings of the audio elements. The
class initializes the settings and the supportedSettings.
2017-01-08 Konstantin Tokarev <annulen@yandex.ru>
Introduce CPU(X86_SSE2) instead of various SSE2 checks
https://bugs.webkit.org/show_bug.cgi?id=166808
Reviewed by Michael Catanzaro.
Now copyLCharsFromUCharSource can use SSE2 implementation on non-Darwin
OSes, and all SSE2 code paths are available for MSVC on x86 if /arch:SSE2
or higher is enabled, and for MSVC on x86_64.
No new tests needed.
* platform/audio/SincResampler.cpp:
(WebCore::SincResampler::process):
* platform/audio/VectorMath.cpp:
(WebCore::VectorMath::vsma):
(WebCore::VectorMath::vsmul):
(WebCore::VectorMath::vadd):
(WebCore::VectorMath::vmul):
(WebCore::VectorMath::zvmul):
(WebCore::VectorMath::vsvesq):
(WebCore::VectorMath::vmaxmgv):
2017-01-07 Simon Fraser <simon.fraser@apple.com>
Avoid triggering rebuilds for minor changes of CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=166810
Post-review cleanup suggested by Darin Adler.
* css/makeprop.pl:
2017-01-07 Simon Fraser <simon.fraser@apple.com>
Avoid triggering rebuilds for minor changes of CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=166810
Reviewed by Daniel Bates.
We expect to make lots of metadata-related changes to CSSProperties.json, and
these should not trigger rebuilds.
Have makeprop.pl write to temporary files first, then only replace the generated
files if the contents differ.
* css/makeprop.pl:
(replaceFileIfChanged):
2017-01-06 Darin Adler <darin@apple.com>
Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
https://bugs.webkit.org/show_bug.cgi?id=166797
Reviewed by Alex Christensen.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify): Pass a reference instead of a pointer.
* dom/Document.cpp:
(WebCore::canonicalizedTitle): Map backslashes to currency symbols inside the
existing loop through the characters instead of calling a function confusingly
named "displayBuffer" to do it. More straightforward, possibly more efficient,
one less function.
(WebCore::Document::displayStringModifiedByEncoding): Call replace to map
backslashes to currency symbols instead of calling a special displayString
function. There was no real benefit to using that function; the String::replace
function has all the same optimizations, and this was also the only call site.
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::invokeRequest): Pass a reference instead of a pointer.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage): Call createEmptyEditorClient instead
of using the class EmptyEditorClient directly.
* loader/EmptyClients.cpp: Moved most of the empty clients here from the header.
Also made lots more things private.
(WebCore::createEmptyEditorClient): Added.
(WebCore::emptyDiagnosticLoggingClient): Added.
* loader/EmptyClients.h: Updated for above changes. Made more things private.
* page/DatabaseProvider.h: Removed unneeded include.
* page/MainFrame.cpp: Ditto.
* page/Page.cpp:
(WebCore::Page::diagnosticLoggingClient): Call emptyDiagnosticLoggingClient
instead of using the class EmptyDiagnosticLoggingClient directly.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setAuthorizer): Take a reference instead of a
PassRefPtr.
* platform/sql/SQLiteDatabase.h: Updated for above.
* platform/text/BidiContext.cpp:
(WebCore::BidiContext::BidiContext): Moved this function here from the header.
(WebCore::copyContextAndRebaselineLevel): Return a Ref instead of a PassRefPtr,
and take a reference rather than a raw pointer.
(WebCore::BidiContext::copyStackRemovingUnicodeEmbeddingContexts): Return a
Ref instead of a PassRefPtr.
* platform/text/BidiContext.h: Updated for the above changes.
* platform/text/BidiResolver.h: Simplify initialization, use more references,
auto, modern for loops, refer to derived class as that rather than the non-C++
term subclass.
* platform/text/TextCheckerClient.h: Changd argument from PassRefPtr to a
reference.
* platform/text/TextEncoding.h:
(WebCore::TextEncoding::displayString): Deleted.
(WebCore::TextEncoding::displayBuffer): Deleted.
* rendering/RootInlineBox.cpp: Style tweaks and use a modern for loop.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged): Call createEmptyEditorClient instead
of using the class EmptyEditorClient directly.
2017-01-07 Andy Estes <aestes@apple.com>
[QuickLook] Update quicklook test expectations
https://bugs.webkit.org/show_bug.cgi?id=166798
<rdar://problem/26477735>
Reviewed by Alex Christensen.
QuickLook uses UUIDs to generate x-apple-ql-id: URLs, so they will differ each time a
document is previewed. Since these URLs are included in QuickLook layout test results,
WebArchiveDumpSupport needs to replace them with predictable values when dumping a web
archive.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::quickLookURLReplacements): Created a static Vector of CFStringRef pairs
to store x-apple-ql-id: URLs and their replacement values.
(WebCoreTestSupport::normalizeWebResourceURL): If the URL starts with “x-apple-ql-id://”,
replace the text between the scheme and the file extension with “resource”. Store the
original URL along with its replacement in quickLookURLReplacements().
(WebCoreTestSupport::createXMLStringFromWebArchiveData): Replaced all QuickLook URLs in the
final XML text with their replacement URLs.
2017-01-07 Andy Estes <aestes@apple.com>
[QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
https://bugs.webkit.org/show_bug.cgi?id=166713
Reviewed by Alex Christensen.
QuickLook conversion was originally implemented by intercepting document loads at the
ResourceHandle level, with separate paths for NSURLConnection and CFURLConnection handles.
When QuickLook was ported to WebKit2, a third path was added in WebResourceLoader.
This change removes these three separate paths and implements a single conversion path in
SubresourceLoader, where QuickLook can intercept document loads regardless of the networking
API being used.
No change in behavior. Covered by existing tests.
* loader/ResourceLoader.h: Removed override from didCreateQuickLookHandle() since this
function is no longer declared in ResourceHandleClient.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreateQuickLookHandleForResponse): Added a helper
function to check if a QuickLookHandle should be created for a response.
(WebCore::SubresourceLoader::didReceiveResponse): Created a QuickLookHandle if necessary
and stored it in the DocumentLoader.
(WebCore::SubresourceLoader::didReceiveData): If there is a QuickLookHandle, call
QuickLookHandle::didReceiveBuffer(), and return early if QuickLook is converting.
(WebCore::SubresourceLoader::didReceiveBuffer): Ditto for QuickLookHandle::didReceiveBuffer().
(WebCore::SubresourceLoader::didFinishLoading): Ditto for QuickLookHandle::didFinishLoading().
(WebCore::SubresourceLoader::didFail): If there is a QuickLookHandle, call QuickLookHandle::didFail().
* loader/SubresourceLoader.h: Declared shouldCreateQuickLookHandleForResponse().
* loader/ios/QuickLook.h: Removed declarations used by the ResourceHandles and declared new
functions used by SubresourceLoader.
* loader/ios/QuickLook.mm:
(WebCore::QuickLookHandle::QuickLookHandle): Removed the NSURLConnection * parameter, since
we’d now always pass nil.
(WebCore::QuickLookHandle::create): Removed create() functions used by ResourceHandles.
(WebCore::QuickLookHandle::didReceiveData): Added. Copies the data into an NSData, wraps it
in an NSArray, and passes it to didReceiveDataArray().
(WebCore::QuickLookHandle::didReceiveBuffer): Added. Creates a NSArray of NSData from the
SharedBuffer and passes it to didReceiveDataArray().
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
(-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
(WebCore::QuickLookHandle::cfResponse): Deleted.
(WebCore::QuickLookHandle::didReceiveDataArray): Passed dataArray to m_converter and m_client.
* platform/SharedBuffer.h: Const-qualified createNSDataArray().
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::createNSDataArray): Ditto.
* platform/network/ResourceHandle.cpp: Stopped including QuickLook.h.
* platform/network/ResourceHandle.h: Removed m_quickLook.
(WebCore::ResourceHandle::quickLookHandle): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didCreateQuickLookHandle): Deleted.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Removed QuickLook code.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFail): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Ditto.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::setQuickLookHandle): Deleted.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Removed QuickLook code.
(-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]): Ditto.
2017-01-06 Daniel Bates <dabates@apple.com>
Ensure navigation only allowed for documents not in the page cache
https://bugs.webkit.org/show_bug.cgi?id=166773
<rdar://problem/29762809>
Reviewed by Brent Fulgham.
It is wise to ensure that navigation is only allowed when initiated from a document that
is not in- or about to be put in- the page cache. Such a navigation would surprise a
person that had navigated away from the initiating document among other issues.
* dom/Document.cpp:
(WebCore::Document::canNavigate): Only allow navigation if the document is not in the
page cache.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): Ditto.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::handleClick): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Assert triggering event's document is not in the
page cache.
(WebCore::FrameLoader::submitForm): Allow submission if the document is not in the
page cache.
(WebCore::FrameLoader::loadFrameRequest): Assert triggering event's document is not in
the page cache.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler): Only allow navigation if the document is
not in the page cache.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler): Ditto.
2017-01-06 Jer Noble <jer.noble@apple.com>
Crash in WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime(const MediaTime&, const FloatSize&)::block_invoke
https://bugs.webkit.org/show_bug.cgi?id=166738
Reviewed by Eric Carlson.
AVFoundation can potentially call the same boundary time observer multiple times, and
in that case, it's possible that the observer queue will be empty when we attempt
to remove the first item from the queue. There's an ASSERT() in Deque for this case,
but we need to explicitly protect against this case.
Drive-by fix: Explicitly unregister the observer before releasing it.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
2017-01-06 Joseph Pecoraro <pecoraro@apple.com>
REGRESSION(r208886) Web Inspector: Toggling CSS Properties in Styles Sidebar (comment / uncomment)
https://bugs.webkit.org/show_bug.cgi?id=166786
<rdar://problem/29767412>
Reviewed by Brian Burg.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::populateAllProperties):
Match earlier behavior and don't send the frontend information about
disabled (commented out) properties. Follow-up later to send this
information when implementing proper handling of them in the frontend.
2017-01-06 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings from CanvasRenderingContext2D
https://bugs.webkit.org/show_bug.cgi?id=166793
Reviewed by Darin Adler.
* WebCore.xcodeproj/project.pbxproj:
Move JSCanvasRenderingContext2DCustom.cpp to the GC only group.
* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toJS): Deleted.
(WebCore::toHTMLCanvasStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::strokeStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::setStrokeStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::fillStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::setFillStyle): Deleted.
Remove non-GC related custom bindings.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::toStyle):
(WebCore::CanvasRenderingContext2D::strokeStyle):
(WebCore::CanvasRenderingContext2D::fillStyle):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
Made existing setStrokeStyle/setFillStyle functions (which take CanvasStyle's)
private, and implemented new ones that operate on Variants, matching the spec.
2017-01-05 Darin Adler <darin@apple.com>
Remove PassRefPtr use from "rendering" directory, other improvements
https://bugs.webkit.org/show_bug.cgi?id=166717
Reviewed by Sam Weinig.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::shapePropertyValue): Use auto.
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image): Use auto. Pass references.
(WebCore::CSSFilterImageValue::filterImageChanged): Use modern for loop.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertShapeValue): Use overloaded
ShapeValue::create function instead of differently named functions.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Ditto.
* platform/graphics/filters/Filter.h: Added a protected constructor that takes
a filter resolution.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::FilterEffectRenderer): Use new constructor so
we don't have to call setFilterResolution and can initialize m_sourceGraphic.
(WebCore::FilterEffectRenderer::create): Moved here from the header.
(WebCore::FilterEffectRenderer::buildReferenceFilter): Take references and not
PssRefPtr. Use auto and references.
(WebCore::FilterEffectRenderer::build): Take a reference. Updated to work with
references rather than pointer. Use auto.
(WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Use early return.
(WebCore::FilterEffectRenderer::clearIntermediateResults): Use modern for loop.
(WebCore::FilterEffectRenderer::apply): Use references.
(WebCore::FilterEffectRenderer::output): Moved here from header.
(WebCore::FilterEffectRenderer::setMaxEffectRects): Moved here from header.
(WebCore::FilterEffectRenderer::outputRect): Moved here from header.
(WebCore::FilterEffectRendererHelper::prepareFilterEffect): Take references.
(WebCore::FilterEffectRendererHelper::beginFilterEffect): Use auto and references.
(WebCore::FilterEffectRendererHelper::applyFilterEffect): Ditto.
* rendering/FilterEffectRenderer.h: Updated for the above changes. Made a lot more
things private.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::filterPainter): Added. Helper so setupFilters does not
have to do things twice.
(WebCore::RenderLayer::hasFilterThatIsPainting): Updated to call filterPainter.
(WebCore::RenderLayer::setupFilters): Ditto.
(WebCore::RenderLayer::calculateClipRects): Pass reference.
* rendering/RenderLayer.h: Updated for the above changes.
* rendering/style/ContentData.cpp:
(WebCore::ContentData::clone): Use auto.
(WebCore::ImageContentData::createContentRenderer): Updated for reference.
* rendering/style/ContentData.h: Use Ref&& instead of PassRefPtr. Made more
things private.
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::defaultData): Made this a static member so it can
get at the now-private class NinePieceImage::Data.
(WebCore::NinePieceImage::NinePieceImage): Use RefPtr&& instead of PassRefPtr.
Use construction instead of calling m_data.access() over and over again.
(WebCore::NinePieceImage::Data::Data): Renamed from NinePieceImageData.
Moved initialization to class definition. Added a new overload for the normal
creation case.
(WebCore::NinePieceImage::Data::create): Ditto.
(WebCore::NinePieceImage::Data::copy): Ditto.
(WebCore::NinePieceImage::Data::operator==): Ditto.
* rendering/style/NinePieceImage.h: Cut down on includes. Moved the class
named NinePieceImageData in to become the private struct NinePieceImage::Data.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setContent): Pass Ref&& instead of RefPtr&& when
creating ImageContentData.
* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid): Tighten up by using data member directly
and using a local variabel.
(WebCore::pointersOrValuesEqual): Deleted.
(WebCore::ShapeValue::operator==): Use arePointingToEqualData instead the
above deleted function template. Wrote as a single return statement for clarity.
* rendering/style/ShapeValue.h: Changed all the create function names to just
create, using overloading instead of separate names. Use Ref&& instead of PassRefPtr.
Removed unused constructor that took a type but no data.
2017-01-06 Chris Dumez <cdumez@apple.com>
Regression(r189230): DOM Callbacks may use wrong global object
https://bugs.webkit.org/show_bug.cgi?id=166784
Reviewed by Mark Lam.
DOM Callbacks could end up using the wrong global object after r189230
because we were getting the globalObject from the callback object
instead of the one at the point the callback object was passed in by
JavaScript. This patch fixes the issue.
Test: fast/frames/frame-window-as-callback.html
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCallbackData.h:
(WebCore::JSCallbackData::globalObject):
(WebCore::JSCallbackData::JSCallbackData):
(WebCore::JSCallbackDataStrong::JSCallbackDataStrong):
(WebCore::JSCallbackDataStrong::callback):
(WebCore::JSCallbackDataStrong::invokeCallback):
(WebCore::JSCallbackDataWeak::JSCallbackDataWeak):
(WebCore::JSCallbackDataWeak::callback):
(WebCore::JSCallbackDataWeak::invokeCallback):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementationContent):
2017-01-06 Andy Estes <aestes@apple.com>
[Cocoa] Consolidate duplicate copies of WebArchiveDumpSupport in DRT and WKTR into WebCoreTestSupport
https://bugs.webkit.org/show_bug.cgi?id=166789
Reviewed by Alex Christensen.
There were duplicate implementations of WebArchiveDumpSupport in DumpRenderTree and
WebKitTestRunner. This change consolidates these into a single implementation in
WebCoreTestSupport.
* PlatformMac.cmake: Added WebArchiveDumpSupport.mm to WebCoreTestSupport.
* WebCore.xcodeproj/project.pbxproj: Ditto. Also made WebArchiveDumpSupport.h a Private header.
* platform/spi/cf/CFNetworkSPI.h: Moved CFNetwork forward declarations from
WebArchiveDumpSupport to here.
* testing/cocoa/WebArchiveDumpSupport.h: Added.
* testing/cocoa/WebArchiveDumpSupport.mm: Merged WebArchiveDumpSupport.cpp and
WebArchiveDumpSupport{Cocoa,Mac}.mm into a single file.
2017-01-06 Tim Horton <timothy_horton@apple.com>
Minor cleanups to IndentOutdentCommand and related code
https://bugs.webkit.org/show_bug.cgi?id=166791
Reviewed by Simon Fraser.
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::IndentOutdentCommand):
(WebCore::IndentOutdentCommand::outdentRegion):
* editing/IndentOutdentCommand.h:
(WebCore::IndentOutdentCommand::create):
Remove the unused m_marginInPixels and fix the copyright header.
2017-01-06 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r210319.
https://bugs.webkit.org/show_bug.cgi?id=166635
* DerivedSources.cpp:
A toJS call was ambiguous, but only if the generated IndexedDB bindings are compiled all-in-one in DerivedSources.cpp.
Compiling these few files separately (which happens automatically in the CMake build) fixes the build and won't increase
the total object files beyond MSVC's current 2GB limit.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots):
Unknown was an ambiguous symbol. It's also defined in winioctl.h.
2017-01-06 Zalan Bujtas <zalan@apple.com>
Text highlight causes Yoon Gothic webfont to reflow.
https://bugs.webkit.org/show_bug.cgi?id=166753
Reviewed by Darin Adler.
Add word-break: keep-all; support for CJK and breaking NBSPs.
Add test later. Need to figure out what font file to use.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition): Use BreakingContext's helper functions
to figure out the next breakable position.
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-01-06 Joseph Pecoraro <pecoraro@apple.com>
Add some missing longhand properties to CSSComputedStyleDeclaration and fix default values
https://bugs.webkit.org/show_bug.cgi?id=166674
<rdar://problem/6026159>
Reviewed by Darin Adler.
* css/CSSComputedStyleDeclaration.cpp:
Add some missing longhand properties to the list of all longhand properties.
(WebCore::counterToCSSValue):
The default value for counter-increment and counter-reset should be "none"
not the empty string.
2017-01-06 Chris Dumez <cdumez@apple.com>
[Form Validation] "character" in maxlength validation message should be singular when maxlength is 1
https://bugs.webkit.org/show_bug.cgi?id=166712
<rdar://problem/29872292>
Reviewed by Darin Adler.
Fix validation message to use singular form of "character" when maxLength value is 1.
Test: fast/forms/validation-message-maxLength.html
* English.lproj/Localizable.strings:
* English.lproj/Localizable.stringsdict: Added.
* WebCore.xcodeproj/project.pbxproj:
* extract-localizable-strings.pl:
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::localizedNString):
(WebCore::localizedString):
(WebCore::validationMessageTooLongText):
2017-01-06 Jer Noble <jer.noble@apple.com>
Add support for MediaKeySystemAccess.createMediaKeys()
https://bugs.webkit.org/show_bug.cgi?id=166749
Reviewed by Eric Carlson.
Test: media/encrypted-media/mock-MediaKeySystemAccess.html
Implement MediaKeySystemAccess::createMediaKeys(). This requires some
additions to CDM, CDMPrivate, and a new interface CDMInstance to support
eventual platform adoption and to implement mock support for testing.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::loadAndInitialize):
(WebCore::CDM::createInstance):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
(WebCore::CDMInstance::~CDMInstance):
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
(WebCore::MediaKeySystemAccess::createMediaKeys):
* Modules/encryptedmedia/MediaKeySystemAccess.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::MediaKeys):
* Modules/encryptedmedia/MediaKeys.h:
(WebCore::MediaKeys::create):
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::tryNextSupportedConfiguration):
* WebCore.xcodeproj/project.pbxproj:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::createInstance):
(WebCore::MockCDM::loadAndInitialize):
(WebCore::MockCDMInstance::MockCDMInstance):
(WebCore::MockCDMInstance::initializeWithConfiguration):
(WebCore::MockCDMInstance::setDistinctiveIdentifiersAllowed):
(WebCore::MockCDMInstance::setPersistentStateAllowed):
* testing/MockCDMFactory.h:
(WebCore::MockCDMFactory::canCreateInstances):
(WebCore::MockCDMFactory::setCanCreateInstances):
(WebCore::MockCDM::factory):
* testing/MockCDMFactory.idl:
2017-01-06 Andreas Kling <akling@apple.com>
Give RenderObject a Page& getter.
<https://webkit.org/b/166735>
Reviewed by Darin Adler.
The render tree should now only ever be live while in a Frame that's connected to a Page.
Hence we can give RenderObject a Page& getter and simplify a lot of code that previously
had to get the Page from Document (or Frame) and perform null checks on it.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree): Assert that the Page is present when we tear the render tree down.
* page/Frame.cpp:
(WebCore::Frame::willDetachPage): Assert that there's no render tree when we're about to detach from the Page.
Also added a comment explaining the two main ways that render trees die.
* rendering/RenderObject.h:
(WebCore::RenderObject::page): Added. So neat!
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::estimatedLoadingProgress):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::chooseInterpolationQuality):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::layout):
(WebCore::RenderAttachment::baselinePosition):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
(WebCore::setupWheelEventTestTrigger):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::shouldUnavailablePluginMessageBeButton):
(WebCore::RenderEmbeddedObject::paint):
(WebCore::RenderEmbeddedObject::paintReplaced):
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
(WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
(WebCore::RenderEmbeddedObject::getCursor):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::flattenFrame):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::isActive):
(WebCore::RenderLayer::didStartScroll):
(WebCore::RenderLayer::didEndScroll):
(WebCore::RenderLayer::didUpdateScroll):
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::setupFontSubpixelQuantization):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::RenderLayerBacking::paintContents):
(WebCore::RenderLayerBacking::shouldAggressivelyRetainTiles):
(WebCore::RenderLayerBacking::shouldTemporarilyRetainTileCohorts):
(WebCore::RenderLayerBacking::useGiantTiles):
(WebCore::RenderLayerBacking::verifyNotPainting):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::scrollingCoordinatorFromLayer): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::updateScrollingLayerWithClient):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
(WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::pageScaleFactor):
(WebCore::RenderLayerCompositor::zoomedOutPageScaleFactor):
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::registerAllScrollingLayers):
(WebCore::RenderLayerCompositor::scrollingCoordinator):
(WebCore::RenderLayerCompositor::graphicsLayerFactory):
(WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
(WebCore::RenderLayerCompositor::page):
* rendering/RenderLayerCompositor.h:
* rendering/RenderListBox.cpp:
(WebCore::setupWheelEventTestTrigger):
(WebCore::RenderListBox::setScrollTop):
(WebCore::RenderListBox::isActive):
(WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::theme):
* rendering/RenderObject.h:
(WebCore::RenderObject::page):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult):
(WebCore::RenderSearchField::showPopup):
(WebCore::RenderSearchField::valueChanged):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::updateControlStatesForRenderer):
(WebCore::RenderTheme::isActive):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/RenderView.cpp:
(WebCore::RenderView::pageNumberForBlockProgressionOffset):
(WebCore::RenderView::pageCount):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2017-01-05 Zalan Bujtas <zalan@apple.com>
TextFragmentIterator::runWidth does not need typename CharacterType<> anymore.
https://bugs.webkit.org/show_bug.cgi?id=166751
Reviewed by Simon Fraser.
No change in functionality.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2017-01-05 Ryosuke Niwa <rniwa@webkit.org>
Finding text doesn't work across shadow boundary
https://bugs.webkit.org/show_bug.cgi?id=158503
Reviewed by Antti Koivisto.
Added a new TextIterator behavior flag, TextIteratorTraversesFlatTree, which makes TextIterator traverse
the flat tree instead of the DOM tree, and made this behavior default in findPlainText.
Also added a new find options flag, DoNotTraverseFlatTree, to suppress this behavior in window.find(~)
and execCommand('FindString', false, ~) as they should not be able to peek information inside shadow trees.
Unfortunately these APIs have been deprecated in the standards so there is no specification to follow.
For now, we don't support finding a word or a keyword across a shadow boundary as this would require
making rangeOfString and other related functions return a Range-like object that can cross shadow boundaries.
Also added internals.rangeOfString to test Editor::rangeOfString, and replaced the bit-flag arguments
to internals.countMatchesForText and internals.countFindMatches by an array of strings for better portability.
Test: editing/text-iterator/find-string-on-flat-tree.html
* editing/Editor.cpp:
(WebCore::Editor::rangeOfString): Use the modern containingShadowRoot instead of nonBoundaryShadowTreeRootNode
since the start container can be a shadow root, which nonBoundaryShadowTreeRootNode asserts not be the case.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeFindString): Don't traverse across shadow boundaries.
* editing/FindOptions.h: Added DoNotTraverseFlatTree.
* editing/TextIterator.cpp:
(WebCore::assignedAuthorSlot): Added.
(WebCore::authorShadowRoot): Added.
(WebCore::firstChildInFlatTreeIgnoringUserAgentShadow): Added.
(WebCore::nextSiblingInFlatTreeIgnoringUserAgentShadow): Added.
(WebCore::firstChild): Added. Traverses the flat tree when TextIteratorTraversesFlatTree is set.
(WebCore::nextSibling): Ditto.
(WebCore::parentNodeOrShadowHost): Ditto.
(WebCore::TextIterator::advance): Don't set m_handledChildren to true when the current node has display: contents.
(WebCore::findPlainText): Use TextIteratorTraversesFlatTree unless DoNotTraverseFlatTree is set.
* editing/TextIteratorBehavior.h: Added TextIteratorTraversesFlatTree.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find): Don't traverse across shadow boundaries.
* testing/Internals.cpp:
(WebCore::parseFindOptions): Added.
(WebCore::Internals::rangeOfString): Added.
(WebCore::Internals::countMatchesForText): Replaced the find options by an array of strings instead of a bit mask.
(WebCore::Internals::countFindMatches): Ditto.
* testing/Internals.h:
* testing/Internals.idl: Added rangeOfString, and replaced find options bit-flag in countMatchesForText and
countFindMatches by an array of strings so that the tests themselves don't rely on a specific value of each bit flag.
2017-01-05 Chris Dumez <cdumez@apple.com>
[Form Validation] lengthy validation messages should be truncated with an ellipsis
https://bugs.webkit.org/show_bug.cgi?id=166747
<rdar://problem/29872021>
Reviewed by Simon Fraser.
Lengthy HTML validation messages should be truncated with an ellipsis.
Previously, they were truncated but there was no ellipsis.
No new tests, not easily testable. Manually tested on
- http://codepen.io/cdumez/full/zoOZmZ/ (last field)
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):
2017-01-05 Simon Fraser <simon.fraser@apple.com>
Radio buttons have a fixed border radius making them look square when resized
https://bugs.webkit.org/show_bug.cgi?id=148676
rdar://problem/29889892
Reviewed by Tim Horton.
Change the 8px border-radius of iOS radio buttons to 50% so they remain circular
when the page overrides the size.
Test: fast/forms/ios/large-radio-button-is-round.html
* css/html.css:
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS):
2017-01-05 Myles C. Maxfield <mmaxfield@apple.com>
CoreText variation axis identifiers don't work with 64-bit numbers
https://bugs.webkit.org/show_bug.cgi?id=166745
<rdar://problem/29856541>
<rdar://problem/29848883>
Reviewed by Tim Horton.
There is a bug where some CFNumbers are getting garbage results when
being placed into a 64-bit field. Luckily, we don't need the full
64-bits; 32-bits is sufficient.
Test: fast/text/international/system-language/hindi-system-font-punctuation.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::defaultVariationValues):
2017-01-05 Zalan Bujtas <zalan@apple.com>
Start hittesting a clean tree in RenderEmbeddedObject::isReplacementObscured
https://bugs.webkit.org/show_bug.cgi?id=166743
<rdar://problem/29024384>
Reviewed by Simon Fraser.
Unable to reproduce.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::isReplacementObscured):
2017-01-04 Ryosuke Niwa <rniwa@webkit.org>
Crash inside Editor::styleForSelectionStart
https://bugs.webkit.org/show_bug.cgi?id=166710
Reviewed by Chris Dumez.
Added a null pointer check. This crash can happen when the DOM is mutated as editorState tries
to compute the style at the selection start.
No new tests since there is no reproducible test case, and I couldn't come up with one either.
This crash seems to retire some intricate dependency between when DOM is mutated, selection is
updated, and then performPostLayoutTasks ends up updating the editor state in response to
the element's editabilty changing.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart):
2017-01-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210370.
This change caused hundreds of LayoutTest failures on Sierra.
Reverted changeset:
"[Cocoa] Variation fonts without variations specified are not
rendered as if the default variations were specified"
https://bugs.webkit.org/show_bug.cgi?id=166672
http://trac.webkit.org/changeset/210370
2017-01-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
https://bugs.webkit.org/show_bug.cgi?id=165082
Reviewed by Alex Christensen.
Simplified WebKitSoupRequestGenericClient.
* platform/network/soup/WebKitSoupRequestGeneric.cpp:
(webkitSoupRequestGenericSendAsync):
(webkitSoupRequestGenericSendFinish):
(webkitSoupRequestGenericGetRequest):
* platform/network/soup/WebKitSoupRequestGeneric.h:
* platform/network/soup/WebKitSoupRequestGenericClient.h:
2017-01-05 Chris Dumez <cdumez@apple.com>
Turn preferLowPowerWebGLRendering setting on by default
https://bugs.webkit.org/show_bug.cgi?id=166737
<rdar://problem/29870033>
Reviewed by Dean Jackson.
Temporarily turn preferLowPowerWebGLRendering setting on by default until
we deal better with WebGL content in background tabs.
* page/Settings.in:
2017-01-05 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Variation fonts without variations specified are not rendered as if the default variations were specified
https://bugs.webkit.org/show_bug.cgi?id=166672
<rdar://problem/29779119>
<rdar://problem/29848883>
Reviewed by Simon Fraser.
CoreText has a bug (<rdar://problem/29859207>) where variation fonts without
a specified variation value are rendered as if the minimum value is specified,
rather than the default value. The solution is to apply default values where
they are omitted.
Test: fast/text/variations/advances.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
2017-01-05 Zalan Bujtas <zalan@apple.com>
Mark the dedicated root linebox for trailing floats in empty inlines dirty.
https://bugs.webkit.org/show_bug.cgi?id=166732
<rdar://problem/29100419>
Reviewed by Antti Koivisto.
We normally attach floating boxes to the last root linebox. However when the floatbox is preceded by a <br>
we generate a dedicated root linebox (TrailingFloatsRootInlineBox) for the floatbox.
When this floatbox is a RenderInline descendant and this RenderInline does not generate lineboxes (it's ancestor RenderBlockFlow does)
we have to make sure that this special root linebox gets marked dirty when the associated floatbox changes.
(Unfortunately through the recursive calls on dirtyLinesFromChangedChild(), we lose the information about
the "changed child" since the inlines propagates the marking logic to the RenderBlockFlow, see FIXME.)
Test: fast/inline/trailing-floats-inline-crash2.html
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
2017-01-05 Antoine Quint <graouts@apple.com>
[Cocoa] Both modern-media-controls/images/iOS modern-media-controls/images/macOS are installed on both platforms
https://bugs.webkit.org/show_bug.cgi?id=163871
Reviewed by Eric Carlson.
We now only copy modern media controls images, if any, for the current platform.
* WebCore.xcodeproj/project.pbxproj:
2017-01-05 Keith Rollin <krollin@apple.com>
Add WebCore::URL::protocolHostAndPort
https://bugs.webkit.org/show_bug.cgi?id=166426
Reviewed by Alex Christensen.
Added to support record/replay mechanism, which needs it in order to
implement fuzzy-matching of URLs that are similar to each other but
that nonetheless come from the same source/host.
Updated TestWebKitAPI/Tests/WebCore/URL.cpp.
* platform/URL.cpp:
(WebCore::URL::protocolHostAndPort):
* platform/URL.h:
2017-01-05 Chris Dumez <cdumez@apple.com>
Form validation: Align email validation with the latest HTML specification
https://bugs.webkit.org/show_bug.cgi?id=166697
<rdar://problem/29870245>
Reviewed by Alex Christensen.
Align email validation with the latest HTML specification:
- https://html.spec.whatwg.org/#valid-e-mail-address
It particular, the following changes were made:
- The first and last character of the domain now needs to be a letter or a digit
- Parts of the domain can only be 63 characters in length
No new tests, extended existing test.
* html/EmailInputType.cpp:
2017-01-05 Enrica Casucci <enrica@apple.com>
Support File Promise during drag for macOS.
https://bugs.webkit.org/show_bug.cgi?id=165204
rdar://problem/19595567
Reviewed by Tim Horton.
Adds the support for handling File Promise type during
drag. DragData now has the knowledge of the NSFilesPromisePboardType and
checks for the data type during drag.
* page/mac/DragControllerMac.mm:
(WebCore::DragController::dragOperation):
* platform/DragData.h:
(WebCore::DragData::setFileNames):
(WebCore::DragData::fileNames):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsFiles):
(WebCore::DragData::numberOfFiles):
(WebCore::DragData::asFilenames):
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::containsPromise):
(WebCore::DragData::asURL):
2017-01-05 Per Arne Vollan <pvollan@apple.com>
[Win] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=166726
Reviewed by Alex Christensen.
Add include folder.
* CMakeLists.txt:
2017-01-05 Milan Crha <mcrha@redhat.com>
[SOUP] AddressSanitizer: heap-use-after-free under WTF::String::fromUTF8()
https://bugs.webkit.org/show_bug.cgi?id=166722
Reviewed by Alex Christensen.
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::topPrivatelyControlledDomain):
Use a variable to hold UTF-8 version of the domain, because
the soup_tld_get_base_domain() returns a pointer into the passed-in
string, which could be freed due to the temporary object being freed.
2017-01-05 Andreas Kling <akling@apple.com>
Remove some unnecessary page cache checks in render tree code.
<https://webkit.org/b/166728>
Reviewed by Antti Koivisto.
There is no render tree in the page cache, so we don't need to be checking
for it in renderer code.
* rendering/RenderElement.cpp:
(WebCore::shouldRepaintForImageAnimation):
(WebCore::RenderElement::newImageAnimationFrameAvailable):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderObject.cpp:
(WebCore::printRenderTreeForLiveDocuments):
(WebCore::printLayerTreeForLiveDocuments):
* rendering/RenderView.cpp:
(WebCore::RenderView::lazyRepaintTimerFired):
2017-01-05 Andreas Kling <akling@apple.com>
REGRESSION(r210226): overflow:scroll scroll position not restored on back navigation
<https://webkit.org/b/166724>
Reviewed by Antti Koivisto.
Before r210226, the render tree being torn down and the document being destroyed
were roughly the same thing, since they would always happen together, from the
render tree's perspective.
Changing this caused us to skip over the code that saves the scroll position
for an element's RenderLayer when going into the page cache. Navigating back to
that page would then scroll the layer to (0,0) instead of the previous position.
The fix is simply to remove the check for documentBeingDestroyed() in ~RenderLayer().
Note that two checks are being removed, there was also a weird "optimization"
to avoid nulling out EventHandler's m_resizeLayer if it points to this layer.
That pointer would eventually get nulled out in EventHandler::clear() anyway,
but it feels better to not let that pointer dangle.
Test: fast/scrolling/page-cache-back-overflow-scroll-restore.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):
2017-01-05 Wenson Hsieh <wenson_hsieh@apple.com>
Disable smooth playhead animation for main content media in the Touch Bar
https://bugs.webkit.org/show_bug.cgi?id=166715
<rdar://problem/29870673>
Reviewed by Eric Carlson.
Passing in a non-zero playback rate to WebPlaybackControlsManager's timing property causes unintended effects
further down the stack. Please see the Radar for more details.
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
2017-01-05 Andreas Kling <akling@apple.com>
Fix iOS build due to missing #include's.
* history/CachedFrame.cpp:
2017-01-05 Andreas Kling <akling@apple.com>
Remove ChromeClient::needTouchEvents().
<https://webkit.org/b/166723>
Rubber-stamped by Antti Koivisto.
Remove this hook since it's a no-op in every port.
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::didAddTouchEventHandler):
(WebCore::Document::didRemoveTouchEventHandler):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::transitionToCommitted):
* page/ChromeClient.h:
2017-01-05 Darin Adler <darin@apple.com>
Remove PassRefPtr use from "bindings/scripts", "svg", "testing", and "workers"
https://bugs.webkit.org/show_bug.cgi?id=166718
Reviewed by Alex Christensen.
* bindings/scripts/test/JS/JSFloat64Array.cpp: Removed. Stale unused test
result expectation file.
* bindings/scripts/test/JS/JSFloat64Array.h: Ditto.
* svg/SVGElement.cpp:
(WebCore::SVGElement::removeEventListener): Fix comment that incorrectly
mentions PassRefPtr.
* testing/Internals.cpp:
(WebCore::Internals::computedStyleIncludingVisitedInfo): Return Ref instead
of RefPtr.
(WebCore::Internals::serializeObject): Ditto.
(WebCore::Internals::deserializeBuffer): Ditto.
(WebCore::Internals::observeGC): Streamlined code a bit.
* testing/Internals.h: Updated for above changes.
* testing/Internals.idl: Marked various function results as nullable.
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Take a RefPtr&&
instead of a PassRefPtr.
* workers/DedicatedWorkerThread.h: Updated for above change.
* workers/Worker.cpp:
(WebCore::Worker::Worker): Passs a reference to WorkerGlobalScopeProxy::create.
(WebCore::Worker::~Worker): Updated since m_contentProxy is a reference.
(WebCore::Worker::postMessage): Ditto.
(WebCore::Worker::terminate): Ditto.
(WebCore::Worker::hasPendingActivity): Ditto.
(WebCore::Worker::notifyNetworkStateChange): Ditto.
(WebCore::Worker::notifyFinished): Ditto.
* workers/Worker.h: Made m_contextProxy a reference rather than a pointer.
* workers/WorkerGlobalScopeProxy.h: Reduced includes. Made destructor
protected instead of public since this class destroys itself.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerGlobalScopeProxy::create): Take and return a reference.
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy): Moved most initialization
to the calass definition. Take a reference instead of a pointer.
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Use auto.
(WebCore::WorkerMessagingProxy::workerThreadCreated): Take a reference
rather than a PassRefPtr.
* workers/WorkerMessagingProxy.h: Updated for above changes.
(WebCore::WorkerMessagingProxy::askedToTerminate): Deleted.
(WebCore::WorkerMessagingProxy::workerObject): Deleted.
* workers/WorkerThread.h: Take a RefPtr&& instead of a PassRefPtr.
2017-01-04 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Addressing post-review comments after r21005.
Simplify cairo_glyph_t initialization as suggested by Said.
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::CairoGlyphToPathTranslator::path):
2017-01-04 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Fix crash clamping grid lines
https://bugs.webkit.org/show_bug.cgi?id=166637
Reviewed by Darin Adler.
Avoid issues with very big values for the grid lines clamping them on GridPosition.
Test: fast/css-grid-layout/grid-position-crash.html
* rendering/style/GridArea.h: Move kGridMaxTracks definition to GridPosition.
* rendering/style/GridPosition.h:
(WebCore::GridPosition::setExplicitPosition): Use new setIntegerPosition().
(WebCore::GridPosition::setSpanPosition): Ditto.
(WebCore::GridPosition::setIntegerPosition): Clamp the position using kGridMaxTracks.
2017-01-04 Darin Adler <darin@apple.com>
Remove PassRefPtr use from the "html" directory, other improvements
https://bugs.webkit.org/show_bug.cgi?id=166635
Reviewed by Alex Christensen.
* CMakeLists.txt: Removed the duplicate copies of all the WebGL-specific files
in the main list of source files; there is no value in listing them twice.
Replaced WebGLGetInfo.cpp with WebGLAny.cpp.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer): Updates since the tracks functions
return references now.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Removed
unneeded SourceBufferPrivate* argument.
(WebCore::SourceBuffer::appendBufferTimerFired): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
(WebCore::SourceBuffer::videoTracks): Return a reference rather than a pointer.
(WebCore::SourceBuffer::audioTracks): Ditto.
(WebCore::SourceBuffer::textTracks): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
Removed unneeded SourceBufferPrivate* argument.
(WebCore::SourceBuffer::validateInitializationSegment): Updated since tracks
functions now return a pointer.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Removed unneeded
SourceBufferPrivate* argument.
(WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
(WebCore::SourceBuffer::videoTrackSelectedChanged): Take a reference rather than
a pointer.
(WebCore::SourceBuffer::audioTrackEnabledChanged): Ditto.
(WebCore::SourceBuffer::textTrackModeChanged): Ditto.
(WebCore::SourceBuffer::textTrackAddCue): Ditto.
(WebCore::SourceBuffer::textTrackAddCues): Ditto.
(WebCore::SourceBuffer::textTrackRemoveCue): Ditto.
(WebCore::SourceBuffer::textTrackRemoveCues): Ditto.
(WebCore::SourceBuffer::textTrackKindChanged): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): Ditto.
(WebCore::SourceBuffer::provideMediaData): Ditto.
(WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.
* Modules/mediasource/SourceBuffer.h: Updated for above changes.
* WebCore.xcodeproj/project.pbxproj: Replaced WebGLGetInfo with WebGLAny.
* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toHTMLCanvasStyle): Removed explicit cast to CanvasStyle and unneeded
conversion to a pointer since CanvasStyle constructors now take references.
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginInstance): Updated since bindingsInstance now returns a raw pointer.
(WebCore::pluginScriptObject): Ditto.
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::toJS): Moved to WebGLAny.h/cpp.
(WebCore::JSWebGL2RenderingContext::getIndexedParameter): Updated since the toJS
function in WebGLAny.h takes references, not pointers.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Removed quite a few unneeded
includes and got rid of a lot of unneeded JSC prefixes.
(WebCore::toJS): Moved to WebGLAny.h/cpp.
(WebCore::toJSNewlyCreated):
(WebCore::objectParameter): Renamed from getObjectParameter and also changed to
take a pointer to member function so we don't need an enum and a switch statement.
(WebCore::toJS): Changed to take references rather than pointers.
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Use a modern for loop.
(WebCore::JSWebGLRenderingContextBase::getBufferParameter): Use objectParameter.
(WebCore::JSWebGLRenderingContextBase::getRenderbufferParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getVertexAttrib): Ditto.
(WebCore::toNumberVector): Renamed from toVector, since this is specifically for
vectors of numbers. Use uncheckedAppend instead of assignment.
(WebCore::functionForUniform): Marked this inline.
(WebCore::dataFunctionf): Updated for above changes.
(WebCore::dataFunctioni): Ditto.
(WebCore::dataFunctionMatrix): Ditto.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch): Moved assertions to the top of the function.
Also added a FIXME because it's unclear why these assertions are correct. Updated
to use downcastScriptElement instead of toScriptElementIfPossible.
* dom/Document.h: Sorted list of forward-declared classes. Removed duplicate
forward declaration of ScriptModuleLoader.
* dom/PendingScript.cpp:
(WebCore::PendingScript::create): Take a ScriptElement instead of an Element.
(WebCore::PendingScript::PendingScript): Ditto.
(WebCore::PendingScript::loadableScript): Moved inline to header and made inline.
(WebCore::PendingScript::setClient): Take a reference instead of a pointer.
* dom/PendingScript.h: UPdated for above changes.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript): Pass a reference instead of a pointer.
(WebCore::ScriptElement::ref): Added. Forwards ref/deref to the underlying element
so we can use Ref and RefPtr with this class.
(WebCore::ScriptElement::deref): Ditto.
(WebCore::isScriptElement): Added. Replaces one of the two uses of
toScriptElementIfPossible, and is similar in style to is<Element>.
(WebCore::downcastScriptElement): Ditto, but for downcast.
* dom/ScriptElement.h: Updated for above changes.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::queueScriptForExecution): Take reference rather than
pointer, and pass ScriptElement rather than Element.
(WebCore::ScriptRunner::notifyFinished): Ditto.
(WebCore::ScriptRunner::timerFired): Ditto.
* dom/ScriptRunner.h: Updated for above changes.
* html/FileInputType.cpp:
(WebCore::FileInputType::files): Updated since m_fileList is a Ref.
(WebCore::FileInputType::createFileList): Updated to return a Ref instead of
a PassRefPtr. Also use reserveInitialCapacity/uncheckedAppend.
(WebCore::FileInputType::requestIcon): Updated since the updateRendering
function is now called iconLoaded. Also use references instead of pointers.
(WebCore::FileInputType::setFiles): Take a RefPtr&& insted of a PassRefPtr.
Also put some conditional code inside an #if.
(WebCore::FileInputType::filesChosen): Updated for function name change.
(WebCore::FileInputType::iconLoaded): Renamed from updateRendering.
Changed argument to RefPtr&& from PassRefPtr.
(WebCore::FileInputType::defaultToolTip): Got rid of unneeded local variable
and used the correct type, unsigned, rather than size_t.
* html/FileInputType.h: Updated for the above changes, use final instead
of override, and use Ref instead of RefPtr.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::form): Renamed from virtualForm.
* html/HTMLElement.h: Replaced the form/virtualForm pair of functions with
just a form function. The old design dates back before we had "final" for
virtual functions, and now we can just use that instead.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::virtualForm): Deleted.
* html/HTMLFormControlElement.h: Mark the form function final, since it's
now both an inline function in this class, and an override of a virtual
function inherited from the base class. Deleted the virtualForm function.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler): Removed use of the
formForSubmission function, which was just another way to get the same
thing as the form function; perhaps they were different in the past.
(WebCore::HTMLInputElement::setFiles): Take a RefPtr&& rather than a PassRefPtr.
* html/HTMLInputElement.h: Updated for the above.
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::control): Made this const.
(WebCore::HTMLLabelElement::form): Made this const, so it can be used to
override the const form function from the base class.
* html/HTMLLabelElement.h: Marked the form function final, since we want it
to override the form function inherited from HTMLElement.
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::form): Renamed from virtualForm.
* html/HTMLLegendElement.h: Override form instead of virtualForm and mark it final
This makes things more efficient if someone calls form directly on this class;
before it would make an unnecessary virtual function call.
* html/HTMLMediaElement.cpp:
(WebCore::TrackDisplayUpdateScope::TrackDisplayUpdateScope): Take a reference
rather than a pointer.
(WebCore::TrackDisplayUpdateScope::~TrackDisplayUpdateScope): Ditto.
(WebCore::eventTimeCueCompare): Compare the cues the same way the cue list would
rather than using cueIndex.
(WebCore::HTMLMediaElement::audioTrackEnabledChanged): Take a reference.
(WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
(WebCore::HTMLMediaElement::videoTrackSelectedChanged): Ditto.
(WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
(WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
(WebCore::HTMLMediaElement::textTrackRemoveCues): Ditto.
(WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
(WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Pass references.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto.
(WebCore::HTMLMediaElement::removeTextTrack): Ditto.
(WebCore::HTMLMediaElement::forgetResourceSpecificTracks): Ditto.
(WebCore::HTMLMediaElement::setController): Take a RefPtr&& instead of PassRefPtr.
* html/HTMLMediaElement.h: Updated for above changes.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::virtualForm): Deleted.
* html/HTMLObjectElement.h: Made the form function inline and final, which
achieves the same thing we did before with using, but without requiring the
separate virtualForm function, now deleted.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::collectOptionInnerText): Use isScriptElement
instead of toScriptElementIfPossible.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::bindingsInstance): Renamed from getInstance and
changed the return type to a raw pointer.
* html/HTMLPlugInElement.h: Updated for the above changes. Also changed the
updateSnapshot function to take a raw pointer instead of a PassRefPtr.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer): Pass a pointer
to updateSnapshot.
(WebCore::HTMLPlugInImageElement::updateSnapshot): Updated to take a raw
pointer instead of a PassRefPtr.
* html/HTMLPlugInImageElement.h: Updated for above changes.
* html/HTMLScriptElement.h: Added using to resolve the ambiguity with the
ref/deref from HTMLElement and from ScriptElement.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::selection): Return a RefPtr instead
of a PassRefPtr.
* html/HTMLTextFormControlElement.h: Updated for above changes.
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::textTrackKindChanged): Take a reference.
(WebCore::HTMLTrackElement::textTrackModeChanged): Ditto.
(WebCore::HTMLTrackElement::textTrackAddCues): Ditto.
(WebCore::HTMLTrackElement::textTrackRemoveCues): Ditto.
(WebCore::HTMLTrackElement::textTrackAddCue): Ditto.
(WebCore::HTMLTrackElement::textTrackRemoveCue): Ditto.
* html/HTMLTrackElement.h: Updated for above changes.
* html/InputType.cpp:
(WebCore::InputType::formForSubmission): Deleted.
(WebCore::InputType::setFiles): Take a RefPtr&& instead of a PassRefPtr.
* html/InputType.h: Updated for above changes.
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Pass a reference.
(WebCore::PluginDocument::setPluginElement): Take a reference rather than
a PassRefPtr.
* html/PluginDocument.h: Updated for above changes.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeStyle): Pass a reference.
(WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
(WebCore::CanvasRenderingContext2D::drawTextInternal): Ditto.
* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::CanvasStyle): Rewrite all constructors to use the
m_style variant instead of separate m_type and other data members. Also
change from PassRefPtr to a reference.
(WebCore::CanvasStyle::createFromString): Update to use the variant.
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha): Ditto.
(WebCore::CanvasStyle::isEquivalentColor): Ditto.
(WebCore::CanvasStyle::isEquivalentRGBA): Ditto.
(WebCore::CanvasStyle::isEquivalentCMYKA): Ditto.
(WebCore::CanvasStyle::CanvasStyle): Deleted copy constructor; the compiler
can now generate a correct copy or move constructor.
(WebCore::CanvasStyle::~CanvasStyle): Deleted. Compiler generates this
properly now without help from us.
(WebCore::CanvasStyle::operator=): Deleted. The compiler can now generate
a correct copy of move assignment operator.
(WebCore::CanvasStyle::applyStrokeColor): Updated to take a reference and
use the variant.
(WebCore::CanvasStyle::applyFillColor): Ditto.
* html/canvas/CanvasStyle.h: Redid this class to use a variant instead of
a type enumeration and a union.
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::createVertexArrayOES): Updated use of enum
since it's now an enum class.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext): Use Ref&& instead of
RefPtr&& for the GraphicsContext3D.
(WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): Updated enum
and also use references.
(WebCore::WebGL2RenderingContext::getInternalformatParameter): Use nullptr to
return null rather than the old idiom (default-constructed WebGLGetInfo).
(WebCore::WebGL2RenderingContext::texStorage2D): Ditto.
(WebCore::WebGL2RenderingContext::getQueryParameter): Ditto.
(WebCore::WebGL2RenderingContext::getSamplerParameter): Ditto.
(WebCore::WebGL2RenderingContext::getSyncParameter): Ditto.
(WebCore::WebGL2RenderingContext::getIndexedParameter): Ditto.
(WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): Ditto.
(WebCore::WebGL2RenderingContext::getActiveUniformBlockName): Ditto.
(WebCore::WebGL2RenderingContext::createVertexArray): Updated enum and also
use reference.
(WebCore::WebGL2RenderingContext::getExtension): Rearranged logic in three ways:
(1) Moved checks for whether an extension is supported inside the case for that
extension, rather than combining the extension name check with the extensions
enabled check. (2) Used the new enableSupportedExtension function to simplify
many of the checks to avoid repeating the extension name twice. (3) Changed the
idiom so we set the pointers to nullptr explicitly, preparing for a future where
we might make the extension pointers use std::optional so we can cache a negative
for each extension too, not just a positive result.
(WebCore::WebGL2RenderingContext::getSupportedExtensions): Use ASCIILiteral.
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): Use nullptr
as above. For non-null types, return the object without converting, letting the
WebGLAny class handle things, except for enumerations, which we need to explicitly
static_cast to an integral type, and things that will be stored in the variant in
a RefPtr, where we use makeRefPtr.
(WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters):
Simplified and clarified the handling of COLOR_ATTACHMENT.
(WebCore::WebGL2RenderingContext::getParameter): Return WebGLAny, same idiom as
described above for getFramebufferAttachmentParameter.
* html/canvas/WebGL2RenderingContext.h: Updated for above changes.
* html/canvas/WebGLAny.cpp: Added.
(WebCore::toJS): Handles conversion to JavaScript types. This function is based
on the existing toJS functions from the two classes that were using WebGLGetInfo.
Eventually we can probably just get the bindings to automatically generate this,
but there is some work to do to get to that point.
* html/canvas/WebGLAny.h: Added. This type, a variant, replaces the WebGLGetInfo
class. Also includes the toJS function, which is the real point of this type, since
it's about returning a variant mapped appropriately to JavaScript types.
* html/canvas/WebGLContextGroup.cpp:
(WebCore::WebGLContextGroup::getAGraphicsContext3D): Changed to return a reference.
Droped unnecessary local variable with a long type name.
(WebCore::WebGLContextGroup::addContext): Take a reference.
(WebCore::WebGLContextGroup::removeContext): Ditto.
(WebCore::WebGLContextGroup::removeObject): Ditto.
(WebCore::WebGLContextGroup::addObject): Ditto.
(WebCore::WebGLContextGroup::detachAndRemoveAllObjects): Dropped unnecessary
local variable with a long type name.
* html/canvas/WebGLContextGroup.h: Updated for above changes.
* html/canvas/WebGLContextObject.cpp:
(WebCore::WebGLContextObject::~WebGLContextObject): Pass references.
(WebCore::WebGLContextObject::detachContext): Ditto.
* html/canvas/WebGLGetInfo.cpp: Removed.
* html/canvas/WebGLGetInfo.h: Removed.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext): Take a Ref&& instead
of as PassRefPtr.
(WebCore::WebGLRenderingContext::initializeVertexArrayObjects): Updated enum
and also use references.
(WebCore::WebGLRenderingContext::getExtension): Rearranged logic in three ways:
(1) Moved checks for whether an extension is supported inside the case for that
extension, rather than combining the extension name check with the extensions
enabled check. (2) Used the new enableSupportedExtension function to simplify
many of the checks to avoid repeating the extension name twice. (3) Changed the
idiom so we set the pointers to nullptr explicitly, preparing for a future where
we might make the extension pointers use std::optional so we can cache a negative
for each extension too, not just a positive result.
(WebCore::WebGLRenderingContext::getSupportedExtensions): Use ASCIILiteral.
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Use nullptr
as above. For non-null types, return the object without converting, letting the
WebGLAny class handle things, except for enumerations, which we need to explicitly
static_cast to an integral type, and things that will be stored in the variant in
a RefPtr, where we use makeRefPtr.
(WebCore::WebGLRenderingContext::validateFramebufferFuncParameters):
Simplified and clarified the handling of COLOR_ATTACHMENT adding a FIXME about
something questionable.
(WebCore::WebGLRenderingContext::getParameter): Return WebGLAny, same idiom as
described above for getFramebufferAttachmentParameter.
* html/canvas/WebGLRenderingContext.h: Updated for above changes.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Updated to pass references
instead of pointers in a couple cases
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): Changed graphics
context argument type from RefPtr&& to Ref&&. Also moved initialization of scalars
from the constructor to the class definition.
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): Pass a reference.
(WebCore::WebGLRenderingContextBase::createBuffer): Pass a reference instead of a pointer.
(WebCore::WebGLRenderingContextBase::createFramebuffer): Ditto.
(WebCore::WebGLRenderingContextBase::createTexture): Ditto.
(WebCore::WebGLRenderingContextBase::createProgram): Ditto.
(WebCore::WebGLRenderingContextBase::createRenderbuffer): Ditto.
(WebCore::WebGLRenderingContextBase::createShader): Ditto.
(WebCore::WebGLRenderingContextBase::deleteBuffer): Ditto.
(WebCore::WebGLRenderingContextBase::getBufferParameter): Update to use WebGLAny.
(WebCore::WebGLRenderingContextBase::getProgramParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getRenderbufferParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getShaderParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getTexParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getUniform): Ditto.
(WebCore::WebGLRenderingContextBase::getVertexAttrib): Ditto.
(WebCore::WebGLRenderingContextBase::getVertexAttribOffset): Removed unnneed
type casts.
(WebCore::WebGLRenderingContextBase::vertexAttribPointer): Pass a reference.
(WebCore::WebGLRenderingContextBase::removeSharedObject): Take a reference.
(WebCore::WebGLRenderingContextBase::addSharedObject): Ditto.
(WebCore::WebGLRenderingContextBase::removeContextObject): Ditto.
(WebCore::WebGLRenderingContextBase::addContextObject): Ditto.
(WebCore::WebGLRenderingContextBase::getBooleanParameter): Changed return type;
connversion to WebGLAny can happen at the point of use.
(WebCore::WebGLRenderingContextBase::getBooleanArrayParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getFloatParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getIntParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getUnsignedIntParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getInt64Parameter): Ditto.
(WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter): Ditto.
(WebCore::WebGLRenderingContextBase::validateBufferDataParameters): Use
optional to simplify logic and get rid of a boolean.
(WebCore::WebGLRenderingContextBase::enableSupportedExtension): Added.
Helper used by the getExtension functions.
* html/canvas/WebGLRenderingContextBase.h: Updated for the above changes.
Also changed setBoundVertexArrayObject to take a raw pointer instead of
as PassRefPtr.
* html/canvas/WebGLSharedObject.cpp:
(WebCore::WebGLSharedObject::~WebGLSharedObject): Pass a reference.
(WebCore::WebGLSharedObject::detachContextGroup): Ditto.
(WebCore::WebGLSharedObject::getAGraphicsContext3D): Updated since the
underlying getAGraphicsContext3D function now returns a reference.
* html/canvas/WebGLSharedObject.h: Removed many unused "is" virtual functions.
* html/canvas/WebGLTransformFeedback.h: Ditto.
* html/canvas/WebGLVertexArrayObject.cpp:
(WebCore::WebGLVertexArrayObject::create): Updated for new type enumeration.
(WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Ditto.
(WebCore::WebGLVertexArrayObject::deleteObjectImpl): Ditto.
* html/canvas/WebGLVertexArrayObject.h: Updated for above changes.
* html/canvas/WebGLVertexArrayObjectBase.cpp:
(WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase): Updated for new
type enumeration and moved initialization to class definition.
(WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer): Changed argument to
raw pointer instead of PassRefPtr.
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribState): Changed argument to
reference instead of PassRefPtr.
(WebCore::WebGLVertexArrayObjectBase::unbindBuffer): Changed arugment type to
reference instead of PassRefPtr.
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor): Removed unneeded
local variable.
* html/canvas/WebGLVertexArrayObjectBase.h: Updated for above changes.
Replaced VAOType with Type. Used class member initialization.
* html/canvas/WebGLVertexArrayObjectOES.cpp:
(WebCore::WebGLVertexArrayObjectOES::create): Updated for new type enumeration.
(WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES): Ditto.
(WebCore::WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES) Ditto.:
(WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl): Ditto.
* html/canvas/WebGLVertexArrayObjectOES.h: Updated for above changes.
* html/forms/FileIconLoader.cpp:
(WebCore::FileIconLoader::iconLoaded): Renamed from notifyFinished. Also changed
the name of the function this calls to iconLoaded. Changed the arguemnt to
RefPtr&& instead of PassRefPtr.
* html/forms/FileIconLoader.h: Updated for above changes.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attachLater): Use isScriptElement instead of
toScriptElementIfPossible.
(WebCore::HTMLConstructionSite::insertForeignElement): Ditto.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Pass script
element as a Ref rather than RefPtr.
(WebCore::HTMLDocumentParser::watchForLoad): Pass a reference instead of a pointer.
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executeParsingBlockingScript): Deleted. Moved the code
into the single call site, execute ParsingBlockingScripts.
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Changed argument
type to a reference from a RefPtr; this funtion was not taking ownership. Also remove
call to toScriptElementIfPossible,
since pending scripts now contains script elements already.
(WebCore::HTMLScriptRunner::execute): Changed argument type to Ref<ScriptElement>&&
from PassRefPtr<Element>.
(WebCore::HTMLScriptRunner::executeParsingBlockingScripts): Moved code here from
executeParsingBlockingScript. Also pass a reference.
(WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): Pass a reference.
(WebCore::requestPendingScript): Changed argument type to ScriptElement& from
Element*.
(WebCore::HTMLScriptRunner::requestParsingBlockingScript): Ditto.
(WebCore::HTMLScriptRunner::requestDeferredScript): Ditto.
(WebCore::HTMLScriptRunner::runScript): Ditto.
* html/parser/HTMLScriptRunner.h: Updated for above changes.
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::takeScriptToProcess): Changed return type from
RefPtr<Element> to RefPtr<ScriptElement>.
(WebCore::HTMLTreeBuilder::processEndTag): Downcast the script element to
HTMLScriptElement so we can store it as a ScriptElement.
(WebCore::HTMLTreeBuilder::processTokenInForeignContent): Downcast the script
element to SVGScriptElement so we can store it as a script element.
* html/parser/HTMLTreeBuilder.h: Updated for above changes. Changed the type
of m_scriptToProcess to RefPtr<ScriptElement>.
* html/parser/TextDocumentParser.cpp: Added now-needed include.
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::generateViolationReport): Changed return type
to Ref from PassRefPtr.
* html/parser/XSSAuditorDelegate.h: Updated for above.
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::AudioTrack): Take references.
(WebCore::AudioTrack::setPrivate): Ditto.
(WebCore::AudioTrack::setEnabled): Removed redundant code to do what the
private setEnabled function is already going to do.
(WebCore::AudioTrack::inbandTrackIndex): Removed assertion since m_private
is now a Ref rather than RefPtr.
(WebCore::AudioTrack::enabledChanged): Added an early exit so we will only
call audioTrackEnabledChanged if m_enabled is actually changing. Also removed
the unneeded track private argument.
(WebCore::AudioTrack::idChanged): Ditto.
(WebCore::AudioTrack::labelChanged): Ditto.
(WebCore::AudioTrack::languageChanged): Ditto.
(WebCore::AudioTrack::willRemove): Ditto.
* html/track/AudioTrack.h: Updated for above changes.
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue): Removed inband text track private
argument. Use contains instead of find/end.
(WebCore::InbandDataTextTrack::updateDataCue): Ditto. Use get instead of find/end.
(WebCore::InbandDataTextTrack::removeDataCue): Ditto.
* html/track/InbandDataTextTrack.h: Updated for above changes.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Take references.
(WebCore::InbandGenericTextTrack::create): Ditto.
(WebCore::InbandGenericTextTrack::updateCueFromCueData): Ditto.
(WebCore::InbandGenericTextTrack::addGenericCue): Ditto. Also removed unused
track private argument.
(WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::parseWebVTTCueData): Ditto.
(WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Ditto.
(WebCore::InbandGenericTextTrack::newRegionsParsed): Pass a reference.
* html/track/InbandGenericTextTrack.h: Updated for above changes.
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::create): Return a Ref instead of a PassRefPtr. Take
references.
(WebCore::InbandTextTrack::InbandTextTrack): Ditto.
(WebCore::InbandTextTrack::setPrivate): Take a reference instead of a PassRefPtr.
(WebCore::InbandTextTrack::isClosedCaptions): Removed check for null since m_private
is now a Ref and so never null.
(WebCore::InbandTextTrack::isSDH): Ditto.
(WebCore::InbandTextTrack::containsOnlyForcedSubtitles): Ditto.
(WebCore::InbandTextTrack::isMainProgramContent): Ditto.
(WebCore::InbandTextTrack::isEasyToRead): Ditto.
(WebCore::InbandTextTrack::inbandTrackIndex): Ditto.
(WebCore::InbandTextTrack::inBandMetadataTrackDispatchType): Ditto.
(WebCore::InbandTextTrack::idChanged): Removed unneeded track private argument.
(WebCore::InbandTextTrack::labelChanged): Ditto.
(WebCore::InbandTextTrack::languageChanged): Ditto.
(WebCore::InbandTextTrack::willRemove): Ditto.
(WebCore::InbandTextTrack::updateKindFromPrivate): Improved switch statement
by removing default so we get a warning if we forget to handle a kind value.
(WebCore::InbandTextTrack::startTimeVariance): Removed check for null.
* html/track/InbandTextTrack.h: Updated for above changes. Changed m_private from
a RefPtr to a Ref.
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Take references.
(WebCore::InbandWebVTTTextTrack::create): Ditto.
(WebCore::InbandWebVTTTextTrack::parseWebVTTCueData): Removed unneeded track
private arguemnt.
(WebCore::InbandWebVTTTextTrack::newRegionsParsed): Pass a reference.
* html/track/InbandWebVTTTextTrack.h: Updated for above changes.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable): Pass references.
(WebCore::LoadableTextTrack::newRegionsAvailable): Ditto.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::~TextTrack): Use references.
(WebCore::TextTrack::setKind): Ditto.
(WebCore::TextTrack::setMode): Ditto.
(WebCore::TextTrack::removeAllCues): Ditto.
(WebCore::TextTrack::activeCues): Ditto.
(WebCore::TextTrack::addCue): Ditto.
(WebCore::TextTrack::removeCue): Removed unneeded code to handle a cue
that points to a track but is not in that track. Added a call to
setIsActive(false) here instead of having the remove function do it.
(WebCore::TextTrack::addRegion): Use references.
(WebCore::TextTrack::removeRegion): Removed unneeded code to handle a
region that points to a track but is not in that track.
(WebCore::TextTrack::cueWillChange): Use references.
(WebCore::TextTrack::cueDidChange): Ditto.
(WebCore::TextTrack::setLanguage): Ditto.
* html/track/TextTrack.h: Updated for above changes.
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::TextTrackCue): Initialized the data members
in the class definition.
(WebCore::TextTrackCue::cueIndex): Deleted.
(WebCore::TextTrackCue::invalidateCueIndex): Deleted.
* html/track/TextTrackCue.h: Updated for the above. Removed m_cueIndex,
because it is not a good design to store these and try to keep them up
to date.
* html/track/TextTrackCueList.cpp:
(WebCore::compareCues): Added. Helper for sorting and checking sorting.
(WebCore::TextTrackCueList::TextTrackCueList): Deleted. Let the compiler
generate this.
(WebCore::TextTrackCueList::length): Moved to header.
(WebCore::TextTrackCueList::cueIndex): Renamed from getCueIndex.
Changed return type to unsigned rather than unsigned long.
(WebCore::TextTrackCueList::item): Updated for name change.
(WebCore::TextTrackCueList::getCueById): Ditto.
(WebCore::TextTrackCueList::activeCues): Build the vector directly
rather than wastefully adding with TextTrackCueList::add, which will
try to sort.
(WebCore::TextTrackCueList::add): Take a Ref&& instead of a PassRefPtr.
Also, keep sorted using std::upper_bound instead of the recursive
binary search this code was using before. Also remove the
invalidateCueIndexes call since there are no cue indices any more.
Also remove the boolean return value since no caller was using it.
(WebCore::TextTrackCueList::remove): Take a reference instead of a
pointer. Also remove the boolean return value since no caller was using it.
(WebCore::TextTrackCueList::contains): Deleted. Was unused.
(WebCore::TextTrackCueList::updateCueIndex): Reimplemented using the
std::upper_bound and std::rotate operations. The old code that used
remove and add was inefficient and also could cause a cue to be deallocated
if something else wasn't holding a reference to the cue. Also changed to take
a reference.
(WebCore::TextTrackCueList::clear): Deleted. Was unused.
(WebCore::TextTrackCueList::invalidateCueIndexes): Deleted. No longer
needed since we don't store cue indices in the cues any more.
* html/track/TextTrackCueList.h: Updated for the above changes.
* html/track/VTTRegionList.cpp:
(WebCore::VTTRegionList::VTTRegionList): Deleted. Let the compiler
generate this.
(WebCore::VTTRegionList::length): Moved to header.
(WebCore::VTTRegionList::item): Updated for name and type changes.
(WebCore::VTTRegionList::getRegionById): Ditto.
(WebCore::VTTRegionList::add): Changed to take a Ref&& instead of a
PassRefPtr.
(WebCore::VTTRegionList::remove): Updated.
(WebCore::VTTRegionList::clear): Deleted. Was unused.
* html/track/VTTRegionList.h: Updated for the above changes.
* html/track/VTTRegionList.idl: Made return values nullable to reflect
the actual semantic of the code.
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack): Use references.
(WebCore::VideoTrack::setPrivate): Ditto.
(WebCore::VideoTrack::setSelected): Ditto.
(WebCore::VideoTrack::inbandTrackIndex): Removed assertion since m_private
is now a Ref instead of a RefPtr.
(WebCore::VideoTrack::selectedChanged): Removed unneeded track private argument.
(WebCore::VideoTrack::idChanged): Ditto.
(WebCore::VideoTrack::labelChanged): Ditto.
(WebCore::VideoTrack::languageChanged): Ditto.
(WebCore::VideoTrack::willRemove): Ditto.
(WebCore::VideoTrack::setKind): Updated to use reference.
(WebCore::VideoTrack::setLanguage): Ditto.
* html/track/VideoTrack.h: Updated for the above. Changed derivation to private.
Removed unneeded defaultKindKeyword.
* loader/EmptyClients.h: Updated to use reference.
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendViolationReport): Take a Ref&& instead of RefPtr&&.
* loader/PingLoader.h: Updated for above change.
* page/Chrome.cpp:
(WebCore::Chrome::loadIconForFiles): Take a reference.
* page/Chrome.h: Updated for above change.
* page/ChromeClient.h: Ditto.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation): Use auto.
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebPlaybackSessionModelMediaElement::selectAudioMediaOption): Simplified
algorithm by removing unneeded direct call to audioTrackEnabledChanged,
which will be called by setEnabled and doesn't need to be called again here.
(WebPlaybackSessionModelMediaElement::selectLegibleMediaOption): Removed
unhelpful assertion and unnneded initialization.
* platform/graphics/AudioTrackPrivate.h: Removed unnneeed track private
argument and initialized data members where they are defined.
* platform/graphics/InbandTextTrackPrivateClient.h: Use Ref instead of
PassRefPtr, initialize data members where they are defined, and removed
the unneeded track private arguments from the client functions.
* platform/graphics/SourceBufferPrivate.h: Fixed functions that were taking
AtomicString to take a const& instead. Use Ref&& instead of PassRefPtr.
* platform/graphics/SourceBufferPrivateClient.h: Removed unneded private pointer
arguments from client functions.
* platform/graphics/TrackPrivateBase.h: Removed unneeded private pointers
from client functions.
* platform/graphics/VideoTrackPrivate: Ditto.
* platform/graphics/avfoundation/AudioTrackPrivateAVF.h: Use
const AtomicString&.
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): Updated for change to arguments.
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto.
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): Ditto.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Ditto.
(WebCore::InbandTextTrackPrivateAVF::resetCueValues): Ditto.
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Ditto.
* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp:
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC):
Moved initialization of data memebrs to where they are defined.
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::enabled): Deleted. No longer needed.
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): Changed to use the enabled
flag from the base class instead of a separate m_enabled in this class.
* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
Removed the enabled function and the m_enabled data member.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: Marked functions
final instead of override and updated arguemnts.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): Updated for change
to arguments.
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::appendCompleted): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::hasVideo): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::hasAudio): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::flush): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::seekToTime): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.
* platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: Updated for
changes to arguments.
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): Ditto.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkNewSample): Ditto.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::append): Ditto.
(WebCore::SourceBufferPrivateGStreamer::flush): Ditto.
(WebCore::SourceBufferPrivateGStreamer::enqueueSample): Ditto.
(WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): Ditto.
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample): Ditto.
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): Ditto.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::append): Ditto.
(WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment): Ditto.
(WebCore::MockSourceBufferPrivate::didReceiveSample): Ditto.
(WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID): Ditto.
(WebCore::MockSourceBufferPrivate::enqueueSample): Ditto.
(WebCore::MockSourceBufferPrivate::hasVideo): Ditto.
(WebCore::MockSourceBufferPrivate::hasAudio): Ditto.
(WebCore::MockSourceBufferPrivate::fastSeekTimeForMediaTime): Ditto.
(WebCore::MockSourceBufferPrivate::seekToTime): Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.h: Ditto.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot): Take raw pointer instead
of PassRefPtr.
* rendering/RenderSnapshottedPlugIn.h: Updated for above change.
* svg/SVGScriptElement.h: Added using to resolve the ambiguity with the
ref/deref from SVGElement and from ScriptElement.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished): Updated to simplify since
the pending script now has a script element.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs): Use isSciprtElement instead
of toScriptElementIfPossible.
(WebCore::XMLDocumentParser::endElementNs): Ditto. Also use downcastScriptElement.
2017-01-04 Wenson Hsieh <wenson_hsieh@apple.com>
Move editing history scripts to WebCore PrivateHeaders
https://bugs.webkit.org/show_bug.cgi?id=166709
<rdar://problem/29876612>
Reviewed by Dan Bernstein.
Move editing history scripts out of InternalScripts and into Scripts, and update the WebCore Copy Script build
phase to copy the editing scripts into PrivateHeaders.
No new tests, because there should be no behavior change.
* Scripts/DumpEditingHistory.js: Renamed from Source/WebCore/InternalScripts/DumpEditingHistory.js.
* Scripts/EditingHistoryUtil.js: Renamed from Source/WebCore/InternalScripts/EditingHistoryUtil.js.
* WebCore.xcodeproj/project.pbxproj:
2017-01-04 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: forced pseudo classes aren't cleared from inspected page when Inspector closes
https://bugs.webkit.org/show_bug.cgi?id=108823
<rdar://problem/13143550>
Reviewed by Timothy Hatcher.
* inspector/InspectorCSSAgent.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::documentDetached):
Clear the document from all of the different Document sets.
(WebCore::InspectorCSSAgent::didRemoveDocument): Deleted.
Use documentDetached, which is more direct.
(WebCore::InspectorCSSAgent::forcePseudoState):
Update the set of Documents with psuedo element changes. So when we
reset forced styles we know which documents to refresh styles.
(WebCore::InspectorCSSAgent::resetPseudoStates):
Use the list of documents we've already computed.
(WebCore::InspectorCSSAgent::didRemoveDOMNode):
(WebCore::InspectorCSSAgent::didModifyDOMAttr):
Change to take a reference and more data to avoid extra work.
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::unbind):
Eliminated didRemoveDocument.
(WebCore::InspectorDOMAgent::didModifyDOMAttr):
(WebCore::InspectorDOMAgent::didRemoveDOMAttr):
(WebCore::InspectorDOMAgent::styleAttributeInvalidated):
Pass a references to the DOM listener client, these are never null.
2017-01-04 Myles C. Maxfield <mmaxfield@apple.com>
Remove runtime flag for variation fonts
https://bugs.webkit.org/show_bug.cgi?id=164251
Reviewed by Dean Jackson.
No new tests because there is no behavior change, but updated the following
tests to stop setting the flag:
- animations/font-variations/font-variation-settings-order.html:
- animations/font-variations/font-variation-settings-unlike.html:
- animations/font-variations/font-variation-settings.html:
- fast/text/variations/duplicate.html:
- fast/text/variations/exist.html:
- fast/text/variations/getComputedStyle.html:
- fast/text/variations/inheritance.html:
- fast/text/variations/order.html:
- fast/text/variations/outofbounds.html:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContext::completeURL):
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::variationFontsEnabled): Deleted.
(WebCore::InternalSettings::setVariationFontsEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2017-01-04 Andy Estes <aestes@apple.com>
[Cocoa] Teach SharedBuffer to return an NSArray of data segments to avoid flattening
https://bugs.webkit.org/show_bug.cgi?id=166696
Reviewed by Tim Horton.
Existing methods of extracting NSData from a SharedBuffer require either merging or copying
data segments. Since data segments are stored in CFDataRefs on Cocoa platforms, it should be
possible to retrieve an NSArray of the segments without having to first flatten to a single
buffer.
This patch implements such a method. This will be used in a follow-on patch, where I will
need to pass SharedBuffer data to QuickLook via an NSArray of NSData.
New API test: SharedBufferTest.createNSDataArray.
* platform/SharedBuffer.h: Declared createNSArrayData(), and exported two functions needed
by the API test.
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::createNSDataArray): Added. Returns m_cfData or a copy of m_fileData
if either exist. Otherwise, adds m_buffer (wrapped in a WebCoreSharedBufferData object) and
the objects in m_dataArray to a NSMutableArray and returns it.
2017-01-04 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210296.
This change broke macOS builds.
Reverted changeset:
"Check for the existence of
AVSampleBufferDisplayLayer_Private.h in AVFoundationSPI.h"
https://bugs.webkit.org/show_bug.cgi?id=166691
http://trac.webkit.org/changeset/210296
2017-01-04 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210287.
This change caused editing test failures on macOS.
Reverted changeset:
"Support File Promise during drag for macOS."
https://bugs.webkit.org/show_bug.cgi?id=165204
http://trac.webkit.org/changeset/210287
2017-01-04 Jer Noble <jer.noble@apple.com>
Check for the existence of AVSampleBufferDisplayLayer_Private.h in AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=166691
Reviewed by Eric Carlson.
Move the declaration of AVSampleBufferDisplayLayer SPI into AVFoundationSPI.h and key off the presence of the _Private.h header.
Drive-by Fix: also check for the presence of AVSampleBufferRenderSynchronizer.h before re-declaring AVSampleBufferRenderSynchronizer.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/spi/mac/AVFoundationSPI.h:
2017-01-04 Nan Wang <n_wang@apple.com>
Many new HTML5 input types still exposed as generic AXTextfield
https://bugs.webkit.org/show_bug.cgi?id=109017
<rdar://problem/13658955>
Reviewed by Chris Fleizach.
Provided more detailed role description for input types that
are exposed as standard text fields on the mac.
Changes are covered in modified test expectation.
* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXDateTimeFieldText):
(WebCore::AXMonthFieldText):
(WebCore::AXNumberFieldText):
(WebCore::AXWeekFieldText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXDateTimeFieldText):
(WebCore::AXMonthFieldText):
(WebCore::AXNumberFieldText):
(WebCore::AXWeekFieldText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXDateTimeFieldText):
(WebCore::AXMonthFieldText):
(WebCore::AXNumberFieldText):
(WebCore::AXWeekFieldText):
2017-01-04 Sam Weinig <sam@webkit.org>
Remove bindings/generic and distribute its contents appropriately
https://bugs.webkit.org/show_bug.cgi?id=166700
Rubber-stamped by Alex Christensen.
* CMakeLists.txt:
* DerivedSources.make:
* PlatformMac.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/IDLTypes.h: Copied from Source/WebCore/bindings/generic/IDLTypes.h.
* bindings/generic/ActiveDOMCallback.cpp: Removed.
* bindings/generic/ActiveDOMCallback.h: Removed.
* bindings/generic/IDLTypes.h: Removed.
* bindings/generic/RuntimeEnabledFeatures.cpp: Removed.
* bindings/generic/RuntimeEnabledFeatures.h: Removed.
* dom/ActiveDOMCallback.cpp: Copied from Source/WebCore/bindings/generic/ActiveDOMCallback.cpp.
* dom/ActiveDOMCallback.h: Copied from Source/WebCore/bindings/generic/ActiveDOMCallback.h.
* page/RuntimeEnabledFeatures.cpp: Copied from Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp.
* page/RuntimeEnabledFeatures.h: Copied from Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h.
Move files around.
2017-01-04 Sam Weinig <sam@webkit.org>
Add Exception accessor to ExceptionOr to remove unnecessary releases
https://bugs.webkit.org/show_bug.cgi?id=166692
Reviewed by Alex Christensen.
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabaseBackend):
Use new exception() function.
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::exception):
(WebCore::ExceptionOr<void>::exception):
Add exception() function which returns the exception without releasing it.
2016-01-04 Brent Fulgham <bfulgham@apple.com>
Correct DOMWindow handling during FrameLoader::clear
https://bugs.webkit.org/show_bug.cgi?id=166357
<rdar://problem/29741862>
Reviewed by Andy Estes.
Make sure that we always clean up the DOM window when clearing Window properties, even if the document will
remain in the page cache. Since 'clearWindowShell' is only used in FrameLoader, divide it's beahvior into
two steps:
1. Rename 'clearWindowShell' to 'clearWIndowShellsNotMatchingDOMWindow' to better describe its function.
Switch to a modern C++ loop. Do not switch to the new DOMWindow here, but detach and clear existing
DOMWindow connections.
2. Add a new method 'setDOMWindowForWindowShell'. Complete switch to the new DOMWindow.
This change allows us to disconnect the old DOMWindow, perform the 'setDocument(nullptr)' operation, and then
connect to the new Window without leaving the loader in an inconsistent state.
* loader/bindings/js/ScriptController.cpp:
(WebCore::clearWindowShellsNotMatchingDOMWindow): Renamed from 'clearWindowShell'
(WebCore::setDOMWindowForWindowShell): Added.
* loader/bindings/js/ScriptController.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear): Revise to use the new two-step DOMWindow switch logic.
2017-01-04 Enrica Casucci <enrica@apple.com>
Support File Promise during drag for macOS.
https://bugs.webkit.org/show_bug.cgi?id=165204
rdar://problem/19595567
Reviewed by Tim Horton.
Adds the support for handling File Promise type during
drag. DragData now has the knowledge of the NSFilesPromisePboardType and
checks for the data type during drag.
* page/mac/DragControllerMac.mm:
(WebCore::DragController::dragOperation):
* platform/DragData.h:
(WebCore::DragData::setFileNames):
(WebCore::DragData::fileNames):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsFiles):
(WebCore::DragData::numberOfFiles):
(WebCore::DragData::asFilenames):
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::containsPromise):
(WebCore::DragData::asURL):
2017-01-04 Chris Dumez <cdumez@apple.com>
Assertion hit on redfin.com: ASSERTION FAILED: collection->length() > 1
https://bugs.webkit.org/show_bug.cgi?id=166687
<rdar://problem/29865854>
Reviewed by Darin Adler.
We were mistakenly calling Document::addWindowNamedItem() / Document::removeWindowNamedItem()
for elements in Shadow DOMs. As a result, the windowNamedItem DocumentOrderedMap would
contain elements in shadow DOMs. This would cause the assertion to be hit in window's
named property getter because of the length mismatch between the windowNamedItem
DocumentOrderedMap and the WindowNameCollection.
Tests: fast/shadow-dom/document-named-property.html
fast/shadow-dom/window-named-property.html
* dom/Element.cpp:
(WebCore::Element::updateNameForDocument):
(WebCore::Element::updateIdForDocument):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateDocNamedItem):
2017-01-04 John Wilander <wilander@apple.com>
Validate the BCP47-ness of the language string passed to TrackBase::setLanguage()
https://bugs.webkit.org/show_bug.cgi?id=123926
Reviewed by Jer Noble.
Test: media/media-source/only-bcp47-language-tags-accepted-as-valid.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::configureTextTrackGroup):
Log message now includes the valid BCP 47 language too.
(WebCore::HTMLMediaElement::setSelectedTextTrack):
Now sets preferred language to the valid BCP 47 language.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::setLanguage):
Removed fixme and aligned comments with new behavior.
* html/track/TrackBase.cpp:
(WebCore::TrackBase::TrackBase):
Initializes m_validBCP47Language with language parameter.
(WebCore::isValidBCP47LanguageTag):
New convenience function.
(WebCore::TrackBase::setLanguage):
Sets m_validBCP47Language if the incoming tag is valid.
Produces a console warning if the tag is invalid.
The member m_language is set to the incoming tag regardless.
(WebCore::TrackBase::validBCP47Language):
New getter for valid language tag. To be used internally.
* html/track/TrackBase.h:
New AtomicString member m_validBCP47Language.
(WebCore::TrackBase::setLanguage): Deleted.
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::setLanguage):
Removed fixme and aligned comments with new behavior.
* page/CaptionUserPreferences.cpp:
(WebCore::trackDisplayName):
Now uses the getter for BCP 47 language.
(WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore):
Now uses the getter for BCP 47 language.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::buildDisplayStringForTrackBase):
Now uses the getter for BCP 47 language.
(WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore):
Now uses the getter for BCP 47 language.
(WebCore::textTrackCompare):
Now uses the getter for BCP 47 language.
(WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu):
Now uses the getter for BCP 47 language.
2017-01-04 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues with Inspector showing Resource
https://bugs.webkit.org/show_bug.cgi?id=165569
<rdar://problem/29607569>
Reviewed by Youenn Fablet.
Test: http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
* loader/ThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::LoaderTaskOptions::LoaderTaskOptions):
Add a new ThreadableLoader option to avoid filtering the response.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
Disable filtering of the response. This is an internal load, we
don't want to filter data that would be valuable later.
2017-01-03 Sam Weinig <sam@webkit.org>
Remove final custom binding from IDBRequest
https://bugs.webkit.org/show_bug.cgi?id=166671
Reviewed by Alex Christensen.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove JSIDBRequestCustom.cpp
* bindings/js/JSIDBRequestCustom.cpp: Removed.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::~IDBRequest):
(WebCore::IDBRequest::result):
(WebCore::IDBRequest::setSource):
(WebCore::IDBRequest::sourceObjectStoreIdentifier):
(WebCore::IDBRequest::sourceIndexIdentifier):
(WebCore::IDBRequest::requestedIndexRecordType):
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
(WebCore::IDBRequest::setResultToUndefined):
(WebCore::IDBRequest::resultCursor):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBRequest::source): Deleted.
(WebCore::IDBRequest::clearResult): Deleted.
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::source):
(WebCore::IDBRequest::cursorResult): Deleted.
(WebCore::IDBRequest::databaseResult): Deleted.
(WebCore::IDBRequest::scriptResult): Deleted.
Replace multiple member variables with Variants for source and result. Add a result
member function that properly sets an exception if not "done".
* Modules/indexeddb/IDBRequest.idl:
Remove CustomGetter annotation and add type.
* bindings/generic/IDLTypes.h:
(WebCore::IDLAny::nullValue):
(WebCore::IDLAny::isNullValue):
(WebCore::IDLAny::extractValueFromNullable):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLAny>::convert):
Flesh out IDLAny to be implemented as a Strong<Unknown> when used in aggregate types,
but still work with JSValue when passing as a parameter.
* inspector/InspectorIndexedDBAgent.cpp:
Update for new return value of IDBRequest::result().
2017-01-04 Tim Horton <timothy_horton@apple.com>
Provide a setting for clients to always prefer low-power WebGL
https://bugs.webkit.org/show_bug.cgi?id=166675
<rdar://problem/29834093>
Reviewed by Dan Bernstein.
No new tests; as noted in r204664, we don't know how to reliably test
automatic graphics switching. One could use the manual test introduced
in that commit; after this commit, with the setting switched on, on a
dual-GPU machine that is actively using integrated graphics, that test
should return the same result for both contexts.
* page/Settings.in:
Add a setting to prefer low-power WebGL.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
If said setting is enabled, set preferLowPowerToHighPerformance.
2017-01-03 Ryosuke Niwa <rniwa@webkit.org>
label element with tabindex >= 0 is not focusable
https://bugs.webkit.org/show_bug.cgi?id=102780
<rdar://problem/29796608>
Reviewed by Darin Adler.
Fixed the bug by removing the override for HTMLLabelElement::isFocusable which always returned false.
This is a behavior from r5532 but it doesn't match the latest HTML specification or that of Chrome
and Firefox.
Also fixed an existing bug in HTMLLabelElement::focus and HTMLLegendElement::focus which focused
the associated form control when there is one even if the element itself is focusable. Without this fix,
traversing from control with shift+tab would break since focusing the label would move the focus back
to the input element inside the label element.
Finally, fixed a bug in HTMLLegendElement::focus that we can call inFocus without updating layout first.
The fix was inspired by https://chromium.googlesource.com/chromium/src/+/085ad8697b1be50c4f93e296797a25a43a79bcfb
Test: fast/events/focus-label-legend-elements-with-tabindex.html
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::focus):
(WebCore::HTMLLabelElement::isFocusable): Deleted.
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::focus):
2017-01-03 Tim Horton <timothy_horton@apple.com>
NSSpellChecker's recordResponse isn't called for unseen automatic corrections
https://bugs.webkit.org/show_bug.cgi?id=166450
<rdar://problem/29447824>
Reviewed by Darin Adler.
Test: editing/mac/spelling/accept-unseen-candidate-records-acceptance.html
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::recordAutocorrectionResponse):
(WebCore::AlternativeTextController::recordAutocorrectionResponseReversed): Deleted.
* editing/AlternativeTextController.h:
Add recordAutocorrectionResponse, which takes a AutocorrectionResponseType, instead of having
a function specifically for reverted autocorrections. Also, get rid of the unnecessary indirection
of the private overload of recordAutocorrectionResponseReversed, since there's only one caller.
* editing/Editor.cpp:
(WebCore::Editor::markAndReplaceFor):
Call recordAutocorrectionResponse with Accepted when performing an auto-autocorrection.
(WebCore::Editor::changeBackToReplacedString):
Adopt recordAutocorrectionResponse.
* page/AlternativeTextClient.h:
Add an "AutocorrectionAccepted" response type.
2017-01-03 Nan Wang <n_wang@apple.com>
AX: Focus should jump into modal dialogs when one appears
https://bugs.webkit.org/show_bug.cgi?id=166670
Reviewed by Chris Fleizach.
Added a timer to let focus jump into a modal dialog if the web
author didn't handle the focus movement.
Test: accessibility/mac/aria-modal-auto-focus.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::firstFocusableChild):
(WebCore::AXObjectCache::focusAriaModalNode):
(WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
(WebCore::AXObjectCache::handleAriaModalChange):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::focusAriaModalNode):
2017-01-03 Andy Estes <aestes@apple.com>
Rename SharedBufferMac.mm to SharedBufferCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=166666
Reviewed by Tim Horton.
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/SharedBufferCocoa.mm: Renamed from Source/WebCore/platform/mac/SharedBufferMac.mm.
2017-01-03 Sam Weinig <sam@webkit.org>
Re-implement ExceptionOr on top of WTF::Expected
https://bugs.webkit.org/show_bug.cgi?id=166668
Reviewed by Alex Christensen.
As a first step towards using WTF::Expected instead of ExceptionOr,
use Expected as an implementation detail, rather than Variant/std::optional.
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
Add missing #include of Variant.h
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::ExceptionOr):
(WebCore::ExceptionOr<ReturnType>::hasException):
(WebCore::ExceptionOr<ReturnType>::releaseException):
(WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
(WebCore::ExceptionOr<void>::ExceptionOr):
(WebCore::ExceptionOr<void>::hasException):
(WebCore::ExceptionOr<void>::releaseException):
Re-implement on top of Expected.
2017-01-03 Chris Dumez <cdumez@apple.com>
Make setting Event's cancelBubble to false a no-op
https://bugs.webkit.org/show_bug.cgi?id=166018
Reviewed by Ryosuke Niwa.
Align behavior of Event.cancelBubble with the latest DOM specification:
- https://dom.spec.whatwg.org/#dom-event-cancelbubble
Setting it to true sets the 'stop propagation' flag to true and setting
it to false is now a no-op.
Tests: imported/w3c/web-platform-tests/dom/events/Event-cancelBubble.html
imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubble-canceled.html
imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-cancelBubble.html
* Modules/indexeddb/IDBEventDispatcher.cpp:
(WebCore::IDBEventDispatcher::dispatch):
* dom/Event.h:
(WebCore::Event::cancelBubble):
(WebCore::Event::setCancelBubble):
* dom/EventDispatcher.cpp:
(WebCore::dispatchEventInDOM):
2017-01-03 Jer Noble <jer.noble@apple.com>
Check for the existence of AVSampleBufferAudioRenderer.h before redeclaring AVSampleBufferAudioRenderer
https://bugs.webkit.org/show_bug.cgi?id=166421
<rdar://problem/29782862>
Reviewed by Dan Bernstein.
Follow up after r210099; fix the __has_include directive to include the framework and fix the #import inside #if.
* platform/spi/mac/AVFoundationSPI.h:
2017-01-03 Andreas Kling <akling@apple.com>
REGRESSION(r210226): fast/history/back-from-page-with-focused-iframe.html crashes under GuardMalloc
<https://webkit.org/b/166657>
<rdar://problem/29848806>
Reviewed by Antti Koivisto.
The problem was that tearDownRenderers() would cause commit Widget hierarchy updates
before returning, which is just before Document clears its m_renderView pointer.
This led to an awkward callback into Page::setActivityState() which ended up trying
to clear the selection inside a partially dead render tree.
Fix this by adding a WidgetHierarchyUpdatesSuspensionScope to Document::destroyRenderTree()
which ensures that Widget updates don't happen until after Document::m_renderView is cleared.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
2017-01-03 Andreas Kling <akling@apple.com>
Placeholder style mechanism leaks CSSFontSelector for first Document styled.
<https://webkit.org/b/166652>
Reviewed by Antti Koivisto.
The placeholder style is used when we're resolving style for a non-rendered
element, or any element before stylesheets have loaded.
An old optimization had us reusing the same style each time, which meant that
since it was initialized with a font selector the first time, it kept that
font selector alive forever.
As we have to clone the style anyway, fix this by just making a new style
each time, using the current document's font selector.
* style/StyleTreeResolver.cpp:
(WebCore::Style::makePlaceholderStyle):
(WebCore::Style::TreeResolver::TreeResolver):
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::ensurePlaceholderStyle): Deleted.
(WebCore::Style::isPlaceholderStyle): Deleted.
* style/StyleTreeResolver.h:
2017-01-03 Carlos Alberto Lopez Perez <clopez@igalia.com>
A floating element within <li> overlaps with the marker
https://bugs.webkit.org/show_bug.cgi?id=166528
Reviewed by Zalan Bujtas.
Merged from Blink (patch by trobhogan@gmail.com):
https://crrev.com/c896e79e5ba348d7ed87438cd3a19d0176f3036d
https://crbug.com/548616
Establish a list marker's offset before floats have been added to its line.
Computing the offset for a list marker after the rest of the objects on the line
it is on have been laid out, means it will avoid floats it ought not to.
Instead, compute the offset when laying out the marker and cache it for use later.
Tests: fast/lists/list-marker-before-float-nested-rtl.html
fast/lists/list-marker-before-float-nested.html
fast/lists/list-marker-before-float-rtl.html
fast/lists/list-marker-before-float.html
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::RenderListMarker):
(WebCore::RenderListMarker::layout):
* rendering/RenderListMarker.h:
2017-01-03 Per Arne Vollan <pvollan@apple.com>
[Win] Some xmlhttprequest tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=166638
Reviewed by Darin Adler.
The tests are failing because the request timeout is set to zero.
When the timeout is set to zero, we should use the default timeout.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2017-01-02 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, follow-up fix for r210227
https://bugs.webkit.org/show_bug.cgi?id=166586
Suggested in the above bug.
* bindings/scripts/StaticString.pm:
(GenerateStrings):
2017-01-02 Yusuke Suzuki <utatane.tea@gmail.com>
Use StaticStringImpl instead of StaticASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=166586
Reviewed by Darin Adler.
* bindings/scripts/StaticString.pm:
(GenerateStrings):
2017-01-02 Andreas Kling <akling@apple.com>
Drop the render tree for documents in the page cache.
<https://webkit.org/b/121798>
Reviewed by Antti Koivisto.
To save memory and reduce complexity, have documents tear down their render tree
when entering the page cache. I've wanted to do this for a long time and it seems
like we can actually do it now.
This patch will enable a number of clean-ups since it's no longer valid for renderers
to exist while the document is in page cache.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree): Remove assertion that we're not in the page cache
since we will now be tearing down render trees right as they enter the page cache.
* dom/PageCache.cpp:
(WebCore::destroyRenderTree):
(WebCore::PageCache::addIfCacheable): Tear down the render tree right before setting
the in-cache flag. The render tree is destroyed in bottom-up order to ensure that the
main frame renderers die last.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::didRestoreFromPageCache): Update the scollable area set after restoring
a frame from the page cache. This dirties the scrolling tree, which was covered by tests.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/AnimationController.cpp:
(WebCore::AnimationController::cancelAnimations): Make these no-ops if called
while the render tree is being torn down. This fixes some assertion failures
on layout tests and avoids pointless style invalidation.
2017-01-02 Andreas Kling <akling@apple.com>
Discard media controls JS/CSS caches under memory pressure.
<https://webkit.org/b/166639>
Reviewed by Antti Koivisto.
Add a RenderTheme::purgeCaches() virtual and teach the iOS and macOS implementations
to drop their cached media controls JS/CSS strings there. The strings are only cleared
if nothing else is referencing them, which gives us a decent "weak cache" behavior.
This sheds ~300kB memory on iOS with the current media controls.
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::purgeCaches):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::purgeCaches):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::purgeCaches):
2017-01-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Since the memory pressure relief has been activated, my disk has a high usage and the desktop stalls
https://bugs.webkit.org/show_bug.cgi?id=164052
Reviewed by Michael Catanzaro.
Check how much memory is freed by the memory pressure handler and wait for a long time if we didn't free that
much.
* platform/linux/MemoryPressureHandlerLinux.cpp:
(WebCore::MemoryPressureHandler::EventFDPoller::EventFDPoller):
2017-01-02 Chris Fleizach <cfleizach@apple.com>
AX: Expose block quote level to iOS API
https://bugs.webkit.org/show_bug.cgi?id=166629
<rdar://problem/29834793>
Reviewed by Darin Adler.
Expose the blockquote level to iOS Accessbility API.
Change the return type of blockquote level to unsigned.
Test: accessibility/ios-simulator/blockquote-level.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::blockquoteLevel):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityBlockquoteLevel]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2017-01-01 Jeff Miller <jeffm@apple.com>
Update user-visible copyright strings to include 2017
https://bugs.webkit.org/show_bug.cgi?id=166278
Reviewed by Dan Bernstein.
* Info.plist:
2017-01-01 Zan Dobersek <zdobersek@igalia.com>
GraphicsContextCairo: setMiterLimit() is missing the DisplayListRecorder diversion
https://bugs.webkit.org/show_bug.cgi?id=166539
Reviewed by Michael Catanzaro.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::setMiterLimit): Call the setMiterLimit() method on the
m_displayListRecorder object when the GraphicsContext object is in recording mode.
2017-01-01 Zan Dobersek <zdobersek@igalia.com>
Clean up GraphicsContext3D forward declarations, header inclusion
https://bugs.webkit.org/show_bug.cgi?id=166537
Reviewed by Alex Christensen.
Remove two unnecessary GraphicsContext3D forward declarations from the
EmptyClients and ChromeClient header files, and remove the unnecessary
GraphicsContext3D.h header inclusion from RenderLayerBacking.
No changes in behavior.
* loader/EmptyClients.h:
* page/ChromeClient.h:
* rendering/RenderLayerBacking.cpp:
2016-12-31 Michael Catanzaro <mcatanzaro@igalia.com>
SecurityOrigin::create triplet constructor does not canonicalize port
https://bugs.webkit.org/show_bug.cgi?id=166624
Reviewed by Daniel Bates.
It is currently possible to create two different unequal SecurityOrigin objects that
represent the same security origin. The SecurityOrigin create functions that take URL and
String parameters convert the port to nullopt if it is the default port for the protocol,
but the separate protocol/host/port constructor doesn't. Change it to parallel the other
constructors.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::create):
* page/SecurityOrigin.h: Export isSameOriginAs for use by tests.
2016-12-25 Darin Adler <darin@apple.com>
Remove setDOMException and a few custom bindings
https://bugs.webkit.org/show_bug.cgi?id=166002
Reviewed by Sam Weinig.
* CMakeLists.txt: Removed JSFileReaderCustom.cpp.
* WebCore.xcodeproj/project.pbxproj: Removed JSFileReaderCustom.cpp.
* bindings/js/CallbackFunction.cpp:
(WebCore::checkFunctionOnlyCallback): Use throwTypeMismatchError instead
of calling setDOMException with TYPE_MISMATCH_ERR.
* bindings/js/JSBindingsAllInOne.cpp: Removed JSFileReaderCustom.cpp.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate): Pass a throw scope in to
propagateException.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier):
Renamed from getAlgorithmIdentifier. Got rid of bool return value, instead
use a conventional return value and conventional JavaScript exception
handling. Added a ThrowScope argument.
(WebCore::optionalHashAlgorithm): Added. Returns an optional hash algorithm.
Also makes the same changes as above, conventional exception handling and
ThrowScope argument.
(WebCore::requiredHashAlgorithm): Added. Like the above but throws an
exception if the algorithm is omitted.
(WebCore::getHashAlgorithm): Deleted. Replaced by the two functions above.
(WebCore::createAesCbcParams): Updated for above changes.
(WebCore::createHmacParams): Ditto.
(WebCore::createHmacKeyParams): Ditto.
(WebCore::createRsaKeyGenParams): Ditto.
(WebCore::createRsaOaepParams): Ditto.
(WebCore::createRsaSsaParams): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): Added
a ThrowScope argument, and changed to use throwNotSupportedError instead
of setDOMException with NOT_SUPPORTED_ERROR.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Ditto.
(WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Ditto.
* bindings/js/JSCryptoAlgorithmDictionary.h: Updated for the above changes.
* bindings/js/JSCryptoOperationData.cpp:
(WebCore::cryptoOperationDataFromJSValue): Got rid of bool return value and
instead use a conventional return value and conventional JS exception handling.
Added a ThrowScope argument.
* bindings/js/JSCryptoOperationData.h: Updated for the above.
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::create): Use ExceptionOr.
(WebCore::JSCustomXPathNSResolver::JSCustomXPathNSResolver): Take a VM&
rather than an ExecState*.
* bindings/js/JSCustomXPathNSResolver.h: Updated for the changes above.
Also marked class final and fixed indentation.
* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException): Updated comment.
(WebCore::throwDOMException): Deleted.
(WebCore::propagateException): Deleted non-inline overload that does not take
a throw scope, now that all callers pass a throw scope.
(WebCore::setDOMExceptionSlow): Deleted.
(WebCore::setDOMException): Deleted.
(WebCore::throwNotSupportedError): Added.
(WebCore::throwDOMSyntaxError): Added.
(WebCore::throwDataCloneError): Added.
(WebCore::throwIndexSizeError): Added.
(WebCore::throwTypeMismatchError): Added.
* bindings/js/JSDOMBinding.h: Updated for the additions and removals
above. Also grouped the standard DOM exception throwing functions separately
from the special ones for getters and setters, and sorted them alphabetically.
* bindings/js/JSDataCueCustom.cpp:
(WebCore::createJSDataCue): Added, helper function for the below.
(WebCore::constructJSDataCue): Tightened and tweaked a bit.
* bindings/js/JSFileReaderCustom.cpp: Removed.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength): Use throwIndexSizeError instead
of setDOMException with INDEX_SIZE_ERR.
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter): Use throwTypeMismatchError instead of
setDOMExceptoin with TYPEMISMATCH_ERR.
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result): Pass a throw scope in to
propagateException.
* bindings/js/JSSQLResultSetRowListCustom.cpp:
(WebCore::JSSQLResultSetRowList::item): Use throwTypeMismatchError and
throwIndexSizeError instead of setDOMException with TYPE_MISMATCH_ERR and
INDEX_ERR. This required adding a throw scope.
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql): Use throwDOMSyntaxError and
throwTypeMismatchError instead of setDOMException with SYNTAX_ERR and
TYPE_MISMATCH_ERR.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Pass a throw scope in to
propagateException.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters): Use throwNotSupportedError
instead of setDOMException with NOT_SUPPORTED_ERR.
(WebCore::createAlgorithm): Deleted.
(WebCore::supportExportKeyThrow): Added ThrowScope argument and use
throwNotSupportedError instead of setDOMException with NOT_SUPPORTED_ERR.
(WebCore::jsSubtleCryptoFunctionEncryptPromise): Updated for above changes,
throwing a not supported exception at this level rather than in a helper.
(WebCore::jsSubtleCryptoFunctionDecryptPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionSignPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionVerifyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionDigestPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionImportKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionExportKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise): Ditto.
(WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise): Ditto.
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::createAlgorithmFromJSValue): Got rid of bool return value and
instead use a conventional return value and conventional JS exception handling.
Added a ThrowScope argument.
(WebCore::cryptoKeyFormatFromJSValue): Ditto.
(WebCore::cryptoKeyUsagesFromJSValue): Ditto.
(WebCore::JSWebKitSubtleCrypto::encrypt): Updated for above changes.
(WebCore::JSWebKitSubtleCrypto::decrypt): Ditto.
(WebCore::JSWebKitSubtleCrypto::sign): Ditto.
(WebCore::JSWebKitSubtleCrypto::verify): Ditto.
(WebCore::JSWebKitSubtleCrypto::digest): Ditto.
(WebCore::JSWebKitSubtleCrypto::generateKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::importKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::exportKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::wrapKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::unwrapKey): Ditto.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send): Pass a throw scope in to
propagateException.
(WebCore::JSXMLHttpRequest::responseText): Ditto.
* bindings/js/JSXPathNSResolverCustom.cpp:
(WebCore::JSXPathNSResolver::toWrapped): Updated since
JSCustomXPathNSResolver::create now uses ExceptionOr.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::maybeThrowExceptionIfSerializationFailed): Updated to take
a reference instead of a pointer. Fixed the handling of success to be
simpler; no need to check the code twice. Use throwDataCloneError instead
of setDOMException with DATA_CLONE_ERR.
(WebCore::SerializedScriptValue::create): Updated for above.
(WebCore::SerializedScriptValue::deserialize): Ditto.
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBuffer): Use throwDataCloneError instead of
setDOMException with DATA_CLONE_ERR.
(WebCore::structuredCloneArrayBufferView): Ditto.
* crypto/CryptoAlgorithmParametersDeprecated.h: Removed unneeded empty
constructor.
* crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Ditto,
moving initialization to where the data member is defined.
* crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Ditto.
* crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Ditto.
* fileapi/FileReader.cpp:
(WebCore::FileReader::result): Added. Returns a combination of optional
and variant that matches what the ID specifies. Moved the code from the
two following functions in here.
(WebCore::FileReader::arrayBufferResult): Deleted.
(WebCore::FileReader::stringResult): Deleted.
* fileapi/FileReader.h: Updated for the above.
* fileapi/FileReader.idl: Removed [Custom] from the result attribute and
declared it with the type mentioned in the specification, a nullable union.
2016-12-30 Darin Adler <darin@apple.com>
Remove PassRefPtr use from the "dom" directory, related cleanup
https://bugs.webkit.org/show_bug.cgi?id=166569
Reviewed by Alex Christensen.
* CMakeLists.txt: Removed DocumentMarker.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state): Pass ExecState by reference.
* dom/CharacterData.cpp:
(WebCore::CharacterData::dispatchModifiedEvent): Use auto.
* dom/DOMAllInOne.cpp: Removed DocumentMarker.cpp.
* dom/DOMNamedFlowCollection.cpp:
(WebCore::DOMNamedFlowCollection::DOMNamedFlowCollection): Updated to take
ownership of the passed in vector.
(WebCore::DOMNamedFlowCollection::create): Moved here from header.
(WebCore::DOMNamedFlowCollection::~DOMNamedFlowCollection): Moved here so we
don't need to include "WebKitNamedFlow.h" in the header.
(WebCore::DOMNamedFlowCollection::item): Rewrote to use Vector.
(WebCore::DOMNamedFlowCollection::namedItem): Rewrote to use a HashSet that
we build from the Vector. Uses a set of hash functions defined right here.
Note that the privor version of this class had incorrect use of ListHashSet
with safeToCompareToEmptyOrDeleted inaccurately set to true.
(WebCore::DOMNamedFlowCollection::supportedPropertyNames): Added this.
Old version just had an empty placeholder.
* dom/DOMNamedFlowCollection.h: Changed to no longer use ListHashSet, not
the right data structure for this. Removed incorrect use of "long" and
made some other simplifications.
* dom/DOMNamedFlowCollection.idl: Changed return types of item and namedItem
to accurately reflect the fact that they return null when the index or name
not found in the collection.
* dom/DataTransfer.h: Remove indentation. Remove unimplemented
incorrect declarations of items for ENABLE(DATA_TRANSFER_ITEMS).
Will be added back when someone implements that feature, or perhaps
ENABLE(DATA_TRANSFER_ITEMS) should be entirely removed for now?
* dom/DataTransferItem.h: Changed return type for getAsFile to
RefPtr. Again, part of ENABLE(DATA_TRANSFER_ITEMS), so dead code for now.
* dom/Document.cpp:
(WebCore::canonicalizedTitle): Removed incorrect comment claiming we
convert control characters to spaces. Simplified logic, removing two
extra loops. Changed to work on just a String rather than StringWithDirection.
(WebCore::Document::updateTitle): Updated to call the function above.
Also updated since StringWithDirection is now a struct instead of a class.
Call displayBuffer on the encoding directly instead of calling a member
function named displayBufferModifiedByEncoding.
(WebCore::Document::updateTitleFromTitleElement): Updated since
StringWithDirection is now a struct.
(WebCore::Document::setTitle): Removed code that unnecessarily calls
updateTitle twice; once indirectly by calling setTextContent on the
title elmeent and once by directly calling updateTitle.
(WebCore::Document::setWindowAttributeEventListener): Take a RefPtr&&.
(WebCore::Document::statePopped): Take a Ref&&.
(WebCore::Document::displayStringModifiedByEncoding): Deleted unused overload.
(WebCore::Document::displayBufferModifiedByEncodingInternal): Deleted.
(WebCore::Document::requestAnimationFrame): Take a Ref&&.
* dom/Document.h: Updated for changes above. Also changed the title function
to return a const String& to slightly cut down on reference count churn.
(WebCore::Document::displayBufferModifiedByEncoding): Deleted.
* dom/DocumentMarker.cpp: Removed.
* dom/DocumentMarker.h: Reworked the DocumentMarker class to use a variant
instead of a separate reference counted DocumentMarkerDetails object.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarkerToNode): Changed argument
type to DocumentMarker::Data&&.
(DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
clearDetails -> clearData
(DocumentMarkerController::showMarkers): activeMatch -> isActiveMatch
* dom/DocumentMarkerController.h: Updated for the above.
* dom/DocumentParser.h: Fixed incorrect reference to PassRefPtr in a comment.
* dom/Element.cpp:
(WebCore::Element::willModifyAttribute): Use auto.
* dom/Event.cpp:
(WebCore::Event::isDragEvent): Deleted. Unused.
(WebCore::Event::cloneFor): Deleted. Unused function left over from the
start of an implementation of seamless frames.
* dom/Event.h: Updated for the above.
* dom/EventContext.cpp: Tweaked blank lines.
* dom/EventContext.h: Removed unnecessary includes and forward declarations.
Changed setRelatedTarget to take a raw pointer instead of PassRefPtr since
callers aren't passing ownership. Moved TouchEventContext::touchList body
out of the class definition since it's a bit long. Deleted unused
toTouchEventContext functions. FIxed incorrect comment.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent): Removed unused overload.
* dom/MessageEvent.h: Updated for above. Also changed the
dataAsSerializedScriptValue function to return a raw pointer instead of
PassRefPtr since it is not passing ownership.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create): Use raw pointer instead of PassRefPtr for
data transfer and related target arguments.
(WebCore::MouseEvent::MouseEvent): Ditto. Also use IntPoint instead of
separate ints for the various X/Y pairs.
(WebCore::MouseEvent::initMouseEvent): Take a raw pointer for event target.
(WebCore::MouseEvent::isDragEvent): Reformatted, sorted alphabetically,
added comment about why this function probably needs to go.
(WebCore::adjustedClientX): Deleted.
(WebCore::adjustedClientY): Deleted.
(WebCore::MouseEvent::cloneFor): Deleted.
* dom/MouseEvent.h: Updated for the above. Also made more functions private
and final and initialized more of the data members.
* dom/MutationEvent.cpp:
(WebCore::MutationEvent::MutationEvent): Pass related node as a raw pointer.
(WebCore::MutationEvent::initMutationEvent): Ditto.
* dom/MutationEvent.h: Updated for the above. Fixed indentation. Removed
unnecessary explicit destructor; default generated one is fine. Initialize
m_attrChange in the class definition.
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe): Pass reference.
(WebCore::MutationObserver::disconnect): Call unregisterMutationObserver
directly instead of calling unregisterAndDelete.
* dom/MutationObserverInterestGroup.cpp:
(WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
Take an rvalue reference to the HashMap and use move.
(WebCore::MutationObserverInterestGroup::createIfNeeded): Updated to call
registeredMutationObservers.
* dom/MutationObserverInterestGroup.h: Updated for the above.
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::MutationObserverRegistration):
Take a reference to the observer instead of PassRefPtr. Also take a
refererence to the node rather than a pointer.
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
Updated to use references instead of pointers.
(WebCore::MutationObserverRegistration::clearTransientRegistrations): Ditto.
(WebCore::MutationObserverRegistration::unregisterAndDelete): Deleted.
(WebCore::MutationObserverRegistration::shouldReceiveMutationFrom): Ditto.
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet): Ditto.
* dom/MutationObserverRegistration.h: Updated for above changes. Also added
a node member function. Changed m_observer to a Ref and m_node to a reference.
Removed the NodeHashSet typedef.
* dom/NamedFlowCollection.cpp:
(WebCore::NamedFlowCollection::createCSSOMSnapshot): Pass a vector of Ref
instead of a vector of raw pointers and pass it as an rvalue reference so
it can be taken over by the named flow collection wrapper.
* dom/Node.cpp:
(WebCore::Node::mutationObserverRegistry): Use auto and nullptr.
(WebCore::Node::transientMutationObserverRegistry): Ditto.
(WebCore::collectMatchingObserversForMutation): Use references instead of pointers.
(WebCore::Node::registeredMutationObservers): Changed to return a map instead of
filling one in and renamed to remove "get" from name.
(WebCore::Node::registerMutationObserver): Use references instead of pointers.
(WebCore::Node::unregisterMutationObserver): Ditto.
(WebCore::Node::registerTransientMutationObserver): Ditto.
(WebCore::Node::unregisterTransientMutationObserver): Ditto.
(WebCore::Node::notifyMutationObserversNodeWillDetach): Ditto.
* dom/Node.h: Updated for the above.
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent): Use RefPtr&& instead of PassRefPtr.
(WebCore::PopStateEvent::create): Use a raw pointer instead of PassRefPtr.
(WebCore::PopStateEvent::trySerializeState): Take a reference to ExecState.
* dom/PopStateEvent.h: Updated for the above.
* dom/Position.cpp:
(WebCore::Position::Position): Take a raw pointer instead of PassRefPtr.
(WebCore::Position::moveToPosition): Ditto.
* dom/Position.h: Updated for the above, also changed createLegacyEditingPosition
in the same way and got rid of the LegacyEditingPosition class.
* dom/Range.cpp:
(WebCore::Range::Range): Changed startContainer and endContainer to RefPtr<Node>&&.
Later this needs to be changed more, but for now this keeps code changes to a minimum.
(WebCore::Range::create): Changed startContainer and endContainer to Node*.
* dom/Range.h: Updated for the above.
* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::dispatchEvent): Removed a comment that talks about
PassRefPtr, and simplified the code since the comment is no longer valid.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::PendingException::PendingException):
Take a RefPtr&& instead of a PassRefPtr.
(WebCore::ScriptExecutionContext::ScriptExecutionContext): Moved initialization
of all the data members up to the class definition.
(WebCore::ScriptExecutionContext::sanitizeScriptError): Use ASCIILiteral.
(WebCore::ScriptExecutionContext::reportException): Use WTFMove when passing
arguments to the PendingException constructor and using a value from the
PendingException just before destroying it.
* dom/ScriptExecutionContext.h: Changed addTimeout to take a reference rather
than a PassRefPtr to the timer. Callers were not passing ownership. Also
initialize all the data members here in the class definition.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::registerCallback): Take a Ref&&.
* dom/ScriptedAnimationController.h: Updated for the above.
* dom/SimulatedClick.cpp:
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Updated since MouseEvent
constructor arguments changed to use IntPoint.
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent): Ditto. Also removed some unneeded initializers
now that the header does more.
(WebCore::WheelEvent::initWheelEvent): Tweaed style a bit.
(WebCore::WheelEvent::initWebKitWheelEvent): Deleted. Moved to the header since it's
just an inline that forwards to initWheelEvent.
* dom/WheelEvent.h: Updated for the above.
* dom/make_event_factory.pl:
(generateImplementation): Use RefPtr instead of PassRefPtr. A couple other tweaks.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use the data
insetad of details.
(WebCore::AlternativeTextController::removeDictationAlternativesForMarker):
Ditto, also changed to take reference instead of pointer.
(WebCore::AlternativeTextController::dictationAlternativesForMarker): Ditto.
(WebCore::AlternativeTextController::applyDictationAlternative): Ditto.
* editing/AlternativeTextController.h: Updated for the above.
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
Updated since Position now takes a raw pointer.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::joinChildTextNodes): Ditto.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::replaceSelectedTextInNode): Ditto.
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): Ditto.
* editing/DictationCommand.cpp:
(WebCore::DictationMarkerSupplier::addMarkersToTextNode): Updated to use the
DictationData struct.
* editing/Editor.cpp:
(WebCore::Editor::updateMarkersForWordsAffectedByEditing): Pass a reference.
(WebCore::Editor::dictationAlternativesForMarker): Take a reference.
* editing/Editor.h: Updated for the above.
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::performOverwrite): Updated since Position now takes
a raw pointer.
(WebCore::InsertTextCommand::doApply): Ditto.
(WebCore::InsertTextCommand::insertTab): Ditto.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition): Ditto.
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::computedTextWithDirection): Updated since
StringWithDirection is now a struct.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm): Use Ref&& for the form submission.
(WebCore::FrameLoader::receivedFirstData): Updated for change to StringWithDirection.
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::didBeginDocument): Pass a reference.
(WebCore::FrameLoader::loadURLIntoChildFrame): Pass a Ref to loadArchive.
(WebCore::FrameLoader::loadArchive): Take a Ref&& for the archive.
(WebCore::FrameLoader::loadInSameDocument): Take a raw pointer for the
serialized script value state object. No one was passing ownership.
But pass it along to statePopped as a Ref since we need to pass ownership
of the null value, at least for now.
(WebCore::FrameLoader::loadFrameRequest): Take a raw pointer for form state.
No one was passing ownership.
(WebCore::FrameLoader::loadURL): Ditto.
(WebCore::FrameLoader::load): Ditto.
(WebCore::FrameLoader::loadWithNavigationAction): Ditto.
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::loadPostRequest): Ditto.
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Ditto.
* loader/FrameLoader.h: Updated for the above and to remove an unneeded forward
declaration of StringWithDirection, which is not used here.
* loader/FrameLoaderClient.h: Updated forward declaration of StringWithDirection.
Also sorted the others and removed unneeded conditionals.
* loader/HistoryController.cpp:
(WebCore::HistoryController::setCurrentItemTitle): Updated to use struct.
(WebCore::HistoryController::initializeItem): Ditto.
* loader/HistoryController.h: Updated forward declaration of StringWithDirection.
* loader/PolicyCallback.cpp:
(WebCore::PolicyCallback::PolicyCallback): Deleted. Default works fine.
(WebCore::PolicyCallback::~PolicyCallback): Ditto.
(WebCore::PolicyCallback::set): Take a raw pointer to form state.
* loader/PolicyCallback.h: Use raw pointer for form state.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): Take a raw pointer for form state.
(WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
* loader/PolicyChecker.h: Updated for the above.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer): Pass reference to addTimeout function.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::requestAnimationFrame): Use Ref&& for callback.
(WebCore::DOMWindow::webkitRequestAnimationFrame): Ditto.
(WebCore::DOMWindow::cancelAnimationFrame): Tweak coding style.
* page/DOMWindow.h: Updated for the above.
* platform/PlatformWheelEvent.h: Use pragma once. Tweaked header indentation.
Simplified constructors by initializing data members.
* platform/text/StringWithDirection.h: Use pragma once. Use struct instead of class.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::dictationAlternatives): Pass a reference.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintTextMatchMarker): activeMatch -> isActiveMatch
2016-12-30 Darin Adler <darin@apple.com>
Remove PassRefPtr use from the "css" directory, related cleanup
https://bugs.webkit.org/show_bug.cgi?id=166628
Reviewed by Alex Christensen.
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcBinaryOperation::create): Take RefPtr&& instead of PassRefPtr.
Also added some checks for null. Code here is really inconsistent about null;
probably should change from RefPtr to Ref at some point.
(WebCore::CSSCalcBinaryOperation::createSimplified): Ditto.
(WebCore::CSSCalcBinaryOperation::CSSCalcBinaryOperation): Take Ref&& instead
of PassRefPtr.
* css/CSSCrossfadeValue.cpp:
(WebCore::subimageKnownToBeOpaque): Take a reference instead of a pointer.
(WebCore::CSSCrossfadeValue::SubimageObserver::SubimageObserver): Moved here
from the header, and renamed.
(WebCore::CSSCrossfadeValue::SubimageObserver::imageChanged): Ditto.
(WebCore::CSSCrossfadeValue::CSSCrossfadeValue): Moved here from the header.
(WebCore::CSSCrossfadeValue::create): Ditto.
(WebCore::CSSCrossfadeValue::~CSSCrossfadeValue): Updated for data member name change.
(WebCore::CSSCrossfadeValue::fixedSize): Take a reference. Also rewrote size math to
take advantage of FloatSize multiplication and addition operators.
(WebCore::CSSCrossfadeValue::knownToBeOpaque): Take a reference.
(WebCore::CSSCrossfadeValue::loadSubimages): Set m_subimagesAreReady rather than
calling setReady on the subimage observer.
(WebCore::CSSCrossfadeValue::image): Return a raw pointer rather than a RefPtr.
Take a reference instead of a pointer.
(WebCore::CSSCrossfadeValue::crossfadeChanged): Removed unused rect argument.
Rewrote to use modern for loop.
* css/CSSCrossfadeValue.h: Updated for above changes.
* css/CSSGradientValue.cpp:
(WebCore::createGradient): Added. Helper so the function below can use Ref rather
than RefPtr, and it's also nice to factor out this "poor man's virtual function".
(WebCore::CSSGradientValue::image): Take a reference rather than a pointer.
(WebCore::clone): Added. Helper like createGradient above.
(WebCore::CSSGradientValue::gradientWithStylesResolved): Take a reference rather
than a pointer. Simplified by using the helper above.
(WebCore::CSSGradientValue::knownToBeOpaque): Removed unused argument. Rewrote to
use a modern for loop.
* css/CSSGradientValue.h: Updated for above changes.
* css/CSSImageGeneratorValue.cpp: Moved the CachedGeneratedImage class in here
from the header. Also changed it to use const and Ref.
(WebCore::CSSImageGeneratorValue::addClient): Take a reference rather than a pointer.
(WebCore::CSSImageGeneratorValue::removeClient): Ditto.
(WebCore::CSSImageGeneratorValue::cachedImageForSize): Updated since image now returns
a reference rather than a pointer.
(WebCore::CSSImageGeneratorValue::saveCachedImageForSize): Take a reference rather
than PassRefPtr.
(WebCore::CSSImageGeneratorValue::image): Take a reference rather than a pointer.
(WebCore::CSSImageGeneratorValue::fixedSize): Ditto.
(WebCore::CSSImageGeneratorValue::knownToBeOpaque): Ditto.
* css/CSSImageGeneratorValue.h: Updated for above changes.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFaceValue): Return a RefPtr rather than PassRefPtr.
* css/CSSValuePool.h: Updated for the above.
* css/StyleBuilderConverter.h: Change convertStyleImage and convertShapeValue to
return RefPtr instead of PassRefPtr.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent): Since gradientWithStylesResolved
returns a Ref now, no need to dereference it any more. This also removes reference
count churn since we are now passing a Ref temporary to a Ref&&.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleImage): Ditto.
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::GradientImage): Pass generator as a reference rather than
as a PassRefPtr.
(WebCore::GradientImage::draw): Updated since m_gradient is now a Ref rather than
a RefPtr.
(WebCore::GradientImage::drawPattern): Ditto.
* platform/graphics/GradientImage.h: Updated for the above changes. Make things
private rather than protected since this class is final.
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::imageSize): Pass renderer as a reference. Later, we
should change the interface to this function, too.
(WebCore::StyleGeneratedImage::addClient): Ditto.
(WebCore::StyleGeneratedImage::removeClient): Ditto.
(WebCore::StyleGeneratedImage::image): Ditto.
(WebCore::StyleGeneratedImage::knownToBeOpaque): Ditto.
2016-12-30 Olivier Blin <olivier.blin@softathome.com>
[EFL] fix buffer over-read in RenderThemeEfl::mediaControlsStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=166622
Reviewed by Gyuyoung Kim.
This has been detected by a charactersAreAllASCII() assert failure.
Initially in WebKitForWayland (WPE), but the code was likely borrowed from EFL.
This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
It is thus incorrect to use StringImpl::createFromLiteral() that calls
strlen() to get the string length.
The String::ConstructFromLiteral constructor can not be used, since it
skips the last character.
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::mediaControlsStyleSheet):
Explicitely pass the size to the String constructor.
2016-12-30 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r210206.
https://bugs.webkit.org/show_bug.cgi?id=166621
Crashes on macOS PLT (Requested by kling on #webkit).
Reverted changeset:
"Drop the render tree for documents in the page cache."
https://bugs.webkit.org/show_bug.cgi?id=121798
http://trac.webkit.org/changeset/210206
2016-12-28 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Isolate instrinsic size computation from layout
https://bugs.webkit.org/show_bug.cgi?id=166530
Reviewed by Darin Adler.
This is the last patch of the items placement data refactoring. By using a different Grid
instance in computeIntrinsicLogicalWidths we effectively isolate the intrinsic size
computation from the layout. They are now using different data structures so they don't
interfere each other.
This also means that we no longer reuse the placement of items done in the intrinsic size
computation. That shouldn't be a big issue once we make m_grid persistent on RenderGrid.
Last but not least, this patch finally removes the ugly const_cast's we had in
computeIntrinsicLogicalWidths() as we no longer modify the internal state of RenderGrid.
Tests: fast/css-grid-layout/grid-auto-repeat-intrinsic.html
fast/css-grid-layout/grid-change-intrinsic-size-with-auto-repeat-tracks.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use a new instance of Grid.
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat): Fixed a missing m_grid -> grid
rename.
(WebCore::RenderGrid::placeItemsOnGrid): Constify it. It nows repositions the items if the
number of auto repeat tracks has changed.
* rendering/RenderGrid.h:
2016-12-30 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve user agent construction
https://bugs.webkit.org/show_bug.cgi?id=142074
Reviewed by Carlos Garcia Campos.
Using the macOS quirk rather than the Chrome quirk for Google domains was a mistake: it
broke Hangouts in a different way than the Chrome quirk, and also prevents use of the nice
Earth mode on Google Maps. Google is making it really hard to develop a sane quirk.
Eventually I settled on the combination of two quirks: (1) Firefox browser, and (2) Linux
x86_64 platform. See the bug for full discussion on why these quirks are the best way to
make Google domains work properly in WebKit. This is an extremely sad state of affairs, but
I'm confident it is the best option. Note this effectively includes a rollout of r210168.
Also, fix a bug that caused an extra space to be inserted in the middle of the user agent.
* platform/UserAgentQuirks.cpp:
(WebCore::isGoogle):
(WebCore::urlRequiresFirefoxBrowser):
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::urlRequiresLinuxDesktopPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
(WebCore::UserAgentQuirks::firefoxRevisionString):
* platform/UserAgentQuirks.h:
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-12-30 Andreas Kling <akling@apple.com>
Drop the render tree for documents in the page cache.
<https://webkit.org/b/121798>
Reviewed by Darin Adler.
To save memory and reduce complexity, have documents tear down their render tree
when entering the page cache. I've wanted to do this for a long time and it seems
like we can actually do it now.
This patch will enable a number of clean-ups since it's no longer valid for renderers
to exist while the document is in page cache.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree): Remove assertion that we're not in the page cache
since we will now be tearing down render trees right as they enter the page cache.
(WebCore::Document::setPageCacheState): Tear down the render tree right before setting
the in-cache flag. From now on, there should not exist render objects for documents in
the page cache.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::didRestoreFromPageCache): Update the scollable area set after restoring a
frame from the page cache. This dirties the scrolling tree, which was covered by tests.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc): Make this a no-op if the render tree is being
torn down. This fixes assertions firing on animation tests.
2016-12-29 Chris Fleizach <cfleizach@apple.com>
AX: Need to expose frames to iOS Accessibility
https://bugs.webkit.org/show_bug.cgi?id=166571
<rdar://problem/29823724>
Reviewed by Darin Adler.
To support navigation by frame for VoiceOver on iOS, we need to expose the frame ancestor.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):
2016-12-09 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Move Grid into GridSizingData
https://bugs.webkit.org/show_bug.cgi?id=165654
Reviewed by Darin Adler.
The grid track sizing algorithm has been using the m_grid attribute from RenderGrid to
compute the sizes of the tracks unconditionally. However the goal is to make it work against
a generic instance of the Grid class, so that the intrinsic size computation and the layout
processes could be effectively decoupled.
Instead of passing the Grid as a new argument to all the track sizing algorithm methods we
leverage the existence of GridSizingData which is already passed to all of them. This data
structure holds from now on a reference to the Grid instance so that the track sizing
algorithm could use it.
No new tests as this is a refactoring.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridSizingData::GridSizingData):
(WebCore::RenderGrid::GridSizingData::grid):
(WebCore::RenderGrid::computeTrackBasedLogicalHeight):
(WebCore::RenderGrid::computeTrackSizesForDirection):
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::guttersSize):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::computeFlexSizedTracksGrowth):
(WebCore::RenderGrid::computeFlexFactorUnitSize):
(WebCore::RenderGrid::findFlexFactorUnitSize):
(WebCore::RenderGrid::rawGridTrackSize):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
(WebCore::RenderGrid::trackSizesForComputedStyle):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
(WebCore::RenderGrid::gridAreaBreadthForChild):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
(WebCore::RenderGrid::numTracks):
(WebCore::RenderGrid::paintChildren):
* rendering/RenderGrid.h:
2016-12-27 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve user agent construction
https://bugs.webkit.org/show_bug.cgi?id=142074
Reviewed by Carlos Garcia Campos.
Use the macOS rather than the Chrome quirk for Google domains, to avoid problems with
Google Calendar and Google Maps.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
(WebCore::urlRequiresMacintoshPlatform):
2016-12-26 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect
https://bugs.webkit.org/show_bug.cgi?id=163461
Reviewed by Darin Adler.
Make sure we don't paint empty rects.
Test: fast/lists/assert-on-empty-list-marker.html
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
2016-12-25 Chris Fleizach <cfleizach@apple.com>
AX: Headers of table not read by VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=158693
<rdar://problem/26771065>
Reviewed by Darin Adler.
If a table cell header is hidden, by pushing off screen then the content won't be accessible.
It seems that unless specifically requested (such as using aria-hidden), we should try to return
that table cell header.
Test: accessibility/hidden-th-still-column-header.html
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObjectForSection):
2016-12-25 Yusuke Suzuki <utatane.tea@gmail.com>
Propagate the source origin as much as possible
https://bugs.webkit.org/show_bug.cgi?id=166348
Reviewed by Darin Adler.
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
* bridge/NP_jsobject.cpp:
(_NPN_Evaluate):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject evaluateWebScript:]):
2016-12-24 Sam Weinig <sam@webkit.org>
[WebIDL] Remove (most) custom bindings for the IndexedDB code
https://bugs.webkit.org/show_bug.cgi?id=166451
Reviewed by Darin Adler.
Removes the custom bindings for all but one attribute (IDBRequest.result) in
the IndexedDB code.
- Adds a new WebIDL extension type, IDBKey, to represent the complex key conversion
rules IndexedDB specifies.
- Replaces custom bindings for IDBCursor.source with use of a union.
- Replaces custom enum type checking for IDBCursor.direction with a WebIDL enum.
- Replaces custom code generation for IDBKeyPaths with a union.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::source):
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::directionNext): Deleted.
(WebCore::IDBCursor::directionNextUnique): Deleted.
(WebCore::IDBCursor::directionPrev): Deleted.
(WebCore::IDBCursor::directionPrevUnique): Deleted.
(WebCore::IDBCursor::stringToDirection): Deleted.
(WebCore::IDBCursor::directionToString): Deleted.
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::objectStore): Deleted.
(WebCore::IDBCursor::index): Deleted.
Replace custom enum checking with direct use of the enum, letting the generator
handle the checks. Also adds source function which returns a Variant.
* Modules/indexeddb/IDBCursor.idl:
Remove custom annotation and use correct types.
* Modules/indexeddb/IDBCursorDirection.h: Added.
* Modules/indexeddb/IDBCursorDirection.idl: Added.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
Replace Strings with IDBCursorDirection enums.
* Modules/indexeddb/IDBKeyRange.idl:
Remove annotation and use new IDBKey extension type.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onSuccess):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
Use ReadyState enum in place of the old m_isDone boolean.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::source):
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::completeRequestAndDispatchEvent):
(WebCore::IDBRequest::readyState): Deleted.
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::readyState):
(WebCore::IDBRequest::isDone):
(WebCore::IDBRequest::objectStoreSource): Deleted.
(WebCore::IDBRequest::indexSource): Deleted.
(WebCore::IDBRequest::cursorSource): Deleted.
* Modules/indexeddb/IDBRequest.idl:
Replace the readyState String with a enum, and the custom source binding with a
source function that returns a Variant.
* Modules/indexeddb/IndexedDB.h:
Add the missing values to CursorDirection to make it comply with the IDL definition.
* bindings/generic/IDLTypes.h:
* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLIDBKey<T>>::convert):
Add new extension type IDLIDBKey.
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::source): Deleted.
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::source): Deleted.
Remove custom bindings.
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
* bindings/scripts/CodeGeneratorJS.pm:
(GetBaseIDLType):
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
(NativeToJSValue):
Add support for IDBKey, and remove custom code for IndexedDB in core conversion logic.
* bindings/scripts/IDLAttributes.txt:
Remove now unused ImplementationReturnType attribute.
* inspector/InspectorIndexedDBAgent.cpp:
Update to work with new functions taking enums rather than strings.
2016-12-23 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
https://bugs.webkit.org/show_bug.cgi?id=166472
rdar://problem/29675551
Reviewed by Tim Horton.
r209299 broke autoscroll in zoomed pages because it changed RenderLayer::scrollRectToVisible()
to shrink viewRect by page scale. This is incorrect for all callers of scrollRectToVisible, since
the "absoluteRect" passed in is actually in zoomed document coordinates for all the callers I tested.
This code is also fixed to account for headers and footers. getRectToExpose() takes rectangles
in "scroll view contents" coordinates (i.e. including header, and zoomed document), so doesn't need
the separate visibleRectRelativeToDocument parameter.
Tests: fast/events/autoscroll-main-document.html
fast/events/autoscroll-when-zoomed.html
fast/events/drag-select-when-zoomed-with-header.html
fast/events/drag-select-when-zoomed.html
fast/scrolling/scroll-to-anchor-zoomed-header.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::getRectToExpose):
* rendering/RenderLayer.h:
2016-12-24 Zalan Bujtas <zalan@apple.com>
RenderBlockFlow::moveFloatsTo does not move floats.
https://bugs.webkit.org/show_bug.cgi?id=166467
Reviewed by Darin Adler.
RenderBlockFlow::moveFloatsTo name is misleading. Floats are not moved from "this" to
the new RenderBlockFlow parent, but rather they are copied so that overhanging floats
don't get lost.
Covered by existing tests.
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::cloneForNewParent):
(WebCore::FloatingObject::unsafeClone): Deleted.
* rendering/FloatingObjects.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addFloatsToNewParent):
(WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
(WebCore::RenderBlockFlow::moveFloatsTo): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::mergeChildrenWithBase):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::removeChild):
2016-12-23 Andreas Kling <akling@apple.com>
REGRESSION(r209865): Crash when navigating back to some pages with compositing layers.
<https://webkit.org/b/166469>
<rdar://problem/29109053>
Reviewed by Darin Adler.
Remove the old WK1-era clear/restoreBackingStores optimization from the page cache.
When enabling it on non-iOS platforms, we started hitting lots of assertions,
and none of our memory tests showed any significant improvement anyway.
Test: compositing/page-cache-back-crash.html
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::CachedFrameBase):
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* history/CachedFrame.h:
* page/FrameView.cpp:
(WebCore::FrameView::restoreBackingStores): Deleted.
* page/FrameView.h:
2016-12-23 Sam Weinig <sam@webkit.org>
Add missing std::optional to ApplePayPaymentRequest.lineItems
https://bugs.webkit.org/show_bug.cgi?id=166468
Reviewed by Alexey Proskuryakov.
No functional change, but is more consistent.
* Modules/applepay/ApplePayPaymentRequest.h:
Remove unnecessary #include of <heap/Strong.h>, add std::optional to lineItems.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
Update to deal with optional line items, remove unnecessary comment.
* Modules/applepay/ApplePaySession.h:
Remove unneeded forward declarations.
2016-12-22 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for WebSQL code
https://bugs.webkit.org/show_bug.cgi?id=166441
Reviewed by Darin Adler.
- Replace custom variant type SQLValue with a type alias of a Variant.
- Use the newly representable SQLValue to remove custom bindings for
SQLResultSetRowList::item and SQLTransaction::executeSql.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSSQLResultSetRowListCustom.cpp: Removed.
* bindings/js/JSSQLTransactionCustom.cpp: Removed.
* platform/sql/SQLValue.cpp: Removed.
Remove files.
* Modules/webdatabase/SQLResultSetRowList.cpp:
(WebCore::SQLResultSetRowList::length):
(WebCore::SQLResultSetRowList::item):
* Modules/webdatabase/SQLResultSetRowList.h:
* Modules/webdatabase/SQLResultSetRowList.idl:
Sink the implementation of item() into the implementation. Use a
record type to bridge to javascript.
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::SQLStatement):
* Modules/webdatabase/SQLStatement.h:
Update to take arguments by rvalue reference.
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::executeSql):
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransaction.idl:
Remove custom annotation, and update signature to match the IDL.
* Modules/webdatabase/SQLTransactionBackend.cpp:
* Modules/webdatabase/SQLTransactionBackend.h:
Remove unneeded #includes of SQLValue.h
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLNull>::convert):
(WebCore::JSConverter<IDLNull>::convert):
Implement conversion for the null type so it can be used in the SQLValue union.
* inspector/InspectorDatabaseAgent.cpp:
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::bindValue):
(WebCore::SQLiteStatement::getColumnValue):
* platform/sql/SQLiteStatement.h:
Replace old switch with a WTF::switchOn that operates on the new variant.
* platform/sql/SQLValue.h:
(WebCore::SQLValue::SQLValue): Deleted.
(WebCore::SQLValue::type): Deleted.
Replace implementation with a Variant.
2016-12-22 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] GLES build broken since r208997
https://bugs.webkit.org/show_bug.cgi?id=166455
Unreviewed. Fix the preprocessor guards here; this code is incompatible with GLES2.
Looks like it's been broken for a month. Typical!
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
2016-12-23 Zan Dobersek <zdobersek@igalia.com>
[EME][GStreamer] Enable various code paths for ENCRYPTED_MEDIA
https://bugs.webkit.org/show_bug.cgi?id=166054
Reviewed by Xabier Rodriguez-Calvar.
Add ENABLE_ENCRYPTED_MEDIA build guards in various places in GStreamer
code to enable decryption-related GStreamer elements and the proper
decryptor handling in AppendPipeline.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::registerWebKitGStreamerElements):
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
Only call needKey() if LEGACY_ENCRYPTED_MEDIA is enabled, since this is
the way the legacy EME system expects to be notified of key necessity.
It's very likely ENCRYPTED_MEDIA will do this differently.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2016-12-23 Ryosuke Niwa <rniwa@webkit.org>
Eliminate the use of lastChild in TextIterator
https://bugs.webkit.org/show_bug.cgi?id=166456
Reviewed by Antti Koivisto.
Just use the node we just existed in TextIterator::exitNode and in emitting additional new line
to eliminate the use of Node::lastChild.
Also initialize member variables in the declaration instead of the constructor to modernize the code.
* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator):
(WebCore::TextIterator::advance):
(WebCore::TextIterator::exitNode):
* editing/TextIterator.h:
2016-12-22 Andy Estes <aestes@apple.com>
Reduce QuickLook.h include overhead
https://bugs.webkit.org/show_bug.cgi?id=166454
Reviewed by Andreas Kling.
* dom/Document.cpp: Included QuickLook.h for QLPreviewProtocol().
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setQuickLookHandle): Moved from DocumentLoader.h to here.
* loader/DocumentLoader.h: Stopped including QuickLook.h and forward-declared
QuickLookHandle.
(WebCore::DocumentLoader::setQuickLookHandle): Moved definition out-of-line since it
requires QuickLookHandle to be a complete type.
* loader/ios/QuickLook.h: Updated to use #pragma once. Cleaned up includes and forward
declarations.
* platform/network/ResourceHandle.cpp: Included QuickLook.h so that QuickLookHandle is a
complete type in the ResourceHandle constructor.
* platform/network/ResourceHandle.h: Stopped including QuickLook.h and forward-declared
QuickLookHandle.
(WebCore::ResourceHandle::setQuickLookHandle): Moved definition out-of-line since it
requires QuickLookHandle to be a complete type.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::setQuickLookHandle): Moved from ResourceHandle.h to here.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Included QuickLook.h for
QuickLookHandle.
2016-12-22 Andy Estes <aestes@apple.com>
[iOS] Move QuickLook from WebCore/platform to WebCore/loader
https://bugs.webkit.org/show_bug.cgi?id=166449
Reviewed by Darin Adler.
QuickLook.mm knows about ResourceLoader, so it's a layering violation to have it in
platform/. Move it to loader/ios/.
* WebCore.xcodeproj/project.pbxproj:
* loader/ios/QuickLook.h: Renamed from Source/WebCore/platform/network/ios/QuickLook.h.
* loader/ios/QuickLook.mm: Renamed from Source/WebCore/platform/network/ios/QuickLook.mm.
2016-12-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused parameter warning in GLES build
Looks like it's been here since 2012. Impressive!
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2016-12-22 Alex Christensen <achristensen@webkit.org>
Move GraphicsContext3DWin to GraphicsContext3DOpenGLES
https://bugs.webkit.org/show_bug.cgi?id=166425
Reviewed by Tim Horton.
Move code which is GLES-specific not Windows-specific to the GLES-specific file
so I can use it on Cocoa, with a temporary PLATFORM macro that I plan to remove once
all platforms use ANGLE's GLES implementation. There is another copy of this code in
GraphicsContext3DCairo, which will also be united with this code here soon.
Also remove the PlatformCALayerWin, which was never used for anything.
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::platformTexture):
(WebCore::GraphicsContext3D::isGLES2Compliant):
(WebCore::GraphicsContext3D::platformLayer):
* platform/graphics/win/GraphicsContext3DWin.cpp: Removed.
* PlatformMac.cmake:
Include the egl directory. I'll need this, too, once Mac starts using ANGLE's EGL implementation.
2016-12-22 Brent Fulgham <bfulgham@apple.com>
Nested calls to setDocument can omit firing 'unload' events
https://bugs.webkit.org/show_bug.cgi?id=166422
<rdar://problem/29763012>
Reviewed by Alex Christensen.
Test: fast/loader/nested-document-handling.html
Only allow a single document change to be taking place during a given runloop cycle.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeIfJavaScriptURL): Block script changing the document
when we are in the middle of changing the document.
* page/Frame.cpp:
(WebCore::Frame::setDocument): Keep track of document change state.
* page/Frame.h:
2016-12-22 Tim Horton <timothy_horton@apple.com>
TileGrid creates new cohorts even when not using temporarilyRetainTileCohorts mode
https://bugs.webkit.org/show_bug.cgi?id=166440
Reviewed by Simon Fraser.
No new tests.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
If we are not temporarily retaining unparented tile cohorts (e.g. on
iOS WebKit2), instead immediately removing all tiles that would go into
the new cohort, avoid starting the cohort at all.
2016-12-22 Zalan Bujtas <zalan@apple.com>
Do not destroy the RenderNamedFlowFragment as leftover anonymous block.
https://bugs.webkit.org/show_bug.cgi?id=166436
rdar://problem/29772233
Reviewed by Simon Fraser.
When as the result of certain style change, the generated anonymous block is not needed anymore, we
move its descendants up to the parent and destroy the generated box. While RenderNamedFlowFragment is a generated
block, the cleanup code should just ignore it the same way we ignore boxes like multicolumn, mathml etc.
Test: fast/regions/flow-fragment-as-anonymous-block-crash.html
* rendering/RenderObject.h:
(WebCore::RenderObject::isAnonymousBlock):
2016-12-22 Wenson Hsieh <wenson_hsieh@apple.com>
CSS Scroll Snap does not work if scrollbar is hidden
https://bugs.webkit.org/show_bug.cgi?id=160442
<rdar://problem/23317034>
Reviewed by Simon Fraser.
Currently, the only reason scroll snapping works in overflow scrolling containers without forcing layout is
because we would initialize the scrolling container's ScrollAnimator in the process of updating scrollbars. If
there are no scrollbars to render, we won't bother creating a ScrollAnimator. Without an existing
ScrollAnimator, ScrollableArea::updateScrollSnapState will simply bail instead of setting up the scroll snap
state. Instead, we should take setting a non-empty vector of scroll offsets on the ScrollableArea as a cue that
the ScrollableArea also needs a ScrollAnimator, and initialize it there if necessary.
Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-hidden-scrollbars.html
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::setHorizontalSnapOffsets):
(WebCore::ScrollableArea::setVerticalSnapOffsets):
2016-12-22 Daniel Bates <dabates@apple.com>
Bypass pop-up blocker from cross-origin or sandboxed frame
https://bugs.webkit.org/show_bug.cgi?id=166290
<rdar://problem/29742039>
Reviewed by Darin Adler.
Tests: fast/events/popup-blocked-from-sandboxed-frame-via-window-open-named-sibling-frame.html
fast/events/popup-blocked-from-sandboxed-frame-via-window-open-named-sibling-frame2.html
fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open): Use FrameLoader::findFrameForNavigation() to find the
target frame to navigate with respect to the active document just as we do in WebCore::createWindow().
2016-12-22 Andy Estes <aestes@apple.com>
Make WebCore::EditorInsertAction an enum class
https://bugs.webkit.org/show_bug.cgi?id=166424
Reviewed by Brent Fulgham.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/Editor.cpp:
(WebCore::Editor::pasteAsPlainTextWithPasteboard):
(WebCore::Editor::shouldInsertText):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::insertLineBreak):
(WebCore::Editor::insertParagraphSeparator):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::handleAcceptedCandidate):
* editing/EditorInsertAction.h:
(): Deleted.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::replaceSelectionWithAttributedString):
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::replaceNodeFromPasteboard):
(WebCore::Editor::replaceSelectionWithAttributedString):
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard):
* page/ContextMenuController.cpp:
(WebCore::insertUnicodeCharacter):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
2016-12-22 Jer Noble <jer.noble@apple.com>
Only include those parts of AVFoundation.framework which are strictly needed.
https://bugs.webkit.org/show_bug.cgi?id=166423
Reviewed by Eric Carlson.
* Modules/plugins/QuickTimePluginReplacement.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/mac/SerializedPlatformRepresentationMac.mm:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
* platform/mac/WebVideoFullscreenController.mm:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
2016-12-22 Jer Noble <jer.noble@apple.com>
NULL-deref CRASH in WebCore::PlatformMediaSession::mediaType
https://bugs.webkit.org/show_bug.cgi?id=166407
Reviewed by Darin Adler.
In r207688, we added a facility in PlatformMediaSessionManager for safely walking through a
list of PlatformMediaSessions by replacing entries of deleted sessions with nullptr. We now
need to use those new iteration falicities in MediaSessionManageriOS.
In addition to the existing iterators, add one which takes a predicate, and returns the first
session which matches the predicate, or nullptr, if none do.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::findSession):
(WebCore::PlatformMediaSessionManager::anyOfSessions):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::sessions): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
(WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
(WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
(WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
2016-12-22 Jer Noble <jer.noble@apple.com>
Muted media element playback should not interrupt other audio playback
https://bugs.webkit.org/show_bug.cgi?id=166347
Reviewed by Eric Carlson.
Test: TestWebKitAPI/WebKit/ios/AudioSessionCategoryIOS.mm
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):
2016-12-22 Jer Noble <jer.noble@apple.com>
Check for the existence of AVSampleBufferAudioRenderer.h before redeclaring AVSampleBufferAudioRenderer
https://bugs.webkit.org/show_bug.cgi?id=166421
Reviewed by Eric Carlson.
* platform/spi/mac/AVFoundationSPI.h:
2016-12-22 Eric Carlson <eric.carlson@apple.com>
AVPlayerLayer isn't available on every system
https://bugs.webkit.org/show_bug.cgi?id=166399
Reviewed by Jer Noble.
No new tests, prevents a crash that can't be reproduced on a test system.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Use SOFT_LINK_CLASS_OPTIONAL.
2016-12-21 Tim Horton <timothy_horton@apple.com>
TileGrid revalidates tiles twice during flush, first with wrong visible rect
https://bugs.webkit.org/show_bug.cgi?id=166406
Reviewed by Simon Fraser.
No new tests; existing tests cover this code, this is just a perf win,
specifically reducing the amount of layer churn during zooming.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::setScale):
Schedule a revalidation, which will happen later in the same flush,
instead of doing it immediately. Doing it immediately is problematic,
because we're currently in the middle of a GraphicsLayer tree flush,
and don't have the complete picture of the new state yet. We're guaranteed
to get the new scale *before* the flush calls revalidateTiles.
2016-12-21 Tim Horton <timothy_horton@apple.com>
TileGrid creates new tiles when there are recyclable tiles about to be removed
https://bugs.webkit.org/show_bug.cgi?id=166408
Reviewed by Simon Fraser.
No new tests; existing tests cover this code, this is just a perf win,
specifically reducing the amount of layer churn during zooming.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
Remove all the tiles that will be removed first, then add new tiles.
Strictly ordering it this way means that tiles will be removed, go into
the LayerPool, then be pulled back out of the LayerPool to sit in the
newly-covered areas. Previously, we would sometimes make new layers
for newly-covered areas, and then remove unneeded but otherwise recyclable
tiles, which would then just go sit in the LayerPool (and often get
pruned, wastefully).
2016-12-21 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Update media-stream-event-constructor test
https://bugs.webkit.org/show_bug.cgi?id=166398
Reviewed by Jer Noble.
No new tests, updated existing test.
* Modules/mediastream/MediaStreamEvent.idl: Mark eventInitDict as optional.
2016-12-21 Jiewen Tan <jiewen_tan@apple.com>
WebKit should set Original URL of a download request correctly
https://bugs.webkit.org/show_bug.cgi?id=166394
<rdar://problem/25391382>
Reviewed by Alex Christensen.
WebKit should set Original URL of a download request correctly if the download
is initiated by clicking on a link with target=_blank.
Manually tested as the requested test infrastructure doesn't exist yet. We need actual
loading process for API test such that we could simulate the real situation which
PolicyDownload is only set when we receive responds. Currently we can only set
PolicyDownload in a NavigationDelegate when the load starts. Hence we cannot simulate
the following process: load starts -> PolicyUse -> creates a new WebView ->
respond receives -> PolicyDownload -> downloads.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setOriginalURLForDownloadRequest):
2016-12-21 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom binding for ErrorEvent
https://bugs.webkit.org/show_bug.cgi?id=166345
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSErrorEventCustom.cpp: Removed.
Remove JSErrorEventCustom.cpp
* ForwardingHeaders/heap/HandleTypes.h: Added.
Add forwarding header for HandleTypes.h
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
Switch to using JSDOMConvert and call the updated name for the error getter.
* bindings/js/ScriptController.h:
* bindings/js/SerializedScriptValue.h:
Remove unnecessary forward declaration of ScriptValue.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::sanitizeScriptError):
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/ScriptExecutionContext.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
Update type that sanitizeScriptError takes from a ScriptValue to a Strong<Unknown>.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* bindings/scripts/IDLAttributes.txt:
Add a new extended attributes option for the CallWith, GlobalObject, that passes the global object.
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::ErrorEvent):
(WebCore::ErrorEvent::error):
(WebCore::ErrorEvent::trySerializeError):
(WebCore::ErrorEvent::sanitizedErrorValue): Deleted.
* dom/ErrorEvent.h:
Store a Strong<Unknown> directly, rather than a ScriptValue. Rename sanitizedErrorValue to
just error to match the IDL.
* dom/ErrorEvent.idl:
Remove CustomGetter.
2016-12-21 Ryosuke Niwa <rniwa@webkit.org>
Modernize findPlainText
https://bugs.webkit.org/show_bug.cgi?id=166299
Reviewed by Sam Weinig.
Modernized findPlainText by merging the static version of it into it
and extracting the main nested loop out as findPlainTextOffset.
No new tests since there should be no behavioral change.
* editing/TextIterator.cpp:
(WebCore::findPlainTextOffset):
(WebCore::findPlainText):
2016-12-21 John Wilander <wilander@apple.com>
Switch to a blacklist model for restricted Accept headers in simple CORS requests
https://bugs.webkit.org/show_bug.cgi?id=166363
Reviewed by Alex Christensen.
Updated existing tests.
* platform/network/HTTPParsers.cpp:
(WebCore::isDelimiterCharacter):
Convenience function for checking delimiter characters according to:
https://tools.ietf.org/html/rfc7230#section-3.2.6
(WebCore::isValidAcceptHeaderValue):
Now uses WebCore::isDelimiterCharacter() to blacklist delimiter characters
instead of a whitelist of accepted non-alphanumeric characters.
2016-12-21 Beth Dakin <bdakin@apple.com>
Holding down on candidates in the TouchBar should show panel on screen
https://bugs.webkit.org/show_bug.cgi?id=166367
-and corresponding-
<rdar://problem/28479236>
Reviewed by Tim Horton.
Expose the version of setCandidates: that takes a rect.
* platform/spi/cocoa/NSTouchBarSPI.h:
2016-12-21 Michael Catanzaro <mcatanzaro@igalia.com>
Extensions3DOpenGL[ES] constructor should not be explicit
https://bugs.webkit.org/show_bug.cgi?id=166296
Reviewed by Darin Adler.
These constructors used to only have one parameter. Now they have two and they're both
mandatory.
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLES.h:
2016-12-21 Eric Carlson <eric.carlson@apple.com>
[MediaStream] MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer can be called before it has a media stream
https://bugs.webkit.org/show_bug.cgi?id=166344
<rdar://problem/29763143>
Reviewed by Jer Noble.
There is a very narrow window during which a MediaStream player can be asked for its layer
before it has a steam, resulting in a NULL dereference and crash. Don't do that.
Unable to reproduce.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer):
2016-12-21 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
[Readable Streams API] Fix test in readableByteStreamCallPullIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=166312
Reviewed by Youenn Fablet.
Add a new function to evaluate if calling a pull function is
required as per specification.
No new test required.
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerShouldCallPull): Added.
(readableByteStreamControllerCallPullIfNeeded):
2016-12-21 Simon Fraser <simon.fraser@apple.com>
Fixed bars are positioned incorrectly when there are header and footer banners
https://bugs.webkit.org/show_bug.cgi?id=166302
rdar://problem/29727145
Reviewed by Tim Horton.
The computation of the visual viewport was wrong in the presence of header and footer
banners. It needs to take into account the fact that "visibleContentRect" applies to the
scroll view contents, which includes header and footer (unscaled), and the potentially scaled
document, and we need to return a rectangle in unscaled document coordinates.
Make a static method in FrameView to do this computation, and call it from FrameView::visualViewportRect()
and ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition().
layoutViewportForScrollPosition() is only called on Mac, so remove the #ifdeffing related to scaling,
and pass in an unscaled scroll position.
Test: fast/visual-viewport/zoomed-fixed-header-and-footer.html
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::maxStableLayoutViewportOrigin):
(WebCore::FrameView::visibleDocumentRect):
(WebCore::FrameView::visualViewportRect):
* page/FrameView.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2016-12-21 Carlos Alberto Lopez Perez <clopez@igalia.com>
[CMake] Remove remaining INDIE_UI related entries.
https://bugs.webkit.org/show_bug.cgi?id=165881
Unreviewed.
* CMakeLists.txt:
2016-12-20 Carlos Garcia Campos <cgarcia@igalia.com>
[Cairo] Conditional jump or move depends on uninitialised value(s)
https://bugs.webkit.org/show_bug.cgi?id=166058
Reviewed by Michael Catanzaro.
Initialize x and y members of cairo_glyph_t struct before passing it to cairo_glyph_path.
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::CairoGlyphToPathTranslator::path):
2016-12-20 Myles C. Maxfield <mmaxfield@apple.com>
Skia lighter wght variation looks bolder than regular
https://bugs.webkit.org/show_bug.cgi?id=165948
Reviewed by Antti Koivisto.
Test: fast/text/variations/default-value.html
This patch inspects the font's information regarding variations. It uses this information
to work around a bug in CoreText where default variation values were not getting applied.
This workaround is placed behind a version check and the macro name
"WORKAROUND_CORETEXT_VARIATIONS_DEFAULT_VALUE_BUG" so we know to delete it whenever
possible. It also uses the minimum and maximum supported values for the axis to clamp our
variation values to the closest supported point, which is in line with a recent edit to
the fonts spec:
https://github.com/w3c/csswg-drafts/commit/52b802ac38619286a30662dceb71b8a29fa72f42
This clamping behavior also revealed another bug in CoreText, which was worked around
behind another version check and macro name WORKAROUND_CORETEXT_VARIATIONS_EXTENTS_BUG so
we know to delete it whenever possible.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::defaultVariationValues):
(WebCore::preparePlatformFont):
2016-12-20 Tim Horton <timothy_horton@apple.com>
Remove a duplicate reference to ScrollingMomentumCalculatorMac.h in the Xcode project
Rubber-stamped by Sam Weinig.
* WebCore.xcodeproj/project.pbxproj:
2016-12-20 Tim Horton <timothy_horton@apple.com>
Remove a duplicate reference to ScrollingMomentumCalculatorMac.mm in the Xcode project
Rubber-stamped by Sam Weinig.
* WebCore.xcodeproj/project.pbxproj:
2016-12-20 Alex Christensen <achristensen@webkit.org>
Remove initEvent quirk
https://bugs.webkit.org/show_bug.cgi?id=166284
Reviewed by Dan Bernstein.
We added this quirk in r207908 and expanded it in r209946 and r210034.
Many web compatibility issues have been found, which leads us to believe that many more exist.
This reverts the behavior to match how it was before r203848.
This change was proposed to the spec in https://github.com/whatwg/dom/issues/387
* dom/Event.cpp:
(WebCore::Event::initEventForBindings): Deleted.
* dom/Event.h:
* dom/Event.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isBaiduNuomi): Deleted.
(WebCore::IOSApplication::isAutoNaviAMap): Deleted.
(WebCore::IOSApplication::isFlipboard): Deleted.
2016-12-20 JF Bastien <jfbastien@apple.com>
INDIE_UI: fix cmake build
https://bugs.webkit.org/show_bug.cgi?id=166288
Reviewed by Mark Lam.
Bug #165881 didn't remove a file from cmake.
* PlatformMac.cmake:
2016-12-20 Alex Christensen <achristensen@webkit.org>
Fix clean Windows build after r210029
https://bugs.webkit.org/show_bug.cgi?id=165881
* DerivedSources.cpp:
2016-12-20 Brent Fulgham <bfulgham@apple.com>
Address some style problems found by static analysis
https://bugs.webkit.org/show_bug.cgi?id=165975
Reviewed by Alex Christensen.
Correct the const-correctness of functions that are implemented using stricter
const declarations.
Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
* inspector/InspectorCSSAgent.h: Declare the method overrides properly to match
the stricter const declarations in the implementation files.
* inspector/InspectorDOMAgent.h: Ditto.
* inspector/InspectorPageAgent.h: Ditto.
* inspector/InspectorTimelineAgent.h: Ditto.
* inspector/PageDebuggerAgent.h: Ditto.
* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::ANGLEWebKitBridge::setResources): Pass by const reference.
* platform/graphics/ANGLEWebKitBridge.h:
(WebCore::ANGLEWebKitBridge::getResources): Return a const reference.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::selectSettings): Use a lambda that takes
a const reference, rather than copying the maps while searching.
2016-12-20 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom binding for WorkerGlobalScope::importScripts
https://bugs.webkit.org/show_bug.cgi?id=166243
Reviewed by Alex Christensen.
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts): Deleted.
* workers/WorkerGlobalScope.idl:
Import scripts can now be trivially generated.
2016-12-20 Zalan Bujtas <zalan@apple.com>
SVG elements should inherit the root's flow thread state.
https://bugs.webkit.org/show_bug.cgi?id=166173
rdar://problem/29704862
Reviewed by Simon Fraser.
When the <svg> is not part of the multicolumn context (out of flow positioning), its descendants should not be in the flow either.
Test: fast/multicol/svg-inside-multicolumn.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFlowThreadState):
* rendering/RenderObject.h:
(WebCore::RenderObject::isProgress):
(WebCore::RenderObject::isRenderSVGBlock):
* rendering/svg/RenderSVGBlock.h:
2016-12-20 Alex Christensen <achristensen@webkit.org>
Fix yet another app that uses initEvent with fewer than 3 parameters
https://bugs.webkit.org/show_bug.cgi?id=166257
<rdar://problem/29420268>
Reviewed by Sam Weinig.
* dom/Event.cpp:
(WebCore::Event::initEventForBindings):
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isAutoNaviAMap):
AutoNavi amap has content that uses initEvent with one parameter. This quirk is needed here, too.
2016-12-20 Dean Jackson <dino@apple.com>
Remove INDIE_UI
https://bugs.webkit.org/show_bug.cgi?id=165881
<rdar://problem/29672532>
Reviewed by Simon Fraser.
The Indie UI work has been discontinued.
* Configurations/FeatureDefines.xcconfig:
* Modules/indieui/UIRequestEvent.cpp: Removed.
* Modules/indieui/UIRequestEvent.h: Removed.
* Modules/indieui/UIRequestEvent.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::setUIActions): Deleted.
(WebCore::Element::UIActions): Deleted.
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.in:
* dom/Node.cpp:
(WebCore::Node::dispatchUIRequestEvent): Deleted.
* dom/Node.h:
2016-12-20 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement readableByteStreamControllerCallPullIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=166022
Reviewed by Youenn Fablet.
Implemented readableByteStreamControllerCallPullIfNeeded(). This function is
in particular called when a new ReadableByteStreamController is created; hence,
ReadableByteStreamController constructor has been updated.
Added 3 tests to check behaviour in case of success/failure of the start and pull functions
associated to the underlyingByteSource.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Updated handling of underlyingByteSource
start function (especially with call to readableByteStreamControllerCallPullIfNeeded).
(isReadableStreamBYOBReader): Added.
(readableStreamHasBYOBReader): Added.
(readableStreamHasDefaultReader): Added.
(readableByteStreamControllerCallPullIfNeeded): Added.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Added missing asserts.
* bindings/js/WebCoreBuiltinNames.h: Added readIntoRequests.
2016-12-20 Sam Weinig <sam@webkit.org>
[DataCue] Un-prefix DataCue and remove custom bindings
https://bugs.webkit.org/show_bug.cgi?id=166087
Reviewed by Eric Carlson.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDataCueCustom.cpp: Removed.
Remove JSDataCueCustom.cpp
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::toJSNewlyCreated):
Remove out of date comment.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
Update constructor generation code to use JSDOMConvert.
* html/track/DataCue.cpp:
(WebCore::DataCue::DataCue):
(WebCore::DataCue::~DataCue):
(WebCore::DataCue::data):
(WebCore::DataCue::setData):
(WebCore::DataCue::cueContentsMatch):
(WebCore::DataCue::value):
(WebCore::DataCue::setValue):
(WebCore::DataCue::valueOrNull):
* html/track/DataCue.h:
* html/track/DataCue.idl:
* platform/SerializedPlatformRepresentation.h:
Remove DATACUE_VALUE define from web exposed classes, so the interface can
be the same on all platforms. Platforms that don't support DATACUE_VALUE will
just never have any value. Also remove custom annotations.
2016-12-20 Wenson Hsieh <wenson_hsieh@apple.com>
Implement the updated port/area-based Scroll Snap Module Level 1 Spec
https://bugs.webkit.org/show_bug.cgi?id=165317
<rdar://problem/29490956>
Reviewed by Dean Jackson.
Implements the changes drafted in the latest iteration of the Scroll Snap Module Level 1 spec, which uses a
snap-area and snap-port-based method for determining snap positions in a scroll snapping container.
Additionally, removes the now-obsolete and prefixed implementation of the scroll snap spec and refactors all
affected layout tests to use the new CSS properties. Also adds new layout tests covering some behaviors detailed
in the new version of the spec, such as scroll snapping with transformed child elements.
See below for more detailed descriptions of the changes.
Tests: css3/scroll-snap/scroll-snap-2d-change-axis-type.html
css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.html
css3/scroll-snap/scroll-snap-children-with-scroll-snap-margin.html
css3/scroll-snap/scroll-snap-children-with-transforms.html
css3/scroll-snap/scroll-snap-positions-mainframe.html
css3/scroll-snap/scroll-snap-positions-overflow-resize.html
css3/scroll-snap/scroll-snap-positions.html
css3/scroll-snap/scroll-snap-style-changed-align.html
css3/scroll-snap/scroll-snap-with-scroll-padding.html
* WebCore.xcodeproj/project.pbxproj:
* css/CSSCalculationValue.cpp:
(WebCore::hasDoubleValue):
Removed use of length repeat.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForScrollSnapType):
(WebCore::valueForScrollSnapAlignment):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::scrollSnapDestination): Deleted.
(WebCore::scrollSnapPoints): Deleted.
(WebCore::scrollSnapCoordinates): Deleted.
Removed helper functions used to create CSS values for scroll snap coordinates and destination, and added
helpers for computed scroll snap type (a combination of axis and strictness values) as well as scroll snap align
(an alignment value per axis).
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
Removed usages of the length repeat type, since repeat(*) is no longer being used anywhere.
* css/CSSPrimitiveValue.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ScrollSnapStrictness):
(WebCore::CSSPrimitiveValue::operator ScrollSnapAxis):
(WebCore::CSSPrimitiveValue::operator ScrollSnapAxisAlignType):
(WebCore::CSSPrimitiveValue::operator ScrollSnapType): Deleted.
Added CSSPrimitiveValue mappings to ScrollSnapAxisAlignType, ScrollSnapStrictness, and ScrollSnapAxis. Removed
the old ScrollSnapType mapping.
* css/CSSProperties.json:
Replaced the old scroll snap CSS properties with the new ones. Note that scroll-snap-margin and scroll-padding
have 4 shorthands each, for the individual top/bottom/left/right values.
* css/CSSValueKeywords.in:
Added CSS keywords {x, y}, which are necessary to support the new scroll snapping properties.
* css/LengthRepeat.h: Removed.
Removed LengthRepeat entirely. This represented the `repeat(<length>)` CSS value, which was only used for the
scroll-snap-points-x and scroll-snap-points-y values.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertScrollSnapType):
(WebCore::StyleBuilderConverter::convertScrollSnapAlign):
(WebCore::StyleBuilderConverter::parseSnapCoordinate): Deleted.
(WebCore::StyleBuilderConverter::convertScrollSnapPoints): Deleted.
(WebCore::StyleBuilderConverter::convertSnapCoordinatePair): Deleted.
(WebCore::StyleBuilderConverter::convertScrollSnapCoordinates): Deleted.
Added helper functions to convert scroll snap type and scroll snap alignment from parsed CSS values to their
primary representation in WebCore as ScrollSnapType and ScrollSnapAlign. These methods assume that the given
CSS values have successfully cleared the parsing step and are represented as CSSValueLists or length 1 or 2.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsX): Deleted.
(WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX): Deleted.
(WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsY): Deleted.
(WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsY): Deleted.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::asText):
Adds support for the scroll-snap-margin and scroll-padding.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::isScrollSnapAxisAlign):
(WebCore::isScrollSnapStrictness):
(WebCore::CSSParser::parseScrollSnapAlign):
(WebCore::CSSParser::parseScrollSnapType):
(WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
(WebCore::CSSParser::parseScrollSnapPositions): Deleted.
(WebCore::CSSParser::parseScrollSnapDestination): Deleted.
(WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
* css/parser/CSSParser.h:
Removed references to LengthRepeat, and added support for parsing new scroll snapping properties. Scroll snap
margin and scroll padding, along with their shorthands, are parsed using the same helper functions as normal
margin and padding. For type and align, I added new helper functions that build up lists of 1 or 2
CSSPrimitiveValues for each of the properties.
Parsing scroll-snap-align is straightforward -- we either have one or two values in the set {none, start,
center, end}. For scroll-snap-type, we allow a single axis value {x, y, inline, block, both}, or a single
strictness value {none, proximity, mandatory}, or an axis value followed by a non-'none' strictness (i.e. either
proximity or mandatory).
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue):
Removed references to LengthRepeat.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
(WebCore::consumeSnapPointCoordinateList): Deleted.
(WebCore::consumeScrollSnapCoordinate): Deleted.
(WebCore::consumeScrollSnapDestination): Deleted.
(WebCore::consumeScrollSnapPoints): Deleted.
(WebCore::consumeScrollSnapAlign):
(WebCore::consumeScrollSnapType):
(WebCore::CSSPropertyParser::parseSingleValue):
Added parsing for the longhand properties of scroll-snap-margin and scroll-padding, which use the existing
consumeLength and consumeLengthOrPercent helpers, respectively. Removed code for parsing scroll snap
coordinates, destinations and points. Added parsing logic for align and type.
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::computeScrollSnapPortOrAreaRect):
(WebCore::computeScrollSnapAlignOffset):
(WebCore::snapOffsetsToString):
(WebCore::snapPortOrAreaToString):
(WebCore::updateSnapOffsetsForScrollableArea):
(WebCore::appendChildSnapOffsets): Deleted.
(WebCore::destinationOffsetForViewSize): Deleted.
(WebCore::updateFromStyle): Deleted.
(WebCore::styleUsesElements): Deleted.
Overhauled updateSnapOffsetsForScrollableArea to work with the new scroll snapping model. In the new way of
computing scroll snap offsets, we:
Compute the scroll container's scroll snap port, which is the padding box inset by the scroll padding
For each child with snap positions (i.e. scroll-snap-align is not none on both axes)
Compute the child's scroll snap area, which is the bounding box of the transformed border box
If the container snaps along the horizontal axis and the snap area contributes a horizontal snap offset:
Emit the distance from the alignment offset in the horizontal of the snap port to the corresponding offset
in the snap area as a snap position.
If the container snaps along the vertical axis and the snap area contributes a vertical snap offset:
Emit the distance from the alignment offset in the vertical of the snap port to the corresponding offset
in the snap area as a snap position.
For the snap offsets in each axis, if there is at least one snap offset:
Clamp the offsets to the min and max scroll offsets
Ensure that the offsets are sorted and do not contain duplicated offsets
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::updateScrollSnapState):
Clear out the ScrollController's snap offsets and state along an axis when its ScrollableArea no longer has snap
offsets in that axis.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
(WebCore::RenderBox::willBeRemovedFromTree):
* rendering/RenderLayerModelObject.cpp:
(WebCore::scrollSnapContainerRequiresUpdateForStyleUpdate):
(WebCore::RenderLayerModelObject::styleDidChange):
* rendering/RenderView.cpp:
(WebCore::RenderView::registerBoxWithScrollSnapPositions):
(WebCore::RenderView::unregisterBoxWithScrollSnapPositions):
(WebCore::RenderView::registerBoxWithScrollSnapCoordinates): Deleted.
(WebCore::RenderView::unregisterBoxWithScrollSnapCoordinates): Deleted.
* rendering/RenderView.h:
Tweaked the scroll snap child registration logic. registerBoxWithScrollSnapCoordinates is renamed to
unregisterBoxWithScrollSnapPositions, since the notion of scroll snap coordinates no longer exists, and instead
of checking if the list of scroll snap coordinates is empty for the absence of scroll positions, we instead
check for a computed scroll snap align that is not none on both axes.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::initialScrollSnapType):
(WebCore::RenderStyle::initialScrollSnapAlign):
(WebCore::RenderStyle::scrollSnapArea):
(WebCore::RenderStyle::scrollSnapPort):
(WebCore::RenderStyle::scrollSnapType):
(WebCore::RenderStyle::scrollPadding):
(WebCore::RenderStyle::scrollPaddingTop):
(WebCore::RenderStyle::scrollPaddingBottom):
(WebCore::RenderStyle::scrollPaddingLeft):
(WebCore::RenderStyle::scrollPaddingRight):
(WebCore::RenderStyle::scrollSnapAlign):
(WebCore::RenderStyle::scrollSnapMargin):
(WebCore::RenderStyle::scrollSnapMarginTop):
(WebCore::RenderStyle::scrollSnapMarginBottom):
(WebCore::RenderStyle::scrollSnapMarginLeft):
(WebCore::RenderStyle::scrollSnapMarginRight):
(WebCore::RenderStyle::setScrollSnapType):
(WebCore::RenderStyle::setScrollPaddingTop):
(WebCore::RenderStyle::setScrollPaddingBottom):
(WebCore::RenderStyle::setScrollPaddingLeft):
(WebCore::RenderStyle::setScrollPaddingRight):
(WebCore::RenderStyle::setScrollSnapAlign):
(WebCore::RenderStyle::setScrollSnapMarginTop):
(WebCore::RenderStyle::setScrollSnapMarginBottom):
(WebCore::RenderStyle::setScrollSnapMarginLeft):
(WebCore::RenderStyle::setScrollSnapMarginRight):
(WebCore::RenderStyle::initialScrollSnapDestination): Deleted.
(WebCore::RenderStyle::initialScrollSnapCoordinates): Deleted.
(WebCore::RenderStyle::scrollSnapPointsX): Deleted.
(WebCore::RenderStyle::scrollSnapPointsY): Deleted.
(WebCore::RenderStyle::scrollSnapDestination): Deleted.
(WebCore::RenderStyle::scrollSnapCoordinates): Deleted.
(WebCore::RenderStyle::setScrollSnapPointsX): Deleted.
(WebCore::RenderStyle::setScrollSnapPointsY): Deleted.
(WebCore::RenderStyle::setScrollSnapDestination): Deleted.
(WebCore::RenderStyle::setScrollSnapCoordinates): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialScrollSnapMargin):
(WebCore::RenderStyle::initialScrollPadding):
(WebCore::RenderStyle::scrollSnapType): Deleted.
(WebCore::RenderStyle::setScrollSnapType): Deleted.
(WebCore::RenderStyle::initialScrollSnapType): Deleted.
(WebCore::RenderStyle::initialScrollSnapPointsX): Deleted.
(WebCore::RenderStyle::initialScrollSnapPointsY): Deleted.
Added boilerplate code for returning various new scroll snap style properties, and removed similar code for
handling the old scroll snap properties.
* rendering/style/RenderStyleConstants.h:
Added three new enum classes:
- ScrollSnapStrictness represents the strictness of scroll snapping along one or both axes
- ScrollSnapAxis designates the axes along which scroll snapping should occur
- ScrollSnapAxisAlignType indicates which offsets along the x or y axes of the snap port and snap area should be
used to compute the snap position emitted by a snap area.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
Replaces the StyleScrollSnapPoints object (which, confusingly, was in charge of storing both the scroll
container's and child elements' scroll snap styles) with StyleScrollSnapPort and StyleScrollSnapArea objects,
which keep track of the style properties on the scroll container and the child element, respectively.
* rendering/style/StyleScrollSnapPoints.h:
(WebCore::operator==):
(WebCore::StyleScrollSnapPort::copy):
(WebCore::StyleScrollSnapPort::StyleScrollSnapPort):
(WebCore::StyleScrollSnapArea::copy):
(WebCore::StyleScrollSnapArea::StyleScrollSnapArea):
* rendering/style/StyleScrollSnapping.h: Added.
(WebCore::operator!=):
(WebCore::StyleScrollSnapPort::create):
(WebCore::StyleScrollSnapArea::create):
(WebCore::StyleScrollSnapArea::hasSnapPosition):
Overhauled StyleScrollSnapPoints, breaking the logic here into two classes: StyleScrollSnapPort for the scroll
container, handling the properties `scroll-snap-type` and `scroll-padding` and StyleScrollSnapArea for child
elements, handling the properties `scroll-snap-align` and `scroll-snap-margin`. The ScrollSnapType itself is
composed of an axis value and a strictness, while a ScrollSnapAlign keeps track of the alignment modes in each
axis. By default, these are initialized to {Both, None} and {None, None}, respectively. The rest of the logic is
boilerplate code for comparing these style objects to one another and copying style representations.
* testing/Internals.cpp:
(WebCore::Internals::scrollSnapOffsets):
Perform a layout on the document if needed before returning the list of computed snap offsets. The absence of
this layout pass was causing some layout tests in css3/scroll-snap/ to flake when testing that programmatic
changes to the scroll snap style properties change the computed snap offsets.
2016-12-19 Dean Jackson <dino@apple.com>
Use ENABLE() in place of ENABLE_CSS_SELECTORS_LEVEL4
https://bugs.webkit.org/show_bug.cgi?id=166043
<rdar://problems/29743655>
Reviewed by Alex Christensen.
This doesn't compile unless the ENABLE_CSS_SELECTORS_LEVEL4 is defined.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSSelectorParser.cpp:
(WebCore::isOnlyPseudoClassFunction):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeCombinator):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2016-12-20 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix Windows Debug build part 2
https://bugs.webkit.org/show_bug.cgi?id=166035
Ensured that this patch passes the build on the GTK port.
* rendering/RenderElement.cpp:
* rendering/RenderElement.h:
2016-12-20 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, fix Windows Debug build
https://bugs.webkit.org/show_bug.cgi?id=166035
The size of SameSizeAsRenderElement should be in sync with sizeof(RenderElement).
* rendering/RenderElement.cpp:
2016-12-20 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
WebRTC: RTCPeerConnection constructor argument should be optional
https://bugs.webkit.org/show_bug.cgi?id=164057
Reviewed by Youenn Fablet.
Modify RTCPeerConnection JSBuiltin constructor to allow RTCPeerConfiguration
argument to be optional.
Update existing tests.
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
2016-12-19 Yusuke Suzuki <utatane.tea@gmail.com>
[ES6] Enable ES6 Modules
https://bugs.webkit.org/show_bug.cgi?id=165849
Reviewed by Geoffrey Garen.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* page/Settings.in:
2016-12-17 Sam Weinig <sam@webkit.org>
Remove a few trivial custom bindings
https://bugs.webkit.org/show_bug.cgi?id=165999
Reviewed by Simon Fraser.
* CMakeLists.txt:
* bindings/js/JSBindingsAllInOne.cpp:
Remove files.
* WebCore.xcodeproj/project.pbxproj:
Move custom bindings that only exist for GC or wrapping reasons
to their own group, so we can focus on the ones with custom functions.
* bindings/js/JSDataTransferCustom.cpp: Removed.
* bindings/js/JSTrackEventCustom.cpp: Removed.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::types):
Remove incorrect comment and use a more concise empty initialization syntax.
* dom/DataTransfer.idl:
Update IDL to remove [Custom] annotation and match spec better.
* html/track/TrackEvent.cpp:
(WebCore::convertToTrackEventTrack):
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
Switch to store the Track in a Variant to make the binding easier.
* html/track/TrackEvent.idl:
Remove [CustomGetter] annotation.
2016-12-19 Zalan Bujtas <zalan@apple.com>
Do not position detached list item marker.
https://bugs.webkit.org/show_bug.cgi?id=166035
<rdar://problem/29175235>
Reviewed by Simon Fraser.
In certain (non-reproducible) cases, the list item marker can get detached from the tree
during layout and when in RenderListItem::positionListMarker() we dereference the marker's parent, we crash.
In addition to the null check, this patch adds an ASSERTION to catch such cases early on.
Unable to reproduce.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeChildInternal):
* rendering/RenderElement.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::layout):
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.h:
2016-12-19 Gavin Barraclough <barraclough@apple.com>
[CSS Parser] Enable CSS Deferred Parsing
https://bugs.webkit.org/show_bug.cgi?id=165869
Unreviewed rollout – looks like this regressed performance.
* css/parser/CSSParserMode.h:
* page/Settings.in:
2016-12-18 Brent Fulgham <bfulgham@apple.com>
Side effects while restting form elements
https://bugs.webkit.org/show_bug.cgi?id=165959
<rdar://problem/29705967>
Reviewed by Anders Carlsson.
JavaScript logic can run while resetting FormElement objects. This can
lead to unintended side-effets and other unwanted behavior. We should
protect these elements during the reset.
Test: fast/html/form-mutate.html
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::HTMLFormElement): Switch to C++11 initialization.
(WebCore::HTMLFormElement::reset): Protect elements until the reset
operation is finished.
(WebCore::HTMLFormElement::resetAssociatedFormControlElements): Added to share
code with 'resumeFromDocument'.
(WebCore::HTMLFormElement::resumeFromDocument): Protect elements until the
reset operation is finished.
2016-12-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r209983.
https://bugs.webkit.org/show_bug.cgi?id=166024
There's intent to support persistent-usage-record (Requested
by zdobersek on #webkit).
Reverted changeset:
"[EME] Remove MediaKeySessionType::persistent-usage-record"
https://bugs.webkit.org/show_bug.cgi?id=166012
http://trac.webkit.org/changeset/209983
2016-12-19 Sam Weinig <sam@webkit.org>
Move custom files / callback objects into their respective groups.
Rubber-stamped by Simon Fraser.
* WebCore.xcodeproj/project.pbxproj:
2016-12-19 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom binding for the named Image constructor
https://bugs.webkit.org/show_bug.cgi?id=166023
Reviewed by Alex Christensen.
* bindings/js/JSBindingsAllInOne.cpp:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove JSImageConstructor.
* bindings/js/JSImageConstructor.cpp: Removed.
* bindings/js/JSImageConstructor.h: Removed.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::image): Deleted.
* page/DOMWindow.idl:
Remove custom getter for the constructor.
* html/HTMLImageElement.idl:
Add NamedConstructor annotation.
2016-12-19 Antti Koivisto <antti@apple.com>
Remove RenderObject::requiresForcedStyleRecalcPropagation
https://bugs.webkit.org/show_bug.cgi?id=166021
Reviewed by Andreas Kling.
It is not called. It also makes no sense architecturally.
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
* html/shadow/mac/ImageControlsRootElementMac.cpp:
* rendering/RenderButton.h:
* rendering/RenderFileUploadControl.h:
* rendering/RenderListItem.h:
* rendering/RenderMedia.h:
* rendering/RenderMenuList.h:
* rendering/RenderMeter.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::requiresForcedStyleRecalcPropagation): Deleted.
* rendering/RenderProgress.h:
* rendering/RenderSlider.h:
* rendering/RenderTextControl.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
This is the only call site. Combination
update.change == Style::NoChange && parent().styleChange == Style::Force
is impossible ('Force' inherits) so requiresForcedStyleRecalcPropagation doesn't ever even get called.
2016-12-19 Zan Dobersek <zdobersek@igalia.com>
[EME] Remove MediaKeySessionType::persistent-usage-record
https://bugs.webkit.org/show_bug.cgi?id=166012
Reviewed by Xabier Rodriguez-Calvar.
Remove the "persistent-usage-record" value from the MediaKeySessionType.
This was removed from the spec as an at-risk feature.
https://github.com/w3c/encrypted-media/issues/353
No non-imported tests need to be updated. This is still present in the
tests imported from the W3C's web-platform-tests repository, but the
tests haven't yet been updated upstream.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::isPersistentType):
* Modules/encryptedmedia/MediaKeySessionType.h:
* Modules/encryptedmedia/MediaKeySessionType.idl:
2016-12-19 Miguel Gomez <magomez@igalia.com>
[GTK] GLXBadFBConfig error when creating an OpenGL context
https://bugs.webkit.org/show_bug.cgi?id=165200
Reviewed by Carlos Garcia Campos.
glXCreateContextAttribsARB causes a GLXBadFBConfig X error when it's not able to provide the
OpenGL version >= 3.2 we are requesting. Due to this, the app crashes instead of falling back to
the legacy path.
The patch modifies GLX context creation using a XErrorTrapper, so the first time a context is created
we don't crash if OpenGL >= 3.2 is not available.
If the gotten context is not valid, we fall back to whatever version glXCreateContextAttribsARB is
able to provide.
The legacy glXCreateContext is only used if the GLX_ARB_create_context extension is not available.
Covered by existent tests.
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::tryCreateGLXARBContext):
(WebCore::GLContextGLX::createWindowContext):
(WebCore::GLContextGLX::createPbufferContext):
2016-12-18 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Prefetch cursor records in the server.
https://bugs.webkit.org/show_bug.cgi?id=166014
Reviewed by Andy Estes.
No new tests (Covered by existing LayoutTests and PerformanceTests).
This patch implements the followng:
1 - After a backing store cursor completes a fetch in the server, it will schedule the next fetch
even before the client requests one. It will do this up to a limited number of prefetches.
2 - Once a client request to advance the cursor comes in, we'll work our way through prefetched
records instead of reading anything from disk, which might then cause us to continue prefetch.
3 - If any changes to the object store occur, it will throw away all previously fetched records
(There's room for future improvement here)
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::postDatabaseTask):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::prefetchCursor):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
(WebCore::IDBServer::SQLiteIDBCursor::prefetch):
(WebCore::IDBServer::SQLiteIDBCursor::advance):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2016-12-18 Wenson Hsieh <wenson_hsieh@apple.com>
Changing text direction fires input events with null inputTypes and no data
https://bugs.webkit.org/show_bug.cgi?id=166007
<rdar://problem/29557205>
Reviewed by Sam Weinig.
Adds support for the "formatSetInlineTextDirection" input type, triggered when using the context menu on Mac in
an editable area (for both plain and rich text cases) to change paragraph direction. To do this, we add cases
for EditActionSetWritingDirection in inputTypeNameForEditingAction and inputEventDataForEditingStyleAndAction.
When changing text direction for a plaintext editable element, we have logic in Editor::setBaseWritingDirection
that sets the focused element's dir attribute to the requested value (ltr or rtl). We add similar hooks here to
dispatch input events and handle preventing default.
Test: fast/events/before-input-events-prevent-text-direction.html
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
Handle the EditActionSetWritingDirection case.
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::Editor::applyParagraphStyle):
Include input event data when dispatching an input event here.
(WebCore::Editor::setBaseWritingDirection):
* testing/Internals.cpp:
(WebCore::Internals::setBaseWritingDirection):
* testing/Internals.h:
* testing/Internals.idl:
Introduce an internal testing support hook for setting base writing direction (the same codepath taken when
using the context menu to change paragraph direction). Currently, using testRunner.execCommand creates and
applies style with an additional `unicode-bidi` attribute, and appears to also be intentionally disabled for
plaintext editable elements.
2016-12-17 Simon Fraser <simon.fraser@apple.com>
Build fix: linking WebCore was failing: you can't export inline functions.
* css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
(WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
* css/DeprecatedCSSOMPrimitiveValue.h:
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): Deleted.
2016-12-16 Dave Hyatt <hyatt@apple.com>
[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
https://bugs.webkit.org/show_bug.cgi?id=165968
Reviewed by Andreas Kling.
This patch changes the CSS OM for values to use distinct wrapper
classes instead of cloning the existing classes. By actually wrapping
values instead of cloning, we are freed up to change our CSS value hierarchy
however we'd like (such as changing to match the new CSS Values OM that
is coming soon).
All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM"
to reflect our desire (ultimately) to remove this API from our tree. We're
the only ones that support it, and it's not used on the Web, but it is part
of the WebKitLegacy API and might be used internally.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.h:
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
(WebCore::JSDeprecatedCSSOMValueOwner::finalize):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted.
(WebCore::JSCSSValueOwner::finalize): Deleted.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSComputedStyleDeclaration.h:
* css/CSSGridLineNamesValue.cpp:
(WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted.
* css/CSSGridLineNamesValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::cloneForCSSOM): Deleted.
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
(WebCore::CSSImageValue::cloneForCSSOM): Deleted.
* css/CSSImageValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
(WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSPrimitiveValue.idl: Removed.
* css/CSSStyleDeclaration.h:
* css/CSSStyleDeclaration.idl:
* css/CSSValue.cpp:
(WebCore::CSSValue::traverseSubresources):
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::createDeprecatedCSSOMWrapper):
(): Deleted.
(WebCore::CSSValue::cloneForCSSOM): Deleted.
* css/CSSValue.h:
(WebCore::CSSValue::CSSValue):
(WebCore::CSSValue::setCssText): Deleted.
(WebCore::CSSValue::isCSSOMSafe): Deleted.
(WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted.
* css/CSSValue.idl: Removed.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::cloneForCSSOM): Deleted.
* css/CSSValueList.h:
(WebCore::CSSValueList::separator):
* css/CSSValueList.idl: Removed.
* css/Counter.h:
* css/Counter.idl: Removed.
* css/DeprecatedCSSOMCounter.h: Added.
* css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl.
* css/DeprecatedCSSOMPrimitiveValue.cpp: Added.
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
* css/DeprecatedCSSOMPrimitiveValue.h: Added.
(WebCore::DeprecatedCSSOMPrimitiveValue::create):
(WebCore::DeprecatedCSSOMPrimitiveValue::equals):
(WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType):
(WebCore::DeprecatedCSSOMPrimitiveValue::cssText):
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
(WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::stringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
* css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl.
* css/DeprecatedCSSOMRGBColor.h: Added.
* css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl.
* css/DeprecatedCSSOMRect.h: Added.
* css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl.
* css/DeprecatedCSSOMValue.cpp: Added.
(WebCore::compareCSSOMValues):
(WebCore::DeprecatedCSSOMValue::equals):
(WebCore::DeprecatedCSSOMValue::destroy):
(WebCore::DeprecatedCSSOMValue::cssValueType):
(WebCore::DeprecatedCSSOMValue::cssText):
* css/DeprecatedCSSOMValue.h: Added.
(WebCore::DeprecatedCSSOMValue::deref):
(WebCore::DeprecatedCSSOMValue::setCssText):
(WebCore::DeprecatedCSSOMValue::operator==):
(WebCore::DeprecatedCSSOMValue::isComplexValue):
(WebCore::DeprecatedCSSOMValue::isPrimitiveValue):
(WebCore::DeprecatedCSSOMValue::isValueList):
(WebCore::DeprecatedCSSOMValue::classType):
(WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMComplexValue::create):
(WebCore::DeprecatedCSSOMComplexValue::equals):
(WebCore::DeprecatedCSSOMComplexValue::cssText):
(WebCore::DeprecatedCSSOMComplexValue::cssValueType):
(WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
* css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl.
* css/DeprecatedCSSOMValueList.cpp: Added.
(WebCore::DeprecatedCSSOMValueList::equals):
(WebCore::DeprecatedCSSOMValueList::cssText):
* css/DeprecatedCSSOMValueList.h: Added.
(WebCore::DeprecatedCSSOMValueList::create):
(WebCore::DeprecatedCSSOMValueList::cssValueType):
(WebCore::DeprecatedCSSOMValueList::length):
(WebCore::DeprecatedCSSOMValueList::item):
(WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
* css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl.
* css/LengthRepeat.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
(WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
(WebCore::StyleRuleCSSStyleDeclaration::didMutate):
(WebCore::InlineCSSStyleDeclaration::didMutate):
(WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted.
* css/PropertySetCSSStyleDeclaration.h:
* css/RGBColor.cpp:
(WebCore::RGBColor::red): Deleted.
(WebCore::RGBColor::green): Deleted.
(WebCore::RGBColor::blue): Deleted.
(WebCore::RGBColor::alpha): Deleted.
* css/RGBColor.h:
* css/RGBColor.idl: Removed.
* css/Rect.h:
(WebCore::RectBase::RectBase):
* css/Rect.idl: Removed.
* svg/SVGElement.cpp:
(WebCore::SVGElement::getPresentationAttribute):
* svg/SVGElement.h:
* svg/SVGElement.idl:
2016-12-17 Philippe Normand <pnormand@igalia.com>
Unreviewed, rollout r209860 OWR player shouldn't be selected for normal video playback
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
(WebCore::MediaPlayerPrivateGStreamerOwr::play):
(WebCore::MediaPlayerPrivateGStreamerOwr::pause):
(WebCore::MediaPlayerPrivateGStreamerOwr::load):
(WebCore::MediaPlayerPrivateGStreamerOwr::stop):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createMutedRemoteSource):
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
2016-12-17 Michael Catanzaro <mcatanzaro@igalia.com>
warning: the compiler can assume that the address of 'thisObject' will always evaluate to 'true' [-Waddress] in WebCore::JSHTMLDocument::getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=165987
Reviewed by Mark Lam.
Work around the warning by passing the JSObject pointer this function receives directly to
ASSERT_GC_OBJECT_INHERITS, instead of casting it to a reference and then taking the address
of that, to avoid the -Waddress warning.
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot):
2016-12-17 Jer Noble <jer.noble@apple.com>
Add implementation for navigator.requestMediaKeySystemAccess()
https://bugs.webkit.org/show_bug.cgi?id=165850
Reviewed by Eric Carlson.
Test: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html
Add an implementation of NavigatorEME::requestMediaKeySystemAccess() as well as the CDM
object on which it depends.
* Modules/encryptedmedia/CDM.cpp: Added.
(WebCore::cdmFactories):
(WebCore::createCDMPrivateForKeySystem):
(WebCore::CDM::registerCDMFactory):
(WebCore::CDM::unregisterCDMFactory):
(WebCore::CDM::supportsKeySystem):
(WebCore::CDM::create):
(WebCore::CDM::CDM):
(WebCore::CDM::getSupportedConfiguration):
(WebCore::CDM::doSupportedConfigurationStep):
(WebCore::CDM::isPersistentType):
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
(WebCore::CDM::getConsentStatus):
* Modules/encryptedmedia/CDM.h: Added.
(WebCore::CDMFactory::~CDMFactory):
(WebCore::CDM::keySystem):
(WebCore::CDM::createWeakPtr):
* Modules/encryptedmedia/CDMPrivate.h: Added.
(WebCore::CDMPrivate::~CDMPrivate):
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
(WebCore::tryNextSupportedConfiguration):
* Modules/encryptedmedia/NavigatorEME.h:
* Modules/encryptedmedia/NavigatorEME.idl:
To aid in testing, a new Internals object is added, MockCDMFactory, which can be
controlled by LayoutTests to change the behavior of the Mock objects it creates.
* testing/Internals.cpp:
(WebCore::Internals::registerMockCDM):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCDMFactory.cpp: Added.
(WebCore::MockCDMFactory::MockCDMFactory):
(WebCore::MockCDMFactory::~MockCDMFactory):
(WebCore::MockCDMFactory::unregister):
(WebCore::MockCDMFactory::supportsKeySystem):
(WebCore::MockCDMFactory::createCDM):
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::supportsInitDataType):
(WebCore::MockCDM::supportsConfiguration):
(WebCore::MockCDM::supportsConfigurationWithRestrictions):
(WebCore::MockCDM::supportsSessionTypeWithConfiguration):
(WebCore::MockCDM::supportsRobustness):
(WebCore::MockCDM::distinctiveIdentifiersRequirement):
(WebCore::MockCDM::persistentStateRequirement):
(WebCore::MockCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable):
* testing/MockCDMFactory.h: Added.
(WebCore::MockCDMFactory::create):
(WebCore::MockCDMFactory::supportedDataTypes):
(WebCore::MockCDMFactory::setSupportedDataTypes):
(WebCore::MockCDMFactory::supportedRobustness):
(WebCore::MockCDMFactory::setSupportedRobustness):
(WebCore::MockCDMFactory::distinctiveIdentifiersRequirement):
(WebCore::MockCDMFactory::setDistinctiveIdentifiersRequirement):
(WebCore::MockCDMFactory::persistentStateRequirement):
(WebCore::MockCDMFactory::setPersistentStateRequirement):
* testing/MockCDMFactory.idl: Added.
Move the MediaKeySessionType definition out of the MediaKeys.idl file and into its own.
Move the MediaKeysRequiriment definition out of the MediaKeySystemConfiguration.idl file
and into its own. Generally fix up the .idl files so that they properly work with their
implementation files.
* Modules/encryptedmedia/MediaKeySessionType.idl: Added.
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
(WebCore::MediaKeySystemAccess::create):
(WebCore::MediaKeySystemAccess::MediaKeySystemAccess):
(WebCore::MediaKeySystemAccess::keySystem): Deleted.
(WebCore::MediaKeySystemAccess::getConfiguration): Deleted.
* Modules/encryptedmedia/MediaKeySystemAccess.h:
(WebCore::MediaKeySystemAccess::keySystem):
(WebCore::MediaKeySystemAccess::getConfiguration):
(WebCore::MediaKeySystemAccess::create): Deleted.
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeySystemConfiguration.h:
* Modules/encryptedmedia/MediaKeySystemConfiguration.idl:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/MediaKeysRequirement.idl: Added.
* Modules/encryptedmedia/MediaKeysRestrictions.h: Added.
* bindings/js/JSMediaKeySystemAccessCustom.cpp: Removed.
As some of these enums are referenced in the Internals project, they need to be exported
from WebCore correctly. Teach the code generator how to export the symbols generated by
enums.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationHeaderContent):
Add new files to the project.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
2016-12-17 Darin Adler <darin@apple.com>
Remove WebCore::Dictionary, which is now unused
https://bugs.webkit.org/show_bug.cgi?id=165988
Reviewed by Andreas Kling.
* CMakeLists.txt: Removed the files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/Dictionary.cpp: Removed.
* bindings/js/Dictionary.h: Removed.
* bindings/js/JSBindingsAllInOne.cpp: Removed include of Dictionary.cpp.
2016-12-17 Youenn Fablet <youenn@apple.com>
Cloned CachedResource should not have an empty response
https://bugs.webkit.org/show_bug.cgi?id=165947
Reviewed by Sam Weinig.
Test: http/tests/loading/reusing-cached-stylesheet-from-different-domain.html
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setBodyDataFrom): Copying the response to the cloned resource.
Even though the issue is appearing for stylesheets only, it is safer to do that for all cloned ressources.
2016-12-16 Brady Eidson <beidson@apple.com>
IndexedDB: Refactor SQLiteIDBCursor to prepare for cursor prefetching.
https://bugs.webkit.org/show_bug.cgi?id=165978
Reviewed by Alex Christensen.
No new tests (Refactor, no behavior change).
In preparation for cursor prefetching, we need to shift the cursor off of keeping "the current record"
and onto keeping "a deque of fetched records", the first of which is "the current record".
This patch does just that, but with no behavior change; The deque only ever holds 0 or 1 records.
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::prefetch):
(WebCore::IDBServer::SQLiteIDBCursor::advance):
(WebCore::IDBServer::SQLiteIDBCursor::fetch):
(WebCore::IDBServer::SQLiteIDBCursor::fetchNextRecord):
(WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):
(WebCore::IDBServer::SQLiteIDBCursor::didComplete):
(WebCore::IDBServer::SQLiteIDBCursor::didError):
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::advanceOnce): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Deleted.
* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteCursorRecord::isTerminalRecord):
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::currentKey): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::currentValue): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::didComplete): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::didError): Deleted.
2016-12-16 Darin Adler <darin@apple.com>
Remove all custom bindings from media streams, using dictionaries instead
https://bugs.webkit.org/show_bug.cgi?id=165943
Reviewed by Sam Weinig.
* CMakeLists.txt: Added and removed files.
* DerivedSources.make: Ditto.
* Modules/mediastream/DoubleRange.h: Added. Moved dictionary here so it can be shared
by both MediaStreamTrack and MediaTrackSupportedConstraints.
* Modules/mediastream/DoubleRange.idl: Ditto.
* Modules/mediastream/LongRange.h: Ditto.
* Modules/mediastream/LongRange.idl: Ditto.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getSupportedConstraints): Changed to return a struct instead
of a reference counted object.
* Modules/mediastream/MediaDevices.h: Updated for the above.
* Modules/mediastream/MediaDevices.idl: Added a conditional on the dictionary in this
file; not needed because the conditional on the interface automatically affects the
entire fiel, but for now the style seems to be to put these on all the dictionaries.
* Modules/mediastream/MediaSourceSettings.cpp: Removed.
* Modules/mediastream/MediaSourceSettings.h: Removed.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings): Changed to return a struct instead of a
reference counted object.
(WebCore::capabilityDoubleRange): Added. Helper for getCapabilities.
(WebCore::capabilityIntRange): Ditto.
(WebCore::capabilityStringVector): Ditto.
(WebCore::capabilityBooleanVector): Ditto.
(WebCore::MediaStreamTrack::getCapabilities): Changed to return a struct instead
of a reference counted object.
* Modules/mediastream/MediaStreamTrack.h: Updated for the above changes. Also
defined the structs here in the class.
* Modules/mediastream/MediaStreamTrack.idl: Defined the two dictionaries here and
changed the functions to return them and not use [Custom] any more.
* Modules/mediastream/MediaTrackConstraints.h: Moved DoubleRange and LongRange out
of this file and into their own headers. Also removed the currently unimplemented
latency and channelCount; there are FIXME comments in the IDL file about eventually
adding these to match the specification.
* Modules/mediastream/MediaTrackConstraints.idl: Added conditionals, and removed
the unimplemented latency and channelCount.
style of marking everything consistently.
* Modules/mediastream/MediaTrackSupportedConstraints.h: Replaced this class with
a struct.
* Modules/mediastream/MediaTrackSupportedConstraints.idl: Replaced this interface
with a dictionary.
* WebCore.xcodeproj/project.pbxproj: Added and removed files.
* bindings/js/JSMediaStreamTrackCustom.cpp: Removed.
* bindings/js/JSMediaTrackSupportedConstraintsCustom.cpp: Removed.
* platform/mediastream/MediaStreamTrackPrivate.cpp: Removed include of the
MediaSourceSettings.h header.
* platform/mediastream/MediaStreamTrackPrivate.h: Removed forward declaration of
the MediaSourceSettings class.
2016-12-16 Zalan Bujtas <zalan@apple.com>
Possible nullptr dereference when applying pagination to viewport
https://bugs.webkit.org/show_bug.cgi?id=165926
Reviewed by Simon Fraser.
Static analysis found a code path where a null dereference could occur.
* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):
2016-12-16 Ryan Haddad <ryanhaddad@apple.com>
Fix the Windows build.
Unreviewed build fix.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2016-12-16 Ryan Haddad <ryanhaddad@apple.com>
Yet another attempt to fix the Windows build after r209936.
Unreviewed build fix.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2016-12-16 Alex Christensen <achristensen@webkit.org>
Use initEvent quirk added in r207908 for Flipboard
https://bugs.webkit.org/show_bug.cgi?id=165974
<rdar://problem/28264190>
Reviewed by Chris Dumez.
* dom/Event.cpp:
(WebCore::Event::initEventForBindings):
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isFlipboard):
Flipboard also has JavaScript content that calls initEvent with not enough arguments.
2016-12-16 Chris Dumez <cdumez@apple.com>
[iOS] Align HTML from validation popover style with Copy/Paste callout bar
https://bugs.webkit.org/show_bug.cgi?id=165973
<rdar://problem/29336638>
Reviewed by Simon Fraser.
Tweak font size and padding of the HTML from validation popover to
match the style of the Copy/Paste callout bar on iOS.
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
2016-12-16 Ryan Haddad <ryanhaddad@apple.com>
Another attempt to fix the Windows build after r209936.
Unreviewed build fix.
* CMakeLists.txt:
2016-12-16 Andy Estes <aestes@apple.com>
Add a setting to suppress keyboard input during provisional navigation
https://bugs.webkit.org/show_bug.cgi?id=165830
Reviewed by Brent Fulgham.
Added a setting that suppresses keyboard input during provisional navigation. When the
setting is enabled, DOM propogation of keyboard input events (KeyboardEvents,
CompositionEvents, InputEvents, and some TextEvents) is suppressed, and text insertion is
disabled in the editor.
Non-editing default event handling still occurs, for instance keyboard scrolling, access
keys, and focus navigation.
Test: http/tests/navigation/keyboard-events-during-provisional-navigation.html
* dom/CompositionEvent.h: Added a type trait specialization.
* dom/EventDispatcher.cpp:
(WebCore::shouldSuppressEventDispatchInDOM): Added. Returns true if the event is trusted,
FrameLoader::shouldSuppressKeyboardInput() returns true, and the event is a
CompositionEvent, InputEvent, KeyboardEvent, or keyboard/composition TextEvent.
(WebCore::EventDispatcher::dispatchEvent): Called stopPropogation() on the event if
shouldSuppressEventDispatchInDOM() returns true.
* dom/InputEvent.h: Removed the inline no-op destructor so that DataTransfer does not need
to be a complete type in every translation unit that includes this header. Added a type
trait specialization.
* dom/TextEvent.h: Added isKeyboard() to determine if m_inputType is TextEventInputKeyboard.
* editing/Editor.cpp:
(WebCore::Editor::shouldInsertText): Returned false if
FrameLoader::shouldSuppressKeyboardInput() returns true and the action is
EditorInsertActionTyped.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldSuppressKeyboardInput): Added. Returns true if
Settings::shouldSuppressKeyboardInputDuringProvisionalNavigation() returns true and the
state is FrameStateProvisional.
* loader/FrameLoader.h: Declared shouldSuppressKeyboardInput().
* page/EventHandler.h: Exported accessKeyModifiers().
* page/Settings.in: Defined shouldSuppressKeyboardInputDuringProvisionalNavigation with an
initial value of false.
* testing/Internals.cpp:
(WebCore::Internals::accessKeyModifiers): Added. Returns a vector of strings representing
the access key modifiers.
* testing/Internals.h: Declared accessKeyModifiers().
* testing/Internals.idl: Exposed accessKeyModifiers() on the internals object.
2016-12-16 Brady Eidson <beidson@apple.com>
More SQLiteIDBCursor refactoring.
https://bugs.webkit.org/show_bug.cgi?id=165956
Reviewed by Tim Horton.
No new tests (No behavior change).
This is a simple patch that encapsulates the current state of the cursor in one structure
which will allow for storing multiple-such states in the future (to support prefetching).
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::advance):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
(WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):
(WebCore::IDBServer::SQLiteIDBCursor::didComplete):
(WebCore::IDBServer::SQLiteIDBCursor::didError):
2016-12-16 Jer Noble <jer.noble@apple.com>
Follow-up build fix after r209936; also rename MockCDM -> LegacyMockCDM in
CMakeLists.txt.
* CMakeLists.txt:
2016-12-16 Sam Weinig <sam@webkit.org>
[Bindings] Remove use of Dictionary/ArrayValue in CDMSessionClearKey
https://bugs.webkit.org/show_bug.cgi?id=165961
Reviewed by Darin Adler.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove ArrayValue.h/cpp
* bindings/js/ArrayValue.cpp: Removed.
* bindings/js/ArrayValue.h: Removed.
* bindings/js/Dictionary.cpp:
* bindings/js/Dictionary.h:
Remove support for ArrayValue.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
Replace use of Dictionary/ArrayValue with direct JSObject functions. This
should really be replaced with a JSON parser that does not require round
tripping through JavaScript objects.
2016-12-13 Jer Noble <jer.noble@apple.com>
Move existing CDM* implementations into modules/encryptedmedia/legacy
https://bugs.webkit.org/show_bug.cgi?id=165823
Rubber-stamped by Sam Weinig.
* Modules/encryptedmedia/legacy/LegacyCDM.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.cpp.
(WebCore::CDMFactory::CDMFactory):
(WebCore::installedCDMFactories):
(WebCore::CDM::registerCDMFactory):
(WebCore::CDMFactoryForKeySystem):
(WebCore::CDM::supportsKeySystem):
(WebCore::CDM::keySystemSupportsMimeType):
(WebCore::CDM::create):
(WebCore::CDM::CDM):
(WebCore::CDM::~CDM):
(WebCore::CDM::supportsMIMEType):
(WebCore::CDM::createSession):
(WebCore::CDM::mediaPlayer):
* Modules/encryptedmedia/legacy/LegacyCDM.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.h.
(WebCore::CDMClient::~CDMClient):
(WebCore::CDM::keySystem):
(WebCore::CDM::client):
(WebCore::CDM::setClient):
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
(WebCore::CDMPrivateInterface::CDMPrivateInterface):
(WebCore::CDMPrivateInterface::~CDMPrivateInterface):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp.
(WebCore::CDMPrivateClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateClearKey::supportsMIMEType):
(WebCore::CDMPrivateClearKey::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h.
(WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
(WebCore::CDMPrivateClearKey::~CDMPrivateClearKey):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp.
(WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
(WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h.
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::cdm):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp.
(WebCore::clearKeyVM):
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
(WebCore::CDMSessionClearKey::~CDMSessionClearKey):
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::releaseKeys):
(WebCore::CDMSessionClearKey::update):
(WebCore::CDMSessionClearKey::cachedKeyForKeyID):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/LegacyCDMSession.h: Renamed from Source/WebCore/platform/graphics/CDMSession.h.
(WebCore::CDMSessionClient::~CDMSessionClient):
(WebCore::CDMSession::CDMSession):
(WebCore::CDMSession::~CDMSession):
(WebCore::CDMSession::type):
(WebCore::CDMSession::cachedKeyForKeyID):
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* testing/Internals.cpp:
* testing/LegacyMockCDM.cpp: Renamed from Source/WebCore/testing/MockCDM.cpp.
(WebCore::MockCDMSession::~MockCDMSession):
(WebCore::MockCDM::supportsKeySystem):
(WebCore::MockCDM::supportsKeySystemAndMimeType):
(WebCore::MockCDM::supportsMIMEType):
(WebCore::MockCDM::createSession):
(WebCore::initDataPrefix):
(WebCore::keyPrefix):
(WebCore::keyRequest):
(WebCore::generateSessionId):
(WebCore::MockCDMSession::MockCDMSession):
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::releaseKeys):
(WebCore::MockCDMSession::update):
* testing/LegacyMockCDM.h: Renamed from Source/WebCore/testing/MockCDM.h.
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::~MockCDM):
2016-12-16 Andreas Kling <akling@apple.com>
Subframes going into page cache don't need to resetScrollbars().
<https://webkit.org/b/163750>
<rdar://problem/29273020>
Reviewed by Antti Koivisto.
The main frame is the only frame that switches its FrameView when using the page cache,
subframes just suspend their DOM and wait around to be either killed or restored.
Thus there is no reason for subframes to reset their FrameView's scrollbars when going
into page cache, since nothing affects them while cached, and their layout should end up
identical when restoring.
This was causing some flakiness with subframe scrollbars jumping between different sizes
in when restoring from page cache in macOS/WK1. This change makes the behavior consistent
in both WK1 and WK2, and removes the flakiness.
* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
2016-12-16 Wenson Hsieh <wenson_hsieh@apple.com>
Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements
https://bugs.webkit.org/show_bug.cgi?id=165767
<rdar://problem/29602382>
Reviewed by Simon Fraser.
When changing the layout viewport override, mark viewport-constrained objects as needing layout. If only the
width and height of the old and new layout viewports are compared, EditorState info (namely selection and caret
rects) that depends on the document location of fixed elements may be stale immediately after the layout
viewport override changes and before layout occurs.
This caused one of the tests (fixed-caret-position-after-scroll.html) to occasionally fail.
Tests: editing/caret/ios/absolute-caret-position-after-scroll.html
editing/caret/ios/fixed-caret-position-after-scroll.html
editing/selection/ios/absolute-selection-after-scroll.html
editing/selection/ios/fixed-selection-after-scroll.html
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOverrideRect):
2016-12-14 Sam Weinig <sam@webkit.org>
[ApplePay] Remove remaining custom bindings from the ApplePay code
https://bugs.webkit.org/show_bug.cgi?id=165860
Reviewed by Darin Adler.
* DerivedSources.make:
Add new IDL files.
* WebCore.xcodeproj/project.pbxproj:
Add/remove files.
* bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp: Removed.
* bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp: Removed.
* bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp: Removed.
* bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp: Removed.
Remove custom bindings.
* Modules/applepay/ApplePayLineItem.h: Added.
* Modules/applepay/ApplePayLineItem.idl: Added.
* Modules/applepay/ApplePayPayment.h: Added.
* Modules/applepay/ApplePayPayment.idl: Added.
* Modules/applepay/ApplePayPaymentContact.h: Added.
* Modules/applepay/ApplePayPaymentContact.idl: Added.
* Modules/applepay/ApplePayPaymentMethod.h: Added.
* Modules/applepay/ApplePayPaymentMethod.idl: Added.
* Modules/applepay/ApplePayPaymentPass.h: Added.
* Modules/applepay/ApplePayPaymentPass.idl: Added.
* Modules/applepay/ApplePayPaymentRequest.h: Added.
* Modules/applepay/ApplePayPaymentRequest.idl: Added.
* Modules/applepay/ApplePayShippingMethod.h: Added.
* Modules/applepay/ApplePayShippingMethod.idl: Added.
Split out dictionaries and enums into separate files where needed.
* Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
(WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
* Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
* Modules/applepay/ApplePayPaymentAuthorizedEvent.idl:
Convert the 'payment' property to return an ApplePayPayment dictionary, removing
the need for custom bindings.
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
(WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl:
Convert the 'paymentMethod' property to return an ApplePayPaymentMethod dictionary, removing
the need for custom bindings.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::ApplePaySession):
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::didSelectShippingMethod):
* Modules/applepay/ApplePaySession.h:
Update for new names, remove need for ExecState in the create function, and simplify
billingContact and shippingContact now that they are strongly typed.
* Modules/applepay/ApplePaySession.idl:
Move dictionaries and enums to their own files.
* Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
(WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
* Modules/applepay/ApplePayShippingContactSelectedEvent.h:
* Modules/applepay/ApplePayShippingContactSelectedEvent.idl:
Convert the 'shippingContact' property to return an ApplePayPaymentContact dictionary, removing
the need for custom bindings.
* Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
* Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
* Modules/applepay/ApplePayShippingMethodSelectedEvent.idl:
Convert the 'shippingMethod' property to return an ApplePayShippingMethod dictionary, removing
the need for custom bindings.
* Modules/applepay/Payment.h:
* Modules/applepay/PaymentContact.h:
* Modules/applepay/PaymentMethod.h:
* Modules/applepay/cocoa/PaymentCocoa.mm:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
Replace toJS/fromJS functions with ones that convert to/from the associated dictionary type.
* bindings/generic/IDLTypes.h:
(WebCore::IDLJSON::nullValue):
(WebCore::IDLJSON::isNullValue):
(WebCore::IDLJSON::extractValueFromNullable):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLJSON>::convert):
(WebCore::JSConverter<IDLJSON>::convert):
Add a new custom type, JSON, which converts from a String to a JS object.
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
Add support for the new JSON type, and improve scoped naming to allow for enums
in dictionary only IDL files.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
Update test result for improved scoped naming.
2016-12-16 Zalan Bujtas <zalan@apple.com>
Defer certain accessibility callbacks until after layout is finished.
https://bugs.webkit.org/show_bug.cgi?id=165861
rdar://problem/29646301
Reviewed by Chris Fleizach.
Currently with certain AXObjectCache callbacks, we can end up in a layout while the render tree is being mutated.
This patch ensures that such callbacks are deferred until after tree mutation/layout is finished.
Test: accessibility/accessibility-crash-with-dynamic-inline-content.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::performDeferredIsIgnoredChange):
(WebCore::AXObjectCache::insertDeferredIsIgnoredChange):
* accessibility/AXObjectCache.h:
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::deleteLines):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::createAndAppendRootInlineBox):
2016-12-16 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r209897.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::visitChildren):
2016-12-15 Brent Fulgham <bfulgham@apple.com>
Arguments called in wrong order
https://bugs.webkit.org/show_bug.cgi?id=165923
Reviewed by Simon Fraser.
Correct the ordering of several function calls.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): The 'nearestToPresentationStartTime'
argument is being checked for validity, but 'nearestToPresentationEndTime' is being used in the
calculation. This seems like a copy/paste error.
* page/PrintContext.cpp:
(WebCore::PrintContext::outputLinkedDestinations): FloatPoint::expandedTo returns a new object that
has been expanded. This code continued using the 'unexpanded' point.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::computeImageSizeInBytes): The 'bytesPerComponent' and 'componentsPerPixel'
variables were being passed in the wrong order.
* platform/network/CacheValidation.cpp: The 'last-modified' header string was being concatenated with
the following string, resulting in an incorrect 'last-modifiedproxy-authenticate' string value.
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::firstGlyph): The ASSERT was assigning to the (by-value) input
parameter 'codePoint', rather than comparing it to the firstGlyph value's codePoint.
2016-12-16 Youenn Fablet <youenn@apple.com>
[Fetch API] Improve resource loading console logging
https://bugs.webkit.org/show_bug.cgi?id=160546
Reviewed by Alex Christensen.
Covered by rebased tests.
Adding support for logging of resource loading failures in ThreadableLoader.
This will allow doing consistent logging for clients such as fetch, XHR, event source...
Doing logging for Fetch API only at the moment in ThreadableLoader.
Future patches should migrate XHR to this logging system.
Logging routine is implemented in ThreadableLoader.
It is used directly by DocumentThreadableLoader before calling didFail client callback.
DocumentThreadableLoader has a new option to not log errors, in the case the client is WorkerThreadableLoader::MainBridge.
In that case, the logging is done in the worker context within WorkerThreadableLoader::MainBridge::didFail
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadResourceSynchronously): Enable logging.
(WebCore::DocumentThreadableLoader::create): Passing logging parameter to constructor.
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Adding initialization of logging parameter.
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Making use of the new logErrorAndFail helper routine.
(WebCore::DocumentThreadableLoader::cancel): No need to log error if it is being cancelled.
(WebCore::DocumentThreadableLoader::redirectReceived): Made the reportXX routines methods of DocumentThreadableLoaders and using logErrorAndFail internally.
(WebCore::DocumentThreadableLoader::didFail): Wrapper around logErrorAndFail since cancel is not calling it anymore.
(WebCore::DocumentThreadableLoader::preflightFailure):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::DocumentThreadableLoader::reportRedirectionWithBadScheme):
(WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError):
(WebCore::DocumentThreadableLoader::reportCrossOriginResourceSharingError):
(WebCore::DocumentThreadableLoader::logErrorAndFail):
(WebCore::reportContentSecurityPolicyError): Deleted.
(WebCore::reportCrossOriginResourceSharingError): Deleted.
(WebCore::reportRedirectionWithBadScheme): Deleted.
* loader/DocumentThreadableLoader.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::logError):
* loader/ThreadableLoader.h:
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::create):
(WebCore::ThreadableLoaderClientWrapper::initiator):
(WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
2016-12-16 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Fix build warning in MediaPlayerPrivateGStreamer.cpp using gcc 6.2
https://bugs.webkit.org/show_bug.cgi?id=165900
Reviewed by Žan Doberšek.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
Move the variable asignation out of the if condition.
2016-12-16 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableByteStreamController cancel internal method
https://bugs.webkit.org/show_bug.cgi?id=165798
Reviewed by Youenn Fablet.
Implemented cancel method of ReadableByteStreamController.
Also fixed small inconsistency in readableByteStreamControllerClose.
Added one test to check cancel behaviour. More tests may be added as the API is implemented.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Define cancel internal method.
(readableByteStreamControllerCancel): Added.
(readableByteStreamControllerClose): Fixed behaviour (no value should be dequeued).
* bindings/js/WebCoreBuiltinNames.h: Removed bytesFilled (previous addition was not needed).
2016-12-16 Youenn Fablet <youennf@gmail.com>
svg/as-image/svg-image-with-data-uri-use-data-uri.svg is flaky after r207754
https://bugs.webkit.org/show_bug.cgi?id=163887
<rdar://problem/29266436>
Reviewed by Alex Christensen.
Test: http/tests/security/cross-origin-cached-images-with-memory-pressure.html
With the introduction of cached resource cloning, an Image may be referenced by several CachedImage.
This did not work well with Image observer system as it mandates a one-to-one relationship.
Introducing CachedImageObserver to restore the one-to-one relationship between Image and its observer.
CachedImageObserver can keep references for more than one CachedImage.
In the future, it might be better to split more clearly CachedImageObserver and its API from CachedImage.
Or remove the concept of CachedResource cloning and find new ways to provide CachedResource origin information to clients.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load): Moved boolean image observer fields to CachedImageObserver.
(WebCore::CachedImage::setBodyDataFrom): Keeping a reference of the image observer when cloning the resource.
(WebCore::CachedImage::createImage): Creating the observer when creating the image.
(WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
(WebCore::CachedImage::CachedImageObserver::decodedSizeChanged):
(WebCore::CachedImage::CachedImageObserver::didDraw):
(WebCore::CachedImage::CachedImageObserver::animationAdvanced):
(WebCore::CachedImage::CachedImageObserver::changedInRect):
(WebCore::CachedImage::clearImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setBodyDataFrom): Now that each cached image receives decodedSizeChanged callback, we need to set its size correctly.
2016-12-15 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix debug build break since r209873. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=165945
No new tests, no new behaviours.
Use Primitive System Data Type uint64_t instead of unsigned long long.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
* Modules/indexeddb/IDBFactory.h:
2016-12-15 Zalan Bujtas <zalan@apple.com>
text-align: justify and word-spacing combine to overflow column
https://bugs.webkit.org/show_bug.cgi?id=165796
rdar://problem/29672168
Reviewed by Myles C. Maxfield.
The value of the word-spacing property is not applied on the inline-tree boxes (normal line layout)
with kerning enabled. It causes hittest failures and selection/rendering glitches.
We normally use the pre-computed 'WordMeasurements' values to figure out the run widths. However
with kerning on, in some cases we need to re-measure a certain part of the text by calling RenderText::width().
This function omits the word-spacing value for leading whitespace, so when this text fragment starts with a whitespace,
(while it's not at the beginning of the run) we have to manually add the word-spacing value back.
r146087 added this logic with the restriction of applying it only to whitespace-only runs.
Test: fast/css/word-spacing-with-normal-layout.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
Stop reinterpret_casting UBreakIterators to the undefined type TextBreakIterator
https://bugs.webkit.org/show_bug.cgi?id=165931
Reviewed by Alex Christensen.
No new tests because there is no behavior change.
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
* editing/TextCheckingHelper.cpp:
(WebCore::findMisspellings):
* editing/VisibleUnits.cpp:
(WebCore::wordBreakIteratorForMinOffsetBoundary):
(WebCore::wordBreakIteratorForMaxOffsetBoundary):
(WebCore::isLogicalStartOfWord):
(WebCore::islogicalEndOfWord):
(WebCore::visualWordPosition):
(WebCore::startSentenceBoundary):
(WebCore::endSentenceBoundary):
(WebCore::previousSentencePositionBoundary):
(WebCore::nextSentencePositionBoundary):
* html/HTMLInputElement.cpp:
* html/HTMLTextAreaElement.cpp:
* html/InputType.cpp:
* html/TextFieldInputType.cpp:
* html/TextInputType.cpp:
* platform/graphics/StringTruncator.cpp:
(WebCore::textBreakAtOrPreceding):
(WebCore::boundedTextBreakFollowing):
(WebCore::rightClipToWordBuffer):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* platform/text/TextBoundaries.cpp:
(WebCore::findNextWordFromIndex):
(WebCore::findWordBoundary):
(WebCore::findEndWordBoundary):
* platform/text/mac/TextBoundaries.mm:
(WebCore::findNextWordFromIndex):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionNonLoosely):
(WebCore::nextBreakablePositionLoosely):
* rendering/RenderBlock.cpp:
* rendering/RenderText.cpp:
(WebCore::makeCapitalized):
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::previousOffsetForBackwardDeletion):
(WebCore::RenderText::nextOffset):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
* rendering/line/LineBreaker.h:
2016-12-15 Darin Adler <darin@apple.com>
Use asString instead of toWTFString, toString, or getString when we already checked isString
https://bugs.webkit.org/show_bug.cgi?id=165895
Reviewed by Yusuke Suzuki.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract): Use asString/value instead of toWTFString.
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::callScript): Use asString/value instead of getString.
* bindings/js/ArrayValue.cpp:
(WebCore::ArrayValue::get): Use asString/value instead of toWTFString.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::get): Use asString/length instead of toString/length.
(WebCore::createIDBKeyFromValue): Use asString/value instead of toWTFString.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier): Ditto.
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue): Use asString/value instead of getString.
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems): Use asString/value instead of toWTFString.
* bindings/js/ScriptController.cpp:
(WebCore::jsValueToModuleKey): Use asString/toIdentifier instead of
jsCast<JSString*>/value/Identifier::fromString.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal): Streamline by getting rid of local variable.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList): Use asString instead of jsCast<JSString*>.
(WebCore::ContentExtensions::loadTrigger): Use asString/value instead of toWTFString.
(WebCore::ContentExtensions::loadAction): Ditto.
* css/FontFace.cpp:
(WebCore::FontFace::create): Use asString/value instead of getString.
2016-12-15 Zalan Bujtas <zalan@apple.com>
Change ::computeLogicalHeight's computedValues out argument to the return value.
https://bugs.webkit.org/show_bug.cgi?id=165789
Reviewed by Simon Fraser.
No change in functionality.
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::RenderImageControlsButton::computeLogicalHeight):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::RenderImageControls::computeLogicalHeight):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
(WebCore::RenderBlock::estimateRegionRangeForBoxChild):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateLogicalHeight):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(WebCore::RenderBox::ComputedMarginValues::ComputedMarginValues): Deleted.
(WebCore::RenderBox::LogicalExtentComputedValues::LogicalExtentComputedValues): Deleted.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::mainAxisContentExtent):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::computeLogicalHeight):
* rendering/RenderFlowThread.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeLogicalHeight):
* rendering/RenderListBox.h:
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::computeLogicalHeight):
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::computeLogicalHeight):
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::computeLogicalHeight):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::computeLogicalHeight):
* rendering/RenderProgress.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight):
* rendering/RenderTextControl.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::computeLogicalHeight):
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeLogicalHeight):
* rendering/svg/RenderSVGForeignObject.h:
2016-12-15 Chris Dumez <cdumez@apple.com>
Make sure HTML validation bubble's state is updated after layout
https://bugs.webkit.org/show_bug.cgi?id=165922
<rdar://problem/29694730>
Reviewed by Simon Fraser.
Make sure HTML validation bubble's state is updated after layout.
In particular, if the validation bubble's associated element has
moved or is no longer visible, we now hide the bubble.
Tests: fast/forms/validation-bubble-disappears-when-input-detached.html
fast/forms/validation-bubble-disappears-when-input-moved.html
fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html
* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged):
* page/Page.cpp:
(WebCore::Page::updateValidationBubbleStateIfNeeded):
* page/Page.h:
* page/ValidationMessageClient.h:
2016-12-15 Sam Weinig <sam@webkit.org>
[WebIDL] Remove use of Dictionary from JSCryptoAlgorithmDictionary
https://bugs.webkit.org/show_bug.cgi?id=165919
Reviewed by Darin Adler.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
* bindings/js/JSCryptoAlgorithmDictionary.h:
* bindings/js/JSCryptoOperationData.cpp:
* bindings/js/JSCryptoOperationData.h:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
Replace simplistic use of Dictionary with simplistic use of direct JSObject
functions. Also, pass the ExecState by reference.
2016-12-15 Filip Pizlo <fpizlo@apple.com>
Get rid of HeapRootVisitor and make SlotVisitor less painful to use
https://bugs.webkit.org/show_bug.cgi?id=165911
Reviewed by Geoffrey Garen.
No new tests because no new behavior.
This updates WebCore code to new JSC API.
* bindings/js/JSDOMBinding.cpp:
(WebCore::DOMConstructorJSBuiltinObject::visitChildren):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::visitAggregate):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::visitJSFunction):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::visitChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=165937
Reviewed by Simon Fraser.
No new tests because there is no behavior change.
* WebCore.xcodeproj/project.pbxproj:
2016-12-15 Chris Dumez <cdumez@apple.com>
Move charCode / keyCode / which attributes from UIEvent to KeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=165904
Reviewed by Sam Weinig.
Move 'charCode' / 'keyCode' attributes from UIEvent to KeyboardEvent and add
'which' to KeyboardEvent to match the specification:
- https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent
We keep a 'which' attribute on UIEvent even though the specification does
not say we should because Firefox and Chrome have 'which' on UIEvent still.
Specification:
- 'charCode' / 'keyCode' / 'which' on KeyboardEvent only
Firefox:
- 'charCode' / 'keyCode' on KeyboardEvent only
- 'which' on UIEvent only
Chrome:
- 'charCode' / 'keyCode' / 'which' on KeyboardEvent
- 'which' on UIEvent as well
Old WebKit behavior:
- 'charCode' / 'keyCode' / 'which' on UIEvent only
New WebKit behavior:
- 'charCode' / 'keyCode' / 'which' on KeyboardEvent
- 'which' on UIEvent as well
Our new behavior is identical to Chrome, much closer to the specification,
and closer to Firefox as well.
No new tests, updated / rebaselined existing tests.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::keyCode):
(WebCore::KeyboardEvent::charCode):
(WebCore::KeyboardEvent::which):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::which):
* dom/UIEvent.cpp:
* dom/UIEvent.h:
* dom/UIEvent.idl:
2016-12-15 Brady Eidson <beidson@apple.com>
IndexedDB: Add an "IDBCursorRecord" struct.
https://bugs.webkit.org/show_bug.cgi?id=165929
Reviewed by Alex Christensen.
No new tests (Refactor, no behavior change).
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):
* Modules/indexeddb/shared/IDBCursorRecord.h: Added.
(WebCore::IDBCursorRecord::encode):
(WebCore::IDBCursorRecord::decode):
* WebCore.xcodeproj/project.pbxproj:
2016-12-15 Keith Rollin <krollin@apple.com>
Refactor Document::suspend/resume
https://bugs.webkit.org/show_bug.cgi?id=165921
Reviewed by Chris Dumez.
Update Document::suspend to call Document::suspendScheduledTasks
rather than duplicating the latter's code within itself. Similar
treatment of Document::resume and Document::resumeScheduledTasks.
No new tests -- no new functionality, just refactoring existing code.
* dom/Document.cpp:
(WebCore::Document::suspend):
(WebCore::Document::resume):
2016-12-15 Alex Christensen <achristensen@webkit.org>
Remove flex and bison build dependencies; commit generated XPath parser
https://bugs.webkit.org/show_bug.cgi?id=165783
Reviewed by Brent Fulgham.
flex and bison are annoying to install and use, especially on Windows.
Since only XPathGrammar uses them and that's not actively developed, let's just check in the one generated file
and make building WebKit easier forever!
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/makegrammar.pl: Removed.
* xml/XPathGrammar.cpp: Added.
(xpathyylex):
(xpathyyerror):
(yysyntax_error):
* xml/XPathGrammar.h: Added.
* xml/XPathGrammar.y: Rename TEXT to TEXT_ to fix a build error on Windows. TEXT is already defined.
2016-12-15 Brady Eidson <beidson@apple.com>
Enhance some of the logging statements just added for IndexedDB Operation scheduling.
Rubberstamped by Tim Horton.
No new tests (No behavior change).
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestPutOrAdd):
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString):
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString):
2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Implement font-synthesis: small-caps
https://bugs.webkit.org/show_bug.cgi?id=165892
Reviewed by David Hyatt.
The CSS Fonts level 4 spec adds a new value to the "font-synthesis"
property which controls whether or not small-caps is allowed to be
synthesized. Luckily, we already have an implementation of this
straightforward, so the implementation is quite simple.
Tests: css3/font-synthesis-small-caps.html
fast/text/font-synthesis-parsing.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontSynthesisFromStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontSynthesis):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontCascadeDescription::initialFontSynthesis):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::shouldSynthesize):
(WebCore::ComplexTextController::collectComplexTextRuns):
2016-12-15 Brady Eidson <beidson@apple.com>
Add a new Logging Channel for IndexedDB Operation scheduling.
https://bugs.webkit.org/show_bug.cgi?id=165912
Reviewed by Alex Christensen.
No new tests (No behavior change).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString):
* Modules/indexeddb/shared/IDBCursorInfo.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString):
* Modules/indexeddb/shared/IDBGetRecordData.h:
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::condensedLoggingString):
* Modules/indexeddb/shared/IDBIndexInfo.h:
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString):
* Modules/indexeddb/shared/IDBIterateCursorData.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* platform/Logging.h:
2016-12-15 Konstantin Tokarev <annulen@yandex.ru>
Added missing override and final specifiers
https://bugs.webkit.org/show_bug.cgi?id=165903
Reviewed by Darin Adler.
No new tests needed.
* Modules/mediastream/OverconstrainedErrorEvent.h:
* bindings/js/JSCallbackData.h:
* bindings/js/JSCustomXPathNSResolver.h:
* bindings/js/JSErrorHandler.h:
* css/StyleRuleImport.h:
* dom/SecurityPolicyViolationEvent.h:
* editing/CreateLinkCommand.h:
* editing/DeleteSelectionCommand.h:
* editing/DictationCommand.h:
* editing/Editor.cpp:
* editing/FormatBlockCommand.h:
* editing/IndentOutdentCommand.h:
* editing/InsertLineBreakCommand.h:
* editing/InsertParagraphSeparatorCommand.h:
* editing/ModifySelectionListLevel.h:
* editing/MoveSelectionCommand.h:
* editing/RemoveFormatCommand.h:
* editing/RemoveNodePreservingChildrenCommand.h:
* editing/ReplaceSelectionCommand.h:
* editing/SimplifyMarkupCommand.h:
* editing/SplitTextNodeContainingElementCommand.h:
* editing/UnlinkCommand.h:
* fileapi/FileReaderLoader.h:
* html/canvas/ANGLEInstancedArrays.h:
* html/canvas/WebGLVertexArrayObjectBase.h:
* loader/SinkDocument.h:
* loader/archive/mhtml/MHTMLArchive.h:
* page/animation/CSSPropertyAnimation.cpp:
* platform/audio/MultiChannelResampler.cpp:
* platform/audio/SincResampler.cpp:
* platform/audio/gstreamer/AudioDestinationGStreamer.h:
* platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/displaylists/DisplayListItems.h:
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.h:
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDropShadow.h:
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMerge.h:
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/SourceAlpha.h:
* platform/graphics/filters/SourceGraphic.h:
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
* platform/mock/GeolocationClientMock.h:
* platform/text/TextCodecICU.h:
* platform/text/TextCodecLatin1.h:
* platform/text/TextCodecUTF16.h:
* platform/text/TextCodecUTF8.h:
* platform/text/TextCodecUserDefined.h:
* rendering/RenderFullScreen.cpp:
* storage/StorageEvent.h:
* svg/properties/SVGListProperty.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
* svg/properties/SVGStaticPropertyTearOff.h:
* xml/NativeXPathNSResolver.h:
* xml/XMLHttpRequestProgressEvent.h:
* xml/XMLHttpRequestProgressEventThrottle.h:
* xml/XPathVariableReference.h:
* xml/XSLImportRule.h:
2016-12-15 Chris Dumez <cdumez@apple.com>
Inline Document::existingAXObjectCache()
https://bugs.webkit.org/show_bug.cgi?id=165906
Reviewed by Darin Adler.
Inline Document::existingAXObjectCache() to avoid paying function call
cost in the common case where AX is disabled.
* dom/Document.cpp:
(WebCore::Document::existingAXObjectCacheSlow):
(WebCore::Document::existingAXObjectCache): Deleted.
* dom/Document.h:
(WebCore::Document::existingAXObjectCache):
2016-12-15 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r209864.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
2016-12-15 Andreas Kling <akling@apple.com>
Always clear RenderLayer backing stores when going into page cache.
<https://webkit.org/b/165901>
Reviewed by Simon Fraser.
We were already doing this for the iOS and GTK+ ports, let's do it everywhere
for consistency, and a bit of memory usage improvement.
This patch just removes the setting and always calls FrameView::clearBackingStores()
when there is composited content going into page cache.
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* history/PageCache.h:
(WebCore::PageCache::shouldClearBackingStores): Deleted.
(WebCore::PageCache::setShouldClearBackingStores): Deleted.
2016-12-15 Darin Adler <darin@apple.com>
Remove custom binding for MediaDevices
https://bugs.webkit.org/show_bug.cgi?id=165894
Reviewed by Eric Carlson.
Removes the explicit code to parse the MediaStreamConstraints and
MediaTrackConstraints. Next step could be to change the internal
code to use the structs from bindings directly so we don't need
code to convert to an internal format.
* CMakeLists.txt: Added MediaTrackConstraints.idl and MediaTrackConstraints.cpp,
removed JSMediaDevicesCustom.cpp.
* DerivedSources.make: Added MediaTrackConstraints.idl.
Also sorted list of IDL files and fixed use of tabs.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::createMediaConstraintsImpl): Added.
(WebCore::MediaDevices::getUserMedia): Changed this function to take arguments that
are generated by the bindings script, and call createMediaConstraintsImpl to convert
into the internal data structure.
* Modules/mediastream/MediaDevices.h: Added StreamConstraints struct and changed
getUserMedia to take that as specified in the IDL.
* Modules/mediastream/MediaDevices.idl: Added definition of the MediaStreamConstraints
dictionary. Removed [Custom] from getUserMedia.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Pass a reference to addObserver.
(WebCore::MediaStream::~MediaStream): Pass a rference to removeObserver.
(WebCore::MediaStream::internalAddTrack): Ditto.
(WebCore::MediaStream::internalRemoveTrack): Ditto.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::createMediaConstraintsImpl): Added.
(WebCore::MediaStreamTrack::applyConstraints): Changed to take an optional
MediaTrackConstraints argument and call createMediaConstraintsImpl to convert
into the internal data structure. Also merged the multiple overloads of this
all into a single function, used auto to make the code easier to read, and
moved the code that stores new constrains into the success handling, since the
specification says that's the only case where we should store it.
(WebCore::MediaStreamTrack::addObserver): Take a reference instead of a pointer.
(WebCore::MediaStreamTrack::removeObserver): Ditto.
* Modules/mediastream/MediaStreamTrack.h: Removed many unneeded includes.
Changed getConstraints to return const MediaTrackConstraints&, applyConstraints
to take an optional MediaTrackConstraints, add/removeObserver to take a reference
rather than a pointer, and changed m_constraints to be a MediaTrackConstraints
instead of a RefPtr<MediaConstraints>.
* Modules/mediastream/MediaStreamTrack.idl: Removed [Custom] from getConstraints
and applyConstraints.
* Modules/mediastream/MediaTrackConstraints.cpp: Added.
(WebCore::set): Overloaded function to set constriaints in a
MediaTrackConstraintSetMap.
(WebCore::convertToInternalForm): Helper function that takes a
MediaTrackConstraintSet and turns it into a MediaTrackConstraintSetMap.
(WebCore::convertAdvancedToInternalForm): More of the same, but for vectors.
(WebCore::createMediaConstraintsImpl): Top level function. Calls the other
functions and then MediaConstraintsImpl::create.
* Modules/mediastream/MediaTrackConstraints.h: Added. Contains all the structures
and type definitions for the dictionaries defined in the IDL file, and also the
createMediaConstraintsImpl function declaration.
* Modules/mediastream/MediaTrackConstraints.idl: Added. Contains the
MediaTrackConstraints and all the other dictionaries and typedefs that are needed
to define that dictionary.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start): Changed to not depend on MediaDevices::Promise.
(WebCore::UserMediaRequest::UserMediaRequest): Ditto.
(WebCore::isSecure): Rearranged to be easier to understand.
(WebCore::UserMediaRequest::start): Removed a local variable for simplicity.
(WebCore::UserMediaRequest::document): Removed a redundant null check.
* Modules/mediastream/UserMediaRequest.h: Reduced includes, changed to not depend
on MediaDevices::Promise, removing the reason to include MediaDevices.h.
* WebCore.xcodeproj/project.pbxproj: Updated to remove old files and add new ones.
* bindings/js/JSBindingsAllInOne.cpp: Removed JSMediaDevicesCustom.cpp.
* bindings/js/JSMediaDevicesCustom.cpp: Removed.
* bindings/js/JSMediaDevicesCustom.h: Removed.
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::applyConstraints): Deleted.
(WebCore::JSMediaStreamTrack::getConstraints): Deleted.
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument): Updated to allow multiple standalone dictionaries, as long as
the name of one of the dictionaries matches the name of the file.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionary): Added "other dictionaries" argument so we can support
files with multiple dictionaries in them.
(GenerateDictionariesHeaderContent): Completed support for dictionaries that
are not named after a top level interface by added one more check for a missing
$interface in a place that otherwise would not handle it correctly.
(GenerateImplementation): Removed code that set $currentCachedAttribute and
$cacheIndex, since no was reading the value of either any longer.
(GenerateDictionaryHeader): Added "other dictionaries".
(GenerateDictionaryImplementation): Ditto.
(WriteData): Removed unnnecessarily indirect code that was using FileNamePrefix
and a local variable named $prefix instead of just writing "JS".
* bindings/scripts/generate-bindings.pl: Corrected the use of the fileparse
function from the Path::Basename module; after reading the documentation for
this it is clear that there is no need to first call basename, and fileparse
should also be used instead of basename.
* platform/mediastream/MediaConstraints.h: Removed unneeded includes.
(WebCore::StringConstraint::appendExact): Removed an incorrect use of clear
here that would mess up cases where there is supposed to be more than one
exact value.
* platform/mediastream/MediaStreamTrackPrivate.cpp: Remvoed unneeded includes.
(WebCore::MediaStreamTrackPrivate::clone): Removed code to copy m_constraints.
(WebCore::MediaStreamTrackPrivate::constraints): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h: Removed the constraints
function member and the m_constraints data member.
2016-12-15 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enable CSS Deferred Parsing
https://bugs.webkit.org/show_bug.cgi?id=165869
Reviewed by Sam Weinig.
Enable CSS deferred parsing once again. It's now behind a pref,
so it's easy to flip off and on.
To address the memory regression that caused the previous rollout,
the tokenizer is no longer retained. Instead the sheet text and escaped
strings are retained by CSSDeferredParser, and then DeferredStyleProperties
and DeferredStyleGroupRuleList make copies of the tokens from the original
tokenization process. As the rules get parsed, these tokens get thrown
away.
This means that instead of the entire set of tokens staying in memory
as long as even one unparsed rule remained, now only the tokens that
still need parsing will remain alive.
Unparsed rules will consume slightly more memory than parsed rules, but
the more unparsed rules you have, the bigger the performance win as
well, so this is a tradeoff. Given that the parsing speed is going up
by anywhere from 25-40% on cold loads of pages (where all stylesheets
have to parse), this seems worth it to me.
* css/parser/CSSParserMode.h:
* page/Settings.in:
2016-12-15 Alejandro G. Castro <alex@igalia.com>
[OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
https://bugs.webkit.org/show_bug.cgi?id=165316
Reviewed by Philippe Normand.
Fixed the ended support of the video element in the OWR player and
fixed the videoTracks support. Now the OW player properly adds and
removes the audio and video tracks. Added the getSettings support
to the mediastream interface. Solved also the size handling in
some of the enable/muted situations.
Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.
* platform/GStreamer.cmake: Added the new
RealtimeMediaSourceOwr.cpp with the new code handling the
settings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
Release the new video and audio maps that creates a relationship
of the mediastream tracks with the mediatracks of the video element.
(WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
false when we start playing.
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
tracks to the player so that the videoTracks API returns it, and
add an entry in the map to be able to restore it using the
mediastream track.
(WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
Move some part of the stop function to this one in order to use it
in pause method and avoid changing the video selection in that
case.
(WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
function disableMediaTracks and we also change teh selected
videoTrack.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
videoTrack reset the size and the selected element. In case there
is no media playing we Make sure we set the ended variable to true
and call the timeChange to modify the state of the player.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
Handle properly the situation when the user changed the enabled
value, we disable the media.
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
size of the source.
(WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
to make sure we return a size even when the sample is not ready
for gst.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
Added the ended attribute and the maps.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
realtime video and audio sources classes, this new classes
implement the settings of each type of media element.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
Use the new audio and video source classes instead of the general
one in order to handle the settings properly.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
(WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
subclass and return the new currentSettings attribute.
(WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
subclass initialization of the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
initialize the settings before returning the value. Implemented in
the subclass.
(WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
Added to initialize the supported settings of the
media. Implemented in the subclass.
(WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
file, implemented using the initialize functions of the subclass
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
this new class to handle the settings of the video elements. The
class initializes the settings and the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
this new class to handle the settings of the audio elements. The
class initializes the settings and the supportedSettings.
2016-12-15 Alex Christensen <achristensen@webkit.org>
REGRESSION (r208902) Null pointer dereference in wkIsPublicSuffix
https://bugs.webkit.org/show_bug.cgi?id=165885
<rdar://problem/29476917>
Reviewed by Darin Adler.
wkIsPublicSuffix crashes if you give it a nil NSString*.
This was possible before IDN2008 adoption, but it's more common now
because domains like "r4---asdf.example.com" fail in uidna_nameToASCII but not in uidna_IDNToASCII.
decodeHostName can return a nil NSString. We can't use it unchecked, so instead we use an algorithm that allows
for decoding failures while still finding top privately controlled domains correctly.
Tested by new API tests which crash before this change and verify the behavior matches behavior before r208902.
* platform/mac/PublicSuffixMac.mm:
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomain):
2016-12-15 Alex Christensen <achristensen@webkit.org>
Fix Windows WebGL build after r209832
* CMakeLists.txt:
2016-12-14 Hunseop Jeong <hs85.jeong@samsung.com>
Unreviewed build fix after r209832
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharedDisplay): Added the guard for the clang
2016-12-14 Yusuke Suzuki <utatane.tea@gmail.com>
[GTK] Support latest SubtleCrypto HMAC APIs
https://bugs.webkit.org/show_bug.cgi?id=165863
Reviewed by Sam Weinig.
SubtleCrypto spec is updated, and new delegate implementations are required to support these interfaces.
This patch implements platformSign and platformVerify with WorkQueues for gcrypt backend.
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature):
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
2016-12-14 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r209415.
This workaround is no longer needed now that
<rdar://problem/29518605> has been fixed
Reverted changeset:
"Add HTML interactive form validation blacklist for some
WebKit-specific sites"
https://bugs.webkit.org/show_bug.cgi?id=165470
http://trac.webkit.org/changeset/209415
2016-12-14 Dean Jackson <dino@apple.com>
Update prefers-reduced-motion syntax
https://bugs.webkit.org/show_bug.cgi?id=165880
<rdar://problems/29671807>
Reviewed by Sam Weinig.
After discussion in:
https://github.com/w3c/csswg-drafts/issues/442
... the syntax of prefers-reduced-motion was changed
to accept "reduce" or "no-preference".
Updated the tests in fast/media.
* css/CSSValueKeywords.in: Add no-preference keyword.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
2016-12-14 Sam Weinig <sam@webkit.org>
REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
<rdar://problem/29573563>
https://bugs.webkit.org/show_bug.cgi?id=165872
Reviewed by Chris Dumez.
Revert the Location.ancestorOrigins part of r204679 because google.com is relying on
it returning a DOMStringList (or at least something with a .item() function), rather
than a frozen javascript array.
Spec changes are tracked with https://github.com/whatwg/html/issues/2179.
* page/Location.cpp:
(WebCore::Location::ancestorOrigins):
* page/Location.h:
* page/Location.idl:
Change Location.ancestorOrigins back to returning a DOMStringList.
2016-12-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
https://bugs.webkit.org/show_bug.cgi?id=165876
Reviewed by Simon Fraser.
* css/CSSKeyframeRule.cpp:
(WebCore::StyleRuleKeyframe::StyleRuleKeyframe):
(WebCore::StyleRuleKeyframe::~StyleRuleKeyframe):
(WebCore::StyleRuleKeyframe::mutableProperties):
(WebCore::StyleRuleKeyframe::keyText):
(WebCore::StyleRuleKeyframe::setKeyText):
(WebCore::StyleRuleKeyframe::cssText):
(WebCore::CSSKeyframeRule::CSSKeyframeRule):
(WebCore::StyleKeyframe::StyleKeyframe): Deleted.
(WebCore::StyleKeyframe::~StyleKeyframe): Deleted.
(WebCore::StyleKeyframe::mutableProperties): Deleted.
(WebCore::StyleKeyframe::keyText): Deleted.
(WebCore::StyleKeyframe::setKeyText): Deleted.
(WebCore::StyleKeyframe::cssText): Deleted.
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::keyframes):
(WebCore::StyleRuleKeyframes::parserAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::CSSKeyframesRule::appendRule):
(WebCore::CSSKeyframesRule::item):
* css/CSSKeyframesRule.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::keyframeStylesForAnimation):
* css/StyleResolver.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
* css/StyleRule.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseKeyframeRule):
* css/parser/CSSParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseDeferredKeyframeList):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeKeyframeStyleRule):
* css/parser/CSSParserImpl.h:
2016-12-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make deferred parsing retain the sheet text. Fix invalidation to avoid deferred parsing.
https://bugs.webkit.org/show_bug.cgi?id=165868
Reviewed by Simon Fraser.
With this new model of token copying, the sheet text needs to be retained. The tokenizer did this,
but we're no longer keeping it around.
StyleInvalidation is also aggressively crawling media rules, even unsupported ones, so fix it
to avoid deferred parsing.
* css/StyleInvalidationAnalysis.cpp:
(WebCore::shouldDirtyAllStyle):
* css/parser/CSSDeferredParser.cpp:
(WebCore::CSSDeferredParser::CSSDeferredParser):
* css/parser/CSSDeferredParser.h:
(WebCore::CSSDeferredParser::create):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):
2016-12-14 Ryosuke Niwa <rniwa@webkit.org>
iOS: An element with tabindex is not focusable unless there is no mouse event handler
https://bugs.webkit.org/show_bug.cgi?id=165843
Reviewed by Antti Koivisto.
The bug was caused by ancestorRespondingToClickEvents not checking the precense of tabindex attribute.
Check that condition along with event listeners.
Test: fast/events/focusing-element-with-tabindex-by-tap-or-click.html
* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):
2016-12-14 Alex Christensen <achristensen@webkit.org>
Progress towards using ANGLE to do WebGL rendering
https://bugs.webkit.org/show_bug.cgi?id=165864
Reviewed by Dean Jackson.
No new tests, no change in behavior.
Just compile fixes for a configuration that will soon be standard
that can be landed now without breaking anything.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharedDisplay):
Ignore some clang warnings that will cause problems when this is compiled on Mac.
2016-12-14 Dean Jackson <dino@apple.com>
[iOS] MediaDocuments have controls on the bottom of the page
https://bugs.webkit.org/show_bug.cgi?id=165865
<rdar://problem/28757268>
Reviewed by Jon Lee.
MediaDocuments on iOS are incorrectly placing the controls at
the bottom of the page. This is due to the <video> element
getting a height of 100%. It should be "auto" instead.
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
2016-12-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
https://bugs.webkit.org/show_bug.cgi?id=165743
Reviewed by Dean Jackson.
Added new tests in fast/css/deferred-parsing.
This patch implements deferred parsing in CSS. By default, when parsing
author stylesheets, the parser goes into a deferred mode where it leaves
the declaration block of all style rules unparsed initially. Instead of
creating and setting an ImmutableStyleProperties object on the StyleRule,
the parser creates a DeferredStyleProperties object instead that is
capable of calling into CSSDeferredParser to parse the properties and values
only when the properties are finally asked for.
In addition, this patch defers the parsing of the interior of @media,
@supports, and @keyframes rules. @media blocks that are never matched will
never parse any of the rules inside. @supports conditions for unsupported
features will also not be parsed. For @keyframes, if the animation is never
referenced/used, then the @keyframes child rules will never be parsed.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add CSSDeferredParser to the build.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFaces):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
(WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
(WebCore::StyleRuleKeyframes::keyframes):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
(WebCore::StyleRuleKeyframes::findKeyframeIndex):
* css/CSSKeyframesRule.h:
Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
object. The keyframes vector won't be populated until it is needed, and the
population is done by DeferredStyleGroupRuleList, which holds both the original
tokens of the keyframes rule interior, and a references to the
CSSDeferredParser that will do the parsing.
* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::supports):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
ElementRuleCollector tests to see if a rule is empty by counting properties(),
but we don't want to initiate deferred parsing just to check this. Instead we
invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
the properties haven't been parsed yet. In order to ensure this optimization
continues to work, any rules whose interiors consist of only whitespace do
not get deferred.
* css/FontFace.cpp:
(WebCore::FontFace::setVariant):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::MutableStyleProperties):
(WebCore::MutableStyleProperties::setProperty):
(WebCore::DeferredStyleProperties::create):
(WebCore::DeferredStyleProperties::DeferredStyleProperties):
(WebCore::DeferredStyleProperties::~DeferredStyleProperties):
(WebCore::DeferredStyleProperties::parseDeferredProperties):
* css/StyleProperties.h:
(WebCore::StylePropertiesBase::type):
(WebCore::StylePropertiesBase::cssParserMode):
(WebCore::StylePropertiesBase::StylePropertiesBase):
(WebCore::StyleProperties::isMutable):
(WebCore::StyleProperties::StyleProperties):
(WebCore::StylePropertiesBase::deref):
(isType):
(WebCore::StyleProperties::cssParserMode): Deleted.
(WebCore::StyleProperties::deref): Deleted.
Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
is created by the parser when not deferring), and MutableStyleProperties (used
when making changes and doing DOM Manipulations).
This patch adds a new base class called StylePropertiesBase, and StyleProperties
now derives from it. DeferredStyleProperties derives from this base. The members
of StyleProperties have been moved up into StylePropertiesBase.
The m_isMutable bit, used to determine the type for downcasting has been enhanced
to m_type (2 bits), since there are now three possible subclasses.
* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
(WebCore::StyleRule::properties):
(WebCore::StyleRule::mutableProperties):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
Patched to ensure that when properties() are accessed, that if the current
stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
rule. By using a common base class, we avoid increasing memory usage in
StyleRule.
(WebCore::DeferredStyleGroupRuleList::create):
(WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
(WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
(WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
DeferredStyleGroupList is used to handle deferred parsing of objects with
child rules. These include @media, @supports and @keyframes.
(WebCore::StyleRuleGroup::StyleRuleGroup):
(WebCore::StyleRuleGroup::childRules):
(WebCore::StyleRuleGroup::wrapperInsertRule):
(WebCore::StyleRuleGroup::wrapperRemoveRule):
(WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
(WebCore::StyleRuleMedia::StyleRuleMedia):
(WebCore::StyleRuleSupports::StyleRuleSupports):
StyleRuleGroup now holds both a child rules Vector and a
DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
when the childRules are finally accessed, we will populate the childRules
Vector and then null out the DeferredStyleGroupRuleList.
* css/StyleRule.h:
(WebCore::StyleRule::propertiesWithoutDeferredParsing):
(WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
(WebCore::StyleRuleGroup::childRules): Deleted.
Add new accesors for fetching properties and child rules without causing
deferred parsing to happen.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
Patched to turn on deferred parsing for author sheets and for all
non-UA stylesheets parsed from a string (e.g., <style>).
(WebCore::traverseSubresourcesInRules):
The broken resource check was aggressively accessing properties(). Patch
it to call propertiesWithoutDeferredParsing() instead so that it doesn't
defeat the new optimization.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/parser/CSSDeferredParser.cpp: Added.
(WebCore::CSSDeferredParser::CSSDeferredParser):
(WebCore::CSSDeferredParser::parseDeclaration):
(WebCore::CSSDeferredParser::parseRuleList):
(WebCore::CSSDeferredParser::parseKeyframeList):
* css/parser/CSSDeferredParser.h: Added.
(WebCore::CSSDeferredParser::create):
(WebCore::CSSDeferredParser::tokenizer):
(WebCore::CSSDeferredParser::mode):
(WebCore::CSSDeferredParser::context):
(WebCore::CSSDeferredParser::styleSheet):
The CSSDeferredParser. It caches the original tokenizer's' escaped strings. Because
the CSSDeferredParser is referenced by all the rules that have yet to parse,
it will stay alive until all rules in the stylesheet has been fully parsed.
The parser receives CSSParserTokenRanges from DeferredStyleProperties or
DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
is able to do the parsing as it would have occurred originally had the
range not been deferred.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParserFastPaths::maybeParseValue):
* css/parser/CSSParserFastPaths.h:
Drop the StyleSheetContents* argument from the methods that no longer need
them.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):
(WebCore::CSSParserImpl::tokenizer):
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::parseCustomPropertyValue):
(WebCore::CSSParserImpl::parseDeclarationList):
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
(WebCore::CSSParserImpl::parseRule):
(WebCore::CSSParserImpl::parseStyleSheet):
(WebCore::CSSParserImpl::parseDeclarationListForInspector):
(WebCore::CSSParserImpl::parseStyleSheetForInspector):
(WebCore::CSSParserImpl::consumeQualifiedRule):
(WebCore::CSSParserImpl::consumeMediaRule):
(WebCore::CSSParserImpl::consumeSupportsRule):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeStyleRule):
Drop the StyleSheetContents* argument from the methods that no longer need
them.
(WebCore::CSSParserImpl::createDeferredStyleProperties):
(WebCore::CSSParserImpl::parseDeferredDeclaration):
(WebCore::CSSParserImpl::parseDeferredRuleList):
(WebCore::CSSParserImpl::parseDeferredKeyframeList):
The methods that handle deferred parsing. They make sure to initialize
new CSSParserImpls with the original deferred parser, and then call existing
methods to do the parsing.
* css/parser/CSSParserImpl.h:
Patched to remove StyleSheetContents* arguments from some methods and
to add the new deferred parsing methods.
* css/parser/CSSParserTokenRange.cpp:
(WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
* css/parser/CSSParserTokenRange.h:
In order to preserve the editability optimization from r180867, when
a style rule's block is consumed, we use a special method that looks
for -webkit-user-modify tokens. If one is seen, then the editability
optimization is turned off. Because we do this at the token level,
the optimization keeps working even if properties don't get parsed.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::parseShorthand):
Patched to remove StyleSheetContents* arguments now that the editability
check is in CSSTokenizer instead.
* css/parser/CSSTokenizer.cpp:
(WebCore::CSSTokenizer::tokenRange):
* css/parser/CSSTokenizer.h:
Make tokenRange() const.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
Patched to drop the StyleSheetContents* argument.
* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList):
(WebCore::Internals::deferredStyleRulesCount):
(WebCore::deferredGroupRulesCountForList):
(WebCore::Internals::deferredGroupRulesCount):
(WebCore::deferredKeyframesRulesCountForList):
(WebCore::Internals::deferredKeyframesRulesCount):
* testing/Internals.h:
* testing/Internals.idl:
Add new testing methods that can count the deferred style rules and
group child rule lists. These methods are used by the new layout tests.
2016-12-14 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Massively speedup IDBIndex.get().
https://bugs.webkit.org/show_bug.cgi?id=165802
Reviewed by Alex Christensen.
No new tests (No behavior change to Javascript, table upgrade change covered by API test).
This change upgrades the IndexRecords schema to include the ObjectStore record ID for the referenced record.
It also adds a SQLite Index-by-key on IndexRecords.
This speeds up PerformanceTests/IndexedDB/index-get.html by 15-20x.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::v3IndexRecordsTableSchema):
(WebCore::IDBServer::v3IndexRecordsTableSchemaAlternate):
(WebCore::IDBServer::v1IndexRecordsIndexSchema):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
2016-12-14 Sam Weinig <sam@webkit.org>
Actually set the shipping contact when validating the payment request
Reviewed by Anders Carlsson.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
Fix typo.
2016-12-14 John Wilander <wilander@apple.com>
Handle key generation with empty challenge string
https://bugs.webkit.org/show_bug.cgi?id=165835
<rdar://problem/29128710>
Reviewed by Anders Carlsson.
https://bugs.webkit.org/show_bug.cgi?id=160945 didn't set the challenge length to
1 for empty challenge strings. Thus the null terminator was not included. Empty
challenge strings are allowed:
"If the element has a challenge attribute, then let challenge be that attribute's
value. Otherwise, let challenge be the empty string."
https://www.w3.org/TR/html5/forms.html#the-keygen-element (fetched 2016-12-13)
Email certificate generation at
https://www.comodo.com/home/email-security/free-email-certificate.php broke
because of https://bugs.webkit.org/show_bug.cgi?id=160945.
No new tests. The original patch did not have tests and the breakage was in the
produced key material so a test would have to validate the crypto output.
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString):
Now adds 1 to the length of the challenge to account for its null terminator.
This matches the old behavior.
2016-12-14 Daniel Bates <dabates@apple.com>
CSP: Allow HTTPS URL to match HTTP source expression
https://bugs.webkit.org/show_bug.cgi?id=159520
<rdar://problem/27287177>
Reviewed by Brent Fulgham.
Test: http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number.html
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::schemeMatches):
(WebCore::ContentSecurityPolicySource::portMatches):
2016-12-14 Alex Christensen <achristensen@webkit.org>
REGRESSION (r209776): [ios-simulator] LayoutTest http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=165836
Reviewed by Brady Eidson.
* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
Use the platform default timeout for CORS preflight requests.
2016-12-14 Antti Koivisto <antti@apple.com>
WebContent crash under WebCore::CachedResource::load in WebCore::FrameLoader::outgoingReferrer const
https://bugs.webkit.org/show_bug.cgi?id=165852
<rdar://problem/27297153>
Reviewed by Chris Dumez.
There appears to be some path where we get here with a null frame.
No test, don't know how exactly this happens.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::outgoingReferrer):
Null check the frame.
2016-12-14 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r209766.
Regressed Dromaeo JSLib by ~50%
Reverted changeset:
"Make opaque root scanning truly constraint-based"
https://bugs.webkit.org/show_bug.cgi?id=165760
http://trac.webkit.org/changeset/209766
2016-12-14 Andy Estes <aestes@apple.com>
EventDispatcher::dispatchEvent() should take its Node by reference
https://bugs.webkit.org/show_bug.cgi?id=165840
Reviewed by Andreas Kling.
No new tests. No change in behavior.
* dom/Element.cpp:
(WebCore::Element::dispatchWheelEvent): Dereferenced |this| when calling
EventDispatcher::dispatchEvent().
(WebCore::Element::dispatchKeyEvent): Ditto.
(WebCore::Element::dispatchFocusEvent): Ditto.
(WebCore::Element::dispatchBlurEvent): Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Changed |origin| from a Node* to a Node&, renamed
it to |node|, and protected it with a Ref called |protectedNode| to match our preferred
style.
* dom/EventDispatcher.h: Changed dispatchEvent's first parameter type from Node* to Node&.
* dom/Node.cpp:
(WebCore::Node::dispatchEvent): Dereferenced |this| when calling
EventDispatcher::dispatchEvent().
(WebCore::Node::dispatchTouchEvent): Ditto.
(WebCore::Node::dispatchUIRequestEvent): Ditto.
* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::dispatchEvent): Dereferenced |node| when calling
EventDispatcher::dispatchEvent().
* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent): Passed |element| as a reference to
EventDispatcher::dispatchEvent().
2016-12-14 Chris Dumez <cdumez@apple.com>
Remove Unicode case-insensitive matching for usemap=""
https://bugs.webkit.org/show_bug.cgi?id=163894
Reviewed by Antti Koivisto.
Remove Unicode case-insensitive matching for usemap="" as this no longer
matches the specification [1] or Firefox. Also align our parsing logic for
the usemap attribute to match the specification [2].
This simplifies the code a bit, is more efficient and the compatibility
risk should be low based on Firefox's behavior and Chome's usage data.
[1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
[2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference
Test: fast/images/image-usemap-parsing.html
* dom/Document.cpp:
(WebCore::Document::addImageElementByUsemap):
(WebCore::Document::removeImageElementByUsemap):
(WebCore::Document::imageElementByUsemap):
* dom/Document.h:
* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::getElementByUsemap):
* dom/DocumentOrderedMap.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::getImageMap):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedInto):
(WebCore::HTMLImageElement::removedFrom):
(WebCore::HTMLImageElement::matchesUsemap):
* html/HTMLImageElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
(WebCore::HTMLMapElement::parseAttribute):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLHashNameReference):
* html/parser/HTMLParserIdioms.h:
2016-12-14 Ryan Haddad <ryanhaddad@apple.com>
Attempt to fix the Windows build after r209805.
Unreviewed build fix.
* css/CSSAllInOne.cpp:
2016-12-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Remove WebkitCSSTransformValue
https://bugs.webkit.org/show_bug.cgi?id=165844
Reviewed by Zalan Bujtas.
Remove WebkitCSSTransformValue and just use a CSSFunctionValue instead. No other
browsers support it, and the information it provides is easily obtainable from cssText.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::matrixTransformValue):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isSpringTimingFunctionValue):
(WebCore::CSSValue::isWebKitCSSTransformValue): Deleted.
* css/StyleResolver.cpp:
* css/TransformFunctions.cpp:
(WebCore::transformOperationType):
(WebCore::transformsForValue):
* css/TransformFunctions.h:
* css/WebKitCSSTransformValue.cpp: Removed.
* css/WebKitCSSTransformValue.h: Removed.
* css/WebKitCSSTransformValue.idl: Removed.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
(WebCore::parseSimpleTransformValue):
(WebCore::parseSimpleTransformList):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::consumeTransformValue):
(WebCore::transformOperationForCSSValueID): Deleted.
2016-12-14 Antti Koivisto <antti@apple.com>
Make Style::Update const in RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=165845
Reviewed by Andreas Kling.
Moving style away from unique_ptrs leaves them in weird state.
* style/RenderTreeUpdater.cpp:
(WebCore::findRenderingRoots):
(WebCore::RenderTreeUpdater::commit):
(WebCore::RenderTreeUpdater::updateElementRenderer):
Clone the style instead of moving it. This is not meaningfully more expensive.
Remove null checks, style is never null.
* style/RenderTreeUpdater.h:
2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
https://bugs.webkit.org/show_bug.cgi?id=165795
Reviewed by Saam Barati.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDeviceOrientationEventCustom.cpp:
(WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::namedItem):
* bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
(WebCore::JSHTMLFormControlsCollection::namedItem):
* bindings/js/JSHTMLInputElementCustom.cpp:
(WebCore::JSHTMLInputElement::setSelectionDirection):
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
* bindings/js/JSXSLTProcessorCustom.cpp:
(WebCore::JSXSLTProcessor::setParameter):
(WebCore::JSXSLTProcessor::getParameter):
(WebCore::JSXSLTProcessor::removeParameter):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/testbindings.cpp:
(main):
2016-12-14 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix debug build break since r207192. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=165847
No new tests, no new behaviours.
In JSDOMBinding.h, JSClass::info() returns each js class's
"static const JSC::ClassInfo s_info"'s address.
It's static variable's address, so always non-null.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::callPromiseOperation):
(WebCore::BindingCaller::callOperation):
(WebCore::BindingCaller::setAttribute):
(WebCore::BindingCaller::attribute):
2016-12-14 Enrique Ocaña González <eocanha@igalia.com>
REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
https://bugs.webkit.org/show_bug.cgi?id=164022
Reviewed by Xabier Rodriguez-Calvar.
Covered by existing tests.
* page/Settings.cpp:
Added new setting to disable GStreamer players, so the selection of
MockMediaPlayerMediaSource can be forced for some tests, just like
it's already being done for the AVFoundation player in Mac.
(WebCore::Settings::setGStreamerEnabled):
* page/Settings.h:
(WebCore::Settings::isGStreamerEnabled):
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
Don't register GStreamer players when they're disabled.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
Use doubles instead of floats.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Use doubles instead of floats for m_durationAtEOS.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Don't reset m_sample on videoSink drain, it causes too many problems.
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Removed unused methods.
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
Keep releasing m_sample on drain, but don't report the event
externally via signal anymore. The base player private isn't
listening to it anymore.
(webkitVideoSinkEvent):
(webkit_video_sink_class_init):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
Check if the demuxer caps correspond to a supported codec.
(WebCore::AppendPipeline::didReceiveInitializationSegment):
Empty m_track is now legal and means unsupported codec.
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
Warn about more than one stream, but "support" it by ignoring it using
a black hole probe.
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
Also report the duration when it's detected for the first time. Invalid
stream types now mean that unsupported codecs have been detected.
Complete init segment processing in that case.
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
Disconnect black hole probe.
(WebCore::appendPipelineDemuxerBlackHolePadProbe): Ignore buffers.
(WebCore::appendPipelineDemuxerPadRemoved): New parameter used.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
Check supported codecs by matching against wildcard expressions.
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
Check for supported codecs.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
New supportsCodecs() method.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::resetParserState):
Implemented parser resetting by aborting the AppendPipeline.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
Added resetParserState().
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
Implemented it.
* testing/Internals.cpp:
(WebCore::Internals::initializeMockMediaSource):
Disable the GStreamer players when initializing the mock media source,
like it's already done for the AVFoundation player to force the
selection of MockMediaPlayerMediaSource.
2016-12-14 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Fix player private selection when MSE is enabled
https://bugs.webkit.org/show_bug.cgi?id=164116
Reviewed by Philippe Normand.
Covered by existing tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
2016-12-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r209792.
https://bugs.webkit.org/show_bug.cgi?id=165841
Cause build failures (Requested by yusukesuzuki on #webkit).
Reverted changeset:
"Use JSValue::toWTFString instead of calling toString(exec)
and value(exec)"
https://bugs.webkit.org/show_bug.cgi?id=165795
http://trac.webkit.org/changeset/209792
2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
https://bugs.webkit.org/show_bug.cgi?id=165795
Reviewed by Saam Barati.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
(WebCore::getNthValueOnKeyPath): Deleted.
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
(WebCore::ensureNthValueOnKeyPath): Deleted.
(WebCore::canInjectNthValueOnKeyPath): Deleted.
(WebCore::injectIDBKeyIntoScriptValue): Deleted.
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
(WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
(WebCore::deserializeIDBValueToJSValue): Deleted.
(WebCore::scriptValueToIDBKey): Deleted.
(WebCore::idbKeyDataToScriptValue): Deleted.
(WebCore::createKeyPathArray): Deleted.
(WebCore::generateIndexKeyForValue): Deleted.
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDeviceOrientationEventCustom.cpp:
(WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
(WebCore::JSEventListener::virtualisAttribute): Deleted.
(WebCore::JSEventListener::operator==): Deleted.
(WebCore::eventHandlerAttribute): Deleted.
(WebCore::createEventListenerForEventHandlerAttribute): Deleted.
(WebCore::setEventHandlerAttribute): Deleted.
(WebCore::windowEventHandlerAttribute): Deleted.
(WebCore::setWindowEventHandlerAttribute): Deleted.
(WebCore::documentEventHandlerAttribute): Deleted.
(WebCore::setDocumentEventHandlerAttribute): Deleted.
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::namedItem):
* bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
(WebCore::JSHTMLFormControlsCollection::namedItem):
* bindings/js/JSHTMLInputElementCustom.cpp:
(WebCore::JSHTMLInputElement::setSelectionDirection):
(WebCore::JSHTMLInputElement::setSelectionRange): Deleted.
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems):
(WebCore::JSInspectorFrontendHost::showContextMenu): Deleted.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
(WebCore::JSXMLHttpRequest::responseText): Deleted.
(WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
* bindings/js/JSXSLTProcessorCustom.cpp:
(WebCore::JSXSLTProcessor::setParameter):
(WebCore::JSXSLTProcessor::getParameter):
(WebCore::JSXSLTProcessor::removeParameter):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertValueToNPVariant):
* bridge/testbindings.cpp:
(main):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
https://bugs.webkit.org/show_bug.cgi?id=164883
Reviewed by Ryosuke Niwa.
This is *attempt to fix* patch since I cannot reproduce the crash reported in this issue.
One possible scenario of this crash is the following.
1. There is pending deferred scripts, that is not fetched yet.
2. Then, we start watching on the script. And stop document parser.
3. The document parser is stopped/detached by calling finishJSTest in beforeload.
4. At this critical timing, (2)'s script is fetched, and notifyFinished is called since it is watched.
In this patch, we ignore the script execution if the document parser is stopped / detached.
Previously, it goes into the wrong path. And it causes assertion failure.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::notifyFinished):
2016-12-13 Keith Rollin <krollin@apple.com>
Memory warning logging appears to capture resident footprint, missing compress/swap.
https://bugs.webkit.org/show_bug.cgi?id=165533
<rdar://problem/29318410>
Reviewed by Daniel Bates.
Fix GTK build by adding an explicit constructor.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::MemoryUsage::MemoryUsage):
2016-12-13 Daniel Bates <dabates@apple.com>
CSP: ws: and wss: blocked with connect-src *
https://bugs.webkit.org/show_bug.cgi?id=165804
<rdar://problem/28563643>
Reviewed by David Kilzer.
Allow * to match ws: and wss:. This will make our behavior of * more closely conform
the behavior of * in the Content Security Policy Level 3 spec.,
<https://w3c.github.io/webappsec-csp/#match-url-to-source-expression> (Editor's Draft, 2 December 2016).
Tests: http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed.html
http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed.html
http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed.html
http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed.html
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
2016-12-13 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make CSSFunctionValue derive from CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=165832
Reviewed by Dean Jackson.
With the old parser gone, we can now shrink CSSFunctionValue a bit by
having it derive from CSSValueList instead of having an extra member
that holds a value list of arguments. This is similar to the trick
already employed by WebkitCSSTransformValue.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize):
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::customCSSText):
(WebCore::CSSFunctionValue::CSSFunctionValue): Deleted.
(WebCore::CSSFunctionValue::equals): Deleted.
(WebCore::CSSFunctionValue::append): Deleted.
* css/CSSFunctionValue.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertScrollSnapPoints):
(WebCore::StyleBuilderConverter::createGridTrackSize):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParser.cpp:
(WebCore::isGridTrackFixedSized):
2016-12-13 Chris Dumez <cdumez@apple.com>
Make Document a FrameDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=165810
<rdar://problem/29157645>
Reviewed by Ryosuke Niwa.
Make Document a FrameDestructionObserver to make sure Document::m_frame
is properly nulled out when a Frame gets destroyed.
Document::disconnectFromFrame() is supposed to be called before the Frame
gets destroyed so this also adds an assertion to try and identify places
where we fail to call it.
No new tests, no known reproduction case.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::disconnectFromFrame):
(WebCore::Document::frameDestroyed):
* dom/Document.h:
(WebCore::Document::frame): Deleted.
2016-12-13 Joseph Pecoraro <pecoraro@apple.com>
REGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecure SourceMap
https://bugs.webkit.org/show_bug.cgi?id=165806
<rdar://problem/28169025>
Reviewed by Alex Christensen.
Test: http/tests/inspector/network/loadResource-insecure-resource.html
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource):
DocumentThreadableLoader now triggers the ThreadableLoaderClient's didFail
callback, so this didFailLoaderCreation is now redundent and incorrect.
2016-12-13 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enhance fast path translate transforms to allow percentages
https://bugs.webkit.org/show_bug.cgi?id=165822
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseTransformTranslateArguments):
2016-12-13 Ryosuke Niwa <rniwa@webkit.org>
:hover rule causes a single tap to not activate a slotted anchor element
https://bugs.webkit.org/show_bug.cgi?id=165551
Reviewed by Antti Koivisto.
Fixed a bug in ancestorRespondingToClickEvents that we were traversing the ancestor nodes without taking
shadow roots and slots into account. This prevented tapping on a text node assigned to a slot inside
an anchor element to activate the hyperlink on iOS.
This bug was supposed to be fixed in r206605, and it was still broken on iOS due to the bug in
ancestorRespondingToClickEvents. It is now tested by click-text-inside-linked-slot.html.
Tests: fast/shadow-dom/click-on-slotted-anchor-with-hover.html
fast/shadow-dom/click-text-inside-linked-slot.html
* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):
(WebCore::Frame::qualifyingNodeAtViewportLocation):
2016-12-13 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Eliminate SVGPaint and SVGColor
https://bugs.webkit.org/show_bug.cgi?id=165819
Reviewed by Dean Jackson.
Remove SVGColor and SVGPaint CSS values from the tree. The new parser
already stopped making these values when parsing, so all that's left
is to make sure computed style doesn't use these values either.
We are the only browser engine to support these CSS values, they see no use
on the Web, and they're already gone at the parsing level, so it's time
to remove these interfaces from our tree.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSComputedStyleDeclaration.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isSubtypeExposedToCSSOM):
(WebCore::CSSValue::isSVGColor): Deleted.
(WebCore::CSSValue::isSVGPaint): Deleted.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSVGColor):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillPaintType):
(WebCore::RenderStyle::setFillPaintColor):
(WebCore::RenderStyle::strokePaintType):
(WebCore::RenderStyle::setStrokePaintColor):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialFillPaintType):
(WebCore::SVGRenderStyle::initialStrokePaintType):
(WebCore::SVGRenderStyle::setFillPaint):
(WebCore::SVGRenderStyle::setStrokePaint):
(WebCore::SVGRenderStyle::fillPaintType):
(WebCore::SVGRenderStyle::strokePaintType):
(WebCore::SVGRenderStyle::visitedLinkFillPaintType):
(WebCore::SVGRenderStyle::visitedLinkStrokePaintType):
(WebCore::SVGRenderStyle::hasStroke):
(WebCore::SVGRenderStyle::hasFill):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
* svg/SVGAllInOne.cpp:
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::constructFromString):
(WebCore::parseColorFromString):
(WebCore::SVGAnimatedColorAnimator::calculateDistance):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString):
* svg/SVGAnimatedType.h:
* svg/SVGColor.cpp: Removed.
* svg/SVGColor.h: Removed.
* svg/SVGColor.idl: Removed.
* svg/SVGFEDiffuseLightingElement.cpp:
* svg/SVGFESpecularLightingElement.cpp:
* svg/SVGPaint.cpp: Removed.
* svg/SVGPaint.h: Removed.
* svg/SVGPaint.idl: Removed.
2016-12-13 Alex Christensen <achristensen@webkit.org>
Restore NSURLRequest's default time interval to match behavior before NSURLSession adoption
https://bugs.webkit.org/show_bug.cgi?id=165821
<rdar://problem/28492939>
Reviewed by Brady Eidson.
Before adopting NSURLSession, iOS used CFURLConnection, not NSURLConnection.
iOS used to have a default timeout of INT_MAX and it now has a default timeout of 0, which means use the
default NSURLRequest timeout, which is 60 seconds. This is not enough for some slow mobile networks,
so we want to match behavior of our CFURLConnection code here.
* platform/network/ResourceRequestBase.cpp:
Use INT_MAX as the default timeout of requests on iOS.
2016-12-13 Filip Pizlo <fpizlo@apple.com>
Make opaque root scanning truly constraint-based
https://bugs.webkit.org/show_bug.cgi?id=165760
Reviewed by Saam Barati.
No new tests yet. I think that writing tests for this is a big investigation:
https://bugs.webkit.org/show_bug.cgi?id=165808
Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
very well. It's super confusing.
This change makes it so that visitChildren can become a GC constraint that executes as
part of the fixpoint. This changes all WebCore visitChildren methods that do opaque
roots into constraints.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
(WebCore::writeBarrierOpaqueRootSlow): Deleted.
* bindings/js/CommonVM.h:
(WebCore::writeBarrierOpaqueRoot): Deleted.
* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitAdditionalChildren):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitAdditionalChildren):
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::visitAdditionalChildren):
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitAdditionalChildren):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitAdditionalChildren):
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitAdditionalChildren):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCue::visitAdditionalChildren):
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitAdditionalChildren):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitAdditionalChildren):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):
2016-12-12 Sam Weinig <sam@webkit.org>
[WebIDL] Remove use of Dictionary in ApplePaySession
https://bugs.webkit.org/show_bug.cgi?id=165787
Reviewed by Anders Carlsson.
First take at generating the bindings for ApplePaySession and removing
all use of Dictionary.
- Removes all use of Dictionary!
- Removes use of logging errors to the console with improved Exception messages.
- Use ExceptionOr extensively to pass exception state.
Still to do:
- Reconcile / merge ApplePaySession::PaymentRequest with WebCore::PaymentRequest
and all the sub-objects held within.
- Remove PaymentRequestValidator entirely, merging validation into the validation
we already do in ApplePaySession.cpp
- Make ApplePayEvents use generated dictionary creation code.
Test: http/tests/ssl/applepay/ApplePaySession.html
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::canCallApplePaySessionAPIs):
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::ApplePaySession):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::begin):
(WebCore::ApplePaySession::completeMerchantValidation):
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::createContactFields): Deleted.
(WebCore::toLineItemType): Deleted.
(WebCore::isValidLineItemPropertyName): Deleted.
(WebCore::createLineItem): Deleted.
(WebCore::createLineItems): Deleted.
(WebCore::createMerchantCapabilities): Deleted.
(WebCore::createSupportedNetworks): Deleted.
(WebCore::toShippingType): Deleted.
(WebCore::isValidShippingMethodPropertyName): Deleted.
(WebCore::createShippingMethod): Deleted.
(WebCore::createShippingMethods): Deleted.
(WebCore::isValidPaymentRequestPropertyName): Deleted.
(WebCore::createPaymentRequest): Deleted.
* Modules/applepay/ApplePaySession.h:
Replace hand written dictionary extraction code with autogenerated code
and hand written additional validation.
* Modules/applepay/ApplePaySession.idl:
Add helper dictionaries and enums.
* Modules/applepay/PaymentRequestValidator.cpp:
(WebCore::PaymentRequestValidator::validate):
(WebCore::PaymentRequestValidator::validateTotal):
(WebCore::validateCountryCode):
(WebCore::validateCurrencyCode):
(WebCore::validateMerchantCapabilities):
(WebCore::validateSupportedNetworks):
(WebCore::validateShippingMethod):
(WebCore::validateShippingMethods):
(WebCore::PaymentRequestValidator::PaymentRequestValidator): Deleted.
(WebCore::PaymentRequestValidator::~PaymentRequestValidator): Deleted.
(WebCore::PaymentRequestValidator::validateCountryCode): Deleted.
(WebCore::PaymentRequestValidator::validateCurrencyCode): Deleted.
(WebCore::PaymentRequestValidator::validateMerchantCapabilities): Deleted.
(WebCore::PaymentRequestValidator::validateShippingMethod): Deleted.
(WebCore::PaymentRequestValidator::validateSupportedNetworks): Deleted.
(WebCore::PaymentRequestValidator::validateShippingMethods): Deleted.
* Modules/applepay/PaymentRequestValidator.h:
Instead of reporting the validation errors to the console, pass them in the exception.
This allows us to remove the window member, and move the helpers to the implementation
file as statics.
* WebCore.xcodeproj/project.pbxproj:
Remove file.
* bindings/generic/IDLTypes.h:
(WebCore::IDLObject::nullValue):
(WebCore::IDLObject::isNullValue):
(WebCore::IDLObject::extractValueFromNullable):
Add nullability traits for IDLObject.
* bindings/js/JSApplePaySessionCustom.cpp:
Removed.
2016-12-13 Daniel Bates <dabates@apple.com>
CSP: Teach the preload scanner about the 'nonce' attribute
https://bugs.webkit.org/show_bug.cgi?id=161192
<rdar://problem/28010354>
Reviewed by Darin Adler.
This patch was inspired by a similar Blink change:
<https://chromium.googlesource.com/chromium/src/+/dde5487f380cf774e4c0e96ba7f88ea68e723907>
Preload external scripts and stylesheets whose HTML script and link elements have a nonce
attribute that is listed in the Content Security Policy (CSP) of the page.
Currently the preload scanner ignores the nonce attribute on HTML script and link elements.
So, WebKit does not preload their associated subresources unless the value of the src
attribute or href attribute is whitelisted in the CSP of the page for script and link
elements, respectively. Instead the preload scanner should recognize the nonce attribute on
script and link elements and query the CSP of the page with it. If the nonce attribute is
whitelisted then the request should be preloaded.
Tests: http/tests/loading/do-not-preload-css-blocked-by-csp.html
http/tests/loading/do-not-preload-script-src-blocked-by-csp.html
http/tests/loading/preload-css-with-csp-nonce.html
http/tests/loading/preload-script-src-with-csp-nonce.html
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Set the nonce on the
PreloadRequest to the nonce that we found during the scan.
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): For script and link tag names,
save the value of the nonce attribute (if it has one).
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest): Skip CSP policy check if the nonce is listed in
the CSP of the page.
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::setNonce): Added.
2016-12-13 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
https://bugs.webkit.org/show_bug.cgi?id=165776
Reviewed by Zalan Bujtas.
* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::hasDoubleValue):
(WebCore::determineCategory):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
* css/CSSCalculationValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::unitCategory):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeLengthDouble):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
(WebCore::CSSPrimitiveValue::getFloatValue):
(WebCore::CSSPrimitiveValue::doubleValue):
(WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
(WebCore::CSSPrimitiveValue::doubleValueInternal):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontRelativeLength):
(WebCore::CSSPrimitiveValue::isLength):
(WebCore::CSSPrimitiveValue::isResolution):
(WebCore::CSSPrimitiveValue::createAllowingMarginQuirk):
* css/CSSValue.h:
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createValue):
* css/CSSValuePool.h:
(WebCore::CSSValuePool::createValue):
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidDensity):
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseSimpleLength):
(WebCore::parseSimpleLengthValue):
(WebCore::parseColorIntOrPercentage):
(WebCore::fastParseColorInternal):
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
* css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
(WebCore::stringToUnitType):
(WebCore::CSSParserToken::CSSParserToken):
(WebCore::CSSParserToken::convertToPercentage):
* css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::unitType):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
(WebCore::consumeCounter):
(WebCore::consumeAnimationName):
(WebCore::consumePerspective):
(WebCore::consumePositionLonghand):
(WebCore::consumeCounterContent):
(WebCore::consumeReflect):
(WebCore::consumeGridBreadth):
(WebCore::CSSPropertyParser::consumeFlex):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeUrl):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readFeatureValue):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
* css/parser/SizesAttributeParser.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::toCSSPrimitiveValue):
2016-12-13 Eric Carlson <eric.carlson@apple.com>
Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
https://bugs.webkit.org/show_bug.cgi?id=165251
Reviewed by Youenn Fablet.
No new tests, fixes an API test.
* page/Settings.in: Delete mediaStreamEnabled and peerConnectionEnabled, we don't need a
setting and a runtime feature.
2016-12-13 Antti Koivisto <antti@apple.com>
REGRESSION (r198990): Cannot edit content inside <details> in wysiwyg editor
https://bugs.webkit.org/show_bug.cgi?id=165757
Reviewed by Andreas Kling.
Test: fast/html/details-edit.html
-webkit-user-modify is reset on shadow boundary so it doesn't go through <details> shadow tree.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::pseudoStyleForElement):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::computeEditability):
Make -webkit-user-modify (which we would want to get rid of completely eventually) have no effect in shadow trees.
Check for contenteditable directly instead.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createInnerTextStyle):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/shadow/TextControlInnerElements.cpp:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::createFlowThreadStyle):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::styleDidChange):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::createAnonymousStyleWithDisplay):
(WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
(WebCore::RenderStyle::inheritFrom):
Let -webkit-user-modify inherit through shadow boundary as normal.
* rendering/style/RenderStyle.h:
2016-12-12 Darin Adler <darin@apple.com>
Remove bindings generation support for legacy WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=165762
Reviewed by Sam Weinig.
After this patch, all use of legacy WebCore::Dictionary is within custom bindings or
inside the DOM code itself. Bindings generation machinery no longer has a special
type named "Dictionary" but has increasingly good support for IDL-defined dictionaries.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Take ExecState and a JSValue rather than a Dictionary.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
* Modules/applepay/ApplePaySession.h: Updated for the above changes.
* Modules/applepay/ApplePaySession.idl: For this last file using Dictionary in IDL, move
to "[CallWith=ScriptState]" and "any" as a stopgap. Later we can return and use IDL
dictionaries or other more modern solutions.
* Modules/mediastream/MediaDevices.idl: For the custom binding written in JavaScript,
use the type mentioned in the specification rather than Dictionary. The bindings generator
ignores the type, so this is more like changing a comment rather than changing source code.
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection): Refer to a non-object as not a valid "dictionary", lowercase
rather than "Dictionary".
* Modules/mediastream/RTCPeerConnectionInternals.js:
(callbacksAndDictionaryOverload): Ditto.
* bindings/generic/IDLTypes.h: Removed IDLLegacyDictionary.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::getHashAlgorithm): Fixed a comment.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLLegacyDictionary<T>>::convert): Deleted.
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType): Removed special case for "Dictionary".
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType): Ditto.
(AreTypesDistinguishableForOverloadResolution): Ditto.
(GenerateOverloadedFunctionOrConstructor): Ditto.
(GenerateParametersCheck): Ditto.
(GetBaseIDLType): Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated results.
* bindings/scripts/test/TestObj.idl: Removed test case for Dictionary.
2016-12-12 Chris Dumez <cdumez@apple.com>
Drop unnecessary null check in removeDetachedChildrenInContainer()
https://bugs.webkit.org/show_bug.cgi?id=165778
Reviewed by Alex Christensen.
Drop unnecessary null check in removeDetachedChildrenInContainer().
Node cannot be null but we do an implicit null check.
No new tests, no Web-exposed behavior change.
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::removeDetachedChildrenInContainer):
2016-12-12 Chris Dumez <cdumez@apple.com>
Add Document.onvisibilitychange event handler attribute
https://bugs.webkit.org/show_bug.cgi?id=165784
Reviewed by Daniel Bates.
Add Document.onvisibilitychange event handler attribute as per Page
Visibility Level 2 API:
- http://w3c.github.io/page-visibility/#onvisiblitychange-event-handler
Test: fast/events/page-visibility-onvisibilitychange.html
* dom/Document.idl:
2016-12-12 Dean Jackson <dino@apple.com>
[iOS] MediaDocument "Done" button should navigate the page back
https://bugs.webkit.org/show_bug.cgi?id=165779
Reviewed by Sam Weinig.
Detect if the exit from fullscreen was caused by the Done button,
and if so, tell the page to navigate back.
Unfortunately this is not yet testable. It's waiting on the
UI-based device testing in development by the media team.
* platform/cocoa/WebVideoFullscreenModel.h: Add a finishedWithMedia parameter to
requestFullscreenMode, to indicate if the change in mode is associated with
the closing of the media document.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::requestFullscreenMode): If we're a media
document, and we say we're finished with the media, tell the document
to navigate back a page.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::requestFullscreenMode):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2016-12-12 Zalan Bujtas <zalan@apple.com>
Infinite recursion when viewport is set to the size of the content but the content overflows the viewport.
https://bugs.webkit.org/show_bug.cgi?id=165775
rdar://problem/29366628
Reviewed by Simon Fraser.
In certain cases when the viewport is sized to accomodate the content and
the content always overflows the viewport, we might end up in recursive FrameView::layout calls.
This is specific to content with viewport units, because we always invalidate elements with vw/vh units on
viewport size change. However if this viewport size change is in response to content size change (layout),
invalidating elements could trigger synchronous layout, while we are still inside this current layout.
This is very similar to the m_setNeedsLayoutWasDeferred case and they should eventually be merged.
It also means that we might be behind by one layout on elements with vw/vh units (fixed layout only though).
Currently not testable.
* page/FrameView.cpp:
(WebCore::FrameView::availableContentSizeChanged):
2016-12-12 Keith Rollin <krollin@apple.com>
Memory warning logging appears to capture resident footprint, missing compress/swap.
https://bugs.webkit.org/show_bug.cgi?id=165533
<rdar://problem/29318410>
Reviewed by Andreas Kling.
Have platformMemoryUsage return both resident and resident + swapped
values. This is now returned as a struct in a std::optional to better
support cases where values cannot or are not returned. Report these
values in logMemoryUsageChange.
Remove most of the ReliefLogger instances and their messages. We no
longer free up fastMalloc memory after each memory-release operation,
so there are no memory regions returned to the OS. Instead, we now
free up fastMalloc memory regions at the end of all memory-releasing
operations in one fell swoop and report a grand total of memory
returned.
No new tests -- no changes to user accessible functionality.
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2016-12-12 Chris Dumez <cdumez@apple.com>
Document.visibilityState should use an IDL string enumeration
https://bugs.webkit.org/show_bug.cgi?id=165774
Reviewed by Daniel Bates.
Document.visibilityState should use an IDL string enumeration:
- http://w3c.github.io/page-visibility/#extensions-to-the-document-interface
No new tests, there should be no Web-exposed behavior change.
* CMakeLists.txt:
* Modules/vibration/NavigatorVibration.cpp:
(WebCore::NavigatorVibration::vibrate):
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::hidden):
(WebCore::Document::pageVisibilityState): Deleted.
(WebCore::Document::visibilityState): Deleted.
* dom/Document.h:
* dom/Document.idl:
* page/Page.cpp:
(WebCore::Page::visibilityState):
* page/PageVisibilityState.cpp: Removed.
* page/PageVisibilityState.h:
(): Deleted.
2016-12-12 Jer Noble <jer.noble@apple.com>
Remove implementation of legacy Mozilla-based Fullscreen API.
https://bugs.webkit.org/show_bug.cgi?id=165689
Reviewed by Eric Carlson.
Alias the legacy webkitRequestFull_S_creen() function on Element to webkitRequestFull_s_creen().
Remove the custom behavior in Document::requestFullScreenForElement() to handle the legacy path.
* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::webkitRequestFullscreen):
(WebCore::Element::webkitRequestFullScreen): Deleted.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
2016-12-12 Zalan Bujtas <zalan@apple.com>
The CSS 'columns' property when set on the <body> element makes short columns
https://bugs.webkit.org/show_bug.cgi?id=164891
Reviewed by Darin Adler and David Hyatt.
Currently when the body has auto height, we use the height of the viewport as
the available height for the columns defined on the body element.
This is the desired behaviour for paginated content.
However in case of a simple, non-paginated multicolumn context, we should let the columns grow beyond
the viewport vertically. This is also what other browsers do.
This patch sets the available height on columns (in non-paginated context) only if the logical height
is defined (we are right before layout, so applying non-defined values does not make much sense anyway).
The reason why it is only broken on the <body> is because it stretches to the viewport by
default (see stretchesToViewport()) while other block renderers do not.
Test: fast/multicol/columns-on-body.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
2016-12-09 Dean Jackson <dino@apple.com>
Autoplay isn't working in iPhone MediaDocuments
https://bugs.webkit.org/show_bug.cgi?id=165710
<rdar://problems/29606761>
Reviewed by Darin Adler.
Our silent video autoplay detection disabled autoplay
of videos in MediaDocuments.
Test: media/ios/autoplay-only-in-main-document.html
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):
Return true if we're in a top-level media document.
2016-12-12 Zan Dobersek <zdobersek@igalia.com>
Unreviewed. Fixing build breakage in GStreamer's WebKitCommonEncryptionDecryptorGStreamer.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
WTF::Seconds should be used instead of std::chrono::seconds.
2016-12-11 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r200283): Transform, overflow hidden and filter combination completely hides the element
https://bugs.webkit.org/show_bug.cgi?id=161509
Reviewed by David Hyatt.
When the filter painting code needs to recompute a paintDirtyRect, it was using selfClipRect()
which is obviously wrong because it returns a rect in absolute coordinates. Use code factored
out of localClipRect() instead, which returns a rect relative to the painting root.
Test: css3/filters/filter-on-overflow-hidden.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
2016-12-11 Saam Barati <sbarati@apple.com>
We should be able to throw exceptions from Wasm code and when Wasm frames are on the stack
https://bugs.webkit.org/show_bug.cgi?id=165429
Reviewed by Keith Miller.
* bindings/js/JSDOMBinding.cpp:
(WebCore::GetCallerGlobalObjectFunctor::operator()):
2016-12-11 Darin Adler <darin@apple.com>
Remove uses of Dictionary in WebRTC IDL files
https://bugs.webkit.org/show_bug.cgi?id=165736
Reviewed by Sam Weinig.
Also removed quite a bit of unused code. There were some mocks that were out of date and
no longer matched the types used in the real code, that also were no longer hooked up,
and other types of dead code. We will have to implement anew when we want to restore tests
like the ones these were intended to enable.
* CMakeLists.txt: Updated for all the removed files.
* Modules/mediastream/MediaEndpointPeerConnection.cpp: Moved some types in here
that don't need to be in the header.
(WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): Use make_unique.
(WebCore::MediaEndpointPeerConnection::setConfiguration): Changed argument type,
obviating the need for most of the code that was here.
* Modules/mediastream/MediaEndpointPeerConnection.h: Updated for the above. Made more
things private and final. Marked the constructor explicit. Removed unneeded includes.
* Modules/mediastream/PeerConnectionBackend.h: Removed unneeded includes and forward
declarations. Changed the argument type for setConfiguration (see above).
* Modules/mediastream/RTCConfiguration.cpp: Removed.
None of the code here was needed except for the ICE server validation, and that was
moved into RTCPeerConnection::setConfiguration.
* Modules/mediastream/RTCConfiguration.h: Changed this from a class to a struct since
this is now a dictionary rather than an interface.
* Modules/mediastream/RTCConfiguration.idl: Changed this from an interface to a dictionary.
* Modules/mediastream/RTCDTMFSender.cpp: Removed some of the code from this file. This
class currently isn't implemented, but was depending on RTCPeerConnectionHandler. I removed
some of the dead code. Someone will have to straighten this out so we can turn it back on.
* Modules/mediastream/RTCDTMFSender.h: Ditto.
* Modules/mediastream/RTCDataChannel.cpp: Updated includes.
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create): Removed most of the code, since this now takes
a structure rather than a WebCore::Dictionary, and so the bindings take care of the work.
* Modules/mediastream/RTCIceCandidate.h: Updated for the above.
* Modules/mediastream/RTCIceCandidate.idl: Changed the constructor to take a
RTCIceCandidateInit instead of a Dictionary.
* Modules/mediastream/RTCIceServer.h: Changed this from a class to a struct since
this is now a dictionary rather than an interface.
* Modules/mediastream/RTCIceServer.idl: Changed this from an interface to a dictionary.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith): Take an RTCConfiguration rather than
a Dictionary.
(WebCore::RTCPeerConnection::getConfiguration): Moved to header, now an inline.
(WebCore::RTCPeerConnection::setConfiguration): Use the configuration dictionary now instead
of the configuration class. Also moved validation of server URLs here, formerly in the
RTCConfiguration RTCConfiguration::initialize function. Also moved code to convert from
RTCConfiguration to MediaEndpointConfiguration here, formerly in
MediaEndpointPeerConnection::setConfiguration.
* Modules/mediastream/RTCPeerConnection.h: Updated for the above.
* Modules/mediastream/RTCPeerConnection.idl: Changed argument to initializeWith and
setConfiguration from Dictionary to RTCConfiguration.
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::parseTypeString): Deleted.
(WebCore::RTCSessionDescription::create): Changed to take struct instead of Dictionary.
* Modules/mediastream/RTCSessionDescription.h: Added Init struct and changed create to
take it.
* Modules/mediastream/RTCSessionDescription.idl: Changed constructor argument to take
RTCSessionDescriptionInit dictionary instead of Dictionary.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Updated includes.
* WebCore.xcodeproj/project.pbxproj: Updated for all the removed files.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Fixed convertDictionaryToJS to work with other
nullable types besides RefPtr.
* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
* platform/mediastream/RTCConfigurationPrivate.h: Removed.
* platform/mediastream/RTCIceServerPrivate.h: Removed.
* platform/mediastream/RTCPeerConnectionHandler.cpp: Removed.
* platform/mediastream/RTCPeerConnectionHandler.h: Removed.
* platform/mock/RTCDTMFSenderHandlerMock.cpp: Removed.
* platform/mock/RTCDTMFSenderHandlerMock.h: Removed.
* platform/mock/RTCDataChannelHandlerMock.h: Updated includes, made more things private and final.
* platform/mock/RTCPeerConnectionHandlerMock.cpp: Removed.
* platform/mock/RTCPeerConnectionHandlerMock.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::Internals): Removed call to enableMockRTCPeerConnectionHandler.
(WebCore::Internals::enableMockRTCPeerConnectionHandler): Deleted.
2016-12-11 Darin Adler <darin@apple.com>
Use std::vsnprintf instead of vasprintf
https://bugs.webkit.org/show_bug.cgi?id=165740
Reviewed by Sam Weinig.
* platform/FileHandle.cpp:
(WebCore::FileHandle::printf): Use vsnprintf, including StringExtras.h to
ensure compatibility with older versions of the Visual Studio library,
and Vector for the buffer. Use inline capacity in the vector so we normally
don't need to allocate any memory on the heap.
* xml/XSLTUnicodeSort.cpp:
(xsltTransformErrorTrampoline): Ditto.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::error): Ditto.
2016-12-11 Darin Adler <darin@apple.com>
Make some refinements to HTMLPlugInImageElement
https://bugs.webkit.org/show_bug.cgi?id=165742
Reviewed by Sam Weinig.
* html/HTMLPlugInImageElement.cpp: Removed many unneeded includes.
(WebCore::titleText): Use HashMap::ensure, correct argument types.
(WebCore::subtitleText): Ditto.
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Moved
initialization of most scalars to the class definition.
(WebCore::HTMLPlugInImageElement::isImageType): Use auto.
(WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn): Removed
unneeded local variable and if statement.
(WebCore::HTMLPlugInImageElement::willDetachRenderers): Use auto.
(WebCore::HTMLPlugInImageElement::updateSnapshot): Do not call
renderer twice unnecessarily.
(WebCore::plugInImageElementIsolatedWorld): Use auto.
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Use auto.
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay): Use auto.
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): Got rid of
unnecessary typedef.
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Take a
reference rather than PassRefPtr.
(WebCore::documentHadRecentUserGesture): Removed unneeded if.
(WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting): Use auto.
(WebCore::isSmallerThanTinySizingThreshold): Use auto.
(WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin): Use auto.
(WebCore::HTMLPlugInImageElement::checkSnapshotStatus): Use auto.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Got rid
of unnecessary local variable. Use auto.
(WebCore::HTMLPlugInImageElement::requestObject): Got rid of unnecessary
local variable.
* html/HTMLPlugInImageElement.h: Updated for the above. Removed incorrect
use of const. Initialized all scalars. Made function private and final.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::handleEvent): Pass reference instead
of pointer.
2016-12-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Cleanup some InspectorInstrumentation network loading notifications
https://bugs.webkit.org/show_bug.cgi?id=165688
Reviewed by Brian Burg.
Eliminate InspectorInstrumentation::willReceiveResourceResponse by folding
it into InspectorInstrumentation::didReceiveResourceResponse. Simplify other
related InspectorInstrumentation calls by using references and using more
consistent InspectorInstrumentation patterns.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl): Deleted.
(WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl): Deleted.
(WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl): Deleted.
(WebCore::InspectorInstrumentation::continueWithPolicyDownloadImpl): Deleted.
(WebCore::InspectorInstrumentation::continueWithPolicyIgnoreImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didReceiveResourceResponse):
(WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
(WebCore::InspectorInstrumentation::continueWithPolicyDownload):
(WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
(WebCore::InspectorInstrumentation::willReceiveResourceResponse): Deleted.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponse):
2016-12-11 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Protect MediaDevicesRequest during callback
https://bugs.webkit.org/show_bug.cgi?id=165711
<rdar://problem/28400468>
Reviewed by Sam Weinig.
No new tests, I was unable to create a reproducible test but this fix avoids
an occasional crash in existing tests.
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
before calling the controller in case the completion handler is called synchronously.
2016-12-09 Filip Pizlo <fpizlo@apple.com>
The DOM should have an advancing wavefront opaque root barrier
https://bugs.webkit.org/show_bug.cgi?id=165712
Reviewed by Yusuke Suzuki.
No new tests because this was covered by crashing tests.
Consider these two cases:
Removal:
1) DOM at start: D->X->Y
2) Mark X, X->visitChildren, addOpaqueRoot(D)
3) remove X
4) Y thinks it's not reachable (its opaque root, X, is not in the set).
Insertion:
1) DOM at start: D, X->Y
2) Mark X, X->visitChildren, addOpaqueRoot(X)
3) insert X into D
4) Y thinks it's not reachable (its opaque root, D, is not in the set).
We can fix this with two barriers:
Removal: add X (the removed child) to the opaque root set.
Insertion: add D (the insertion point) to the opaque root set.
Thanks Rysosuke for coming up with this idea!
Both barriers advance the wavefront. We could consider retreating wavefront barriers in
the future (where we cause visitChildren to be called again on wrappers that belonged to
roots that got affected by insertion/removal) but those would probably require more
bookkeeping.
To make this barrier very fast, the WebCore caches the JSC VM's barrier state in
its own global variable for very fast access. This variable will be false most of the
time. It's false when there is no VM, so triggering the barrier won't cause the VM to be
created. It's only true when GC is running, which is rare by design.
To make that caching more sensible, I finally gave WebCore a central header for
the common VM (CommonVM.h).
* CMakeLists.txt:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::callScript):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CommonVM.cpp: Added.
(WebCore::commonVMSlow):
(WebCore::writeBarrierOpaqueRootSlow):
* bindings/js/CommonVM.h: Added.
(WebCore::commonVM):
(WebCore::writeBarrierOpaqueRoot):
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::mainThreadNormalWorld):
* bindings/js/GCController.cpp:
(WebCore::collect):
(WebCore::GCController::garbageCollectSoon):
(WebCore::GCController::garbageCollectNow):
(WebCore::GCController::garbageCollectNowIfNotDoneRecently):
(WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
(WebCore::GCController::deleteAllCode):
(WebCore::GCController::deleteAllLinkedCode):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::addImpureProperty):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
(WebCore::JSDOMWindowBase::commonVM): Deleted.
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::setWindow):
* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
(WebCore::ScriptCachedFrameData::clear):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::createWorld):
(WebCore::ScriptController::getAllWorlds):
(WebCore::ScriptController::clearWindowShell):
(WebCore::ScriptController::cacheableBindingRootObject):
(WebCore::ScriptController::bindingRootObject):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::jsObjectForPluginElement):
(WebCore::ScriptController::clearScriptObjects):
* dom/CollectionIndexCache.cpp:
(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
* dom/ContainerNode.cpp:
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):
* dom/Document.cpp:
(WebCore::Document::shouldBypassMainWorldContentSecurityPolicy):
* dom/Node.h:
(WebCore::Node::opaqueRoot):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::vm):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pauseAfterDetachedTask):
(WebCore::HTMLMediaElement::ensureIsolatedWorld):
* html/HTMLPlugInImageElement.cpp:
(WebCore::plugInImageElementIsolatedWorld):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::vm):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::memoryUsageStatistics):
(WebCore::PerformanceLogging::javaScriptObjectCounts):
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::createThreadIfNeeded):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::reportApproximateMemoryCost):
* testing/MemoryInfo.h:
(WebCore::MemoryInfo::MemoryInfo):
2016-12-11 Dan Bernstein <mitz@apple.com>
[Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:space element contains non-breaking space characters, but shouldn’t
https://bugs.webkit.org/show_bug.cgi?id=165515
<rdar://problem/4108460>
Reviewed by Darin Adler.
Test: platform/mac/fast/text/attributed-substring-from-range.html
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_processText): Emit a space instead of a non-breaking space if the text node
is styled with -webkit-nbsp-mode:space.
(WebCore::editingAttributedStringFromRange): Replace all non-breaking spaces with spaces if
they come from a text node with -webkit-nbsp-mode:space.
2016-12-11 Konstantin Tokarev <annulen@yandex.ru>
Unreviewed, add KHR include dir to fix ANGLE build after r209665
https://bugs.webkit.org/show_bug.cgi?id=165686
* CMakeLists.txt:
2016-12-10 Dave Hyatt <hyatt@apple.com>
Rolling out 165737, since it broke layout tests. I need to find a
different place to put the init.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidSelector):
2016-12-10 Simon Fraser <simon.fraser@apple.com>
Support the deprecated dictionary constructor for DOMPointReadOnly and DOMPoint
https://bugs.webkit.org/show_bug.cgi?id=165732
Reviewed by Sam Weinig.
For compatibility with other browsers, support the DOMPointInit constructor to
DOMPoint and DOMPointReadOnly per <https://www.w3.org/TR/geometry-1/#DOMPoint>
Extended geometry/DOMPoint-001.html to test.
* dom/DOMPoint.h:
* dom/DOMPoint.idl:
* dom/DOMPointReadOnly.h:
(WebCore::DOMPointReadOnly::create):
* dom/DOMPointReadOnly.idl:
2016-12-10 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure content extensions initialize AtomicString
https://bugs.webkit.org/show_bug.cgi?id=165737
Reviewed by Simon Fraser.
Fixes two broken tests in TestWebkitAPI.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidSelector):
2016-12-10 Simon Fraser <simon.fraser@apple.com>
Animation followed by transition doesn't always fire transitionend event
https://bugs.webkit.org/show_bug.cgi?id=165731
rdar://problem/28471240
Reviewed by Zalan Bujtas.
After r200047, a keyframe animation of an accelerated property followed by a
transition didn't always fire a transitionend event.
This happened if CompositeAnimation::timeToNextService() happend to be called
when the transitions's timeToNextService() returned a positive value, but the
keyframe animation still existed, but its timeToNextService() returned -1. In
this case that -1 would clobber the positing minT.
Fix by just continuing in each loop when the timeToNextService() returns -1.
This code should probably be rewritten to use std::optional<double> rather than
magic values.
Test: animations/animation-followed-by-transition.html
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::timeToNextService):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::pauseAnimation):
(WebCore::GraphicsLayerCA::removeAnimation):
(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
(WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
2016-12-10 Sam Weinig <sam@webkit.org>
[WebIDL] Merge JSDictionary into Dictionary, and remove unused bits
https://bugs.webkit.org/show_bug.cgi?id=165641
Reviewed by Dan Bernstein.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove JSDictionary.h/cpp
* Modules/mediastream/RTCDataChannel.cpp:
Remove unused #include of Dictionary.h
* Modules/mediastream/RTCPeerConnection.cpp:
* Modules/mediastream/RTCPeerConnection.h:
Replace unnecessary #include of Dictionary in a header with forward declaration.
* bindings/js/Dictionary.cpp:
(WebCore::Dictionary::Dictionary):
(WebCore::Dictionary::tryGetProperty):
(WebCore::Dictionary::getOwnPropertyNames):
(WebCore::Dictionary::convertValue):
(WebCore::Dictionary::asJSObject<Notification>): Deleted.
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap): Deleted.
(WebCore::Dictionary::getWithUndefinedOrNullCheck): Deleted.
* bindings/js/Dictionary.h:
(WebCore::Dictionary::isObject):
(WebCore::Dictionary::isUndefinedOrNull):
(WebCore::Dictionary::execState):
(WebCore::Dictionary::initializerObject):
(WebCore::Dictionary::isValid):
(WebCore::Dictionary::convertValue):
(WebCore::Dictionary::get):
(WebCore::Dictionary::tryGetPropertyAndResult):
(WebCore::Dictionary::getEventListener): Deleted.
Merge JSDictionary into Dictionary. Remove all unused functions (some getters, lots
of convertValue overrides). Modernize to taste.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createHmacParams):
(WebCore::createHmacKeyParams):
(WebCore::createRsaKeyGenParams):
(WebCore::createRsaOaepParams):
(WebCore::createRsaSsaParams):
Update for rename. JSDictionary is now Dictionary.
* bindings/js/JSDictionary.cpp: Removed.
* bindings/js/JSDictionary.h: Removed.
* dom/MutationObserver.cpp:
Remove unused #include of Dictionary.h
2016-12-10 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Move CSSParserValues.h/.cpp to CSSParserSelector.h/.cpp
https://bugs.webkit.org/show_bug.cgi?id=165730
Reviewed by Simon Fraser.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSCustomPropertyValue.cpp:
* css/CSSPrimitiveValue.cpp:
* css/CSSSelectorList.cpp:
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/parser/CSSParserImpl.cpp:
* css/parser/CSSParserSelector.cpp: Copied from Source/WebCore/css/parser/CSSParserValues.cpp.
* css/parser/CSSParserSelector.h: Copied from Source/WebCore/css/parser/CSSParserValues.h.
* css/parser/CSSParserValues.cpp: Removed.
* css/parser/CSSParserValues.h: Removed.
* css/parser/CSSSelectorParser.h:
2016-12-10 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Remove the pseudoclass/element hacks
https://bugs.webkit.org/show_bug.cgi?id=165729
Reviewed by Sam Weinig.
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/SelectorPseudoElementTypeMap.in:
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
2016-12-09 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for Geolocation
https://bugs.webkit.org/show_bug.cgi?id=165625
Reviewed by Alex Christensen.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add/remove files.
* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::GeoNotifier):
(WebCore::GeoNotifier::hasZeroTimeout):
(WebCore::GeoNotifier::startTimerIfNeeded):
* Modules/geolocation/GeoNotifier.h:
(WebCore::GeoNotifier::create):
(WebCore::GeoNotifier::options):
Update to store PositionOptions as a value, and pass the PositionCallback
as a Ref, rather than a RefPtr, since it is not optional.
* Modules/geolocation/Geolocation.cpp:
(WebCore::createGeoposition):
Use auto, to get the good type for Coordinates (Ref).
(WebCore::Geolocation::getCurrentPosition):
(WebCore::Geolocation::watchPosition):
(WebCore::Geolocation::haveSuitableCachedPosition):
(WebCore::Geolocation::startUpdating):
* Modules/geolocation/Geolocation.h:
Update to pass PositionOptions itself now that it is a plain struct.
* Modules/geolocation/Geolocation.idl:
Remove [Custom] extended attribute and add FIXME about nullable annotation.
* Modules/geolocation/Geoposition.h:
Pass/store Coordinates as a Ref.
* Modules/geolocation/PositionOptions.h:
Convert to be a simple struct.
* Modules/geolocation/PositionOptions.idl:
Added.
* bindings/js/JSGeolocationCustom.cpp:
Removed.
2016-12-09 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Remove the old CSS Parser
https://bugs.webkit.org/show_bug.cgi?id=165645
Reviewed by Daniel Bates.
Remove the old CSS parser code. In doing so, code that used documentless
CSSParserContexts is now going through the new parser. This resulted in
some additional changes. These include:
(1) Canvas color parsing switched to new parser's code. This resulted in
progressions on canvas tests.
(2) Support for CSSNamespaceRule in the CSS OM, since the Inspector's
creation of CSS OM wrappers made it necessary to add this in. The old parser
did not create style rules for namespaces, but the new one (and other browsers)
did.
(3) <font face="X"> now uses the new parser's font-family parsing code. This
change was made in createFontFaceValue in CSSValuePool.
(4) FontFace now uses a new function on the new parser called
parseFontFaceDescriptor. This function sets things up so that parsing occurs
as though you are inside a @font-face. The old parser let you call parseValue
to parse "properties", but descriptors need to be handled differently in the
new parser.
(5) Illegal CSS rules in mediaControlsApple/ios.css forced me to add a quirk
to handle chained shadow DOM pseudo-elements. This should not be allowed, but
for now it is.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::hasDoubleValue):
(WebCore::checkDepthAndIndexDeprecated): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseCalc): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::operatorValue): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValue): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueExpression): Deleted.
* css/CSSCalculationValue.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences):
* css/CSSCustomPropertyValue.h:
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::CSSFunctionValue):
(WebCore::CSSFunctionValue::customCSSText):
(WebCore::CSSFunctionValue::append):
(WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables): Deleted.
* css/CSSFunctionValue.h:
* css/CSSGrammar.y.in: Removed.
* css/CSSGrammar.y.includes: Removed.
* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule):
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::appendRule):
* css/CSSNamespaceRule.cpp: Added.
(WebCore::CSSNamespaceRule::CSSNamespaceRule):
(WebCore::CSSNamespaceRule::~CSSNamespaceRule):
(WebCore::CSSNamespaceRule::namespaceURI):
(WebCore::CSSNamespaceRule::prefix):
(WebCore::CSSNamespaceRule::cssText):
(WebCore::CSSNamespaceRule::reattach):
* css/CSSNamespaceRule.h: Added.
* css/CSSNamespaceRule.idl: Added.
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
(WebCore::CSSPrimitiveValue::buildParserValue): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSRule.h:
* css/CSSRule.idl:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::insertRule):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyValue):
(WebCore::CSSValue::hasVariableReferences):
(WebCore::CSSValue::isVariableDependentValue): Deleted.
(WebCore::CSSValue::isVariableValue): Deleted.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCSSText):
(WebCore::CSSValueList::containsVariables): Deleted.
(WebCore::CSSValueList::checkVariablesForCycles): Deleted.
(WebCore::CSSValueList::buildParserValueSubstitutingVariables): Deleted.
(WebCore::CSSValueList::buildParserValueListSubstitutingVariables): Deleted.
* css/CSSValueList.h:
(WebCore::CSSValueList::createSlashSeparated):
(WebCore::CSSValueList::createFromParserValueList): Deleted.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFaceValue):
* css/CSSVariableData.cpp:
* css/CSSVariableDependentValue.cpp: Removed.
* css/CSSVariableDependentValue.h: Removed.
* css/CSSVariableValue.cpp: Removed.
* css/CSSVariableValue.h: Removed.
* css/DOMCSSNamespace.cpp:
* css/FontFace.cpp:
(WebCore::FontFace::parseString):
* css/InspectorCSSOMWrappers.cpp:
* css/MediaQueryExp.cpp:
(WebCore::isFeatureValidWithIdentifier): Deleted.
(WebCore::isFeatureValidWithNonNegativeLengthOrNumber): Deleted.
(WebCore::isFeatureValidWithDensity): Deleted.
(WebCore::isFeatureValidWithNonNegativeInteger): Deleted.
(WebCore::isFeatureValidWithNonNegativeNumber): Deleted.
(WebCore::isFeatureValidWithZeroOrOne): Deleted.
(WebCore::isFeatureValidWithNumberWithUnit): Deleted.
(WebCore::isFeatureValidWithNumber): Deleted.
(WebCore::isSlash): Deleted.
(WebCore::isPositiveIntegerValue): Deleted.
* css/MediaQueryExp.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText):
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/SelectorPseudoTypeMap.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::getPropertyCSSValue):
(WebCore::MutableStyleProperties::setCustomProperty):
(WebCore::MutableStyleProperties::parseDeclaration):
(WebCore::StyleProperties::asText):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* css/StyleResolver.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::createCSSOMWrapper):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
(WebCore::StyleSheetContents::completeURL):
(WebCore::StyleSheetContents::parseStringAtPosition): Deleted.
* css/StyleSheetContents.h:
* css/WebKitCSSMatrix.cpp:
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::parseRule):
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseSystemColor):
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseCustomPropertyValue):
(WebCore::CSSParser::parseSelector):
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::parseValueWithVariableReferences):
(WebCore::CSSParser::parseKeyframeKeyList):
(WebCore::CSSParser::parseFontFaceDescriptor):
(WebCore::equalLettersIgnoringASCIICase): Deleted.
(WebCore::hasPrefix): Deleted.
(WebCore::createPrimitiveValuePair): Deleted.
(WebCore::AnimationParseContext::commitFirstAnimation): Deleted.
(WebCore::AnimationParseContext::hasCommittedFirstAnimation): Deleted.
(WebCore::AnimationParseContext::commitAnimationPropertyKeyword): Deleted.
(WebCore::AnimationParseContext::animationPropertyKeywordAllowed): Deleted.
(WebCore::AnimationParseContext::hasSeenAnimationPropertyKeyword): Deleted.
(WebCore::AnimationParseContext::sawAnimationPropertyKeyword): Deleted.
(): Deleted.
(WebCore::convertToASCIILowercaseInPlace): Deleted.
(WebCore::CSSParserString::convertToASCIILowercaseInPlace): Deleted.
(WebCore::CSSParser::setupParser): Deleted.
(WebCore::isColorPropertyID): Deleted.
(WebCore::CSSParser::isValidSystemColorValue): Deleted.
(WebCore::validPrimitiveValueColor): Deleted.
(WebCore::parseColorValue): Deleted.
(WebCore::isSimpleLengthPropertyID): Deleted.
(WebCore::parseSimpleLength): Deleted.
(WebCore::parseSimpleLengthValue): Deleted.
(WebCore::isValidKeywordPropertyAndValue): Deleted.
(WebCore::isUniversalKeyword): Deleted.
(WebCore::isKeywordPropertyID): Deleted.
(WebCore::parseKeywordValue): Deleted.
(WebCore::parseTransformTranslateArguments): Deleted.
(WebCore::parseTranslateTransformValue): Deleted.
(WebCore::CSSParser::parseFontFaceValue): Deleted.
(WebCore::CSSParser::parseColorFromString): Deleted.
(WebCore::CSSParser::parseDeclarationDeprecated): Deleted.
(WebCore::filterProperties): Deleted.
(WebCore::CSSParser::createStyleProperties): Deleted.
(WebCore::CSSParser::addProperty): Deleted.
(WebCore::CSSParser::rollbackLastProperties): Deleted.
(WebCore::CSSParser::clearProperties): Deleted.
(WebCore::CSSParser::completeURL): Deleted.
(WebCore::CSSParser::validateCalculationUnit): Deleted.
(WebCore::CSSParser::shouldAcceptUnitLessValues): Deleted.
(WebCore::CSSParser::validateUnit): Deleted.
(WebCore::CSSParser::createPrimitiveNumericValue): Deleted.
(WebCore::CSSParser::createPrimitiveStringValue): Deleted.
(WebCore::isComma): Deleted.
(WebCore::isForwardSlashOperator): Deleted.
(WebCore::CSSParser::isValidSize): Deleted.
(WebCore::CSSParser::parseValidPrimitive): Deleted.
(WebCore::CSSParser::addExpandedPropertyForValue): Deleted.
(WebCore::isImageSetFunctionValue): Deleted.
(WebCore::CSSParser::addFillValue): Deleted.
(WebCore::isContentDistributionKeyword): Deleted.
(WebCore::isContentPositionKeyword): Deleted.
(WebCore::isBaselinePositionKeyword): Deleted.
(WebCore::isAlignmentOverflowKeyword): Deleted.
(WebCore::isItemPositionKeyword): Deleted.
(WebCore::CSSParser::parseLegacyPosition): Deleted.
(WebCore::CSSParser::parseContentDistributionOverflowPosition): Deleted.
(WebCore::CSSParser::parseItemPositionOverflowPosition): Deleted.
(WebCore::parseBackgroundClip): Deleted.
(WebCore::CSSParser::useLegacyBackgroundSizeShorthandBehavior): Deleted.
(WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
(WebCore::CSSParser::parseScrollSnapPositions): Deleted.
(WebCore::CSSParser::parseScrollSnapDestination): Deleted.
(WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
(WebCore::CSSParser::parseFillShorthand): Deleted.
(WebCore::CSSParser::addAnimationValue): Deleted.
(WebCore::CSSParser::parseAnimationShorthand): Deleted.
(WebCore::CSSParser::parseColumnWidth): Deleted.
(WebCore::CSSParser::parseColumnCount): Deleted.
(WebCore::CSSParser::parseColumnsShorthand): Deleted.
(WebCore::CSSParser::parseTransitionShorthand): Deleted.
(WebCore::CSSParser::parseShorthand): Deleted.
(WebCore::CSSParser::parse4Values): Deleted.
(WebCore::CSSParser::parsePage): Deleted.
(WebCore::CSSParser::parseSize): Deleted.
(WebCore::CSSParser::parseSizeParameter): Deleted.
(WebCore::CSSParser::parseQuotes): Deleted.
(WebCore::CSSParser::parseAlt): Deleted.
(WebCore::CSSParser::parseCustomPropertyDeclaration): Deleted.
(WebCore::CSSParser::parseContent): Deleted.
(WebCore::CSSParser::parseAttr): Deleted.
(WebCore::CSSParser::parseBackgroundColor): Deleted.
(WebCore::CSSParser::parseFillImage): Deleted.
(WebCore::CSSParser::parsePositionX): Deleted.
(WebCore::CSSParser::parsePositionY): Deleted.
(WebCore::CSSParser::parseFillPositionComponent): Deleted.
(WebCore::isValueConflictingWithCurrentEdge): Deleted.
(WebCore::isFillPositionKeyword): Deleted.
(WebCore::CSSParser::parse4ValuesFillPosition): Deleted.
(WebCore::CSSParser::parse3ValuesFillPosition): Deleted.
(WebCore::CSSParser::isPotentialPositionValue): Deleted.
(WebCore::CSSParser::parseFillPosition): Deleted.
(WebCore::CSSParser::parse2ValuesFillPosition): Deleted.
(WebCore::CSSParser::parseFillRepeat): Deleted.
(WebCore::CSSParser::parseFillSize): Deleted.
(WebCore::CSSParser::parseFillProperty): Deleted.
(WebCore::CSSParser::parseAnimationDelay): Deleted.
(WebCore::CSSParser::parseAnimationDirection): Deleted.
(WebCore::CSSParser::parseAnimationDuration): Deleted.
(WebCore::CSSParser::parseAnimationFillMode): Deleted.
(WebCore::CSSParser::parseAnimationIterationCount): Deleted.
(WebCore::CSSParser::parseAnimationName): Deleted.
(WebCore::CSSParser::parseAnimationPlayState): Deleted.
(WebCore::CSSParser::parseAnimationTrigger): Deleted.
(WebCore::CSSParser::parseAnimationProperty): Deleted.
(WebCore::CSSParser::parseTransformOriginShorthand): Deleted.
(WebCore::CSSParser::isSpringTimingFunctionEnabled): Deleted.
(WebCore::CSSParser::parseCubicBezierTimingFunctionValue): Deleted.
(WebCore::CSSParser::parseSpringTimingFunctionValue): Deleted.
(WebCore::CSSParser::parseAnimationTimingFunction): Deleted.
(WebCore::isValidGridPositionCustomIdent): Deleted.
(WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition): Deleted.
(WebCore::CSSParser::parseGridPosition): Deleted.
(WebCore::gridMissingGridPositionValue): Deleted.
(WebCore::CSSParser::parseGridItemPositionShorthand): Deleted.
(WebCore::CSSParser::parseGridGapShorthand): Deleted.
(WebCore::CSSParser::parseGridTemplateColumns): Deleted.
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Deleted.
(WebCore::CSSParser::parseGridTemplateShorthand): Deleted.
(WebCore::parseImplicitAutoFlow): Deleted.
(WebCore::CSSParser::parseGridShorthand): Deleted.
(WebCore::CSSParser::parseGridAreaShorthand): Deleted.
(WebCore::CSSParser::parseSingleGridAreaLonghand): Deleted.
(WebCore::CSSParser::parseGridLineNames): Deleted.
(WebCore::isGridTrackFixedSized): Deleted.
(WebCore::CSSParser::parseGridTrackList): Deleted.
(WebCore::CSSParser::parseGridTrackRepeatFunction): Deleted.
(WebCore::CSSParser::parseGridTrackSize): Deleted.
(WebCore::CSSParser::parseGridBreadth): Deleted.
(WebCore::isValidGridAutoFlowId): Deleted.
(WebCore::CSSParser::parseGridAutoFlow): Deleted.
(WebCore::skipCommaInDashboardRegion): Deleted.
(WebCore::CSSParser::parseDashboardRegions): Deleted.
(WebCore::parseGridTemplateAreasColumnNames): Deleted.
(WebCore::CSSParser::parseGridTemplateAreasRow): Deleted.
(WebCore::CSSParser::parseGridTemplateAreas): Deleted.
(WebCore::CSSParser::parseCounterContent): Deleted.
(WebCore::CSSParser::parseClipShape): Deleted.
(WebCore::completeBorderRadii): Deleted.
(WebCore::CSSParser::parseInsetRoundedCorners): Deleted.
(WebCore::CSSParser::parseBasicShapeInset): Deleted.
(WebCore::CSSParser::parseShapeRadius): Deleted.
(WebCore::CSSParser::parseBasicShapeCircle): Deleted.
(WebCore::CSSParser::parseBasicShapeEllipse): Deleted.
(WebCore::CSSParser::parseBasicShapePolygon): Deleted.
(WebCore::CSSParser::parseBasicShapePath): Deleted.
(WebCore::isBoxValue): Deleted.
(WebCore::CSSParser::parseBasicShapeAndOrBox): Deleted.
(WebCore::CSSParser::parseShapeProperty): Deleted.
(WebCore::CSSParser::parseClipPath): Deleted.
(WebCore::CSSParser::parseBasicShape): Deleted.
(WebCore::CSSParser::parseFont): Deleted.
(WebCore::CSSParser::parseSystemFont): Deleted.
(WebCore::FontFamilyValueBuilder::FontFamilyValueBuilder): Deleted.
(WebCore::FontFamilyValueBuilder::add): Deleted.
(WebCore::FontFamilyValueBuilder::commit): Deleted.
(WebCore::valueIsCSSKeyword): Deleted.
(WebCore::CSSParser::parseFontFamily): Deleted.
(WebCore::CSSParser::parseLineHeight): Deleted.
(WebCore::CSSParser::parseFontSize): Deleted.
(WebCore::createFontWeightValueKeyword): Deleted.
(WebCore::CSSParser::parseFontWeight): Deleted.
(WebCore::CSSParser::parseFontSynthesis): Deleted.
(WebCore::CSSParser::parseFontFaceSrcURI): Deleted.
(WebCore::CSSParser::parseFontFaceSrcLocal): Deleted.
(WebCore::CSSParser::parseFontFaceSrc): Deleted.
(WebCore::CSSParser::parseFontFaceUnicodeRange): Deleted.
(WebCore::checkForValidDouble): Deleted.
(WebCore::parseDouble): Deleted.
(WebCore::parseColorIntOrPercentage): Deleted.
(WebCore::isTenthAlpha): Deleted.
(WebCore::parseAlphaValue): Deleted.
(WebCore::mightBeRGBA): Deleted.
(WebCore::mightBeRGB): Deleted.
(WebCore::fastParseColorInternal): Deleted.
(WebCore::CSSParser::fastParseColor): Deleted.
(WebCore::CSSParser::parsedDouble): Deleted.
(WebCore::CSSParser::isCalculation): Deleted.
(WebCore::isPercent): Deleted.
(WebCore::CSSParser::parseColorInt): Deleted.
(WebCore::CSSParser::parseColorDouble): Deleted.
(WebCore::CSSParser::parseRGBParameters): Deleted.
(WebCore::CSSParser::parseColorFunctionParameters): Deleted.
(WebCore::CSSParser::parseHSLParameters): Deleted.
(WebCore::CSSParser::parseColorFromValue): Deleted.
(WebCore::ShadowParseContext::ShadowParseContext): Deleted.
(WebCore::ShadowParseContext::allowLength): Deleted.
(WebCore::ShadowParseContext::commitValue): Deleted.
(WebCore::ShadowParseContext::commitLength): Deleted.
(WebCore::ShadowParseContext::commitColor): Deleted.
(WebCore::ShadowParseContext::commitStyle): Deleted.
(WebCore::CSSParser::parseShadow): Deleted.
(WebCore::CSSParser::parseReflect): Deleted.
(WebCore::CSSParser::parseFlex): Deleted.
(WebCore::BorderImageParseContext::BorderImageParseContext): Deleted.
(WebCore::BorderImageParseContext::canAdvance): Deleted.
(WebCore::BorderImageParseContext::setCanAdvance): Deleted.
(WebCore::BorderImageParseContext::allowCommit): Deleted.
(WebCore::BorderImageParseContext::allowImage): Deleted.
(WebCore::BorderImageParseContext::allowImageSlice): Deleted.
(WebCore::BorderImageParseContext::allowRepeat): Deleted.
(WebCore::BorderImageParseContext::allowForwardSlashOperator): Deleted.
(WebCore::BorderImageParseContext::requireWidth): Deleted.
(WebCore::BorderImageParseContext::requireOutset): Deleted.
(WebCore::BorderImageParseContext::commitImage): Deleted.
(WebCore::BorderImageParseContext::commitImageSlice): Deleted.
(WebCore::BorderImageParseContext::commitForwardSlashOperator): Deleted.
(WebCore::BorderImageParseContext::commitBorderWidth): Deleted.
(WebCore::BorderImageParseContext::commitBorderOutset): Deleted.
(WebCore::BorderImageParseContext::commitRepeat): Deleted.
(WebCore::BorderImageParseContext::commitWebKitBorderImage): Deleted.
(WebCore::BorderImageParseContext::commitBorderImage): Deleted.
(WebCore::BorderImageParseContext::commitBorderImageProperty): Deleted.
(WebCore::CSSParser::parseBorderImage): Deleted.
(WebCore::isBorderImageRepeatKeyword): Deleted.
(WebCore::CSSParser::parseBorderImageRepeat): Deleted.
(WebCore::BorderImageSliceParseContext::BorderImageSliceParseContext): Deleted.
(WebCore::BorderImageSliceParseContext::allowNumber): Deleted.
(WebCore::BorderImageSliceParseContext::allowFill): Deleted.
(WebCore::BorderImageSliceParseContext::allowFinalCommit): Deleted.
(WebCore::BorderImageSliceParseContext::top): Deleted.
(WebCore::BorderImageSliceParseContext::commitNumber): Deleted.
(WebCore::BorderImageSliceParseContext::commitFill): Deleted.
(WebCore::BorderImageSliceParseContext::commitBorderImageSlice): Deleted.
(WebCore::CSSParser::parseBorderImageSlice): Deleted.
(WebCore::BorderImageQuadParseContext::BorderImageQuadParseContext): Deleted.
(WebCore::BorderImageQuadParseContext::allowNumber): Deleted.
(WebCore::BorderImageQuadParseContext::allowFinalCommit): Deleted.
(WebCore::BorderImageQuadParseContext::top): Deleted.
(WebCore::BorderImageQuadParseContext::commitNumber): Deleted.
(WebCore::BorderImageQuadParseContext::setAllowFinalCommit): Deleted.
(WebCore::BorderImageQuadParseContext::setTop): Deleted.
(WebCore::BorderImageQuadParseContext::commitBorderImageQuad): Deleted.
(WebCore::CSSParser::parseBorderImageQuad): Deleted.
(WebCore::CSSParser::parseBorderImageWidth): Deleted.
(WebCore::CSSParser::parseBorderImageOutset): Deleted.
(WebCore::CSSParser::parseBorderRadius): Deleted.
(WebCore::CSSParser::parseAspectRatio): Deleted.
(WebCore::CSSParser::parseCounter): Deleted.
(WebCore::parseDeprecatedGradientPoint): Deleted.
(WebCore::parseDeprecatedGradientColorStop): Deleted.
(WebCore::CSSParser::parseDeprecatedGradient): Deleted.
(WebCore::valueFromSideKeyword): Deleted.
(WebCore::parseGradientColorOrKeyword): Deleted.
(WebCore::CSSParser::parseDeprecatedLinearGradient): Deleted.
(WebCore::CSSParser::parseDeprecatedRadialGradient): Deleted.
(WebCore::CSSParser::parseLinearGradient): Deleted.
(WebCore::CSSParser::parseRadialGradient): Deleted.
(WebCore::CSSParser::parseGradientColorStops): Deleted.
(WebCore::CSSParser::isGeneratedImageValue): Deleted.
(WebCore::CSSParser::parseGeneratedImage): Deleted.
(WebCore::CSSParser::parseFilterImage): Deleted.
(WebCore::CSSParser::parseCrossfade): Deleted.
(WebCore::CSSParser::parseCanvas): Deleted.
(WebCore::CSSParser::parseNamedImage): Deleted.
(WebCore::CSSParser::parseImageResolution): Deleted.
(WebCore::CSSParser::parseImageSet): Deleted.
(WebCore::TransformOperationInfo::TransformOperationInfo): Deleted.
(WebCore::TransformOperationInfo::type): Deleted.
(WebCore::TransformOperationInfo::argCount): Deleted.
(WebCore::TransformOperationInfo::unit): Deleted.
(WebCore::TransformOperationInfo::unknown): Deleted.
(WebCore::TransformOperationInfo::hasCorrectArgCount): Deleted.
(WebCore::CSSParser::parseTransform): Deleted.
(WebCore::CSSParser::parseTransformValue): Deleted.
(WebCore::CSSParser::isBlendMode): Deleted.
(WebCore::CSSParser::isCompositeOperator): Deleted.
(WebCore::isValidPrimitiveFilterFunction): Deleted.
(WebCore::CSSParser::parseBuiltinFilterArguments): Deleted.
(WebCore::cssValueKeywordIDForFunctionName): Deleted.
(WebCore::CSSParser::parseFilter): Deleted.
(WebCore::validFlowName): Deleted.
(WebCore::CSSParser::isTextAutosizingEnabled): Deleted.
(WebCore::CSSParser::isCSSGridLayoutEnabled): Deleted.
(WebCore::CSSParser::parseFlowThread): Deleted.
(WebCore::CSSParser::parseRegionThread): Deleted.
(WebCore::CSSParser::parseTransformOrigin): Deleted.
(WebCore::CSSParser::parsePerspectiveOrigin): Deleted.
(WebCore::CSSParser::addTextDecorationProperty): Deleted.
(WebCore::CSSParser::parseTextDecoration): Deleted.
(WebCore::CSSParser::parseTextDecorationSkip): Deleted.
(WebCore::CSSParser::parseTextUnderlinePosition): Deleted.
(WebCore::CSSParser::parseTextEmphasisStyle): Deleted.
(WebCore::CSSParser::parseTextEmphasisPosition): Deleted.
(WebCore::CSSParser::parseTextIndent): Deleted.
(WebCore::CSSParser::parseHangingPunctuation): Deleted.
(WebCore::CSSParser::parseLineBoxContain): Deleted.
(WebCore::CSSParser::parseFontFeatureTag): Deleted.
(WebCore::CSSParser::parseFontFeatureSettings): Deleted.
(WebCore::CSSParser::parseFontVariationTag): Deleted.
(WebCore::CSSParser::parseFontVariationSettings): Deleted.
(WebCore::CSSParser::parseFontVariantLigatures): Deleted.
(WebCore::CSSParser::parseFontVariantNumeric): Deleted.
(WebCore::CSSParser::parseFontVariantEastAsian): Deleted.
(WebCore::CSSParser::parseFontVariant): Deleted.
(WebCore::isValidWillChangeAnimatableFeature): Deleted.
(WebCore::CSSParser::parseWillChange): Deleted.
(WebCore::CSSParser::parseCalculation): Deleted.
(WebCore::isCSSLetter): Deleted.
(WebCore::isCSSEscape): Deleted.
(WebCore::isURILetter): Deleted.
(WebCore::isIdentifierStartAfterDash): Deleted.
(WebCore::isCustomPropertyIdentifier): Deleted.
(WebCore::isEqualToCSSIdentifier): Deleted.
(WebCore::isEqualToCSSCaseSensitiveIdentifier): Deleted.
(WebCore::checkAndSkipEscape): Deleted.
(WebCore::skipWhiteSpace): Deleted.
(WebCore::CSSParserString::characters<LChar>): Deleted.
(WebCore::CSSParserString::characters<UChar>): Deleted.
(WebCore::CSSParser::currentCharacter<LChar>): Deleted.
(WebCore::CSSParser::currentCharacter<UChar>): Deleted.
(WebCore::CSSParser::currentCharacter16): Deleted.
(WebCore::CSSParser::tokenStart<LChar>): Deleted.
(WebCore::CSSParser::tokenStart<UChar>): Deleted.
(WebCore::CSSParser::currentLocation): Deleted.
(WebCore::CSSParser::isIdentifierStart): Deleted.
(WebCore::checkAndSkipString): Deleted.
(WebCore::CSSParser::parseEscape): Deleted.
(WebCore::CSSParser::UnicodeToChars<LChar>): Deleted.
(WebCore::CSSParser::UnicodeToChars<UChar>): Deleted.
(WebCore::CSSParser::parseIdentifierInternal): Deleted.
(WebCore::CSSParser::parseIdentifier): Deleted.
(WebCore::CSSParser::parseStringInternal): Deleted.
(WebCore::CSSParser::parseString): Deleted.
(WebCore::CSSParser::findURI): Deleted.
(WebCore::CSSParser::parseURIInternal): Deleted.
(WebCore::CSSParser::parseURI): Deleted.
(WebCore::CSSParser::parseUnicodeRange): Deleted.
(WebCore::CSSParser::parseNthChild): Deleted.
(WebCore::CSSParser::parseNthChildExtra): Deleted.
(WebCore::CSSParser::detectFunctionTypeToken): Deleted.
(WebCore::CSSParser::detectMediaQueryToken): Deleted.
(WebCore::CSSParser::detectNumberToken): Deleted.
(WebCore::CSSParser::detectDashToken): Deleted.
(WebCore::CSSParser::detectAtToken): Deleted.
(WebCore::CSSParser::detectSupportsToken): Deleted.
(WebCore::CSSParser::realLex): Deleted.
(WebCore::CSSParser::createImportRule): Deleted.
(WebCore::CSSParser::createMediaRule): Deleted.
(WebCore::CSSParser::createEmptyMediaRule): Deleted.
(WebCore::CSSParser::createSupportsRule): Deleted.
(WebCore::CSSParser::markSupportsRuleHeaderStart): Deleted.
(WebCore::CSSParser::markSupportsRuleHeaderEnd): Deleted.
(WebCore::CSSParser::popSupportsRuleData): Deleted.
(WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded): Deleted.
(WebCore::CSSParser::addNewRuleToSourceTree): Deleted.
(WebCore::CSSParser::popRuleData): Deleted.
(WebCore::CSSParser::syntaxError): Deleted.
(WebCore::CSSParser::isLoggingErrors): Deleted.
(WebCore::CSSParser::logError): Deleted.
(WebCore::CSSParser::createKeyframesRule): Deleted.
(WebCore::CSSParser::createStyleRule): Deleted.
(WebCore::CSSParser::createFontFaceRule): Deleted.
(WebCore::CSSParser::addNamespace): Deleted.
(WebCore::CSSParser::determineNameInNamespace): Deleted.
(WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded): Deleted.
(WebCore::CSSParser::rewriteSpecifiersWithElementName): Deleted.
(WebCore::CSSParser::rewriteSpecifiers): Deleted.
(WebCore::CSSParser::createPageRule): Deleted.
(WebCore::CSSParser::createSelectorVector): Deleted.
(WebCore::CSSParser::recycleSelectorVector): Deleted.
(WebCore::CSSParser::createRegionRule): Deleted.
(WebCore::CSSParser::createMarginAtRule): Deleted.
(WebCore::CSSParser::startDeclarationsForMarginBox): Deleted.
(WebCore::CSSParser::endDeclarationsForMarginBox): Deleted.
(WebCore::CSSParser::createKeyframe): Deleted.
(WebCore::CSSParser::invalidBlockHit): Deleted.
(WebCore::CSSParser::updateLastMediaLine): Deleted.
(WebCore::fixUnparsedProperties): Deleted.
(WebCore::CSSParser::fixUnparsedPropertyRanges): Deleted.
(WebCore::CSSParser::markRuleHeaderStart): Deleted.
(WebCore::CSSParser::setRuleHeaderEnd): Deleted.
(WebCore::CSSParser::markRuleHeaderEnd): Deleted.
(WebCore::CSSParser::markSelectorStart): Deleted.
(WebCore::CSSParser::markSelectorEnd): Deleted.
(WebCore::CSSParser::markRuleBodyStart): Deleted.
(WebCore::CSSParser::markRuleBodyEnd): Deleted.
(WebCore::CSSParser::markPropertyStart): Deleted.
(WebCore::CSSParser::markPropertyEnd): Deleted.
(WebCore::CSSParser::createViewportRule): Deleted.
(WebCore::CSSParser::parseViewportProperty): Deleted.
(WebCore::CSSParser::parseViewportShorthand): Deleted.
(WebCore::isAppleLegacyCSSPropertyKeyword): Deleted.
(WebCore::cssPropertyID): Deleted.
(WebCore::cssPropertyNameIOSAliasing): Deleted.
(WebCore::isAppleLegacyCSSValueKeyword): Deleted.
(WebCore::cssValueKeywordID): Deleted.
(WebCore::isValidNthToken): Deleted.
* css/parser/CSSParser.h:
(): Deleted.
(WebCore::CSSParser::ValueWithCalculation::ValueWithCalculation): Deleted.
(WebCore::CSSParser::ValueWithCalculation::value): Deleted.
(WebCore::CSSParser::ValueWithCalculation::operator CSSParserValue&): Deleted.
(WebCore::CSSParser::ValueWithCalculation::calculation): Deleted.
(WebCore::CSSParser::ValueWithCalculation::setCalculation): Deleted.
(WebCore::CSSParser::hasProperties): Deleted.
(WebCore::CSSParser::startNestedSelectorList): Deleted.
(WebCore::CSSParser::endNestedSelectorList): Deleted.
(WebCore::CSSParser::resetPropertyRange): Deleted.
(WebCore::CSSParser::isExtractingSourceData): Deleted.
(WebCore::CSSParser::lex): Deleted.
(WebCore::CSSParser::token): Deleted.
(WebCore::CSSParser::markViewportRuleBodyStart): Deleted.
(WebCore::CSSParser::markViewportRuleBodyEnd): Deleted.
(WebCore::CSSParser::setCustomPropertyName): Deleted.
(WebCore::CSSParser::is8BitSource): Deleted.
(WebCore::CSSParser::setStyleSheet): Deleted.
(WebCore::CSSParser::inStrictMode): Deleted.
(WebCore::CSSParser::inQuirksMode): Deleted.
(WebCore::CSSParser::setupParser): Deleted.
(WebCore::CSSParser::inShorthand): Deleted.
(WebCore::CSSParser::inViewport): Deleted.
(WebCore::CSSParser::operator|): Deleted.
(WebCore::CSSParser::validateUnit): Deleted.
(WebCore::ShorthandScope::ShorthandScope): Deleted.
(WebCore::ShorthandScope::~ShorthandScope): Deleted.
(WebCore::CSSParser::setTokenStart<LChar>): Deleted.
(WebCore::CSSParser::setTokenStart<UChar>): Deleted.
(WebCore::CSSParser::tokenStartOffset): Deleted.
(WebCore::CSSParser::currentCharacterOffset): Deleted.
(WebCore::CSSParser::tokenStartChar): Deleted.
(WebCore::isCustomPropertyName): Deleted.
(WebCore::cssyylex): Deleted.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setSelectorList):
(WebCore::destroy): Deleted.
(WebCore::CSSParserValueList::~CSSParserValueList): Deleted.
(WebCore::CSSParserValueList::addValue): Deleted.
(WebCore::CSSParserValueList::insertValueAt): Deleted.
(WebCore::CSSParserValueList::extend): Deleted.
(WebCore::CSSParserValueList::containsVariables): Deleted.
(WebCore::CSSParserValue::createCSSValue): Deleted.
(WebCore::CSSParserSelector::parsePseudoElementSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): Deleted.
(WebCore::CSSParserSelector::setPseudoClassValue): Deleted.
* css/parser/CSSParserValues.h:
(WebCore::CSSParserString::init): Deleted.
(WebCore::CSSParserString::clear): Deleted.
(WebCore::CSSParserString::is8Bit): Deleted.
(WebCore::CSSParserString::characters8): Deleted.
(WebCore::CSSParserString::characters16): Deleted.
(WebCore::CSSParserString::length): Deleted.
(WebCore::CSSParserString::setLength): Deleted.
(WebCore::CSSParserString::operator[]): Deleted.
(WebCore::CSSParserString::operator String): Deleted.
(WebCore::CSSParserString::operator AtomicString): Deleted.
(WebCore::CSSParserString::toStringView): Deleted.
(): Deleted.
(WebCore::CSSParserValueList::CSSParserValueList): Deleted.
(WebCore::CSSParserValueList::size): Deleted.
(WebCore::CSSParserValueList::currentIndex): Deleted.
(WebCore::CSSParserValueList::current): Deleted.
(WebCore::CSSParserValueList::next): Deleted.
(WebCore::CSSParserValueList::previous): Deleted.
(WebCore::CSSParserValueList::setCurrentIndex): Deleted.
(WebCore::CSSParserValueList::valueAt): Deleted.
(WebCore::CSSParserValueList::clear): Deleted.
(WebCore::CSSParserValue::setFromValueList): Deleted.
(WebCore::equalLettersIgnoringASCIICase): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::isCustomPropertyName):
(WebCore::cssPropertyNameIOSAliasing):
* css/parser/CSSPropertyParser.h:
* css/parser/SVGCSSParser.cpp: Removed.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::ensureSourceData):
(WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
* page/animation/AnimationController.cpp:
* rendering/style/RenderStyle.cpp:
* svg/SVGAnimateElementBase.cpp:
* svg/SVGAnimationElement.cpp:
* svg/SVGElement.cpp:
2016-12-10 Konstantin Tokarev <annulen@yandex.ru>
[cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
https://bugs.webkit.org/show_bug.cgi?id=165686
Reviewed by Michael Catanzaro.
This change reduces duplication of include path lists between modules,
and reduces future need for fixes like r209605 (broken build because of
WebCore header suddenly becoming used in WebKit2).
No new tests needed.
* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWinCairo.cmake:
2016-12-10 Ryosuke Niwa <rniwa@webkit.org>
Replace isUnclosedNode by isClosedShadowHidden
https://bugs.webkit.org/show_bug.cgi?id=165722
Reviewed by Antti Koivisto.
Replaced Node::isUnclosedNode by Node::isClosedShadowHidden and negated the semantics as done in the spec:
https://dom.spec.whatwg.org/#concept-closed-shadow-hidden
https://github.com/whatwg/dom/pull/306
Also added a version which follows the spec text for a debug assertion.
No new tests since this has no behavioral change.
* dom/EventContext.h:
(WebCore::EventContext::isUnreachableNode):
* dom/EventPath.cpp:
(WebCore::EventPath::computePathUnclosedToTarget):
(WebCore::RelatedNodeRetargeter::checkConsistency):
* dom/Node.cpp:
(WebCore::isClosedShadowHiddenUsingSpecDefinition): Added to assert our implementation matches the spec text.
(WebCore::Node::isClosedShadowHidden): Renamed from Node::isUnclosedNode and negated the return value.
* dom/Node.h:
2016-12-10 Antti Koivisto <antti@apple.com>
CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WTF::match_constness<WebCore::CSSValue, WebCore::CSSContentDistributionValue>::type& WTF::downcast<WebCore::CSSContentDistributionValue, WebCore::CSSValue> + 65
https://bugs.webkit.org/show_bug.cgi?id=165652
rdar://problem/28465278
Reviewed by Darin Adler.
No, test don't know how to get here.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertContentAlignmentData):
Add type checks.
2016-12-10 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] RSA algorithms should allow importing keys without usages
https://bugs.webkit.org/show_bug.cgi?id=165680
<rdar://problem/29601354>
Reviewed by Brent Fulgham.
Tests: crypto/subtle/rsa-oaep-import-jwk-public-key-empty-usages.html
crypto/subtle/rsa-oaep-import-spki-key-empty-usages.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-empty-usages.html
crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-empty-usages.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-empty-usages.html
crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-empty-usages.html
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
2016-12-10 Frederic Wang <fred.wang@free.fr>
Add STIX Two Math to the list of math fonts in mathml.css
https://bugs.webkit.org/show_bug.cgi?id=165676
Reviewed by Darin Adler.
No new tests, this is just changing default style.
* css/mathml.css:
(math):
2016-12-09 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableByteStreamController desiredSize
https://bugs.webkit.org/show_bug.cgi?id=165599
Reviewed by Darin Adler.
Implemented ReadableByteStreamController attribute desiredSize.
Added test to check desiredSize value.
* Modules/streams/ReadableByteStreamController.js:
(desiredSize):
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerGetDesiredSize):
2016-12-09 Ryosuke Niwa <rniwa@webkit.org>
document.pointerLockElement exposes a node inside a shadow tree
https://bugs.webkit.org/show_bug.cgi?id=165702
Reviewed by Simon Fraser.
Expose pointerLockElement on ShadowRoot as spec'ed (DocumentOrShadowRoot):
https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
Use ancestorElementInThisScope to find the correct node in pointerLockElement.
Tests: fast/shadow-dom/pointerlockelement-in-shadow-tree.html
fast/shadow-dom/pointerlockelement-in-slot.html
* dom/Document.cpp:
(WebCore::Document::pointerLockElement): Moved to TreeScope.
* dom/Document.h:
* dom/Document.idl: Moved ointerLockElement to DocumentOrShadowRoot.idl.
* dom/DocumentOrShadowRoot.idl: Ditto.
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedElementInScope): Use documentScope instead of acessing it via m_rootNode.
(WebCore::TreeScope::pointerLockElement): Moved from Document.
* dom/TreeScope.h:
2016-12-09 Daniel Bates <dabates@apple.com>
Add reflected nonce attribute to HTML Link element IDL
https://bugs.webkit.org/show_bug.cgi?id=165709
Reviewed by Ryosuke Niwa.
Add the reflected nonce attribute to the HTML Link element IDL definition
as per the HTML standard <https://html.spec.whatwg.org/multipage/semantics.html#the-link-element> (9 December 2016).
Test: fast/dom/nonce-attribute-reflection.html
* html/HTMLLinkElement.idl:
2016-12-09 Eric Carlson <eric.carlson@apple.com>
Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
https://bugs.webkit.org/show_bug.cgi?id=165251
Reviewed by Dean Jackson.
Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
No new tests, covered by existing tests.
* Modules/mediastream/MediaStreamEvent.idl: Add "EnabledAtRuntime".
* Modules/mediastream/NavigatorMediaDevices.idl: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Ditto.
* Modules/mediastream/RTCDTMFToneChangeEvent.idl: Ditto.
* Modules/mediastream/RTCIceCandidate.idl: Ditto.
* Modules/mediastream/RTCPeerConnection.idl: Ditto.
* Modules/mediastream/RTCRtpReceiver.idl: Ditto.
* Modules/mediastream/RTCRtpSender.idl: Ditto.
* Modules/mediastream/RTCRtpTransceiver.idl: Ditto.
* Modules/mediastream/RTCSessionDescription.idl: Ditto.
* Modules/mediastream/RTCTrackEvent.idl: Ditto.
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Set m_isMediaStreamEnabled in the
constructor instead of in reset() because the later is called by the Internals constructor,
making it impossible to override the runtime flag from WTR or DRT.
(WebCore::RuntimeEnabledFeatures::reset): Don't set m_isMediaStreamEnabled.
* page/Settings.in: Add peerConnectionEnabled.
2016-12-09 Daniel Bates <dabates@apple.com>
Remove QuickLook scheme from the list of secure schemes
https://bugs.webkit.org/show_bug.cgi?id=165699
Reviewed by Andy Estes.
Following r207155 we use a unique origin for QuickLook documents. Unique origins are not
subject to mixed content restrictions. Prior to r207155 QuickLook documents used the
origin from which they were served. We added the QuickLook scheme to the list of secure
schemes as a workaround to avoid mixed content errors when loading subresources in a
QuickLook document served over HTTPS. Now that we use a unique origin for QuickLook
documents we no longer need this workaround.
* platform/SchemeRegistry.cpp:
(WebCore::secureSchemes):
2016-12-09 Brady Eidson <beidson@apple.com>
Re-landing:
Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894
Reviewed by Alex Christensen.
No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).
With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
For icons the app decides to load, WebKit will pass the data to the app without storing locally.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::didGetLoadDecisionForIcon):
(WebCore::DocumentLoader::finishedLoadingIcon):
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(WebCore::LinkIcon::encode):
(WebCore::LinkIcon::decode):
2016-12-06 Jiewen Tan <jiewen_tan@apple.com>
[Part 2 of 2] Add support for PKCS8 format while doing SubtleCrypto.importKey/exportKey
https://bugs.webkit.org/show_bug.cgi?id=129978
<rdar://problem/21799829>
Reviewed by Brent Fulgham.
This is part 2 of Bug 129978. In this patch, it adds the PKCS8 format support for
SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
RSASSA-PKCS1-v1_5 and RSA-OAEP.
Tests: crypto/subtle/rsa-import-jwk-key-export-pkcs8-key.html
crypto/subtle/rsa-import-pkcs8-key-export-jwk-key.html
crypto/subtle/rsa-import-pkcs8-key-export-pkcs8-key.html
crypto/subtle/rsa-oaep-generate-export-key-pkcs8.html
crypto/subtle/rsa-oaep-import-pkcs8-key.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-pkcs8.html
crypto/subtle/rsaes-pkcs1-v1_5-import-pkcs8-key.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-pkcs8.html
crypto/subtle/rsassa-pkcs1-v1_5-import-pkcs8-key.html
crypto/workers/subtle/rsa-export-pkcs8-key.html
crypto/workers/subtle/rsa-import-pkcs8-key.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toKeyData):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportPkcs8):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportPkcs8):
2016-12-09 Geoffrey Garen <ggaren@apple.com>
Deploy OrdinalNumber in JSC::SourceCode
https://bugs.webkit.org/show_bug.cgi?id=165687
Reviewed by Michael Saboff.
Updated for interface changes.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::startLine):
2016-12-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Some resources fetched via Fetch API do not have data
https://bugs.webkit.org/show_bug.cgi?id=165230
<rdar://problem/29449220>
Reviewed by Alex Christensen.
Tests: http/tests/inspector/network/fetch-response-body.html
http/tests/inspector/network/xhr-response-body.html
* platform/network/ResourceRequestBase.h:
Distinguish Fetch requests.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
Set the requester type as Fetch.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
* loader/DocumentThreadableLoader.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponseImpl):
(WebCore::InspectorInstrumentation::didReceiveXHRResponseImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didReceiveResourceResponse):
(WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
(WebCore::InspectorInstrumentation::didReceiveXHRResponse): Deleted.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveThreadableLoaderResponse):
(WebCore::InspectorNetworkAgent::didFinishXHRLoading):
(WebCore::InspectorNetworkAgent::didReceiveXHRResponse): Deleted.
Add a generic way for a ThreadableLoader load to update the type of a network request.
This will include both XHR and Fetch requests.
* inspector/InspectorPageAgent.cpp:
(WebCore::hasTextContent):
(WebCore::createXHRTextDecoder):
(WebCore::InspectorPageAgent::resourceTypeJson):
(WebCore::InspectorPageAgent::cachedResourceType):
(WebCore::InspectorPageAgent::createTextDecoder):
(WebCore::textContentForCachedResource):
* inspector/InspectorPageAgent.h:
* inspector/NetworkResourcesData.cpp:
(WebCore::createOtherResourceTextDecoder): Deleted.
Share the logic that creates a Text Decoders for XHR with other non-buffered requests
(like Fetch). This moves us to identical behavior for now.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedJSONMIMEType):
(WebCore::MIMETypeRegistry::isTextMIMEType):
* platform/MIMETypeRegistry.h:
Better detect different JSON content based on MIME Type.
2016-12-09 Ryosuke Niwa <rniwa@webkit.org>
document.webkitFullscreenElement leaks elements inside a shadow tree
https://bugs.webkit.org/show_bug.cgi?id=158471
Reviewed by Chris Dumez.
Fixed the bug by calling the newly added ancestorElementInThisScope in webkitCurrentFullScreenElementForBindings
and webkitFullscreenElementForBinding.
The specification (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement) uses "the result of
retargeting fullscreen element" and returns null if the result is not in the same tree as the context object.
This is equivalent to the algorithm implemented by ancestorElementInThisScope. Observe that the retargeting
algorithm (https://dom.spec.whatwg.org/#retarget) finds the lowest common tree scope of the retargetee and
the context object. There are two cases to consider.
1. The context object's tree scope is the lowest common tree scope: In this case, an ancestor shadow host or
the retargetee itself is in this tree scope. It's sufficient traverse every shadow host to find the one that
resides in the same tree scope as the context object. This is precisely what ancestorElementInThisScope does.
2. The context object's tree scope is not the lowest common tree scope: In this case, the context object is
inside a shadow tree whose ancestor shadow host is in the lowest common tree scope. In this case, retargeting
algorithm finds a node which is not in the same tree as the context object. Thus, the result is null.
ancestorElementInThisScope traveres ancestor shadow hosts and returns null if no shadow host's tree scope
matches that of the context object's tree scope. Thus, it would return null in this case as desired.
Also renamed TreeScope::focusedElement to focusedElementInScope for clarity since Document which inherits
from TreeScope also has a distinct member function named focusedElement called by TreeScope::focusedElement,
and used ancestorElementInThisScope since it uses the same algorithm.
Tests: fast/shadow-dom/activeElement-for-focused-element-in-another-shadow.html
fast/shadow-dom/blur-on-shadow-host-with-focused-shadow-content.html
fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html
fast/shadow-dom/fullscreen-in-shadow-webkitCurrentFullScreenElement.html
fast/shadow-dom/fullscreen-in-slot-fullscreenElement.html
fast/shadow-dom/fullscreen-in-slot-webkitCurrentFullScreenElement.html
* dom/Document.cpp:
(WebCore::Document::removeFocusedNodeOfSubtree):
(WebCore::Document::activeElement):
* dom/Document.h:
(WebCore::Document::webkitCurrentFullScreenElementForBindings): Added.
(WebCore::Document::webkitFullscreenElementForBindings): Added.
* dom/Document.idl:
* dom/Element.cpp:
(WebCore::Element::blur):
* dom/ShadowRoot.h:
(WebCore::ShadowRoot::activeElement):
* dom/TreeScope.cpp:
(WebCore::TreeScope::ancestorNodeInThisScope): Renamed from ancestorInThisScope for clarity.
(WebCore::TreeScope::ancestorElementInThisScope):
(WebCore::TreeScope::focusedElementInScope): Renamed from focusedElement to disambiguate it from Document's
focusedElement.
* dom/TreeScope.h:
* editing/VisibleSelection.cpp:
(WebCore::adjustPositionForEnd):
(WebCore::adjustPositionForStart):
* editing/htmlediting.cpp:
(WebCore::comparePositions):
(WebCore::firstEditablePositionAfterPositionInRoot):
(WebCore::lastEditablePositionBeforePositionInRoot):
* page/DOMSelection.cpp:
(WebCore::selectionShadowAncestor):
(WebCore::DOMSelection::shadowAdjustedNode):
(WebCore::DOMSelection::shadowAdjustedOffset):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::addNodeToRectBasedTestResult): Added a FIXME here since this is clearly wrong for
shadow trees created by author scripts.
2016-12-09 Geoffrey Garen <ggaren@apple.com>
TextPosition and OrdinalNumber should be more like idiomatic numbers
https://bugs.webkit.org/show_bug.cgi?id=165678
Reviewed by Filip Pizlo.
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::sourcePosition):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::JSLazyEventListener):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::eventHandlerPosition):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::create):
* dom/ScriptElement.h:
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::uninitializedPositionValue1):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo): Adopt
default construtor.
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::XMLErrors):
(WebCore::XMLErrors::handleError):
* xml/XMLErrors.h: Use std::optional instead of belowRangePosition()
because in-band signaling is harder to reason about.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::textPosition): Adopt default constructor.
2016-12-09 Chris Dumez <cdumez@apple.com>
[Cocoa] Validation message for required checkbox doesn’t conform the the Apple Style Guide
https://bugs.webkit.org/show_bug.cgi?id=165661
Reviewed by Dan Bernstein.
Update validation message as per Apple Style Guide.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::validationMessageValueMissingForCheckboxText):
2016-12-09 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: !beforeChild->isRubyRun() in WebCore::RenderRubyAsBlock::addChild
https://bugs.webkit.org/show_bug.cgi?id=141433
<rdar://problem/27711351>
Reviewed by Dean Jackson.
Do not try to inject the list marker into a block ruby subtree. Have it as the sibling
of the ruby instead (with an anonymous block wrapper ofc).
Test: fast/ruby/assert-with-listitem-and-block-ruby.html
* rendering/RenderListItem.cpp:
(WebCore::getParentOfFirstLineBox):
2016-12-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Implement the pageScaleFactor property
https://bugs.webkit.org/show_bug.cgi?id=165660
Reviewed by Dean Jackson.
We implement the pageScaleFactor property on MediaController. This property is set
by the HTMLMediaElement when the page scale factor changes, and we only choose to handle
it on iOS by setting controlsDependOnPageScaleFactor to true on the MediaControlsHost.
To do so, we now size the media controls by multiplying the layout size of the media by
the page scale factor, and apply an inverse CSS zoom on the media controls themselves.
Test: media/modern-media-controls/media-controller/media-controller-scale-factor.html
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container,):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get scaleFactor):
(MediaControls.prototype.set scaleFactor):
(MediaControls.prototype.commitProperty):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.set pageScaleFactor):
(MediaController.prototype._updateControlsSize):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::setControllerJSProperty):
We no longer hit a JSC assertion when trying to set the pageScaleFactor property before
the JS controller was actually created.
2016-12-09 Daniel Bates <dabates@apple.com>
Attempt to fix the Mac CMake build following <http://trac.webkit.org/changeset/209549>
(https://bugs.webkit.org/show_bug.cgi?id=165572)
Add directory html/canvas to the list of forwarding headers directories so that
the Legacy WebKit Objective-C DOM binding DOMHTMLCanvasElement.mm can ultimately
include header WebGLContextAttributes.h.
* PlatformMac.cmake:
2016-12-09 Brady Eidson <beidson@apple.com>
LinkIconCollector refactoring.
https://bugs.webkit.org/show_bug.cgi?id=165657
Reviewed by Dean Jackson.
No new tests (Refactor, no behavior change)
* WebCore.xcodeproj/project.pbxproj:
* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:
* platform/LinkIcon.h: Move outside of LinkIconCollector for future expandability.
2016-12-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r209574.
This change broke the Windows build.
Reverted changeset:
"[WebIDL] Remove custom bindings for Geolocation"
https://bugs.webkit.org/show_bug.cgi?id=165625
http://trac.webkit.org/changeset/209574
2016-12-09 Ryosuke Niwa <rniwa@webkit.org>
Custom Elements from a different document are not customized when created with innerHTML
https://bugs.webkit.org/show_bug.cgi?id=165617
Reviewed by Antti Koivisto.
The bug was caused by a superflous null check on window in createHTMLElementOrFindCustomElementInterface.
Removed the nullcheck to fix the bug.
Test: fast/custom-elements/adopting-from-frameless-document.html
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2016-12-09 Daniel Bates <dabates@apple.com>
[CSP] Policy of window opener not applied to about:blank window
https://bugs.webkit.org/show_bug.cgi?id=165531
<rdar://problem/29426639>
Reviewed by Brent Fulgham.
Fixes an issue where the content security policy of the opener document was not applied to
an about:blank window.
An about:blank window inherits its security origin from its opener document. It should also
copy (inherit) the ContentSecurityPolicy from its opener document. When copying the ContentSecurityPolicy
state from the opener document to the about:blank document we must take care to avoid copying
any upgrade-insecure-request directive because new windows should not inherit it by definition.
With respect to upgrade-insecure-requests, new windows should only inherit the insecure navigation set
from their opener document.
Test: http/tests/security/contentSecurityPolicy/image-blocked-in-about-blank-window.html
* dom/Document.cpp:
(WebCore::Document::initContentSecurityPolicy): Copy the ContentSecurityPolicy state from the
owner document to this document when it inherits its security origin from its owner. An about:blank
window is one example of a document that inherits its security origin from its owner.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
to copy the upgrade insecure requests state from the owner document to the worker now that
ContentSecurityPolicy::copyStateFrom() no longer does this.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom): Do not copy the upgrade insecure request state.
Callers are now responsible for calling ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
to copy this state.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::parse): Ignore directive upgrade-insecure-requests when
inheriting ContentSecurityPolicy state as this directive as the Upgrade Insecure Requests feature has
its own inheritance semantics that differ from the semantics of copying a ContentSecurityPolicy object.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
to copy the upgrade insecure requests state from the original document to the transformed document now
that ContentSecurityPolicy::copyStateFrom() no longer does this.
2016-12-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Remaining time label first appears way to the left
https://bugs.webkit.org/show_bug.cgi?id=165637
Reviewed by Dean Jackson.
We would sometimes see the remaining time label be laid out in an incorrect position
when a video would start playing. This happened because the time label was being committed
from a previous value before, in the same frame, we would call the layout() function
of MacOSInlineMediaControls. This would set the newly computed location for the
remaining time label, but because we would reset the list of dirty properties after
calling all layout functions, the new value set in MacOSInlineMediaControls.layout()
would be disregarded and the wrong, committed value would persist until it was reset
in a much later frame.
We now correctly clear the list of dirty nodes before laying them out, giving all nodes
a chance to become dirty again during layout, and updated again in the next frame.
Test: media/modern-media-controls/layout-node/node-made-dirty-during-layout.html
* Modules/modern-media-controls/controls/layout-node.js:
(performScheduledLayout):
2016-12-09 Per Arne Vollan <pvollan@apple.com>
Fix compile errors on Windows when building with .proj files.
Unreviewed build fix.
Fix include paths.
* platform/graphics/win/IntPointWin.cpp:
* platform/graphics/win/IntRectWin.cpp:
* platform/graphics/win/IntSizeWin.cpp:
2016-12-09 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed buildfix after r209570.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2016-12-01 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Pass Grid as argument to items' placement methods
https://bugs.webkit.org/show_bug.cgi?id=165250
Reviewed by Darin Adler.
In order to constify computeIntrinsicLogicalWidths() it is required to constify
placeItemsOnGrid() first, which is the base method of the grid items' positioning logic. The
first step is to constify all the methods invoked by the latter, which basically means to
pass the Grid as argument to all of them instead of directly using the m_grid attribute from
RenderGrid. As this is an intermediate step, a new const_cast<> was required in the
intrinsic size computation. However it will be promptly removed after the const-ification of
placeItemsOnGrid().
After this, only the methods used by the track sizing algorithm will directly access
m_grid. All those would get a reference to the Grid via GridSizingData, but that's a matter
of a follow up patch.
Apart from that, m_gridIsDirty was removed because it was always too confusing. It was
replaced by Grid's m_needsItemsPlacement which is much more concise. The clearGrid() call
was indeed only forcing a new placement of the grid items.
No new tests as this is a refactoring.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::setNeedsItemsPlacement): New method to flag the Grid whenever
grid items' placement algorithm needs to be run.
(WebCore::RenderGrid::canPerformSimplifiedLayout):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Constified. Got Grid as
argument.
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid): Ditto.
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
(WebCore::RenderGrid::clearGrid):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::numTracks):
* rendering/RenderGrid.h:
2016-12-09 Gavin Barraclough <barraclough@apple.com>
Revert - Add _WKIconLoadingDelegate SPI
https://bugs.webkit.org/show_bug.cgi?id=164894
Unreviewed rollout due to performance regression.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading): Deleted.
(WebCore::DocumentLoader::didGetLoadDecisionForIcon): Deleted.
(WebCore::DocumentLoader::finishedLoadingIcon): Deleted.
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* platform/LinkIcon.h: Removed.
2016-12-08 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Remove NoInterfaceObject attribute from SubtleCrypto Interface
https://bugs.webkit.org/show_bug.cgi?id=165629
<rdar://problem/29586203>
Reviewed by Chris Dumez.
Covered by existing tests.
* crypto/SubtleCrypto.idl:
2016-12-08 Keith Rollin <krollin@apple.com>
FileHandle::printf doesn't build on Windows
https://bugs.webkit.org/show_bug.cgi?id=165642
Reviewed by Ryosuke Niwa.
Fix the build -- vasprintf does not exist on Windows, so make
FileHandle::printf a no-op on that platform.
No new tests -- affected facility is currently only used in testing
code and is not user reachable.
* platform/FileHandle.cpp:
(WebCore::FileHandle::printf):
2016-12-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Exiting fullscreen with paused media shows the start button
https://bugs.webkit.org/show_bug.cgi?id=165640
Reviewed by Dean Jackson.
Like all supporting objects, the StartSupport instance gets recreated when creating controls
for new layout traits, which happens when going from fullscreen to inline. Due to this, the
"_isPlayed" property is not longer set to true, even if the media has played prior to being
paused in fullscreen. We now also check the media's played range to identify whether media
has been played.
* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype._shouldShowStartButton):
(StartSupport):
2016-12-08 Myles C. Maxfield <mmaxfield@apple.com>
ASSERTION FAILED: locale in WebCore::lastHyphenLocation
https://bugs.webkit.org/show_bug.cgi?id=164182
Reviewed by Zalan Bujtas.
Our hyphenation code assumes the locale is in a small set of known locales.
However, web content can put whatever string it wants in the locale field.
Test: fast/text/hyphenation-unknown-locale.html
* platform/text/cf/HyphenationCF.cpp:
(WebCore::lastHyphenLocation):
* rendering/RenderText.cpp:
(WebCore::maxWordFragmentWidth): When computing the minimum preferred width of
an element, we want to know the size of the widest nonbreakable unit. When
hyphenation is enabled, we have to measure the width of each fragment of each
word (where "fragment" is determined by a substring between two successive
hyphenation points, appended with a hyphen character). A hyphenation point at
string offset 0 is irrelevant for this purpose, because it would lead to an
empty fragment. Therefore, skip this situation.
2016-12-08 David Kilzer <ddkilzer@apple.com>
Always check the return value of pthread_key_create()
<https://webkit.org/b/165274>
Reviewed by Darin Adler.
* platform/ios/wak/WebCoreThread.mm:
(InitThreadContextKey): Call CRASH() if pthread_key_create()
returns an error. The error code will be stored in a register
available in a crash log, so no need to log the value
explicitly.
2016-12-08 Alex Christensen <achristensen@webkit.org>
Reduce PassRefPtr use in platform/graphics
https://bugs.webkit.org/show_bug.cgi?id=165636
Reviewed by Dean Jackson.
No change in behavior.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
(WebCore::DisplayRefreshMonitorMac::create):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createForCurrentGLContext):
(WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
2016-12-08 Keith Rollin <krollin@apple.com>
Move FileHandle to WebCore FileHandle.h
https://bugs.webkit.org/show_bug.cgi?id=165562
Reviewed by Alex Christensen.
Add FileHandle, a small wrapper around FileSystem facilities to manage
the lifetime of an open file and give the facilities a C++ interface.
No new tests -- affected facility is currently only used in testing
code and is not user reachable.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/FileHandle.cpp: Added.
(WebCore::FileHandle::FileHandle):
(WebCore::FileHandle::~FileHandle):
(WebCore::FileHandle::operator=):
(WebCore::FileHandle::operator bool):
(WebCore::FileHandle::open):
(WebCore::FileHandle::read):
(WebCore::FileHandle::write):
(WebCore::FileHandle::printf):
(WebCore::FileHandle::close):
* platform/FileHandle.h: Added.
2016-12-07 Ryosuke Niwa <rniwa@webkit.org>
ASSERTION FAILED: m_items.isEmpty() in CustomElementReactionQueue destructor
https://bugs.webkit.org/show_bug.cgi?id=162029
<rdar://problem/28945851>
Reviewed by Chris Dumez.
The bug was caused by Document::removedLastRef enqueuing disconnectedCallback during a tear down.
Don't enqueue a disconnectedCallback while a document is getting torn down since that should not be
observable to author scripts. The connected, adopted, and attributeChanged callbacks are immune from
this problem since they don't happen during a document destruction.
Note that this was also the case prior to this patch since the disconnectedCallback would have been
added to the current CustomElementReactionQueue which will be destructed without invoking callbacks
(or hit a release assertion added in r208785 and r209426 for now).
Tests: fast/custom-elements/disconnected-callback-in-detached-iframe.html
fast/custom-elements/element-queue-during-document-destruction.html
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Added an assertion that
document's refCount hasn't reached zero yet.
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Fixed the bug.
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added the same assertion.
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
2016-12-08 Daniel Bates <dabates@apple.com>
Add Strict Mixed Content Checking and Upgrade Insecure Requests to WebKit Feature Status dashboard
https://bugs.webkit.org/show_bug.cgi?id=165635
Rubber-stamped by Ryosuke Niwa.
* features.json:
2016-12-08 Daniel Bates <dabates@apple.com>
Implement Strict Mixed Content Checking
https://bugs.webkit.org/show_bug.cgi?id=165438
<rdar://problem/26103867>
Reviewed by Brent Fulgham and Andy Estes.
Add support for the CSP directive block-all-mixed-content to enable strict mixed content checking
as per <https://www.w3.org/TR/2016/CR-mixed-content-20160802/#strict-checking> (2 August 2016).
Currently WebKit only blocks blockable content as such content can contaminate the security origin
that loaded it. Optionally-blockable content, including images, would be allowed to load as mixed
content. When strict mixed content checking is enabled all mixed content is blocked. That is, both
blockable and optionally-blockable content will be blocked. A web site can opt into strict mixed
content checking by adding the directive block-all-mixed-content to their content security policy.
Tests: http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/duplicate-directive.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-blob-url-iframe-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe.html
http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe.html
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Inherit strict mixed content checking mode from parent document.
* dom/SecurityContext.h:
(WebCore::SecurityContext::isStrictMixedContentMode): Added.
(WebCore::SecurityContext::setStrictMixedContentMode): Added.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Check mixed content policy with respect to the current frame.
The document in the current frame may have opted into strict mixed content checking or inherited it from
its parent document.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin): Inherit the strict mixed content checking mode from the owner document
when loading a JavaScript URL in a frame (e.g. <iframe src="javascript:...">) because such URLs inherit
the security origin of their parent document.
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::canDisplayInsecureContent): Check the content security policy of the document
and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
strict mode. Block display of insecure content when in strict mode. Modified to take enum AlwaysDisplayInNonStrictMode (defaults
to AlwaysDisplayInNonStrictMode::No) as to whether to allow our current relaxed behavior of displaying insecure
content in non-strict mode.
(WebCore::MixedContentChecker::canRunInsecureContent): Check the content security policy of the document
and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
strict mode. Block running of insecure content when in strict mode.
* loader/MixedContentChecker.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::checkInsecureContent): Always check mixed content policy with respect to
the current frame. The document in the current frame may have opted into strict mixed content checking or
inherited it from its parent document. Also renamed a local variable f to frame to better describe its
purpose.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Added. Iterate through all the
policies and report violations with respect to policies that have directive block-all-mixed-content.
(WebCore::ContentSecurityPolicy::didReceiveHeader): Move logic to set eval() error message from here...
(WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): ...to here so that we only perform
it once we are ready to apply the CSP policy to the script execution context. Additionally, enable
strict mixed content checking on the script execution context if applicable.
(WebCore::ContentSecurityPolicy::reportViolation): Added overrides that take a string and a directive list
object (ContentSecurityPolicyDirectiveList) for the effective violated directive and its associated directive
list, respectively. We make use of these overrides so as to support reporting block-all-mixed-content
violations, which are not implemented using a ContentSecurityPolicyDirective object as it seemed sufficient
to implement it as a boolean on ContentSecurityPolicyDirectiveList.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::setBlockAllMixedContentEnabled): Added.
(WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the directive block-all-mixed-content.
* page/csp/ContentSecurityPolicyDirectiveList.h:
(WebCore::ContentSecurityPolicyDirectiveList::hasBlockAllMixedContentDirective): Added.
* page/csp/ContentSecurityPolicyDirectiveNames.cpp:
* page/csp/ContentSecurityPolicyDirectiveNames.h: Add constant for "block-all-mixed-content".
2016-12-08 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for Geolocation
https://bugs.webkit.org/show_bug.cgi?id=165625
Reviewed by Alex Christensen.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add/remove files.
* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::GeoNotifier):
(WebCore::GeoNotifier::hasZeroTimeout):
(WebCore::GeoNotifier::startTimerIfNeeded):
* Modules/geolocation/GeoNotifier.h:
(WebCore::GeoNotifier::create):
(WebCore::GeoNotifier::options):
Update to store PositionOptions as a value, and pass the PositionCallback
as a Ref, rather than a RefPtr, since it is not optional.
* Modules/geolocation/Geolocation.cpp:
(WebCore::createGeoposition):
Use auto, to get the good type for Coordinates (Ref).
(WebCore::Geolocation::getCurrentPosition):
(WebCore::Geolocation::watchPosition):
(WebCore::Geolocation::haveSuitableCachedPosition):
(WebCore::Geolocation::startUpdating):
* Modules/geolocation/Geolocation.h:
Update to pass PositionOptions itself now that it is a plain struct.
* Modules/geolocation/Geolocation.idl:
Remove [Custom] extended attribute and add FIXME about nullable annotation.
* Modules/geolocation/Geoposition.h:
Pass/store Coordinates as a Ref.
* Modules/geolocation/PositionOptions.h:
Convert to be a simple struct.
* Modules/geolocation/PositionOptions.idl:
Added.
* bindings/js/JSGeolocationCustom.cpp:
Removed.
2016-12-08 Alex Christensen <achristensen@webkit.org>
REGRESSION (URL parser): Relative URLs aren’t resolved correctly when the base URL is an applewebdata: URL
https://bugs.webkit.org/show_bug.cgi?id=165621
Reviewed by Dan Bernstein.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
URLs with nonspecial schemes and no slash after the host get no slash as the path to maintain compatibility with all browsers.
This was proposed to the URL spec in https://github.com/whatwg/url/issues/148
When such as URL is used as a base URL with a relative path, in order to maintain compatibility with URL::parse we need to prepend
a slash to the path. For completeness I added tests with a relative path, a relative query, a relative fragment, and a relative empty string,
and because the fate of the spec is unclear in this case, I decided to maintain compatibility with URL::parse in all these cases.
2016-12-06 Filip Pizlo <fpizlo@apple.com>
Concurrent GC should be stable enough to land enabled on X86_64
https://bugs.webkit.org/show_bug.cgi?id=164990
Reviewed by Geoffrey Garen.
Made WebCore down with concurrent marking by adding some locking and adapting to some new API.
This has new test modes in run-sjc-stress-tests. Also, the way that LayoutTests run is already
a fantastic GC test.
* ForwardingHeaders/heap/DeleteAllCodeEffort.h: Added.
* ForwardingHeaders/heap/LockDuringMarking.h: Added.
* bindings/js/GCController.cpp:
(WebCore::GCController::deleteAllCode):
(WebCore::GCController::deleteAllLinkedCode):
* bindings/js/GCController.h:
* bindings/js/JSDOMBinding.cpp:
(WebCore::getCachedDOMStructure):
(WebCore::cacheDOMStructure):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
(WebCore::getDOMConstructor):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::DeferredPromise):
(WebCore::DeferredPromise::clear):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren):
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
(WebCore::EventListenerMap::replace):
(WebCore::EventListenerMap::add):
(WebCore::EventListenerMap::remove):
(WebCore::EventListenerMap::find):
(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
(WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
(WebCore::EventListenerIterator::EventListenerIterator):
* dom/EventListenerMap.h:
(WebCore::EventListenerMap::lock):
* dom/EventTarget.cpp:
(WebCore::EventTarget::visitJSEventListeners):
* dom/EventTarget.h:
(WebCore::EventTarget::visitJSEventListeners): Deleted.
* dom/Node.cpp:
(WebCore::Node::eventTargetDataConcurrently):
(WebCore::Node::ensureEventTargetData):
(WebCore::Node::clearEventTargetData):
* dom/Node.h:
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
(WebCore::registerMemoryReleaseNotifyCallbacks):
2016-12-08 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add strict checking for right parens to selector functions like :matches, :not etc.
https://bugs.webkit.org/show_bug.cgi?id=165624
Reviewed by Dean Jackson.
Unskipped fast/selectors/invalid-functional-pseudo-class.html.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Bail if we don't actually consume a right parenthesis.
2016-12-08 Jeremy Jones <jeremyj@apple.com>
Exit fullscreen on escape key down, not up.
https://bugs.webkit.org/show_bug.cgi?id=165618
rdar://problem/29581688
This problem was introduced by https://bugs.webkit.org/show_bug.cgi?id=165416
The fix to only exit fullscreen on key down, not key up.
Reviewed by Jer Noble.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
2016-12-08 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Unskip background parsing tests
https://bugs.webkit.org/show_bug.cgi?id=165619
Reviewed by Zalan Bujtas.
Change background-position so that the origin being set is tracked
on a per-x/y basis instead of as a single boolean. The single boolean
caused lousy computed style dumping, since we would switch into verbose
mode for both x and y, even if only one of them had a pair set for it.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createPositionListForLayer):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponent):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
(WebCore::FillLayer::operator=):
(WebCore::FillLayer::fillUnsetProperties):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::isBackgroundXOriginSet):
(WebCore::FillLayer::isBackgroundYOriginSet):
(WebCore::FillLayer::setBackgroundXOrigin):
(WebCore::FillLayer::setBackgroundYOrigin):
(WebCore::FillLayer::clearXPosition):
(WebCore::FillLayer::clearYPosition):
(WebCore::FillLayer::isBackgroundOriginSet): Deleted.
2016-12-08 Jeremy Jones <jeremyj@apple.com>
pointer lock should exit when a js alert is shown
https://bugs.webkit.org/show_bug.cgi?id=165423
rdar://problem/29430803
Reviewed by Jer Noble.
Test: pointer-lock/lock-lost-on-alert.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirm):
(WebCore::DOMWindow::prompt):
2016-12-07 Sam Weinig <sam@webkit.org>
[WebIDL] WebGLContextAttributes should be a dictionary
https://bugs.webkit.org/show_bug.cgi?id=165572
Reviewed by Dean Jackson.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove unused files.
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
(WebCore::attributesFor3DContext): Deleted.
Re-work getContext to use JSDOMConvert and use the WebGLContextAttributes dictionary.
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add missing inclusion of dictionaries.
* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::is2dType):
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::shouldEnableWebGL):
(WebCore::HTMLCanvasElement::is3dType):
(WebCore::HTMLCanvasElement::getContextWebGL):
* html/HTMLCanvasElement.h:
Refactor context creation of 2d and WebGL contexts into their own functions. Make the
WebGL one take a WebGLContextAttributes struct.
* html/HTMLCanvasElement.idl:
No functionality change. Make IDL match the latest spec.
* html/canvas/CanvasContextAttributes.cpp: Removed.
* html/canvas/CanvasContextAttributes.h: Removed.
Remove unneeded base class.
* html/canvas/WebGLContextAttributes.cpp: Removed.
* html/canvas/WebGLContextAttributes.h:
Instead of a class, we can use a type alias of GraphicsContext3D::Attributes for
WebGLContextAttributes.
* html/canvas/WebGLContextAttributes.idl:
Convert to a dictionary.
* html/canvas/WebGL2RenderingContext.cpp:
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::clearIfComposited):
(WebCore::WebGLRenderingContextBase::getContextAttributes):
(WebCore::WebGLRenderingContextBase::applyStencilTest):
* html/canvas/WebGLRenderingContextBase.h:
Update to WebGLContextAttributes by value, since it is a simple struct now. Update getContextAttributes
to return a std::optional<WebGLContextAttributes>.
* html/canvas/WebGLRenderingContextBase.idl:
Make getContextAttributes return a nullable WebGLContextAttributes, as per spec.
* platform/graphics/GraphicsContext3D.h:
Sort attributes into categories, one that match WebGLContextAttributes, and the remainder.
2016-12-08 Zalan Bujtas <zalan@apple.com>
Do not create multicolumn context for certain type of renderers.
https://bugs.webkit.org/show_bug.cgi?id=135601
<rdar://problem/27686300>
Reviewed by David Hyatt.
Certain type of renderers including forms should not initialize multicolumn context for
their inner (shadow) content. It just does not makes sense and is inline with what other browsers do.
Test: fast/multicol/no-multicol-for-textareas.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns):
(WebCore::RenderBlockFlow::requiresColumns):
* rendering/RenderBlockFlow.h:
2016-12-08 Dave Hyatt <hyatt@apple.com>
[CSS Parser] REGRESSION: Values of 0 should not be allowed for -webkit-aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=165607
Reviewed by Simon Fraser.
Unskipped fast/css/aspect-ratio-parsing-tests.html.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitAspectRatio):
Don't allow 0 as either the left or right value of the ratio.
2016-12-08 Antti Koivisto <antti@apple.com>
::after and ::before don't work on :host
https://bugs.webkit.org/show_bug.cgi?id=164675
<rdar://problem/29231874>
Reviewed by Andreas Kling.
We didn't allow combining :host with any other selectors. Pseudo elements should be allowed.
Test: fast/shadow-dom/shadow-host-with-before-after.html
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):
Allow pseudo element matching.
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
Use the normal collectMatchingRulesForList path instead of a direct call to SelectorChecker::matchHostPseudoClass.
This path supports pseudo elements.
Pass the information that we are matching :host rules with m_isMatchingHostPseudoClass bit
similarly to how this is done with slots.
(WebCore::ElementRuleCollector::ruleMatches):
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:
Collect :host rules similarly to other rules.
(WebCore::RuleSet::addRule):
* css/SelectorChecker.cpp:
Rename didMoveToShadowHost->mayMatchHostPseudoClass for clarity.
(WebCore::SelectorChecker::match):
Enable :host matching in the current context immediately if needed.
(WebCore::SelectorChecker::matchHostPseudoClass):
The check for illegal combinations with :host is now done in checkOne().
(WebCore::localContextForParent):
(WebCore::SelectorChecker::checkOne):
In context where :host matches nothing else can match, except pseudo elements.
* css/SelectorChecker.h:
2016-12-08 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
Add PerformanceLoggingCocoa.mm after r209181.
2016-12-08 Per Arne Vollan <pvollan@apple.com>
[Win] Some versions of Cygwin Perl generate incorrect C++ code.
https://bugs.webkit.org/show_bug.cgi?id=165524
rdar://problem/29508043
Reviewed by Daniel Bates.
Perl strings with variables seems to be handled differently, depending on which version of
Cygwin Perl you are running. To make sure they are handled identically, specify variables
in strings as "${var}" instead of "$var".
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
2016-12-08 Alex Christensen <achristensen@webkit.org>
Fix EFL build after r209526
https://bugs.webkit.org/show_bug.cgi?id=165594
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
nullptr is being automatically converted to false everywhere but EFL.
It should be false. This function returns a bool.
2016-12-07 Dave Hyatt <hyatt@apple.com>
REGRESSION: font shorthand parsing is broken
https://bugs.webkit.org/show_bug.cgi?id=165594
Reviewed by Zalan Bujtas.
Unskipping fast/css/font-calculated-value.html.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeight):
The new parser did not support calc() in the font-weight property.
In order to support a positive integer, add new functions to consume
and handle positive integers without making a CSSPrimitiveValue out of
the number. These correspond to consumeNumberRaw but are limited to positive
integers.
(WebCore::CSSPropertyParser::consumeFont):
The implicit bool was incorrectly set to true when properties were
defined because releaseNonNull() cleared the variables being null
checked. Add separate booleans to avoid this.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
* css/parser/CSSPropertyParserHelpers.h:
Add the new helpers that consume positive integers without creating
CSSPrimitiveValues out of them.
2016-12-07 Jeremy Jones <jeremyj@apple.com>
Exit pointer lock when page goes into page cache.
https://bugs.webkit.org/show_bug.cgi?id=165425
rdar://problem/29430834
Reviewed by Jer Noble.
Test: pointer-lock/lock-lost-on-navigation.html
Cancel pointer lock when page goes into page cache and add methods to Internals
so it can be tested.
* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* page/PointerLockController.h:
* testing/Internals.cpp:
(WebCore::Internals::pageHasPendingPointerLock):
(WebCore::Internals::pageHasPointerLock):
* testing/Internals.h:
* testing/Internals.idl:
2016-12-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Tracks panel does not display in the right location in fullscreen and cannot be dismissed
https://bugs.webkit.org/show_bug.cgi?id=165575
Reviewed by Dean Jackson.
We position the tracks panel programmatically based on the current bounds of the fullscreen button in fullscreen.
This allows for the tracks panel to be shown in the right spot even after dragging the controls bar. We also use
the fullscreen media controls as the target for tracking "mousedown" events when the tracks panel is shown in a
fullscreen presentation.
Tests: media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html
media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen .scrubber):
(.media-controls.mac.fullscreen .tracks-panel): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.showTracksPanel):
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):
(TracksPanel.prototype.get bottomY):
(TracksPanel.prototype.set bottomY):
(TracksPanel.prototype.commitProperty):
(TracksPanel.prototype._mousedownTarget):
2016-12-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Use a small picture-in-picture button in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=165587
Reviewed by Dean Jackson.
Use a newer, smaller asset for picture-in-picture in fullscreen.
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Added.
2016-12-07 Dean Jackson <dino@apple.com>
Remove runtime toggle for pointer-lock
https://bugs.webkit.org/show_bug.cgi?id=165577
<rdar://problems/29566996>
Reviewed by Jon Lee.
Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.
Covered by existing tests.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPointerLockEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::pointerLockEnabled): Deleted.
* dom/Document.idl:
* dom/Element.idl:
* page/Page.h:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
(WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
2016-12-07 John Wilander <wilander@apple.com>
Allow commas in Accept, Accept-Language, and Content-Language request headers for simple CORS
https://bugs.webkit.org/show_bug.cgi?id=165566
<rdar://problem/29560983>
Reviewed by Alex Christensen.
Updated the existing tests.
* platform/network/HTTPParsers.cpp:
(WebCore::isValidAcceptHeaderValue):
Now also accepts ','.
(WebCore::isValidLanguageHeaderValue):
Ditto.
2016-12-07 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Stop skipping tests in the css3 LayoutTests subdirectory
https://bugs.webkit.org/show_bug.cgi?id=165574
Reviewed by Dean Jackson.
* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule):
The old parser didn't support the creation of @namespace rules in the
CSS OM, but the new parser does. We need to ensure that just like for
@import rules, that the insertion of a @namespace rule inside a
@supports rule is not allowed. This test passed in the old parser because
the rule just didn't get created, but in the new parser, we need to
add a check along with the @import rule check to ensure it isn't allowed.
2016-12-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Remove aspect ratio button
https://bugs.webkit.org/show_bug.cgi?id=165571
Reviewed by Dean Jackson.
Since we do not have a way to toggle letterboxing on an HTMLMediaElement, we remove the
corresponding button in the media controls.
* Modules/modern-media-controls/controls/aspect-ratio-button.js: Removed.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
* Modules/modern-media-controls/js-files:
2016-12-07 Jeremy Jones <jeremyj@apple.com>
One esc to exit fullscreen and pointer lock
https://bugs.webkit.org/show_bug.cgi?id=165416
rdar://problem/29430711
Reviewed by Jer Noble.
Test: pointer-lock/lock-lost-on-esc-in-fullscreen.html
When handling escape, also exit fullscreen on escape.
This also means that escape can exit fullscreen in TestRunner.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
2016-12-07 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Drop translate phase in module loader
https://bugs.webkit.org/show_bug.cgi?id=164861
Reviewed by Saam Barati.
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
2016-12-07 Keith Rollin <krollin@apple.com>
Network event record/replay
https://bugs.webkit.org/show_bug.cgi?id=164527
<rdar://problem/29168157>
Reviewed by Alex Christensen.
Export parseURLEncodedForm.
No new tests -- no functionality added, changed, or removed.
* platform/URLParser.h:
2016-12-07 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Consolidate string/ident/url serialization functions
https://bugs.webkit.org/show_bug.cgi?id=165552
Reviewed by Zalan Bujtas.
Right now CSSParser has string, ident and url serialization functions
called quoteCSStringIfNeeded (which actually serializes both strings and
identifiers), as well as quoteCSSURLIfNeeded.
CSSMarkup already has serialization functions that exist outside of the
CSSParser and that handle serialization of strings, idents and URLs. This
patch eliminates the CSSParser functions and consolidates all of the
serialization to use CSSMarkup's functions.
Note that we are not spec-compliant at all here, and so I had to amend
the functions to support our non-spec-compliant serialization. The goal
of this patch is consolidation and not to fix our broken serialization.
Notable changes include parameterizing string serialization so that
both single and double quotes are supported, since in the existing code
we're sometimes spec-compliant (CSSSelectors) and sometimes not
(CSSPrimitiveValue).
We also overload CSS_STRING primitive value type and have it act as both
a string and a custom identifier. This is lame, since the parser should
have made two different types of objects instead, but since our parser
doesn't do that yet, I added a serializeAsStringOrCustomIdent that
preserves our old behavior of "quote the string only if needed." In this
case what that really meant was "Try to guess that we were originally a
custom ident and leave off quotes if so." This function will go away
once we properly create CSSStringValues and CSSCustomIdentValues instead
of turning the latter into strings.
* css/CSSBasicShapes.cpp:
(WebCore::buildPathString):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::customCSSText):
* css/CSSMarkup.cpp:
(WebCore::isCSSTokenizerURL):
(WebCore::serializeString):
(WebCore::serializeURL):
(WebCore::serializeAsStringOrCustomIdent):
(WebCore::serializeURI): Deleted.
* css/CSSMarkup.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/parser/CSSParser.cpp:
(WebCore::isCSSTokenizerIdent): Deleted.
(WebCore::isCSSTokenizerURL): Deleted.
(WebCore::quoteCSSStringInternal): Deleted.
(WebCore::quoteCSSString): Deleted.
(WebCore::quoteCSSStringIfNeeded): Deleted.
(WebCore::quoteCSSURLIfNeeded): Deleted.
* css/parser/CSSParser.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::mapLanguageAttributeToLocale):
2016-12-07 Dean Jackson <dino@apple.com>
Expose internal API to detect media documents
https://bugs.webkit.org/show_bug.cgi?id=165559
<rdar://problems/29564054>
Reviewed by Antoine Quint.
Expose via MediaControlsHost whether or not we're in
a MediaDocument.
Since MediaControlsHost is only exposed to our
internal controls, it's not possible to test this
directly. However, a subsequent test for media documents
with audio-only content will cover this change.
* Modules/mediacontrols/MediaControlsHost.cpp: Add isInMediaDocument and put const on
various methods that should have it.
(WebCore::MediaControlsHost::captionDisplayMode):
(WebCore::MediaControlsHost::supportsFullscreen):
(WebCore::MediaControlsHost::isVideoLayerInline):
(WebCore::MediaControlsHost::isInMediaDocument):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl: Add isInMediaDocument.
2016-12-07 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
https://bugs.webkit.org/show_bug.cgi?id=136365
<rdar://problem/27686727>
Reviewed by Simon Fraser.
Margin value overflow ends up confusing the column count computing logic.
Test: fast/multicol/assert-on-column-count-when-zoomed-in.html
* css/StyleResolver.cpp:
(WebCore::addIntrinsicMargins):
2016-12-07 Ryosuke Niwa <rniwa@webkit.org>
document.caretRangeFromPoint doesn't retarget the resultant Range correctly.
https://bugs.webkit.org/show_bug.cgi?id=165146
Reviewed by Sam Weinig.
The bug was caused by caretRangeFromPoint not retargeting the resultant Range correctly.
Namely, it's possible for RenderObject::positionForPoint to move across shadow boundary
even if node was identically equal to ancestorInThisScope(node).
Fixed the bug by directly retargeting the range's container node and its offset as done
for elementFromPoint in r206795.
Test: fast/shadow-dom/caret-range-from-point-in-shadow-tree.html
* dom/Document.cpp:
(WebCore::Document::caretRangeFromPoint):
2016-12-07 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Entering fullscreen and returning to inline shows fullscreen controls
https://bugs.webkit.org/show_bug.cgi?id=165536
Reviewed by Tim Horton.
We regressed when we implemented the fix for webkit.org/b/165494 and we started to rely solely
on the "webkitpresentationmodechanged" event to identify presention mode changes. As it turns out,
when the "webkitpresentationmodechanged" event is dispatched when exiting fullscreen and returning
to the inline presentation mode, querying the "webkitPresentationMode" property says "inline" while
"webkitDisplayingFullscreen" still returns true (raised as webkit.org/b/165538).
We now use the "webkitPresentationMode" property when that property is supported and we're using the
"webkitpresentationmodechanged" event, and we use the "webkitDisplayingFullscreen" property otherwise.
Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits):
2016-12-07 Wenson Hsieh <wenson_hsieh@apple.com>
Scroll position jumps to the origin when scrolling without momentum at the end of a scroll snapping container
https://bugs.webkit.org/show_bug.cgi?id=165474
<rdar://problem/29534305>
Reviewed by Simon Fraser.
When initializing an AppKit _NSScrollingMomentumCalculator, if the initial and target positions are the same and
the initial velocity is (0, 0), the momentum calculator will output (0, 0) as the animated scroll position when
animating. This causes the scroll position to jump to the top left in some cases when scrolling in scroll snap
containers. To fix this, we teach the ScrollingMomentumCalculatorMac to return an animation duration of 0 and
an animated scroll position equal to the final scroll position when this is the case.
Test: tiled-drawing/scrolling/scroll-snap/scrolling-jumps-to-top.html
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
(WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
(WebCore::ScrollingMomentumCalculatorMac::animationDuration):
2016-12-07 Nan Wang <n_wang@apple.com>
AX: menu type toolbar should be mapped correctly on Mac
https://bugs.webkit.org/show_bug.cgi?id=165537
Reviewed by Chris Fleizach.
The menu tag with a toolbar type should have the corresponding role.
Test: accessibility/mac/menu-type-toolbar.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2016-12-07 Wenson Hsieh <wenson_hsieh@apple.com>
Add a new project for recording and playing back editing commands in editable web content
https://bugs.webkit.org/show_bug.cgi?id=165114
<rdar://problem/29408135>
Reviewed by Beth Dakin.
Adds new scripts used to record and play back editing, as well as a new Xcode Copy files phase that pushes these
scripts to the internal system directory when installing. See the Tools ChangeLog and individual comments below
for more details. Covered by 3 new unit tests in the EditingHistory project.
* InternalScripts/DumpEditingHistory.js: Added.
(beginProcessingTopLevelUpdate):
(endProcessingTopLevelUpdate):
(appendDOMUpdatesFromRecords):
(appendSelectionUpdateIfNecessary):
Adds new entries into the top-level list of DOM updates captured when editing. Respectively, these are input
events and selection changes.
(EditingHistory.getEditingHistoryAsJSONString):
* InternalScripts/EditingHistoryUtil.js: Added.
(prototype._scramble):
(prototype.applyToText):
(prototype.applyToFilename):
(prototype._scrambedNumberIndexForCode):
(prototype._scrambedLowercaseIndexForCode):
(prototype._scrambedUppercaseIndexForCode):
Naive implementation of an obfuscator. Currently, this only affects alphanumeric characters. Obfuscation is off
by default, but can be toggled on in JavaScript.
(elementFromMarkdown):
(GlobalNodeMap):
(GlobalNodeMap.prototype.nodesForGUIDs):
(GlobalNodeMap.prototype.guidsForTNodes):
(GlobalNodeMap.prototype.nodeForGUID):
(GlobalNodeMap.prototype.guidForNode):
(GlobalNodeMap.prototype.hasGUIDForNode):
(GlobalNodeMap.prototype.nodes):
(GlobalNodeMap.prototype.toObject):
(GlobalNodeMap.fromObject):
(GlobalNodeMap.dataForNode):
(GlobalNodeMap.elementFromTagName):
(GlobalNodeMap.nodeAttributesToObject):
(GlobalNodeMap.prototype.descriptionHTMLForGUID):
(GlobalNodeMap.prototype.descriptionHTMLForNode):
The GlobalNodeMap keeps track of every node that has appeared in the DOM, assigning each node a globally unique
identifier (GUID). This GUID is used when reconstructing the DOM, as well as unapplying or applying editing.
(SelectionState):
(SelectionState.prototype.isEqual):
(SelectionState.prototype.applyToSelection):
(SelectionState.fromSelection):
(SelectionState.prototype.toObject):
(SelectionState.fromObject):
Represents a snapshot of the Selection state (determined by getSelection()).
(DOMUpdate):
(DOMUpdate.prototype.apply):
(DOMUpdate.prototype.unapply):
(DOMUpdate.prototype.targetNode):
(DOMUpdate.prototype.detailsElement):
(DOMUpdate.ofType):
(DOMUpdate.fromRecords):
A DOMUpdate is an abstract object representing a change in the DOM that may be applied and unapplied. These are
also serializable as hashes, which may then be converted to JSON when generating editing history data.
(ChildListUpdate):
(ChildListUpdate.prototype.apply):
(ChildListUpdate.prototype.unapply):
(ChildListUpdate.prototype._nextSibling):
(ChildListUpdate.prototype._removedNodes):
(ChildListUpdate.prototype._addedNodes):
(ChildListUpdate.prototype.toObject):
(ChildListUpdate.prototype.detailsElement):
(ChildListUpdate.fromObject):
These three update types correspond to the three types of DOM mutations. These may appear as top-level updates
if they are not captured during an input event, but for the majority of user-input-driven changes, they will be
children of an input event.
(CharacterDataUpdate):
(CharacterDataUpdate.prototype.apply):
(CharacterDataUpdate.prototype.unapply):
(CharacterDataUpdate.prototype.detailsElement):
(CharacterDataUpdate.prototype.toObject):
(CharacterDataUpdate.fromObject):
(AttributeUpdate):
(AttributeUpdate.prototype.apply):
(AttributeUpdate.prototype.unapply):
(AttributeUpdate.prototype.detailsElement):
(AttributeUpdate.prototype.toObject):
(AttributeUpdate.fromObject):
(SelectionUpdate):
(SelectionUpdate.prototype.apply):
(SelectionUpdate.prototype.unapply):
(SelectionUpdate.prototype.toObject):
(SelectionUpdate.fromObject):
(SelectionUpdate.prototype._rangeDescriptionHTML):
(SelectionUpdate.prototype._anchorDescriptionHTML):
(SelectionUpdate.prototype._focusDescriptionHTML):
(SelectionUpdate.prototype.detailsElement):
Represents a change in the Selection. While no changes to the DOM structure occur as a result of a
SelectionUpdate, the information contained in these updates is used to determine where the selection should be
when rewinding or playing back the editing history.
(InputEventUpdate):
(InputEventUpdate.prototype._obfuscatedData):
(InputEventUpdate.prototype.apply):
(InputEventUpdate.prototype.unapply):
(InputEventUpdate.prototype.toObject):
(InputEventUpdate.fromObject):
(InputEventUpdate.prototype.detailsElement):
Represents an update due to user input, which consists of some number of child DOM mutation updates.
* WebCore.xcodeproj/project.pbxproj:
2016-12-07 Jer Noble <jer.noble@apple.com>
ASSERT crash while running media-source/mediasource-activesourcebuffers.html under Stress GC bot.
https://bugs.webkit.org/show_bug.cgi?id=165514
Reviewed by Eric Carlson.
If a track associated with MSE is disabled after a SourceBuffer begins parsing a queued
append operation, SourceBuffer can get into a state where it asks SourceBufferPrivateAVFObjC
if it is ready to accept data for that disabled track. This causes an ASSERT_NOT_REACHED in
isReadyForMoreData().
However, this seems to be a valid condition; we can safely just return "false" from
isReadyForMoreSamples() (and also bail from notifyClientWhenReadyForMoreSamples()) when asked
about a disabled track.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
2016-12-07 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Eliminate the Scope class and fold it into CSSTokenizer
https://bugs.webkit.org/show_bug.cgi?id=165532
Reviewed by Dean Jackson.
The Scope class, nested inside CSSTokenizer, is both poorly named and serves
no purpose. It's especially weird that it was the entry point into tokenization
instead of CSSTokenizer.
Eliminate the class, fold its members and functions into CSSTokenizer, and have
callers just make a CSSTokenizer instead.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseSelector):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::parseCustomPropertyValue):
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
(WebCore::CSSParserImpl::parseDeclarationList):
(WebCore::CSSParserImpl::parseRule):
(WebCore::CSSParserImpl::parseStyleSheet):
(WebCore::CSSParserImpl::parseKeyframeKeyList):
(WebCore::CSSParserImpl::parseDeclarationListForInspector):
(WebCore::CSSParserImpl::parseStyleSheetForInspector):
* css/parser/CSSTokenizer.cpp:
(WebCore::CSSTokenizer::CSSTokenizer):
(WebCore::CSSTokenizer::tokenRange):
(WebCore::CSSTokenizer::tokenCount):
(WebCore::CSSTokenizer::registerString):
(WebCore::CSSTokenizer::Scope::Scope): Deleted.
(WebCore::CSSTokenizer::Scope::tokenRange): Deleted.
(WebCore::CSSTokenizer::Scope::tokenCount): Deleted.
* css/parser/CSSTokenizer.h:
(WebCore::CSSTokenizer::Scope::storeString): Deleted.
* css/parser/CSSTokenizerInputStream.cpp:
(WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
* css/parser/CSSTokenizerInputStream.h:
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::parseMediaQuerySet):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::SizesAttributeParser):
2016-12-07 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unused and mostly untested Page domain commands and events
https://bugs.webkit.org/show_bug.cgi?id=165507
Reviewed by Brian Burg.
Remove any code associated with the commands/events being removed.
* inspector/DOMPatchSupport.cpp:
* inspector/DOMPatchSupport.h:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::handleJavaScriptDialog): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::scriptsEnabledImpl): Deleted.
(WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl): Deleted.
(WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::scriptsEnabled): Deleted.
(WebCore::InspectorInstrumentation::willRunJavaScriptDialog): Deleted.
(WebCore::InspectorInstrumentation::didRunJavaScriptDialog): Deleted.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
(WebCore::InspectorPageAgent::didPaint):
(WebCore::InspectorPageAgent::buildObjectForFrame):
(WebCore::InspectorPageAgent::archive):
(WebCore::createXHRTextDecoder): Deleted.
(WebCore::InspectorPageAgent::getScriptExecutionStatus): Deleted.
(WebCore::InspectorPageAgent::setScriptExecutionDisabled): Deleted.
(WebCore::InspectorPageAgent::willRunJavaScriptDialog): Deleted.
(WebCore::InspectorPageAgent::didRunJavaScriptDialog): Deleted.
(WebCore::InspectorPageAgent::scriptsEnabled): Deleted.
(WebCore::InspectorPageAgent::handleJavaScriptDialog): Deleted.
* inspector/InspectorPageAgent.h:
* page/Chrome.cpp:
(WebCore::Chrome::runBeforeUnloadConfirmPanel):
(WebCore::Chrome::runJavaScriptAlert):
(WebCore::Chrome::runJavaScriptConfirm):
(WebCore::Chrome::runJavaScriptPrompt):
* page/Settings.cpp:
(WebCore::Settings::setScriptEnabled):
2016-12-07 Jer Noble <jer.noble@apple.com>
[pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
https://bugs.webkit.org/show_bug.cgi?id=165377
Reviewed by Eric Carlson.
Follow up to previous patch; clear the m_forceCursorVisibleUponUnlock flag upon losing
pointer lock, so that subsequent unlocks don't erroneously cause the cursor to become
visible.
* page/PointerLockController.cpp:
(WebCore::PointerLockController::didLosePointerLock):
2016-12-06 Geoffrey Garen <ggaren@apple.com>
performance.now() should truncate to 100us
https://bugs.webkit.org/show_bug.cgi?id=165503
<rdar://problem/29544531>
Reviewed by Mark Lam.
* page/Performance.cpp:
(WebCore::Performance::reduceTimeResolution):
2016-12-07 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Turn back on a bunch of layout tests
https://bugs.webkit.org/show_bug.cgi?id=165529
Reviewed by Zalan Bujtas.
Fixes fast/css/transform-origin-parsing.html.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
The implicit check was relying on a null check of the z value, but
we called releaseNonNull on it already. This meant all z properties were
marked as implicit incorrectly. Fix by storing whether or not we had a z
value in a local variable.
2016-12-07 Andreas Kling <akling@apple.com>
[iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
<https://webkit.org/b/165527>
Reviewed by Antti Koivisto.
This code no longer does anything, as the page cache is hard capped
at 0 entries while under memory pressure.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
2016-12-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Use tap and pinch gestures on iOS
https://bugs.webkit.org/show_bug.cgi?id=165518
Reviewed by Dean Jackson.
We now use touch events to identify taps and pinches on media controls to respond immediately
to user interaction on buttons and enter fullscreen when pinching out.
* Modules/modern-media-controls/controls/button.css:
(button):
* Modules/modern-media-controls/controls/button.js:
(Button):
(Button.prototype.handleEvent):
(Button.prototype.gestureRecognizerStateDidChange):
(Button.prototype._notifyDelegateOfActivation):
(Button.prototype._handleUIEvent): Deleted.
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set fadesWhileIdle):
(ControlsBar.prototype.gestureRecognizerStateDidChange):
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage):
(IconButton):
* Modules/modern-media-controls/controls/ios-inline-media-controls.js:
(IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
* Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js: Added.
(GestureRecognizer):
(GestureRecognizer.prototype.get state):
(GestureRecognizer.prototype.set state):
(GestureRecognizer.prototype.get target):
(GestureRecognizer.prototype.set target):
(GestureRecognizer.prototype.get numberOfTouches):
(GestureRecognizer.prototype.get enabled):
(GestureRecognizer.prototype.set enabled):
(GestureRecognizer.prototype.reset):
(GestureRecognizer.prototype.locationInElement):
(GestureRecognizer.prototype.locationInClient):
(GestureRecognizer.prototype.locationOfTouchInElement):
(GestureRecognizer.prototype.touchesBegan):
(GestureRecognizer.prototype.touchesMoved):
(GestureRecognizer.prototype.touchesEnded):
(GestureRecognizer.prototype.touchesCancelled):
(GestureRecognizer.prototype.gestureBegan):
(GestureRecognizer.prototype.gestureChanged):
(GestureRecognizer.prototype.gestureEnded):
(GestureRecognizer.prototype.enterPossibleState):
(GestureRecognizer.prototype.enterBeganState):
(GestureRecognizer.prototype.enterEndedState):
(GestureRecognizer.prototype.enterCancelledState):
(GestureRecognizer.prototype.enterFailedState):
(GestureRecognizer.prototype.enterChangedState):
(GestureRecognizer.prototype.enterRecognizedState):
(GestureRecognizer.prototype.handleEvent):
(GestureRecognizer.prototype._initRecognizer):
(GestureRecognizer.prototype._updateBaseListeners):
(GestureRecognizer.prototype._removeTrackingListeners):
(GestureRecognizer.prototype._updateTargetTouches):
(GestureRecognizer.prototype._updateKeyboardModifiers):
* Modules/modern-media-controls/gesture-recognizers/pinch.js: Added.
(PinchGestureRecognizer):
(PinchGestureRecognizer.prototype.get velocity):
(PinchGestureRecognizer.prototype.touchesBegan):
(PinchGestureRecognizer.prototype.touchesMoved):
(PinchGestureRecognizer.prototype.touchesEnded):
(PinchGestureRecognizer.prototype.gestureBegan):
(PinchGestureRecognizer.prototype.gestureChanged):
(PinchGestureRecognizer.prototype.gestureEnded):
(PinchGestureRecognizer.prototype.reset):
(PinchGestureRecognizer.prototype._recordGesture):
(PinchGestureRecognizer.prototype._updateStateWithEvent):
(PinchGestureRecognizer.prototype._distance):
* Modules/modern-media-controls/gesture-recognizers/tap.js: Added.
(TapGestureRecognizer):
(TapGestureRecognizer.prototype.touchesBegan):
(TapGestureRecognizer.prototype.touchesMoved):
(TapGestureRecognizer.prototype.touchesEnded):
(TapGestureRecognizer.prototype.reset):
(TapGestureRecognizer.prototype.locationInElement):
(TapGestureRecognizer.prototype.locationInClient):
(TapGestureRecognizer.prototype._clearTimer):
(TapGestureRecognizer.prototype._rewindTimer):
(TapGestureRecognizer.prototype._timerFired):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js:
(AirplaySupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport):
(ControlsVisibilitySupport.prototype.handleEvent):
(ControlsVisibilitySupport.prototype.syncControl): Deleted.
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport):
(FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
(FullscreenSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport):
(MediaControllerSupport.prototype.handleEvent):
(MediaControllerSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/mute-support.js:
(MuteSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/skip-back-support.js:
(SkipBackSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.buttonWasClicked): Deleted.
2016-12-06 Dean Jackson <dino@apple.com>
Apply styling to media documents with modern controls
https://bugs.webkit.org/show_bug.cgi?id=165499
<rdar://problems/29543847>
Reviewed by Antoine Quint.
Forgot to commit most of the changes in MediaDocument.cpp :(
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
2016-12-06 Simon Fraser <simon.fraser@apple.com>
Two tiled drawing tests failing with visual viewports enabled.
https://bugs.webkit.org/show_bug.cgi?id=165489
Reviewed by Dean Jackson.
computeLayoutViewportOrigin() gets called for iframes when the layout viewport
is zero-sized, but the visual viewport is non-zero. It doesn't really make sense
to compute a layout viewport when the visual viewport is larger than the layout
viewport, but if this happens just anchor the layout viewport at the origin
of the visual viewport.
* page/FrameView.cpp:
(WebCore::FrameView::computeLayoutViewportOrigin):
2016-12-04 Darin Adler <darin@apple.com>
Remove various stray uses of WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=165358
Reviewed by Sam Weinig.
I discovered three completely unused classes in the MediaStream code:
MediaTrackConstraint, MediaTrackConstraintSet, and MediaTrackConstraints.
While there is some chance we may implement these at some point, they are
likely to be dictionaries or some other kind of data structure rather than
clases, and there is no reason to keep the current classes.
* CMakeLists.txt: Removed MediaTrackConstraint, MediaTrackConstraintSet,
and MediaTrackConstraints.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* Modules/indexeddb/IDBDatabase.h: Removed include of Dictionary.h.
* Modules/indexeddb/IDBObjectStore.cpp: Added include of HeapInlines.h.
* Modules/indexeddb/IDBRequest.cpp: Added include of StrongInlines.h.
* Modules/indexeddb/IDBTransaction.cpp: Added include of SerializedScriptValue.h.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getConstraints): Deleted.
This function is implemented entirely in the bindings layer.
* Modules/mediastream/MediaStreamTrack.h: Removed getConstraints.
* Modules/mediastream/MediaTrackConstraint.cpp: Removed.
* Modules/mediastream/MediaTrackConstraint.h: Removed.
* Modules/mediastream/MediaTrackConstraint.idl: Removed.
* Modules/mediastream/MediaTrackConstraintSet.cpp: Removed.
* Modules/mediastream/MediaTrackConstraintSet.h: Removed.
* Modules/mediastream/MediaTrackConstraintSet.idl: Removed.
* Modules/mediastream/MediaTrackConstraints.cpp: Removed.
* Modules/mediastream/MediaTrackConstraints.h: Removed.
* Modules/mediastream/MediaTrackConstraints.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.idl: Use the type names from the latest
getUserMedia specification for the arguments to webkitGetUserMedia; not sure they
are precisely correct for this legacy function, but since this is a JSBuiltin,
it's all ignored anyway. Just important not to call anything "Dictionary".
* WebCore.xcodeproj/project.pbxproj: Removed MediaTrackConstraint, MediaTrackConstraintSet,
and MediaTrackConstraints.
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection): Use uncheckedArgument, since
the code explicitly checks the number of arguments.
(WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
* bindings/js/JSFontFaceCustom.cpp: Removed include of Dictionary.h.
* dom/Document.cpp: Ditto.
* dom/Element.cpp: Ditto.
* dom/Element.h: Removed forward declaration of Dictionary.
2016-12-06 Wenson Hsieh <wenson_hsieh@apple.com>
After preventing a beforeinput event, an input event is fired when formatting rich text
https://bugs.webkit.org/show_bug.cgi?id=165435
<rdar://problem/29522314>
Reviewed by Ryosuke Niwa.
This regressed after I refactored some input event event dispatch logic when formatting text in r208461.
I moved the logic for dispatching input events when applying styles into Editor::applyStyle, but left out an
early return after firing the beforeinput event if the default behavior was prevented, which caused us to
continue on and dispatch an input event. The fix is to bail from applyStyle if default was prevented.
Augmented an existing layout test to cover this case.
* editing/Editor.cpp:
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
2016-12-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Instantiate iOS media controls
https://bugs.webkit.org/show_bug.cgi?id=165498
Reviewed by Dean Jackson.
Add support for the modern media controls runtime flags in RenderThemeIOS and, when instantiating iOS controls,
return an IOSInlineMediaControls class.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._controlsClass):
(MediaController):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsStyleSheet):
(WebCore::RenderThemeIOS::mediaControlsScript):
(WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform):
2016-12-06 Dean Jackson <dino@apple.com>
Apply styling to media documents with modern controls
https://bugs.webkit.org/show_bug.cgi?id=165499
<rdar://problems/29543847>
Reviewed by Antoine Quint.
Existing MediaDocuments got styling from the injected style
sheet, which had rules for such documents. The modern media controls
use a scoped style rule, so we can't touch the document style. Instead,
inline the style directly from MediaDocument.
Test: media/modern-media-controls/media-documents/background-color-and-centering.html
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
2016-12-06 Zalan Bujtas <zalan@apple.com>
Move RenderElement::rendererForRootBackground to RenderView.
https://bugs.webkit.org/show_bug.cgi?id=165454
Reviewed by Simon Fraser.
Currently RenderElement::rendererForRootBackground can only be called on document element's renderer.
This patch removes this limitation and moves the functionality from RenderElement to RenderView.
No change in functionality.
* page/FrameView.cpp:
(WebCore::FrameView::calculateExtendedBackgroundMode):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::rendererForRootBackground): Deleted.
* rendering/RenderElement.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::rendererBackgroundColor):
* rendering/RenderView.cpp:
(WebCore::RenderView::rendererForRootBackground):
(WebCore::rendererObscuresBackground):
(WebCore::RenderView::paintBoxDecorations):
(WebCore::RenderView::rootBackgroundIsEntirelyFixed):
* rendering/RenderView.h:
2016-12-05 Jiewen Tan <jiewen_tan@apple.com>
[Part 1 of 2] Add support for SPKI format while doing SubtleCrypto.importKey/exportKey
https://bugs.webkit.org/show_bug.cgi?id=129978
<rdar://problem/21799829>
This is part 1 of Bug 129978. In this patch, it adds the SPKI format support for
SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
RSASSA-PKCS1-v1_5 and RSA-OAEP.
Reviewed by Brent Fulgham.
Tests: crypto/subtle/rsa-import-jwk-key-export-spki-key.html
crypto/subtle/rsa-import-spki-key-export-jwk-key.html
crypto/subtle/rsa-import-spki-key-export-spki-key.html
crypto/subtle/rsa-import-spki-small-key.html
crypto/subtle/rsa-oaep-generate-export-key-spki.html
crypto/subtle/rsa-oaep-import-spki-key.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki.html
crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki.html
crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key.html
crypto/workers/subtle/rsa-export-spki-key.html
crypto/workers/subtle/rsa-import-spki-key.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toKeyData):
* crypto/CommonCryptoUtilities.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::exportSpki):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::bytesUsedToEncodedLength):
(WebCore::bytesNeededForEncodedLength):
(WebCore::addEncodedASN1Length):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::exportSpki):
2016-12-06 Simon Fraser <simon.fraser@apple.com>
Fix editing text flakiness introduced in r209411
https://bugs.webkit.org/show_bug.cgi?id=165500
Reviewed by Dean Jackson.
The "insideFixed" out param was left uninitialized sometimes. This affected FrameSelection's
m_caretInsidePositionFixed, which caused problems in these tests.
Tested by editing tests in WK1.
* editing/htmlediting.cpp:
(WebCore::absoluteBoundsForLocalCaretRect):
2016-12-06 Alexey Proskuryakov <ap@apple.com>
Correct SDKROOT values in xcconfig files
https://bugs.webkit.org/show_bug.cgi?id=165487
rdar://problem/29539209
Reviewed by Dan Bernstein.
Fix suggested by Dan Bernstein.
* Configurations/DebugRelease.xcconfig:
2016-12-06 Saam Barati <sbarati@apple.com>
Remove old Wasm object model
https://bugs.webkit.org/show_bug.cgi?id=165481
Reviewed by Keith Miller and Mark Lam.
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
2016-12-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media controls use the fullscreen layout after going from inline to fullscreen to PiP to inline
https://bugs.webkit.org/show_bug.cgi?id=165494
Reviewed by Dean Jackson.
We would only call _updateControlsIfNeeded() when entering or leaving fullscreen, so we going from fullscreen to PiP to
inline would retain fullscreen controls since we would not check for the event that indicates we went back from PiP to
inline. On platforms that support it, we listen to the "webkitpresentationmodechanged" event
to update the controls, and only "webkitfullscreenchange" on others (ie. Yosemite).
Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._returnMediaLayerToInlineIfNeeded):
2016-12-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Rendering issues with controls bar when captions are on
https://bugs.webkit.org/show_bug.cgi?id=165390
Reviewed by Dean Jackson.
We would face some layout issues with captions due to RenderImage::layoutShadowControls()
expecting a single RenderBox in the media controls shadow root, which was the case with
legacy media controls, but no longer the case with modern media controls. We now host
both the captions and the media controls elements under a single container, and add
an asertion in RenderImage to check that a single RenderBox child exists.
Test: media/modern-media-controls/media-controller/media-controller-single-container.html
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container):
(.media-controls-container,):
(.media-controls-container > *):
(.media-controls):
* Modules/modern-media-controls/controls/text-tracks.css:
(video::-webkit-media-text-track-container):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype._updateControlsIfNeeded):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layoutShadowControls):
2016-12-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Automatically hide the controls bar when the mouse is idle
https://bugs.webkit.org/show_bug.cgi?id=165492
Reviewed by Dean Jackson.
We now automatically hide the controls bar. When the media is no longer paused, the controls remain
visible for 4 seconds, regardless of where the mouse pointer is located. When the user mouses over the
media, the controls become visible and automatically hide 4 seconds after the last time the user has
moved his mouse over the media. When the user mouses out of the media, the controls automatically hide.
When the mouse is over the controls bar, it remains visible. When the media is paused, the controls bar
remain visible regardless of the mouse position.
Tests: media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html
media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html
media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html
media/modern-media-controls/media-controller/media-controller-auto-hide-pause.html
media/modern-media-controls/media-controller/media-controller-auto-hide-rewind-with-mouse-enter.html
media/modern-media-controls/media-controller/media-controller-auto-hide.html
* Modules/modern-media-controls/controls/controls-bar.css: Added.
(.controls-bar):
(.controls-bar.faded):
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.get userInteractionEnabled):
(ControlsBar.prototype.set userInteractionEnabled):
(ControlsBar.prototype.get fadesWhileIdle):
(ControlsBar.prototype.set fadesWhileIdle):
(ControlsBar.prototype.get visible):
(ControlsBar.prototype.set visible):
(ControlsBar.prototype.get faded):
(ControlsBar.prototype.set faded):
(ControlsBar.prototype.handleEvent):
(ControlsBar.prototype.commitProperty):
(ControlsBar.prototype._cancelAutoHideTimer):
(ControlsBar.prototype._rewindAutoHideTimer):
(ControlsBar.prototype._autoHideTimerFired):
* Modules/modern-media-controls/controls/media-controls.js:
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.get mediaEvents):
(ControlsVisibilitySupport.prototype.syncControl):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
2016-12-06 Zalan Bujtas <zalan@apple.com>
Can not select whole line when using flexbox
https://bugs.webkit.org/show_bug.cgi?id=165299
Reviewed by David Hyatt.
RootInlineBox::selectionTopAdjustedForPrecedingBlock assumes that the preceding block is
always above the current line. However in certain layout contexts (flex as an example) the block before
could just be on the same line as the current one.
This patch checks if we actually need to adjust the selection top to avoid vertical selection overlap.
Test: fast/flexbox/flexbox-fail-to-select-same-line.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::blockBeforeWithinSelectionRoot): Deleted.
* rendering/RenderBlock.h:
* rendering/RootInlineBox.cpp:
(WebCore::blockBeforeWithinSelectionRoot):
(WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock):
2016-12-06 Ryosuke Niwa <rniwa@webkit.org>
Add more assertions to ElementQueue diagnose a bug
https://bugs.webkit.org/show_bug.cgi?id=164814
Reviewed by Alexey Proskuryakov.
Set m_invoking in release builds now that assertions are also run in release builds.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
2016-12-06 Jer Noble <jer.noble@apple.com>
YouTube sometimes pauses when switching tabs
https://bugs.webkit.org/show_bug.cgi?id=165468
Reviewed by Eric Carlson.
Test: media/media-session-restrictions.html
The bitfield which represents the restrictions for "VideoAudio" media type was unititialized,
leading to what was effectively a random set of restrictions at runtime.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::resetRestrictions):
* testing/Internals.cpp:
(WebCore::mediaTypeFromString):
(WebCore::Internals::setMediaSessionRestrictions):
(WebCore::Internals::mediaSessionRestrictions):
* testing/Internals.h:
* testing/Internals.idl:
2016-12-06 Mark Lam <mark.lam@apple.com>
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
https://bugs.webkit.org/show_bug.cgi?id=165227
<rdar://problem/29442665>
Reviewed by Saam Barati.
Make all objects in window.__proto__'s prototype chain immutable prototype exotic
objects. This gives us roughly equivalent behavior to other browsers.
Firefox's behavior differ slightly in that Firefox will fail any attempted
assignment their __proto__, while the immutable prototype exotic objects will
only fail if the assignment is of a different value. See
https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects.
Chrome differs in that assignment to window.__proto__ is also handled like an
immutable prototype exotic object. Instead we adhere to the current HTML spec
that says that the assignment should fail unconditionally. See
https://html.spec.whatwg.org/#the-windowproxy-exotic-object and
https://html.spec.whatwg.org/#windowproxy-setprototypeof.
If the HTML spec is changed to make the WindowProxy and Location objects into
immutable prototype exotic objects later, we can update to match the spec then.
Test: js/prototype-assignment.html
* bindings/js/JSDOMWindowProperties.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePrototypeDeclaration):
* bindings/scripts/IDLAttributes.txt:
* dom/EventTarget.idl:
* page/DOMWindow.idl:
2016-12-06 Andreas Kling <akling@apple.com>
[Cocoa] Add some memory usage related information to sysdiagnose state dumps
<https://webkit.org/b/165375>
<rdar://problem/29057243>
Reviewed by Darin Adler.
Follow-up to address two more review comments.
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::javaScriptObjectCounts): Use WTFMove() when returning the
HashCountedSet to avoid making an extra copy.
2016-12-06 Dave Hyatt <hyatt@apple.com>
REGRESSION (Safari 10): Scrolling not working inside height 100% table
https://bugs.webkit.org/show_bug.cgi?id=164366
<rdar://problem/29095535>
Reviewed by Zalan Bujtas.
Added fast/table/overflow-percent-height-regression.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePercentageLogicalHeight):
This patch wasn't merged correctly from Blink. The value returned needed
to be 0, not unset.
2016-12-06 Sam Weinig <sam@webkit.org>
REGRESSION: media/track LayoutTests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=165432
Reviewed by Antoine Quint.
RenderThemeMac was caching the media controls script / style sheets
and not being invalidated when the RuntimeEnabledFeatures changed. So,
we can just cache both.
* bindings/generic/RuntimeEnabledFeatures.h:
Initialize m_areModernMediaControlsEnabled to false.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
Have separate caches for the modern and legacy media control scripts/style sheets.
2016-12-06 Sam Weinig <sam@webkit.org>
DumpRenderTree crashed in com.apple.WebCore: WebCore::MockMediaEndpoint::generateDtlsInfo const + 23
https://bugs.webkit.org/show_bug.cgi?id=165486
<rdar://problem/29149588>
Reviewed by Tim Horton.
The MockMediaEndpoint can be destroyed before the task created in MockMediaEndpoint::generateDtlsInfo()
gets a chance to run, so guard it with a weak pointer.
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::generateDtlsInfo):
* platform/mock/MockMediaEndpoint.h:
2016-12-06 Chris Dumez <cdumez@apple.com>
Add HTML interactive form validation blacklist for some WebKit-specific sites
https://bugs.webkit.org/show_bug.cgi?id=165470
<rdar://problem/29509424>
Reviewed by Simon Fraser.
Add HTML interactive form validation blacklist for some WebKit-specific sites
expecting our old behavior, until they get a chance to be updated.
* html/HTMLFormElement.cpp:
(WebCore::isURLBlacklistedForInteractiveFormValidation):
(WebCore::HTMLFormElement::prepareForSubmission):
2016-12-06 Chris Dumez <cdumez@apple.com>
Unreviewed, rollout r209050.
This change may impact other popovers than the HTML validation one.
The previous code is safer.
* platform/ValidationBubble.h:
* platform/ios/ValidationBubbleIOS.mm:
(-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
(WebCore::ValidationBubble::setAnchorRect):
* platform/spi/ios/UIKitSPI.h:
2016-12-05 Simon Fraser <simon.fraser@apple.com>
Improve the behavior of scroll-into-view when the target is inside position:fixed
https://bugs.webkit.org/show_bug.cgi?id=165354
Reviewed by Zalan Bujtas.
The existing RenderLayer::scrollRectToVisible() code paid no heed to whether the
target was inside position:fixed, resulting in unwanted scrolls.
Fix this by plumbing through from the call sites a "insideFixed" flag which we get
when we call localToAbsolute(), and use this flag to avoid scrolling at all if
unzoomed.
If zoomed and we're focussing something inside position:fixed, and if visual viewports
are enabled, we can compute the visual viewport required to reveal the target rect,
which gives us the ideal scroll position.
Fix a bug on non-iOS platforms when zoomed, which is to scale the viewRect since
frameView.visibleContentRect() gives an unscaled rect on those platforms.
Not all callers of scrollRectToVisible() are fixed, but those that are not will get
the current behavior.
Tests: fast/overflow/scroll-anchor-in-position-fixed.html
fast/visual-viewport/zoomed-scroll-into-view-fixed.html
fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
* dom/Element.cpp:
(WebCore::Element::scrollIntoView):
(WebCore::Element::scrollIntoViewIfNeeded):
(WebCore::Element::scrollIntoViewIfNotVisible):
(WebCore::Element::updateFocusAppearance):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::absoluteCaretBounds):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::revealSelection):
* editing/FrameSelection.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteCaretBounds):
* editing/VisiblePosition.h:
* editing/htmlediting.cpp:
(WebCore::absoluteBoundsForLocalCaretRect):
* editing/htmlediting.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollElementToRect):
(WebCore::FrameView::scrollToAnchor):
* page/PrintContext.cpp:
(WebCore::PrintContext::outputLinkedDestinations):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getLeadingCorner):
(WebCore::RenderElement::getTrailingCorner):
(WebCore::RenderElement::absoluteAnchorRect):
(WebCore::RenderElement::anchorRect): Deleted.
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::getRectToExpose):
(WebCore::RenderLayer::autoscroll):
* rendering/RenderLayer.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::scrollRectToVisible):
* rendering/RenderObject.h:
2016-12-06 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] REGRESSION(r205396): Intermediate CTRuns with initial advances get double counted when glyph origins are enabled
https://bugs.webkit.org/show_bug.cgi?id=165084
Reviewed by Simon Fraser.
When glyph origins are not enabled, an intermediate CTRun's initial advance is simply added
to the previous glyph's advance. However, when glyph origins are enabled, this shouldn't
occur.
Test: fast/text/initial-advance-in-intermediate-run-complex.html
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2016-12-06 Simon Fraser <simon.fraser@apple.com>
Enable visual viewports by default on Mac, and iOS Wk2
https://bugs.webkit.org/show_bug.cgi?id=165452
Reviewed by Zalan Bujtas.
Some tests revealed an issue where, during scrollbar updates, the visual viewport would be
15px wider than the layout viewport, which results in the layout viewport shifting 15px to the
right. Prevent this by disallowing viewport updates during the AdjustViewSize phase; we'll
be called again in postLayoutTasks.
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
2016-12-06 Daniel Bates <dabates@apple.com>
Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
https://bugs.webkit.org/show_bug.cgi?id=165451
Reviewed by Alex Christensen.
Rename Document::shouldEnforceHTTP0_9Sandbox() and ResourceResponseBase::isHttpVersion0_9()
to Document::shouldEnforceHTTP09Sandbox() and ResourceResponseBase::isHTTP09, respectively,
to conform to the WebKit Code Style Guidelines.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
(WebCore::Document::shouldEnforceHTTP09Sandbox): Renamed; formerly named shouldEnforceHTTP0_9Sandbox
* dom/Document.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isHTTP09): Renamed; formerly named isHttpVersion0_9.
* platform/network/ResourceResponseBase.h:
2016-12-06 Daniel Bates <dabates@apple.com>
Use Vector::uncheckedAppend() in more places
https://bugs.webkit.org/show_bug.cgi?id=164952
Reviewed by Darin Adler.
We can use Vector::uncheckedAppend() whenever the number of items that will be appended
to a vector is equal to or less than its capacity. Using Vector::uncheckedAppend() is
more efficient than Vector::append() as it avoids checking the capacity of the vector
before appending a value to the end of it.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::SerializedScriptValue):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::extractJumpTable):
* contentextensions/DFAMinimizer.cpp:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::copyPropertiesInSet): Use Vector::uncheckedAppend() and inline
the assignment of the temporary variable value into the if condition to limit its scope
as it is referenced exactly once in the loop body.
* css/StyleRule.cpp:
(WebCore::StyleRuleGroup::StyleRuleGroup): Use Vector::uncheckedAppend() and write for-loop
using a C++11 range-based for-loop.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setLangArgumentList):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
* dom/DocumentMarkerController.cpp:
(WebCore::updateRenderedRectsForMarker):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::convertToLayoutUnits):
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::AudioBus):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/PathUtilities.cpp:
(WebCore::polygonsForRect):
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::bestSourcesForTypeAndConstraints):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formCreate):
2016-12-04 Darin Adler <darin@apple.com>
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
2016-12-06 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r209390.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestObj.h:
2016-12-06 Tim Horton <timothy_horton@apple.com>
PDF markup/annotations visible in Mail on macOS but not on iOS
https://bugs.webkit.org/show_bug.cgi?id=165444
<rdar://problem/28942896>
Reviewed by Simon Fraser.
No new tests, but enabled an existing test for this feature.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/spi/cg/CoreGraphicsSPI.h:
Make use of CGContextDrawPDFPageWithAnnotations where available,
to paint the page with annotations.
2016-12-06 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Turn on the new CSS parser
https://bugs.webkit.org/show_bug.cgi?id=165213
Reviewed by Zalan Bujtas.
* page/Settings.in:
2016-12-06 Dan Bernstein <mitz@apple.com>
Tried to fix the USE(APPLE_INTERNAL_SDK) build after r209385.
* platform/spi/cocoa/NSTouchBarSPI.h:
2016-12-05 Jer Noble <jer.noble@apple.com>
[pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
https://bugs.webkit.org/show_bug.cgi?id=165377
Reviewed by Darin Adler.
Introduce the concept of "force cursor to become visible" when requesting the pointer be
unlocked. ESC events will cause the pointer to become visible, while normal key events
will not.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerUnlock):
(WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
(WebCore::PointerLockController::documentDetached):
(WebCore::PointerLockController::didLosePointerLock):
* page/PointerLockController.h:
Drive-by fix: apply Darin's feedback to existing functions:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* dom/Element.cpp:
(WebCore::Element::removedFrom):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::elementRemoved):
(WebCore::PointerLockController::documentDetached):
2016-12-06 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for converting dictionaries to JS
https://bugs.webkit.org/show_bug.cgi?id=165367
Reviewed by Darin Adler and Alex Christensen.
- Adds support for converting dictionary types to JSValues via JSDOMConvert.
- Adopts that functionality to correct the CryptoKeyPair implementation, which
is supposed to be a dictionary.
(While doing this, I also update places that were passing both a CryptoKey
and CryptoKeyPair to use a Variant, since they always only wanted one.)
- Re-works DOMPromise and DeferredPromise to be based on JSDOMConvert and IDLTypes.
* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Remove JSCryptoKeyPairCustom.cpp and CryptoKeyPair.cpp.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
* Modules/mediasource/MediaSource.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* bindings/js/JSMediaDevicesCustom.cpp:
* html/MediaController.cpp:
* html/track/TextTrack.cpp:
Add some missing includes.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::text):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::loadingFailed):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolveWithData):
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchResponse.h:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setLocalDescription):
(WebCore::PeerConnectionBackend::setRemoteDescription):
(WebCore::PeerConnectionBackend::addIceCandidate):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedSetLocalDescription):
(WebCore::RTCPeerConnection::queuedSetRemoteDescription):
(WebCore::RTCPeerConnection::queuedAddIceCandidate):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::deny):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::suspend):
(WebCore::AudioContext::resume):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::whenDefinedPromise):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::notifyFinished):
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load):
* css/FontFaceSet.h:
* dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::addElementDefinition):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
* html/HTMLMediaElement.h:
Update to use new IDLType based promises.
* bindings/generic/IDLTypes.h:
Add a new type, ParameterType, to use as the parameter to
DOMPromise/DeferredPromise.
* bindings/js/JSCryptoKeyPairCustom.cpp:
Removed.
* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLDictionary<T>>::convert):
Add JSConverter specialization for IDLDictionary. Have it simply forward to a generated
convertDictionaryToJS function, following the convention set in place by IDLEnumeration.
* bindings/js/JSDOMPromise.cpp:
* bindings/js/JSDOMPromise.h:
Re-write to be based on IDLTypes and JSDOMConvert, simplifying the implementation.
* bindings/js/JSSubtleCryptoCustom.cpp:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
Update for variant based KeyOrKeyPair.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionaryImplementationContent):
Add generation of the convertDictionaryToJS function. I made it require the JSGenerateToJSObject
extended attribute for now, as the majority of dictionaries do not need this code generated for them.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/TestObj.idl:
Add JSGenerateToJSObject to a dictionary to test generation in bindings tests.
* crypto/CryptoAlgorithm.h:
Change KeyOrKeyPairCallback to take a Variant<RefPtr<CryptoKey>, CryptoKeyPair>, rather
than two separate arguments.
* crypto/CryptoKeyPair.cpp:
Removed.
* crypto/CryptoKeyPair.h:
Convert to a struct.
* crypto/CryptoKeyPair.idl:
Convert to a dictionary.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
Update for new signature of KeyOrKeyPairCallback.
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Reject invalid hex colors on the fast path
https://bugs.webkit.org/show_bug.cgi?id=165461
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
Make sure to check for success. There was even a FIXME in the code about this!
Matches our old parser's behavior.
2016-12-05 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls bar in fullscreen cannot be dragged
https://bugs.webkit.org/show_bug.cgi?id=165448
Reviewed by Simon Fraser.
We weren't listening to mousemove and mouseup events on the right event target, window in the context
of a fullscreen shadow root makes no sense. We now listen to those events on the media controls, which
we size to fit the whole of the media element's bounds. We then apply a transform to the controls bar
to apply the dragging distance.
Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.get translation):
(ControlsBar.prototype.set translation):
(ControlsBar.prototype.commitProperty):
(ControlsBar): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen):
(.media-controls.mac.fullscreen > .controls-bar):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype._handleMousedown):
(MacOSFullscreenMediaControls.prototype._handleMousemove):
(MacOSFullscreenMediaControls.prototype._handleMouseup):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow calc in SVG attributes
https://bugs.webkit.org/show_bug.cgi?id=165459
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeLength):
2016-12-05 Brady Eidson <beidson@apple.com>
Build fix followup to r209379:
STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476
Rubberstamped by Tim Horton.
No new tests (No behavior change).
* platform/spi/cocoa/NSTouchBarSPI.h: Strategically relocate NS_ASSUME_NONNULL* macros.
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure the SVGPaint URI and currentColor style still paints using the URI
https://bugs.webkit.org/show_bug.cgi?id=165457
Reviewed by Zalan Bujtas.
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
Add support for this paint type. The old parser doesn't use it.
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix dashboard region parsing
https://bugs.webkit.org/show_bug.cgi?id=165456
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitDashboardRegion):
Make sure to reject whitespace by itself as well as unclosed dashboard-region functions.
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Properly reject large numeric values
https://bugs.webkit.org/show_bug.cgi?id=165455
Reviewed by Zalan Bujtas.
The new parser clamped numeric values in both the slow and fast paths to the max
and min float values. The old parser simply allowed the values to be inf, and then
had std::isinf checks to reject.
Blink rejects also even though it clamps, but I could not discern the mechanism by
which they did so. Therefore I am changing the new parser to exactly match the old
parser. Numeric values are no longer clamped, but instead are allowed to be inf, and
isinf checks now exist in the new parser in the same places they do in the old parser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseSimpleLength):
(WebCore::parseSimpleLengthValue):
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::CSSParserToken):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
2016-12-05 Ricky Mondello <rmondello@apple.com>
STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476
Reviewed by Tim Horton.
* platform/spi/cocoa/NSTouchBarSPI.h: Re-declare the SPI symbols as weak. The cited crash itself is for a
symbol we weren't handling here, but is part of the same group. Re-declare all four of these symbols to
be safe.
2016-12-05 Antoine Quint <graouts@apple.com>
ERROR: post-layout: dirty renderer(s) - Encountered with LayoutTest media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html
https://bugs.webkit.org/show_bug.cgi?id=165312
Reviewed by Simon Fraser.
Reverting part of the code added in https://bugs.webkit.org/show_bug.cgi?id=165287 that triggered
an assertion. We go back to removing previous media controls as we add new ones when the fullscreen
status changes, and simply hide the controls during the animated transition using a CSS pseudo-class.
This also fixes an issue where we wouldn't have removed the previous controls should we have entered
fullscreen in a different way than clicking on the fullscreen button in the media controls.
We restore testing coverage that was fixed due to this assertion.
* Modules/modern-media-controls/controls/media-controls.css:
(:host(:-webkit-animating-full-screen-transition) .media-controls):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.fadeIn):
(MediaControls.prototype.presentInElement): Deleted.
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.buttonWasClicked):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
2016-12-05 Dean Jackson <dino@apple.com>
MediaDocuments crash with modern media controls
https://bugs.webkit.org/show_bug.cgi?id=165446
<rdar://problem/29524959>
Reviewed by Antoine Quint.
The modern media controls inject a <style> element into
the document, which exposed a bug when used in MediaDocuments.
Such documents were not getting a charset, and the hash table
for the CSSParserContexts was crashing.
Test: media/modern-media-controls/media-documents/insert-style-should-not-crash.html
* css/parser/CSSParserMode.h: Guard against an empty charset.
(WebCore::CSSParserContextHash::hash):
* dom/InlineStyleSheetOwner.cpp: Ask for the charset with fallback.
(WebCore::parserContextForElement):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] shape-rendering supports crispEdges rather than crisp-edges
https://bugs.webkit.org/show_bug.cgi?id=165443
Reviewed by Tim Horton.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support setting of custom properties from the CSS OM
https://bugs.webkit.org/show_bug.cgi?id=165442
Reviewed by Tim Horton.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseCustomPropertyValue):
Call in to a new function in CSSParserImpl that can handle
custom property parsing.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseCustomPropertyValue):
New function that is similar to parseValue, but handling custom
properties.
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeCustomPropertyValue):
(WebCore::CSSParserImpl::consumeVariableValue): Deleted.
* css/parser/CSSParserImpl.h:
Rename consumeVariableValue to consumeCustomPropertyValue, since that
is more clear. consumeVariableValue sounds like you might be resolving
a variable reference rather than parsing a custom property's value.
2016-12-05 Tim Horton <timothy_horton@apple.com>
Adopt CAMachPort-as-layer-contents
https://bugs.webkit.org/show_bug.cgi?id=141687
<rdar://problem/19393233>
Reviewed by Darin Adler.
No new tests, just a performance bump.
* platform/spi/cocoa/QuartzCoreSPI.h:
Add some SPI.
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] calcs on column-width that resolve to 0 should be discarded
https://bugs.webkit.org/show_bug.cgi?id=165439
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeColumnWidth):
2016-12-05 Dean Jackson <dino@apple.com>
pointer lock needs to be feature detectable
https://bugs.webkit.org/show_bug.cgi?id=165426
<rdar://problem/29486715>
Reviewed by Antoine Quint.
Annotate the public-facing API for pointer-lock, so
that it is hidden when not available.
Also move the Setting to a RuntimeEnabledFeature, since
pointer-lock is exposed from WebKit as a feature.
Tests: pointer-lock/pointerlock-interface-disabled.html
pointer-lock/pointerlock-interface.html
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPointerLockEnabled):
(WebCore::RuntimeEnabledFeatures::pointerLockEnabled):
* dom/Document.idl:
* dom/Element.idl:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
* page/Settings.in:
2016-12-05 Keith Rollin <krollin@apple.com>
Reduce number of platformMemoryUsage calls
https://bugs.webkit.org/show_bug.cgi?id=164375
Reviewed by Darin Adler.
Removed the calls to WTF::releaseFastMallocFreeMemory (it's already
called elsewhere in the free-all-memory pipeline) and
malloc_zone_pressure_relief (it should be called by the OS on its own
terms).
No new tests -- no new or changed features.
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Leave the Animation type alone when the property is invalid
https://bugs.webkit.org/show_bug.cgi?id=165418
Reviewed by Dean Jackson.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationProperty):
2016-12-05 Antti Koivisto <antti@apple.com>
keyframes do not work when defined inside a style in a shadowRoot
https://bugs.webkit.org/show_bug.cgi?id=164608
<rdar://problem/29210251>
Reviewed by Darin Adler.
With :host and ::slotted rules a keyframe animation affecting an element can be
defined in a style scope different from the element's own scope. Style resolver
loses the scope information when building the RenderStyle so there is no way
to find out the correct scope.
Fix by passing style scope through to style builder and including a scope association
with the animation name. Find the correct scope when resolving keyframes.
Test: fast/shadow-dom/shadow-host-animation.html
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationName):
Include scope with the name.
* css/ElementRuleCollector.cpp:
(WebCore::MatchRequest::MatchRequest):
(WebCore::ElementRuleCollector::addMatchedRule):
(WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
Replace treeContextOrdinal int with Style::ScopeOrdinal enum carrying the same information.
Simplify the code removing unnecessary use of MatchRequest struct.
(WebCore::compareRules):
* css/ElementRuleCollector.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties):
(WebCore::StyleResolver::CascadedProperties::setPropertyInternal):
(WebCore::StyleResolver::CascadedProperties::set):
(WebCore::StyleResolver::CascadedProperties::setDeferred):
Pass styleScopeOrdinal through the cascade mechanism
(WebCore::cascadeLevelForIndex):
(WebCore::StyleResolver::CascadedProperties::addMatch):
(WebCore::StyleResolver::CascadedProperties::addImportantMatches):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
Set styleScopeOrdinal in State when applying style.
(WebCore::StyleResolver::CascadedProperties::addStyleProperties): Deleted.
Move the code to the only caller.
* css/StyleResolver.h:
(WebCore::StyleResolver::State::styleScopeOrdinal):
(WebCore::StyleResolver::State::setStyleScopeOrdinal):
* page/animation/CompositeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::resolveKeyframeStyles):
Find the correct scope for resolving keyframes based on the scope ordinal.
* platform/animation/Animation.cpp:
* platform/animation/Animation.h:
Add m_nameStyleScopeOrdinal that tells the scope where the name is defined.
* style/StyleScope.cpp:
(WebCore::Style::Scope::forOrdinal):
Find the scope for ordinal.
* style/StyleScope.h:
Define ScopeOrdinal types.
(WebCore::Style::operator++):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support glyph-orientation-horizontal and glyph-orientation-vertical
https://bugs.webkit.org/show_bug.cgi?id=165414
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGlyphOrientation):
(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the glyph-orientation-horizontal and glyph-orientation-vertical
properties. They take an angle and allow unitless values.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngle):
Fix a bug in the handling of unitless values for angles. Make sure to
actually pass in the value instead of always doing 0. Blink does not
accept unitless values for angles at all, so this is another difference
to investigate for SVG in the future.
2016-12-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r209299.
This change appears to have caused LayoutTest failures on
Sierra WK1.
Reverted changeset:
"Improve the behavior of scroll-into-view when the target is
inside position:fixed"
https://bugs.webkit.org/show_bug.cgi?id=165354
http://trac.webkit.org/changeset/209299
2016-12-05 Andreas Kling <akling@apple.com>
[Cocoa] Add some memory usage related information to sysdiagnose state dumps
<https://webkit.org/b/165375>
<rdar://problem/29057243>
Reviewed by Darin Adler.
Add a flag to memoryUsageStatistics() to allow gathering of slightly more expensive information.
This mode is used when capturing a state dump for sysdiagnose.
The more expensive information added in this patch relates to information about live objects
and memory on the JavaScript heap.
* WebCore.xcodeproj/project.pbxproj:
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::memoryUsageStatistics):
(WebCore::PerformanceLogging::javaScriptObjectCounts):
(WebCore::PerformanceLogging::didReachPointOfInterest):
* page/PerformanceLogging.h:
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure the transform fast path uses WebKitCSSTransformValue
https://bugs.webkit.org/show_bug.cgi?id=165399
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
(WebCore::parseSimpleTransformValue):
(WebCore::parseSimpleTransformList):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix calc() with -webkit-line-clamp
https://bugs.webkit.org/show_bug.cgi?id=165398
Reviewed by Zalan Bujtas.
Remove the aggressive token type checking up front, since it was causing calc() to not
be allowed.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLineClamp):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-text-decoration
https://bugs.webkit.org/show_bug.cgi?id=165391
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
2016-12-05 Beth Dakin <bdakin@apple.com>
STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476
Rubber-stamped by Brady Eidson.
* platform/spi/cocoa/NSTouchBarSPI.h:
2016-12-05 Beth Dakin <bdakin@apple.com>
STP 19 fails to launch on 16B255
https://bugs.webkit.org/show_bug.cgi?id=165388
-and corresponding-
rdar://problem/29514476
Reviewed by Tim Horton.
Speculative fix.
* platform/spi/cocoa/NSTouchBarSPI.h:
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the 'alphabetic' keyword for text-underline-position
https://bugs.webkit.org/show_bug.cgi?id=165387
Reviewed by Simon Fraser.
Fixes fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix assert when unknown properties are encountered.
https://bugs.webkit.org/show_bug.cgi?id=165385
Reviewed by Zalan Bujtas.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationProperty):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix rx and ry parsing
https://bugs.webkit.org/show_bug.cgi?id=165383
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
rx and ry can be negative in the slow path, so make sure they can be negative in the
fast path too.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeRxOrRy):
Disallow auto as a value since we are not equipped to handle it, and it's not clear if it's
even valid.
2016-12-05 Konstantin Tokarev <annulen@yandex.ru>
Add __STDC_FORMAT_MACROS before inttypes.h is included
https://bugs.webkit.org/show_bug.cgi?id=165374
We need formatting macros like PRIu64 to be available in all places where
inttypes.h header is used. All these usages get inttypes.h definitions
via wtf/Assertions.h header, except SQLiteFileSystem.cpp where formatting
macros are not used anymore since r185129.
This patch fixes multiple build errors with MinGW and reduces number of
independent __STDC_FORMAT_MACROS uses in the code base.
Reviewed by Darin Adler.
No new tests needed.
* platform/sql/SQLiteFileSystem.cpp: Removed unused inttypes.h
inclusion.
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Properly fail on bad values for -webkit-clip-path
https://bugs.webkit.org/show_bug.cgi?id=165382
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] The page-break-* properties are only keyword props for old parser.
https://bugs.webkit.org/show_bug.cgi?id=165381
Reviewed by Dean Jackson.
* css/parser/CSSParser.cpp:
(WebCore::isKeywordPropertyID):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Don't use CSS_PARSER_INTEGER unit for resolved integer calcs.
https://bugs.webkit.org/show_bug.cgi?id=165379
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
2016-12-05 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add parseValue support to new parser. Use new parser for UA sheet too if useNewParser is set.
https://bugs.webkit.org/show_bug.cgi?id=165376
Reviewed by Zalan Bujtas.
* css/StyleColor.cpp:
(WebCore::StyleColor::isColorKeyword):
Include system colors when using the fast parseValue path.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::setupParser):
Add an assert to catch any code path using the old parser when the new parser flag is set.
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::parseRule):
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseSelector):
(WebCore::CSSParser::parseDeclaration):
Patched to use the new parser in UASheetMode as well as other modes when the new parser flag
is set. parseValue is patched to use the new parser's fast paths and to call into CSSParserImpl's
parseValue.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
Support CSSPropertyShapeMargin in the fast path since the old parser did in its fast path.
(WebCore::parseSimpleLengthValue):
Don't ever return unitless numbers. If we accept a unitless number, convert the unit to PX still.
(WebCore::CSSParserFastPaths::parseColor):
Use the CSSValuePool when creating colors on the fast path.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseValue):
* css/parser/CSSParserImpl.h:
Change the return type to be compatible with the old parser's ParseResult flag.
2016-12-05 Konstantin Tokarev <annulen@yandex.ru>
Removed MediaPlayerPrivateTaskTimer
https://bugs.webkit.org/show_bug.cgi?id=165373
Reviewed by Sam Weinig.
It is not used anywhere since QTSDK removal in r165476.
No new tests needed.
* platform/graphics/win/MediaPlayerPrivateTaskTimer.cpp: Removed.
* platform/graphics/win/MediaPlayerPrivateTaskTimer.h: Removed.
2016-12-04 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Eliminate in-place lowercasing in the parser.
https://bugs.webkit.org/show_bug.cgi?id=165368
Reviewed by Darin Adler.
Replace the in-place lowercasing that the parser does with new
mechanisms. In-place lowercasing ruins serialization and doesn't
work on CSS parsed from static strings. It also has the side effect
of mutating strings passed in from JavaScript like for querySelectorAll.
For class/id selectors, we now check if the string is lowercase or not.
If it contains uppercase ASCII characters, then we allocate the RareData
for the selector. RareData now has two fields instead of one for the value,
a matching value (all lowercase in quirks mode), and a serializing value (the
original string). Because this is done at the CSSSelector level, the old
parser has been patched as well for these cases.
In addition, in-place lowercasing was done for pseudo-elements, for
media query features, and for attr(). In all of these cases we do
lowercase converting by first checking if it's needed. Serialization will
not retain the original string in these cases, so we may want to revisit
these cases in the future and apply a solution similar to what we did for
selectors.
* css/CSSGrammar.y.in:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::createRareData):
(WebCore::CSSSelector::selectorText):
(WebCore::CSSSelector::RareData::RareData):
(WebCore::CSSSelector::RareData::~RareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::RareData::create):
(WebCore::CSSSelector::setValue):
(WebCore::CSSSelector::value):
(WebCore::CSSSelector::serializingValue):
* css/MediaQueryExp.cpp:
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/parser/CSSParserToken.cpp:
(WebCore::convertToASCIILowercaseInPlace): Deleted.
(WebCore::CSSParserToken::convertToASCIILowercaseInPlace): Deleted.
* css/parser/CSSParserToken.h:
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAttr):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
(WebCore::CSSSelectorParser::consumePseudo):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readFeature):
2016-12-04 Gyuyoung Kim <gyuyoung.kim@webkit.org>
Fix a build break on EFL since r209303.
Unreviewed build fix.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::exceptionForSerializationFailure): Add a return in the end of function.
2016-12-03 Dan Bernstein <mitz@apple.com>
[Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
https://bugs.webkit.org/show_bug.cgi?id=165276
<rdar://problem/29467040>
Reviewed by Darin Adler.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Make sure to put the client data on the pasteboard,
like we do on macOS.
2016-12-03 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Remove line numbers from StyleRule.
https://bugs.webkit.org/show_bug.cgi?id=165361
Reviewed by Simon Fraser.
StyleRules have a concept of a source line that is eventually passed
to the inspector. This was only ever used by normal rules, i.e., ones with
selectors, and set to 0 for all other rules. This line was set to the line number
at which the end of the selector text occurred.
Because Inspector already computes the start and end range for the selector
text, storing a source line on StyleRule ends up being redundant. This patch
gets rid of the source line and uses the end line of the selector text
instead.
* css/CSSGrammar.y.in:
Remove the code that updates the last seen selector line.
* css/CSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::StyleKeyframe):
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
No longer need to pass in a 0 line number.
* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
(WebCore::StyleRule::create):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
(WebCore::StyleRuleFontFace::StyleRuleFontFace):
(WebCore::StyleRuleGroup::StyleRuleGroup):
(WebCore::StyleRuleCharset::StyleRuleCharset):
(WebCore::StyleRuleNamespace::StyleRuleNamespace):
* css/StyleRule.h:
(WebCore::StyleRuleBase::StyleRuleBase):
(WebCore::StyleRuleBase::sourceLine): Deleted.
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::StyleRuleImport):
Remove m_sourceLine and change the create methods and constructors to not
require a line number.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::createStyleRule):
Line number no longer needed.
(WebCore::CSSParser::updateLastSelectorLineAndPosition): Deleted.
* css/parser/CSSParser.h:
Got rid of the function that tracks and updates the last seen selector line.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeStyleRule):
Fix the rule creation in the new parser to not pass in a 0 line number.
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildSourceRangeObject):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
* inspector/InspectorStyleSheet.h:
Patch the methods that build up the selector range to return the end line
information for selector text so that it can be set as the source line
for the rule (thus eliminating the need to store the line number on the style
rule itself).
2016-12-02 Sam Weinig <sam@webkit.org>
optional sequence values not handled correctly by binding generator
https://bugs.webkit.org/show_bug.cgi?id=142562
Also fixes:
Remove non-standard postMessage overload
https://bugs.webkit.org/show_bug.cgi?id=161911
and
Wrong argument order in window.postMessage
https://bugs.webkit.org/show_bug.cgi?id=63141
Reviewed by Darin Adler.
* WebCore.xcodeproj/project.pbxproj:
Remove no longer needed files.
* bindings/generic/IDLTypes.h:
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLObject>::convert):
Add support for the WebIDL object type.
* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException):
Add support for throwing stack overflow errors.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage): Deleted.
(WebCore::JSDOMWindow::postMessage): Deleted.
* bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp: Removed.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::postMessage): Deleted.
(WebCore::extractTransferables): Deleted.
* bindings/js/JSMessagePortCustom.h: Removed.
* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorker::postMessage): Deleted.
Remove custom bindings for postMessage.
* bindings/js/SerializedScriptValue.h:
Switch to using enum class.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::transferArrayBuffers):
(WebCore::SerializedScriptValue::create):
Add new create function that takes the transfer list, processes it, and returns
MessagePorts and SerializedScriptValue / exception.
(WebCore::CloneBase::throwStackOverflow): Deleted.
(WebCore::CloneDeserializer::throwValidationError): Deleted.
Remove uncalled functions.
* bindings/scripts/CodeGenerator.pm:
(IsRefPtrType):
(IsBuiltinType):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GetBaseIDLType):
Add support for the WebIDL 'object' type.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add tests for 'object'.
* dom/ExceptionCode.h:
Add two new ExceptionCodes:
- ExistingExceptionError, to indicate that implementation code threw a JS exception.
- StackOverflowError, to indicate that a stack overflow exception should be thrown.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
* dom/MessagePort.h:
* dom/MessagePort.idl:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/Worker.h:
* workers/Worker.idl:
Update to call new SerializedScriptValue create function.
2016-12-03 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support Dashboard Regions
https://bugs.webkit.org/show_bug.cgi?id=165357
Reviewed by Daniel Bates.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitDashboardRegion):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-12-02 Simon Fraser <simon.fraser@apple.com>
Improve the behavior of scroll-into-view when the target is inside position:fixed
https://bugs.webkit.org/show_bug.cgi?id=165354
Reviewed by Zalan Bujtas.
The existing RenderLayer::scrollRectToVisible() code paid no heed to whether the
target was inside position:fixed, resulting in unwanted scrolls.
Fix this by plumbing through from the call sites a "insideFixed" flag which we get
when we call localToAbsolute(), and use this flag to avoid scrolling at all if
unzoomed.
If zoomed and we're focussing something inside position:fixed, and if visual viewports
are enabled, we can compute the visual viewport required to reveal the target rect,
which gives us the ideal scroll position.
Fix a bug on non-iOS platforms when zoomed, which is to scale the viewRect since
frameView.visibleContentRect() gives an unscaled rect on those platforms.
Not all callers of scrollRectToVisible() are fixed, but those that are not will get
the current behavior.
Tests: fast/overflow/scroll-anchor-in-position-fixed.html
fast/visual-viewport/zoomed-scroll-into-view-fixed.html
fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
* dom/Element.cpp:
(WebCore::Element::scrollIntoView):
(WebCore::Element::scrollIntoViewIfNeeded):
(WebCore::Element::scrollIntoViewIfNotVisible):
(WebCore::Element::updateFocusAppearance):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::absoluteCaretBounds):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::revealSelection):
* editing/FrameSelection.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteCaretBounds):
* editing/VisiblePosition.h:
* editing/htmlediting.cpp:
(WebCore::absoluteBoundsForLocalCaretRect):
* editing/htmlediting.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollElementToRect):
(WebCore::FrameView::scrollToAnchor):
* page/PrintContext.cpp:
(WebCore::PrintContext::outputLinkedDestinations):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getLeadingCorner):
(WebCore::RenderElement::getTrailingCorner):
(WebCore::RenderElement::absoluteAnchorRect):
(WebCore::RenderElement::anchorRect): Renamed to absoluteAnchorRect().
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::getRectToExpose):
(WebCore::RenderLayer::autoscroll):
* rendering/RenderLayer.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::scrollRectToVisible):
* rendering/RenderObject.h:
2016-11-30 Simon Fraser <simon.fraser@apple.com>
localToAbsolute() does incorrect conversion for elements inside position:fixed with zooming
https://bugs.webkit.org/show_bug.cgi?id=165244
Reviewed by Zalan Bujtas.
RenderView::mapLocalToContainer() and RenderView::mapAbsoluteToLocalPoint() handle the coordinate
mapping through the RenderView's transform (when zoomed), and apply the scroll offset for position:fixed
elements.
They did this in the wrong order; "local to absolute" applied the zoom scale, and then adjusted for the scroll position,
and "absolute to local" applied the scroll position and then the transform.
However that scroll position adjustment should be in unzoomed coordinates, since it's accounting for the
layout adjustment that position:fixed receives (which actually occurs via the localToAbsolute() call
in RenderLayer's accumulateOffsetTowardsAncestor()). "local to absolute" should therefore apply the scroll
adjustment first before the transform, and "absolute to local" the reverse.
In both visual viewport mode, and legacy drifty fixed mode FrameView::scrollPositionForFixedPosition()
returns a scroll offset that is unaffected by zoom, which is correct and confirms this change.
[Confusingly, ScrollView scroll positions _are_ affected by zoom, as the entire document gets bigger.]
RenderGeometryMap::mapToContainer(), which is an optimization on top of RenderView::mapLocalToContainer(),
gets a similar fix.
Test: fast/zooming/client-rect-in-fixed-zoomed.html
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::mapToContainer):
* rendering/RenderView.cpp:
(WebCore::RenderView::mapLocalToContainer):
(WebCore::RenderView::mapAbsoluteToLocalPoint):
2016-12-02 Simon Fraser <simon.fraser@apple.com>
Put names on layers in release builds
https://bugs.webkit.org/show_bug.cgi?id=165347
Reviewed by Tim Horton.
Put names on GraphicsLayers (and therefore CALayers) in release builds. Release names
are a simpler, truncated version of debug names, with <tagname> id class names.
Non-primary layer names converted to lowercase and "layer" removed.
Fix comments that refer to gdb.
Use ENABLE(TREE_DEBUGGING) in more places.
* dom/Node.h:
* dom/Position.h:
* dom/Range.h:
* editing/FrameSelection.h:
* editing/VisiblePosition.h:
* editing/VisibleSelection.h:
* history/HistoryItem.h:
* page/FrameTree.h:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName):
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
(WebCore::GraphicsLayerCA::updateNames):
(WebCore::GraphicsLayerCA::updateBackdropFilters):
(WebCore::GraphicsLayerCA::updateContentsImage):
(WebCore::GraphicsLayerCA::updateClippingStrategy):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::changeLayerTypeTo):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileGridContainerLayerName):
(WebCore::TileController::zoomedOutTileGridContainerLayerName):
(WebCore::TileController::createTileLayer):
* rendering/CounterNode.h:
* rendering/InlineBox.h:
* rendering/InlineFlowBox.h:
* rendering/RenderCounter.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::name):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateAncestorClippingLayer):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateForegroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
* rendering/RenderObject.h:
2016-12-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Update the media controls size as the media element is resized
https://bugs.webkit.org/show_bug.cgi?id=165346
Reviewed by Dean Jackson.
The "resize" event dispatched by HTMLMediaElement indicates a change in the media's
intrinsic size, while the "resize" event dispatched by the HTMLMediaElement's ShadowRoot
indicates that the layout size of the media element has changed. We now use the latter.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
2016-12-02 Andy Estes <aestes@apple.com>
[Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
https://bugs.webkit.org/show_bug.cgi?id=164492
Reviewed by Dan Bernstein.
* Configurations/WebCore.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
com.apple.$(PRODUCT_NAME:rfc1034identifier).
* Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
${PRODUCT_BUNDLE_IDENTIFIER}.
2016-12-02 Chris Dumez <cdumez@apple.com>
HTML Interactive Form Validation popovers do not show in iOS WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=165340
<rdar://problem/29489966>
Reviewed by Simon Fraser.
HTML Interactive Form Validation popovers do not show in iOS WKWebViews,
only in MobileSafari. To address the issue try to find an appropriate
UIViewController to present the popover when the client does not provide
a presenting view controller.
* platform/ValidationBubble.h:
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::fallbackViewController):
(WebCore::ValidationBubble::setAnchorRect):
* platform/spi/ios/UIKitSPI.h:
2016-12-02 Zalan Bujtas <zalan@apple.com>
Remove redundant LayoutUnit conversions.
https://bugs.webkit.org/show_bug.cgi?id=165338
Reviewed by Simon Fraser.
RenderBlockFlow::computeColumnCountAndWidth has some redundant LayoutUnti <-> unsigned conversions.
No change in functionality.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeColumnCountAndWidth):
2016-12-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add rewind and fast-forward support
https://bugs.webkit.org/show_bug.cgi?id=165294
Reviewed by Dean Jackson.
We implement support for rewinding and fast-forwarding the media by pressing dedicated
buttons in fullscreen on macOS. We introduce a new SeekButton class that the existing
RewindButton and ForwardButton classes now extend and which provides handling of
"mousedown" and "mouseup" events to indicate that a button is being pressed to the
UI delegate.
We also introduce a new SeekSupport class from which SeekBackwardSupport and
SeekForwardSupport inherit to integrate with those controls and update the media
time.
Tests: media/modern-media-controls/layout-node/layout-node-parent-of-type.html
media/modern-media-controls/seek-backward-support/seek-backward-support.html
media/modern-media-controls/seek-forward-support/seek-forward-support.html
* Modules/modern-media-controls/controls/forward-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.parentOfType):
* Modules/modern-media-controls/controls/rewind-button.js:
* Modules/modern-media-controls/controls/seek-button.js: Added.
(SeekButton):
(SeekButton.prototype.handleEvent):
(SeekButton.prototype._didStartPressing):
(SeekButton.prototype._didStopPressing):
(SeekButton.prototype._notifyDelegateOfPressingState):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/seek-backward-support.js: Added.
(SeekBackwardSupport.prototype.get control):
(SeekBackwardSupport.prototype.get multiplier):
(SeekBackwardSupport):
* Modules/modern-media-controls/media/seek-forward-support.js: Added.
(SeekForwardSupport.prototype.get control):
(SeekForwardSupport.prototype.get multiplier):
(SeekForwardSupport):
* Modules/modern-media-controls/media/seek-support.js: Added.
(SeekSupport.prototype.get multiplier):
(SeekSupport.prototype.buttonPressedStateDidChange):
(SeekSupport.prototype._startSeeking):
(SeekSupport.prototype._stopSeeking):
(SeekSupport.prototype._seek):
(SeekSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Need to set edit flags properly when user-modify/select are used.
https://bugs.webkit.org/show_bug.cgi?id=165334
Reviewed by Dean Jackson.
The old parser calls parserSetUsesStyleBasedEditability on
StyleSheetContents* from inside isValidKeywordPropertyAndValue. This
is pretty lame, but we have to do the same in order to pass editing
layout tests.
All of the functions below have been patched with the sole purpose of
propagating StyleSheetContents* through to isValidKeywordPropertyAndValue
in the new parser.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParserFastPaths::maybeParseValue):
* css/parser/CSSParserFastPaths.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
2016-12-02 Beth Dakin <bdakin@apple.com>
REGRESSION (r208802): TouchBar pause button doesn't work
https://bugs.webkit.org/show_bug.cgi?id=165333
-and corresponding-
rdar://problem/29487187
Reviewed by Wenson Hsieh.
The previous code got this right by using self.playing. _playing was totally un-
used, so this patch just removes it.
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager setPlaying:]):
2016-12-02 John Wilander <wilander@apple.com>
Require preflight for non-standard CORS-safelisted request headers Accept, Accept-Language, and Content-Language
https://bugs.webkit.org/show_bug.cgi?id=165178
<rdar://problem/18792250>
Reviewed by Youenn Fablet.
Fetch currently only restricts the header Content-Type for simple requests:
https://fetch.spec.whatwg.org/#cors-safelisted-request-header
This means simple CORS requests can send unexpected characters in Accept,
Accept-Language, and Content-Language header values.
RFC 7231 implies restrictions on these header values:
- Accept https://tools.ietf.org/html/rfc7231#section-5.3.2
- Accept-Language https://tools.ietf.org/html/rfc7231#section-5.3.5
- Content-Language https://tools.ietf.org/html/rfc7231#section-3.1.3.2
As per discussions in the W3C WebAppSec group we should try to restrict
these header values to help protect servers that do not expect simple CORS
requests.
Non-standard, safelisted header values should trigger a preflight and require
the headers to be whitelisted in the response's Access-Control-Allow-Headers.
For Fetch in no-cors mode this change means non-standard header values are not
allowed to be set.
Test: http/tests/xmlhttprequest/cors-non-standard-safelisted-headers-should-trigger-preflight.html
* loader/CrossOriginAccessControl.cpp:
(WebCore::isSimpleCrossOriginAccessRequest):
Now calls WebCore::isCrossOriginSafeRequestHeader() instead of
WebCore::isOnAccessControlSimpleRequestHeaderWhitelist().
(WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Deleted.
It was a duplicate of WebCore::isCrossOriginSafeRequestHeader().
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
Now calls WebCore::isCrossOriginSafeRequestHeader() instead of
WebCore::isOnAccessControlSimpleRequestHeaderWhitelist().
* platform/network/HTTPParsers.cpp:
(WebCore::isValidAcceptHeaderValue):
Basic check that the characters are all ASCII alphanumeric, ' ', '*', '.',
'/', ';', or '='.
(WebCore::isValidLanguageHeaderValue):
Basic check that the characters are all ASCII alphanumeric, ' ', '*', '-',
'.', ';', or '='.
(WebCore::isSimpleHeader):
Removed duplicate code. Now calls WebCore::isCrossOriginSafeRequestHeader().
(WebCore::isCrossOriginSafeRequestHeader):
Now makes a call to WebCore::isValidAcceptHeaderValue() for Accept
headers and WebCore::isValidLanguageHeaderValue() for Accept-Language
and Content-Language headers.
* platform/network/HTTPParsers.h:
2016-12-02 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: flowThread->regionInRange(region, startRegion, endRegion) in WebCore::RenderBox::borderBoxRectInRegion
https://bugs.webkit.org/show_bug.cgi?id=152113
<rdar://problem/27720221>
Reviewed by David Hyatt.
In a nested column context, do not process a spanner if it belongs to an inner column.
While populating a flow, we search for possible spanners and construct multicolumnsets accordingly.
However due to the top-down nature of populating flows, a descendant spanner could belong to an inner
flow which hasn't been populated yet.
This patch checks if a potential spanner has an ancestor (which is also a descendant
of the flow that we are populating -> nested) that will eventually create a flow context.
Test: fast/multicol/assert-with-nested-columns-and-spanner.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeColumnCountAndWidth):
(WebCore::RenderBlockFlow::willCreateColumns):
* rendering/RenderBlockFlow.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::isValidColumnSpanner):
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure the z-component of transform-origin can be implicit
https://bugs.webkit.org/show_bug.cgi?id=165326
Reviewed by Tim Horton.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix :any/:host to allow pseudo-elements. Support -webkit-border-radius.
https://bugs.webkit.org/show_bug.cgi?id=165323
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
2016-12-02 Chris Dumez <cdumez@apple.com>
[iOS] Tapping on an HTML validation bubble should dismiss it
https://bugs.webkit.org/show_bug.cgi?id=165122
<rdar://problem/29429372>
Reviewed by Simon Fraser.
Tapping on an HTML validation bubble should dismiss it. Previously it did
nothing.
No new tests, I tried writing one but the validation popover does not
show in the simulator, only on device. I believe at least one reason is that
_presentingViewControllerForWebView() is required and is currently not
implemented by WKTR. I'll look into this issue separately.
* platform/ValidationBubble.h:
* platform/ios/ValidationBubbleIOS.mm:
(-[WebValidationBubbleTapRecognizer initWithPopoverController:withPopoverView:]):
(-[WebValidationBubbleTapRecognizer dismissPopover]):
(WebCore::ValidationBubble::ValidationBubble):
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for the SVG 'kerning' property
https://bugs.webkit.org/show_bug.cgi?id=165315
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeKerning):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-12-02 Sam Weinig <sam@webkit.org>
[WebIDL] Remove support for the 'Nondeterministic' extended attribute
https://bugs.webkit.org/show_bug.cgi?id=165307
Reviewed by Chris Dumez.
We are not currently using the WebReplay functionality that the Nondeterministic
extended attribute is intended to aide. If we come back to WebReplay in the future,
we can bring it back.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateImplementationFunctionCall):
(GetNativeTypeForMemoization): Deleted.
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp: Removed.
* bindings/scripts/test/JS/JSTestNondeterministic.h: Removed.
* bindings/scripts/test/TestNondeterministic.idl: Removed.
* page/Navigator.idl:
* page/Screen.idl:
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the -webkit-letterpress value for text-decoration
https://bugs.webkit.org/show_bug.cgi?id=165313
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTextDecorationLine):
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix the color-gamut media query evaluator
https://bugs.webkit.org/show_bug.cgi?id=165309
Reviewed by Zalan Bujtas).
* css/MediaQueryEvaluator.cpp:
(WebCore::colorGamutEvaluate):
Unknown values should result in a failed match, not a successful match.
2016-12-02 Darin Adler <darin@apple.com>
Remove use of WebCore::Dictionary in MediaSession
https://bugs.webkit.org/show_bug.cgi?id=165296
Reviewed by Chris Dumez.
I am not exactly sure of the status of this code. When I enabled it to test my
changes it did not compile until I fixed some things, and it's far out of date
of the latest draft of the Media Session Standard. But despite that I updated it.
* DerivedSources.make: Removed a line that was breaking the build for some
configurations, perhaps only for programmers from Apple, after r209198.
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::MediaSession): Fixed so it compiles.
(WebCore::MediaSession::setMetadata): Changed argument to use a struct rather
htan a WebCore::Dictionary.
* Modules/mediasession/MediaSession.h: Added a Metadata struct, and used it.
Also fixed the arguments to the constructor.
* Modules/mediasession/MediaSession.idl: Added MediaMetadata and used it instead
of Dictionary.
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure margin and font set the implicit flag properly
https://bugs.webkit.org/show_bug.cgi?id=165306
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::consume4Values):
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure the templatized consumeIdent uses CSSValuePool
https://bugs.webkit.org/show_bug.cgi?id=165302
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParserHelpers.h:
(WebCore::CSSPropertyParserHelpers::consumeIdent):
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font-variant parsing
https://bugs.webkit.org/show_bug.cgi?id=165301
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariantEastAsian):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
Fix a bug with font-variant-east-asian parsing where the id
was getting improperly consumed even when it didn't match.
2016-12-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix animation property parsing
https://bugs.webkit.org/show_bug.cgi?id=165305
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationPropertyList):
Match the old parser by only creating a list for animation properties if there
are two or more comma-separated values. Otherwise just return the CSSValue for
the singleton without creating a list.
2016-12-02 Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
Fix build break when disabling some features.
https://bugs.webkit.org/show_bug.cgi?id=165254
Reviewed by Michael Catanzaro.
If we disable SVG_FONTS or XSLT, then
WebCore::CachedResource::isCORSSameOrigin() would have assertions
on non-existent members. These should be isolated within "#if" as
the other places.
If we're in DEVELOPER_MODE but did not provide
TEST_HYPHENATAION_PATH, then we must mark UNUSED_PARAM() if we're
not on GTK port (ie: EFL).
No new tests as this is a build fix.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin):
- missing #if ENABLED(SVG_FONTS)
- missing #if ENABLED(XSLT)
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanTestDictionariesDirectoryIfNecessary):
- missing UNUSED_PARAM()
2016-12-02 Miguel Gomez <magomez@igalia.com>
[GTK] Use an OpenGL < 3.0 compliant way to request the OpenGL version
https://bugs.webkit.org/show_bug.cgi?id=165253
Reviewed by Carlos Garcia Campos.
Use glGetString(GL_VERSION) to get the OpenGL version, as glGetIntegerv with GL_MAJOR_VERSION
and GL_MINOR_VERSION is only supported from 3.0 on.
Covered by existent tests.
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::version):
2016-12-02 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r208997
https://bugs.webkit.org/show_bug.cgi?id=165283
Reviewed by Carlos Garcia Campos.
* platform/graphics/GLContext.cpp:
glGetIntegerv is defined in gl2.h.
GL_MAJOR_VERSION is defined in gl3.h.
These are not included in the WinCairo build.
2016-11-30 Darin Adler <darin@apple.com>
Stop using WebCore::Dictionary in bindings for Fetch
https://bugs.webkit.org/show_bug.cgi?id=165241
Reviewed by Chris Dumez.
* Modules/fetch/DOMWindowFetch.idl: Use RequestInit instead of Dictionary.
No effect on code generated since this is a JSBuiltin.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy): Deleted. Bindings handle this now.
(WebCore::setMode): Ditto.
(WebCore::setCredentials): Ditto.
(WebCore::setCache): Ditto.
(WebCore::setRedirect): Ditto.
(WebCore::setReferrer): Changed argument from Dictionary to String.
(WebCore::buildOptions): Changed argument from Dictionary to FetchRequest::Init,
and simplified the code accordingly.
(WebCore::FetchRequest::initializeOptions): Ditto.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above changes. Also added the Init struct.
* Modules/fetch/FetchRequest.idl: Added missing "only-if-cached" value to RequestCache.
Added RequestInit dictionary and used it instead of Dictionary. Used more-specific string
types for the method and referrer attributes; no effect at runtime, since the code for
getters is the same for ByteString, USVString, and DOMString and these are read-only.
* Modules/fetch/WorkerGlobalScopeFetch.idl: Use RequestInit instead of Dictionary.
No effect on code generated since this is a JSBuiltin.
2016-12-01 Jiewen Tan <jiewen_tan@apple.com>
Add a runtime flag for SubtleCrypto
https://bugs.webkit.org/show_bug.cgi?id=164982
Reviewed by Brent Fulgham.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled):
(WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled):
* page/Crypto.idl:
2016-12-01 Saam Barati <sbarati@apple.com>
Rename CallFrame::callee() to CallFrame::jsCallee()
https://bugs.webkit.org/show_bug.cgi?id=165293
Reviewed by Keith Miller.
* bindings/js/JSDOMConstructor.h:
(WebCore::JSBuiltinConstructor<JSClass>::construct):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::construct):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::callPlugin):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::construct):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
(WebCore::constructJSTestOverloadedConstructors3):
(WebCore::constructJSTestOverloadedConstructors4):
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::constructJSTestOverloadedConstructorsWithSequence1):
(WebCore::constructJSTestOverloadedConstructorsWithSequence2):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::callObjCFallbackObject):
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::callRuntimeObject):
(JSC::Bindings::callRuntimeConstructor):
2016-12-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Fade controls in when entering and exiting fullscreen
https://bugs.webkit.org/show_bug.cgi?id=165287
Reviewed by Dean Jackson.
Fade controls in when we enter and leave fullscreen.
Test: media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls.fade-in):
(@keyframes fade-in):
(to):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.presentInElement):
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.buttonWasClicked):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
2016-12-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Show and populate the tracks panel
https://bugs.webkit.org/show_bug.cgi?id=165284
Reviewed by Dean Jackson.
We added a TracksPanel in https://bugs.webkit.org/show_bug.cgi?id=165239 which allows to
show a list of media tracks and text tracks to choose from. We now show this panel when
clicking on the tracks button in the controls bar and populate its content with the
list of audio and text tracks for the media element. As an item is picked from the tracks
panel, we toggle the represented track's enabled state and dismiss the panel.
We also pick up the text track container display mostly unchanged from current media controls.
Tests: media/modern-media-controls/tracks-support/tracks-support-click-track-in-panel.html
media/modern-media-controls/tracks-support/tracks-support-show-and-populate-panel.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.showTracksPanel):
* Modules/modern-media-controls/controls/text-tracks.css: Added.
(video::-webkit-media-text-track-container):
(video::cue):
(video::-webkit-media-text-track-display):
(video::-webkit-media-text-track-display-backdrop):
(video::cue(:future)):
(video::-webkit-media-text-track-container b):
(video::-webkit-media-text-track-container u):
(video::-webkit-media-text-track-container i):
(video::-webkit-media-text-track-container .hidden):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport):
(TracksSupport.prototype.destroy):
(TracksSupport.prototype.buttonWasClicked):
(TracksSupport.prototype.tracksPanelNumberOfSections):
(TracksSupport.prototype.tracksPanelTitleForSection):
(TracksSupport.prototype.tracksPanelNumberOfTracksInSection):
(TracksSupport.prototype.tracksPanelTitleForTrackInSection):
(TracksSupport.prototype.tracksPanelIsTrackInSectionSelected):
(TracksSupport.prototype.tracksPanelSelectionDidChange):
(TracksSupport.prototype.syncControl):
(TracksSupport.prototype._textTracks):
(TracksSupport.prototype._audioTracks):
(TracksSupport.prototype._canPickAudioTracks):
(TracksSupport.prototype._canPickTextTracks):
(TracksSupport.prototype._sortedTrackList):
2016-12-01 Brent Fulgham <bfulgham@apple.com>
Rare crash when preparing to print
https://bugs.webkit.org/show_bug.cgi?id=165280
<rdar://problem/28240254>
Reviewed by Dean Jackson.
* page/Frame.cpp:
(WebCore::Frame::setPrinting): Only manipulate the FrameView if it is non-null.
(WebCore::Frame::documentAtPoint): Drive-by fix to change a 0 return to nullptr.
2016-12-01 Simon Fraser <simon.fraser@apple.com>
Put an obvious debug border on layers with backdrop filters
https://bugs.webkit.org/show_bug.cgi?id=165291
Reviewed by Tim Horton.
Put a wide magenta border on layers with backdrop filters, to highlight their performance impact.
Change the "contents layer" color (used by WebGL, video etc) to blue.
Make the clipping layer border slightly narrower.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::getDebugBorderInfo):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setBackdropFilters):
2016-12-01 Brian Burg <bburg@apple.com>
Fix the Windows Release build after r209198
https://bugs.webkit.org/show_bug.cgi?id=165285
Unreviewed build fix.
* Modules/webdriver/NavigatorWebDriver.cpp:
Brute force include all the inlines to work around a JSC issue.
2016-12-01 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Only allow a single font-family in @font-face
https://bugs.webkit.org/show_bug.cgi?id=165278
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamilyDescriptor):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
2016-12-01 Beth Dakin <bdakin@apple.com>
Blacklist Netflix for TouchBar support
https://bugs.webkit.org/show_bug.cgi?id=165104
Rubber-stamped by Tim Horton.
Meant to not have the www. in the first case because that is covered by the second
case.
* html/HTMLMediaElement.cpp:
(WebCore::needsPlaybackControlsManagerQuirk):
2016-12-01 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-overflow-scrolling: touch
https://bugs.webkit.org/show_bug.cgi?id=165275
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-12-01 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::unwrapKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164747
<rdar://problem/29258198>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::unwrapKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-unwrapKey.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-unwrapKey.
2. It implements unwrapKey operations of the following algorithms: AES-KW.
Tests: crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-private.html
crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public.html
crypto/subtle/aes-kw-generate-key-wrap-key-unwrap-key.html
crypto/subtle/aes-kw-import-key-unwrap-raw-key.html
crypto/subtle/rsa-oaep-import-key-unwrap-jwk-oct-key.html
crypto/subtle/unwrapKey-malformed-parameters.html
crypto/workers/subtle/aes-cbc-import-key-unwrap-key.html
crypto/workers/subtle/aes-kw-import-key-unwrap-key.html
crypto/workers/subtle/rsa-oaep-import-key-unwrap-key.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
Add some comments.
(WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
(WebCore::JSSubtleCrypto::unwrapKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::unwrapKey):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
(WebCore::unwrapKeyAES_KW):
(WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformDecrypt):
2016-12-01 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font-variant parsing
https://bugs.webkit.org/show_bug.cgi?id=165266
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariantEastAsian):
(WebCore::consumeFontVariantAlternates):
(WebCore::consumeFontVariantPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
(WebCore::consumeFontVariantList): Deleted.
2016-12-01 Brian Burg <bburg@apple.com>
Web Automation: expose navigator.webdriver if the page is controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=165245
<rdar://problem/29449874>
Reviewed by Joseph Pecoraro.
Move the implementation into OpenSource. It's in Modules/webdriver/.
* CMakeLists.txt:
* DerivedSources.make:
Add new paths and files.
* Modules/webdriver/NavigatorWebDriver.cpp: Added.
(WebCore::NavigatorWebDriver::NavigatorWebDriver):
(WebCore::NavigatorWebDriver::~NavigatorWebDriver):
(WebCore::NavigatorWebDriver::supplementName):
(WebCore::NavigatorWebDriver::isControlledByAutomation):
(WebCore::NavigatorWebDriver::from):
(WebCore::JSNavigator::webdriver):
* Modules/webdriver/NavigatorWebDriver.h: Added.
* Modules/webdriver/NavigatorWebDriver.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
2016-12-01 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Implement IDBObjectStore.getKey().
https://bugs.webkit.org/show_bug.cgi?id=165256
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/idbobjectstore-getkey-1-private.html
storage/indexeddb/modern/idbobjectstore-getkey-1.html
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::getKey):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::createObjectStoreGet):
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::requestedObjectStoreRecordType):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::didGetRecordOnServer):
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::isolatedCopy):
* Modules/indexeddb/shared/IDBGetRecordData.h:
(WebCore::IDBGetRecordData::encode):
(WebCore::IDBGetRecordData::decode):
2016-12-01 Joseph Pecoraro <pecoraro@apple.com>
Misc. cleanup in Modules/fetch
https://bugs.webkit.org/show_bug.cgi?id=165240
Reviewed by Darin Adler.
* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyConsumer.cpp:
* Modules/fetch/FetchBodyOwner.cpp:
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchInternals.js:
(consumeStream):
* Modules/fetch/FetchLoader.cpp:
* Modules/fetch/FetchResponse.h:
Remove unnecessary includes and forward declarations.
* Modules/fetch/DOMWindowFetch.js:
(fetch):
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse):
* Modules/fetch/WorkerGlobalScopeFetch.js:
(fetch):
Improve style.
2016-12-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn off text selection
https://bugs.webkit.org/show_bug.cgi?id=165261
Reviewed by Dean Jackson.
We turn off text selection and force a non-text cursor for all text in media controls.
Tests: media/modern-media-controls/airplay-placard/airplay-placard-text-section.html
media/modern-media-controls/pip-placard/pip-placard-text-section.html
media/modern-media-controls/status-label/status-label-text-selection.html
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
2016-12-01 Chris Dumez <cdumez@apple.com>
Parameter to DOMStringList.contains() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=165257
Reviewed by Alex Christensen.
Parameter to DOMStringList.contains() should be mandatory.
Gecko and Blink have it mandatory but WebKit had it optional and the
string 'undefined" was used by default, which is not helpful.
No new tests, updated existing test.
* dom/DOMStringList.idl:
2016-12-01 Jiewen Tan <jiewen_tan@apple.com>
SubtleCrypto::deriveBits always return NOT_SUPPORTED_ERR for now
https://bugs.webkit.org/show_bug.cgi?id=164745
<rdar://problem/29258118>
Reviewed by Darin Adler.
Since we don't support any cryptography algorithms that has deriveBits operations,
SubtleCrypto::deriveBits will always return NOT_SUPPORTED_ERR for now.
Test: crypto/subtle/deriveBits-malformed-parameters.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDeriveBitsPromise):
(WebCore::JSSubtleCrypto::deriveBits):
* crypto/SubtleCrypto.idl:
2016-12-01 Eric Carlson <eric.carlson@apple.com>
[MediaStream][Mac] Video presets sometimes don't work
https://bugs.webkit.org/show_bug.cgi?id=165214
<rdar://problem/29444533>
Reviewed by Jer Noble.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setPreset): Set videoSettings width and height.
(WebCore::AVVideoCaptureSource::setupCaptureSession): Store videoSettings object for later use.
Set videoSettings width and height.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
(WebCore::AVVideoCaptureSource::sizeForPreset): New.
2016-12-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Promote the "on" property from AirPlayButton to IconButton
https://bugs.webkit.org/show_bug.cgi?id=165260
Reviewed by Dean Jackson.
With the fix for https://bugs.webkit.org/show_bug.cgi?id=165239 we now set the "on"
property for the TracksButton as well, so it makes sense to provide that property
for all IconButton subclasses, not just AirplayButton.
Test: media/modern-media-controls/icon-button/icon-button-on.html
* Modules/modern-media-controls/controls/airplay-button.css:
(button.airplay.on):
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton):
(AirplayButton.prototype.get on): Deleted.
(AirplayButton.prototype.set on): Deleted.
* Modules/modern-media-controls/controls/icon-button.css:
(button.icon:active,):
(button.icon:active): Deleted.
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.get on):
(IconButton.prototype.set on):
2016-11-30 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for File and Blob constructors
https://bugs.webkit.org/show_bug.cgi?id=165218
Reviewed by Darin Adler.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add/remove new files.
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob): Deleted.
* bindings/js/JSFileCustom.cpp: Removed.
Remove custom constructors.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
(GenerateParametersCheck):
Add support for optional sequences without default values. Move string default value
optimizations into GenerateDefaultValue.
* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
* fileapi/Blob.idl:
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:
* fileapi/File.idl:
Add support for the generated constructors.
* fileapi/BlobBuilder.cpp: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.cpp.
* fileapi/BlobBuilder.h: Copied from Source/WebCore/fileapi/WebKitBlobBuilder.h.
* fileapi/WebKitBlobBuilder.cpp: Removed.
* fileapi/WebKitBlobBuilder.h: Removed.
Rename WebKitBlobBuilder to BlobBuilder, and update to work with generated constructor.
* fileapi/BlobPropertyBag.h: Added.
* fileapi/BlobPropertyBag.idl: Added.
Added.
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
Avoid copies of the BlobPart Vector.
* platform/network/BlobPart.h:
Replace header-guards with #pragma once.
2016-12-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Provide a UI object to show a list of tracks
https://bugs.webkit.org/show_bug.cgi?id=165239
Reviewed by Dean Jackson.
We add a new TracksPanel object which we will be using to display a list of
audio and text tracks. The tracks panel can be shown by calling showTracksPanel()
on a MacOSMediaControls object and will be dismissed by hitting the Escape key
or mousing down outside of the panel's bounds. While the tracks panel is up,
arrows can be used to focus individual tracks which can be activated by either
pressing the Space bar or Enter key.
Activating a track will briefly animate its background to indicate selection and
dismissing the tracks panel is also animated with a quick fade-out animation.
Data for the tracks panel is provided by specifying a dataSource property and
implementing the required methods to provide the number of sections in the panel,
the number of tracks in each section, etc.
Tests: media/modern-media-controls/tracks-panel/tracks-panel-hide-click-outside.html
media/modern-media-controls/tracks-panel/tracks-panel-hide-esc-key.html
media/modern-media-controls/tracks-panel/tracks-panel-hide.html
media/modern-media-controls/tracks-panel/tracks-panel-population.html
media/modern-media-controls/tracks-panel/tracks-panel-right-x.html
media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-keyboard.html
media/modern-media-controls/tracks-panel/tracks-panel-select-track-with-mouse.html
media/modern-media-controls/tracks-panel/tracks-panel.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen):
(.media-controls.mac.fullscreen > .controls-bar):
(.media-controls.mac.fullscreen .tracks-panel):
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .tracks-panel):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
(MacOSMediaControls.prototype.hideTracksPanel):
(MacOSMediaControls):
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
* Modules/modern-media-controls/controls/placard.css:
(.placard):
* Modules/modern-media-controls/controls/status-label.css:
(.status-label):
* Modules/modern-media-controls/controls/tracks-panel.css: Added.
(.tracks-panel):
(.tracks-panel *):
(.tracks-panel.fade-out):
(.tracks-panel-section):
(.tracks-panel-section:first-of-type):
(.tracks-panel-section > h3):
(.tracks-panel-section > ul):
(.tracks-panel-section > ul > li):
(.tracks-panel-section > ul > li:focus):
(.tracks-panel-section > ul > li.selected:before):
(.tracks-panel-section > ul > li.animated):
(@keyframes tracks-panel-item-selection):
(22.22%):
* Modules/modern-media-controls/controls/tracks-panel.js: Added.
(TracksPanel.prototype.get presented):
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):
(TracksPanel.prototype.get rightX):
(TracksPanel.prototype.set rightX):
(TracksPanel.prototype.trackNodeSelectionAnimationDidEnd):
(TracksPanel.prototype.mouseMovedOverTrackNode):
(TracksPanel.prototype.mouseExitedTrackNode):
(TracksPanel.prototype.commitProperty):
(TracksPanel.prototype.handleEvent):
(TracksPanel.prototype._childrenFromDataSource.):
(TracksPanel.prototype._childrenFromDataSource):
(TracksPanel.prototype._handleMousedown):
(TracksPanel.prototype._handleKeydown):
(TracksPanel.prototype._dismiss):
(TracksPanel.prototype._focusTrackNode):
(TracksPanel.prototype._focusPreviousTrackNode):
(TracksPanel.prototype._focusNextTrackNode):
(TracksPanel.prototype._focusFirstTrackNode):
(TracksPanel.prototype._focusLastTrackNode):
(TrackNode):
(TrackNode.prototype.activate):
(TrackNode.prototype.handleEvent):
(TrackNode.prototype._animationDidEnd):
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:
2016-12-01 Andreas Kling <akling@apple.com>
Log some basic memory usage stats at interesting points in time
<https://webkit.org/b/165206>
Reviewed by Antti Koivisto.
This patch adds a mechanism to mark points of interests where we might
want to do performance-related logging:
class PerformanceLogging {
enum PointOfInterest {
MainFrameLoadStarted,
MainFrameLoadCompleted,
}
void didReachPointOfInterest(PointOfInterest)
}
You get to this object via MainFrame::performanceLogging().
We respond to these callbacks by logging some basic data about memory usage
to the PerformanceLogging channel.
More PointOfInterest values will be added soon.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::setState):
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
* page/PerformanceLogging.cpp: Added.
(WebCore::toString):
(WebCore::getMemoryUsageStatistics):
(WebCore::PerformanceLogging::PerformanceLogging):
(WebCore::writeLog):
(WebCore::PerformanceLogging::didReachPointOfInterest):
(WebCore::PerformanceLogging::getPlatformMemoryUsageStatistics):
* page/PerformanceLogging.h: Added.
* page/cocoa/PerformanceLoggingCocoa.mm: Added.
(WebCore::PerformanceLogging::getPlatformMemoryUsageStatistics):
* platform/Logging.h:
2016-11-28 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Move more attributes from RenderGrid to the new Grid class
https://bugs.webkit.org/show_bug.cgi?id=165094
Reviewed by Darin Adler.
Moved more attributes from RenderGrid to Grid as they are not really part of the state of
the RenderGrid object. In particular m_autoRepeat{Columns|Rows},
m_autoRepeatEmpty{Columns|Rows} and m_orderIterator. All of them are now private attributes
of the Grid class so clients should use the getters/setters provided by this patch.
This change allows to definitely remove the grid{Column|Row}Count() methods from
RenderGrid. These two became Grid::numTracks() which returns the number of tracks in the
data structure used to represent the grid (currently a matrix). Contrary to that,
RenderGrid::numTracks() returns the actual size of the grid.
No new tests as this is a refactoring.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::numTracks):
(WebCore::RenderGrid::Grid::ensureGridSize):
(WebCore::RenderGrid::Grid::setAutoRepeatTracks):
(WebCore::RenderGrid::Grid::autoRepeatTracks):
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyColumns):
(WebCore::RenderGrid::Grid::setAutoRepeatEmptyRows):
(WebCore::RenderGrid::Grid::hasAutoRepeatEmptyTracks):
(WebCore::RenderGrid::Grid::isEmptyAutoRepeatTrack):
(WebCore::RenderGrid::Grid::autoRepeatEmptyTracks):
(WebCore::RenderGrid::Grid::gridItemSpan):
(WebCore::RenderGrid::Grid::clear):
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::computeTrackSizesForDirection):
(WebCore::RenderGrid::guttersSize):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::rawGridTrackSize):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::trackSizesForComputedStyle):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
(WebCore::RenderGrid::gridAreaBreadthForChild):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::numTracks):
(WebCore::RenderGrid::paintChildren):
(WebCore::RenderGrid::gridColumnCount): Deleted.
(WebCore::RenderGrid::gridRowCount): Deleted.
(WebCore::RenderGrid::hasAutoRepeatEmptyTracks): Deleted.
(WebCore::RenderGrid::isEmptyAutoRepeatTrack): Deleted.
(WebCore::RenderGrid::cachedGridSpan): Deleted.
* rendering/RenderGrid.h:
(WebCore::RenderGrid::autoRepeatCountForDirection): Deleted.
2016-11-30 Brady Eidson <beidson@apple.com>
Unreviewed, rolling out r209168.
Caused 2 API tests to fail
Reverted changeset:
"IndexedDB: When doing puts, don't
"updateAllIndexesForAddRecord" if there are no indexes."
https://bugs.webkit.org/show_bug.cgi?id=165215
http://trac.webkit.org/changeset/209168
2016-11-30 Gyuyoung Kim <gyuyoung.kim@webkit.org>
Build break when using --minimal
https://bugs.webkit.org/show_bug.cgi?id=165238
Reviewed by Darin Adler.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo): Use #if ENABLE(VIDEO_TRACK) guard.
2016-11-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add support for right-to-left layouts
https://bugs.webkit.org/show_bug.cgi?id=165229
Reviewed by Dean Jackson.
We implement the "usesLTRUserInterfaceLayoutDirection" property which is set by HTMLMediaElement
and set a CSS class when the layout is left-to-right, flipping the fullscreen volume slider in the
case that it would not be present (right-to-left).
Test: media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get usesLTRUserInterfaceLayoutDirection):
(MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype._updateControlsIfNeeded):
2016-11-30 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unused parameter of InspectorInstrumentation::didFinishXHRLoading
https://bugs.webkit.org/show_bug.cgi?id=165233
Reviewed by Brian Burg.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
Remove unused ThreadableLoaderClient parameter.
2016-11-30 Brady Eidson <beidson@apple.com>
IndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no indexes.
https://bugs.webkit.org/show_bug.cgi?id=165215
Reviewed by Alex Christensen.
No new tests (No observable behavior change).
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Don't "updateAllIndexesForAddRecord" if there are no indexes.
Avoiding this saved us some IDBKey serialization and Javascript object manipulation.
2016-11-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] LayoutNode: only mark properties as dirty if different than current value
https://bugs.webkit.org/show_bug.cgi?id=165236
Reviewed by Simon Fraser.
Check that the new value is different than the current value before marking the property as dirty.
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set x):
(LayoutNode.prototype.set y):
(LayoutNode.prototype.set width):
(LayoutNode.prototype.set height):
(LayoutNode.prototype.set visible):
(performScheduledLayout):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.get hasScheduledLayoutCallbacks):
2016-11-30 Jiewen Tan <jiewen_tan@apple.com>
SubtleCrypto::deriveKey always return NOT_SUPPORTED_ERR for now
https://bugs.webkit.org/show_bug.cgi?id=164744
<rdar://problem/29258083>
Reviewed by Darin Adler.
Since we don't support any cryptography algorithms that has deriveKey operations,
SubtleCrypto::deriveKey will always return NOT_SUPPORTED_ERR for now.
Test: crypto/subtle/deriveKey-malformed-parameters.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDeriveKeyPromise):
(WebCore::JSSubtleCrypto::deriveKey):
* crypto/SubtleCrypto.idl:
2016-11-26 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::digest to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164742
<rdar://problem/29258037>
Reviewed by Darin Adler.
This patch updates the SubtleCrypto::digest method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-digest.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-digest.
Currently supported digest algorithms are SHA-1, SHA-224, SHA-256, SHA-384,
and SHA-512.
Tests: crypto/subtle/digest-malformed-parameters.html
crypto/subtle/sha1-digest.html
crypto/subtle/sha224-digest.html
crypto/subtle/sha256-digest.html
crypto/subtle/sha384-digest.html
crypto/subtle/sha512-digest.html
crypto/workers/subtle/sha1-digest.html
crypto/workers/subtle/sha224-digest.html
crypto/workers/subtle/sha256-digest.html
crypto/workers/subtle/sha384-digest.html
crypto/workers/subtle/sha512-digest.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionDigestPromise):
(WebCore::JSSubtleCrypto::digest):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::digest):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest):
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest):
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest):
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest):
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest):
* crypto/algorithms/CryptoAlgorithmSHA512.h:
2016-11-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: <audio> controls
https://bugs.webkit.org/show_bug.cgi?id=164619
<rdar://problem/29207215>
Reviewed by Dean Jackson.
Add a default size for <audio> elements (200x50).
Tests: media/modern-media-controls/audio/audio-controls-buttons.html
media/modern-media-controls/audio/audio-controls-metrics.html
* Modules/modern-media-controls/controls/media-controls.css:
(:host(audio)):
2016-11-30 Brady Eidson <beidson@apple.com>
REGRESSION (r209144): API test IndexedDB.DeleteRecovery failing.
https://bugs.webkit.org/show_bug.cgi?id=165216
Rubberstamped by Tim Horton.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB): Change invalid ASSERT into a null check.
2016-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Add separate settings and preferences to enable/disable async decoding for large images and animated images
https://bugs.webkit.org/show_bug.cgi?id=165177
Reviewed by Simon Fraser.
Instead of having the async image decoding be controlled by one setting,
two separate settings are added:
largeImageAsyncDecodingEnabled
animatedImageAsyncDecodingEnabled
And an existing setting is removed:
asyncImageDecodingEnabled
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* loader/cache/CachedImage.h:
* page/Settings.in:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::internalStartAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageObserver.h:
2016-11-30 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
https://bugs.webkit.org/show_bug.cgi?id=155364
<rdar://problem/27720461>
Reviewed by David Hyatt.
RenderNamedFlowThread is considered to be a root for the current renderer context so
we need to bail out from the containing block traversal here (like we do for the RenderView).
Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2016-11-30 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Send operations off to the server in batches instead of one at a time.
https://bugs.webkit.org/show_bug.cgi?id=165221
Reviewed by Myles C. Maxfield.
No new tests (No observable behavior change).
On a profile of "Lots of writes to an IndexedDB", timer scheduling/firing presented as over 10% of the time.
This patch negates much of that.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::pendingOperationTimerFired): Send 100 operations off to the server
before spinning the runloop, instead of only 1.
2016-11-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls are not visible when returning from picture-in-picture playback
https://bugs.webkit.org/show_bug.cgi?id=165183
Reviewed by Dean Jackson.
We need to call MediaControlsHost::setPreparedToReturnVideoLayerToInline() when we return from
picture-in-picture playback such that the video layer is correctly stacked under the media controls.
We call that function in a rAF call to ensure it's performed in sync with the next scheduled layout
or the media controls would not appear in sync with the video layer.
We also fix an error from a previous commit in ControlsVisibilitySupport.
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.syncControl):
(ControlsVisibilitySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._returnMediaLayerToInlineIfNeeded):
2016-11-30 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::wrapKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164746
<rdar://problem/29258160>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::wrapKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-wrapKey.
2. It implements wrapKey operations of the following algorithms: AES-KW.
3. It also replaces JSSubtleCrypto* with auto in all promise functions.
Tests: crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-private.html
crypto/subtle/aes-cbc-import-key-wrap-jwk-rsa-key-public.html
crypto/subtle/aes-kw-import-key-wrap-raw-key.html
crypto/subtle/aes-kw-wrap-key-malformed-parameters.html
crypto/subtle/rsa-oaep-import-key-wrap-jwk-oct-key.html
crypto/subtle/wrapKey-malformed-parameters.html
crypto/workers/subtle/aes-cbc-import-key-wrap-key.html
crypto/workers/subtle/aes-kw-import-key-wrap-key.html
crypto/workers/subtle/rsa-oaep-import-key-wrap-key.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::supportExportKeyThrow):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
(WebCore::JSSubtleCrypto::wrapKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::wrapKey):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::wrapKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
(WebCore::wrapKeyAES_KW):
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformEncrypt):
2016-11-29 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for more missing / exotic IDLTypes
https://bugs.webkit.org/show_bug.cgi?id=165156
Reviewed by Alex Christensen.
- Adds JSDOMConvert support for WebIDL's 'callback interface' and 'callback function'.
- Adds JSDOMConvert support for WebIDL extensions for SerializedScriptValue, Dictionary,
EventListener and XPathNSResolver (moving much of their special casing out of perl and
into JSDOMConvert).
* DerivedSources.make:
Adds $(WebCore)/testing to the list of available IDL directories to keep internals
compiling.
* Modules/webaudio/WaveShaperNode.cpp:
* Modules/webaudio/WaveShaperNode.h:
Update to take curve by reference.
* bindings/generic/IDLTypes.h:
(WebCore::IDLWrapper):
Add helper type, IDLWrapper, which serves as a base type for all IDLTypes that are
RefCounted.
* bindings/js/JSDOMConvert.h:
(WebCore::convert):
(WebCore::Converter<IDLNullable<T>>::convert):
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
(WebCore::JSConverter<IDLCallbackFunction<T>>::convert):
(WebCore::JSConverter<IDLCallbackFunction<T>>::convertNewlyCreated):
(WebCore::Converter<IDLCallbackInterface<T>>::convert):
(WebCore::JSConverter<IDLCallbackInterface<T>>::convert):
(WebCore::JSConverter<IDLCallbackInterface<T>>::convertNewlyCreated):
(WebCore::Converter<IDLSerializedScriptValue<T>>::convert):
(WebCore::JSConverter<IDLSerializedScriptValue<T>>::convert):
(WebCore::Converter<IDLLegacyDictionary<T>>::convert):
(WebCore::Converter<IDLEventListener<T>>::convert):
(WebCore::Converter<IDLXPathNSResolver<T>>::convert):
(WebCore::JSConverter<IDLXPathNSResolver<T>>::convert):
(WebCore::JSConverter<IDLXPathNSResolver<T>>::convertNewlyCreated):
Add converters for the new types. IDLSerializedScriptValue, IDLLegacyDictionary, IDLEventListener and IDLXPathNSResolver
have been templatized to avoid including their implementation classes everywhere. We can improve this in the future by
splitting JSDOMConvert up into to separate files.
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
(IsInterfaceType):
(IsWrapperType):
(ComputeIsCallbackInterface):
(ComputeIsCallbackFunction):
Add new predicates, IsBuiltinType and IsInterfaceType, and re-work IsWrapperType to determine all types that
have a JS wrapper (and consequently a JS{name}.h file).
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
Update to add include for EventListener.
(GetArgumentExceptionFunction):
(GetArgumentExceptionThrower):
(GetAttributeExceptionFunction):
(GetAttributeExceptionThrower):
Add support for exceptions for callbacks.
(PassArgumentExpression):
Factor out logic on how to pass arguments to C++.
(GenerateHeader):
Make toWrapped and JSDOMWrapperConverterTraits work with XPathNSResolver.
(GenerateImplementation):
Update to use PassArgumentExpression and pass a global object reference to JSValueToNative.
(GenerateParametersCheck):
Remove special casing for callbacks.
(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Simplify toJS functions. State and global object are not necessary.
(GetBaseIDLType):
Add support for new types. Add assertion so that unknown types can't get through.
(ShouldPassArgumentByReference):
Rename from ShouldPassWrapperByReference, and merge in CodeGenerator's ShouldPassWrapperByReference.
(JSValueToNativeDOMConvertNeedsThisObject):
Added. Predicate to determine types that need a this object for conversion.
(JSValueToNativeDOMConvertNeedsGlobalObject):
Added. Predicate to determine types that need a global object for conversion.
(JSValueToNative):
Remove special cases for new types.
(NativeToJSValueDOMConvertNeedsState):
Add SerializedScriptValue and XPathNSResolver.
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add SerializedScriptValue and XPathNSResolver.
(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(NativeToJSValue):
Remove unused $statePointer and replace $globalObject with $globalObjectReference. Remove
special cases for new types.
(GenerateConstructorDefinition):
Use PassArgumentExpression.
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerializedScriptValueInterface.idl:
Update tests. Remove test for a readonly attribute returning a Promise, which is not supported
yet (this was caught by the assertion added to GetBaseIDLType). Add tests for passing and returning
SerializedScriptValues from functions.
2016-11-30 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::verify to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164741
<rdar://problem/29257935>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::verify method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-verify.
2. It implements verify operations of the following algorithms: HMAC, and
RSASSA-PKCS1-V1_5.
Tests: crypto/subtle/hmac-generate-key-sign-verify.html
crypto/subtle/hmac-import-key-verify-sha1.html
crypto/subtle/hmac-import-key-verify-sha224.html
crypto/subtle/hmac-import-key-verify-sha256.html
crypto/subtle/hmac-import-key-verify-sha384.html
crypto/subtle/hmac-import-key-verify-sha512.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-key-sign-verify.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha1.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha224.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha256.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha384.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-verify-sha512.html
crypto/subtle/verify-malformed-parameters.html
crypto/workers/subtle/hmac-import-key-verify.html
crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-verify.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionVerifyPromise):
(WebCore::JSSubtleCrypto::verify):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::verify):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::verify):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::verifyRSASSA_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
2016-11-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix columns shorthand parsing
https://bugs.webkit.org/show_bug.cgi?id=165210
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeColumns):
(WebCore::consumeColumnWidthOrCount): Deleted.
Bring over the old parser code, since it was actually better at creating implicit values for auto.
2016-11-30 Andy Estes <aestes@apple.com>
[Cocoa] Pass the embedding app's bundle ID to new instances of NEFilterSource
https://bugs.webkit.org/show_bug.cgi?id=165168
<rdar://problem/29003618>
Reviewed by Simon Fraser.
* platform/RuntimeApplicationChecks.h: Declared applicationBundleIdentifier().
* platform/RuntimeApplicationChecks.mm:
(WebCore::applicationBundleIdentifier): Made non-static.
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): If the new NEFilterSource instance
responds to -setSourceAppBundleID:, call it with applicationBundleIdentifier().
* platform/spi/cocoa/NEFilterSourceSPI.h: Moved NEFilterSourceOptionsRedirectURL into the
!USE(APPLE_INTERNAL_SDK) section and unconditionally declared @property sourceAppBundleID in
a new category on NEFilterSource.
2016-11-30 Brent Fulgham <bfulgham@apple.com>
Use 'childOfType' template when retrieving Shadow DOM elements
https://bugs.webkit.org/show_bug.cgi?id=165145
<rdar://problem/29331830>
Reviewed by Antti Koivisto.
Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
fast/shadow-dom/file-input-element-shadow-manipulation.html
fast/shadow-dom/keygen-shadow-manipulation.html
fast/shadow-dom/media-shadow-manipulation.html
fast/shadow-dom/range-input-element-shadow-manipulation.html
fast/shadow-dom/textarea-shadow-manipulation.html
Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
than relying on expected element positions, as these can be changed by
JavaScript.
Drive by fix: Make more use of is<> and downcast<> templates rather than blindly casting.
* dom/Element.h:
(WebCore::Element::isUploadButton): Added.
(WebCore::Element::isSliderContainerElement): Added.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
the first child is the one we want.
* html/FileInputType.cpp:
(isType): Added.
(WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
the first child is the one we want.
(WebCore::FileInputType::multipleAttributeChanged): Ditto.
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::shadowSelect): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaControls): Ditto.
(WebCore::HTMLMediaElement::hasMediaControls): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::sliderTrackElement): Ditto.
* html/shadow/SliderThumbElement.h:
(isType): Added.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
the first child is the one we want.
2016-11-30 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974
Reviewed by Alex Christensen.
No new tests (No behavior change other than being faster).
Instead of building new SQLiteStatements from scratch each time they're needed and then
finalizing them after they're used for a single operation, we cache them.
For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2016-11-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure -webkit-background-size coalesces identical values.
https://bugs.webkit.org/show_bug.cgi?id=165207
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundSize):
2016-11-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Sync video preview layer and parent layer sizes
https://bugs.webkit.org/show_bug.cgi?id=165139
Reviewed by Jer Noble.
CALayer auto-resizing doesn't work on iOS, so manually reize the video capture preview layer
whenever the background layer's bounds change.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview): Create layer observer.
(WebCore::AVVideoSourcePreview::backgroundLayerBoundsChanged): Sync preview layer and background
layer sizes.
(WebCore::AVVideoSourcePreview::invalidate): Invalidate and clear observer.
(-[WebCoreAVVideoCaptureSourceObserver initWithParent:]):
(-[WebCoreAVVideoCaptureSourceObserver setParent:]): Add KVO bounds observer.
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): Call
parent when "bounds" changes.
(-[WebCoreAVVideoCaptureSourceObserver actionForKey:]): Return nil to disable all animations.
2016-11-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix crash in -webkit-shape-outside parsing
https://bugs.webkit.org/show_bug.cgi?id=165202
Reviewed by Dean Jackson.
* css/CSSBasicShapes.cpp:
(WebCore::buildSerializablePositionOffset):
The old parser never passed in a singleton value ID for top/right/bottom/left.
The new parser does, and it exposed a bug in the serialization code for
shapes that didn't properly create the offset primitive value as a percentage
in those cases.
2016-11-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GLIB] IndexedDB: Switch to use new encoder for IDBKeyData
https://bugs.webkit.org/show_bug.cgi?id=165191
Reviewed by Sergio Villar Senin.
Instead of using KeyedEncoder.
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::isLegacySerializedIDBKeyData): Helper function to check whether the given data were encoded with
KeyedEncoder or not.
(WebCore::serializedTypeForKeyType): Remove #ifdefs for CF and always use the new encoder.
(WebCore::encodeKey): Ditto.
(WebCore::serializeIDBKeyData): Ditto.
(WebCore::decodeKey): Ditto.
(WebCore::deserializeIDBKeyData): Ditto.
2016-11-30 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Null ResourceResponse Preflight requests cause crash
https://bugs.webkit.org/show_bug.cgi?id=165120
<rdar://problem/27911350>
Reviewed by Brian Burg.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
Only inform Web Inspector about successful responses. Informing with a
null response would break the expected Inspector API contract when
notifying about did receive response. Also, when informing Web Inspector
include a didFinishLoading event so the frontend knows this pre-flight
request is complete.
2016-11-30 Brady Eidson <beidson@apple.com>
REGRESSION (209086): IDB tests crash under GuardMalloc.
https://bugs.webkit.org/show_bug.cgi?id=165201
Reviewed by Chris Dumez.
No new tests (Covered by literally every IDB test when run under GuardMalloc).
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commitOnServer): "Commit on Server" operations are special, in that they
are the last operation a transaction does, and they remove themselves from the protector map right away.
So when we remove them from the protector map we also need to remove their raw-pointer from the
"in-progress" queue.
2016-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Some animated image do not animate after reseting their animations
https://bugs.webkit.org/show_bug.cgi?id=165131
Reviewed by Simon Fraser.
Test: fast/images/reset-image-animation.html
The bug happens because the ImageFrameCache does not reset its cached
frames properly when the BitmapImage rests its animation.
-- We need to ignore caching the new NativeImage of an ImageFrame if the
decoding thread is terminated after asynchronously calling
cacheFrameNativeImageAtIndex() on the main thread through callOnMainThread().
Although the decoding thread was terminated this call is still scheduled
to be executed later on the main thread.
-- We need to open the m_frameRequestQueue before starting a new decoding
thread. Opening m_frameRequestQueue clears the enqueued requests from the
previous decoding thread and allows enqueueing requests for the new thread.
-- We need to clear the ImageFrames which were being decoded at the time
the decoding queue was closing and their new NativeImages were not cached.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Assert the NativeImage
is cached for an ImageFrame which is still being decoded.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Open the m_frameRequestQueue
before starting the decoding thread. Don't cache the NativeImage of an ImageFrame
unless the decoding thread is still alive and it the same as the one that makes
the asynchronous call to cacheFrameNativeImageAtIndex().
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Don't request an
image frame to be be asynchronously decoded if it is already being decoded.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Clear the ImageFrames that
were being decoded when the decoding thread terminates.
* testing/Internals.cpp:
(WebCore::Internals::resetImageAnimation):
* testing/Internals.h:
* testing/Internals.idl:
Expose BitmapImage::resetAnimation() through Internals so tests can force it.
2016-11-30 Darin Adler <darin@apple.com>
Streamline and speed up tokenizer and segmented string classes
https://bugs.webkit.org/show_bug.cgi?id=165003
Reviewed by Sam Weinig.
Profiling Speedometer on my iMac showed the tokenizer as one of the
hottest functions. This patch streamlines the segmented string class,
removing various unused features, and also improves some other functions
seen on the Speedometer profile. On my iMac I measured a speedup of
about 3%. Changes include:
- Removed m_pushedChar1, m_pushedChar2, and m_empty data members from the
SegmentedString class and all the code that used to handle them.
- Simplified the SegmentedString advance functions so they are small
enough to get inlined in the HTML tokenizer.
- Updated callers to call the simpler SegmentedString advance functions
that don't handle newlines in as many cases as possible.
- Cut down on allocations of SegmentedString and made code move the
segmented string and the strings that are moved into it rather than
copying them whenever possible.
- Simplified segmented string functions, removing some branches, mostly
from the non-fast paths.
- Removed small unused functions and small functions used in only one
or two places, made more functions private and renamed for clarity.
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::documentWrite): Moved a little more of the common code in here
from the two functions belwo. Removed obsolete comment saying this was not
following the DOM specification because it is. Removed unneeded special
cases for 1 argument and no arguments. Take a reference instead of a pointer.
(WebCore::JSHTMLDocument::write): Updated for above.
(WebCore::JSHTMLDocument::writeln): Ditto.
* css/parser/CSSTokenizer.cpp: Added now-needed include.
* css/parser/CSSTokenizer.h: Removed unneeded include.
* css/parser/CSSTokenizerInputStream.h: Added definition of kEndOfFileMarker
here; this is now separate from the use in the HTMLParser. In the long run,
unclear to me whether it is really needed in either.
* dom/Document.cpp:
(WebCore::Document::prepareToWrite): Added. Helper function used by the three
different variants of write. Using this may prevent us from having to construct
a SegmentedString just to append one string after future refactoring.
(WebCore::Document::write): Updated to take an rvalue reference and move the
value through.
(WebCore::Document::writeln): Use a single write call instead of two.
* dom/Document.h: Changed write to take an rvalue reference to SegmentedString
rather than a const reference.
* dom/DocumentParser.h: Changed insert to take an rvalue reference to
SegmentedString. In the future, should probably overload to take a single
string since that is the normal case.
* dom/RawDataDocumentParser.h: Updated for change to DocumentParser.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::append): Refactored a bit, just enough
so that we don't need an assignment operator for SegmentedString that can
copy a String.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::insert): Updated to take an rvalue reference,
and move the value through.
* html/parser/HTMLDocumentParser.h: Updated for the above.
* html/parser/HTMLEntityParser.cpp:
(WebCore::HTMLEntityParser::consumeNamedEntity): Updated for name changes.
Changed the twao calls to advance here to call advancePastNonNewline; no
change in behavior, but asserts what the code was assuming before, that the
character was not a newline.
* html/parser/HTMLInputStream.h:
(WebCore::HTMLInputStream::appendToEnd): Updated to take an rvalue reference,
and move the value through.
(WebCore::HTMLInputStream::insertAtCurrentInsertionPoint): Ditto.
(WebCore::HTMLInputStream::markEndOfFile): Removed the code to construct a
SegmentedString, overkill since we can just append an individual string.
(WebCore::HTMLInputStream::splitInto): Rewrote the move idiom here to actually
use move, which will reduce reference count churn and other unneeded work.
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Removed unneeded
construction of a SegmentedString, just to append a string.
* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::HTMLSourceTracker): Moved to the class definition.
(WebCore::HTMLSourceTracker::source): Updated for function name change.
* html/parser/HTMLSourceTracker.h: Updated for above.
* html/parser/HTMLTokenizer.cpp: Added now-needed include.
(WebCore::HTMLTokenizer::emitAndResumeInDataState): Use advancePastNonNewline,
since this function is never called in response to a newline character.
(WebCore::HTMLTokenizer::commitToPartialEndTag): Ditto.
(WebCore::HTMLTokenizer::commitToCompleteEndTag): Ditto.
(WebCore::HTMLTokenizer::processToken): Use ADVANCE_PAST_NON_NEWLINE_TO macro
instead of ADVANCE_TO in cases where the character we are advancing past is
known not to be a newline, so we can use the more efficient advance function
that doesn't check for the newline character.
* html/parser/InputStreamPreprocessor.h: Moved kEndOfFileMarker to
SegmentedString.h; not sure that's a good place for it either. In the long run,
unclear to me whether this is really needed.
(WebCore::InputStreamPreprocessor::peek): Added UNLIKELY for the empty check.
Added LIKELY for the not-special character check.
(WebCore::InputStreamPreprocessor::advance): Updated for the new name of the
advanceAndUpdateLineNumber function.
(WebCore::InputStreamPreprocessor::advancePastNonNewline): Added. More
efficient than advance for cases where the last characer is known not to be
a newline character.
(WebCore::InputStreamPreprocessor::skipNextNewLine): Deleted. Was unused.
(WebCore::InputStreamPreprocessor::reset): Deleted. Was unused except in the
constructor; added initial values for the data members to replace.
(WebCore::InputStreamPreprocessor::processNextInputCharacter): Removed long
FIXME comment that didn't really need to be here. Reorganized a bit.
(WebCore::InputStreamPreprocessor::isAtEndOfFile): Renamed and made static.
* html/track/BufferedLineReader.cpp:
(WebCore::BufferedLineReader::nextLine): Updated to not use the poorly named
scanCharacter function to advance past a newline. Also renamed from getLine
and changed to return Optional<String> instead of using a boolean to indicate
failure and an out argument.
* html/track/BufferedLineReader.h:
(WebCore::BufferedLineReader::BufferedLineReader): Use the default, putting
initial values on each data member below.
(WebCore::BufferedLineReader::append): Updated to take an rvalue reference,
and move the value through.
(WebCore::BufferedLineReader::scanCharacter): Deleted. Was poorly named,
and easy to replace with two lines of code at its two call sites.
(WebCore::BufferedLineReader::reset): Rewrote to correctly clear all the
data members of the class, not just the segmented string.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Updated to take
an rvalue reference and move the value through.
* html/track/InbandGenericTextTrack.h: Updated for the above.
* html/track/InbandTextTrack.h: Updated since parseWebVTTFileHeader now
takes an rvalue reference.
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::parseFileHeader): Updated to take an rvalue reference
and move the value through.
(WebCore::WebVTTParser::parseBytes): Updated to pass ownership of the string
in to the line reader append function.
(WebCore::WebVTTParser::parseCueData): Use auto and WTFMove for WebVTTCueData.
(WebCore::WebVTTParser::flush): More of the same.
(WebCore::WebVTTParser::parse): Changed to use nextLine instead of getLine.
* html/track/WebVTTParser.h: Updated for the above.
* html/track/WebVTTTokenizer.cpp:
(WebCore::advanceAndEmitToken): Use advanceAndUpdateLineNumber by its new
name, just advance. No change in behavior.
(WebCore::WebVTTTokenizer::WebVTTTokenizer): Pass a String, not a
SegmentedString, to add the end of file marker.
* platform/graphics/InbandTextTrackPrivateClient.h: Updated since
parseWebVTTFileHeader takes an rvalue reference.
* platform/text/SegmentedString.cpp:
(WebCore::SegmentedString::Substring::appendTo): Moved here from the header.
The only caller is SegmentedString::toString, inside this file.
(WebCore::SegmentedString::SegmentedString): Deleted the copy constructor.
No longer needed.
(WebCore::SegmentedString::operator=): Defined a move assignment operator
rather than an ordinary assignment operator, since that's what the call
sites really need.
(WebCore::SegmentedString::length): Simplified since we no longer need to
support pushed characters.
(WebCore::SegmentedString::setExcludeLineNumbers): Simplified, since we
can just iterate m_otherSubstrings without an extra check. Also changed to
write directly to the data member of Substring instead of using a function.
(WebCore::SegmentedString::updateAdvanceFunctionPointersForEmptyString):
Added. Used when we run out of characters.
(WebCore::SegmentedString::clear): Removed code to clear now-deleted members.
Updated for changes to other member names.
(WebCore::SegmentedString::appendSubstring): Renamed from just append to
avoid ambiguity with the public append function. Changed to take an rvalue
reference, and move in, and added code to set m_currentCharacter properly,
so the caller doesn't have to deal with that.
(WebCore::SegmentedString::close): Updated to use m_isClosed by its new name.
Also removed unneeded comment about assertion that fires when trying to close
an already closed string.
(WebCore::SegmentedString::append): Added overloads for rvalue references of
both entire SegmentedString objects and of String. Streamlined to just call
appendSubstring and append to the deque.
(WebCore::SegmentedString::pushBack): Tightened up since we don't allow empty
strings and changed to take just a string, not an entire segmented string.
(WebCore::SegmentedString::advanceSubstring): Moved logic into the
advancePastSingleCharacterSubstringWithoutUpdatingLineNumber function.
(WebCore::SegmentedString::toString): Simplified now that we don't need to
support pushed characters.
(WebCore::SegmentedString::advancePastNonNewlines): Deleted.
(WebCore::SegmentedString::advance8): Deleted.
(WebCore::SegmentedString::advanceWithoutUpdatingLineNumber16): Renamed from
advance16. Simplified now that there are no pushed characters. Also changed to
access data members of m_currentSubstring directly instead of calling a function.
(WebCore::SegmentedString::advanceAndUpdateLineNumber8): Deleted.
(WebCore::SegmentedString::advanceAndUpdateLineNumber16): Ditto.
(WebCore::SegmentedString::advancePastSingleCharacterSubstringWithoutUpdatingLineNumber):
Renamed from advanceSlowCase. Removed uneeded logic to handle pushed characters.
Moved code in here from advanceSubstring.
(WebCore::SegmentedString::advancePastSingleCharacterSubstring): Renamed from
advanceAndUpdateLineNumberSlowCase. Simplified by calling the function above.
(WebCore::SegmentedString::advanceEmpty): Broke assertion up into two.
(WebCore::SegmentedString::updateSlowCaseFunctionPointers): Updated for name changes.
(WebCore::SegmentedString::advancePastSlowCase): Changed name and meaning of
boolean argument. Rewrote to use the String class less; it's now used only when
we fail to match after the first character rather than being used for the actual
comparison with the literal.
* platform/text/SegmentedString.h: Moved all non-trivial function bodies out of
the class definition to make things easier to read. Moved the SegmentedSubstring
class inside the SegmentedString class, making it a private struct named Substring.
Removed the m_ prefix from data members of the struct, removed many functions from
the struct and made its union be anonymous instead of naming it m_data. Removed
unneeded StringBuilder.h include.
(WebCore::SegmentedString::isEmpty): Changed to use the length of the substring
instead of a separate boolean. We never create an empty substring, nor leave one
in place as the current substring unless the entire segmented string is empty.
(WebCore::SegmentedString::advancePast): Updated to use the new member function
template instead of a non-template member function. The new member function is
entirely rewritten and does the matching directly rather than allocating a string
just to do prefix matching.
(WebCore::SegmentedString::advancePastLettersIgnoringASCIICase): Renamed to make
it clear that the literal must be all non-letters or lowercase letters as with
the other "letters ignoring ASCII case" functions. The three call sites all fit
the bill. Implement by calling the new function template.
(WebCore::SegmentedString::currentCharacter): Renamed from currentChar.
(WebCore::SegmentedString::Substring::Substring): Use an rvalue reference and
move the string in.
(WebCore::SegmentedString::Substring::currentCharacter): Simplified since this
is never used on an empty substring.
(WebCore::SegmentedString::Substring::incrementAndGetCurrentCharacter): Ditto.
(WebCore::SegmentedString::SegmentedString): Overload to take an rvalue reference.
Simplified since there are now fewer data members.
(WebCore::SegmentedString::advanceWithoutUpdatingLineNumber): Renamed from
advance, since this is only safe to use if there is some reason it is OK to skip
updating the line number.
(WebCore::SegmentedString::advance): Renamed from advanceAndUpdateLineNumber,
since doing that is the normal desired behavior and not worth mentioning in the
public function name.
(WebCore::SegmentedString::advancePastNewline): Renamed from
advancePastNewlineAndUpdateLineNumber.
(WebCore::SegmentedString::numberOfCharactersConsumed): Greatly simplified since
pushed characters are no longer supported.
(WebCore::SegmentedString::characterMismatch): Added. Used by advancePast.
* xml/parser/CharacterReferenceParserInlines.h:
(WebCore::unconsumeCharacters): Use toString rather than toStringPreserveCapacity
because the SegmentedString is going to take ownership of the string.
(WebCore::consumeCharacterReference): Updated to use the pushBack that takes just
a String, not a SegmentedString. Also use advancePastNonNewline.
* xml/parser/MarkupTokenizerInlines.h: Added ADVANCE_PAST_NON_NEWLINE_TO.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::insert): Updated since this takes an rvalue reference.
(WebCore::XMLDocumentParser::append): Removed unnecessary code to create a
SegmentedString.
* xml/parser/XMLDocumentParser.h: Updated for above. Also fixed indentation
and initialized most data members.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser): Moved most data member
initialization into the class definition.
(WebCore::XMLDocumentParser::resumeParsing): Removed code that copied a
segmented string, but converted the whole thing into a string before using it.
Now we convert to a string right away.
2016-11-30 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed speculative cmake buildfix after r209070.
* PlatformMac.cmake: New sources added.
2016-11-29 Philippe Normand <pnormand@igalia.com>
[WebRTC][OpenWebRTC] Temporary device selection support
https://bugs.webkit.org/show_bug.cgi?id=165141
Reviewed by Alejandro G. Castro.
Make sure the player handles only one audio and video track at
most for now. The device choice can be influenced with the
WEBKIT_VIDEO_DEVICE and WEBKIT_AUDIO_DEVICE environment variables.
Each variable optionally holds the name of the device to use.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::play):
(WebCore::MediaPlayerPrivateGStreamerOwr::load):
2016-11-29 Claudio Saavedra <csaavedra@igalia.com>
Build fix with !HAVE(ACCESSIBILITY)
* accessibility/AXObjectCache.h:
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AccessibilityReplacedText::postTextStateChangeNotification):
Add dummy implementations.
2016-11-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r209058 and r209074.
https://bugs.webkit.org/show_bug.cgi?id=165188
These changes caused API test StringBuilderTest.Equal to crash
and/or fail. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"Streamline and speed up tokenizer and segmented string
classes"
https://bugs.webkit.org/show_bug.cgi?id=165003
http://trac.webkit.org/changeset/209058
"REGRESSION (r209058): API test StringBuilderTest.Equal
crashing"
https://bugs.webkit.org/show_bug.cgi?id=165142
http://trac.webkit.org/changeset/209074
2016-11-29 Nan Wang <n_wang@apple.com>
AX: ARIA tree & treeitem roles & aria-expanded state not spoken to VoiceOver iOS 10
https://bugs.webkit.org/show_bug.cgi?id=164936
<rdar://problem/29334274>
Reviewed by Chris Fleizach.
Added a new container type on iOS for trees. Also, since the treeitem role is ignored
on iOS, we should expose the expanded status of a treeitem to its accessible children.
Test: accessibility/ios-simulator/treeitem-expanded.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
(-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
(-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
(-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
2016-11-29 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r209096, r209104, and r209114.
Caused over 200 layout test failures on the bots
Reverted changesets:
"IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite
backend."
https://bugs.webkit.org/show_bug.cgi?id=164974
http://trac.webkit.org/changeset/209096
"Followup to:"
https://bugs.webkit.org/show_bug.cgi?id=164974
http://trac.webkit.org/changeset/209104
"REGRESSION (r209104): storage/indexeddb/modern/gc-closes-
database(-private).html timeout."
https://bugs.webkit.org/show_bug.cgi?id=165186
http://trac.webkit.org/changeset/209114
2016-11-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Localization
https://bugs.webkit.org/show_bug.cgi?id=165176
Reviewed by Dean Jackson.
We add a new localization file for the purpose of modern media controls, since we may
require different strings than the legacy one.
* English.lproj/modern-media-controls-localized-strings.js: Added.
* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/pip-placard.js:
(PiPPlacard):
* Modules/modern-media-controls/main.js:
(UIString):
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsScript):
2016-11-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Show an invalid placard when we fail to load a media file
https://bugs.webkit.org/show_bug.cgi?id=165180
Reviewed by Dean Jackson.
We now show a placard with an "invalid" icon when we fail to load the media file.
Tests: media/modern-media-controls/invalid-placard/invalid-placard.html
media/modern-media-controls/placard-support/placard-support-error.html
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/invalid-placard.js: Added.
(InvalidPlacard):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get showsStartButton):
(MediaControls.prototype.set showsStartButton):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.hidePlacard):
(MediaControls.prototype._invalidateChildren):
* Modules/modern-media-controls/controls/placard.css:
(.placard .icon):
* Modules/modern-media-controls/images/iOS/invalid-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/invalid-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/invalid-placard@3x.png: Added.
* Modules/modern-media-controls/images/macOS/invalid-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/invalid-placard@2x.png: Added.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-11-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Only show controls when the controls attribute is set
https://bugs.webkit.org/show_bug.cgi?id=165175
We now respect the value of the media's "controls" attribute so that the start button and the controls
bar are only shown when that attribute is set to "true".
Reviewed by Dean Jackson.
Tests: media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off-audio.html
media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-off.html
media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on-audio.html
media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-on.html
media/modern-media-controls/controls-visibility-support/controls-visibility-support-controls-toggle.html
* Modules/modern-media-controls/controls/controls-bar.js: Added.
(ControlsBar):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.): Deleted.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/controls-visibility-support.js: Added.
(ControlsVisibilitySupport):
(ControlsVisibilitySupport.prototype.destroy):
(ControlsVisibilitySupport.prototype.get mediaEvents):
(ControlsVisibilitySupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport):
(MediaControllerSupport.prototype.handleEvent):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* WebCore.xcodeproj/project.pbxproj:
2016-11-29 Brady Eidson <beidson@apple.com>
Followup to:
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974
Unreviewed.
* Modules/indexeddb/IDBTransaction.h: Until I can explore further why these operations
are not protected in the map, change these raw pointers to RefPtrs.
This fixes issues seen under GuardMalloc.
2016-11-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Inline controls show when entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=165161
Reviewed by Dean Jackson.
We would error when entering fullscreen due to the TracksSupport having its destroy() method
called when tearing down the inline controls and the `mediaController` reference being incorrect.
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.destroy):
2016-11-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Status text stuck saying "Loading" after media starts playing
https://bugs.webkit.org/show_bug.cgi?id=165162
Reviewed by Dean Jackson.
We forgot to handle the case where none of the special messages need to be set and the
status text should be just an empty string, meaning there is no status text shown in the
controls bar and the scrubber appears instead.
Test: media/modern-media-controls/status-support/status-support-playing.html
* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):
2016-11-29 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Cache and reuse SQLiteStatements in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=164974
Reviewed by Alex Christensen.
No new tests (No behavior change other than being faster).
Instead of building new SQLiteStatements from scratch each time they're needed and then
finalizing them after used for a single operation, cache them.
For tests that do puts and/or gets in tight loops, this shows up as a 5%-20% speedup on profiles.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
(WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2016-11-22 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::sign to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164740
<rdar://problem/29257864>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::sign method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-sign.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-sign.
2. It implements sign operations of the following algorithms: HMAC, and
RSASSA-PKCS1-V1_5.
3. It also replaces promise.copyRef() with WTFMove(promise) for all the
capture lists of exception callbacks in promise functions.
Tests: crypto/subtle/hmac-import-key-sign-sha1.html
crypto/subtle/hmac-import-key-sign-sha224.html
crypto/subtle/hmac-import-key-sign-sha256.html
crypto/subtle/hmac-import-key-sign-sha384.html
crypto/subtle/hmac-import-key-sign-sha512.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha1.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha224.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha256.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha384.html
crypto/subtle/rsassa-pkcs1-v1_5-import-key-sign-sha512.html
crypto/subtle/sign-malformed-parameters.html
crypto/workers/subtle/hmac-import-key-sign.html
crypto/workers/subtle/rsassa-pkcs1-v1_5-import-key-sign.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
Fix a minor bug.
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionSignPromise):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::JSSubtleCrypto::sign):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::sign):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::CryptoAlgorithmHMAC::platformSign):
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
(WebCore::CryptoAlgorithmHMAC::platformSign):
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::commonCryptoHMACAlgorithm):
(WebCore::calculateSignature):
Remove a null guardance since the depending bug is resolved.
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::signRSASSA_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
2016-11-29 Chris Dumez <cdumez@apple.com>
Can't download move.simple.com direct deposit transition PDF: Non user-triggered activations of anchors that have a download attribute are ignored
https://bugs.webkit.org/show_bug.cgi?id=165148
<rdar://problem/29421771>
Reviewed by Daniel Bates.
We were ignoring non user-triggered activations of anchors that have a
download attribute which is stricter than Chrome and Firefox and breaks
downloads on move.simple.com. This patch relaxes our policy to allow
simulated clicks on such links, similarly to other browsers.
Web authors can anyway already trigger downloads using script by setting
window.location to a specific URL and serving to right HTTP headers to
trigger a download.
Note that our previous behavior matches the current version of the
specification so I also filed a bug against the HTML specification to
see if we can get it changed to match the behavior of browsers:
- https://github.com/whatwg/html/issues/2116
No new tests, updated existing test.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-11-29 Andy Estes <aestes@apple.com>
[Cocoa] Enable two clang warnings recommended by Xcode
https://bugs.webkit.org/show_bug.cgi?id=164498
Reviewed by Mark Lam.
* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
2016-11-29 Wenson Hsieh <wenson_hsieh@apple.com>
Address post-review feedback following r209070 (AppKit momentum scrolling adoption for scroll snapping)
https://bugs.webkit.org/show_bug.cgi?id=165147
Reviewed by Simon Fraser.
Addresses some additional review feedback after r209070, which adopts _NSScrollingMomentumCalculator for scroll
snapping. See individual changes below for more details. No new tests, since there is no behavior change.
* page/EventHandler.cpp:
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/Page.cpp:
(WebCore::Page::ensureTestTrigger):
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredVelocity):
* page/WheelEventDeltaFilter.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
Rather than force a complete layout pass when the Page first acquires a WheelEventTestTrigger, we now simply
have the scrolling coordinator update its frame node to expect a wheel event test trigger.
* page/scrolling/ScrollingMomentumCalculator.cpp:
(WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
(WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
(WebCore::BasicScrollingMomentumCalculator::animationDuration):
(WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
(WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
* page/scrolling/ScrollingMomentumCalculator.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculator::create):
(WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
(WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
(WebCore::ScrollingMomentumCalculatorMac::animationDuration):
(WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
(WebCore::PlatformWheelEvent::scrollingVelocity):
Change scrolling velocity in PlatformWheelEvent to be a FloatSize instead of a FloatPoint. This change
propagates to the ScrollController, where state variables and arguments pertaining to scrolling velocity are
also now sizes instead of points.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::scheduleStatelessScrollSnap):
* platform/cocoa/ScrollSnapAnimatorState.h:
* platform/cocoa/ScrollSnapAnimatorState.mm:
(WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
(WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):
Refactor elapsed time to be Seconds instead of double. Additionally, use MonotonicTime::now() instead of
monotonicallyIncreasingTime(), and MonotonicTime instead of double for keeping track of the start time.
* platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
2016-11-29 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: The client's transaction operation queue should flush as much to the server as possible.
https://bugs.webkit.org/show_bug.cgi?id=164932
Reviewed by Alex Christensen.
No new tests (No new test necessary, covered extensively by all existing tests).
Profiles showed that on tests with lots of rapid IDBRequests in a row, both the main thread and database
threads were largely idle.
The explanation was simple. Currently the client IDBTransaction queues up operations and only vends them out
to the server 1 at a time, waiting for the previous operation to complete.
While some operations do need to wait for the server to reply, by making the change to send most operations
(all operations with an associated IDBRequest) to the server without waiting we get rid of most of the idleness.
It is possible we can find a few other types of operations to send without waiting, but we haven't yet seen any
test case where they would show up on profiles.
Sending more than one operation at a time was actually a very small part of this change.
As many "edge case" regression tests revealed, we also needed to start having IDBTransaction track all of their
"in progress" operations such that they could be aborted on the client side in exceptional circumstances.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abortInProgressOperations): Abort's all in-progress operations (ones that have already
been sent to the server)
(WebCore::IDBTransaction::abortOnServerAndCancelRequests): Abort in-progress operations before pending ones.
(WebCore::IDBTransaction::operationTimerFired): If we just started an operation with an associated IDBRequest,
schedule the timer to send another one right away.
(WebCore::IDBTransaction::operationDidComplete):
(WebCore::IDBTransaction::connectionClosedFromServer): Abort in-progress operations before pending ones.
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/TransactionOperation.cpp:
(WebCore::IDBClient::TransactionOperation::TransactionOperation):
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::completed):
(WebCore::IDBClient::TransactionOperation::hasIDBRequest):
2016-11-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix ::cue parsing
https://bugs.webkit.org/show_bug.cgi?id=165152
Reviewed by Zalan Bujtas.
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setPseudoElementType):
* css/parser/CSSSelectorParser.cpp:
(WebCore::isOnlyPseudoClassFunction):
(WebCore::isOnlyPseudoElementFunction):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::isPseudoClassFunction): Deleted.
(WebCore::isPseudoElementFunction): Deleted.
2016-11-28 Gavin Barraclough <barraclough@apple.com>
HTMLMediaElement::updateVolume should updateIsPlayingMedia
https://bugs.webkit.org/show_bug.cgi?id=165132
Reviewed by Darin Adler & Jer Noble.
HTMLMediaElement::mediaState takes the volume into account when determining whether media
is playing (audio is not considered to be playing if volume is 0). As such, any change to
the volume may require mediaState to be recomputed.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume):
2016-11-29 Daniel Bates <dabates@apple.com>
Avoid ref-count churn in ShadowParseContext::commitColor()
https://bugs.webkit.org/show_bug.cgi?id=165125
Reviewed by Simon Fraser.
Avoid ref-count churn in ShadowParseContext::commitColor() by moving the passed
color into its instance variable.
Also modified ShadowParseContext::commitColor() to take a Ref<> instead of a
RefPtr<> because it is never passed a nullptr.
* css/parser/CSSParser.cpp:
(WebCore::ShadowParseContext::commitColor):
2016-11-29 Daniel Bates <dabates@apple.com>
Avoid ref-count churn in CSSParser::ValueWithCalculation::setCalculation()
https://bugs.webkit.org/show_bug.cgi?id=165127
Reviewed by Simon Fraser.
Use WTFMove() to move the passed RefPtr into CSSParser::ValueWithCalculation::m_calculation
instead of copying it.
* css/parser/CSSParser.h:
(WebCore::CSSParser::ValueWithCalculation::setCalculation):
2016-11-29 Daniel Bates <dabates@apple.com>
CryptoAlgorithm::generateKey() should take lvalue reference to const CryptoAlgorithmParameters
https://bugs.webkit.org/show_bug.cgi?id=165111
Reviewed by Darin Adler.
CryptoAlgorithm::generateKey() and its overrides always expect to receive a non-null pointer
to a CryptoAlgorithmParameter object and never take ownership of it. This kind of relationship
is best expressed by modifying CryptoAlgorithm::generateKey() to take a lvalue reference to
a const CryptoAlgorithmParameter object.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::generateKey):
* crypto/CryptoAlgorithm.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2016-11-29 Andy Estes <aestes@apple.com>
window.name leaks information across domains
https://bugs.webkit.org/show_bug.cgi?id=158216
<rdar://problem/14548481>
Reviewed by Brent Fulgham.
When updating the history after a cross-origin navigation, the HTML Standard says:
"If the browsing context is a top-level browsing context, but not an auxiliary browsing
context, then set the browsing context's name to the empty string."
https://html.spec.whatwg.org/multipage/browsers.html#resetBCName
Tests: http/tests/security/window-name-after-cross-origin-aux-frame-navigation.html
http/tests/security/window-name-after-cross-origin-main-frame-navigation.html
http/tests/security/window-name-after-cross-origin-sub-frame-navigation.html
http/tests/security/window-name-after-same-origin-aux-frame-navigation.html
http/tests/security/window-name-after-same-origin-main-frame-navigation.html
http/tests/security/window-name-after-same-origin-sub-frame-navigation.html
* loader/FrameLoader.cpp:
(WebCore::shouldClearWindowName): Returns true if frame is a main frame with no opener and
newDocument does not have the same origin as the frame's current document.
(WebCore::FrameLoader::clear): Changed to set m_frame's name to nullAtom if
clearWindowProperties and shouldClearWindowName() are true.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccessStorage): Changed to call isSameOriginAs() and check
m_universalAccess.
(WebCore::SecurityOrigin::isSameOriginAs): Renamed from isThirdParty(); removed the check
for m_universalAccess.
(WebCore::SecurityOrigin::isThirdParty): Renamed to isSameOriginAs().
* page/SecurityOrigin.h: Renamed isThirdParty() to isSameOriginAs() and made it public.
2016-11-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix parsing of "all" in transitions
https://bugs.webkit.org/show_bug.cgi?id=165144
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTransitionProperty):
2016-11-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix @page rule parsing
https://bugs.webkit.org/show_bug.cgi?id=165143
Reviewed by Zalan Bujtas.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
2016-11-29 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the build after r209070
-[ScrollingMomentumCalculatorMac calculateToReachDestination] is only available on Sierra.
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
* platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
2016-11-28 Wenson Hsieh <wenson_hsieh@apple.com>
Scroll snapping on Mac should use AppKit animations
https://bugs.webkit.org/show_bug.cgi?id=147261
<rdar://problem/29395293>
Reviewed by Brent Fulgham.
Refactors the scroll snapping animation logic to support arbitrary scrolling momentum calculators and
introduces ScrollingMomentumCalculatorMac, which wraps AppKit's _NSScrollingMomentumCalculator. On macOS El
Capitan and later, we use the platform scrolling momentum calculator and for all other cases, we fall back to
the preexissting platform-invariant momentum calculator.
Previously, the scroll snapping animation logic was shared between the ScrollSnapAnimatorState and
ScrollController -- namely, the ScrollController would update various parameters of the ScrollSnapAnimatorState
and then tell it to compute animation-specific constants and coefficients. After this patch, ScrollController
will no longer directly set the ScrollSnapAnimatorState's member variables. Instead, it will tell the animator
state to transition to a new ScrollSnapState with the necessary parameters, and the ScrollSnapAnimatorState is
responsible for modifying itself accordingly. Furthermore, logic pertaining to computing animated scroll offsets
is now split out into a new ScrollingMomentumCalculator, which may have different platform-dependent
implementations. The correct calculator is initialized via ScrollingMomentumCalculator::create, which currently
returns a ScrollingMomentumCalculatorMac on El Capitan and later, and a BasicScrollingMomentumCalculator
otherwise.
The new abstracted ScrollingMomentumCalculator is initialized with various parameters describing the scrolled
content and viewport, as well as the initial and target scrolling offsets. The momentum calculator is then able
to compute the animated scroll offset at any given elapsed time, as well as the total duration of the snapping
animation. The ScrollController's scroll snap timer uses this information (via the ScrollSnapAnimatorState) to
animate its client's scroll offset during a snap or glide.
Also reenables 8 failing and/or flaky scroll snapping tests and adds a new layout test. This patch addresses
two causes for failures and flakiness in these scroll snapping tests:
1. When starting or stopping the scroll snap animation timer, we call deferTestsForReason and
removeTestDeferralForReason, respectively. These were actually noops for the first simulated scroll gesture
on each of the failing mainframe scrolling tests due to m_expectsWheelEventTestTrigger being false. This
member variable is updated when AsyncScrollingCoordinator::frameViewLayoutUpdated is invoked, wherein we
call ScrollingStateFrameScrollingNode::setExpectsWheelEventTestTrigger(true) when the test has started
monitoring wheel events. However, if this does not happen before scrolling begins in the test (which is the
case here), then the mainframe scrolling node will not expect a wheel event test trigger even though
eventSender.monitorWheelEvents() has been called. To fix this, we simply make the Page trigger a layout of
the main FrameView when first ensuring the wheel event test trigger on the Page.
2. The second reason for flakiness affects both overflow and mainframe scrolling. Previously, due to the way
we would wait for multiple momentum scroll events before starting to glide, we would end up starting the
scroll snap timer for a snapping animation, stopping it, and then starting it again for the glide animation.
Thus, if the wheel event test trigger's timer fires right after the scroll snap timer stops and before it
starts again due to a glide animation, it will erroneously think that scroll snapping is complete, even
though it's only just about to begin! Now that we know scrolling velocity when we receive the initial
"momentum begin", we now directly transition the scroll snap state from a snapping state to a gliding state
and no longer stop and start the timer during this transition, which means that the test trigger will be
deferred for at least the entire duration of the scroll snapping animation (starting right after the first
"drag end" wheel event).
Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-vertical-then-horizontal.html
* WebCore.xcodeproj/project.pbxproj:
* page/EventHandler.cpp:
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/Page.cpp:
(WebCore::Page::ensureTestTrigger):
Addresses test failures by forcing the mainframe scrolling node to expect wheel event test triggers.
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::create):
(WebCore::WheelEventDeltaFilter::filteredVelocity):
* page/WheelEventDeltaFilter.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
Add support for plumbing filtered scrolling velocity over to the ScrollController.
* page/scrolling/ScrollingMomentumCalculator.cpp: Copied from Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm.
(WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
(WebCore::ScrollingMomentumCalculator::create):
Creates a platform-independent BasicScrollingMomentumCalculator.
(WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
(WebCore::BasicScrollingMomentumCalculator::linearlyInterpolatedOffsetAtProgress):
(WebCore::BasicScrollingMomentumCalculator::cubicallyInterpolatedOffsetAtProgress):
(WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
(WebCore::BasicScrollingMomentumCalculator::animationDuration):
(WebCore::BasicScrollingMomentumCalculator::initializeInterpolationCoefficientsIfNecessary):
(WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
(WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
Interpolation logic ported over from ScrollSnapAnimatorState.
* page/scrolling/ScrollingMomentumCalculator.h: Added.
(WebCore::ScrollingMomentumCalculator::~ScrollingMomentumCalculator):
* page/scrolling/mac/ScrollingMomentumCalculatorMac.h: Copied from Source/WebCore/page/WheelEventDeltaFilter.h.
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm: Added.
(WebCore::ScrollingMomentumCalculator::create):
Creates a ScrollingMomentumCalculatorMac.
(WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
(WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
(WebCore::ScrollingMomentumCalculatorMac::animationDuration):
(WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset):
(WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Deleted.
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
(WebCore::PlatformWheelEvent::scrollingVelocity):
(WebCore::PlatformWheelEvent::copyWithDeltas): Deleted.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::scrollOffset):
(WebCore::ScrollAnimator::viewportSize):
(WebCore::ScrollAnimator::scrollOffsetOnAxis): Deleted.
* platform/ScrollAnimator.h:
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::otherScrollEventAxis):
(WebCore::ScrollController::ScrollController):
(WebCore::ScrollController::shouldOverrideInertialScrolling):
(WebCore::ScrollController::scheduleStatelessScrollSnap):
(WebCore::ScrollController::statelessSnapTransitionTimerFired):
(WebCore::ScrollController::startDeferringTestsDueToScrollSnapping):
(WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping):
(WebCore::ScrollController::processWheelEventForScrollSnap):
(WebCore::ScrollController::updateScrollSnapState):
(WebCore::ScrollController::updateScrollSnapPoints):
Update the ScrollController's ScrollSnapAnimationState for both vertical and horizontal axes. If both axes lack
any snap points, the pointer to the animation state will be nulled out; otherwise, the animation state will
exist.
(WebCore::ScrollController::startScrollSnapTimer):
(WebCore::ScrollController::stopScrollSnapTimer):
(WebCore::ScrollController::scrollSnapTimerFired):
(WebCore::ScrollController::activeScrollSnapIndexForAxis):
(WebCore::ScrollController::setActiveScrollSnapIndexForAxis):
(WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset):
(WebCore::ScrollController::setActiveScrollSnapIndicesForOffset):
(WebCore::ScrollController::scrollSnapPointState): Deleted.
(WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Deleted.
(WebCore::ScrollController::shouldOverrideWheelEvent): Deleted.
(WebCore::projectedInertialScrollDistance): Deleted.
(WebCore::ScrollController::beginScrollSnapAnimation): Deleted.
(WebCore::ScrollController::endScrollSnapAnimation): Deleted.
(WebCore::ScrollController::initializeScrollSnapAnimationParameters): Deleted.
(WebCore::ScrollController::isSnappingOnAxis): Deleted.
* platform/cocoa/ScrollSnapAnimatorState.h:
(WebCore::ScrollSnapAnimatorState::snapOffsetsForAxis):
(WebCore::ScrollSnapAnimatorState::setSnapOffsetsForAxis):
(WebCore::ScrollSnapAnimatorState::currentState):
(WebCore::ScrollSnapAnimatorState::activeSnapIndexForAxis):
(WebCore::ScrollSnapAnimatorState::setActiveSnapIndexForAxis):
* platform/cocoa/ScrollSnapAnimatorState.mm:
(WebCore::projectedInertialScrollDistance):
(WebCore::ScrollSnapAnimatorState::transitionToSnapAnimationState):
(WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
(WebCore::ScrollSnapAnimatorState::transitionToUserInteractionState):
(WebCore::ScrollSnapAnimatorState::transitionToDestinationReachedState):
These methods are used to update the ScrollSnapAnimationState. These state transitions should (and do)
encapsulate all changes that need to be made to the animation state; in other words, the ScrollController should
no longer be reaching directly into the ScrollSnapAnimatorState to change member variables.
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
(WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):
(WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset):
(WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState): Deleted.
(WebCore::ScrollSnapAnimatorState::pushInitialWheelDelta): Deleted.
(WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta): Deleted.
(WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow): Deleted.
(WebCore::ScrollSnapAnimatorState::isSnapping): Deleted.
(WebCore::ScrollSnapAnimatorState::canReachTargetWithCurrentInitialScrollDelta): Deleted.
(WebCore::ScrollSnapAnimatorState::wheelDeltaTrackingIsInProgress): Deleted.
(WebCore::ScrollSnapAnimatorState::hasFinishedTrackingWheelDeltas): Deleted.
(WebCore::ScrollSnapAnimatorState::interpolatedOffsetAtProgress): Deleted.
(WebCore::ScrollSnapAnimationCurveState::initializeSnapProgressCurve): Deleted.
(WebCore::ScrollSnapAnimationCurveState::initializeInterpolationCoefficientsIfNecessary): Deleted.
(WebCore::ScrollSnapAnimationCurveState::interpolatedPositionAtProgress): Deleted.
(WebCore::ScrollSnapAnimationCurveState::shouldCompleteSnapAnimationImmediatelyAtTime): Deleted.
(WebCore::ScrollSnapAnimationCurveState::animationProgressAtTime): Deleted.
The ScrollSnapAnimatorState now tracks state across both axes. This simplifies coordinating scroll snapping in
both horizontal and vertical axes and fixes the issue of the scroll offset not snapping when performing a scroll
in one direction without momentum, then scrolling with momentum in the other direction in a single gesture.
* platform/spi/mac/NSScrollingMomentumCalculatorSPI.h: Added.
2016-11-29 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Queue up completed requests in the client, handle them one by one.
https://bugs.webkit.org/show_bug.cgi?id=165000
Reviewed by Alex Christensen.
No new tests (Covered extensively by every existing test).
Currently when a TransactionOperation completes on the server, it immediately completes
itself on the client side, including scheduling an event dispatch if necessary.
This patch changes it so that "server completed operations" instead queue up in the
IDBTransaction and are "client-side completed" asynchronously, 1-by-1.
Currently this is a "no behavior change" because only one operation is ever sent to
the server at a time.
But that will change with https://webkit.org/b/164932
And this patch is a pre-requisite for that.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBRequest::completeRequestAndDispatchEvent):
(WebCore::IDBRequest::requestCompleted): Deleted.
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::scheduleOperation):
(WebCore::IDBTransaction::schedulePendingOperationTimer):
(WebCore::IDBTransaction::pendingOperationTimerFired):
(WebCore::IDBTransaction::operationCompletedOnServer):
(WebCore::IDBTransaction::scheduleCompletedOperationTimer):
(WebCore::IDBTransaction::completedOperationTimerFired):
(WebCore::IDBTransaction::completeNoncursorRequest):
(WebCore::IDBTransaction::completeCursorRequest):
(WebCore::IDBTransaction::finishedDispatchEventForRequest):
(WebCore::IDBTransaction::didStart):
(WebCore::IDBTransaction::didOpenCursorOnServer):
(WebCore::IDBTransaction::didIterateCursorOnServer):
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
(WebCore::IDBTransaction::didGetRecordOnServer):
(WebCore::IDBTransaction::didGetCountOnServer):
(WebCore::IDBTransaction::didDeleteRecordOnServer):
(WebCore::IDBTransaction::didClearObjectStoreOnServer):
(WebCore::IDBTransaction::putOrAddOnServer):
(WebCore::IDBTransaction::didPutOrAddOnServer):
(WebCore::IDBTransaction::operationCompletedOnClient):
(WebCore::IDBTransaction::deactivate):
(WebCore::IDBTransaction::connectionClosedFromServer):
(WebCore::IDBTransaction::scheduleOperationTimer): Deleted.
(WebCore::IDBTransaction::operationTimerFired): Deleted.
(WebCore::IDBTransaction::operationDidComplete): Deleted.
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::completeOperation):
* Modules/indexeddb/client/TransactionOperation.cpp:
(WebCore::IDBClient::TransactionOperation::TransactionOperation):
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread):
(WebCore::IDBClient::TransactionOperation::transitionToComplete):
(WebCore::IDBClient::TransactionOperation::doComplete):
(WebCore::IDBClient::TransactionOperation::idbRequest):
(WebCore::IDBClient::TransactionOperation::performCompleteOnOriginThread): Deleted.
(WebCore::IDBClient::TransactionOperation::completed): Deleted.
2016-11-29 Zalan Bujtas <zalan@apple.com>
Safari (WebKit) doesn't wrap element within flex when width comes below min-width
https://bugs.webkit.org/show_bug.cgi?id=136041
<rdar://problem/25569370>
Reviewed by Darin Adler.
While figuring out whether a particular flex item fits the current line, we need to take
the min-width into account too. This matches both FF and Chrome behaviour.
Tests: fast/flexbox/flex-wrap-when-min-widht-is-set-1.html
fast/flexbox/flex-wrap-when-min-widht-is-set-2.html
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeNextFlexLine):
2016-11-29 Antti Koivisto <antti@apple.com>
Try to fix win/gtk build.
* style/StyleUpdate.h:
(WebCore::Style::ElementUpdate::ElementUpdate):
Add explicit constructor for compilers that don't support C++14 list initialization correctly.
2016-11-28 Antti Koivisto <antti@apple.com>
Slotted nodes ignore transition
https://bugs.webkit.org/show_bug.cgi?id=160866
<rdar://problem/29231901>
Reviewed by Sam Weinig.
The problem is that slot (display:contents) always triggers full render tree rebuild when something
changes in the slotted subtree. This causes animation to jump to end (may be another bug).
Test: fast/shadow-dom/shadow-host-transition.html
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
* style/StyleChange.h:
Rearrange so the strongest ('Detach') is the highest.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
If style was display:contents and stays that way, use 'Inherit' StyleChange which doesn't force render tree rebuild.
Refactor more of the functionality to createAnimatedElementUpdate.
* style/StyleTreeResolver.h:
2016-11-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash in WebCore::PlatformDisplayX11::supportsXComposite when running under Wayland
https://bugs.webkit.org/show_bug.cgi?id=164917
Reviewed by Michael Catanzaro.
WebKitGTK+ appplications are expected to call gtk_init(), because WebKitGTK+, like GTK+ itself, requires a
display to work. We currently fallback to create a X11 display when X11 is enabled in cases where GTK+ doesn't
have a default display (gtk_init() wasn't called or failed). That's why we end up creating an X11 display under
Wayland when both Wayland and X11 option are enabled. The code assumes X11 display creation will always work if
X11 is enabled, but that's not true now that we support also Wayland at runtime. So, we should try to get a
native display before creating the PlatformDisplay. Rendering will not work in any case when gtk_init() is not
called, but in most of the cases those applications are not actually going to render anything, so this way at
least we will not crash.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay): Use create() method for X11 and Wayland if we couldn't get a
native display from GTK+. If everything fails create a display with no native.
(WebCore::PlatformDisplay::PlatformDisplay): Add NativeDisplayOwned parameter.
* platform/graphics/PlatformDisplay.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create): Try to create a native Wayland display or return nullptr.
(WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Initialize NativeDisplayOwned parameter.
(WebCore::PlatformDisplayWayland::~PlatformDisplayWayland): Destroy the display if owned.
(WebCore::PlatformDisplayWayland::initialize): Return early if native display is nullptr.
* platform/graphics/wayland/PlatformDisplayWayland.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create): Try to create a native X11 display or return nullptr.
(WebCore::PlatformDisplayX11::PlatformDisplayX11): Use NativeDisplayOwned now.
(WebCore::PlatformDisplayX11::~PlatformDisplayX11): Ditto.
* platform/graphics/x11/PlatformDisplayX11.h:
2016-11-28 Matt Baker <mattbaker@apple.com>
Web Inspector: Debugger should have an option for showing asynchronous call stacks
https://bugs.webkit.org/show_bug.cgi?id=163230
<rdar://problem/28698683>
Reviewed by Joseph Pecoraro.
Test: inspector/debugger/async-stack-trace.html
* inspector/InspectorInstrumentation.cpp:
(WebCore::didScheduleAsyncCall):
Helper function used by by instrumentation hooks. Informs the debugger
agent that an asynchronous call was scheduled for the current script
execution state.
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didFireTimerImpl):
Asynchronous stack trace plumbing for timers (setTimeout, setInterval).
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
Asynchronous stack trace plumbing for requestAnimationFrame.
2016-11-28 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, followup patch after r209059.
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2016-11-28 Jiewen Tan <jiewen_tan@apple.com>
ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
https://bugs.webkit.org/show_bug.cgi?id=165124
<rdar://problem/29413805>
Reviewed by Daniel Bates.
We should only dereference callbacks after being back to the Document/Worker threads as
it might destroy promises in the work queue which will then trigger the assertion.
Covered by existing tests.
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2016-11-28 Darin Adler <darin@apple.com>
Streamline and speed up tokenizer and segmented string classes
https://bugs.webkit.org/show_bug.cgi?id=165003
Reviewed by Sam Weinig.
Profiling Speedometer on my iMac showed the tokenizer as one of the
hottest functions. This patch streamlines the segmented string class,
removing various unused features, and also improves some other functions
seen on the Speedometer profile. On my iMac I measured a speedup of
about 3%. Changes include:
- Removed m_pushedChar1, m_pushedChar2, and m_empty data members from the
SegmentedString class and all the code that used to handle them.
- Simplified the SegmentedString advance functions so they are small
enough to get inlined in the HTML tokenizer.
- Updated callers to call the simpler SegmentedString advance functions
that don't handle newlines in as many cases as possible.
- Cut down on allocations of SegmentedString and made code move the
segmented string and the strings that are moved into it rather than
copying them whenever possible.
- Simplified segmented string functions, removing some branches, mostly
from the non-fast paths.
- Removed small unused functions and small functions used in only one
or two places, made more functions private and renamed for clarity.
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::documentWrite): Moved a little more of the common code in here
from the two functions belwo. Removed obsolete comment saying this was not
following the DOM specification because it is. Removed unneeded special
cases for 1 argument and no arguments. Take a reference instead of a pointer.
(WebCore::JSHTMLDocument::write): Updated for above.
(WebCore::JSHTMLDocument::writeln): Ditto.
* css/parser/CSSTokenizer.cpp: Added now-needed include.
* css/parser/CSSTokenizer.h: Removed unneeded include.
* css/parser/CSSTokenizerInputStream.h: Added definition of kEndOfFileMarker
here; this is now separate from the use in the HTMLParser. In the long run,
unclear to me whether it is really needed in either.
* dom/Document.cpp:
(WebCore::Document::prepareToWrite): Added. Helper function used by the three
different variants of write. Using this may prevent us from having to construct
a SegmentedString just to append one string after future refactoring.
(WebCore::Document::write): Updated to take an rvalue reference and move the
value through.
(WebCore::Document::writeln): Use a single write call instead of two.
* dom/Document.h: Changed write to take an rvalue reference to SegmentedString
rather than a const reference.
* dom/DocumentParser.h: Changed insert to take an rvalue reference to
SegmentedString. In the future, should probably overload to take a single
string since that is the normal case.
* dom/RawDataDocumentParser.h: Updated for change to DocumentParser.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::append): Refactored a bit, just enough
so that we don't need an assignment operator for SegmentedString that can
copy a String.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::insert): Updated to take an rvalue reference,
and move the value through.
* html/parser/HTMLDocumentParser.h: Updated for the above.
* html/parser/HTMLEntityParser.cpp:
(WebCore::HTMLEntityParser::consumeNamedEntity): Updated for name changes.
Changed the twao calls to advance here to call advancePastNonNewline; no
change in behavior, but asserts what the code was assuming before, that the
character was not a newline.
* html/parser/HTMLInputStream.h:
(WebCore::HTMLInputStream::appendToEnd): Updated to take an rvalue reference,
and move the value through.
(WebCore::HTMLInputStream::insertAtCurrentInsertionPoint): Ditto.
(WebCore::HTMLInputStream::markEndOfFile): Removed the code to construct a
SegmentedString, overkill since we can just append an individual string.
(WebCore::HTMLInputStream::splitInto): Rewrote the move idiom here to actually
use move, which will reduce reference count churn and other unneeded work.
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Removed unneeded
construction of a SegmentedString, just to append a string.
* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::HTMLSourceTracker): Moved to the class definition.
(WebCore::HTMLSourceTracker::source): Updated for function name change.
* html/parser/HTMLSourceTracker.h: Updated for above.
* html/parser/HTMLTokenizer.cpp: Added now-needed include.
(WebCore::HTMLTokenizer::emitAndResumeInDataState): Use advancePastNonNewline,
since this function is never called in response to a newline character.
(WebCore::HTMLTokenizer::commitToPartialEndTag): Ditto.
(WebCore::HTMLTokenizer::commitToCompleteEndTag): Ditto.
(WebCore::HTMLTokenizer::processToken): Use ADVANCE_PAST_NON_NEWLINE_TO macro
instead of ADVANCE_TO in cases where the character we are advancing past is
known not to be a newline, so we can use the more efficient advance function
that doesn't check for the newline character.
* html/parser/InputStreamPreprocessor.h: Moved kEndOfFileMarker to
SegmentedString.h; not sure that's a good place for it either. In the long run,
unclear to me whether this is really needed.
(WebCore::InputStreamPreprocessor::peek): Added UNLIKELY for the empty check.
Added LIKELY for the not-special character check.
(WebCore::InputStreamPreprocessor::advance): Updated for the new name of the
advanceAndUpdateLineNumber function.
(WebCore::InputStreamPreprocessor::advancePastNonNewline): Added. More
efficient than advance for cases where the last characer is known not to be
a newline character.
(WebCore::InputStreamPreprocessor::skipNextNewLine): Deleted. Was unused.
(WebCore::InputStreamPreprocessor::reset): Deleted. Was unused except in the
constructor; added initial values for the data members to replace.
(WebCore::InputStreamPreprocessor::processNextInputCharacter): Removed long
FIXME comment that didn't really need to be here. Reorganized a bit.
(WebCore::InputStreamPreprocessor::isAtEndOfFile): Renamed and made static.
* html/track/BufferedLineReader.cpp:
(WebCore::BufferedLineReader::nextLine): Updated to not use the poorly named
scanCharacter function to advance past a newline. Also renamed from getLine
and changed to return Optional<String> instead of using a boolean to indicate
failure and an out argument.
* html/track/BufferedLineReader.h:
(WebCore::BufferedLineReader::BufferedLineReader): Use the default, putting
initial values on each data member below.
(WebCore::BufferedLineReader::append): Updated to take an rvalue reference,
and move the value through.
(WebCore::BufferedLineReader::scanCharacter): Deleted. Was poorly named,
and easy to replace with two lines of code at its two call sites.
(WebCore::BufferedLineReader::reset): Rewrote to correctly clear all the
data members of the class, not just the segmented string.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Updated to take
an rvalue reference and move the value through.
* html/track/InbandGenericTextTrack.h: Updated for the above.
* html/track/InbandTextTrack.h: Updated since parseWebVTTFileHeader now
takes an rvalue reference.
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::parseFileHeader): Updated to take an rvalue reference
and move the value through.
(WebCore::WebVTTParser::parseBytes): Updated to pass ownership of the string
in to the line reader append function.
(WebCore::WebVTTParser::parseCueData): Use auto and WTFMove for WebVTTCueData.
(WebCore::WebVTTParser::flush): More of the same.
(WebCore::WebVTTParser::parse): Changed to use nextLine instead of getLine.
* html/track/WebVTTParser.h: Updated for the above.
* html/track/WebVTTTokenizer.cpp:
(WebCore::advanceAndEmitToken): Use advanceAndUpdateLineNumber by its new
name, just advance. No change in behavior.
(WebCore::WebVTTTokenizer::WebVTTTokenizer): Pass a String, not a
SegmentedString, to add the end of file marker.
* platform/graphics/InbandTextTrackPrivateClient.h: Updated since
parseWebVTTFileHeader takes an rvalue reference.
* platform/text/SegmentedString.cpp:
(WebCore::SegmentedString::Substring::appendTo): Moved here from the header.
The only caller is SegmentedString::toString, inside this file.
(WebCore::SegmentedString::SegmentedString): Deleted the copy constructor.
No longer needed.
(WebCore::SegmentedString::operator=): Defined a move assignment operator
rather than an ordinary assignment operator, since that's what the call
sites really need.
(WebCore::SegmentedString::length): Simplified since we no longer need to
support pushed characters.
(WebCore::SegmentedString::setExcludeLineNumbers): Simplified, since we
can just iterate m_otherSubstrings without an extra check. Also changed to
write directly to the data member of Substring instead of using a function.
(WebCore::SegmentedString::updateAdvanceFunctionPointersForEmptyString):
Added. Used when we run out of characters.
(WebCore::SegmentedString::clear): Removed code to clear now-deleted members.
Updated for changes to other member names.
(WebCore::SegmentedString::appendSubstring): Renamed from just append to
avoid ambiguity with the public append function. Changed to take an rvalue
reference, and move in, and added code to set m_currentCharacter properly,
so the caller doesn't have to deal with that.
(WebCore::SegmentedString::close): Updated to use m_isClosed by its new name.
Also removed unneeded comment about assertion that fires when trying to close
an already closed string.
(WebCore::SegmentedString::append): Added overloads for rvalue references of
both entire SegmentedString objects and of String. Streamlined to just call
appendSubstring and append to the deque.
(WebCore::SegmentedString::pushBack): Tightened up since we don't allow empty
strings and changed to take just a string, not an entire segmented string.
(WebCore::SegmentedString::advanceSubstring): Moved logic into the
advancePastSingleCharacterSubstringWithoutUpdatingLineNumber function.
(WebCore::SegmentedString::toString): Simplified now that we don't need to
support pushed characters.
(WebCore::SegmentedString::advancePastNonNewlines): Deleted.
(WebCore::SegmentedString::advance8): Deleted.
(WebCore::SegmentedString::advanceWithoutUpdatingLineNumber16): Renamed from
advance16. Simplified now that there are no pushed characters. Also changed to
access data members of m_currentSubstring directly instead of calling a function.
(WebCore::SegmentedString::advanceAndUpdateLineNumber8): Deleted.
(WebCore::SegmentedString::advanceAndUpdateLineNumber16): Ditto.
(WebCore::SegmentedString::advancePastSingleCharacterSubstringWithoutUpdatingLineNumber):
Renamed from advanceSlowCase. Removed uneeded logic to handle pushed characters.
Moved code in here from advanceSubstring.
(WebCore::SegmentedString::advancePastSingleCharacterSubstring): Renamed from
advanceAndUpdateLineNumberSlowCase. Simplified by calling the function above.
(WebCore::SegmentedString::advanceEmpty): Broke assertion up into two.
(WebCore::SegmentedString::updateSlowCaseFunctionPointers): Updated for name changes.
(WebCore::SegmentedString::advancePastSlowCase): Changed name and meaning of
boolean argument. Rewrote to use the String class less; it's now used only when
we fail to match after the first character rather than being used for the actual
comparison with the literal.
* platform/text/SegmentedString.h: Moved all non-trivial function bodies out of
the class definition to make things easier to read. Moved the SegmentedSubstring
class inside the SegmentedString class, making it a private struct named Substring.
Removed the m_ prefix from data members of the struct, removed many functions from
the struct and made its union be anonymous instead of naming it m_data. Removed
unneeded StringBuilder.h include.
(WebCore::SegmentedString::isEmpty): Changed to use the length of the substring
instead of a separate boolean. We never create an empty substring, nor leave one
in place as the current substring unless the entire segmented string is empty.
(WebCore::SegmentedString::advancePast): Updated to use the new member function
template instead of a non-template member function. The new member function is
entirely rewritten and does the matching directly rather than allocating a string
just to do prefix matching.
(WebCore::SegmentedString::advancePastLettersIgnoringASCIICase): Renamed to make
it clear that the literal must be all non-letters or lowercase letters as with
the other "letters ignoring ASCII case" functions. The three call sites all fit
the bill. Implement by calling the new function template.
(WebCore::SegmentedString::currentCharacter): Renamed from currentChar.
(WebCore::SegmentedString::Substring::Substring): Use an rvalue reference and
move the string in.
(WebCore::SegmentedString::Substring::currentCharacter): Simplified since this
is never used on an empty substring.
(WebCore::SegmentedString::Substring::incrementAndGetCurrentCharacter): Ditto.
(WebCore::SegmentedString::SegmentedString): Overload to take an rvalue reference.
Simplified since there are now fewer data members.
(WebCore::SegmentedString::advanceWithoutUpdatingLineNumber): Renamed from
advance, since this is only safe to use if there is some reason it is OK to skip
updating the line number.
(WebCore::SegmentedString::advance): Renamed from advanceAndUpdateLineNumber,
since doing that is the normal desired behavior and not worth mentioning in the
public function name.
(WebCore::SegmentedString::advancePastNewline): Renamed from
advancePastNewlineAndUpdateLineNumber.
(WebCore::SegmentedString::numberOfCharactersConsumed): Greatly simplified since
pushed characters are no longer supported.
(WebCore::SegmentedString::characterMismatch): Added. Used by advancePast.
* xml/parser/CharacterReferenceParserInlines.h:
(WebCore::unconsumeCharacters): Use toString rather than toStringPreserveCapacity
because the SegmentedString is going to take ownership of the string.
(WebCore::consumeCharacterReference): Updated to use the pushBack that takes just
a String, not a SegmentedString. Also use advancePastNonNewline.
* xml/parser/MarkupTokenizerInlines.h: Added ADVANCE_PAST_NON_NEWLINE_TO.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::insert): Updated since this takes an rvalue reference.
(WebCore::XMLDocumentParser::append): Removed unnecessary code to create a
SegmentedString.
* xml/parser/XMLDocumentParser.h: Updated for above. Also fixed indentation
and initialized most data members.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser): Moved most data member
initialization into the class definition.
(WebCore::XMLDocumentParser::resumeParsing): Removed code that copied a
segmented string, but converted the whole thing into a string before using it.
Now we convert to a string right away.
2016-11-28 Chris Dumez <cdumez@apple.com>
[iOS] Use UIKit SPI to force popover presentation style on iPhone for html validation popovers
https://bugs.webkit.org/show_bug.cgi?id=165107
Reviewed by Simon Fraser.
Use UIKit SPI to force popover presentation style on iPhone for html validation
popovers as this results in simpler code and achieves the same behavior.
* platform/ValidationBubble.h:
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::setAnchorRect):
(-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]): Deleted.
* platform/spi/ios/UIKitSPI.h:
2016-11-28 Chris Dumez <cdumez@apple.com>
[Mac] Clicking on an HTML validation bubble should dismiss it
https://bugs.webkit.org/show_bug.cgi?id=165117
<rdar://problem/29409837>
Reviewed by Simon Fraser.
Clicking on an HTML validation bubble should dismiss it. It previously
did nothing.
No new tests, this is not easily testable as EventSender.keyDown() sends
the event to the view, not to a particular screen location.
* platform/mac/ValidationBubbleMac.mm:
(-[WebValidationPopover mouseDown:]):
(WebCore::ValidationBubble::ValidationBubble):
2016-11-27 Sam Weinig <sam@webkit.org>
Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern and drawImage
https://bugs.webkit.org/show_bug.cgi?id=165086
Reviewed by Darin Adler.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
Add overloads of size for each type of CanvasSource.
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::CanvasRenderingContext2D::createPattern):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
Use variants to reduce code duplication and match spec language in drawImage and createPattern.
2016-11-28 Beth Dakin <bdakin@apple.com>
Blacklist Netflix for TouchBar support
https://bugs.webkit.org/show_bug.cgi?id=165104
-and corresponding-
rdar://problem/29404778
Reviewed by Tim Horton.
This patch moves the algorithm to
bestMediaElementForShowingPlaybackControlsManager() so that Now Playing can also
use it.
* html/HTMLMediaElement.cpp:
(WebCore::needsPlaybackControlsManagerQuirk):
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
(WebCore::HTMLMediaElement::updatePlaybackControlsManager):
2016-11-28 Mark Lam <mark.lam@apple.com>
Fix exception scope verification failures in more miscellaneous files.
https://bugs.webkit.org/show_bug.cgi?id=165102
Reviewed by Saam Barati.
No new tests because these are fixes to failures detected by existing tests when
exception check verification is enabled.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::put):
2016-11-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix bugs in the @supports parser
https://bugs.webkit.org/show_bug.cgi?id=165115
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Clean up the display property to match the old parser to ensure
that @supports conditions on display are the same.
* css/parser/CSSSupportsParser.cpp:
(WebCore::CSSSupportsParser::consumeCondition):
(WebCore::CSSSupportsParser::consumeNegation):
(WebCore::CSSSupportsParser::consumeConditionInParenthesis):
* css/parser/CSSSupportsParser.h:
What follows are all bugs in Blink that need to be fixed to pass our
tests.
Fix the supports parser to allow the whitespace after not/or/and to
be optional. Allow the whitespace following parenthetical conditions
to be optional.
With whitespace being optional, this means that "not(" will parse
as a FunctionToken type, as will "or(" and "and(". Handle this situation
by checking for FunctionToken along with IdentToken and parameterizing
consumeConditionInParenthesis to do the right thing when it starts with
a FunctionToken instead of an IdentToken.
Fix the general enclosure FunctionToken for forward compatibility to require that
the function still be enclosed within parentheses.
2016-11-28 Mark Lam <mark.lam@apple.com>
Fix exception scope verification failures in ObjectConstructor.cpp and ObjectPrototype.cpp.
https://bugs.webkit.org/show_bug.cgi?id=165051
Reviewed by Saam Barati.
No new tests because this is covered by the existing test
http/tests/security/cross-frame-access-object-prototype.html with the help of a
new ASSERT in ObjectPrototype.cpp.
Fixed jsDOMWindowGetOwnPropertySlotRestrictedAccess() to return false when it
throws an exception.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2016-11-28 Tim Horton <timothy_horton@apple.com>
Obvious change in saturation/color when swiping to a previously visited page
https://bugs.webkit.org/show_bug.cgi?id=165112
<rdar://problem/29257229>
Reviewed by Simon Fraser.
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::createFromImage):
IOSurface::createFromImage should take into account the colorspace of the
originating image, instead of just hardcoding sRGB.
Otherwise, on a non-sRGB display, the display-space snapshot that we take
for back-forward swipe is converted to sRGB, then the colorspace information
is lost (without a way to maintain it inside the IOSurface), and displayed
as layer contents interpreted as display space (instead of sRGB).
2016-11-28 Chris Dumez <cdumez@apple.com>
Unreviewed, fix crashes on Yosemite after r209009
NSTextField's maximumNumberOfLines was introduced in ElCapitan so
disable it at compile-time on previous OSes for now.
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):
2016-11-28 Keith Rollin <krollin@apple.com>
Unreviewed, rolling out r208607.
The actual changes aren't inline with what was requested.
Reverted changeset:
"Reduce number of platformMemoryUsage calls"
https://bugs.webkit.org/show_bug.cgi?id=164375
http://trac.webkit.org/changeset/208607
2016-11-28 Beth Dakin <bdakin@apple.com>
Blacklist Netflix for TouchBar support
https://bugs.webkit.org/show_bug.cgi?id=165104
-and corresponding-
rdar://problem/29404778
Reviewed by Darin Adler.
* html/HTMLMediaElement.cpp:
(WebCore::needsPlaybackControlsManagerQuirk):
(WebCore::HTMLMediaElement::updatePlaybackControlsManager):
2016-11-28 Chris Dumez <cdumez@apple.com>
Limit HTML Form validation popovers to 4 lines
https://bugs.webkit.org/show_bug.cgi?id=165098
<rdar://problem/29403286>
Reviewed by Darin Adler.
Limit HTML Form validation popovers to 4 lines as per recent feedback.
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):
2016-11-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Filters and Reflections Fixes
https://bugs.webkit.org/show_bug.cgi?id=165103
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeReflect):
Support the "none" keyword for box-reflect.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
Don't rely on range checking, since invert isn't grouped with the other
function values. Actually check every keyword.
2016-11-28 Brent Fulgham <bfulgham@apple.com>
ImageData does not match specification
https://bugs.webkit.org/show_bug.cgi?id=164663
Reviewed by Simon Fraser.
The W3C specification https://www.w3.org/TR/2dcontext/ clearly states that
the width and height attributes of the ImageData type should be unsigned.
Our current implementation has signed integer values.
In practice, we have enforced the unsigned requirement by throwing a TypeError
if you attempt to construct an ImageData with negative width or height.
This change simply updates the IDL and impelemntation to match the spec.
Test coverage is already provided by fast/canvas/canvas-imageData.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal): Serialize as uint32_t values.
* html/ImageData.idl: Revise width and height to be unsigned long.
2016-11-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] flex-basis should be pixel units not percentages.
https://bugs.webkit.org/show_bug.cgi?id=165100
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeFlex):
2016-11-28 Daniel Bates <dabates@apple.com>
Replace CSSPropertyNames.in with a JSON file
https://bugs.webkit.org/show_bug.cgi?id=164691
Reviewed by Simon Fraser.
Convert CSSPropertyNames.in to a structured JSON file. This is the first step towards
exposing a CSS feature status dashboard and generating more of the boilerplate code
for a CSS property.
A side effect of this change is that makeprop.pl no longer detects duplicate CSS property
definitions. We will look to bring such duplication detection back in a subsequent
commit.
* CMakeLists.txt: Substitute CSSProperties.json for CSSPropertyNames.in and update the
invocation of makeprop.pl as we no longer need to pass the bindings/scripts/preprocessor.pm
Perl module. Makeprop.pl supports conditional CSS properties and values without the need
to preprocess CSSProperties.json using the C preprocessor.
* DerivedSources.make: Ditto. Pass WTF_PLATFORM_IOS to makeprop.pl when building for iOS
as we no longer make use of bindings/scripts/preprocessor.pm.
* css/CSSProperties.json: Added.
* css/CSSPropertyNames.in: Removed.
* css/StyleResolver.cpp: Remove variable lastHighPriorityProperty as we now generate it.
* css/makeprop.pl: Extracted the input file name, now CSSProperties.json, into a global variable
and referenced this variable throughout this script instead of hardcoding the input file name at
each call site. Updated code to handle CSS longhand names being encoded in a JSON array as opposed
to a string of '|'-separated values. I added a FIXME comment to do the same for the codegen property
"custom". Fixed Perl uninitialized variable warnings when die()-ing with error "Unknown CSS property
used in all shorthand ..." or "Unknown CSS property used in longhands ...".
(isPropertyEnabled): Added. Determine whether code should be generated for a property.
(addProperty): Added.
(sortByDescendingPriorityAndName): Added.
(getScopeForFunction): Lowercase option names so that we can use a consistent case throughout
the JSON file.
(getNameForMethods): Ditto.
(generateColorValueSetter):
(generateAnimationPropertyInitialValueSetter): Ditto.
(generateAnimationPropertyInheritValueSetter): Ditto.
(generateFillLayerPropertyInitialValueSetter): Ditto.
(generateFillLayerPropertyInheritValueSetter): Ditto.
(generateSetValueStatement): Ditto.
(generateInitialValueSetter): Ditto.
(generateInheritValueSetter): Ditto.
(generateValueSetter): Ditto.
2016-11-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-animation-trigger
https://bugs.webkit.org/show_bug.cgi?id=165095
Reviewed by Zalan Bujtas.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitAnimationTrigger):
(WebCore::consumeAnimationValue):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-28 Antti Koivisto <antti@apple.com>
Remove FIRST_LINE_INHERITED fake pseudo style
https://bugs.webkit.org/show_bug.cgi?id=165071
Reviewed by Andreas Kling.
These are create during layout an then cached to the RenderStyle. Cache computed first line style to
RenderObject rare data instead, avoiding style mutation an other confusing messiness.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::computeFirstLineStyle):
(WebCore::RenderElement::firstLineStyle):
Cache the first line style.
(WebCore::RenderElement::invalidateCachedFirstLineStyle):
(WebCore::RenderElement::styleWillChange):
Invalidate subtree if we have cached first line style.
(WebCore::RenderElement::getUncachedPseudoStyle):
(WebCore::RenderElement::uncachedFirstLineStyle): Deleted.
(WebCore::RenderElement::cachedFirstLineStyle): Deleted.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::rareDataMap):
(WebCore::RenderObject::rareData):
(WebCore::RenderObject::ensureRareData):
* rendering/RenderObject.h:
Stop copying rare data objects.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
Use the normal mechanism for invalidating layout for first-line instead of a hack in pseudoStyleCacheIsInvalid.
* rendering/style/RenderStyleConstants.h:
* style/RenderTreeUpdater.cpp:
(WebCore::pseudoStyleCacheIsInvalid):
Simplify.
2016-11-28 Miguel Gomez <magomez@igalia.com>
[GTK] Dramatic increase on memory usage since 2.14.x
https://bugs.webkit.org/show_bug.cgi?id=164049
Reviewed by Žan Doberšek.
Use OpenGL version 3.2 Core for rendering when available.
Update some operations that have changed when using 3.2 Core:
- Use glGetStringi to get the extensions list.
- Do not use GL_POINT_SPRITE.
- Always use a VAO when rendering.
- Use a GLSL 1.50 compatible shader.
No new tests needed.
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::version):
Add a method to get OpenGL version we are using.
* platform/graphics/GLContext.h:
Ditto.
* platform/graphics/GraphicsContext3D.h:
Add an attribute to store the VAO used for rendering.
* platform/graphics/OpenGLShims.cpp:
(WebCore::initializeOpenGLShims):
Add glGetStringi to the list of functions.
* platform/graphics/OpenGLShims.h:
Ditto.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Set appropriate output to the shader compiler and initalize the VAO if needed.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
Delete the VAO if needed.
(WebCore::GraphicsContext3D::getExtensions):
Use glGetExtensionsi for OpenGL versions >= 3.2.
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::hasGLXARBCreateContextExtension):
Check whether the GLX_ARB_create_context extension is available.
(WebCore::GLContextGLX::createWindowContext):
Use glXCreateContextAttribsARB() if possible to request an OpenGL 3.2 context.
(WebCore::GLContextGLX::createPbufferContext):
Ditto.
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
Enable glGetStringi for GTK.
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
Do not use default getExtensions() method for GTK.
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
Ditto.
2016-11-24 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Move attributes from RenderGrid to the new Grid class
https://bugs.webkit.org/show_bug.cgi?id=165065
Reviewed by Darin Adler.
A new class called Grid was added in 208973. This is the first of a couple of patches moving
private attributes from RenderGrid to Grid.
Apart from that this is adding a couple of new helper functions that will decouple the
existence of in-flow items from the actual data structures storing that information.
Last but not least, the Grid::insert() method does not only insert the item in the m_grid
data structure, but also stores the GridArea associated to that item, so there is no need to
do it in two different calls.
No new tests required as this is a refactoring.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::insert): Added a new parameter.
(WebCore::RenderGrid::Grid::setSmallestTracksStart):
(WebCore::RenderGrid::Grid::smallestTrackStart):
(WebCore::RenderGrid::Grid::gridItemArea):
(WebCore::RenderGrid::Grid::setGridItemArea):
(WebCore::RenderGrid::Grid::clear): Clear the newly added attributes.
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::rawGridTrackSize):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::clearGrid):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::cachedGridSpan):
(WebCore::RenderGrid::cachedGridArea): Deleted.
* rendering/RenderGrid.h:
2016-11-27 Sam Weinig <sam@webkit.org>
Remove unused DOMRequestState
https://bugs.webkit.org/show_bug.cgi?id=165085
Reviewed by Simon Fraser.
Remove DOMRequestState. It was unused.
* Modules/fetch/FetchBody.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMRequestState.h: Removed.
2016-11-27 Csaba Osztrogonác <ossy@webkit.org>
Fix various --minimal build issues
https://bugs.webkit.org/show_bug.cgi?id=165060
Reviewed by Darin Adler.
* css/parser/CSSPropertyParser.cpp:
* dom/Document.cpp:
* loader/EmptyClients.cpp:
2016-11-26 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Import std::optional reference implementation as WTF::Optional
https://bugs.webkit.org/show_bug.cgi?id=164199
Reviewed by Saam Barati and Sam Weinig.
Rename valueOr to value_or. This is specified in C++17 proposal.
Use Optional::emplace. C++17 Optional::operator=(Optional&&) requires
either copy assignment operator or move assignment operator. But
DFG::JSValueOperand etc. only defines move constructors and drop
implicit copy assignment operators.
It was OK in the previous WTF::Optional since it always uses move
constructors. But it is not valid in C++17 Optional. We use Optional::emplace
instead. This function has the same semantics to the previous WTF::Optional's
operator=.
No behavior change.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::parseAmount):
(WebCore::createContactFields):
(WebCore::toLineItemType):
(WebCore::createLineItem):
(WebCore::createLineItems):
(WebCore::createMerchantCapabilities):
(WebCore::createSupportedNetworks):
(WebCore::toShippingType):
(WebCore::createShippingMethod):
(WebCore::createShippingMethods):
(WebCore::createPaymentRequest):
(WebCore::toPaymentAuthorizationStatus):
* Modules/applepay/PaymentContact.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentMerchantSession.h:
* Modules/applepay/PaymentRequest.h:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::PaymentContact::fromJS):
* Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
(WebCore::PaymentMerchantSession::fromJS):
* Modules/encryptedmedia/MediaKeyStatusMap.cpp:
(WebCore::MediaKeyStatusMap::Iterator::next):
* Modules/encryptedmedia/MediaKeyStatusMap.h:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::FetchBodyOwner):
(WebCore::FetchBodyOwner::loadBlob):
(WebCore::FetchBodyOwner::finishBlobLoading):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next):
* Modules/fetch/FetchHeaders.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy):
(WebCore::setMode):
(WebCore::setCredentials):
(WebCore::setCache):
(WebCore::setRedirect):
(WebCore::setMethod):
(WebCore::setReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h:
(WebCore::FetchRequest::FetchRequest):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::FetchResponse):
(WebCore::FetchResponse::cloneForJS):
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didFail):
(WebCore::FetchResponse::BodyLoader::didReceiveResponse):
(WebCore::FetchResponse::BodyLoader::stop):
* Modules/fetch/FetchResponse.h:
* Modules/geolocation/Coordinates.cpp:
(WebCore::Coordinates::altitude):
(WebCore::Coordinates::altitudeAccuracy):
(WebCore::Coordinates::heading):
(WebCore::Coordinates::speed):
* Modules/geolocation/Coordinates.h:
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open):
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::isolatedCopy):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyPath):
(WebCore::deserializeIDBKeyPath):
* Modules/indexeddb/server/IDBSerialization.h:
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::getAllRecords):
* Modules/indexeddb/server/MemoryIndex.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::getAllRecords):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
(WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
(WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
* Modules/indexeddb/server/MemoryObjectStoreCursor.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::createNewObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::keyPath):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::displayNameForTrack):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::streamEndedWithError):
* Modules/mediasource/MediaSource.h:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::stop):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::insertDTMF):
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create):
(WebCore::RTCIceCandidate::RTCIceCandidate):
* Modules/mediastream/RTCIceCandidate.h:
(WebCore::RTCIceCandidate::sdpMLineIndex):
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::iceCandidateFromJSON):
* Modules/proximity/DeviceProximityEvent.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished):
(WebCore::ReadableStreamSource::clean):
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::start):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webdatabase/SQLResultSet.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::close):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
* Modules/websockets/WebSocketChannel.h:
* bindings/generic/IDLTypes.h:
(WebCore::IDLType::nullValue):
* bindings/js/CachedModuleScript.h:
(WebCore::CachedModuleScript::error):
* bindings/js/Dictionary.h:
(WebCore::Dictionary::get):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
* bindings/js/JSCryptoKeySerializationJWK.h:
* bindings/js/JSDOMConvert.h:
(WebCore::Detail::VariadicConverterBase::convert):
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMPromise.h:
(WebCore::DOMPromise::DOMPromise):
(WebCore::DOMPromise::operator=):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::item):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::toDataURL):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::construct):
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::createStringConstraint):
(WebCore::createBooleanConstraint):
(WebCore::createDoubleConstraint):
(WebCore::createIntConstraint):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::importKey):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::executeScript):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateDefaultValue):
(GenerateImplementation):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::JSFloat64Array::getOwnPropertySlot):
(WebCore::JSFloat64Array::getOwnPropertyDescriptor):
(WebCore::JSFloat64Array::put):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::parseEnumeration<TestObj::EnumType>):
(WebCore::parseEnumeration<TestObj::Optional>):
(WebCore::parseEnumeration<AlternateEnumName>):
(WebCore::parseEnumeration<TestObj::EnumA>):
(WebCore::parseEnumeration<TestObj::EnumB>):
(WebCore::parseEnumeration<TestObj::EnumC>):
(WebCore::parseEnumeration<TestObj::Kind>):
(WebCore::parseEnumeration<TestObj::Size>):
(WebCore::parseEnumeration<TestObj::Confidence>):
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::JSTestObj::getOwnPropertySlot):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordCaller):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Caller):
(WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentCaller):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
(WebCore::parseEnumeration<TestStandaloneEnumeration>):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionSetShadowCaller):
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampCaller):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::put):
* crypto/CryptoAlgorithmRegistry.cpp:
(WebCore::CryptoAlgorithmRegistry::identifier):
* crypto/CryptoAlgorithmRegistry.h:
* crypto/CryptoKeySerialization.h:
* crypto/JsonWebKey.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeySerializationRaw.cpp:
(WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::commonCryptoHMACAlgorithm):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm):
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::calculateStyleMask):
(WebCore::CSSFontFace::calculateWeightMask):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::computeFontTraitsMask):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::doubleValue):
(WebCore::CSSPrimitiveValue::doubleValueInternal):
* css/CSSPrimitiveValue.h:
* css/CSSPropertyNames.in:
* css/CSSSegmentedFontFace.cpp:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::create):
(WebCore::CSSStyleSheet::CSSStyleSheet):
(WebCore::CSSStyleSheet::addRule):
* css/CSSStyleSheet.h:
* css/FontFace.cpp:
(WebCore::FontFace::fontStateChanged):
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::completedLoading):
* css/FontFaceSet.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::doubleValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridPosition):
(WebCore::StyleBuilderConverter::convertWordSpacing):
(WebCore::StyleBuilderConverter::convertPerspective):
(WebCore::StyleBuilderConverter::convertMarqueeIncrement):
(WebCore::StyleBuilderConverter::convertFilterOperations):
(WebCore::StyleBuilderConverter::convertLineHeight):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueLineHeight):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
(WebCore::CSSParser::parseSpringTimingFunctionValue):
(WebCore::CSSParser::parseColorFunctionParameters):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
* dom/CustomElementReactionQueue.cpp:
* dom/Document.cpp:
(WebCore::Document::lastModified):
* dom/Element.cpp:
(WebCore::Element::scrollBy):
(WebCore::Element::getIntegralAttribute):
(WebCore::Element::getUnsignedIntegralAttribute):
(WebCore::Element::resolveCustomStyle):
* dom/Element.h:
* dom/ElementIteratorAssertions.h:
(WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
(WebCore::ElementIteratorAssertions::clear):
* dom/ExceptionOr.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::makeInlineStyleSheetCacheKey):
* dom/KeyboardEvent.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::error):
* dom/LoadableClassicScript.h:
* dom/LoadableModuleScript.cpp:
(WebCore::LoadableModuleScript::error):
* dom/LoadableModuleScript.h:
* dom/LoadableScript.h:
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
* dom/MessageEvent.h:
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe):
* dom/MutationObserver.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::resolveCustomStyle):
* dom/PseudoElement.h:
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setToBeforeChild):
(WebCore::RangeBoundaryPoint::setToAfterChild):
(WebCore::RangeBoundaryPoint::setToEndOfNode):
(WebCore::RangeBoundaryPoint::invalidateOffset):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::executeScriptAndDispatchEvent):
* dom/ScriptElement.h:
* dom/TextDecoder.cpp:
(WebCore::TextDecoder::decode):
* dom/TextDecoder.h:
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* dom/UserGestureIndicator.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* fileapi/File.h:
* history/CachedFrame.h:
(WebCore::CachedFrame::hasInsecureContent):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::toggle):
* html/DOMTokenList.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toDataURL):
* html/HTMLCanvasElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseBorderWidthAttribute):
(WebCore::HTMLElement::parseAttribute):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::createForJSConstructor):
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::findClosestTickMarkValue):
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::iconType):
* html/HTMLLinkElement.h:
* html/HTMLOListElement.h:
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add):
* html/HTMLOptionsCollection.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
(WebCore::HTMLSelectElement::setLength):
* html/HTMLSelectElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
(WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::height):
(WebCore::ImageInputType::width):
* html/InputType.cpp:
(WebCore::InputType::findClosestTickMarkValue):
* html/InputType.h:
* html/LinkIconCollector.cpp:
* html/LinkRelAttribute.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::findClosestTickMarkValue):
* html/RangeInputType.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::restore):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::isPointInPathInternal):
(WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::fillText):
(WebCore::CanvasRenderingContext2D::strokeText):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::arrayBufferViewElementSize):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::validateArrayBufferType):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
(WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLIntegerInternal):
(WebCore::parseHTMLInteger):
(WebCore::parseHTMLNonNegativeInteger):
(WebCore::parseValidHTMLNonNegativeIntegerInternal):
(WebCore::parseValidHTMLNonNegativeInteger):
(WebCore::parseValidHTMLFloatingPointNumberInternal):
(WebCore::parseValidHTMLFloatingPointNumber):
(WebCore::parseHTTPRefreshInternal):
* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyHTMLNonNegative):
* html/parser/HTMLSrcsetParser.cpp:
(WebCore::parseDescriptors):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
(WebCore::SliderThumbElement::resolveCustomStyle):
(WebCore::SliderContainerElement::resolveCustomStyle):
* html/shadow/SliderThumbElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
(WebCore::TextControlInnerTextElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
* html/shadow/TextControlInnerElements.h:
* html/track/TrackEvent.h:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::preflightSuccess):
(WebCore::DocumentThreadableLoader::preflightFailure):
* loader/DocumentThreadableLoader.h:
* loader/EmptyClients.cpp:
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::open):
(WebCore::FrameLoader::dispatchDidCommitLoad):
(WebCore::FrameLoader::clearTestingOverrides):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::resourceTypeFromAsAttribute):
(WebCore::LinkLoader::loadLink):
* loader/LinkLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::notifyDone):
* loader/SubresourceLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setLoadPriority):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::priority):
* mathml/MathMLElement.h:
(WebCore::MathMLElement::specifiedDisplayStyle):
(WebCore::MathMLElement::specifiedMathVariant):
* mathml/MathMLFractionElement.cpp:
(WebCore::MathMLFractionElement::cachedFractionAlignment):
(WebCore::MathMLFractionElement::parseAttribute):
* mathml/MathMLFractionElement.h:
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::specifiedDisplayStyle):
(WebCore::MathMLMathElement::parseAttribute):
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.cpp:
(WebCore::MathMLMencloseElement::parseAttribute):
* mathml/MathMLMencloseElement.h:
* mathml/MathMLOperatorDictionary.cpp:
(WebCore::MathMLOperatorDictionary::search):
* mathml/MathMLOperatorDictionary.h:
* mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::computeOperatorFlag):
(WebCore::MathMLOperatorElement::childrenChanged):
(WebCore::attributeNameToPropertyFlag):
(WebCore::MathMLOperatorElement::parseAttribute):
* mathml/MathMLOperatorElement.h:
* mathml/MathMLPaddedElement.cpp:
(WebCore::MathMLPaddedElement::parseAttribute):
* mathml/MathMLPaddedElement.h:
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::cachedBooleanAttribute):
(WebCore::MathMLPresentationElement::cachedMathMLLength):
(WebCore::MathMLPresentationElement::specifiedDisplayStyle):
(WebCore::MathMLPresentationElement::specifiedMathVariant):
(WebCore::MathMLPresentationElement::parseAttribute):
* mathml/MathMLPresentationElement.h:
(WebCore::MathMLPresentationElement::toOptionalBool):
* mathml/MathMLScriptsElement.cpp:
(WebCore::MathMLScriptsElement::parseAttribute):
* mathml/MathMLScriptsElement.h:
* mathml/MathMLSpaceElement.cpp:
(WebCore::MathMLSpaceElement::parseAttribute):
* mathml/MathMLSpaceElement.h:
* mathml/MathMLTokenElement.cpp:
(WebCore::MathMLTokenElement::convertToSingleCodePoint):
* mathml/MathMLTokenElement.h:
* mathml/MathMLUnderOverElement.cpp:
(WebCore::MathMLUnderOverElement::parseAttribute):
* mathml/MathMLUnderOverElement.h:
* page/ChromeClient.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollBy):
* page/DOMWindow.h:
* page/EventSource.cpp:
(WebCore::EventSource::parseEventStream):
(WebCore::EventSource::parseEventStreamLine):
* page/EventSource.h:
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::setViewExposedRect):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::takeAnyMediaCanStartListener):
* page/Page.h:
(WebCore::Page::eventThrottlingBehaviorOverride):
(WebCore::Page::setEventThrottlingBehaviorOverride):
* page/ScrollToOptions.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::create):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::port):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::debugString):
(WebCore::SecurityOriginData::databaseIdentifier):
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
(WebCore::SecurityOriginData::isEmpty):
(WebCore::SecurityOriginDataHash::hash):
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* page/WindowFeatures.cpp:
(WebCore::parseDialogFeatures):
(WebCore::boolFeature):
(WebCore::floatFeature):
* page/WindowFeatures.h:
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
(WebCore::ContentSecurityPolicySource::portMatches):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parsePort):
* page/csp/ContentSecurityPolicySourceList.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
* platform/DragImage.cpp:
* platform/LinkIcon.h:
* platform/MemoryPressureHandler.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange):
* platform/ScrollView.h:
* platform/Theme.h:
(WebCore::Theme::controlFont):
* platform/Timer.h:
(WebCore::TimerBase::alignedFireTime):
* platform/URL.cpp:
(WebCore::URL::port):
(WebCore::defaultPortForProtocol):
(WebCore::portAllowed):
* platform/URL.h:
* platform/URLParser.cpp:
(WebCore::URLParser::defaultPortForProtocol):
(WebCore::findLongestZeroSequence):
(WebCore::URLParser::parseIPv4Piece):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv4PieceInsideIPv6):
(WebCore::URLParser::parseIPv4AddressInsideIPv6):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::formURLDecode):
* platform/URLParser.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/Color.h:
(WebCore::colorWithOverrideAlpha):
* platform/graphics/DisplayRefreshMonitorClient.h:
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText):
(WebCore::FontCascade::drawEmphasisMarks):
(WebCore::FontCascade::adjustSelectionRectForText):
(WebCore::FontCascade::getEmphasisMarkGlyphData):
(WebCore::FontCascade::emphasisMarkAscent):
(WebCore::FontCascade::emphasisMarkDescent):
(WebCore::FontCascade::emphasisMarkHeight):
* platform/graphics/FontCascade.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawText):
(WebCore::GraphicsContext::drawEmphasisMarks):
(WebCore::GraphicsContext::drawBidiText):
* platform/graphics/GraphicsContext.h:
(WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setPosition):
(WebCore::GraphicsLayer::setApproximatePosition):
* platform/graphics/Image.h:
(WebCore::Image::hotSpot):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::clearMetadata):
(WebCore::ImageFrameCache::metadata):
(WebCore::ImageFrameCache::frameMetadataAtIndex):
(WebCore::ImageFrameCache::hotSpot):
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::hotSpot):
* platform/graphics/PathUtilities.cpp:
(WebCore::rectFromPolygon):
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::calculateLayerBoundingRect):
* platform/graphics/TiledBacking.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flush):
(WebCore::SourceBufferPrivateAVFObjC::naturalSize):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setLayoutViewportRect):
* platform/graphics/ca/TileController.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::encodeImage):
(WebCore::dataURL):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::hotSpot):
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::openTypeFeature):
(WebCore::advanceForColorBitmapFont):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::localBounds):
(WebCore::DisplayList::DrawLine::localBounds):
(WebCore::DisplayList::DrawLinesForText::localBounds):
(WebCore::DisplayList::DrawLineForDocumentMarker::localBounds):
(WebCore::DisplayList::DrawFocusRingPath::localBounds):
(WebCore::DisplayList::DrawFocusRingRects::localBounds):
(WebCore::DisplayList::StrokeRect::localBounds):
(WebCore::DisplayList::StrokePath::localBounds):
(WebCore::DisplayList::StrokeEllipse::localBounds):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawingItem::localBounds):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::updateItemExtent):
(WebCore::DisplayList::Recorder::ContextState::rotate):
(WebCore::DisplayList::Recorder::ContextState::concatCTM):
* platform/graphics/efl/ImageBufferEfl.cpp:
(WebCore::encodeImageJPEG):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::mapAbsolutePointToLocalPoint):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::selectionRect):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::capitalized):
(WebCore::shouldSynthesize):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::replicaTransform):
(WebCore::TextureMapperLayer::mapScrollOffset):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::inverse):
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mappedPoint):
(WebCore::TransformState::mappedSecondaryQuad):
(WebCore::TransformState::mapQuad):
(WebCore::TransformState::flattenWithTransform):
* platform/graphics/transforms/TransformState.h:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::inverse):
* platform/graphics/transforms/TransformationMatrix.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::hotSpot):
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXDamage):
* platform/graphics/x11/PlatformDisplayX11.h:
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::hotSpot):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::hotSpot):
(WebCore::ICOImageDecoder::hotSpotAtIndex):
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-encoders/JPEGImageEncoder.cpp:
(WebCore::compressRGBABigEndianToJPEG):
* platform/image-encoders/JPEGImageEncoder.h:
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::setOverrideVisibleRect):
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileHostLayer renderInContext:]):
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::controlFont):
* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaTrackConstraintSetMap::set):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaTrackConstraintSetMap::width):
(WebCore::MediaTrackConstraintSetMap::height):
(WebCore::MediaTrackConstraintSetMap::sampleRate):
(WebCore::MediaTrackConstraintSetMap::sampleSize):
(WebCore::MediaTrackConstraintSetMap::aspectRatio):
(WebCore::MediaTrackConstraintSetMap::frameRate):
(WebCore::MediaTrackConstraintSetMap::volume):
(WebCore::MediaTrackConstraintSetMap::echoCancellation):
(WebCore::MediaTrackConstraintSetMap::facingMode):
(WebCore::MediaTrackConstraintSetMap::deviceId):
(WebCore::MediaTrackConstraintSetMap::groupId):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
(WebCore::RealtimeMediaSource::applySizeAndFrameRate):
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/network/CacheValidation.cpp:
(WebCore::computeCurrentAge):
(WebCore::computeFreshnessLifetimeForHTTPFamily):
* platform/network/CacheValidation.h:
* platform/network/DataURLDecoder.h:
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPDate):
* platform/network/HTTPParsers.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::cacheControlMaxAge):
(WebCore::parseDateValueInHeader):
(WebCore::ResourceResponseBase::date):
(WebCore::ResourceResponseBase::age):
(WebCore::ResourceResponseBase::expires):
(WebCore::ResourceResponseBase::lastModified):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::certificateInfo):
* platform/network/SocketStreamHandle.h:
* platform/network/SocketStreamHandleClient.h:
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::readStreamCallback):
(WebCore::SocketStreamHandleImpl::platformSend):
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::platformSend):
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesInPartitionForURL):
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::readBytes):
(WebCore::SocketStreamHandleImpl::platformSend):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionNonLoosely):
(WebCore::nextBreakablePositionLoosely):
(WebCore::isBreakable):
* rendering/HitTestingTransformState.cpp:
(WebCore::HitTestingTransformState::flattenWithTransform):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::interpolationQualityFromStyle):
(WebCore::ImageQualityController::chooseInterpolationQuality):
* rendering/ImageQualityController.h:
* rendering/InlineIterator.h:
(WebCore::InlineIterator::moveTo):
(WebCore::InlineIterator::nextBreakablePosition):
(WebCore::InlineIterator::setNextBreakablePosition):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::substringToRender):
(WebCore::InlineTextBox::hyphenatedStringForTextRun):
(WebCore::InlineTextBox::constructTextRun):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::substringToRender):
(WebCore::InlineTextBox::hyphenatedStringForTextRun):
(WebCore::InlineTextBox::constructTextRun):
* rendering/OrderIterator.cpp:
(WebCore::OrderIterator::reset):
* rendering/OrderIterator.h:
* rendering/PaintInfo.h:
(WebCore::PaintInfo::applyTransform):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlockRareData::RenderBlockRareData):
(WebCore::RenderBlock::baselinePosition):
(WebCore::RenderBlock::firstLineBaseline):
(WebCore::RenderBlock::inlineBlockBaseline):
(WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline):
(WebCore::RenderBlockFlow::inlineBlockBaseline):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalHeightByMinMax):
(WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
(WebCore::RenderBox::overrideContainingBlockContentLogicalWidth):
(WebCore::RenderBox::overrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightUsing):
(WebCore::RenderBox::computeContentLogicalHeight):
(WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeight):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(WebCore::RenderBox::firstLineBaseline):
(WebCore::RenderBox::inlineBlockBaseline):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::computeTextOrigin):
* rendering/RenderCombineText.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::baselinePosition):
(WebCore::RenderFlexibleBox::firstLineBaseline):
(WebCore::RenderFlexibleBox::inlineBlockBaseline):
(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
(WebCore::RenderFlexibleBox::marginBoxAscentForChild):
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
(WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
* rendering/RenderFlexibleBox.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::addForcedRegionBreak):
* rendering/RenderGrid.cpp:
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrack::setGrowthLimitCap):
(WebCore::GridTrack::growthLimitCap):
(WebCore::RenderGrid::GridSizingData::freeSpace):
(WebCore::RenderGrid::GridSizingData::availableSpace):
(WebCore::RenderGrid::GridSizingData::setAvailableSpace):
(WebCore::RenderGrid::GridSizingData::setFreeSpace):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::overrideContainingBlockContentSizeForChild):
(WebCore::setOverrideContainingBlockContentSizeForChild):
(WebCore::RenderGrid::logicalHeightForChild):
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::minContentForChild):
(WebCore::RenderGrid::maxContentForChild):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::layoutGridItems):
* rendering/RenderGrid.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::hitTestLayer):
* rendering/RenderLayerBacking.cpp:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItem):
(WebCore::RenderListBox::listIndexIsVisible):
(WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
(WebCore::RenderTable::baselinePosition):
(WebCore::RenderTable::inlineBlockBaseline):
(WebCore::RenderTable::firstLineBaseline):
* rendering/RenderTable.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::cellBaselinePosition):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::firstLineBaseline):
* rendering/RenderTableSection.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::stringView):
* rendering/RenderText.h:
* rendering/RenderTextControl.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::setSelection):
(WebCore::RenderView::splitSelectionBetweenSubtrees):
(WebCore::RenderView::getSelection):
(WebCore::RenderView::clearSelection):
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.h:
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::lastFragment):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
(WebCore::SimpleLineLayout::createTextRuns):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/line/BreakingContext.h:
(WebCore::WordTrailingSpace::width):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
(WebCore::BreakingContext::InlineIteratorHistory::moveTo):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::resolveMathMLStyle):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::baselinePosition):
(WebCore::RenderMathMLTable::firstLineBaseline):
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::ascentForChild):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::firstLineBaseline):
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::firstLineBaseline):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.cpp:
(WebCore::RenderMathMLPadded::firstLineBaseline):
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::firstLineBaseline):
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
(WebCore::RenderMathMLScripts::firstLineBaseline):
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.cpp:
(WebCore::RenderMathMLSpace::firstLineBaseline):
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateMathVariantGlyph):
(WebCore::RenderMathMLToken::firstLineBaseline):
* rendering/mathml/RenderMathMLToken.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::hitTestClipContent):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::setupNonScalingStrokeContext):
(WebCore::RenderSVGShape::nodeAtFloatPoint):
(WebCore::RenderSVGShape::calculateStrokeBoundingBox):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::clipToImageBuffer):
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::Parent::Parent):
* style/RenderTreeUpdater.h:
* style/StyleScope.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::parseAttribute):
(WebCore::SVGElement::resolveCustomStyle):
* svg/SVGElement.h:
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
(WebCore::SVGToOTFFontConverter::processGlyphElement):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
(WebCore::convertSVGToOTFFont):
* svg/SVGToOTFFontConversion.h:
* testing/Internals.cpp:
(WebCore::Internals::setEventThrottlingBehaviorOverride):
(WebCore::Internals::eventThrottlingBehaviorOverride):
* testing/Internals.h:
* workers/Worker.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::prepareToSend):
(WebCore::XMLHttpRequest::didFinishLoading):
* xml/XMLHttpRequest.h:
2016-11-26 Csaba Osztrogonác <ossy@webkit.org>
Fix build warnings in WebCore/Modules/indexeddb/server/IDBSerialization.cp
https://bugs.webkit.org/show_bug.cgi?id=165070
Reviewed by Brady Eidson.
* Modules/indexeddb/server/IDBSerialization.cpp:
2016-11-26 Sam Weinig <sam@webkit.org>
Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
https://bugs.webkit.org/show_bug.cgi?id=164965
Reviewed by Simon Fraser.
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::reset):
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIntersectionObserverEnabled):
(WebCore::RuntimeEnabledFeatures::intersectionObserverEnabled):
Add intersection observer setting.
* page/IntersectionObserver.idl:
* page/IntersectionObserverEntry.idl:
Convert to use EnabledAtRuntime extended attribute.
* page/Settings.in:
Remove the old intersection observer setting.
2016-11-26 Simon Fraser <simon.fraser@apple.com>
Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
https://bugs.webkit.org/show_bug.cgi?id=164992
Reviewed by Darin Adler.
std::chrono::milliseconds -> Seconds.
Rename Document::elapsedTime() to timeSinceDocumentCreation() which is more explicit.
Replace INSTRUMENT_LAYOUT_SCHEDULING with LOG(Layout...).
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::implicitClose):
(WebCore::Document::isLayoutTimerActive):
(WebCore::Document::minimumLayoutDelay):
(WebCore::Document::timeSinceDocumentCreation):
(WebCore::Document::elapsedTime): Deleted.
* dom/Document.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::layoutTimerFired):
(WebCore::FrameView::scheduleRelayout):
(WebCore::FrameView::scheduleRelayoutOfSubtree):
(WebCore::FrameView::unscheduleRelayout):
* page/Settings.cpp:
(WebCore::Settings::setLayoutInterval):
* page/Settings.h:
(WebCore::Settings::layoutInterval):
* style/StyleScope.cpp:
(WebCore::Style::Scope::removePendingSheet):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
2016-11-26 Simon Fraser <simon.fraser@apple.com>
Composited negative z-index elements are hidden behind the body sometimes
https://bugs.webkit.org/show_bug.cgi?id=165080
rdar://problem/22260229
Reviewed by Zalan Bujtas.
If the <body> falls into the "directly composited background color" code path
(say, because it's composited because of composited negative z-index children,
and has content of its own), then we failed to take root background propagation
into account, and put the opaque root background color on the body's layer.
Fix by sharing some code from RenderBox related to whether the body's renderer
paints its background.
Tests cover the buggy case, and the case where the <html> has its own background color.
Tests: compositing/backgrounds/negative-z-index-behind-body-non-propagated.html
compositing/backgrounds/negative-z-index-behind-body.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintsOwnBackground):
(WebCore::RenderBox::paintBackground):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
(WebCore::skipBodyBackground): Deleted.
* rendering/RenderBox.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
2016-11-25 Myles C. Maxfield <mmaxfield@apple.com>
[CSS Font Loading] FontFace.load() promises don't always fire
https://bugs.webkit.org/show_bug.cgi?id=165037
Reviewed by Simon Fraser.
We currently handle web fonts in two phases. The first phase is building up
StyleRuleFontFace objects which reflect the style on the page. The second is creating
CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
style on the page, we can often update the CSSFontFace objects, but there are some
modifications which we don't know how to model. For these operations, we destroy the
CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.
Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
Javascript objects which will persist across the rebuilding step mentioned above. This
means that the FontFace objects need to adopt the new CSSFontFace objects and forget
the old CSSFontFace objects.
This gets a little tricky because the operation which caused the rebuild may actually
be a modification to the specific @font-face block which backs a Javascript FontFace
object. Because the CSSOM can be used to change the src: attribute of the FontFace
object, I decided in r201971 to clear the FontFace's promise in case an old load would
cause the promise to resolve. However, this would never happen because the old
CSSFontFace is unparented during the FontFace::adopt()ion of the new CSSFontFace.
Therefore, old loads may still complete, but the signal would never make it to the
FontFace and therefore would not cause the promise to resolve. In addition, clearing
the promise during a rebuild is problematic because that rebuild may be caused by
operations which have nothing to do with the specific FontFace object in question (so
the FontFace object should be observably uneffected.)
Because of the above reasons, this patch simply stops clearing the promise during the
rebuild phase.
Tests: fast/text/fontface-rebuild-during-loading.html
fast/text/fontface-rebuild-during-loading-2.html
* css/FontFace.cpp:
(WebCore::FontFace::adopt):
2016-11-25 Andreas Kling <akling@apple.com>
MemoryPressureHandler should only trigger synchronous GC on iOS
<https://webkit.org/b/165043>
<rdar://problem/29312684>
Reviewed by Sam Weinig.
On iOS we know that there is really only one web process in play at a time,
so it's okay to do a synchronous GC immediately in response to high memory pressure.
On other platforms, we may have tens or hundreds of web processes, and if they
all start doing full GCs at the same time, it can easily bring a system to its knees
if it's already under pressure.
Fix this by using garbageCollectSoon() on non-iOS platforms.
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
2016-11-23 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Convert grid representation into a class
https://bugs.webkit.org/show_bug.cgi?id=165042
Reviewed by Manuel Rego Casasnovas.
So far grids are represented as Vectors of Vectors. There are a couple of issues associated
to that decision. First or all, the source code in RenderGrid assumes the existence of that
data structure, meaning that we cannot eventually change it without changing a lot of
code. Apart from the coupling there is another issue, RenderGrid is full of methods to
access and manipulate that data structure.
Instead, it'd be much better to have a Grid class encapsulating both the data structures and
the methods required to access/manipulate it. Note that follow-up patches will move even
more data and procedures into this new class from the RenderGrid code.
No new tests required as this is a refactoring.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::ensureGridSize): Moved from RenderGrid.
(WebCore::RenderGrid::Grid::insert): Ditto.
(WebCore::RenderGrid::Grid::clear): Ditto.
(WebCore::RenderGrid::GridIterator::GridIterator):
(WebCore::RenderGrid::gridColumnCount): Use Grid's methods.
(WebCore::RenderGrid::gridRowCount): Ditto.
(WebCore::RenderGrid::placeItemsOnGrid): Use Grid's methods to insert children.
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Ditto.
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
(WebCore::RenderGrid::numTracks): Use Grid's methods.
(WebCore::RenderGrid::ensureGridSize): Deleted. Moved to Grid class.
(WebCore::RenderGrid::insertItemIntoGrid): Deleted. Moved to Grid class.
* rendering/RenderGrid.h:
2016-11-24 Antti Koivisto <antti@apple.com>
Remove unused bool return from Element::willRecalcStyle
https://bugs.webkit.org/show_bug.cgi?id=165059
Reviewed by Andreas Kling.
It is always true.
* dom/Element.cpp:
(WebCore::Element::willRecalcStyle):
* dom/Element.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLFrameSetElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
* html/HTMLPlugInImageElement.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):
* svg/SVGElement.cpp:
(WebCore::SVGElement::willRecalcStyle):
* svg/SVGElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::willRecalcStyle):
* svg/SVGUseElement.h:
2016-11-22 Antti Koivisto <antti@apple.com>
CrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::ExtensionStyleSheets::pageUserSheet + 14
https://bugs.webkit.org/show_bug.cgi?id=165030
Reviewed by Darin Adler.
We failed to reset the style scope when an element was moved to a different document. This could lead to having dangling
document pointers in style scope and style resolver.
Test: fast/shadow-dom/shadow-host-move-to-different-document.html
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::didMoveToNewDocument):
Reset style scope.
* dom/ShadowRoot.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
Some more assertions.
* style/StyleScope.h:
(WebCore::Style::Scope::document):
2016-11-22 Darin Adler <darin@apple.com>
Make normal case fast in the input element limitString function
https://bugs.webkit.org/show_bug.cgi?id=165023
Reviewed by Dan Bernstein.
When running Speedometer, the limitLength function was showing up as hot.
Fixed a couple obvious problems with that function's performance.
* html/TextFieldInputType.cpp:
(WebCore::isASCIILineBreak): Deleted. The isHTMLLineBreak function does
the same thing, but faster.
(WebCore::limitLength): Added a FIXME comment explaining that the function
isn't really a good idea. Don't call through to numCharactersInGraphemeClusters
at all for 8-bit strings since we don't allow CR or LF characters in the string
anyway, so there are no grapheme clusters more than a single code unit. Removed
optimization when the length is the string's length that String::left already does.
(WebCore::TextFieldInputType::sanitizeValue): Use isHTMLLineBreak instead of
isASCIILineBreak.
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): Ditto.
* platform/LocalizedStrings.cpp: Use auto a lot more rather than writing out
RetainPtr.
(WebCore::truncatedStringForLookupMenuItem): Removed unneeded special case for
empty strings. Removed unneeded string with the ellipsis character in it, since
the makeString function already knows how to append a character to a string.
* rendering/RenderText.cpp:
(WebCore::mapLineBreakToIteratorMode): Updated for change to LineBreakIteratorMode.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition): Ditto.
2016-11-21 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Isolate size of internal representation from actual grid size
https://bugs.webkit.org/show_bug.cgi?id=165006
Reviewed by Manuel Rego Casasnovas.
RenderGrid has an internal representation of a grid used to place grid items, compute grid
positions, run the track sizing algorithm etc. That data structure normally has exactly the
same size as the actual grid specified using the grid-template-xxx properties (or any other
shorthand). But in some cases, like for example when the grid is empty, the internal data
structure does not really match the actual grid. In the particular case of empty grids no
memory allocations are done to create a grid representation as it is not needed.
From now on both gridColumnCount() and gridRowCount() will always return the size of the
data structure representing the grid whereas the newly added numTracks() will always return
the actual size of the grid.
This is the first required step of the process of isolating the data used by the grid track
sizing algorithm from the actual internal state of the LayoutGrid object.
No new tests as this is just a code refactoring.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridColumnCount): Always return the number of columns of the internal
data structure to represent the grid.
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use the actual size of the grid to
create the GridSizingData structure.
(WebCore::RenderGrid::placeItemsOnGrid): Use the actual size of the grid to create the
GridSizingData structure.
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::numTracks): New method which returns the actual size of the grid.
* rendering/RenderGrid.h:
2016-11-21 Konstantin Tokarev <annulen@yandex.ru>
Disable #line markers in bison output on Windows
https://bugs.webkit.org/show_bug.cgi?id=164973
Reviewed by Darin Adler.
New bison versions since 3.0 have bug that causes unescaped paths
to be printed in #line directives. On Windows CMake passes absolute
paths to bison that have backslashes in them, leading to compiler
errors or warnings because of unrecognized escape sequences.
No new tests needed.
* css/makegrammar.pl:
2016-11-21 Olivier Blin <olivier.blin@softathome.com>
[cmake][OpenWebRTC] Move SDPProcessorScriptResource rules to common WebCore
https://bugs.webkit.org/show_bug.cgi?id=164937
Reviewed by Youenn Fablet.
SDPProcessorScriptResource has been moved in common mediastream directory (bug 163940).
Since it is not specific to the GTK port, the matching cmake rules should be
moved out from PlatformGTK.cmake to the main WebCore CMakeLists.txt.
This is needed to build OpenWebRTC support in other ports, WPE in my case,
probably Mac, EFL and Qt as well.
This also fixes the path in SDP scripts dependencies, the old openwebrtc subdir
was still being used.
No new tests, build fix only
* CMakeLists.txt:
* PlatformGTK.cmake:
2016-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
Add URL::hostAndPort()
https://bugs.webkit.org/show_bug.cgi?id=164907
Reviewed by Alex Christensen.
As a convenient way of getting the host and port (if any) as a string.
* html/URLUtils.h:
(WebCore::URLUtils<T>::host): Use URL::hostAndPort().
* page/Location.cpp:
(WebCore::Location::host): Ditto.
* platform/URL.cpp:
(WebCore::URL::hostAndPort): Return host:port or just host if there isn't a port.
* platform/URL.h:
* platform/network/CredentialStorage.cpp:
(WebCore::originStringFromURL): Use URL::hostAndPort().
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::host): Ditto.
2016-11-21 Philippe Normand <pnormand@igalia.com>
[WebRTC][OpenWebRTC] parse turns urls
https://bugs.webkit.org/show_bug.cgi?id=164587
Reviewed by Alejandro G. Castro.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
Hook turns servers between the RTCConfiguration and the underlying
OpenWebRTC layer.
2016-11-21 Philippe Normand <pnormand@igalia.com>
[Gstreamer] Add volume and mute support to the WebRTC mediaplayer
https://bugs.webkit.org/show_bug.cgi?id=153828
Reviewed by Darin Adler.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::setVolume): New implementation setting the OWR source volume property.
(WebCore::MediaPlayerPrivateGStreamerOwr::setMuted): New implementation setting the OWR source mute property.
(WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Also set audio OWR source mute state depending on the track enabled state.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged): chain to maybeHandleChangeMuteState.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
2016-11-21 Alejandro G. Castro <alex@igalia.com> and Philippe Normand <pnormand@igalia.com>
[WebRTC][OpenWebRTC] RTP bundling support
https://bugs.webkit.org/show_bug.cgi?id=162333
Reviewed by Alejandro G. Castro.
Configure the OpenWebRTC transport agent bundle policy according
to the RTCConfiguration and pass the receive SSRCs over to
OpenWebRTC as well. Those are needed so the agent is aware of the
bundle layout.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateReceiveConfiguration):
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
2016-11-20 Zan Dobersek <zdobersek@igalia.com>
[EncryptedMedia] Make EME API runtime-enabled
https://bugs.webkit.org/show_bug.cgi?id=164927
Reviewed by Jer Noble.
Update the EME API IDL definitions to use the EnabledAtRuntime
attribute on the relevant interfaces, attributes and operations.
EncryptedMediaAPI is used as the attribute value.
The corresponding getter, setter and member boolean are added to
the RuntimeEnabledFeatures class.
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.idl:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled):
(WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled):
* html/HTMLMediaElement.idl:
* html/MediaEncryptedEvent.idl:
2016-11-20 Eric Carlson <eric.carlson@apple.com>
REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=164715
<rdar://problem/29277180>
Reviewed by Alexey Proskuryakov.
No new tests, fixes an existing test crash.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::contextDestroyed): Call base class method before clearing m_controller
because it nullifies the security context.
2016-11-19 Chris Dumez <cdumez@apple.com>
Update HTML form validation messages
https://bugs.webkit.org/show_bug.cgi?id=164957
<rdar://problem/29338669>
Reviewed by Darin Adler.
Update HTML form validation messages as per recent feedback:
- Drop the "Please".
- Drop the period at the end.
- Drop the "if you want to proceed" that was used only for the checkbox.
No new tests, rebaselined existing tests.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::validationMessageValueMissingText):
(WebCore::validationMessageValueMissingForCheckboxText):
(WebCore::validationMessageValueMissingForFileText):
(WebCore::validationMessageValueMissingForRadioText):
(WebCore::validationMessageValueMissingForSelectText):
(WebCore::validationMessageTypeMismatchText):
(WebCore::validationMessageTypeMismatchForEmailText):
(WebCore::validationMessageTypeMismatchForURLText):
(WebCore::validationMessagePatternMismatchText):
(WebCore::validationMessageTooShortText):
(WebCore::validationMessageTooLongText):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::validationMessageStepMismatchText):
(WebCore::validationMessageBadInputForNumberText):
2016-11-19 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Implement selection interface and states for elements supporting aria-selected and for menu roles
https://bugs.webkit.org/show_bug.cgi?id=164865
Reviewed by Chris Fleizach.
Implement AtkSelection and support ATK_STATE_SELECTABLE and ATK_STATE_SELECTED
for elements supporting aria-selected and for menu-related roles. Also enable the
equivalent support for the Mac because NSAccessibilitySelectedChildrenAttribute is
included as supported on the same roles.
In addition, fix several bugs discovered along the way: Call isSelected() on role
tab, because tab supports aria-selected; not aria-checked. Correct ATK mapping
of ListBoxRole and ListBoxOptionRole for combobox descendants. Always defer to
WebCore for inclusion/exclusion decisions related to elements with an explicit
ARIA role.
Tests: accessibility/aria-combobox-hierarchy.html
accessibility/aria-selected-menu-items.html
accessibility/aria-selected.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::selectedTabItem):
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isDescendantOfRole):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::canHaveSelectedChildren):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isSelected):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(webkitAccessibleSelectionGetSelectionCount):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
(getInterfaceMaskFromObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2016-11-19 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
https://bugs.webkit.org/show_bug.cgi?id=164855
Reviewed by Sam Weinig.
During UI-process panning and zooming, we send visible rect updates to the web process
with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
This causes a problem where the web process has a stale notion of where the GraphicsLayers
for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
in the scrolling tree.
To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
reconcileViewportConstrainedLayerPositions).
This allows us to remmove "viewportIsStable" from GraphicsLayer flushing, and FrameView.
SetOrSyncScrollingLayerPosition is made into an enum class.
Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
* page/FrameView.cpp:
(WebCore::FrameView::reset):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
(WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileScrollingState):
(WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
(WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions): Deleted.
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
(WebCore::ScrollingStateFixedNode::syncLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect):
(WebCore::ScrollingStateNode::syncLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
(WebCore::ScrollingStateStickyNode::syncLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setPosition):
(WebCore::GraphicsLayer::approximatePosition):
(WebCore::GraphicsLayer::setApproximatePosition):
(WebCore::GraphicsLayer::flushCompositingState):
(WebCore::GraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): No longer bail for viewportConstained layers when the viewport is unstable.
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::flushCompositingState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingState):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2016-11-19 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Expose aria-busy via ATK_STATE_BUSY
https://bugs.webkit.org/show_bug.cgi?id=164909
Reviewed by Chris Fleizach.
Expose aria-busy via ATK_STATE_BUSY. Also rename ariaLiveRegionBusy()
to isBusy() because in ARIA 1.1 aria-busy is no longer limited to live
regions.
Test: accessibility/aria-busy.html
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isBusy):
(WebCore::AccessibilityObject::ariaLiveRegionBusy): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isBusy):
(WebCore::AccessibilityRenderObject::ariaLiveRegionBusy): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityARIAIsBusy]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-11-19 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com
https://bugs.webkit.org/show_bug.cgi?id=164888
Reviewed by Antti Koivisto.
The bug was caused by FocusNavigationScope::parentInScope incorrectly returning nullptr when moving out of
a user agent shadow tree of a SVG use element. Fixed the bug by explicitly checking against the focus scope's
root node or its slot element. Also removed a superfluous early return when the parent node is a focus scope.
Tests: fast/shadow-dom/focus-navigation-out-of-slot.html
fast/shadow-dom/focus-navigation-passes-shadow-host.html
fast/shadow-dom/focus-navigation-passes-svg-use-element.html
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::parentInScope):
2016-11-18 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
https://bugs.webkit.org/show_bug.cgi?id=164980
Reviewed by Chris Dumez.
WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
flag that impacts tile coverage.
During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
Tests: fast/scrolling/ios/scroll-events-default.html
fast/scrolling/ios/scroll-events-responsive.html
fast/scrolling/ios/scroll-events-unresponsive.html
* page/Page.h:
(WebCore::Page::eventThrottlingBehaviorOverride):
(WebCore::Page::setEventThrottlingBehaviorOverride):
* testing/Internals.cpp:
(WebCore::Internals::setEventThrottlingBehaviorOverride):
(WebCore::Internals::eventThrottlingBehaviorOverride):
* testing/Internals.h:
* testing/Internals.idl:
2016-11-18 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix the build after r208917.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
2016-11-18 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix the build after r208917.
* dom/CustomElementReactionQueue.cpp:
2016-11-18 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::decrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164739
<rdar://problem/29257848>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::decrypt method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-decrypt.
2. It implements decrypt operations of the following algorithms: AES-CBC,
RSAES-PKCS1-V1_5, and RSA-OAEP.
Tests: crypto/subtle/aes-cbc-decrypt-malformed-parameters.html
crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html
crypto/subtle/aes-cbc-import-key-decrypt.html
crypto/subtle/decrypt-malformed-parameters.html
crypto/subtle/rsa-oaep-decrypt-malformed-parameters.html
crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html
crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
crypto/subtle/rsa-oaep-import-key-decrypt-label.html
crypto/subtle/rsa-oaep-import-key-decrypt.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html
crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html
crypto/workers/subtle/aes-cbc-import-key-decrypt.html
crypto/workers/subtle/rsa-oaep-import-key-decrypt.html
crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::toCryptoKey):
(WebCore::toVector):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::JSSubtleCrypto::decrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::decrypt):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::decryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::decryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
2016-11-18 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r208837.
The bots did not show a progression
Reverted changeset:
"REGRESSION(r208082): 1% Speedometer regression on iOS"
https://bugs.webkit.org/show_bug.cgi?id=164852
http://trac.webkit.org/changeset/208837
2016-11-18 Simon Fraser <simon.fraser@apple.com>
Remove use of std::chrono in WebPage and entrained code
https://bugs.webkit.org/show_bug.cgi?id=164967
Reviewed by Tim Horton.
Replace std::chrono with Seconds and Monotonic Time.
Use more C++11 initialization for WebPage data members.
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::setScrollVelocity):
* page/FrameView.h:
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
* platform/graphics/TiledBacking.h:
(WebCore::VelocityData::VelocityData):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect):
2016-11-18 Dean Jackson <dino@apple.com>
AX: "(inverted-colors)" media query only matches on page reload; should match on change
https://bugs.webkit.org/show_bug.cgi?id=163564
<rdar://problem/28807350>
Reviewed by Simon Fraser.
Mark some media queries as responding to notifications that
system accessibility settings have changed. When Page gets told
that has happened, check if any of the results have changed.
Tests: fast/media/mq-inverted-colors-live-update.html
fast/media/mq-monochrome-live-update.html
fast/media/mq-prefers-reduced-motion-live-update.html
* css/MediaQueryEvaluator.cpp:
(WebCore::isAccessibilitySettingsDependent):
(WebCore::MediaQueryEvaluator::evaluate):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addAccessibilitySettingsDependentMediaQueryResult):
(WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasAccessibilitySettingsDependentMediaQueries):
* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):
* page/Page.h:
2016-11-18 Anders Carlsson <andersca@apple.com>
Rename the 'other' Apple Pay Button type to 'donate'
https://bugs.webkit.org/show_bug.cgi?id=164978
Reviewed by Dean Jackson.
* DerivedSources.make:
* WebCorePrefix.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:
2016-11-18 Myles C. Maxfield <mmaxfield@apple.com>
[WebGL2] Implement texStorage2D()
https://bugs.webkit.org/show_bug.cgi?id=164493
Reviewed by Dean Jackson.
Create a new validation function which only accepts sized internalFormats.
After running texStorage2D(), we also texSubImage2D() to zero-fill it. This
is to compensate for potentially buggy drivers.
Because glTexStorage2D() was only added to OpenGL in version 4.2, not all
OpenGL 3.2+ contexts can implement this command. However, according to
https://developer.apple.com/opengl/capabilities/ all Apple GPUs have the
GL_ARB_texture_storage which implements this call. In the future, we could
implement texStorage2D() on top of texImage2D() if there are any ports which
want WebGL2 but don't have 4.2 and don't have the extension.
Also, when calling texStorage2D, callers specify an internalFormat but not a
type/format pair. This means that storing the texture's type is only valid
for WebGL 1 contexts. This patch surrounds all calls to reading the texture
type with guards and adds an ASSERT() at the read site to make sure the
right thing is happening.
Test: fast/canvas/webgl/webgl2-texStorage.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateTexStorageFuncParameters):
(WebCore::WebGL2RenderingContext::texStorage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::WebGLTexture):
(WebCore::WebGLTexture::getType):
(WebCore::WebGLTexture::needToUseBlackTexture):
(WebCore::WebGLTexture::canGenerateMipmaps):
(WebCore::internalFormatIsFloatType):
(WebCore::internalFormatIsHalfFloatType):
(WebCore::WebGLTexture::update):
* html/canvas/WebGLTexture.h:
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::texImage2DResourceSafe):
(WebCore::GraphicsContext3D::packImageData):
(WebCore::GraphicsContext3D::extractImageData):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::texStorage2D):
(WebCore::GraphicsContext3D::texStorage3D):
2016-11-18 Alex Christensen <achristensen@webkit.org>
TextDecoder constructor should not accept replacement encodings
https://bugs.webkit.org/show_bug.cgi?id=164903
Reviewed by Chris Dumez.
Covered by newly passing web platform tests.
* dom/TextDecoder.cpp:
(WebCore::TextDecoder::create):
https://encoding.spec.whatwg.org/#textdecoder says about the constructor:
"If label is either not a label or is a label for replacement, throws a RangeError."
See https://bugs.webkit.org/show_bug.cgi?id=159180 for the mapping of the replacement
codec names to "replacement".
2016-11-18 Chris Dumez <cdumez@apple.com>
Assertion failures in ActiveDOMObject::~ActiveDOMObject under Database destructor
https://bugs.webkit.org/show_bug.cgi?id=164955
<rdar://problem/29336715>
Reviewed by Brady Eidson.
Make sure the Database's DatabaseContext object is destroyed on the context
thread given that DatabaseContext is an ActiveDOMObject and there is an
assertion in the ActiveDOMObject destructor that it should be destroyed on
on the context thread.
No new tests, already covered by existing tests.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):
2016-11-18 Enrica Casucci <enrica@apple.com>
Refactor drag and drop for WebKit2 to encode DragData message exchange.
https://bugs.webkit.org/show_bug.cgi?id=164945
Reviewed by Tim Horton.
No new tests. No change in functionality.
* loader/EmptyClients.h:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::createMouseEvent):
(WebCore::documentFragmentFromDragData):
(WebCore::DragController::dragIsMove):
(WebCore::DragController::dragEntered):
(WebCore::DragController::dragExited):
(WebCore::DragController::dragUpdated):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::tryDocumentDrag):
(WebCore::DragController::operationForLoad):
(WebCore::DragController::dispatchTextInputEventFor):
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::tryDHTMLDrag):
* page/DragController.h:
* page/efl/DragControllerEfl.cpp:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/mac/DragControllerMac.mm:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/win/DragControllerWin.cpp:
(WebCore::DragController::dragOperation):
(WebCore::DragController::isCopyKeyDown):
* platform/DragData.h:
(WebCore::DragData::DragData):
2016-11-18 Jeremy Jones <jeremyj@apple.com>
Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
https://bugs.webkit.org/show_bug.cgi?id=163801
Reviewed by Simon Fraser.
These tests now pass with DumpRenderTree.
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-element-not-in-dom.html
LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
LayoutTests/pointer-lock/mouse-event-api.html
PointerLockController::requestPointerLock now protects against synchronous callback
to allowPointerLock().
Add pointerLockEnabled setting.
* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Fix existing typo.
(WebCore::Document::pointerLockElement):
* features.json:
* page/EventHandler.cpp:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
* page/Settings.in:
2016-11-17 Alex Christensen <achristensen@webkit.org>
Support IDN2008 with UTS #46 instead of IDN2003
https://bugs.webkit.org/show_bug.cgi?id=144194
Reviewed by Darin Adler.
Use uidna_nameToASCII instead of the deprecated uidna_IDNToASCII.
It uses IDN2008 instead of IDN2003, and it uses UTF #46 when used with a UIDNA opened with uidna_openUTS46.
This follows https://url.spec.whatwg.org/#concept-domain-to-ascii except we do not use Transitional_Processing
to prevent homograph attacks on german domain names with "ß" and "ss" in them. These are now treated as separate domains.
Firefox also doesn't use Transitional_Processing. Chrome and the current specification use Transitional_processing,
but https://github.com/whatwg/url/issues/110 might change the spec.
In addition, http://unicode.org/reports/tr46/ says:
"implementations are encouraged to apply the Bidi and ContextJ validity criteria"
Bidi checks prevent domain names with bidirectional text, such as latin and hebrew characters in the same domain. Chrome and Firefox do this.
ContextJ checks prevent code points such as U+200D, which is a zero-width joiner which users would not see when looking at the domain name.
Firefox currently enables ContextJ checks and it is suggested by UTS #46, so we'll do it.
ContextO checks, which we do not use and neither does any other browser nor the spec, would fail if a domain contains code points such as U+30FB,
which looks somewhat like a dot. We can investigate enabling these checks later.
Covered by new API tests and rebased LayoutTests.
The new API tests verify that we do not use transitional processing, that we do apply the Bidi and ContextJ checks, but not ContextO checks.
* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::internationalDomainNameTranscoder):
* platform/URLParser.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNameWithRange):
2016-11-18 Dean Jackson <dino@apple.com>
Better testing for accessibility media queries
https://bugs.webkit.org/show_bug.cgi?id=164954
<rdar://problem/29338292>
Reviewed by Myles Maxfield.
Provide an override mode for the accessibility media queries
that rely on system settings. This way we can test that they
are least responding to something.
Tests: fast/media/mq-inverted-colors-forced-value.html
fast/media/mq-monochrome-forced-value.html
* css/MediaQueryEvaluator.cpp: Query the Settings to see if we're
forcing a value.
(WebCore::monochromeEvaluate):
(WebCore::invertedColorsEvaluate):
(WebCore::prefersReducedMotionEvaluate):
* page/Settings.h:
* testing/InternalSettings.cpp: Add new forcing values for inverted-colors
and monochrome.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::settingsToInternalSettingsValue):
(WebCore::internalSettingsToSettingsValue):
(WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue):
(WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionValue): Deleted.
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2016-11-18 Myles C. Maxfield <mmaxfield@apple.com>
Unsupported emoji are invisible
https://bugs.webkit.org/show_bug.cgi?id=164944
<rdar://problem/28591608>
Reviewed by Dean Jackson.
In WidthIterator, we explicitly skip characters which the OS has no font
to render with. However, for emoji, we should draw something to show that
there is missing content. Because we have nothing to draw, we can draw
the .notdef glyph (empty box, or "tofu").
Test: fast/text/emoji-draws.html
* platform/graphics/WidthIterator.cpp:
(WebCore::characterMustDrawSomething):
(WebCore::WidthIterator::advanceInternal):
2016-11-18 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for record types
https://bugs.webkit.org/show_bug.cgi?id=164935
Reviewed by Tim Horton.
Add support for WebIDLs record types. We map them to HashMap<String, {OtherType}>.
* bindings/generic/IDLTypes.h:
- Add IDLRecord type and helper predicate.
- Remove IDLRegExp which is no longer in WebIDL and we never supported.
* bindings/js/JSDOMBinding.cpp:
(WebCore::stringToByteString):
(WebCore::identifierToByteString):
(WebCore::valueToByteString):
(WebCore::hasUnpairedSurrogate):
(WebCore::stringToUSVString):
(WebCore::identifierToUSVString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Refactor ByteString and USVString conversion to support converting from
either a JSValue or Identifier.
* bindings/js/JSDOMConvert.h:
(WebCore::DetailConverter<IDLRecord<K, V>>):
(WebCore::JSConverter<IDLRecord<K, V>>):
Add conversion support for record types. Use Detail::IdentifierConverter helper
to convert identifiers to strings using the correct conversion rules.
(WebCore::Converter<IDLUnion<T...>>::convert):
Update comments in union conversion to match current spec. Remove check
for regular expressions and add support for record types.
* bindings/scripts/CodeGenerator.pm:
(IsRefPtrType):
Add record and union types to the list of things that aren't RefPtrs.
(IsRecordType):
Add predicate for testing if a type is a record.
(IsWrapperType):
Remove check for union. This is now handled in the IsRefPtrType check.
(SkipIncludeHeader): Deleted.
(GetSequenceInnerType): Deleted.
(GetFrozenArrayInnerType): Deleted.
(GetSequenceOrFrozenArrayInnerType): Deleted.
Remove no longer necessary functions.
* bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForImplementationType):
Remove check for includes to skip. This is now only called for interfaces, which should be included
unconditionally.
(AddToIncludesForIDLType):
Add includes and recursive includes for record types.
(GenerateOverloadedFunctionOrConstructor):
Update to account for records.
(GetGnuVTableRefForInterface):
(GetGnuVTableNameForInterface):
(GetGnuMangledNameForInterface):
(GetWinVTableNameForInterface):
(GetWinMangledNameForInterface):
Strength-reduce GetNativeTypeForConversions and GetNamespaceForInterface into their callers.
(GetBaseIDLType):
Add support for IDLRecord. Remove call to GetIDLInterfaceName now that is simply the type name.
(GetNativeType):
Simplify sequence/FrozenArray support and add record support.
(GetNativeInnerType):
Generalize GetNativeVectorInnerType to work for record types as well.
(ShouldPassWrapperByReference):
Moved so native type accessors can be together.
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add record support.
(GetNativeTypeForConversions): Deleted.
(GetNamespaceForInterface): Deleted.
(GetNativeVectorType): Deleted.
(GetIDLInterfaceName): Deleted.
(GetNativeVectorInnerType): Deleted.
Remove unneeded functions.
* bindings/scripts/IDLParser.pm:
(typeDescription):
Add helper useful for debugging, that constructs the string form of a type.
(typeByApplyingTypedefs):
Add missing call to typeByApplyingTypedefs (this is noted by a fix in JSTestCallbackFunctionWithTypedefs.h)
(parseNonAnyType):
Remove unused $subtypeName variables and add support for parsing record types.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add tests for records and update results.
* testing/TypeConversions.h:
(WebCore::TypeConversions::testLongRecord):
(WebCore::TypeConversions::setTestLongRecord):
(WebCore::TypeConversions::testNodeRecord):
(WebCore::TypeConversions::setTestNodeRecord):
(WebCore::TypeConversions::testSequenceRecord):
(WebCore::TypeConversions::setTestSequenceRecord):
* testing/TypeConversions.idl:
Add record types so it can be tested from layout tests.
2016-11-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=164947
Reviewed by Myles Maxfield.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariationTag):
(WebCore::consumeFontVariationSettings):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-17 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::encrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164738
<rdar://problem/29257812>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::encrypt method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-encrypt.
2. It implements encrypt operations of the following algorithms: AES-CBC,
RSAES-PKCS1-V1_5, and RSA-OAEP.
3. It addes ASSERT(parameters) for every method that accepts a
std::unique_ptr<CryptoAlgorithmParameters>&& type parameter.
4. It changes RefPtr<CryptoKey>&& to Ref<CryptoKey>&& for every method that
accepts a CryptoKey.
Tests: crypto/subtle/aes-cbc-encrypt-malformed-parameters.html
crypto/subtle/aes-cbc-import-key-encrypt.html
crypto/subtle/encrypt-malformed-parameters.html
crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html
crypto/subtle/rsa-oaep-import-key-encrypt-label.html
crypto/subtle/rsa-oaep-import-key-encrypt.html
crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
crypto/workers/subtle/aes-cbc-import-key-encrypt.html
crypto/workers/subtle/rsa-oaep-import-key-encrypt.html
crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
Add a default constructor for initializing an empty BufferSource object.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::JSSubtleCrypto::encrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::exportKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::workQueue):
* crypto/SubtleCrypto.idl:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
(WebCore::CryptoAlgorithmAES_CBC::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
(WebCore::CryptoAlgorithmAES_KW::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
(WebCore::CryptoAlgorithmHMAC::exportKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::transformAES_CBC):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::encryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::encryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesCbcParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
* crypto/parameters/RsaOaepParams.idl: Added.
2016-11-18 Ryan Haddad <ryanhaddad@apple.com>
Attempt to fix iOS build again.
<rdar://problem/29312689>
Unreviewed build fix.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack):
2016-11-18 Myles C. Maxfield <mmaxfield@apple.com>
[CSS Font Loading] FontFaceSet.load() promises don't always fire
https://bugs.webkit.org/show_bug.cgi?id=164902
Reviewed by David Hyatt.
Test: fast/text/fontfaceset-rebuild-during-loading.html
We currently handle web fonts in two phases. The first phase is building up
StyleRuleFontFace objects which reflect the style on the page. The second is creating
CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
style on the page, we can often update the CSSFontFace objects, but there are some
modifications which we don't know how to model. For these operations, we destroy the
CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.
Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
Javascript objects which will persist across the rebuilding step mentioned above. This
means that the FontFace objects need to adopt the new CSSFontFace objects and forget
the old CSSFontFace objects.
There was one bit of state which I forgot to update during this rebuilding phase. The
FontFaceSet object contains an internal HashMap where a reference to a CSSFontFace
is used as a key. After the rebuilding phase, this reference wasn't updated to point
to the new CSSFontFace.
The solution is to instead use a reference to the higher-level FontFace as the key to
the HashMap. This object is persistent across the rebuilding phase (and it adopts
the new CSSFontFaces). There is not a lifetime problem because the FontFace holds a
strong reference to its backing CSSFontFace object.
This bug didn't cause a memory problem because the HashMap was keeping the old
CSSFontFace alive because the key was a strong reference.
This patch also adds a lengthy comment explaining how the migration works.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::initializeWrapper): This is another bit of state which didn't
survive the rebuilding phase. Moving it here causes it to survive.
(WebCore::CSSFontFace::wrapper):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h:
2016-11-18 Myles C. Maxfield <mmaxfield@apple.com>
[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the generated font file
https://bugs.webkit.org/show_bug.cgi?id=164846
<rdar://problem/29031509>
Reviewed by Darin Adler.
The fonts I'm generating in the SVG -> OTF converter have fractional FUnit values for their advances.
The CFF table can encode that, but hmtx can't, which means the font isn't internally consistent.
Covered by existing tests.
* svg/SVGToOTFFontConversion.cpp:
2016-11-18 Ryan Haddad <ryanhaddad@apple.com>
Attempt to fix iOS build.
<rdar://problem/29312689>
Unreviewed build fix.
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
2016-11-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
https://bugs.webkit.org/show_bug.cgi?id=164886
Reviewed by Dean Jackson.
* css/CSSGrammar.y.in:
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.
* css/CSSPropertySourceData.cpp:
(WebCore::CSSPropertySourceData::CSSPropertySourceData):
* css/CSSPropertySourceData.h:
Add a concept of disabled to CSSPropertySourceData. This is used for
commented out properties.
(WebCore::CSSRuleSourceData::create):
(WebCore::CSSRuleSourceData::createUnknown):
(WebCore::CSSRuleSourceData::CSSRuleSourceData):
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSheetForInspector):
(WebCore::CSSParser::parseDeclarationForInspector):
(WebCore::CSSParser::markSupportsRuleHeaderStart):
(WebCore::CSSParser::markRuleHeaderStart):
(WebCore::CSSParser::markPropertyEnd):
* css/parser/CSSParser.h:
Add functions that represent the new API for inspector sheet
and declaration parsing. Patch the old parse code to use StyleRule::Type
now that the CSSRuleSourceData type is gone.
* css/parser/CSSParserObserver.h:
Tweak the API for our memory management.
* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
(WebCore::parserContextForDocument):
(WebCore::StyleSheetHandler::StyleSheetHandler):
(WebCore::StyleSheetHandler::startRuleHeader):
(WebCore::StyleSheetHandler::setRuleHeaderEnd):
(WebCore::StyleSheetHandler::endRuleHeader):
(WebCore::StyleSheetHandler::observeSelector):
(WebCore::StyleSheetHandler::startRuleBody):
(WebCore::StyleSheetHandler::endRuleBody):
(WebCore::StyleSheetHandler::popRuleData):
(WebCore::fixUnparsedProperties):
(WebCore::StyleSheetHandler::fixUnparsedPropertyRanges):
(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::isValidSelectorListString):
(WebCore::InspectorStyleSheet::ensureSourceData):
(WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
(WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
(WebCore::createCSSParser): Deleted.
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges): Deleted.
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorStyleProperty::setRawTextFromStyleDeclaration):
Add the new implementation. This involves duplicating most of the old
parser code for this into a new class, StyleSheetHandler, that implements
the observer interface and builds up the same data structures as the old
parser did in response to the callbacks.
2016-11-18 Dan Bernstein <mitz@apple.com>
Tried to fix some non-macOS builds.
<rdar://problems/29331425&29331438&29331722>
* platform/mac/WebPlaybackControlsManager.h:
2016-11-18 Per Arne Vollan <pvollan@apple.com>
[Win32] Start releasing memory earlier when memory is running low.
https://bugs.webkit.org/show_bug.cgi?id=164862
Reviewed by Brent Fulgham.
On Windows, 32-bit processes have 2GB of memory available, where some is used by the system.
Debugging has shown that allocations might fail and cause crashes when memory usage is > ~1GB.
We should start releasing memory before we reach 1GB.
* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::CheckMemoryTimer::fired):
2016-11-17 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
https://bugs.webkit.org/show_bug.cgi?id=164864
Reviewed by Simon Fraser.
This happens sometimes since r208511 because the same decoder is used by more than one thread at the same
time and the decoders are not thread-safe. Several methods in ImageDecoder need to decode partially the image,
so it's possible that one method calls frameBufferAtIndex at the same times as createFrameImageAtIndex that now
can be called from the image decoder thread. Use a Lock in ImageDecoder to protect calls to frameBufferAtIndex.
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:
2016-11-17 Ryosuke Niwa <rniwa@webkit.org>
Add an experimental API to find elements across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=164851
<rdar://problem/28220092>
Reviewed by Sam Weinig.
Add window.collectMatchingElementsInFlatTree(Node node, DOMString selectors)
as an experimental API which finds a list of elements that matches the given CSS selectors
and expose it to a JSWorld on which WKBundleScriptWorldMakeAllShadowRootsOpen was called.
No new tests. More test cases are added to WebKit2.InjectedBundleMakeAllShadowRootsOpen.
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck): Added. Abstracts checks for EnabledAtRuntime and EnabledForWorld.
(OperationShouldBeOnInstance):
(GeneratePropertiesHashTable):
(GetRuntimeEnableFunctionName): Use worldForDOMObject(this).condition() for EnabledForWorld.
Also split the line for EnabledAtRuntime and EnabledAtRuntime for a better readability.
(GenerateImplementation):
(addIterableProperties):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttribute):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorld):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldCaller):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionWorldSpecificMethod):
(WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodCaller):
* bindings/scripts/test/TestGlobalObject.idl: Added a test case.
* bindings/scripts/test/TestObj.idl: Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::collectMatchingElementsInFlatTree): Added. Implements the feature by
calling SelectorQuery's matches on a node yielded by ComposedTreeIterator.
* page/DOMWindow.h:
* page/DOMWindow.idl:
2016-11-17 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for ByteString
https://bugs.webkit.org/show_bug.cgi?id=164901
Reviewed by Darin Adler.
* bindings/generic/IDLTypes.h:
Make IDLByteString a IDLString.
* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToByteString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Add conversion function for ByteString and fix valueToUSVString to take an ExecState reference.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLByteString>::convert):
(WebCore::JSConverter<IDLByteString>::convert):
Add conversion functions for ByteString, using valueToByteString.
(WebCore::Converter<IDLUSVString>::convert):
Update to pass the ExecState by reference.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Update to pass the ExecState by reference.
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
Update to pass the ExecState by reference.
* bindings/scripts/CodeGenerator.pm:
Add ByteString as a string type.
* testing/TypeConversions.h:
(WebCore::TypeConversions::testByteString):
(WebCore::TypeConversions::setTestByteString):
* testing/TypeConversions.idl:
Add a testByteString attribute for testing.
2016-11-17 Ryosuke Niwa <rniwa@webkit.org>
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
https://bugs.webkit.org/show_bug.cgi?id=164857
<rdar://problem/27721742>
Reviewed by Wenson Hsieh.
It turns out that some users want text replacement to be always enabled so change the semantics of
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to only disable everything else.
Instead of completely disabling spellchecking, remove all text checking options but text replacement
when the user types into an input element on which this API is used to disable spellchecking.
No new tests since we don't have a good facility to test text replacement.
* dom/Element.h:
(WebCore::Element::isSpellCheckingEnabled): Made this non-virtual now that there is no override.
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Don't call resolveTextCheckingTypeMask twice.
(WebCore::Editor::resolveTextCheckingTypeMask): Filter out the text checking options if the root editable
element is inside an input element on which isSpellcheckDisabledExceptTextReplacement is set to true.
* editing/Editor.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::isSpellCheckingEnabled): Deleted.
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::setSpellcheckDisabledExceptTextReplacement): Renamed from setSpellcheckEnabled
to reflect the new semantics.
(WebCore::HTMLInputElement::isSpellcheckDisabledExceptTextReplacement): Ditto.
2016-11-17 John Wilander <wilander@apple.com>
Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
https://bugs.webkit.org/show_bug.cgi?id=164659
Reviewed by Andy Estes.
No new tests. This feature is behind a flag and off by default. Tests require real domain names.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
All three functions are now more conservative in calls to
m_store->fireDataModificationHandler(). They only fire when an important statistic has
changed or data records have previously been removed for the domain in question.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode):
Added the dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatistics::decode):
Now takes a version parameter to control which keys to expect.
Added the dataRecordsRemoved statistic.
(WebCore::appendHashCountedSet):
Removed stray linefeed.
(WebCore::ResourceLoadStatistics::toString):
Added the dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatistics::merge):
Added the dataRecordsRemoved statistic.
* loader/ResourceLoadStatistics.h:
Added the dataRecordsRemoved statistic.
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
Now encodes a version number for the statistics model.
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
Now tries to decode a version number and passes it on to statistics decoding.
(WebCore::ResourceLoadStatisticsStore::processStatistics):
No longer gates processing on the number of data captured.
(WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
Update function for the new dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing): Deleted.
No longer needed since we no longer gate processing on the number of data captured.
* loader/ResourceLoadStatisticsStore.h:
2016-11-17 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r208740
https://bugs.webkit.org/show_bug.cgi?id=164749
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore::GraphicsContext3D::getExtensions):
Use more references instead of pointers, like Myles did in r208740
2016-11-17 Alex Christensen <achristensen@webkit.org>
Implement TextDecoder and TextEncoder
https://bugs.webkit.org/show_bug.cgi?id=163771
Reviewed by Sam Weinig.
This API is already implemented by Chrome and Firefox
as specified in https://encoding.spec.whatwg.org/
Covered by newly passing web platform tests.
* features.json:
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/TextDecoder.cpp: Added.
(WebCore::isEncodingWhitespace):
(WebCore::TextDecoder::create):
(WebCore::TextDecoder::TextDecoder):
(WebCore::TextDecoder::ignoreBOMIfNecessary):
(WebCore::TextDecoder::prependBOMIfNecessary):
(WebCore::codeUnitByteSize):
(WebCore::TextDecoder::decode):
(WebCore::TextDecoder::encoding):
* dom/TextDecoder.h: Added.
(WebCore::TextDecoder::fatal):
(WebCore::TextDecoder::ignoreBOM):
* dom/TextDecoder.idl: Added.
* dom/TextEncoder.cpp: Added.
(WebCore::TextEncoder::TextEncoder):
(WebCore::TextEncoder::encoding):
(WebCore::TextEncoder::encode):
* dom/TextEncoder.h: Added.
(WebCore::TextEncoder::create):
* dom/TextEncoder.idl: Added.
2016-11-17 Sam Weinig <sam@webkit.org>
Try to fix the windows build again.
* svg/SVGStringList.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
(WebCore::SVGStaticListPropertyTearOff::SVGStaticListPropertyTearOff):
2016-11-17 Sam Weinig <sam@webkit.org>
Try to fix the windows build.
* svg/SVGStringList.h:
Remove unnecessary using declarations.
2016-11-17 Chris Dumez <cdumez@apple.com>
Regression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
https://bugs.webkit.org/show_bug.cgi?id=164887
<rdar://problem/29319497>
Reviewed by Brady Eidson.
Restore pre-r208672 behavior where we do not ref the script execution context in the
background thread since this is unsafe. We use WTFMove(m_scriptExecutionContext)
instead of m_scriptExecutionContext.copyRef(). Before r208672, it was calling
m_scriptExecutionContext.releaseNonNull() because m_scriptExecutionContext was a
RefPtr instead of a Ref. Note that copyRef() causes 2 issues here:
1. It refs the scriptExecutionContext in a non-main thread which is unsafe and asserts.
2. The point of this postTask in the destructor is to make sure the scriptExecutionContext
gets destroyed in the main thread so we definitely want to *transfer* ownership of
m_scriptExecutionContext to the main thread, not ref it to pass it to the main thread.
No new tests, already covered by storage/websql/multiple-transactions-on-different-handles.html.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):
2016-11-17 Brady Eidson <beidson@apple.com>
Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894
Reviewed by Alex Christensen.
No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).
With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
For icons the app decides to load, WebKit will pass the data to the app without storing locally.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::didGetLoadDecisionForIcon):
(WebCore::DocumentLoader::finishedLoadingIcon):
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(WebCore::LinkIcon::encode):
(WebCore::LinkIcon::decode):
2016-11-15 Sam Weinig <sam@webkit.org>
[SVG] Moving more special casing of SVG out of the bindings - SVG lists
https://bugs.webkit.org/show_bug.cgi?id=164790
Reviewed by Alex Christensen.
- Make SVGLengthList, SVGNumberList, SVGPointList, SVGStringList, SVGPathSegList and SVGTransformList
real classes and stop special casing them in the bindings generator. This
removes the remaining SVG specializations for tear offs from the bindings generator.
- Renamed existing SVGLengthList, SVGNumberList, SVGPointList, SVGStringList, SVGPathSegList,
SVGPathSegList and SVGTransformList to SVG<Type>ListValues, to make way for the new classes.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
Add new files.
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
Remove SVG tear off specific code!
* rendering/svg/RenderSVGShape.cpp:
* rendering/svg/RenderSVGText.cpp:
* rendering/svg/RenderSVGTextPath.cpp:
* rendering/svg/SVGRenderTreeAsText.cpp:
* svg/SVGAnimateMotionElement.cpp:
* svg/SVGClipPathElement.cpp:
* svg/SVGLinearGradientElement.cpp:
* svg/SVGRadialGradientElement.cpp:
Remove unnecessary #includes.
* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromPolygonElement):
(WebCore::updatePathFromPolylineElement):
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::updateCharacterData):
(WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::constructFromString):
(WebCore::parseLengthListFromString):
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedLengthListAnimator::calculateDistance):
* svg/SVGAnimatedLengthList.h:
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::constructFromString):
(WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedNumberListAnimator::calculateDistance):
* svg/SVGAnimatedNumberList.h:
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::constructFromString):
(WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedPointListAnimator::calculateDistance):
* svg/SVGAnimatedPointList.h:
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::constructFromString):
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedTransformList.h:
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createLengthList):
(WebCore::SVGAnimatedType::createNumberList):
(WebCore::SVGAnimatedType::createPointList):
(WebCore::SVGAnimatedType::createTransformList):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::lengthList):
(WebCore::SVGAnimatedType::numberList):
(WebCore::SVGAnimatedType::pointList):
(WebCore::SVGAnimatedType::transformList):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::parseAttribute):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGParserUtilities.cpp:
(WebCore::pointsListFromSVGData):
* svg/SVGParserUtilities.h:
* svg/SVGPathElement.cpp:
* svg/SVGPathElement.h:
* svg/SVGPathSegListBuilder.cpp:
* svg/SVGPathSegListBuilder.h:
* svg/SVGPathSegListSource.cpp:
* svg/SVGPathSegListSource.h:
* svg/SVGPathUtilities.cpp:
(WebCore::buildSVGPathByteStreamFromSVGPathSegListValues):
(WebCore::appendSVGPathByteStreamFromSVGPathSeg):
(WebCore::buildSVGPathSegListValuesFromByteStream):
(WebCore::buildStringFromSVGPathSegListValues):
(WebCore::buildSVGPathByteStreamFromSVGPathSegList): Deleted.
(WebCore::buildSVGPathSegListFromByteStream): Deleted.
(WebCore::buildStringFromSVGPathSegList): Deleted.
* svg/SVGPathUtilities.h:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
(WebCore::SVGPolyElement::points):
(WebCore::SVGPolyElement::animatedPoints):
* svg/SVGPolyElement.h:
(WebCore::SVGPolyElement::pointList):
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::parseAttribute):
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformAttribute):
* svg/SVGTransformable.h:
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::viewTarget):
(WebCore::SVGViewElement::parseAttribute):
* svg/SVGViewElement.h:
* svg/SVGViewElement.idl:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::transformString):
(WebCore::SVGViewSpec::transform):
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
(WebCore::SVGViewSpec::reset):
* svg/SVGViewSpec.h:
Update for name changes.
* svg/SVGAngle.h:
(WebCore::SVGAngle::create):
(WebCore::SVGAngle::SVGAngle):
* svg/SVGLength.h:
(WebCore::SVGLength::create):
(WebCore::SVGLength::SVGLength):
* svg/SVGMatrix.h:
(WebCore::SVGMatrix::create):
(WebCore::SVGMatrix::SVGMatrix):
* svg/SVGNumber.h:
(WebCore::SVGNumber::create):
(WebCore::SVGNumber::SVGNumber):
* svg/SVGPoint.h:
(WebCore::SVGPoint::create):
(WebCore::SVGPoint::SVGPoint):
* svg/SVGPreserveAspectRatio.h:
(WebCore::SVGPreserveAspectRatio::create):
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
* svg/SVGRect.h:
(WebCore::SVGRect::create):
(WebCore::SVGRect::SVGRect):
* svg/SVGTransform.h:
(WebCore::SVGTransform::create):
(WebCore::SVGTransform::SVGTransform):
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::create):
Pass the SVGAnimatedProperty parameter by reference.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::requiredFeatures):
(WebCore::SVGAnimationElement::requiredExtensions):
(WebCore::SVGAnimationElement::systemLanguage):
* svg/SVGAnimationElement.h:
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::requiredFeatures):
(WebCore::SVGCursorElement::requiredExtensions):
(WebCore::SVGCursorElement::systemLanguage):
* svg/SVGCursorElement.h:
* svg/SVGGradientElement.cpp:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::requiredFeatures):
(WebCore::SVGGraphicsElement::requiredExtensions):
(WebCore::SVGGraphicsElement::systemLanguage):
* svg/SVGGraphicsElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::requiredFeatures):
(WebCore::SVGMaskElement::requiredExtensions):
(WebCore::SVGMaskElement::systemLanguage):
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
(WebCore::SVGPatternElement::requiredFeatures):
(WebCore::SVGPatternElement::requiredExtensions):
(WebCore::SVGPatternElement::systemLanguage):
* svg/SVGPatternElement.h:
* svg/SVGTests.cpp:
(WebCore::SVGTests::synchronizeAttribute):
(WebCore::SVGTests::synchronizeRequiredFeatures):
(WebCore::SVGTests::synchronizeRequiredExtensions):
(WebCore::SVGTests::synchronizeSystemLanguage):
(WebCore::SVGTests::requiredFeatures):
(WebCore::SVGTests::requiredExtensions):
(WebCore::SVGTests::systemLanguage):
* svg/SVGTests.h:
* svg/SVGTests.idl:
Make SVGTests SVGStringLists work by adding implementations of functions
on the SVGElements that implement SVGTests, passing *this down to SVGTests.
* svg/SVGLengthList.cpp: Removed.
* svg/SVGLengthList.h:
* svg/SVGLengthList.idl:
* svg/SVGLengthListValues.cpp: Copied from svg/SVGLengthList.cpp.
* svg/SVGLengthListValues.h: Copied from svg/SVGLengthList.h.
Rename SVGLengthList to SVGLengthListValues and add an explicit implementation of
the SVGLengthList interface inheriting from SVGListPropertyTearOff<SVGLengthListValues>.
* svg/SVGNumberList.cpp: Removed.
* svg/SVGNumberList.h:
* svg/SVGNumberListValues.cpp: Copied from svg/SVGNumberList.cpp.
* svg/SVGNumberListValues.h: Copied from svg/SVGNumberList.h.
Rename SVGNumberList to SVGNumberListValues and add an explicit implementation of
the SVGNumberList interface inheriting from SVGListPropertyTearOff<SVGNumberListValues>.
* svg/SVGPathSegList.cpp:
* svg/SVGPathSegList.h:
* svg/SVGPathSegListValues.cpp: Copied from svg/SVGPathSegList.cpp.
* svg/SVGPathSegListValues.h: Copied from svg/SVGPathSegList.h.
* svg/properties/SVGPathSegListPropertyTearOff.cpp: Removed.
* svg/properties/SVGPathSegListPropertyTearOff.h: Removed.
Rename SVGPathSegList to SVGPathSegListValues and add an explicit implementation of
the SVGPathSegList interface inheriting from SVGListProperty<SVGPathSegListValues>.
* svg/SVGPointList.cpp: Removed.
* svg/SVGPointList.h:
* svg/SVGPointListValues.cpp: Copied from svg/SVGPointList.cpp.
* svg/SVGPointListValues.h: Copied from svg/SVGPointList.h.
Rename SVGPointList to SVGPointListValues and add an explicit implementation of
the SVGPointList interface inheriting from SVGListPropertyTearOff<SVGPointListValues>.
* svg/SVGStringList.cpp: Removed.
* svg/SVGStringList.h:
* svg/SVGStringListValues.cpp: Copied from svg/SVGStringList.cpp.
* svg/SVGStringListValues.h: Copied from svg/SVGStringList.h.
Rename SVGStringList to SVGStringListValues and add an explicit implementation of
the SVGStringList interface inheriting from SVGStaticListPropertyTearOff<SVGStringListValues>.
* svg/SVGTransformList.cpp: Removed.
* svg/SVGTransformList.h:
* svg/SVGTransformListValues.cpp: Copied from svg/SVGTransformList.cpp.
* svg/SVGTransformListValues.h: Copied from svg/SVGTransformList.h.
* svg/properties/SVGTransformListPropertyTearOff.h: Removed.
Rename SVGTransformList to SVGTransformListValues and add an explicit implementation of
the SVGTransformList interface inheriting from SVGListPropertyTearOff<SVGTransformListValues>.
* svg/properties/SVGAnimatedListPropertyTearOff.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
Convert to return fully specialized types for baseVal and animVal, removing many unnecessary casts
around the codebase. Also add some uses of Ref.
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::create):
(WebCore::SVGListPropertyTearOff::SVGListPropertyTearOff):
(WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
Store the AnimatedListPropertyTearOff as a Ref, and pass it around by reference.
* svg/properties/SVGStaticPropertyTearOff.h:
Update to take the ContextElement by reference.
2016-11-17 Brent Fulgham <bfulgham@apple.com>
Improve URL length handling
https://bugs.webkit.org/show_bug.cgi?id=164884
<rdar://problem/5909143>
Reviewed by David Kilzer.
Make sure the result of re-encoding and other fix-up stays within
expected parameters.
No new tests. No change in behavior.
* platform/URL.cpp:
(WebCore::URL::parse):
2016-11-17 Zalan Bujtas <zalan@apple.com>
Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162834
Reviewed by Simon Fraser.
This is a preventive patch to ensure we don't introduce new bugs through
dirty renderers. There are still 3 failing cases and they are skipped for now (debug only).
* page/FrameView.cpp:
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
2016-11-17 Brent Fulgham <bfulgham@apple.com>
keygen element should not support < 2048 RSA key lengths
https://bugs.webkit.org/show_bug.cgi?id=164874
<rdar://problem/22618141>
Reviewed by Dean Jackson.
Remove the two insecure RSA choices (512-bit and 1024-bit) so that users
do not accidentally select a bad key length.
Tested by fast/html/keygen.html
* platform/LocalizedStrings.cpp:
(WebCore::keygenMenuItem512): Deleted.
(WebCore::keygenMenuItem1024): Deleted.
* platform/LocalizedStrings.h:
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString): ASSERT on bad key size.
(WebCore::getSupportedKeySizes): Remove bad key sizes.
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::WebCore::getSupportedKeySizes): Ditto.
2016-11-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream][Mac] Use AVCapturePreview object for camera/microphone rendering
https://bugs.webkit.org/show_bug.cgi?id=164837
<rdar://problem/29297727>
Reviewed by Jer Noble.
No new tests, the real capture devices can not be used in layout tests.
* WebCore.xcodeproj/project.pbxproj:
Drive-by fix: clear m_settingMediaStreamSrcObject when the media player is destroyed unless
that happens as a side effect of setting video.srcObject.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::clearMediaPlayer):
* html/HTMLMediaElement.h:
Add support for realtime media source that vend a preview interface, while keeping support
for those that do not (e.g. the mock capture devices).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::internalSetVolume):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::platformLayer): Deleted, no longer used.
* platform/mediastream/MediaStreamPrivate.h:
Enable/disable the preview when available.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setEnabled):
(WebCore::MediaStreamTrackPrivate::endTrack):
(WebCore::MediaStreamTrackPrivate::preview):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::preview):
(WebCore::RealtimeMediaSource::createWeakPtr):
(WebCore::RealtimeMediaSource::platformLayer): Deleted.
Define a realtime media source preview interface.
* platform/mediastream/RealtimeMediaSourcePreview.h: Added.
(WebCore::RealtimeMediaSourcePreview::~RealtimeMediaSourcePreview):
(WebCore::RealtimeMediaSourcePreview::invalidate):
(WebCore::RealtimeMediaSourcePreview::createWeakPtr):
(WebCore::RealtimeMediaSourcePreview::RealtimeMediaSourcePreview):
Implement the preview interface.
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioSourcePreview::create):
(WebCore::AVAudioSourcePreview::AVAudioSourcePreview):
(WebCore::AVAudioSourcePreview::invalidate):
(WebCore::AVAudioSourcePreview::play):
(WebCore::AVAudioSourcePreview::pause):
(WebCore::AVAudioSourcePreview::setEnabled):
(WebCore::AVAudioSourcePreview::setVolume):
(WebCore::AVAudioSourcePreview::updateState):
(WebCore::AVAudioCaptureSource::createPreview):
* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaCaptureSource::createWeakPtr):
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::reset):
(WebCore::AVMediaCaptureSource::preview):
(WebCore::AVMediaCaptureSource::removePreview):
(WebCore::AVMediaSourcePreview::AVMediaSourcePreview):
(WebCore::AVMediaSourcePreview::~AVMediaSourcePreview):
(WebCore::AVMediaSourcePreview::invalidate):
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoSourcePreview::create):
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview):
(WebCore::AVVideoSourcePreview::invalidate):
(WebCore::AVVideoSourcePreview::play):
(WebCore::AVVideoSourcePreview::pause):
(WebCore::AVVideoSourcePreview::setPaused):
(WebCore::AVVideoSourcePreview::setEnabled):
(WebCore::AVVideoCaptureSource::shutdownCaptureSession):
(WebCore::AVVideoCaptureSource::processNewFrame):
(WebCore::AVVideoCaptureSource::createPreview):
(WebCore::AVVideoCaptureSource::platformLayer): Deleted.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::platformLayer): Deleted.
(WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::applyFrameRate):
(WebCore::MockRealtimeVideoSource::applySize):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::updatePlatformLayer): Deleted.
2016-11-17 Chris Dumez <cdumez@apple.com>
Unreviewed, fix build after r208839.
* dom/Node.h:
(WebCore::Node::isDescendantOf):
2016-11-16 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add @supports, @keyframe and media query parsing options
https://bugs.webkit.org/show_bug.cgi?id=164821
Reviewed by Sam Weinig and Zalan Bujtas.
* css/CSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::setKeyText):
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::findKeyframeIndex):
Changed to call into CSSParserImpls implementation. The new parser
is now always used when parsing the key list.
* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
(WebCore::MediaQuerySet::MediaQuerySet):
(WebCore::MediaQuerySet::set):
(WebCore::MediaQuerySet::add):
(WebCore::MediaQuerySet::remove):
(WebCore::MediaList::setMediaText):
(WebCore::parseMediaDescriptor): Deleted.
(WebCore::MediaQuerySet::internalParse): Deleted.
(WebCore::MediaQuerySet::parse): Deleted.
* css/MediaList.h:
Rewritten to remove fallback descriptor support/parsing, since no other
browser supports it, and this was part of our initial 2005 landing that
nobody else appears to use. Media queries now call into the new parser always.
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidDensity):
(WebCore::featureWithPositiveNumber):
(WebCore::MediaQueryExpression::MediaQueryExpression):
Make sure to support transform2d, animation and transition.
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
Call the normal create now that fallback descriptor syntax is gone.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseDeclarationDeprecated):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::parseKeyframeKeyList):
(WebCore::CSSParser::parseMediaQuery): Deleted.
(WebCore::CSSParser::parseKeyframeSelector): Deleted.
* css/parser/CSSParser.h:
Patched the old parser to have flags to call into the new parser
for supports conditions and keyframes. Rename the parseDeclaration that
is only used by the old parser to have the word Deprecated in it. Removed
the media query and key list parsing functions, since the new parser
now does it always.
* css/parser/CSSParserIdioms.cpp:
(WebCore::convertToASCIILowercaseInPlace): Deleted.
* css/parser/CSSParserIdioms.h:
* css/parser/CSSParserToken.cpp:
(WebCore::convertToASCIILowercaseInPlace):
(WebCore::CSSParserToken::convertToASCIILowercaseInPlace):
* css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::value):
(WebCore::CSSParserToken::initValueFromStringView):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAttr):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
(WebCore::CSSSelectorParser::consumePseudo):
Moving convertToASCIILowercase to be a CSSParserToken member function instead
of operating on StringView. This saves an extra step, since the token itself
already had all the correct members. Note that converting in-place is bad,
and we'll be removing it once the new parser turns on.
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readMediaType):
(WebCore::MediaQueryParser::readFeature):
(WebCore::MediaQueryParser::readFeatureEnd):
Require the closing ")" on features. Fix the in-place lowercasing to only
be done for features, not for types. This matches the old parser.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parseAttribute):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::mediaAttributeMatches):
Patched to call the normal MediaQuerySet::create and not the one that had fallback
descriptor support.
2016-11-17 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix link error after r208841 part2
Use static_cast to avoid referencing static storage.
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):
2016-11-17 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix link error after r208841
* storage/StorageMap.h:
2016-11-17 Saam Barati <sbarati@apple.com>
Remove async/await compile time flag and enable tests
https://bugs.webkit.org/show_bug.cgi?id=164828
<rdar://problem/28639334>
Reviewed by Yusuke Suzuki.
* Configurations/FeatureDefines.xcconfig:
2016-11-17 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] WTF::TemporaryChange with WTF::SetForScope
https://bugs.webkit.org/show_bug.cgi?id=164761
Reviewed by Saam Barati.
No behavior change.
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/StyleResolver.cpp:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseBorderRadius):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* dom/CustomElementRegistry.h:
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
(WebCore::Document::destroyRenderTree):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* history/PageCache.cpp:
(WebCore::PageCache::pruneToSizeNow):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::scan):
* html/parser/HTMLConstructionSite.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::handleProvisionalLoadFailure):
* loader/SubresourceLoader.cpp:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
* page/Chrome.cpp:
(WebCore::Chrome::runModal):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::applyRecursivelyWithVisibleRect):
(WebCore::FrameView::autoSizeIfEnabled):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeaders):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
* platform/graphics/opengl/TemporaryOpenGLSetting.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::writeClipboardContents):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* rendering/RenderBlock.cpp:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushMappingsToAncestor):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest):
* replay/EventLoopInputDispatcher.cpp:
(WebCore::EventLoopInputDispatcher::dispatchInput):
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::addAnimatedPath):
2016-11-16 Yusuke Suzuki <utatane.tea@gmail.com>
[WebCore] Clean up script loading code in XML
https://bugs.webkit.org/show_bug.cgi?id=161651
Reviewed by Ryosuke Niwa.
This patch cleans up XML document script handling by using PendingScript.
Previously, we directly used CachedScript. But it is not good since we
have PendingScript wrapper.
We also disable ES6 modules for non HTML document. While ES6 modules tag
requires "defer" semantics, "defer" semantics is not implemented in non
HTML documents. And ES6 module tag is only specified in whatwg HTML spec.
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::execute):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::executeClassicScript):
(WebCore::ScriptElement::executePendingScript):
(WebCore::ScriptElement::executeScript): Deleted.
(WebCore::ScriptElement::executeScriptForScriptRunner): Deleted.
* dom/ScriptElement.h:
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):
* html/parser/HTMLDocumentParser.cpp:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
(WebCore::HTMLScriptRunner::runScript):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParser.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):
2016-11-16 Chris Dumez <cdumez@apple.com>
Add Node::isDescendantOf() overload that takes in a reference
https://bugs.webkit.org/show_bug.cgi?id=164854
Reviewed by Ryosuke Niwa.
Add Node::isDescendantOf() overload that takes in a reference as a lot
of call sites have a reference or a pointer they know is not null.
No new tests, no Web-exposed behavior change.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
* dom/Document.cpp:
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFullScreenElementOfSubtree):
(WebCore::Document::setAnimatingFullScreen):
* dom/Node.cpp:
(WebCore::Node::isDescendantOf):
(WebCore::Node::isDescendantOrShadowDescendantOf):
(WebCore::Node::contains):
* dom/Node.h:
(WebCore::Node::isDescendantOf):
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::updateForNodeRemoval):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeFastPathForIdSelector):
(WebCore::filterRootById):
* dom/TypedElementDescendantIterator.h:
(WebCore::TypedElementDescendantIteratorAdapter<ElementType>::beginAt):
(WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
(WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::beginAt):
(WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::textDirectionForSelection):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore):
(WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter):
* editing/htmlediting.cpp:
(WebCore::firstEditablePositionAfterPositionInRoot):
(WebCore::lastEditablePositionBeforePositionInRoot):
(WebCore::selectionForParagraphIteration):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
* html/CachedHTMLCollection.h:
(WebCore::traversalType>::namedItem):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formElementIndex):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getElementById):
2016-11-16 Ryosuke Niwa <rniwa@webkit.org>
Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845
Reviewed by Dan Bernstein.
Revert r208833 and fix the build by declaring AVFunctionBarMediaSelectionOption and AVThumbnail in AVKitSPI.h
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
* platform/spi/cocoa/AVKitSPI.h:
2016-11-16 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r208082): 1% Speedometer regression on iOS
https://bugs.webkit.org/show_bug.cgi?id=164852
Reviewed by Chris Dumez.
Temporarily disable CEReactions entirely to recover the regression in Speedometer since
reverting r208082 wouldn't remove CEReactions from other DOM APIs and if r208082 was a regression,
then they're likely causing a regression on Speedometer as well.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add): Removed the release assert added in r208785
since reactions can be inserted into the backup queue while the queue is running.
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Ditto.
* dom/CustomElementReactionQueue.h:
(WebCore::CustomElementReactionStack::CustomElementReactionStack): Removed all the code so that this
constructor would be optimized away by clang.
(WebCore::CustomElementReactionStack::~CustomElementReactionStack): Ditto.
2016-11-16 Ryosuke Niwa <rniwa@webkit.org>
Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845
Reviewed by Wenson Hsieh.
Fix builds after r208802 by wrapping code inside USE(APPLE_INTERNAL_SDK).
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
2016-11-16 Chris Dumez <cdumez@apple.com>
ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
https://bugs.webkit.org/show_bug.cgi?id=164812
<rdar://problem/29148465>
Reviewed by Geoffrey Garen.
ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary,
meaning when there is not already one pending.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
* dom/ScriptExecutionContext.h:
2016-11-16 Chris Dumez <cdumez@apple.com>
Use more references in TreeScope / TreeScopeAdopter
https://bugs.webkit.org/show_bug.cgi?id=164836
Reviewed by Ryosuke Niwa.
Use more references in TreeScope / TreeScopeAdopter and avoid some
unnecessary null checks.
No new tests, no Web-exposed behavior change.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::parserAppendChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::addChildNodesToDeletionQueue):
* dom/Document.cpp:
(WebCore::Document::adoptNode):
(WebCore::Document::moveNodeIteratorsToNewDocument):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::addShadowRoot):
(WebCore::Element::removeShadowRoot):
(WebCore::Element::setAttributeNode):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::ensureAttr):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):
* dom/Node.h:
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::adoptDocument):
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::setParentTreeScope):
(WebCore::TreeScope::adoptIfNeeded):
* dom/TreeScope.h:
(WebCore::TreeScope::documentScope):
(WebCore::TreeScope::setDocumentScope):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveShadowTreeToNewDocument):
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::updateTreeScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* dom/TreeScopeAdopter.h:
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::TreeScopeAdopter):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
* html/FormAssociatedElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::didMoveToNewDocument):
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didMoveToNewDocument):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::didMoveToNewDocument):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didMoveToNewDocument):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didMoveToNewDocument):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didMoveToNewDocument):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::didMoveToNewDocument):
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::didMoveToNewDocument):
* html/HTMLPictureElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
* html/HTMLPlugInImageElement.h:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):
* html/HTMLTemplateElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didMoveToNewDocument):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::didMoveToNewDocument):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::didMoveToNewDocument):
* svg/SVGImageElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::didMoveToNewDocument):
* svg/SVGSVGElement.h:
2016-11-16 Jon Davis <jond@apple.com>
Added Web App Manifest to the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=162675
Reviewed by Timothy Hatcher.
* features.json:
2016-11-16 Chris Dumez <cdumez@apple.com>
Use more references for Document::removeFocusedNodeOfSubtree()
https://bugs.webkit.org/show_bug.cgi?id=164839
Reviewed by Andreas Kling.
Use more references for Document::removeFocusedNodeOfSubtree().
No new tests, no Web-exposed behavior change.
* dom/Document.cpp:
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFocusedNodeOfSubtree):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::removeFocusNavigationNodeOfSubtree):
(WebCore::Document::removeFullScreenElementOfSubtree):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
2016-11-16 Brent Fulgham <bfulgham@apple.com>
Clear track client when removing a track
https://bugs.webkit.org/show_bug.cgi?id=164842
<rdar://problem/29213621>
Reviewed by Eric Carlson.
Call 'clearClient' when removing a track from an HTMLMediaElement.
Test: media/track/audio-track-add-remove.html
media/track/video-track-add-remove.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack): Call 'clearClient'
(WebCore::HTMLMediaElement::removeVideoTrack): Ditto.
2016-11-16 Yusuke Suzuki <utatane.tea@gmail.com>
[ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
https://bugs.webkit.org/show_bug.cgi?id=164827
Reviewed by Ryosuke Niwa.
Use Settings.in. And intentionally do not use RuntimeEnabledFeatures.
According to the pointer lock's issue[1], we should use Settings.
[1]: https://bugs.webkit.org/show_bug.cgi?id=163801
* Configurations/FeatureDefines.xcconfig:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* page/Settings.in:
A bit unfortunate thing is that the setter is named `setEs6ModulesEnabled`
if we use `es6ModulesEnabled` here.
2016-11-16 Chris Dumez <cdumez@apple.com>
Unreviewed, remove outdated comment about using PassRefPtr.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::parserAppendChild):
2016-11-16 Ryosuke Niwa <rniwa@webkit.org>
slotchange event should bubble and dispatched once
https://bugs.webkit.org/show_bug.cgi?id=164770
Reviewed by Antti Koivisto.
Updated our implementation of slotchange event to match the latest specification after:
https://github.com/w3c/webcomponents/issues/571
https://dom.spec.whatwg.org/#signal-a-slot-change
The new behavior matches that of Google Chrome Canary.
In the latest specification, we no longer dispatch a separate event on ancestor slots.
Instead, we fire a single slotchange event to which a new node is assigned or from which
an existing assigned node is removed. This patch mostly removes the code that existed to
locate ancestor slot elements, and makes the event bubble up by changing a single line in
HTMLSlotElement::dispatchSlotChangeEvent.
Test: fast/shadow-dom/slotchange-event-bubbling.html
* dom/ShadowRoot.h:
* dom/SlotAssignment.cpp:
(WebCore::recursivelyFireSlotChangeEvent): Deleted.
(WebCore::SlotAssignment::didChangeSlot): Removed ChangeType from the arguments since we
no longer notify the ancestor slot elements.
(WebCore::SlotAssignment::hostChildElementDidChange):
* dom/SlotAssignment.h:
(WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
(WebCore::ShadowRoot::didChangeDefaultSlot):
(WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute):
(WebCore::ShadowRoot::innerSlotDidChange): Deleted.
* html/HTMLDetailsElement.cpp:
(WebCore::DetailsSlotAssignment::hostChildElementDidChange):
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::dispatchSlotChangeEvent): Make slotchange event bubble.
2016-11-16 Alex Christensen <achristensen@webkit.org>
REGRESSION (r207162): [debug] loader/stateobjects LayoutTests timing out
https://bugs.webkit.org/show_bug.cgi?id=163307
Reviewed by Alexey Proskuryakov.
* platform/URLParser.cpp:
Removed some unnecessary and redundant assertions in iterators, which are inside inner loops.
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::parse):
Add a parsedDataView that just returns a UChar instead of a StringView for 1-length views.
This speeds up debug builds considerably, which spent most of the time parsing the path
making and destroying these 1-length StringViews. It can't hurt release builds.
* platform/URLParser.h:
2016-11-16 Chris Dumez <cdumez@apple.com>
Micro-optimize ContainerNode::removeBetween()
https://bugs.webkit.org/show_bug.cgi?id=164832
Reviewed by Sam Weinig.
Micro-optimize ContainerNode::removeBetween() by updating pointers only
when strictly needed and reducing branching.
No new tests, no Web-exposed behavior change.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeBetween):
2016-11-16 Chris Dumez <cdumez@apple.com>
Micro-optimize AtomicHTMLToken::initializeAttributes()
https://bugs.webkit.org/show_bug.cgi?id=164826
Reviewed by Sam Weinig.
Micro-optimize AtomicHTMLToken::initializeAttributes():
- Use uncheckedAppend() instead of append() since we reserve capacity
before the loop.
- Use a more efficient findAttribute() that only checks the local names
since this function only adds attributes that have to namespace or
prefix.
No new tests, no Web-exposed behavior change.
* html/parser/AtomicHTMLToken.h:
(WebCore::hasAttribute):
(WebCore::AtomicHTMLToken::initializeAttributes):
2016-11-16 Beth Dakin <bdakin@apple.com>
Another build fix.
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
2016-11-16 Beth Dakin <bdakin@apple.com>
Attempted build fix.
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::durationChanged):
(WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
(WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
(WebCore::WebPlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::ensureControlsManager):
2016-11-16 Brady Eidson <beidson@apple.com>
Re-indent some old headers.
Rubberstamped by Alex Christensen
No new tests (No behavior change).
(Also #pragma once a few of them)
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* page/Frame.h:
* page/FrameTree.h:
* page/PageGroup.h:
* platform/Cursor.h:
2016-11-16 Darin Adler <darin@apple.com>
REGRESSION (r208672): Crash in com.apple.WebCore: WebCore::DatabaseContext::stopDatabases + 34
https://bugs.webkit.org/show_bug.cgi?id=164820
Reviewed by Sam Weinig.
Crash seen in existing regression tests; reliably reproducible in some test configurations.
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::contextDestroyed): Call through to base class before calling
stopDatabases, since that might cause this object to be deallocated.
(WebCore::DatabaseContext::stopDatabases): Be sure not to clear the possibly-last reference
to this database context until after all code that accesses data members, since it might
cause this object to be deallocated.
2016-11-16 Beth Dakin <bdakin@apple.com>
Implement WebPlaybackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=164789
-and corresponding-
rdar://problem/29275082
Reviewed by Dan Bernstein.
* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager dealloc]):
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
(-[WebPlaybackControlsManager generateFunctionBarThumbnailsForTimes:size:completionHandler:]):
(-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
(-[WebPlaybackControlsManager canBeginFunctionBarScrubbing]):
(-[WebPlaybackControlsManager beginFunctionBarScrubbing]):
(-[WebPlaybackControlsManager endFunctionBarScrubbing]):
(-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]):
(-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]):
(-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]):
(mediaSelectionOptions):
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
(-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
(-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
(-[WebPlaybackControlsManager togglePlayback]):
(-[WebPlaybackControlsManager setPlaying:]):
(-[WebPlaybackControlsManager isPlaying]):
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::durationChanged):
(WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
(WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
(WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
2016-11-16 Jiewen Tan <jiewen_tan@apple.com>
Add more tests for SubtleCrypto::importKey and SubtleCrypto::exportKey
https://bugs.webkit.org/show_bug.cgi?id=164815
<rdar://problem/29281660>
Reviewed by Brent Fulgham.
Tests: crypto/subtle/aes-import-jwk-key-export-jwk-key.html
crypto/subtle/aes-import-jwk-key-export-raw-key.html
crypto/subtle/aes-import-raw-key-export-jwk-key.html
crypto/subtle/aes-import-raw-key-export-raw-key.html
crypto/subtle/hmac-import-jwk-key-export-jwk-key.html
crypto/subtle/hmac-import-jwk-key-export-raw-key.html
crypto/subtle/hmac-import-raw-key-export-jwk-key.html
crypto/subtle/hmac-import-raw-key-export-raw-key.html
crypto/subtle/rsa-import-jwk-key-export-jwk-key-private.html
crypto/subtle/rsa-import-jwk-key-export-jwk-key-public.html
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::create):
Add a comment.
2016-11-16 Antti Koivisto <antti@apple.com>
Remove getMutableCachedPseudoStyle
https://bugs.webkit.org/show_bug.cgi?id=164819
Reviewed by Zalan Bujtas.
It is only used by styleForFirstLetter.
* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):
Clone the original style before mutations.
(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::createFirstLetterRenderer):
Since we have a clone already just move it in place.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getMutableCachedPseudoStyle): Deleted.
* rendering/RenderElement.h:
2016-11-16 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableByteStreamController close()
https://bugs.webkit.org/show_bug.cgi?id=164413
Reviewed by Darin Adler.
Implemented close() method of ReadableByteStreamController.
Updated test expectations for close() tests and added tests
to ensure errors are thrown in various cases defined by spec.
* Modules/streams/ReadableByteStreamController.js:
(close): Added.
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerClose): Added.
* bindings/js/WebCoreBuiltinNames.h: Added bytesFilled.
2016-11-16 Philippe Normand <pnormand@igalia.com>
[GStreamer][GL] build broken when using gst-plugins-bad from git
https://bugs.webkit.org/show_bug.cgi?id=164776
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): The
GStreamer GL context GType was renamed, add an ifdef taking this
into account.
2016-11-16 Yusuke Suzuki <utatane.tea@gmail.com>
[ES6] Integrate ES6 Modules into WebCore
https://bugs.webkit.org/show_bug.cgi?id=148897
Reviewed by Ryosuke Niwa.
This patch introduces ES6 Modules into WebCore. We integrate JSC's JSModuleLoader into WebCore.
JSC constructs the module loader pipeline by the chains of the promises. To handle this,
the following components are added.
1. CachedModuleScript
CachedModuleScript wraps the promise based JSModuleLoader pipeline and offers
similar APIs to CachedScript. ScriptElement and PendingScript interact with
CachedModuleScript when the script tag is the module tag instead of CachedScript.
ScriptElement and PendingScript will receive the notification from
CachedModuleScript by implementing CachedModuleScriptClient.
2. ScriptModuleLoader
This is the module loader instantiated per document. It manages fetching and
offers the callbacks for the JSC's JSModuleLoader implementation. ScriptModuleLoader
will fetch the resource by creating CachedModuleScriptLoader per resource. ScriptModuleLoader
will receive the notification by implementing CachedModuleScriptLoaderClient. When the
resource is fetched, the module loader will drive the promise resolve/reject chain.
3. CachedModuleScriptLoader
This fetches the resource by using CachedScript. Using CachedScript means that it
automatically reports the resource to the inspector. CachedModuleScriptLoader notify to
ScriptModuleLoader when the resource is fetched.
One tricky point is that the fetch requests issued from one module-graph should share the same
nonce, crossorigin attributes etc.
Here, we wrote the module graph like `A -> B (A depends on B)`.
<script tag> -> A -> B -> C -> D
When fetching A, B, C, and D modules, we need to set the same nonce, crossorigin etc. configuration
derived from the original script tag. So per module-graph information should be shared throughout
the module loader pipeline. To do so, JSC's module loader implementation can take the value called
`initiator`. Since the loader will propagate & share this `initiator` throughout the pipeline,
we can transfer and share some metadata. Currently, we pass the JSWrapper of the script tag as the
initiator. Each fetch request is created by using this initiator script element.
More integration into the inspector should be done in the subsequent patch.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CachedModuleScript.cpp: Added.
CachedModuleScript offers similar interface to CachedScript to make ScriptElement things easier. It encapsulates the
detail of the JSC JSModuleLoader that this module loader is driven by the chain of the promises. CachedModuleScript's
callbacks are called from the promise's handlers configured in ScriptController::loadModuleScript.
(WebCore::CachedModuleScript::create):
(WebCore::CachedModuleScript::CachedModuleScript):
(WebCore::CachedModuleScript::load):
(WebCore::CachedModuleScript::notifyLoadCompleted):
(WebCore::CachedModuleScript::notifyLoadFailed):
(WebCore::CachedModuleScript::notifyLoadWasCanceled):
(WebCore::CachedModuleScript::notifyClientFinished):
(WebCore::CachedModuleScript::addClient):
(WebCore::CachedModuleScript::removeClient):
* bindings/js/CachedModuleScript.h: Added.
(WebCore::CachedModuleScript::moduleKey):
(WebCore::CachedModuleScript::error):
(WebCore::CachedModuleScript::wasCanceled):
(WebCore::CachedModuleScript::isLoaded):
(WebCore::CachedModuleScript::nonce):
(WebCore::CachedModuleScript::crossOriginMode):
Save nonce and crossorigin attributes when we start ScriptElement::prepareScript.
* bindings/js/CachedModuleScriptClient.h: Copied from Source/WebCore/dom/LoadableScript.h.
(WebCore::CachedModuleScriptClient::~CachedModuleScriptClient):
* bindings/js/CachedModuleScriptLoader.cpp: Added.
CachedModuleScriptLoader is responsible to fetching the resource for the module script. It uses propagated `initiator`
to create the request. This initiator is the JS wrapper of the script element issuing this fetching request. The name
`initiator` is derived from the request.setInitiator(). Once the resource is fetched, the fetcher will notify to the
client. Currently, ScriptModuleLoader implements this client interface.
(WebCore::CachedModuleScriptLoader::create):
(WebCore::CachedModuleScriptLoader::CachedModuleScriptLoader):
(WebCore::CachedModuleScriptLoader::~CachedModuleScriptLoader):
(WebCore::CachedModuleScriptLoader::load):
Create the request. We call ScriptElement::requestCachedScript to initiate a new fetching request. At that time,
nonce and crossorigin (and charset) attributes of this element are applied to the new request.
(WebCore::CachedModuleScriptLoader::notifyFinished):
* bindings/js/CachedModuleScriptLoader.h: Copied from Source/WebCore/bindings/js/ScriptModuleLoader.h.
* bindings/js/CachedModuleScriptLoaderClient.h: Copied from Source/WebCore/dom/LoadableScript.h.
(WebCore::CachedModuleScriptLoaderClient::~CachedModuleScriptLoaderClient):
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::create):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
(WebCore::makeSource):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMBinding.cpp:
(WebCore::retrieveErrorMessage):
(WebCore::reportException):
* bindings/js/JSDOMBinding.h:
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::loadModule):
(WebCore::JSMainThreadExecState::linkAndEvaluateModule):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::loadModuleScript):
This just performs loading and not executing the module graph. Once the module graph is loaded, it is notified to
the given CachedModuleScript.
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScript):
This executes the linking and evaluation of the already instantiated module graph. After loading the module graph,
we call this function for the module to evaluate it. This is called from ScriptElement::executeModuleScript.
(WebCore::ScriptController::evaluateModule):
Every time we evaluate the module, the ScriptModuleLoader::evaluate hook is called. So the loader calls this function
to actually evaluate the module.
(WebCore::jsValueToModuleKey):
(WebCore::ScriptController::setupModuleScriptHandlers):
The JSC's module loader is driven by the chain of the promise. So here, we convert this to CachedModuleScript /
CachedModuleScriptClient style and encapsulate the details. This encapsulation makes CachedModuleScript similar
to CachedScript and it makes things simple in the rest of WebCore. If the propagated error is already reported
to the inspector, we receive moduleLoaderAlreadyReportedErrorSymbol as the error value. So at that case, we
don't report it twice. If the rejection is caused due to the canceled fetching, moduleLoaderFetchingIsCanceledSymbol
appears as the error value. In that case, we will call CachedModuleScript::notifyLoadWasCanceled.
(WebCore::ScriptController::executeScript):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::moduleLoaderAlreadyReportedErrorSymbol):
(WebCore::ScriptController::moduleLoaderFetchingIsCanceledSymbol):
* bindings/js/ScriptModuleLoader.cpp:
We use DeferredWrapper to resolve promises used for the module pipeline. Thus, once the active DOM objects are
suspended, the module loader propagation stops.
(WebCore::ScriptModuleLoader::~ScriptModuleLoader):
Clear the clients of the fetchers issued from this loader.
(WebCore::isRootModule):
(WebCore::ScriptModuleLoader::resolve):
Resolve the module specifier (that is written in `import from "XXX"`) to the unique module key. We use URL
string as module key. The edge case is that the module is inlined one. In that case, we don't have any URL
for that. Instead of URL, we use symbol at that time.
(WebCore::ScriptModuleLoader::fetch):
Start fetching for the requested module. It returns the promise that is resolved when the fetching is done.
The loader creates the fetcher, and the fetcher start loading the resource. Once the fetcher loads the resource,
it notify to the loader through CachedModuleScriptLoaderClient interface. Since we pass the original script
element as the `initiator` here, the fetcher can use this initiator to create the request. While the result of
CachedResource has 3 variations (loaded, canceled, error occurred), Promise only tells us whether it is resolved
or rejected. When CachedModuleScript gets the result from the promise chain, it needs to know which the result is.
To transfer the canceled information, we reject the promise with the special symbol `moduleLoaderAlreadyReportedErrorSymbol`.
This offers the way to distinguish the canceled error from the other errors.
(WebCore::ScriptModuleLoader::evaluate):
This is the hook function that is called when JSC's JSModuleLoader attempts to execute each module.
(WebCore::ScriptModuleLoader::notifyFinished):
This function is called when the fetcher completes. We will resolve the promise with the result of the fetching.
The module loader pipeline is constructed as a chain of promises.
Rejecting a promise when some error occurs is important because the execution flow of
the promise chain is driven by "rejected" or "fulfilled" events.
If the promise is not rejected while error occurs, reject handler won't be executed
and all the subsequent promise chain will wait the result forever.
As a result, even if the error is already reported to the inspector elsewhere,
it should be propagated in the pipeline. For example, the error of loading
CachedResource is already reported to the inspector by the loader. But we still need
to reject the promise to propagate this error to the script element.
At that time, we don't want to report the same error twice. When we propagate the error
that is already reported to the inspector, we throw moduleLoaderAlreadyReportedErrorSymbol
symbol instead. By comparing the thrown error with this symbol, we can distinguish errors raised
when checking syntax of a module script from errors reported already.
In the reject handler of the promise, we only report a error that is not this symbol.
And mime type checking is done here since the module script always require this check.
* bindings/js/ScriptModuleLoader.h:
(WebCore::ScriptModuleLoader::document): Deleted.
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
* dom/CurrentScriptIncrementer.h:
(WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::error):
(WebCore::LoadableClassicScript::execute):
(WebCore::LoadableClassicScript::wasErrored): Deleted.
* dom/LoadableClassicScript.h:
* dom/LoadableModuleScript.cpp: Copied from Source/WebCore/dom/LoadableScript.h.
This is the derived class from LoadableScript. It is used for the script module graphs.
(WebCore::LoadableModuleScript::create):
(WebCore::LoadableModuleScript::LoadableModuleScript):
(WebCore::LoadableModuleScript::~LoadableModuleScript):
(WebCore::LoadableModuleScript::isLoaded):
(WebCore::LoadableModuleScript::error):
(WebCore::LoadableModuleScript::wasCanceled):
(WebCore::LoadableModuleScript::notifyFinished):
(WebCore::LoadableModuleScript::execute):
* dom/LoadableModuleScript.h: Copied from Source/WebCore/dom/LoadableScript.h.
(isType):
* dom/LoadableScript.h:
(WebCore::LoadableScript::isModuleScript):
(WebCore::LoadableScript::isModuleGraph): Deleted.
* dom/PendingScript.cpp:
(WebCore::PendingScript::error):
(WebCore::PendingScript::wasErrored): Deleted.
* dom/PendingScript.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::determineScriptType):
(WebCore::ScriptElement::prepareScript):
prepareScript is aligned to whatwg spec: the last sequence to setup flags has one-on-one correspondence to
the spec now. And prepareScript recognizes the type="module" case and call the requestModuleScript to setup
the CachedModuleScript.
(WebCore::ScriptElement::requestClassicScript):
(WebCore::ScriptElement::requestModuleScript):
We use the nonce and crossorigin attributes at the time of preparing the script tag. To do so, we store the
above values in CachedModuleScript.
Since inlined module scripts does not have "src" attribute, it is also affected by Content Security Policy's
inline script rules.
(WebCore::ScriptElement::requestScriptWithCacheForModuleScript):
The module loader will construct the fetching request by calling this function. This should be here since we
would like to set this Element to the initiator of the request. And nonce and crossorigin attributes of this
script tag will be used.
(WebCore::ScriptElement::requestScriptWithCache):
(WebCore::ScriptElement::executeScript):
(WebCore::ScriptElement::executeModuleScript):
The entry point to execute the module graph. Since the module graph is beyond the multiple CachedScript code,
we have the different entry point from ScriptElement::executeScript.
(WebCore::ScriptElement::executeScriptAndDispatchEvent):
(WebCore::ScriptElement::executeScriptForScriptRunner):
* dom/ScriptElement.h:
(WebCore::ScriptElement::scriptType):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::emitRule):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
According to the spec, the module tag ignores the "charset" attribute as the same to the worker's
importScript. But WebKit supports the "charset" for importScript intentionally. So to be consistent,
even for the module tags, we handle the "charset" attribute. We explicitly note about it in the preloader.
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::PreloadRequest):
* html/parser/HTMLScriptRunner.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
2016-11-15 Alejandro G. Castro <alex@igalia.com>
Warning added in r208542
https://bugs.webkit.org/show_bug.cgi?id=164636
Reviewed by Eric Carlson.
Deleted the copy constructor, we now explicitly copy the object in
the clone method.
* platform/mediastream/MediaStreamTrackPrivate.cpp: Delete the
copy constructor.
(WebCore::MediaStreamTrackPrivate::clone): Copy the relevant
information for the clone operation in the API.
* platform/mediastream/MediaStreamTrackPrivate.h: Delete the copy
constructor.
2016-11-15 Ryosuke Niwa <rniwa@webkit.org>
Add more assertions to ElementQueue diagnose a bug
https://bugs.webkit.org/show_bug.cgi?id=164814
Reviewed by Yusuke Suzuki.
Add more assertions to check the sanity of the element queue.
Also made them all release assertions so that we can catch them better.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add):
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
2016-11-15 Chris Dumez <cdumez@apple.com>
Simplify Element::stripScriptingAttributes()
https://bugs.webkit.org/show_bug.cgi?id=164785
Reviewed by Ryosuke Niwa.
Simplify Element::stripScriptingAttributes() by leveraging
Vector::removeAllMatching().
No new tests, no Web-exposed behavior change.
* dom/Element.cpp:
(WebCore::Element::stripScriptingAttributes):
2016-11-15 Jon Lee <jonlee@apple.com>
Report active video and audio capture devices separately
https://bugs.webkit.org/show_bug.cgi?id=164769
Reviewed by Eric Carlson.
For UI purposes, separate the notion of any active capture device to
an active audio and video capture device.
* page/MediaProducer.h: Replace HasActiveMediaCaptureDevice with
HasActiveAudioCaptureDevice and HasActiveVideoCaptureDevice.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Update the logic for mediaState().
Since it is possible to arbitrarily add tracks from various sources,
check specifically for a local AV source (meaning a capture device) that
is producing data.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::hasLocalVideoSource): Iterate over the tracks
and look for video sources that are not remote.
(WebCore::MediaStreamPrivate::hasLocalAudioSource): Ditto for audio.
* platform/mediastream/MediaStreamPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Update internals reporting.
2016-11-15 Chris Dumez <cdumez@apple.com>
Avoid copying vector of attributes as much as possible in the HTML parser
https://bugs.webkit.org/show_bug.cgi?id=164778
Reviewed by Ryosuke Niwa.
Avoid copying vector of attributes as much as possible in the HTML parser by moving
AtomicHTMLToken around and making it obvious it is safe to move its attributes
vector as well.
No new tests, no Web-exposed behavior change.
* html/parser/AtomicHTMLToken.h:
(WebCore::AtomicHTMLToken::AtomicHTMLToken):
(WebCore::findAttribute):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
(WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
(WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
(WebCore::HTMLConstructionSite::insertDoctype):
(WebCore::HTMLConstructionSite::insertComment):
(WebCore::HTMLConstructionSite::insertCommentOnDocument):
(WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
(WebCore::HTMLConstructionSite::insertHTMLHeadElement):
(WebCore::HTMLConstructionSite::insertHTMLBodyElement):
(WebCore::HTMLConstructionSite::insertHTMLFormElement):
(WebCore::HTMLConstructionSite::insertHTMLElement):
(WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
(WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
(WebCore::HTMLConstructionSite::insertFormattingElement):
(WebCore::HTMLConstructionSite::insertScriptElement):
(WebCore::HTMLConstructionSite::insertForeignElement):
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
(WebCore::HTMLConstructionSite::createElementFromSavedToken):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::constructTreeFromHTMLToken):
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::HTMLStackItem):
(WebCore::HTMLStackItem::create):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::CustomElementConstructionData::CustomElementConstructionData):
(WebCore::HTMLTreeBuilder::constructTree):
(WebCore::HTMLTreeBuilder::processToken):
(WebCore::HTMLTreeBuilder::processDoctypeToken):
(WebCore::HTMLTreeBuilder::processFakeStartTag):
(WebCore::HTMLTreeBuilder::processFakeEndTag):
(WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
(WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
(WebCore::HTMLTreeBuilder::processTemplateStartTag):
(WebCore::HTMLTreeBuilder::processTemplateEndTag):
(WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
(WebCore::HTMLTreeBuilder::processStartTagForInTable):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
(WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
(WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
(WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
(WebCore::HTMLTreeBuilder::processEndTagForInRow):
(WebCore::HTMLTreeBuilder::processEndTagForInCell):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):
(WebCore::HTMLTreeBuilder::processEndTagForInTable):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processComment):
(WebCore::HTMLTreeBuilder::processCharacter):
(WebCore::HTMLTreeBuilder::processEndOfFile):
(WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
(WebCore::HTMLTreeBuilder::defaultForBeforeHead):
(WebCore::HTMLTreeBuilder::defaultForInHead):
(WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
(WebCore::HTMLTreeBuilder::defaultForAfterHead):
(WebCore::HTMLTreeBuilder::processStartTagForInHead):
(WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
(WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
(WebCore::HTMLTreeBuilder::processScriptStartTag):
(WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent):
(WebCore::hasAttribute):
(WebCore::HTMLTreeBuilder::processTokenInForeignContent):
(WebCore::HTMLTreeBuilder::parseError):
* html/parser/HTMLTreeBuilder.h:
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::insertFakePreElement):
2016-11-15 Alex Christensen <achristensen@webkit.org>
Fix iOS API test assertion after r208534
https://bugs.webkit.org/show_bug.cgi?id=164751
Reviewed by Geoffrey Garen.
This removes a firing assertion in the WebKit1.AudioSessionCategoryIOS API test on the iOS simulator.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setLowMemoryHandler):
This assertion is no longer valid because we are using m_installed to determine if m_lowMemoryHandler xor m_releaseMemoryBlock is set,
and we should be setting both right now on iOS and they are both useful in freeing memory. These should be united.
2016-11-15 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Key collation during SQLite lookups is insanely slow.
https://bugs.webkit.org/show_bug.cgi?id=164754
Reviewed by Alex Christensen.
No new tests (Covered by *all* existing tests, and unskips a previously-too-slow test)
The new serialization format is straight forward enough to get back with minimal documentation
in a comment with the code itself being the rest of the documentation.
It handles all current IDB key types and leaves room for future key types.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::setBinaryValue):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::binary):
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializedTypeForKeyType):
(WebCore::writeLittleEndian):
(WebCore::readLittleEndian):
(WebCore::writeDouble):
(WebCore::readDouble):
(WebCore::encodeKey):
(WebCore::serializeIDBKeyData):
(WebCore::decodeKey):
(WebCore::deserializeIDBKeyData):
* Modules/indexeddb/server/IDBSerialization.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey): Verify that Type == Invalid
keys don't get into the database. This was happening before and the previous serialization
supported it, but there's clearly no point in supporting it with the new serialization.
2016-11-15 Brent Fulgham <bfulgham@apple.com>
Ensure sufficient buffer for worst-case URL encoding
https://bugs.webkit.org/show_bug.cgi?id=164794
<rdar://problem/5905510>
Reviewed by David Kilzer.
Slightly increase the default allocation size for URL parsing to account for
the worst-case parsing case. Under these assumptions, we might need three times
the byte length of the URL, plus nine bytes for fix-up characters.
In short, increase the default buffer size by 9 bytes.
No new tests. No change in behavior.
* platform/URL.cpp:
(WebCore::URL::parse): Slightly increase the default buffer size.
2016-11-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unused and untested Page.setTouchEmulationEnabled command
https://bugs.webkit.org/show_bug.cgi?id=164793
Reviewed by Matt Baker.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorPageAgent::updateTouchEventEmulationInPage): Deleted.
(WebCore::InspectorPageAgent::setTouchEmulationEnabled): Deleted.
* inspector/InspectorPageAgent.h:
2016-11-15 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, quick fix for r208751
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
2016-11-15 Chris Dumez <cdumez@apple.com>
Unreviewed, fix build after r208710.
Inline functions should not be marked as WEBCORE_EXPORT.
* dom/QualifiedName.h:
2016-11-15 Brent Fulgham <bfulgham@apple.com>
strncpy may leave unterminated string in WebCore::URL::init
https://bugs.webkit.org/show_bug.cgi?id=74473
<rdar://problem/10576626>
Reviewed by David Kilzer.
Reviving an old patch by David Kilzer! This should have been integrated years ago.
No new tests. No change in behavior.
* platform/URL.cpp:
(WebCore::URL::init): Make sure we always enter 'parse' with a
null-terminated string.
2016-11-15 Jiewen Tan <jiewen_tan@apple.com>
Followup patch for r208737
Reviewed by Yusuke Suzuki.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
2016-11-14 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Implement support for visual viewports
https://bugs.webkit.org/show_bug.cgi?id=164765
Reviewed by Tim Horton.
Adopt the visual viewport scrolling model in iOS WK2.
This is more complex than the Mac implementation for two primary reasons. First,
WKWebView needs to to able to control the rectangle used for fixed position layout
to get the correct behavior when zooming all the way out, and because iOS displays
pages scaled down, exposing document overflow such that the layout viewport rectangle
has to get larger than the initial containing block size (which does not happen on Mac).
This is achieved by pushing a "layoutViewportOverrideRect" down onto FrameView, in
a similar way to the customFixedPositionRect that's used now. We share that name
for now in code that is agnostic to its use (e.g. VisibleContentRectUpdateInfo).
I tried so hard to write tests, but ran into various problems (webkit.org/b/164762,
webkit.org/b/164764). Will add tests via webkit.org/b/164764.
* page/FrameView.cpp:
(WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling): layoutViewportOrigin()
was removed.
(WebCore::FrameView::setBaseLayoutViewportOrigin): Rename with "base" to make it clearer that
it can be overridden.
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::baseLayoutViewportSize): Renamed.
(WebCore::FrameView::updateLayoutViewport): Logging.
(WebCore::FrameView::layoutViewportRect):
(WebCore::FrameView::scrollPositionForFixedPosition):
(WebCore::FrameView::unscaledMaximumScrollPosition): During page transitions on iOS, it
was possible for unscaledDocumentRect to be empty, but visibleSize() to be non-empty, leading
to odd negative max scroll offsets, so clamp to 0,0.
(WebCore::FrameView::setLayoutViewportOrigin): Deleted.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState): scrollPositionForFixedPosition() already does the
visualViewportEnabled() check.
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* platform/graphics/FloatSize.cpp:
(WebCore::FloatSize::constrainedBetween): Added for consistency with the other geometry types.
* platform/graphics/FloatSize.h:
* platform/graphics/LayoutSize.cpp:
(WebCore::LayoutSize::constrainedBetween): Ditto.
* platform/graphics/LayoutSize.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::clientLogicalWidthForFixedPosition): If we have an override layout viewport, its size might be different
from the RenderView's size (the initial containing block), so we need to use the layoutViewportRect here.
(WebCore::RenderView::clientLogicalHeightForFixedPosition):
2016-11-15 Myles C. Maxfield <mmaxfield@apple.com>
[WebGL] Remove unused Chromium-specific OpenGL extensions
https://bugs.webkit.org/show_bug.cgi?id=164782
Reviewed by Dean Jackson.
No new tests because there is no behavior change.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyBufferSubData):
(WebCore::WebGL2RenderingContext::clear):
(WebCore::WebGL2RenderingContext::getExtension):
* html/canvas/WebGLCompressedTextureS3TC.cpp:
(WebCore::WebGLCompressedTextureS3TC::supported):
* html/canvas/WebGLDepthTexture.cpp:
(WebCore::WebGLDepthTexture::supported):
* html/canvas/WebGLDrawBuffers.cpp:
(WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::onAccess):
* html/canvas/WebGLFramebuffer.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::clear):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::validateDrawArrays):
(WebCore::WebGLRenderingContextBase::validateDrawElements):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::texImage2DBase):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::isGLES2NPOTStrict):
(WebCore::WebGLRenderingContextBase::isErrorGeneratedOnOutOfBoundsAccesses): Deleted.
(WebCore::WebGLRenderingContextBase::isResourceSafe): Deleted.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::texImage2DResourceSafe):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::isResourceSafe): Deleted.
2016-11-14 Brent Fulgham <bfulgham@apple.com>
Correct handling of changing input type
https://bugs.webkit.org/show_bug.cgi?id=164759
<rdar://problem/29211174>
Reviewed by Darin Adler.
Test: fast/forms/search-cancel-button-change-input.html
It is possible for JavaScript to change the type property of an input field. WebKit
needs to gracefully handle this case.
Add a type traits specialization so we can properly downcast InputType elements.
Use this to only call search functions on actual search input types.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::onSearch): Only perform search functions if the
input type is actually a search field.
* html/InputType.h: Add type traits specialization for 'downcast' template.
* html/SearchInputType.h: Ditto.
2016-11-15 Zalan Bujtas <zalan@apple.com>
CounterNode::insertAfter and ::removeChild should take references.
https://bugs.webkit.org/show_bug.cgi?id=164780
Reviewed by Simon Fraser.
No change in functionality.
* rendering/CounterNode.cpp:
(WebCore::CounterNode::insertAfter):
(WebCore::CounterNode::removeChild):
* rendering/CounterNode.h:
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::destroyCounterNodeWithoutMapRemoval):
(WebCore::updateCounters):
2016-11-15 Antti Koivisto <antti@apple.com>
slot doesn't work as a flex container
https://bugs.webkit.org/show_bug.cgi?id=160740
<rdar://problem/28605080>
Reviewed by Ryosuke Niwa.
Test: fast/shadow-dom/css-scoping-slot-flex.html
The style adjustment for flex children needs to be based on their parent box style rather
than the composed tree parent. This can be different when display:contents is involved.
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::styleForElement):
Optionally provide parent box style so we can do adjustments based on it when computing style for rendering.
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::pseudoStyleForElement):
(WebCore::equivalentBlockDisplay):
Avoid boolean parameters.
(WebCore::StyleResolver::adjustRenderStyle):
Do the display:contents adjustment first and treat 'content' like 'none' later'. We never want to override
'contents' with adjustments.
Use parent box style for flex/grid adjustments instead of the DOM parent style.
* css/StyleResolver.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::computeStyleInRegion):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
Call with parent box style.
(WebCore::Style::TreeResolver::parentBoxStyle):
Find the parent box style if any.
* style/StyleTreeResolver.h:
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::overrideComputedStyle):
2016-11-15 Joseph Pecoraro <pecoraro@apple.com>
Misc Inspector backend cleanup
https://bugs.webkit.org/show_bug.cgi?id=164768
Reviewed by Brian Burg.
* inspector/DOMPatchSupport.cpp:
* inspector/InspectorApplicationCacheAgent.cpp:
* inspector/InspectorApplicationCacheAgent.h:
* inspector/InspectorCSSAgent.cpp:
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDatabaseAgent.cpp:
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::ClearObjectStoreListener::create): Deleted.
(WebCore::ClearObjectStoreListener::~ClearObjectStoreListener): Deleted.
(WebCore::ClearObjectStoreListener::ClearObjectStoreListener): Deleted.
(WebCore::ClearObjectStore::create): Deleted.
(WebCore::ClearObjectStore::ClearObjectStore): Deleted.
* inspector/InspectorLayerTreeAgent.cpp:
* inspector/InspectorLayerTreeAgent.h:
* inspector/InspectorNetworkAgent.h:
* inspector/InspectorPageAgent.cpp:
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.cpp:
* inspector/InspectorReplayAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::stopFromConsole):
* inspector/InspectorTimelineAgent.h:
* inspector/PageRuntimeAgent.h:
2016-11-14 Myles C. Maxfield <mmaxfield@apple.com>
[WebGL] Migrate construction functions from pointers to references
https://bugs.webkit.org/show_bug.cgi?id=164749
Reviewed by Zalan Bujtas.
Mechanical find/replace.
No new tests because there is no behavior change.
* html/canvas/ANGLEInstancedArrays.cpp:
(WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
(WebCore::ANGLEInstancedArrays::supported):
(WebCore::ANGLEInstancedArrays::drawArraysInstancedANGLE):
(WebCore::ANGLEInstancedArrays::drawElementsInstancedANGLE):
(WebCore::ANGLEInstancedArrays::vertexAttribDivisorANGLE):
* html/canvas/ANGLEInstancedArrays.h:
* html/canvas/EXTBlendMinMax.cpp:
(WebCore::EXTBlendMinMax::EXTBlendMinMax):
* html/canvas/EXTBlendMinMax.h:
* html/canvas/EXTFragDepth.cpp:
(WebCore::EXTFragDepth::EXTFragDepth):
* html/canvas/EXTFragDepth.h:
* html/canvas/EXTShaderTextureLOD.cpp:
(WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
* html/canvas/EXTShaderTextureLOD.h:
* html/canvas/EXTTextureFilterAnisotropic.cpp:
(WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
* html/canvas/EXTTextureFilterAnisotropic.h:
* html/canvas/EXTsRGB.cpp:
(WebCore::EXTsRGB::EXTsRGB):
* html/canvas/EXTsRGB.h:
* html/canvas/OESElementIndexUint.cpp:
(WebCore::OESElementIndexUint::OESElementIndexUint):
* html/canvas/OESElementIndexUint.h:
* html/canvas/OESStandardDerivatives.cpp:
(WebCore::OESStandardDerivatives::OESStandardDerivatives):
* html/canvas/OESStandardDerivatives.h:
* html/canvas/OESTextureFloat.cpp:
(WebCore::OESTextureFloat::OESTextureFloat):
* html/canvas/OESTextureFloat.h:
* html/canvas/OESTextureFloatLinear.cpp:
(WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
* html/canvas/OESTextureFloatLinear.h:
* html/canvas/OESTextureHalfFloat.cpp:
(WebCore::OESTextureHalfFloat::OESTextureHalfFloat):
* html/canvas/OESTextureHalfFloat.h:
* html/canvas/OESTextureHalfFloatLinear.cpp:
(WebCore::OESTextureHalfFloatLinear::OESTextureHalfFloatLinear):
* html/canvas/OESTextureHalfFloatLinear.h:
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::OESVertexArrayObject):
(WebCore::OESVertexArrayObject::createVertexArrayOES):
(WebCore::OESVertexArrayObject::deleteVertexArrayOES):
(WebCore::OESVertexArrayObject::isVertexArrayOES):
(WebCore::OESVertexArrayObject::bindVertexArrayOES):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
(WebCore::WebGL2RenderingContext::initializeShaderExtensions):
(WebCore::WebGL2RenderingContext::drawBuffers):
(WebCore::WebGL2RenderingContext::createVertexArray):
(WebCore::WebGL2RenderingContext::isVertexArray):
(WebCore::WebGL2RenderingContext::bindVertexArray):
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::create):
(WebCore::WebGLBuffer::WebGLBuffer):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLCompressedTextureATC.cpp:
(WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
(WebCore::WebGLCompressedTextureATC::supported):
* html/canvas/WebGLCompressedTextureATC.h:
* html/canvas/WebGLCompressedTexturePVRTC.cpp:
(WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
(WebCore::WebGLCompressedTexturePVRTC::supported):
* html/canvas/WebGLCompressedTexturePVRTC.h:
* html/canvas/WebGLCompressedTextureS3TC.cpp:
(WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
(WebCore::WebGLCompressedTextureS3TC::supported):
* html/canvas/WebGLCompressedTextureS3TC.h:
* html/canvas/WebGLContextObject.cpp:
(WebCore::WebGLContextObject::WebGLContextObject):
* html/canvas/WebGLContextObject.h:
* html/canvas/WebGLDebugRendererInfo.cpp:
(WebCore::WebGLDebugRendererInfo::WebGLDebugRendererInfo):
* html/canvas/WebGLDebugRendererInfo.h:
* html/canvas/WebGLDebugShaders.cpp:
(WebCore::WebGLDebugShaders::WebGLDebugShaders):
(WebCore::WebGLDebugShaders::getTranslatedShaderSource):
* html/canvas/WebGLDebugShaders.h:
* html/canvas/WebGLDepthTexture.cpp:
(WebCore::WebGLDepthTexture::WebGLDepthTexture):
(WebCore::WebGLDepthTexture::supported):
* html/canvas/WebGLDepthTexture.h:
* html/canvas/WebGLDrawBuffers.cpp:
(WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
(WebCore::WebGLDrawBuffers::supported):
(WebCore::WebGLDrawBuffers::drawBuffersWEBGL):
(WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
* html/canvas/WebGLDrawBuffers.h:
* html/canvas/WebGLExtension.cpp:
(WebCore::WebGLExtension::WebGLExtension):
* html/canvas/WebGLExtension.h:
(WebCore::WebGLExtension::ref):
(WebCore::WebGLExtension::deref):
(WebCore::WebGLExtension::context):
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::create):
(WebCore::WebGLFramebuffer::WebGLFramebuffer):
(WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
* html/canvas/WebGLFramebuffer.h:
* html/canvas/WebGLLoseContext.cpp:
(WebCore::WebGLLoseContext::WebGLLoseContext):
(WebCore::WebGLLoseContext::loseContext):
(WebCore::WebGLLoseContext::restoreContext):
* html/canvas/WebGLLoseContext.h:
* html/canvas/WebGLObject.cpp:
(WebCore::WebGLObject::WebGLObject):
* html/canvas/WebGLObject.h:
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::create):
(WebCore::WebGLProgram::WebGLProgram):
* html/canvas/WebGLProgram.h:
* html/canvas/WebGLQuery.cpp:
(WebCore::WebGLQuery::create):
(WebCore::WebGLQuery::WebGLQuery):
* html/canvas/WebGLQuery.h:
* html/canvas/WebGLRenderbuffer.cpp:
(WebCore::WebGLRenderbuffer::create):
(WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
* html/canvas/WebGLRenderbuffer.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::checkObjectToBeBound):
(WebCore::WebGLRenderingContextBase::createBuffer):
(WebCore::WebGLRenderingContextBase::createFramebuffer):
(WebCore::WebGLRenderingContextBase::createTexture):
(WebCore::WebGLRenderingContextBase::createProgram):
(WebCore::WebGLRenderingContextBase::createRenderbuffer):
(WebCore::WebGLRenderingContextBase::createShader):
(WebCore::WebGLRenderingContextBase::deleteObject):
(WebCore::WebGLRenderingContextBase::validateWebGLObject):
(WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::supportsDrawBuffers):
* html/canvas/WebGLSampler.cpp:
(WebCore::WebGLSampler::create):
(WebCore::WebGLSampler::WebGLSampler):
* html/canvas/WebGLSampler.h:
* html/canvas/WebGLShader.cpp:
(WebCore::WebGLShader::create):
(WebCore::WebGLShader::WebGLShader):
* html/canvas/WebGLShader.h:
* html/canvas/WebGLSharedObject.cpp:
(WebCore::WebGLSharedObject::WebGLSharedObject):
* html/canvas/WebGLSharedObject.h:
* html/canvas/WebGLSync.cpp:
(WebCore::WebGLSync::create):
(WebCore::WebGLSync::WebGLSync):
* html/canvas/WebGLSync.h:
* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::create):
(WebCore::WebGLTexture::WebGLTexture):
* html/canvas/WebGLTexture.h:
* html/canvas/WebGLTransformFeedback.cpp:
(WebCore::WebGLTransformFeedback::create):
(WebCore::WebGLTransformFeedback::WebGLTransformFeedback):
* html/canvas/WebGLTransformFeedback.h:
* html/canvas/WebGLVertexArrayObject.cpp:
(WebCore::WebGLVertexArrayObject::create):
(WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
* html/canvas/WebGLVertexArrayObject.h:
* html/canvas/WebGLVertexArrayObjectBase.cpp:
(WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
* html/canvas/WebGLVertexArrayObjectBase.h:
* html/canvas/WebGLVertexArrayObjectOES.cpp:
(WebCore::WebGLVertexArrayObjectOES::create):
(WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
(WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
* html/canvas/WebGLVertexArrayObjectOES.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/gpu/Texture.cpp:
(WebCore::convertFormat):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::getIntegerv):
(WebCore::GraphicsContext3D::getExtensions):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::validateDepthStencil):
(WebCore::GraphicsContext3D::drawArraysInstanced):
(WebCore::GraphicsContext3D::drawElementsInstanced):
(WebCore::GraphicsContext3D::vertexAttribDivisor):
2016-11-15 Joanmarie Diggs <jdiggs@igalia.com>
AX: Need to update implicit/default values for aria-valuemin, aria-valuenow, and aria-valuemax
https://bugs.webkit.org/show_bug.cgi?id=164773
Reviewed by Chris Fleizach.
Return the values stated in the ARIA 1.1 spec, namely:
- aria-valuemin is 0 for roles other than spinbutton
- aria-valuemax is 100 for roles other than spinbutton
- aria-valuenow is half way between aria-valuemax and aria-valuemin
for roles other than spinbutton, and 0 for spinbutton
For spinbutton, the spec states that "there is no minimum/maximum value."
But at least in the case of ATK/AT-SPI2, the accessible value interface
is expected to provide a number. Therefore, expose the values we use to
constrain input type="number": -std::numeric_limits<float>::max() and
std::numeric_limits<float>::max().
Test: accessibility/spinbutton-implicit-values.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::valueForRange):
(WebCore::AccessibilityNodeObject::maxValueForRange):
(WebCore::AccessibilityNodeObject::minValueForRange):
2016-11-14 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::exportKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164722
<rdar://problem/29251740>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::exportKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-exportKey.
It also refers to the latest Editor's Draft to a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-exportKey.
2. It implements exportKey operations of the following algorithms: AES-CBC, AES-KW,
HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It also fixes the following bugs:
https://bugs.webkit.org/show_bug.cgi?id=156114,
<rdar://problem/21773066>.
Note: We currently only support Raw and Jwk key format.
Tests: crypto/subtle/aes-cbc-generate-export-key-jwk-length-128.html
crypto/subtle/aes-cbc-generate-export-key-jwk-length-192.html
crypto/subtle/aes-cbc-generate-export-key-jwk-length-256.html
crypto/subtle/aes-cbc-generate-export-key-raw.html
crypto/subtle/aes-export-key-malformed-parameters.html
crypto/subtle/aes-kw-generate-export-key-jwk-length-128.html
crypto/subtle/aes-kw-generate-export-key-jwk-length-192.html
crypto/subtle/aes-kw-generate-export-key-jwk-length-256.html
crypto/subtle/aes-kw-generate-export-raw-key.html
crypto/subtle/export-key-malformed-parameters.html
crypto/subtle/hmac-export-key-malformed-parameters.html
crypto/subtle/hmac-generate-export-key-jwk-sha1.html
crypto/subtle/hmac-generate-export-key-jwk-sha224.html
crypto/subtle/hmac-generate-export-key-jwk-sha256.html
crypto/subtle/hmac-generate-export-key-jwk-sha384.html
crypto/subtle/hmac-generate-export-key-jwk-sha512.html
crypto/subtle/hmac-generate-export-raw-key.html
crypto/subtle/hmac-import-key-malformed-parameters.html
crypto/subtle/rsa-export-key-malformed-parameters.html
crypto/subtle/rsa-oaep-generate-export-key-jwk-sha1.html
crypto/subtle/rsa-oaep-generate-export-key-jwk-sha224.html
crypto/subtle/rsa-oaep-generate-export-key-jwk-sha256.html
crypto/subtle/rsa-oaep-generate-export-key-jwk-sha384.html
crypto/subtle/rsa-oaep-generate-export-key-jwk-sha512.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-jwk.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha1.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha224.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha256.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha384.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha512.html
crypto/workers/subtle/aes-generate-export-key-jwk.html
crypto/workers/subtle/aes-generate-export-key-raw.html
crypto/workers/subtle/hmac-generate-export-key-jwk.html
crypto/workers/subtle/hmac-generate-export-key-raw.html
crypto/workers/subtle/rsa-generate-export-key-jwk.html
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toJSValueFromJsonWebKey):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::JSSubtleCrypto::exportKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::exportKey):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::importKey):
(WebCore::CryptoAlgorithmAES_CBC::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
(WebCore::CryptoAlgorithmAES_KW::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::importKey):
(WebCore::CryptoAlgorithmHMAC::exportKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::exportJwk):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::exportJwk):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::exportJwk):
* crypto/keys/CryptoKeyRSA.h:
2016-11-15 Jon Lee <jonlee@apple.com>
Remove HasMediaCaptureDevice
https://bugs.webkit.org/show_bug.cgi?id=164767
<rdar://problem/29263696>
Reviewed by Eric Carlson.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Remove HasMediaCaptureDevice in state.
* page/MediaProducer.h:
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Remove it in the media string.
2016-11-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font-synthesis and text-decoration-skip parsing
https://bugs.webkit.org/show_bug.cgi?id=164736
Reviewed by Dean Jackson.
Fix the properties to not allow duplicate values, to reject when
garbage values are included, to require that none be a singleton,
and to preserve the declaration order of the properties.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontSynthesis):
(WebCore::CSSParser::parseTextDecorationSkip):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontSynthesis):
(WebCore::consumeTextDecorationSkip):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-15 Daniel Bates <dabates@apple.com>
Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
https://bugs.webkit.org/show_bug.cgi?id=164662
<rdar://problem/29268514>
Reviewed by Reviewed by Alex Christensen and Brady Eidson.
Currently we disallow non-default HTTP 0.9 loads at the ResourceLoader level and disallow
subresource loads using HTTP 0.9 on a default port when the embedding page loads using a
different HTTP version. However loads can still be initiated from other loaders (e.g. FrameLoader)
with regards to the first issue. The latter issue does not afford much protection and
increases code complexity. Instead we should simplify our policy and move our code to the
lowest networking abstraction level, ResourceHandle/NetworkDataTask, so that we disallow
all non-default port loads using HTTP 0.9 regardless of the loader used.
Tests: http/tests/security/http-0.9/image-default-port-allowed.html
http/tests/security/http-0.9/xhr-blocked.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Remove logic to cancel an HTTP 0.9 load from here.
We will cancel the HTTP 0.9 load at the ResourceHandle/NetworkDataTask level.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse): Ditto.
* platform/URL.h: Export stringCenterEllipsizedToLength() so that we can use it in WebKit2.
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess): Modified to call ResourceHandle::didReceiveResponse().
(WebCore::BlobResourceHandle::notifyResponseOnError): Ditto.
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
Otherwise notify the client that we received a response.
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Perform any
additional platform-specific logic after notifying the resource handle client of the received
response. Only the libsoup backend overwrites this member function to do something meaningful.
* platform/network/ResourceHandle.h:
* platform/network/ResourceResponseBase.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): Modified to
call ResourceHandle::didReceiveResponse().
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): Ditto.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::nextMultipartResponsePartCallback): Ditto.
(WebCore::sendRequestCallback): Ditto.
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Turns around and
calls continueAfterDidReceiveResponse().
2016-11-15 Zalan Bujtas <zalan@apple.com>
[MultiCol] Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162833
Reviewed by Simon Fraser.
This is a temporary workaround until after we addressed render tree mutation during layout (webkit.org/b/163849).
Test: fast/inline/out-of-flow-quotation-text-with-multicolumn.html
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::populate):
(WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::attachQuote): Populating/evacuating the flow should not trigger quotation text changes.
(WebCore::RenderQuote::detachQuote):
* rendering/RenderView.h:
(WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope):
(WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope):
2016-11-15 Eric Carlson <eric.carlson@apple.com>
REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=164715
Reviewed by Jon Lee.
No new tests, fixes a crash in an existing test.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::document): Return nullptr when the script execution context has
been cleared.
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::document): Deleted.
2016-11-15 Alejandro G. Castro <alex@igalia.com>
WebRTC: update MediaStream-MediaElement-srcObject.html test and unskip it
https://bugs.webkit.org/show_bug.cgi?id=159343
Reviewed by Philippe Normand.
Test updated.
We can not initialize the srcObject attribute when creating the mediaplayer
or we would be removing the srcObject we are going to use.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaPlayer):
2016-11-14 Alex Christensen <achristensen@webkit.org>
Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164720
Reviewed by Brady Eidson.
This is adding to r208558 where we moved databaseIdentifier to SecurityOriginData so we
don't have to use SecurityOrigin in the DatabaseProcess. This is a step towards only using
SecurityOrigin (and the SchemeRegistry) in the WebProcess. SecurityOriginData is for other
processes and IPC. There should be no change in behaviour.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::securityOrigin):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::tryToOpenDatabaseBackend):
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseManagerClient.h:
(WebCore::DatabaseManagerClient::dispatchDidAddNewOrigin):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasAdequateQuotaForOrigin):
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
(WebCore::DatabaseTracker::hasEntryForOriginNoLock):
(WebCore::DatabaseTracker::hasEntryForDatabase):
(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::originPath):
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
(WebCore::DatabaseTracker::fullPathForDatabase):
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::databaseNamesNoLock):
(WebCore::DatabaseTracker::databaseNames):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::deleteOriginLockFor):
(WebCore::DatabaseTracker::usage):
(WebCore::DatabaseTracker::quotaNoLock):
(WebCore::DatabaseTracker::quota):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::addDatabase):
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor):
(WebCore::DatabaseTracker::recordCreatingDatabase):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::creatingDatabase):
(WebCore::DatabaseTracker::canDeleteDatabase):
(WebCore::DatabaseTracker::recordDeletingDatabase):
(WebCore::DatabaseTracker::doneDeletingDatabase):
(WebCore::DatabaseTracker::isDeletingDatabase):
(WebCore::DatabaseTracker::canDeleteOrigin):
(WebCore::DatabaseTracker::isDeletingOrigin):
(WebCore::DatabaseTracker::recordDeletingOrigin):
(WebCore::DatabaseTracker::doneDeletingOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::deleteDatabaseFile):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::getDatabaseIdentifier):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier): Deleted.
(WebCore::SecurityOrigin::createFromDatabaseIdentifier): Deleted.
* page/SecurityOrigin.h:
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
* storage/StorageArea.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* storage/StorageEventDispatcher.h:
* storage/StorageNamespace.h:
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
2016-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Worker debugging should pause all targets and view call frames in all targets
https://bugs.webkit.org/show_bug.cgi?id=164305
<rdar://problem/29056192>
Reviewed by Timothy Hatcher.
Tests: inspector/debugger/continueUntilNextRunLoop
inspector/worker/debugger-multiple-targets-pause
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
Switch from postTask (callOnMainThread) to RunLoop::main().dispatch so
that a paused Worker can send Inspector protocol messages responses
back through the Main Page's InspectorWorkerAgent even if the Page
itself is paused and MainThread callbacks are paused.
* workers/WorkerRunLoop.h:
(WebCore::WorkerRunLoop::isNested):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
When running a nested WorkerRunLoop, running inspector debugger
commands, we should not fire timers on the Worker. Timers would
then be happening out of order and would not be debuggable.
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
(WebCore::InspectorDOMDebuggerAgent::clear):
(WebCore::InspectorDOMDebuggerAgent::didPause): Deleted.
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didFireTimerImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl): Deleted.
(WebCore::InspectorInstrumentation::cancelPauseOnNativeEvent): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willHandleEvent):
(WebCore::InspectorInstrumentation::didHandleEvent): Deleted.
Remove unnecessary code where WebCore is trying to keep track
of pause on next statement but that state is already more
accurately provided by InspectorDebuggerAgent.
2016-11-14 Myles C. Maxfield <mmaxfield@apple.com>
[WebGL2] Teach WebGLRenderingContextBase about new texture internal formats
https://bugs.webkit.org/show_bug.cgi?id=164525
Reviewed by Dean Jackson.
Test: fast/canvas/webgl/webgl2-texture-upload-enums.html
This patch migrates the existing WebGL calls texImage2D(), texSubImage2D(),
and readPixels() to understand the new WebGL 2 texture types. In WebGL1, the
format and the internalFormat were required to be the same, and we had this
assumption baked into many places in these functions. In WebGL 2, those two
values are often different, which means I had to fix all of these assumptions
in our code. Also, rather than have two completely separate parallel
implementations of these functions, a more forward-looking approach is to
have one implementation which has a few checks to isWebGL1() in strategic
places. (This way, bugs only have to be fixed in a single place). Therefore,
this patch deletes the WebGL 2 versions of these functions.
* html/canvas/WebGL2RenderingContext.cpp: These functions are moved to
WebGLRenderingContextBase.
(WebCore::WebGL2RenderingContext::isIntegerFormat):
(WebCore::WebGL2RenderingContext::copyTexImage2D): Deleted.
(WebCore::WebGL2RenderingContext::texSubImage2DBase): Deleted.
(WebCore::WebGL2RenderingContext::texSubImage2DImpl): Deleted.
(WebCore::WebGL2RenderingContext::texSubImage2D): Deleted.
(WebCore::WebGL2RenderingContext::validateTexFuncParameters): Deleted.
(WebCore::WebGL2RenderingContext::validateTexFuncFormatAndType): Deleted.
(WebCore::WebGL2RenderingContext::validateTexFuncData): Deleted.
* html/canvas/WebGL2RenderingContext.h: Moved function implementations to
WebGLRenderingContextBase.
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore::WebGLRenderingContext::copyTexImage2D): Deleted.
(WebCore::WebGLRenderingContext::texSubImage2DBase): Deleted.
(WebCore::WebGLRenderingContext::texSubImage2DImpl): Deleted.
(WebCore::WebGLRenderingContext::texSubImage2D): Deleted.
(WebCore::WebGLRenderingContext::validateTexFuncParameters): Deleted.
(WebCore::WebGLRenderingContext::validateTexFuncFormatAndType): Deleted.
(WebCore::WebGLRenderingContext::validateTexFuncData): Deleted.
* html/canvas/WebGLRenderingContext.h: Moved function implementations to
WebGLRenderingContextBase.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateSettableTexInternalFormat):
Teach about new depth texture formats.
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D): Rename
"internalformat" to "internalFormat". Teach about the distinction between
format and internalFormat. When pre-filling textures with 0s to work around
buggy drivers, we need a new way of knowing which format/type arguments to
pass to texSubImage2D() which are compatible with the texture's internal
format. The implementation of this function was added to GraphicsContext3D
and is called here.
(WebCore::WebGLRenderingContextBase::generateMipmap): Teach about the
distinction between format and internalFormat.
(WebCore::internalFormatTheme): This is used so readPixels() knows what
kind of format/type arguments are compatible with the texture's internal
format.
(WebCore::numberOfComponentsForFormat): Ditto.
(WebCore::numberOfComponentsForInternalFormat): Ditto.
(WebCore::WebGLRenderingContextBase::readPixels): Many more format/type
combinations are required in order to test the various new kinds of
textures.
(WebCore::WebGLRenderingContextBase::texImage2DBase): Rename internalformat
to internalFormat, and teach about the distinction between format and
internalFormat.
(WebCore::WebGLRenderingContextBase::validateTexFunc): Ditto.
(WebCore::WebGLRenderingContextBase::texImage2D): Ditto.
(WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Moved from
WebGLRenderingContext.
(WebCore::WebGLRenderingContextBase::texSubImage2D): Ditto.
(WebCore::WebGLRenderingContextBase::validateArrayBufferType): Ditto.
(WebCore::WebGLRenderingContextBase::validateTexFuncData): Ditto.
(WebCore::WebGLRenderingContextBase::validateTexFuncParameters): Ditto.
(WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): Ditto.
This is the main function where the new internalFormats are dealt with.
The OpenGL ES spec lists a table of all the internalFormats and all their
compatible format/type values. This table is entered into this function to
check that the combinations are correct.
(WebCore::WebGLRenderingContextBase::texSubImage2DBase): Moved from
WebGLRenderingContext.
(WebCore::WebGLRenderingContextBase::copyTexImage2D): Ditto.
(WebCore::WebGLRenderingContextBase::validateSettableTexFormat): Deleted.
* html/canvas/WebGLRenderingContextBase.h: No longer overrides virtual
functions.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::computeFormatAndTypeParameters): Because
this is inside GraphicsContext3D, it doesn't need any isWebGL1() checks.
Teach about new enums.
(WebCore::GraphicsContext3D::possibleFormatAndTypeForInternalFormat):
Ditto.
(WebCore::GraphicsContext3D::packImageData):
(WebCore::GraphicsContext3D::packPixels): It is possible to try to
copy data from a video into one of these new formats. Currently, we
implement this by swizzling on the CPU. Rather than implementing all the
swizzling functions in this patch (which would make this patch much
larger), simply bail in this case. We will implement this later.
(WebCore::GraphicsContext3D::getClearBitsByFormat): Update.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::hasAlpha): Ditto.
(WebCore::GraphicsContext3D::hasColor): Ditto.
2016-11-14 Simon Fraser <simon.fraser@apple.com>
Scrolling when zoomed doesn't always use the correct layout viewport
https://bugs.webkit.org/show_bug.cgi?id=164756
Reviewed by Dean Jackson.
The scrolling thread was always using the layout viewport rect pushed onto it and
never computing a new one, so when scrolling around after zooming position:fixed
elements would not get the expected visual viewport behavior.
Fix by having ScrollingTreeFrameScrollingNode updating its notion of the layout viewport
on scrolls.
Not testable because we can't dump the scrolling tree on Mac (yet).
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2016-11-14 Ryosuke Niwa <rniwa@webkit.org>
document.createElementNS doesn't construct a custom element
https://bugs.webkit.org/show_bug.cgi?id=164700
Reviewed by Darin Adler.
Fixed the bug that document.createElementNS doesn't create a custom element or enqueue it to upgrade.
Also made constructCustomElementSynchronously not call the custom element constructors with the element's
local name as the first argument, which was a non-standard behavior added during prototyping.
Test: fast/custom-elements/DOMImplementation-createDocument.html
fast/custom-elements/document-createElementNS.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback): Added a variant that takes QualifiedName
instead of AtomicString.
(WebCore::constructCustomElementSynchronously): Don't add the local name as an argument.
* bindings/js/JSCustomElementInterface.h:
* dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::findInterface): Just find the interface based on the local name after
checking the namespace URI to be that of the XHTML. We need to ignore the prefix for the purpose of looking
up the custom element definition as specified in the latest HTML specification:
https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Added an assertion to make sure we don't invoke scripts while
constructing the document element.
* dom/Document.cpp:
(WebCore::createUpgradeCandidateElement): Made this function create a HTMLUnknownElement instead of returning
nullptr to share more code. Also added a variant which takes QualifiedName.
(WebCore::isValidHTMLElementName): Added; helpers for createHTMLElementWithNameValidation to call isValidName
on Document with the right argument.
(WebCore::createHTMLElementWithNameValidation): Templatized the function to be called with either AtomicString
or QualifiedName for the name.
(WebCore::createFallbackHTMLElement):
(WebCore::Document::createElementNS): Call createHTMLElementWithNameValidation to create a custom element if
possible. This function ends up re-validating the element name before creating a HTMLUnknownElement but that
shouldn't be a common scenario to matter. In fact, createElementNS is a rarely used API.
2016-11-14 Chris Dumez <cdumez@apple.com>
Avoid copying attributes vector when constructing a CustomElement in HTMLTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=164734
Reviewed by Ryosuke Niwa.
Avoid copying attributes vector when constructing a CustomElement in HTMLTreeBuilder.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertCustomElement):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::HTMLStackItem):
(WebCore::HTMLStackItem::create):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
2016-11-14 Chris Dumez <cdumez@apple.com>
Inline QualifiedName::toString() method
https://bugs.webkit.org/show_bug.cgi?id=164726
Reviewed by Ryosuke Niwa.
Inline QualifiedName::toString() method to limit performance impact of r208674.
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::toString): Deleted.
* dom/QualifiedName.h:
(WebCore::QualifiedName::toString):
2016-11-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the font-synthesis property
https://bugs.webkit.org/show_bug.cgi?id=164728
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontSynthesis):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-12 Sam Weinig <sam@webkit.org>
[SVG] Moving more special casing of SVG out of the bindings - SVGNumber/SVGPoint/SVGRect/SVGLength/SVGTransform/SVGMatrix
https://bugs.webkit.org/show_bug.cgi?id=164696
Reviewed by Darin Adler.
- Make SVGNumber, SVGPoint, SVGRect, SVGLength, SVGTransform and SVGMatrix
real classes and stop special casing them in the bindings generator. This
removes the remaining non-list SVG specializations from the bindings generator.
- Renamed existing SVGLength, SVGTransform and SVGMatrix to SVGLengthValue,
SVGTransformValue and SVGMatrixValue. There are no SVNumberValue, SVGPointValue
and SVGRectValue classes, as float, FloatPoint and FloatRect can be used
directly. Going forward, we can get rid of SVGMatrixValue as well, and just
use AffineTransform, but that will be done in a separate change.
* WebCore.xcodeproj/project.pbxproj:
* CMakeLists.txt:
Add new files.
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::value): Deleted.
(WebCore::JSSVGLength::setValue): Deleted.
(WebCore::JSSVGLength::convertToSpecifiedUnits): Deleted.
Removed. This can now be generated completely.
* bindings/scripts/CodeGenerator.pm:
(SkipIncludeHeader):
Remove special casing of SVGNumber. A header for it now exists.
(GetSVGWrappedTypeNeedingTearOff):
Remove special casing SVGPropertyTearOffs. None remain.
(ShouldPassWrapperByReference):
Allow all tear off types to be passed by reference.
(IsSVGTypeWithWritablePropertiesNeedingTearOff):
Remove now unused function.
* bindings/scripts/CodeGeneratorJS.pm:
(GetImplClassName):
(GenerateHeader):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GetSVGPropertyTypes):
(NativeToJSValue):
(GenerateConstructorDefinition):
Remove non-property tear off specific code.
(IsNativeType):
Remove unused function.
* css/CSSPropertyNames.in:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::strokeDashArrayToCSSValueList):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSVGLengthValue):
(WebCore::StyleBuilderConverter::convertSVGLengthVector):
(WebCore::StyleBuilderConverter::convertStrokeDashArray):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueBaselineShift):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::strokeDashArray):
(WebCore::RenderStyle::setStrokeDashArray):
(WebCore::RenderStyle::baselineShiftValue):
(WebCore::RenderStyle::setBaselineShiftValue):
(WebCore::RenderStyle::kerning):
(WebCore::RenderStyle::setKerning):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialStrokeDashArray):
(WebCore::SVGRenderStyle::initialBaselineShiftValue):
(WebCore::SVGRenderStyle::initialKerning):
(WebCore::SVGRenderStyle::setStrokeDashArray):
(WebCore::SVGRenderStyle::setKerning):
(WebCore::SVGRenderStyle::setBaselineShiftValue):
(WebCore::SVGRenderStyle::strokeDashArray):
(WebCore::SVGRenderStyle::kerning):
(WebCore::SVGRenderStyle::baselineShiftValue):
* rendering/style/SVGRenderStyleDefs.h:
Update for name change of SVGLength to SVGLengthValue.
* rendering/svg/RenderSVGImage.cpp:
Remove unused include.
* html/canvas/DOMPath.h:
Add an overload that takes a DOMMatrix, now that it is distinct from
AffineTransform.
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::buildLocalToBorderBoxTransform):
Update for name change of SVGPoint to FloatPoint.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift):
* rendering/svg/SVGTextLayoutEngineSpacing.cpp:
(WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing):
Update for name change of SVGLength to SVGLengthValue.
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::startPositionOfCharacter):
(WebCore::SVGTextQuery::endPositionOfCharacter):
(WebCore::SVGTextQuery::characterNumberAtPosition):
* rendering/svg/SVGTextQuery.h:
Update for name change of SVGPoint to FloatPoint.
* svg/LinearGradientAttributes.h:
* svg/PatternAttributes.h:
* svg/RadialGradientAttributes.h:
Update for name change of SVGLength to SVGLengthValue.
* svg/SVGAllInOne.cpp:
Remove SVGLength.cpp
* svg/SVGAngle.h:
Add missing newline.
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
(WebCore::SVGAnimateTransformElement::parseAttribute):
* svg/SVGAnimateTransformElement.h:
Update for name change of SVGTransform to SVGTransformValue.
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::SVGAnimatedLengthAnimator):
(WebCore::SVGAnimatedLengthAnimator::constructFromString):
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
(WebCore::parseLengthFromString):
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedLengthAnimator::calculateDistance):
* svg/SVGAnimatedLength.h:
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::SVGAnimatedLengthListAnimator):
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
(WebCore::parseLengthListFromString):
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedLengthList.h:
Update for name change of SVGLength to SVGLengthValue.
* svg/SVGAnimatedNumberList.h:
Include the new SVGNumber.h and switch typedef to type alias.
* svg/SVGAnimatedPointList.cpp:
Add now necessary include of SVGPoint.h
* svg/SVGAnimatedRect.h:
Update for name change of SVGPropertyTearOff<FloatRect> to SVGRect.
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
(WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
Update for name change of SVGTransform to SVGTransformValue.
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createLength):
(WebCore::SVGAnimatedType::setValueAsString):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::length):
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::parseAttribute):
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::parseAttribute):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::startPan):
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::parseAttribute):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::parseAttribute):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::parseAttribute):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::resolveRectangle):
(WebCore::SVGLengthContext::resolvePoint):
(WebCore::SVGLengthContext::resolveLength):
* svg/SVGLengthContext.h:
* svg/SVGLengthList.cpp:
(WebCore::SVGLengthList::parse):
* svg/SVGLengthList.h:
(WebCore::SVGPropertyTraits<SVGLengthList>::initialValue):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::parseAttribute):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::parseAttribute):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::parseAttribute):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::parseAttribute):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::parseAttribute):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::parseAttribute):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::parseAttribute):
Update for name change of SVGLength to SVGLengthValue.
* svg/SVGLength.cpp: Removed.
* svg/SVGLength.h:
(WebCore::SVGLength::create):
(WebCore::SVGLength::unitType):
(WebCore::SVGLength::valueForBindings):
(WebCore::SVGLength::setValueForBindings):
(WebCore::SVGLength::valueInSpecifiedUnits):
(WebCore::SVGLength::setValueInSpecifiedUnits):
(WebCore::SVGLength::valueAsString):
(WebCore::SVGLength::setValueAsString):
(WebCore::SVGLength::newValueSpecifiedUnits):
(WebCore::SVGLength::convertToSpecifiedUnits):
(WebCore::SVGLength::SVGLength):
Implement the SVGLength interface as a tear off.
* svg/SVGLength.idl:
Add annotations for exceptions, custom naming, and remove now unnecessary
custom binding annotation.
* svg/SVGLengthValue.cpp: Copied from Source/WebCore/svg/SVGLength.cpp.
* svg/SVGLengthValue.h: Copied from Source/WebCore/svg/SVGLength.h.
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::getCTMForBindings):
(WebCore::SVGGraphicsElement::getScreenCTMForBindings):
(WebCore::SVGGraphicsElement::getBBoxForBindings):
* svg/SVGGraphicsElement.h:
Add bindings specific versions of transformation access functions that return
tear offs.
* svg/SVGGraphicsElement.idl:
Annotate tear off returning functions with NewObject and ImplementedAs as necessary.
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGLocatable.h:
Change getTransformToElement to return a Ref<SVGMatrix> as that is what the binding
wants.
* svg/SVGMatrix.h:
Implement the SVGMatrix interface as a tear off.
* svg/SVGMatrix.idl:
Add annotations for exceptions. Remove meaningless Immutable annotation.
* svg/SVGMatrixValue.h: Copied from Source/WebCore/svg/SVGMatrix.h.
* svg/SVGNumber.h: Added.
(WebCore::SVGNumber::create):
(WebCore::SVGNumber::valueForBindings):
(WebCore::SVGNumber::setValueForBindings):
(WebCore::SVGNumber::SVGNumber):
Implement the SVGNumber interface as a tear off.
* svg/SVGNumber.idl:
Add exception annotation and custom naming annotations.
* svg/SVGNumberList.h:
Update for name change of SVGPropertyTearOff<float> to SVGNumber.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::getPointAtLength):
* svg/SVGPathElement.h:
Make getPointAtLength return a Ref<SVGPoint> to match the bindings.
* svg/SVGPathElement.idl:
Annotate getPointAtLength with [NewObject].
* svg/SVGPathTraversalStateBuilder.cpp:
(WebCore::SVGPathTraversalStateBuilder::currentPoint):
* svg/SVGPathTraversalStateBuilder.h:
* svg/SVGPathUtilities.cpp:
(WebCore::getPointAtLengthOfSVGPathByteStream):
* svg/SVGPathUtilities.h:
* svg/SVGPointList.cpp:
(WebCore::SVGPointList::valueAsString):
* svg/SVGPointList.h:
* svg/SVGPolyElement.cpp:
Update for name change of SVGPoint to FloatPoint.
* svg/SVGPoint.h:
(WebCore::SVGPoint::create):
(WebCore::SVGPoint::x):
(WebCore::SVGPoint::setX):
(WebCore::SVGPoint::y):
(WebCore::SVGPoint::setY):
(WebCore::SVGPoint::matrixTransform):
(WebCore::SVGPoint::SVGPoint):
Implement the SVGPoint interface as a tear off. Remove typedef of FloatPoint
to SVGPoint.
* svg/SVGPoint.idl:
Add exception and NewObject annotations.
* svg/SVGRect.h:
(WebCore::SVGRect::create):
(WebCore::SVGRect::x):
(WebCore::SVGRect::setX):
(WebCore::SVGRect::y):
(WebCore::SVGRect::setY):
(WebCore::SVGRect::width):
(WebCore::SVGRect::setWidth):
(WebCore::SVGRect::height):
(WebCore::SVGRect::setHeight):
Implement the SVGRect interface as a tear off. FloatRect SVGPropertyTraits have
been moved to SVGRectTraits.h.
* svg/SVGRect.idl:
Add exception annotations.
* svg/SVGRectTraits.h: Copied from Source/WebCore/svg/SVGRect.cpp.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::viewport):
(WebCore::SVGSVGElement::currentTranslate):
(WebCore::SVGSVGElement::parseAttribute):
(WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
(WebCore::SVGSVGElement::getIntersectionList):
(WebCore::SVGSVGElement::getEnclosureList):
(WebCore::SVGSVGElement::checkIntersection):
(WebCore::SVGSVGElement::checkEnclosure):
(WebCore::SVGSVGElement::createSVGNumber):
(WebCore::SVGSVGElement::createSVGLength):
(WebCore::SVGSVGElement::createSVGPoint):
(WebCore::SVGSVGElement::createSVGMatrix):
(WebCore::SVGSVGElement::createSVGRect):
(WebCore::SVGSVGElement::createSVGTransform):
(WebCore::SVGSVGElement::createSVGTransformFromMatrix):
* svg/SVGSVGElement.h:
(WebCore::SVGSVGElement::currentTranslateValue):
(WebCore::SVGSVGElement::currentTranslate): Deleted.
(WebCore::SVGSVGElement::createSVGNumber): Deleted.
Update functions taking tear off values to take the wrappers, and update
the factory functions returning tear offs, to return the wrappers.
* svg/SVGSVGElement.idl:
Annotate functions/properties returning tear offs with [NewObject].
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::synchronizeTextLength):
(WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
(WebCore::SVGTextContentElement::textLengthAnimated):
(WebCore::SVGTextContentElement::getStartPositionOfChar):
(WebCore::SVGTextContentElement::getEndPositionOfChar):
(WebCore::SVGTextContentElement::getExtentOfChar):
(WebCore::SVGTextContentElement::getCharNumAtPosition):
(WebCore::SVGTextContentElement::parseAttribute):
* svg/SVGTextContentElement.h:
(WebCore::SVGTextContentElement::specifiedTextLength):
Update functions returning tear off values to return the wrappers
and ones taking the values to take the wrappers.
* svg/SVGTextContentElement.idl:
Annotate functions/properties returning tear offs with [NewObject].
* svg/SVGTransform.cpp:
(WebCore::SVGTransform::matrix):
* svg/SVGTransform.h:
(WebCore::SVGTransform::create):
(WebCore::SVGTransform::type):
(WebCore::SVGTransform::angle):
(WebCore::SVGTransform::setMatrix):
(WebCore::SVGTransform::setTranslate):
(WebCore::SVGTransform::setScale):
(WebCore::SVGTransform::setRotate):
(WebCore::SVGTransform::setSkewX):
(WebCore::SVGTransform::setSkewY):
Implement the SVGTransform interface as a tear off.
* svg/SVGTransform.idl:
Add ConstantsScope annotation to allow the constants to be defined on
SVGTransformValue. Add exception and NewObject annotations.
* svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::SVGTransformDistance):
(WebCore::SVGTransformDistance::scaledDistance):
(WebCore::SVGTransformDistance::addSVGTransforms):
(WebCore::SVGTransformDistance::addToSVGTransform):
(WebCore::SVGTransformDistance::distance):
* svg/SVGTransformDistance.h:
* svg/SVGTransformList.cpp:
(WebCore::SVGTransformList::createSVGTransformFromMatrix):
(WebCore::SVGTransformList::consolidate):
* svg/SVGTransformList.h:
(WebCore::SVGPropertyTraits<SVGTransformList>::initialValue):
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformValue):
(WebCore::parseAndSkipType):
(WebCore::SVGTransformable::parseTransformType):
(WebCore::SVGTransformable::parseTransformAttribute):
* svg/SVGTransformable.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::parseAttribute):
Update for name change of SVGTransform to SVGTransformValue.
* svg/SVGTransformList.idl:
Annotate functions returning tear offs with NewObject.
* svg/SVGTransformValue.cpp: Copied from Source/WebCore/svg/SVGTransform.cpp.
* svg/SVGTransformValue.h: Copied from Source/WebCore/svg/SVGTransform.h.
* svg/SVGZoomEvent.cpp:
(WebCore::SVGZoomEvent::zoomRectScreen):
(WebCore::SVGZoomEvent::previousTranslate):
(WebCore::SVGZoomEvent::newTranslate):
* svg/SVGZoomEvent.h:
Update for change to SVGPoint/SVGRect. SVGPoint values become FloatPoints. Functions
returning SVGPoint/SVGRect now return Ref<SVGPoint>/Ref<SVGRect>.
* svg/SVGZoomEvent.idl:
Annotate function returning tear off with NewObject.
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::findItem):
Switch typedefs to type aliases. Define ListItemTearOff using SVGPropertyTraits
to get the correct tear off type (as we do for the other list property tear off
classes.)
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::clearValues):
(WebCore::SVGListProperty::clearValuesAndWrappers):
(WebCore::SVGListProperty::initializeValues):
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValues):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValues):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::canReplaceItem):
(WebCore::SVGListProperty::replaceItemValues):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::canRemoveItem):
(WebCore::SVGListProperty::removeItemValues):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValues):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::initialize):
(WebCore::SVGListPropertyTearOff::getItem):
(WebCore::SVGListPropertyTearOff::insertItemBefore):
(WebCore::SVGListPropertyTearOff::replaceItem):
(WebCore::SVGListPropertyTearOff::removeItem):
(WebCore::SVGListPropertyTearOff::appendItem):
* svg/properties/SVGPathSegListPropertyTearOff.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
* svg/properties/SVGTransformListPropertyTearOff.h:
Change functions returning PtrListItemTearOff, to instead return
Ref<ListItemTearOff>. To accomplish this, remove unreachable conditions
that were returning nullptr, and replace them with a assertions (these
were cases where a function like canGetItem() was called, and it only
did one of two things, returning an exception, or returned true).
* svg/properties/SVGMatrixTearOff.h:
Update for SVGMatrix's addition, this can now inherit from SVGMatrix. Remove
incorrect comment and update some SVGMatrix types to SVGMatrixValues.
* svg/properties/SVGStaticPropertyTearOff.h:
Require the use of SVGStaticPropertyTearOff to pass in the tear off type, rather
than the value type, so it can be directly inherited from. This allow the one user
of this class, SVGSVGElement::currentTranslate, to specialize on SVGPoint directly.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results now that svg property tear offs are not handled specially.
2016-11-14 Youenn Fablet <youenn@apple.com>
Move updateSignalingState to PeerConnectionBackend
https://bugs.webkit.org/show_bug.cgi?id=164719
Reviewed by Eric Carlson.
No change of behavior.
Refactoring MediaEndpointPeerConnection signaling state update to PeerConnectionBackend.
It is not specific to MediaEndpointPeerConnection and can be reused for other backends.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::updateSignalingState):
* Modules/mediastream/PeerConnectionBackend.h:
2016-11-14 Dean Jackson <dino@apple.com>
Handle filter() image type in new CSS Parser
https://bugs.webkit.org/show_bug.cgi?id=164673
<rdar://problems/29231376>
Reviewed by Darin Adler.
Add support for the <image> type filter() to the
new CSS Parser. This involved moving some functions
from CSSPropertyParser into CSSPropertyParserHelpers.
Covered by fast/filter-image tests.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeShadow):
(WebCore::parseSingleShadow): Deleted.
(WebCore::consumeFilterFunction): Deleted.
(WebCore::consumeFilter): Deleted.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFilterImage):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilter):
(WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
* css/parser/CSSPropertyParserHelpers.h:
2016-11-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support percentages in word-spacing
https://bugs.webkit.org/show_bug.cgi?id=164721
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLetterSpacing):
(WebCore::consumeWordSpacing):
(WebCore::consumeSpacing): Deleted.
2016-11-14 Joanmarie Diggs <jdiggs@igalia.com>
AX: In ARIA 1.1, the implicit value for aria-level on headings is 2
https://bugs.webkit.org/show_bug.cgi?id=164714
Reviewed by Chris Fleizach.
Return 2 rather than 0 if there is not a valid author-provided value
for aria-level on an ARIA heading.
No new tests required as we have sufficient coverage. Added one new
test case to heading-level.html and updated expectations for it and
for xml-roles-exposed.html.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::headingLevel):
2016-11-14 Youenn Fablet <youenn@apple.com>
Refresh RTCDataChannel abstract infrastructure
https://bugs.webkit.org/show_bug.cgi?id=164680
Reviewed by Darin Adler.
No real changes, except that a mock data channel is now returned for layout test.
Covered by activated and rebased test.
Adding support for mock data channel.
Updating data channel creation by using dictionary binding infrastructure.
Storing of options directly in RTCDataChannel to reduce the use of the data channel handler.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createDataChannelHandler):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::bufferedAmount):
(WebCore::RTCDataChannel::~RTCDataChannel): Deleted.
(WebCore::RTCDataChannel::label): Deleted.
(WebCore::RTCDataChannel::ordered): Deleted.
(WebCore::RTCDataChannel::maxRetransmitTime): Deleted.
(WebCore::RTCDataChannel::maxRetransmits): Deleted.
(WebCore::RTCDataChannel::protocol): Deleted.
(WebCore::RTCDataChannel::negotiated): Deleted.
(WebCore::RTCDataChannel::id): Deleted.
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannelEvent.cpp:
(WebCore::RTCDataChannelEvent::create):
(WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
(WebCore::RTCDataChannelEvent::~RTCDataChannelEvent): Deleted.
* Modules/mediastream/RTCDataChannelEvent.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::createDataChannel):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* platform/mediastream/MediaEndpoint.cpp:
(WebCore::EmptyMediaEndpoint::EmptyMediaEndpoint): Deleted.
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/RTCDataChannelHandler.h:
* platform/mediastream/RTCDataChannelHandlerClient.h:
* platform/mediastream/RTCPeerConnectionHandler.h:
(WebCore::RTCDataChannelInit::RTCDataChannelInit): Deleted.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createDataChannelHandler):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::createDataChannelHandler):
* platform/mock/MockMediaEndpoint.h:
* platform/mock/RTCDataChannelHandlerMock.cpp:
(WebCore::RTCDataChannelHandlerMock::RTCDataChannelHandlerMock):
* platform/mock/RTCDataChannelHandlerMock.h:
2016-11-14 David Kilzer <ddkilzer@apple.com>
Bug 164702: WebContent crash due to checked unsigned overflow in WebCore: WebCore::RenderLayerCompositor::requiresCompositingLayer const + 1104
<https://webkit.org/b/164702>
<rdar://problem/29236368>
Reviewed by Darin Adler.
Test: inspector/layers/layers-compositing-reasons.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
Don't composite if the canvas area overflows.
2016-11-14 Chris Dumez <cdumez@apple.com>
Fix the !ENABLE(FETCH_API) build after r208613
https://bugs.webkit.org/show_bug.cgi?id=164713
Reviewed by Youenn Fablet.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2016-11-13 Darin Adler <darin@apple.com>
Remove many includes of ExceptionCode.h
https://bugs.webkit.org/show_bug.cgi?id=164706
Reviewed by Alex Christensen.
* Modules/encryptedmedia/CDMPrivateClearKey.cpp: Removed include of ExceptionCode.h.
* Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp: Ditto.
* Modules/fetch/FetchBodyOwner.cpp: Ditto.
* Modules/indexeddb/IDBDatabase.cpp: Added include of ExceptionCode.h.
* Modules/indexeddb/IDBDatabase.h: Removed include of ExceptionCode.h.
* Modules/indexeddb/IDBDatabaseException.cpp: Ditto.
* Modules/indexeddb/IDBIndex.cpp: Added include of ExceptionCode.h.
* Modules/indexeddb/IDBObjectStore.cpp: Ditto.
* Modules/mediastream/MediaConstraintsImpl.cpp: Removed include of ExceptionCode.h.
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Ditto.
* Modules/mediastream/MediaDevicesRequest.cpp: Ditto.
* Modules/mediastream/MediaStream.cpp: Ditto.
* Modules/mediastream/MediaStreamTrack.cpp: Ditto.
* Modules/mediastream/RTCDTMFSender.cpp: Ditto.
* Modules/mediastream/RTCDataChannel.cpp: Ditto.
* Modules/mediastream/RTCPeerConnection.cpp: Ditto.
* Modules/notifications/Notification.h: Removed definition of ExceptionCode.
* Modules/streams/ReadableStreamSource.h: Ditto.
* Modules/webaudio/BiquadFilterNode.cpp: Ditto.
* Modules/webaudio/PannerNode.cpp: Removed inclde of ExceptionCode.h.
* Modules/webaudio/WaveShaperNode.cpp: Ditto.
* Modules/webdatabase/Database.cpp:
(WebCore::guidForOriginAndName): Reimplemented using HashMap::ensure.
* Modules/webdatabase/Database.h: Renamed DatabaseGuid to DatabaseGUID and defined
it here instead of a in DatabaseBasicTypes.h; removed that include.
* Modules/webdatabase/DatabaseBasicTypes.h: Removed.
* Modules/webdatabase/DatabaseManager.h: Removed include of DatabaseBasicTypes.h.
* Modules/webdatabase/DatabaseTask.h: Ditto.
* Modules/webdatabase/SQLTransactionBackend.cpp: Removed include of ExceptionCode.h.
* Modules/webdatabase/SQLTransactionBackend.h: Removed include of DatabaseBasicTypes.h.
* WebCore.xcodeproj/project.pbxproj: Removed DatabaseBasicTypes.h, also let Xcode
edit the file.
* bindings/js/ScriptModuleLoader.cpp: Removed include of ExceptionCode.h.
* bindings/js/SerializedScriptValue.cpp: Ditto.
* bindings/js/StructuredClone.cpp: Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck): Removed unnecessary include of ExceptionCode.h.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated.
* css/CSSMediaRule.cpp: Removed include of ExceptionCode.h.
* css/CSSSupportsRule.cpp: Ditto.
* dom/ClientRectList.cpp: Ditto.
* dom/DOMCoreException.cpp: Added include of ExceptionCode.h.
* dom/DOMImplementation.cpp: Removed include of ExceptionCode.h.
* dom/ExceptionBase.h: Ditto.
* dom/Node.cpp: Added include of ExceptionCode.h.
* dom/NodeIterator.cpp: Removed include of ExceptionCode.h.
(WebCore::NodeIterator::NodePointer::NodePointer): Marked this inline.
(WebCore::NodeIterator::NodePointer::clear): Ditto.
(WebCore::NodeIterator::NodePointer::moveToNext): Ditto.
(WebCore::NodeIterator::NodePointer::moveToPrevious): Ditto.
(WebCore::NodeIterator::NodeIterator): Ditto.
(WebCore::NodeIterator::create): Moved this here from the header.
Now the constructor is inlined instead of this function.
(WebCore::NodeIterator::detach): Deleted. Moved to header.
* dom/NodeIterator.h: Removed definition of ExceptionCode, fixed indentation
of this file and made a few changes as mentioned above.
* dom/ProcessingInstruction.cpp: Removed include of ExceptionCode.h.
* dom/Text.cpp: Added include of ExceptionCode.h.
* dom/TreeWalker.cpp: Removed include of ExceptionCode.h.
* editing/FrameSelection.cpp: Ditto.
* fileapi/WebKitBlobBuilder.cpp: Ditto.
* history/CachedFrame.cpp: Ditto.
* html/HTMLDocument.cpp: Ditto.
* html/HTMLMeterElement.cpp: Ditto.
* html/HTMLObjectElement.cpp: Ditto.
* html/HTMLOptionElement.cpp: Ditto.
* html/HTMLOptionsCollection.cpp: Removed include of ExceptionCode.h.
(WebCore::HTMLOptionsCollection::add): Changed argument to const& to avoid a
little bit of reference count churn.
* html/HTMLOptionsCollection.h: Updated for above.
* html/HTMLProgressElement.cpp: Removed include of ExceptionCode.h.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add): Changed argument to const& to avoid a
little bit of reference count churn.
* html/HTMLSelectElement.h: Updated for above.
* html/HTMLTextAreaElement.cpp: Removed include of ExceptionCode.h.
* html/canvas/CanvasPattern.cpp: Ditto.
* html/canvas/WebGLContextGroup.h: Removed definition of ExceptionCode.
* html/track/AudioTrack.h: Removed include of ExceptionCode.h.
* html/track/TextTrack.h: Ditto.
* html/track/VTTCue.cpp: Added include of ExceptionCode.h.
* html/track/VTTRegion.cpp: Ditto.
* html/track/VideoTrack.h: Removed include of ExceptionCode.h.
* inspector/DOMEditor.cpp: Ditto.
* inspector/InspectorDatabaseAgent.cpp: Removed include of ExceptionCode.h.
Tweaked the code in the file a bit, marking more things final and making them
private. ALso simplified a couple of the functions a bit.
(WebCore::InspectorDatabaseAgent::didOpenDatabase):
(WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
(WebCore::InspectorDatabaseAgent::executeSQL):
(WebCore::InspectorDatabaseAgent::databaseForId):
* inspector/InspectorIndexedDBAgent.cpp: Removed include of ExceptionCode.h.
* inspector/InspectorStyleSheet.cpp: Added include of ExceptionCode.h.
* page/FocusController.cpp: Removed include of ExceptionCode.h.
* page/Location.h: Removed definition of ExceptionCode.
* page/Page.cpp: Removed include of ExceptionCode.h.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Ditto.
* storage/StorageArea.h: Removed definition of ExceptionCode.
* svg/SVGCircleElement.cpp: Removed include of ExceptionCode.h.
* svg/SVGColor.cpp: Added include of ExceptionCode.h.
* svg/SVGPaint.cpp: Ditto.
* svg/SVGStyleElement.cpp: Removed include of ExceptionCode.h.
* svg/properties/SVGListProperty.h: Added include of ExceptionCode.h.
* workers/Worker.cpp: Removed include of ExceptionCode.h.
* workers/WorkerMessagingProxy.cpp: Ditto.
* xml/XMLSerializer.cpp: Removed unneeded includes.
(WebCore::XMLSerializer::serializeToString): Use nullptr.
* xml/XMLSerializer.h: Removed definition of ExceptionCode, fixed indentation
of this file, and made a couple tweaks.
2016-11-14 Youenn Fablet <youenn@apple.com>
MediaStreamPrivate::create should take vectors of Ref
https://bugs.webkit.org/show_bug.cgi?id=164670
Reviewed by Sam Weinig.
No change of behavior.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2016-11-14 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Expose STATE_SINGLE_LINE and STATE_MULTI_LINE for ARIA searchbox role
https://bugs.webkit.org/show_bug.cgi?id=164712
Reviewed by Chris Fleizach.
Include SearchFieldRole when adding STATE_SINGLE_LINE and STATE_MULTI_LINE
to AtkStateSet.
Test: accessibility/gtk/singleline-and-multiline.html
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):
2016-11-14 Youenn Fablet <youennf@gmail.com>
RTCRtpTransceiver should have Ref of sender and receiver
https://bugs.webkit.org/show_bug.cgi?id=164665
Reviewed by Darin Adler.
No change of behavior.
Making RTCRptTransceiver have Ref<RTCRtpSender> and Ref<RTCRtpReceiver>.
Transforming transceiver set list of senders and receivers as vectors of references to reduce count churning.
Also making RTCRptTransceiver have a Ref<RTCIceTransport> instead of a RefPtr.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::createSourceMap):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::createReceiver):
(WebCore::MediaEndpointPeerConnection::replaceTrack):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::removeTrack):
(WebCore::RTCPeerConnection::close):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::create):
(WebCore::RTCRtpTransceiver::sender):
(WebCore::RTCRtpTransceiver::receiver):
(WebCore::RTCRtpTransceiver::iceTransport):
(WebCore::RtpTransceiverSet::senders):
(WebCore::RtpTransceiverSet::receivers):
2016-11-14 Csaba Osztrogonác <ossy@webkit.org>
Fix various --minimal build issue
https://bugs.webkit.org/show_bug.cgi?id=164479
Reviewed by Darin Adler.
* dom/Node.cpp:
* platform/audio/PlatformMediaSessionManager.cpp:
* testing/Internals.cpp:
(WebCore::Internals::captionsStyleSheetOverride):
2016-11-14 Csaba Osztrogonác <ossy@webkit.org>
Fix the !ENABLE(VIDEO_TRACK) build
https://bugs.webkit.org/show_bug.cgi?id=164476
Reviewed by Darin Adler.
* css/RuleSet.cpp:
(WebCore::RuleSet::addRule):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoElementFunction):
(WebCore::CSSSelectorParser::consumePseudo):
2016-11-14 Miguel Gomez <magomez@igalia.com>
[GTK] Do not use gstreamer-gl when accelerated compositing is disabled
https://bugs.webkit.org/show_bug.cgi?id=164481
Reviewed by Žan Doberšek.
Check whether accelerated compositing is enabled before creating the gstreamer-gl video sink.
No new tests (Covered by existing tests).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2016-11-14 Csaba Osztrogonác <ossy@webkit.org>
Fix the !ENABLE(CSS_BOX_DECORATION_BREAK) build
https://bugs.webkit.org/show_bug.cgi?id=164478
Reviewed by Darin Adler.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-11-14 Csaba Osztrogonác <ossy@webkit.org>
Fix the !ENABLE(CSS_GRID_LAYOUT) build
https://bugs.webkit.org/show_bug.cgi?id=164477
Reviewed by Darin Adler.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
2016-11-14 Csaba Osztrogonác <ossy@webkit.org>
[EFL] Suppress build warning in generated Geoclue2Interface.c
https://bugs.webkit.org/show_bug.cgi?id=164475
Reviewed by Darin Adler.
* PlatformEfl.cmake:
2016-11-10 Philippe Normand <pnormand@igalia.com>
[GStreamer][OWR] poor video rendering in apprtc
https://bugs.webkit.org/show_bug.cgi?id=164585
Reviewed by Xabier Rodriguez-Calvar.
The apprtc service uses 3 video elements in total, one for local, one
for remote and one called preview. During a call only remote and
preview are displayed, preview being linked to the same mediastream as
local. The consequence is that 2 OWR video renderers of the same
source are created. When gst-gl is enabled this isn't a problem but
when it is disabled a performance issue appears and the webkit video
sink starts dropping frames.
The solution is to have the video renderer shared between the 2
media players in this scenario.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::videoSink): Add video sink getter.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Make sure the m_streamPrivate is
set before creating the video sink.
(WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): Re-use video renderer
and sink if they have previously been created for another media player.
* platform/mediastream/MediaStreamPrivate.h: Store GStreamer sink and renderer so
they can be potentially used by multiple media players.
(WebCore::MediaStreamPrivate::setVideoRenderer):
(WebCore::MediaStreamPrivate::getVideoSinkElement):
(WebCore::MediaStreamPrivate::getVideoRenderer):
2016-11-13 Fujii Hironori <Hironori.Fujii@sony.com>
[HarfBuzz] HarfBuzzShaper should not assume numGlyphs is greater than 0
https://bugs.webkit.org/show_bug.cgi?id=164500
Reviewed by Myles C. Maxfield.
Test: fast/text/international/harfbuzz-runs-with-no-glyph.html
HarfBuzzShaper assumes numGlyphs of HarfBuzzRun is greater than
zero. But this is not necessarily true. If a font does not have a
glyph of SPACE (U+0020), HarfBuzz removes ignorable glyphs. In
this case, HarfBuzzRun can have no glyphs.
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Resize
m_offsets to one if m_numGlyphs is zero.
* platform/graphics/harfbuzz/HarfBuzzShaper.h:
(WebCore::HarfBuzzShaper::HarfBuzzRun::glyphs): Use Vector::data()
instread of operator[0].
(WebCore::HarfBuzzShaper::HarfBuzzRun::advances): Ditto.
(WebCore::HarfBuzzShaper::HarfBuzzRun::offsets): Ditto.
(WebCore::HarfBuzzShaper::HarfBuzzRun::glyphToCharacterIndexes): Ditto.
2016-11-13 Chris Dumez <cdumez@apple.com>
REGRESSION (204441): newsplex.com map does not load
https://bugs.webkit.org/show_bug.cgi?id=164705
<rdar://problem/28753438>
Reviewed by Darin Adler.
Update getElementsByTagName(qualifiedName) implementation to match more closely
the specification at:
- https://dom.spec.whatwg.org/#dom-document-getelementsbytagname
- https://dom.spec.whatwg.org/#concept-getelementsbytagname
- https://dom.spec.whatwg.org/#concept-element-qualified-name
In particular, we no longer split the input qualifiedName into a prefix and a
localName in order to compare those to element.prefix() / element.localName().
Instead, we keep the input qualifiedName as is and compare it to the element's
qualifiedName. This matters for HTML elements inside an HTML document that have
a semicolon in their localname (e.g. 'wx:map'). For this example, the element's
localName and its qualified name are both 'wx:map'. Calling
getElementsByTagName('wx:map') should return it. However, if you split the input
qualifiedName into a prefix and a localName, you end up checking:
'wx' == null && 'map' == 'wx:map'
which does not match.
Test: fast/dom/getElementsByTagName-HTMLElement-prefix.html
* dom/TagCollection.cpp:
(WebCore::TagCollection::TagCollection):
(WebCore::TagCollection::~TagCollection):
(WebCore::HTMLTagCollection::HTMLTagCollection):
(WebCore::HTMLTagCollection::~HTMLTagCollection):
(WebCore::makeQualifiedName): Deleted.
(WebCore::splitQualifiedName): Deleted.
* dom/TagCollection.h:
(WebCore::TagCollection::elementMatches):
(WebCore::HTMLTagCollection::elementMatches):
2016-11-13 Darin Adler <darin@apple.com>
Remove ExceptionCodePlaceholder
https://bugs.webkit.org/show_bug.cgi?id=164703
Reviewed by Sam Weinig.
* CMakeLists.txt: Removed ExceptionCodePlaceholder.cpp.
* WebCore.xcodeproj/project.pbxproj: Removed ExceptionCodePlaceholder.h/cpp.
Also let Xcode make a change to the file, I think removing an unreferenced
dead entry for a file that is already listed under a different ID.
* dom/DOMAllInOne.cpp: Removed ExceptionCodePlaceholder.cpp.
* dom/ExceptionCodePlaceholder.cpp: Removed.
* dom/ExceptionCodePlaceholder.h: Removed.
* inspector/InspectorDatabaseAgent.cpp: Removed include of ExceptionCodePlaceholder.h.
2016-11-13 Darin Adler <darin@apple.com>
Fix exception handling in SQL database code, streamline and update code
https://bugs.webkit.org/show_bug.cgi?id=164685
Reviewed by Sam Weinig.
Removed some old abstraction layers that were no longer in use. For example,
i n many cases, calls were going through DatabaseManager, which called through
an abstract class AbstractDatabaseServer to a concrete class DatabaseServer,
which then called through to DatabaseTracker. Clients now mostly just call
DatabaseTracker directly.
* CMakeLists.txt: Removed DatabaseServer.cpp and SQLTransactionClient.cpp.
* Modules/webdatabase/AbstractDatabaseServer.h: Removed.
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr instead of
DatabaseError to communicate DOM exceptions from DatabaseManager.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database): Use a reference instead of a RefPtr&& for database
context. Use unsigned instead of unsigned long. Modernize code to use more
initialization rather than assignment, to initialize scalar data members in the
class definition, and to use HashMap::ensure.
(WebCore::Database::databaseThread): Added. This class asserts that there is a
thread in the constructor, and so it is useful to have a helper for all the other
functions that assumes the thread is present and returns a reference rather than
a pointer.
(WebCore::Database::~Database): Updated since m_scriptExecutionContext is now
a Ref instead of a RefPtr.
(WebCore::Database::openAndVerifyVersion): Use ExceptionOr and databaseThread.
(WebCore::Database::close): Use databaseThread.
(WebCore::Database::performClose): Ditto.
(WebCore::DoneCreatingDatabaseOnExitCaller::DoneCreatingDatabaseOnExitCaller):
Use a reference. Removed unused m_openSuccceeded.
(WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
Use DatabaseTracker::singleton by its new name.
(WebCore::DoneCreatingDatabaseOnExitCaller::setOpenSucceeded): Deleted.
(WebCore::Database::performOpenAndVerify): Use ExceptionOr and update for above.
(WebCore::Database::closeDatabase): Updated for name change.
(WebCore::Database::scheduleTransaction): Updated for above, simplified and
streamlined.
(WebCore::Database::scheduleTransactionStep): Use databaseThread.
(WebCore::Database::transactionClient): Deleted. This object is no longer needed.
(WebCore::Database::transactionCoordinator): Use databaseThread.
(WebCore::Database::markAsDeletedAndClose): Removed unnecessary null check for
databaseThread, which can never be null.
(WebCore::Database::estimatedSize): Use unsigned, not unsigned long.
(WebCore::Database::disableAuthorizer): Removed assertion about RefPtr that is
now a Ref and never could have been null.
(WebCore::Database::enableAuthorizer): Ditto.
(WebCore::Database::setAuthorizerPermissions): Ditto.
(WebCore::Database::lastActionChangedDatabase): Ditto.
(WebCore::Database::lastActionWasInsert): Ditto.
(WebCore::Database::resetDeletes): Ditto.
(WebCore::Database::hadDeletes): Ditto.
(WebCore::Database::resetAuthorizer): Removed null check for a RefPtr that is now
a Ref and never could have been null.
(WebCore::Database::runTransaction): Simplified a bit.
(WebCore::Database::tableNames): Use databaseThread.
(WebCore::Database::securityOrigin): Changed to return a reference instead of a
pointer because all the callers need it to do that. If called on the wrong thread,
this will now do a RELEASE_ASSERT_NOT_REACHED. In the old code it would return a
null pointer and then the caller would dereference it a moment later, so it would
still be a crash.
(WebCore::Database::maximumSize): Removed const since it's not really needed and
the DatabaseTracker wants a non-const reference to this database.
(WebCore::Database::didCommitWriteTransaction): Added. Moved this code here from
SQLTransactionClient. There is no abstraction layer, so no reason to not have
this code, quite comparable to the rest of the code in the class, here. I am
assuming this served some more useful purpose back when we had a different back end
for Chromium?
(WebCore::Database::didExceedQuota): Ditto.
* Modules/webdatabase/Database.h: Updated for above changes. Made some functions
return references instead of pointers. Use Ref instead of RefPtr for some things that
can never be null.
* Modules/webdatabase/Database.idl: Added ImplementationLacksVTable because the
Database class is not polymorphic.
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::DatabaseContext): Take a reference instead of a pointer.
Moved data member initialization into class definition. Remove code that tries to do
debug accounting and databasecontext registration and instead just make sure to keep
the ScriptExecutionContext pointing at the DatabaseContext.
(WebCore::DatabaseContext::~DatabaseContext): Ditto.
(WebCore::DatabaseContext::stopDatabases): Ditto.
* Modules/webdatabase/DatabaseContext.h: Updated for the above. Also used the
scriptExecutionContext function inherited from the base class intead of adding our
own, and added a existingDatabaseThread() function, letting us get at the database
thread efficiently without creating a new one.
* Modules/webdatabase/DatabaseError.h: Removed. We now use DOM exceptions directly
instead of our own error enumeration that has to be translated to a DOM exception.
* Modules/webdatabase/DatabaseManager.cpp: Moved the ProposedDatabase class here
from the header file, and had it use references instead of pointers.
(WebCore::DatabaseManager::DatabaseManager): Deleted. There was nothing left to
initialize once the refactoring was done.
(WebCore::DatabaseManager::initialize): Call DatabaseTracker directly instead of
calling through m_server.
(WebCore::DatabaseManager::setClient): Ditto.
(WebCore::DatabaseManager::databaseDirectoryPath): Deleted. Callers will use the
function in DatabaseTracker directly.
(WebCore::DatabaseManager::setDatabaseDirectoryPath): Ditto.
(WebCore::DatabaseManager::existingDatabaseContextFor): Deleted. Callers will use
the ScriptExecutionContext::databaseContext function instead.
(WebCore::DatabaseManager::databaseContext): Renamed from databaseContextFor.
(WebCore::DatabaseManager::registerDatabaseContext): Deleted.
(WebCore::DatabaseManager::unregisterDatabaseContext): Deleted.
(WebCore::DatabaseManager::didConstructDatabaseContext): Deleted.
(WebCore::DatabaseManager::didDestructDatabaseContext): Deleted.
(WebCore::DatabaseManager::exceptionCodeForDatabaseError): Deleted.
(WebCore::logOpenDatabaseError): Tweaked conditionals a bit.
(WebCore::DatabaseManager::openDatabaseBackend): Use ExceptionOr. Changed to call
tryToOpenDatabaseBackend function here in this class rather than using m_server.
(WebCore::DatabaseManager::tryToOpenDatabaseBackend): Added. Moved here from the
DatabaseServer class.
(WebCore::DatabaseManager::addProposedDatabase): Take a reference.
(WebCore::DatabaseManager::removeProposedDatabase): Ditto.
(WebCore::DatabaseManager::openDatabase): Use ExceptionOr.
(WebCore::DatabaseManager::hasOpenDatabases): Use ScriptContext::databaseContext
directly instead of using helper functions in this class.
(WebCore::DatabaseManager::stopDatabases): Ditto.
(WebCore::DatabaseManager::fullPathForDatabase): Take a reference and also call
DatabaseTracker directly instead of calling through m_server.
(WebCore::DatabaseManager::hasEntryForOrigin): Deleted. Callers will use the
function in DatabaseTracker directly.
(WebCore::DatabaseManager::origins): Ditto.
(WebCore::DatabaseManager::databaseNamesForOrigin): Ditto.
(WebCore::DatabaseManager::detailsForNameAndOrigin): Call DatabaseTracker directly
instead of calling through m_server.
(WebCore::DatabaseManager::usageForOrigin): Deleted. Callers will use the
function in DatabaseTracker directly.
(WebCore::DatabaseManager::quotaForOrigin): Ditto.
(WebCore::DatabaseManager::setQuota): Ditto.
(WebCore::DatabaseManager::deleteAllDatabasesImmediately): Ditto.
(WebCore::DatabaseManager::deleteOrigin): Ditto.
(WebCore::DatabaseManager::deleteDatabase): Ditto.
(WebCore::DatabaseManager::closeAllDatabases): Ditto.
(WebCore::DatabaseManager::logErrorMessage): Take a reference.
* Modules/webdatabase/DatabaseManager.h: Updated for changes above.
* Modules/webdatabase/DatabaseManagerClient.h: Use references for security origins.
Also changed #if for iOS so that other platforms can call the iOS-specific functions
and they have inline empty bodies; lets us clean up call sites to not need conditionals.
* Modules/webdatabase/DatabaseServer.cpp: Removed.
* Modules/webdatabase/DatabaseServer.h: Removed.
* Modules/webdatabase/DatabaseTask.cpp:
(WebCore::isolatedCopy): Added. Helper functions for making isolated copies of
exceptions, which can contain strings.
(WebCore::DatabaseOpenTask::DatabaseOpenTask): Use ExceptionOr<void> instead of
a DatabaseError, a String, and a success boolean.
(WebCore::DatabaseOpenTask::doPerformTask): Updated to use ExceptoinOr.
(WebCore::DatabaseTableNamesTask::DatabaseTableNamesTask): Renamed.
(WebCore::DatabaseTableNamesTask::doPerformTask): Added a comment.
* Modules/webdatabase/DatabaseTask.h: Updated for above changes.
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::DatabaseThread): Initialized data members in the class
definition. Removed m_transactionClient.
(WebCore::DatabaseThread::recordDatabaseOpen): Take a reference.
(WebCore::DatabaseThread::recordDatabaseClosed): Ditto.
(WebCore::DatabaseThread::scheduleTask): Use an rvalue reference.
(WebCore::DatabaseThread::scheduleImmediateTask): Ditto.
(WebCore::DatabaseThread::unscheduleDatabaseTasks): Use a lambda instead of a
class for the same-database predicate.
* Modules/webdatabase/DatabaseThread.h: Updated for above.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::isolatedCopy): Added. Helper for making an isolated copy of a vector
of strings.
(WebCore::DatabaseTracker::singleton): Renamed from tracker.
(WebCore::DatabaseTracker::DatabaseTracker): Moved the code from
setDatabaseDirectoryPath in here.
(WebCore::DatabaseTracker::setDatabaseDirectoryPath): Deleted.
(WebCore::DatabaseTracker::databaseDirectoryPath): Deleted.
(WebCore::DatabaseTracker::hasAdequateQuotaForOrigin): Use ExceptionOr.
(WebCore::DatabaseTracker::canEstablishDatabase): Ditto.
(WebCore::DatabaseTracker::retryCanEstablishDatabase): Ditto.
(WebCore::DatabaseTracker::hasEntryForOriginNoLock): Take a reference.
(WebCore::DatabaseTracker::hasEntryForOrigin): Deleted.
(WebCore::DatabaseTracker::hasEntryForDatabase): Take a reference.
(WebCore::DatabaseTracker::maximumSize): Renamed from getMaxSizeForDatabase
and changed to take a reference.
(WebCore::DatabaseTracker::originPath): Take a reference.
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock): Ditto.
(WebCore::DatabaseTracker::fullPathForDatabase): Ditto.
(WebCore::DatabaseTracker::origins): Changed to use a return value instead
of using an out argument.
(WebCore::DatabaseTracker::databaseNamesNoLock): Ditto. Also renamed from
databaseNamesForOriginNoLock.
(WebCore::DatabaseTracker::databaseNames): Ditto. Also renamed from
databaseNamesForOrigin.
(WebCore::DatabaseTracker::detailsForNameAndOrigin): Take a reference.
(WebCore::DatabaseTracker::setDatabaseDetails): Ditto.
(WebCore::DatabaseTracker::doneCreatingDatabase): Ditto.
(WebCore::DatabaseTracker::addOpenDatabase): Ditto.
(WebCore::DatabaseTracker::removeOpenDatabase): Ditto.
(WebCore::DatabaseTracker::getOpenDatabases): Deleted.
(WebCore::DatabaseTracker::originLockFor): Take a reference.
(WebCore::DatabaseTracker::deleteOriginLockFor): Take a reference.
(WebCore::DatabaseTracker::usage): Renamed from usageForOrigin. Take a reference.
(WebCore::DatabaseTracker::quotaNoLock): Renamed from quotaForOriginNoLock.
Take a reference.
(WebCore::DatabaseTracker::quota): Renamed from quatoForOrigin. Take a reference.
(WebCore::DatabaseTracker::setQuota): Take a reference.
(WebCore::DatabaseTracker::addDatabase): Ditto.
(WebCore::DatabaseTracker::deleteAllDatabasesImmediately): Updated now that
origins has a return value.
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Ditto.
(WebCore::DatabaseTracker::deleteOrigin): Take a reference.
(WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor): Ditto.
(WebCore::DatabaseTracker::recordCreatingDatabase): Updated to take a reference,
use unique_ptr, and use HashCountedSet.
(WebCore::DatabaseTracker::doneCreatingDatabase): Ditto.
(WebCore::DatabaseTracker::creatingDatabase): Ditto.
(WebCore::DatabaseTracker::canDeleteDatabase): Take a reference.
(WebCore::DatabaseTracker::recordDeletingDatabase): Updated to take a reference,
and use unique_ptr.
(WebCore::DatabaseTracker::doneDeletingDatabase): Ditto.
(WebCore::DatabaseTracker::isDeletingDatabase): Ditto.
(WebCore::DatabaseTracker::canDeleteOrigin): Take a reference.
(WebCore::DatabaseTracker::isDeletingOrigin): Ditto.
(WebCore::DatabaseTracker::recordDeletingOrigin): Ditto.
(WebCore::DatabaseTracker::doneDeletingOrigin): Ditto.
(WebCore::DatabaseTracker::deleteDatabase): Ditto.
(WebCore::DatabaseTracker::deleteDatabaseFile): Ditto.
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases): Ditto.
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged): Ditto.
(WebCore::DatabaseTracker::notifyDatabasesChanged): Ditto.
* Modules/webdatabase/DatabaseTracker.h: Updated for above changes.
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::SQLStatement): Updated since Database::scriptExecutionContext
now returns a reference.
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::SQLTransaction): Moved data member initialization to
the calss definition. Also updated since Database::scriptExecutionContext now
returns a reference.
(WebCore::SQLTransaction::executeSQL): Use ExceptionOr.
(WebCore::SQLTransaction::checkAndHandleClosedDatabase): Updated since
databaseContext now returns a reference.
(WebCore::SQLTransaction::deliverQuotaIncreaseCallback): Updated to call
didExceedQuota on the database instead of the transaction client.
(WebCore::SQLTransaction::postflightAndCommit): Updated to call
didCommitWriteTransaction on the database instead of the transaction client.
(WebCore::SQLTransaction::acquireOriginLock): Updated for name change of
DatabaseTracker::tracker to DatbaseTracker::singleton.
* Modules/webdatabase/SQLTransaction.h: Updated for above.
* Modules/webdatabase/SQLTransaction.idl: Added MayThrowException to
executeSql. Not technically needed since it's a custom binding.
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::doCleanup): Updated assertion to use
Database::databaseThread.
(WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): Ditto.
* Modules/webdatabase/SQLTransactionClient.cpp: Removed.
* Modules/webdatabase/SQLTransactionClient.h: Removed.
* Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::getDatabaseIdentifier): Updated to pass a reference.
* WebCore.xcodeproj/project.pbxproj: Removed various deleted files.
Also let Xcode change the whitespace on some lines.
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql): Use ExceptionOr, specifically by
using the propagateException function.
* dom/ScriptExecutionContext.h: Added databaseContext function. Before, we
had setDatabaseContext, but no way to inspect the pointer that was stored.
* inspector/InspectorDatabaseAgent.cpp: Removed IGNORE_EXCEPTION in a call
to executeSQL, which no longer has an ExceptionCode out argument.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading): Pass a reference in the call to
DatabaseManager::stopDatabases.
2016-11-13 Dan Bernstein <mitz@apple.com>
Try to fix building with newer versions of clang.
* page/FrameView.h: Don’t export an inline function.
2016-11-13 Darin Adler <darin@apple.com>
Move crypto code from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164698
Reviewed by Sam Weinig.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
Use the new identifier function instead of getIdentifierForName.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters): Ditto.
(WebCore::toCryptoKeyUsageBitmap): Removed a stray meaningless const.
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): Pass
ScriptExecutionContext as a reference instead of a pointer.
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::createAlgorithmFromJSValue): Use the more efficient version
of setDOMException that uses scope.
(WebCore::JSWebKitSubtleCrypto::encrypt): Ditto. Also updated to use
ExceptionOr instead of ExceptionCode.
(WebCore::JSWebKitSubtleCrypto::decrypt): Ditto.
(WebCore::JSWebKitSubtleCrypto::sign): Ditto.
(WebCore::JSWebKitSubtleCrypto::verify): Ditto.
(WebCore::JSWebKitSubtleCrypto::digest): Ditto.
(WebCore::JSWebKitSubtleCrypto::generateKey): Ditto.
(WebCore::importKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::wrapKey): Ditto.
(WebCore::JSWebKitSubtleCrypto::unwrapKey): Ditto.
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::CryptoAlgorithm): Deleted.
(WebCore::CryptoAlgorithm::~CryptoAlgorithm): Deleted.
(WebCore::CryptoAlgorithm::generateKey): Use ExceptionOr.
(WebCore::CryptoAlgorithm::encrypt): Ditto.
(WebCore::CryptoAlgorithm::decrypt): Ditto.
(WebCore::CryptoAlgorithm::sign): Ditto.
(WebCore::CryptoAlgorithm::verify): Ditto.
(WebCore::CryptoAlgorithm::digest): Ditto.
(WebCore::CryptoAlgorithm::deriveKey): Ditto.
(WebCore::CryptoAlgorithm::deriveBits): Ditto.
(WebCore::CryptoAlgorithm::importKey): Ditto.
(WebCore::CryptoAlgorithm::encryptForWrapKey): Ditto.
(WebCore::CryptoAlgorithm::decryptForUnwrapKey): Ditto.
* crypto/CryptoAlgorithm.h: Use ExceptionOr.
Moved the destructor into the header since it's more efficient for
derived classes to have it inlined. Removed the protected constructor
because since there are pure virtual functions in the class, there is
no risk of anyone misusing the public constructor.
* crypto/CryptoAlgorithmRegistry.cpp:
(WebCore::CryptoAlgorithmRegistry::identifier): Renamed from
getIdentifierForName and changed to use an Optional rather than
using a boolean plus an out argument.
(WebCore::CryptoAlgorithmRegistry::name): Renamed to name from
nameForIdentifier. Also updated to share a single map containing
both names and constructors.
(WebCore::CryptoAlgorithmRegistry::create): Share single map as above.
(WebCore::CryptoAlgorithmRegistry::registerAlgorithm): Updated assertions
to a mroe straightforward style. Share single map for names and constructors.
* crypto/CryptoAlgorithmRegistry.h: Updated for above.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC): Deleted.
(WebCore::CryptoAlgorithmAES_CBC::~CryptoAlgorithmAES_CBC): Deleted.
(WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches): Use references, ExceptionOr.
(WebCore::CryptoAlgorithmAES_CBC::generateKey): Ditto.
(WebCore::CryptoAlgorithmAES_CBC::encrypt): Ditto.
(WebCore::CryptoAlgorithmAES_CBC::decrypt): Ditto.
(WebCore::CryptoAlgorithmAES_CBC::importKey): Ditto.
* crypto/algorithms/CryptoAlgorithmAES_CBC.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::CryptoAlgorithmAES_KW): Deleted.
(WebCore::CryptoAlgorithmAES_KW::~CryptoAlgorithmAES_KW): Deleted.
(WebCore::CryptoAlgorithmAES_KW::keyAlgorithmMatches): Use references, ExceptionOr.
(WebCore::CryptoAlgorithmAES_KW::generateKey): Ditto.
(WebCore::CryptoAlgorithmAES_KW::importKey): Ditto.
(WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Ditto.
(WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Ditto.
* crypto/algorithms/CryptoAlgorithmAES_KW.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::CryptoAlgorithmHMAC): Deleted.
(WebCore::CryptoAlgorithmHMAC::~CryptoAlgorithmHMAC): Deleted.
(WebCore::CryptoAlgorithmHMAC::generateKey): Use references, ExceptionOr.
(WebCore::CryptoAlgorithmHMAC::sign): Ditto.
(WebCore::CryptoAlgorithmHMAC::verify): Ditto.
(WebCore::CryptoAlgorithmHMAC::importKey): Ditto.
* crypto/algorithms/CryptoAlgorithmHMAC.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5): Deleted.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5): Deleted.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey): Use references, ExceptionOr.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt): Ditto.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt): Ditto.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): Ditto.
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::CryptoAlgorithmRSASSA_PKCS1_v1_5): Deleted.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::~CryptoAlgorithmRSASSA_PKCS1_v1_5): Deleted.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey): Use references, ExceptionOr.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign): Ditto.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify): Ditto.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): Ditto.
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::CryptoAlgorithmRSA_OAEP): Deleted.
(WebCore::CryptoAlgorithmRSA_OAEP::~CryptoAlgorithmRSA_OAEP): Deleted.
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey): Use references, ExceptionOr.
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt): Ditto.
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt): Ditto.
(WebCore::CryptoAlgorithmRSA_OAEP::importKey): Ditto.
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::CryptoAlgorithmSHA1): Deleted.
(WebCore::CryptoAlgorithmSHA1::~CryptoAlgorithmSHA1): Deleted.
(WebCore::CryptoAlgorithmSHA1::digest): Use ExceptionOr.
* crypto/algorithms/CryptoAlgorithmSHA1.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::CryptoAlgorithmSHA224): Deleted.
(WebCore::CryptoAlgorithmSHA224::~CryptoAlgorithmSHA224): Deleted.
(WebCore::CryptoAlgorithmSHA224::digest): Use ExceptionOr.
* crypto/algorithms/CryptoAlgorithmSHA224.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::CryptoAlgorithmSHA256): Deleted.
(WebCore::CryptoAlgorithmSHA256::~CryptoAlgorithmSHA256): Deleted.
(WebCore::CryptoAlgorithmSHA256::digest): Use ExceptionOr.
* crypto/algorithms/CryptoAlgorithmSHA256.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::CryptoAlgorithmSHA384): Deleted.
(WebCore::CryptoAlgorithmSHA384::~CryptoAlgorithmSHA384): Deleted.
(WebCore::CryptoAlgorithmSHA384::digest): Use ExceptionOr.
* crypto/algorithms/CryptoAlgorithmSHA384.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::CryptoAlgorithmSHA512): Deleted.
(WebCore::CryptoAlgorithmSHA512::~CryptoAlgorithmSHA512): Deleted.
(WebCore::CryptoAlgorithmSHA512::digest): Use ExceptionOr.
* crypto/algorithms/CryptoAlgorithmSHA512.h: Updated for above.
Also use constexpr for s_name and s_identifier.
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature): Use Optional instead of a boolean
return value and an out argument.
(WebCore::CryptoAlgorithmHMAC::platformSign): Use ExceptionOr.
(WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Ditto.
* crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Ditto.
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
(WebCore::CryptoAlgorithmHMAC::platformSign): Ditto.
(WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Ditto.
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Ditto.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Ditto.
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::buildAlgorithm): Updated to use name instead
of nameForIdentifier.
* crypto/keys/CryptoKeyHMAC.cpp: Ditto.
(WebCore::CryptoKeyHMAC::buildAlgorithm):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Use ExceptionOr.
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Ditto.
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
(WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Ditto.
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::commonCryptoHMACAlgorithm): Renamed from
getCommonCryptoHMACAlgorithm and changed to use Optional instead of
a boolean return value and an out argument.
(WebCore::CryptoAlgorithmHMAC::platformSign): Use ExceptionOr.
(WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Ditto.
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm): Renamed from
getCryptoDigestAlgorithm and changed to use Optional instead of
a boolean return value and an out argument.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Use ExceptionOr.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Ditto.
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Ditto.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::buildAlgorithm): Updated to use name instead
of nameForIdentifier.
2016-11-13 Joseph Pecoraro <pecoraro@apple.com>
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164686
Reviewed by Michael Catanzaro.
* css/*.h:
* plugins/*.h:
* rendering/*.h:
* style/*.h:
* svg/*.h:
* testing/*.h:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the iOS build after r208666.
* platform/SuddenTermination.h:
2016-11-12 Simon Fraser <simon.fraser@apple.com>
Add a way to get the UI-side scrolling tree as text via UIScriptController
https://bugs.webkit.org/show_bug.cgi?id=164697
Reviewed by Zalan Bujtas.
Add dumping to ScrollingTreeNode and subclasses (previously, we could only dump
the scrolling state tree). This re-uses the flags used for state tree dumping.
NodeIDs are not dumped by default because they can depend on earlier tests.
Test: scrollingcoordinator/ios/ui-scrolling-tree.html
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollingTreeAsText):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::dumpProperties):
(WebCore::ScrollingTreeNode::dump):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::dumpProperties):
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::dumpProperties):
2016-11-12 Darin Adler <darin@apple.com>
Remove some use of ExceptionCode in MediaStream
https://bugs.webkit.org/show_bug.cgi?id=164690
Reviewed by Sam Weinig.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices): Take a Document&.
(WebCore::MediaDevices::create): Ditto.
(WebCore::MediaDevices::~MediaDevices): Deleted.
(WebCore::MediaDevices::getUserMedia): Check document for null and
pass a reference to UserMediaRequest::start. Removed unused ExceptionCode
argument to UserMediaRequest::start, since the only exception was for
a null document.
(WebCore::MediaDevices::enumerateDevices): Check document for null and
pass a reference to MediaDevicesRequest::create. Removed exception
handling entirely because MediaDevicesRequest::create was not ever
raising an exception before.
* Modules/mediastream/MediaDevices.h: Updated for above changes.
* Modules/mediastream/MediaDevices.idl: Removed MayThrowException from
enumerateDevices, because it never throws an exception.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::MediaDevicesRequest): Take a Document&.
Removed unused ExceptionCode& argument.
(WebCore::MediaDevicesRequest::create): Ditto.
* Modules/mediastream/MediaDevicesRequest.h: Updated for above changes.
* Modules/mediastream/NavigatorMediaDevices.cpp:
(WebCore::NavigatorMediaDevices::mediaDevices): Pass a reference.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start): Use ExceptionOr.
(WebCore::UserMediaRequest::UserMediaRequest): Take a Document& and
a UserMediaController&.
* Modules/mediastream/UserMediaRequest.h: Updated for above changes.
2016-11-12 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
https://bugs.webkit.org/show_bug.cgi?id=164694
Reviewed by Zalan Bujtas.
When an async scroll notifications get back to the main thread in
AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(), we call
syncViewportConstrainedLayerPositions() to poke the new layer positions on the
GraphicsLayers to match the changes made on the scrolling thread.
However, this was not done on iOS, which will be problematic for a future patch
where we require GraphicsLayer positions and the current fixedPositionViewport rect
to have been computed when in a consistent state.
Fix by factoring some code into reconcileScrollingState(), which is called on iOS/WK2
from WebPage::updateVisibleContentRects() rather than setting the FrameView's scroll offset
directly.
Test: scrollingcoordinator/ios/sync-layer-positions-after-scroll.html
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredDelta):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions):
(WebCore::AsyncScrollingCoordinator::syncChildPositions): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileScrollingState):
(WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions):
(WebCore::ScrollingCoordinator::syncChildPositions): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* platform/Logging.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollOffset):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterDocumentScroll):
2016-11-12 Zalan Bujtas <zalan@apple.com>
RenderObject::flowThreadState should follow containing block instead of parent.
https://bugs.webkit.org/show_bug.cgi?id=164629
Reviewed by Simon Fraser.
Currently every descendant of a region/multicolumn container is considered to be part of the
flowthread including out-of-flow renderers. They all have the InsideFlowThread flag set.
However since out-of-flow renderers are not really part of the flowthread layout context,
whenever the layout code actually checks for their flowthread containers, we return nullptr and
try to handle this seemingly defective state gracefully (that is, flag indicates "inside the flow thread" state,
but there's no flow tread container).
This patch fixes this confused state by setting the RenderObject::flowThreadState flag based on
the containing block's state instead of the parent's.
Not testable, since we seem to manage out-of-flow elements just fine even
when they have the InsideFlowThread flag set.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::adjustFlowThreadStateIncludingDescendants): This is an iterative DFS pre-order traversal so
we set the flow state first on containers.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFlowThreadState):
(WebCore::RenderObject::initializeFlowThreadStateOnInsertion):
* rendering/RenderObject.h:
2016-11-12 Ryosuke Niwa <rniwa@webkit.org>
document.currentScript should be null when running a script inside a shadow tree
https://bugs.webkit.org/show_bug.cgi?id=164693
Reviewed by Yusuke Suzuki.
Fixed the bug that we were returning the old or outer script element in document.currentScript
while executing a script element inside a shadow tree. Return null instead.
New behavior matches the latest HTML5 specification:
https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
where it says for the classic script type, "if the script element's root is not a shadow root, then set
the script element's node document's currentScript attribute to the script element. Otherwise, set it to null."
No new tests. imported/w3c/web-platform-tests/shadow-dom/Document-prototype-currentScript.html covers it.
* dom/CurrentScriptIncrementer.h:
(WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer): Push nullptr when the script element
is inside a shadow tree.
(WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer): Changed to use an early exit.
* dom/Document.cpp:
(WebCore::Document::pushCurrentScript): Removed the assertion since the argument can now be nullptr.
2016-11-12 Darin Adler <darin@apple.com>
Remove a few assorted uses of ExceptionCode
https://bugs.webkit.org/show_bug.cgi?id=164683
Reviewed by Chris Dumez.
* Modules/applepay/PaymentContact.h: Removed include of ExceptionCode.h.
Also tidied up the constructor and destructor.
* Modules/indexeddb/IDBFactory.h: Removed typedef of ExceptionCode.
* Modules/indexeddb/IDBKeyRange.h: Ditto.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter): Removed local ExceptionCode variable that
was always 0.
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Ditto.
(WebCore::dataFunctionf): Ditto.
(WebCore::dataFunctioni): Ditto.
(WebCore::dataFunctionMatrix): Ditto.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes): Ditto.
* dom/Document.h: Removed typedef of ExceptionCode.
* dom/TreeWalker.h: Ditto.
* editing/markup.h: Ditto.
* html/ImageData.h: Ditto.
* html/InputType.h: Ditto.
* html/canvas/CanvasRenderingContext2D.h: Ditto.
* html/canvas/WebGLDebugShaders.h: Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setTimeout): Fixed typo where this was using
ExceptionCode instead of Exception. The code would return an integer
instead of an exception in this case. I could not produce a test that
exercises this code path; I suspect it is an unreachable error condition.
(WebCore::DOMWindow::setInterval): Ditto.
* replay/MemoizedDOMResult.h: Changed typedef of ExceptionCode into
a using statement. Not sure what the longer term fix is.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::PendingCallbacks::appendStartElementNSCallback): Renamed to use
WebKit-style "numXXX" rather than "nb_xxx".
(WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
Ditto.
(WebCore::handleNamespaceAttributes): Ditto. Replaced ExceptionCode out
argument with a boolean return value.
(WebCore::handleElementAttributes): Ditto.
(WebCore::XMLDocumentParser::startElementNs): Ditto. Updated for changes
to the handle functions above.
(WebCore::startElementNsHandler): More of the same.
(WebCore::attributesStartElementNsHandler): Ditto.
2016-11-11 Darin Adler <darin@apple.com>
Remove LegacyException support from bindings script
https://bugs.webkit.org/show_bug.cgi?id=164516
Reviewed by Youenn Fablet.
Besides removing LegacyException support from the bindings script, this patch
also removes most uses of ExceptionCodePlaceholder.h. Also, some call sites of
createElement were using ASSERT_NO_EXCEPTION on an argument that was not even an
ExceptionCode&, so to fix that, this changes most call sites to use specific create
functions for specific element classes, rather than using Document::createElement.
* Modules/mediasource/SourceBuffer.cpp: Removed include of
ExceptionCodePlaceholder.h.
* Modules/mediastream/MediaStreamTrack.cpp: Ditto.
* Modules/websockets/WebSocketChannel.cpp: Ditto.
* bindings/js/JSBlobCustom.cpp: Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed support for GetterMayThrowLegacyException,
SetterMayThrowLegacyException, and MayThrowLegacyException.
(GenerateParametersCheck): Ditto.
(GenerateImplementationFunctionCall): Ditto.
(GenerateConstructorDefinition): Ditto.
* bindings/scripts/IDLAttributes.txt: Removed ConstructorMayThrowLegacyException,
GetterMayThrowLegacyException, MayThrowLegacyException, and SetterMayThrowLegacyException.
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated exepected results.
* bindings/scripts/test/TestImplements.idl: Use non-legacy exceptions.
* bindings/scripts/test/TestInterface.idl: Ditto.
* bindings/scripts/test/TestNamedConstructor.idl: Ditto.
* bindings/scripts/test/TestObj.idl: Ditto.
* bindings/scripts/test/TestSupplemental.idl: Ditto.
* bindings/scripts/test/TestTypedefs.idl: Ditto.
* dom/ContainerNode.h: Removed include of ExceptionCodePlaceholder.h.
* editing/AlternativeTextController.cpp: Ditto.
* editing/AppendNodeCommand.cpp: Ditto.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Use specific create function
instead of Document::createElement.
* editing/DeleteFromTextNodeCommand.cpp: Removed include of
ExceptionCodePlaceholder.h.
* editing/Editor.cpp: Ditto.
* editing/EditorCommand.cpp: Ditto.
* editing/FormatBlockCommand.cpp: Ditto.
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem): Use specific create
function instead of Document::createElement.
* editing/InsertListCommand.cpp: Removed include of ExceptionCodePlaceholder.h.
* editing/InsertNodeBeforeCommand.cpp: Ditto.
* editing/RemoveNodeCommand.cpp: Ditto.
* editing/ReplaceSelectionCommand.cpp: Ditto.
* editing/TextIterator.cpp: Ditto.
* editing/WrapContentsInDummySpanCommand.cpp: Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart): Use specific create function instead
of Document::createElement.
* editing/htmlediting.cpp:
(WebCore::createTabSpanElement): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::readURL): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readURL): Ditto.
* editing/markup.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry): Use specific create function
instead of Document::createElement.
(WebCore::FTPDirectoryDocumentParser::createTDForFilename): Ditto.
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.
(WebCore::FTPDirectoryDocumentParser::createBasicDocument): Ditto.
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::create): Added overload that just takes a Document.
* html/HTMLEmbedElement.h: Updated for above.
* html/HTMLMediaElement.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::create): Added overload that just takes a Document.
* html/HTMLMetaElement.h: Updated for above.
* html/HTMLOutputElement.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/HTMLSelectElement.cpp: Ditto.
(WebCore::HTMLSelectElement::setLength): Use specific create function
instead of Document::createElement.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::create): Added overload that just takes a Document.
* html/HTMLSourceElement.h: Updated for above.
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::HTMLStyleElement): Moved data member initialization
to class definition.
(WebCore::HTMLStyleElement::create): Added overload that just takes a Document.
* html/HTMLStyleElement.h: Updated for above. Also made finishParsingChildren public.
* html/HTMLTableElement.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/HTMLTextAreaElement.cpp: Ditto.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::create): Added overload that just takes a Document.
* html/HTMLVideoElement.h: Updated for above.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure): Use specific create function
instead of Document::createElement.
* html/InputType.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure): Use specific create
function instead of Document::createElement.
(WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
* html/RangeInputType.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/RubyElement.cpp:
(WebCore::RubyElement::create): Added overload that just takes a Document.
* html/RubyElement.h: Updated for above.
* html/RubyTextElement.cpp:
(WebCore::RubyTextElement::create): Added overload that just takes a Document.
* html/RubyTextElement.h: Updated for above.
* html/ValidationMessage.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/canvas/CanvasRenderingContext2D.cpp: Ditto.
* html/shadow/MediaControlElementTypes.cpp: Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
Use specific create function instead of Document::createElement.
* html/shadow/MediaControls.cpp: Removed include of ExceptionCodePlaceholder.h.
* html/shadow/MediaControlsApple.cpp: Ditto.
* html/track/InbandDataTextTrack.cpp: Ditto.
* html/track/InbandGenericTextTrack.cpp: Ditto.
* html/track/InbandTextTrack.cpp: Ditto.
* html/track/VTTRegion.cpp: Ditto.
* html/track/WebVTTElement.cpp:
(WebCore::WebVTTElement::createEquivalentHTMLElement): Use specific create
function instead of Document::createElement.
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Ditto.
* page/ContextMenuController.cpp: Removed include of ExceptionCodePlaceholder.h.
* page/DOMWindow.cpp: Ditto.
* page/DragController.cpp: Ditto.
* page/EventHandler.cpp: Ditto.
* page/Page.cpp: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Ditto.
* platform/mac/PasteboardMac.mm: Ditto.
* platform/mac/WebVideoFullscreenHUDWindowController.mm: Ditto.
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Ditto.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp: Ditto.
* rendering/RenderNamedFlowThread.cpp: Ditto.
* rendering/RenderThemeEfl.cpp: Ditto.
* rendering/RenderThemeMac.mm: Ditto.
* rendering/style/SVGRenderStyle.h: Ditto.
* svg/SVGTRefElement.cpp: Ditto.
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::XMLErrors): Take a reference and initialize data member
in class definition.
(WebCore::createXHTMLParserErrorHeader): Take a reference, and mostly use
specific create functions instead of createElement.
(WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
* xml/XMLErrors.h: Updated for above.
* xml/XMLTreeViewer.cpp: Removed include of ExceptionCodePlaceholder.h.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::handleError): Pass a reference.
* xml/parser/XMLDocumentParserLibxml2.cpp: Removed include of
ExceptionCodePlaceholder.h.
2016-11-12 Dan Bernstein <mitz@apple.com>
Clean up a couple of macOS *SPI headers
https://bugs.webkit.org/show_bug.cgi?id=164687
Reviewed by Sam Weinig.
* platform/spi/cocoa/NSTouchBarSPI.h: Replaced hardcoded strings with global declarations.
* platform/spi/mac/NSSpellCheckerSPI.h: Addressed FIXME by importing private header, and removed declarations
that already appear in the SDK.
2016-11-12 Wenson Hsieh <wenson_hsieh@apple.com>
The main content heuristic should be robust when handling large media elements
https://bugs.webkit.org/show_bug.cgi?id=164676
<rdar://problem/29211503>
Reviewed by Eric Carlson.
Handles integer overflow gracefully when performing the main content check for very large media elements. If the
heuristic comes across such an element, it will now bail early and reject the video as main content. Also adds a
new API test: VideoControlsManager.VideoControlsManagerPageWithEnormousVideo.
* html/MediaElementSession.cpp:
(WebCore::isElementRectMostlyInMainFrame):
2016-11-12 Chris Dumez <cdumez@apple.com>
Speed up setting attributes of input elements of type 'text'
https://bugs.webkit.org/show_bug.cgi?id=164674
Reviewed by Ryosuke Niwa.
Speed up setting attributes of input elements of type 'text' by calling
updateInnerTextValue() only when needed. It was previously called
whenever an attribute was set, no matter it could impact its text value
or not.
No new tests, no Web-exposed behavior change.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
* html/InputType.cpp:
(WebCore::InputType::attributeChanged):
* html/InputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::attributeChanged):
* html/TextFieldInputType.h:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the 32-bit build.
* platform/mac/WebPlaybackControlsManager.mm:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the 32-bit build.
* platform/mac/WebPlaybackControlsManager.h:
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the build.
* platform/mac/WebPlaybackControlsManager.h: Declared conformance to
AVFunctionBarPlaybackControlsControlling, which is expected in WebKit::WebViewImpl.
Added ivar.
* platform/mac/WebPlaybackControlsManager.mm:
Synthesize seekToTime property needed for AVFunctionBarPlaybackControlsControlling
conformance.
(-[WebPlaybackControlsManager isSeeking]): Implement this
AVFunctionBarPlaybackControlsControlling method.
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Ditto.
2016-11-12 Dan Bernstein <mitz@apple.com>
Tried to fix the build.
* platform/spi/cocoa/NSTouchBarSPI.h: Removed duplicate @interface declarations.
2016-11-12 Frederic Wang <fwang@igalia.com>
Ensure MathML render tree are clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162824
Reviewed by Darin Adler.
clearNeedsLayout is not called during the layout of invalid MathML markup. We introduce a new
helper function to perform proper layout of such markup and we now call it from the various
MathML layoutBlock functions. Additionally, we ensure that the preferred width is dirty after
computation in RenderMathMLScripts::computePreferredLogicalWidths.
Test: mathml/invalid-markup.html
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutInvalidMarkup): Helper function to layout invalid markup.
* rendering/mathml/RenderMathMLBlock.h: Declare layoutInvalidMarkup.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock): Call layoutInvalidMarkup.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layoutBlock): Ditto.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Set the preferred width dirty
after computation to avoid that it is computed again and again.
(WebCore::RenderMathMLScripts::layoutBlock): Call layoutInvalidMarkup.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
2016-11-12 Frederic Wang <fwang@igalia.com>
Remove RenderMathMLOperator::shouldAllowStretching
https://bugs.webkit.org/show_bug.cgi?id=164313
Reviewed by Darin Adler.
RenderMathMLOperator::shouldAllowStretching is an old function from early implementations of
MathML. Its name is now confusing since it also includes non-stretchy large operators.
Moreover, it is not really useful and is actually only used by two functions: useMathOperator
and updateMathOperator. The former is almost equivalent and is used as a replacement of
shouldAllowStretching everywhere else. We rewrite the two remaining calls with the finer
test functions isStretchy() and isLargeOperatorInDisplayStyle().
No new tests, behavior unchanged.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::updateMathOperator): Reorder the conditionals to avoid the
use of RenderMathMLOperator::shouldAllowStretching and match useMathOperator.
(WebCore::RenderMathMLOperator::useMathOperator): Rewrite shouldAllowStretching() using
isStretchy() and isLargeOperatorInDisplayStyle().
(WebCore::RenderMathMLOperator::shouldAllowStretching): Deleted.
* rendering/mathml/RenderMathMLOperator.h: Remove declaration of shouldAllowStretching.
2016-11-12 Joseph Pecoraro <pecoraro@apple.com>
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164373
Reviewed by Darin Adler.
* Modules/*.h:
* crypto/*.h:
* cssjit/*.h:
* editing/*.h:
* fileapi/*.h:
* history/*.h:
* loader/*.h:
* mathml/*.h:
* page/*.h:
* replay/*.h:
* storage/*.h:
* xml/*.h:
* editing/FrameSelection.cpp:
* loader/ResourceLoadStatisticsStore.cpp:
Remove unused LOG and DEBUG defines.
2016-11-12 Wenson Hsieh <wenson_hsieh@apple.com>
Follow-up: fix the OpenSource build on Mac after r208642
https://bugs.webkit.org/show_bug.cgi?id=164677
Reviewed by Ryosuke Niwa.
The playbackControlsController property should also be `assign`.
* platform/spi/cocoa/AVKitSPI.h:
2016-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
SPI imports in AVKitSPI.h should be guarded by USE(APPLE_INTERNAL_SDK)
https://bugs.webkit.org/show_bug.cgi?id=164672
Reviewed by Dan Bernstein.
Fixes the OpenSource build when ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) is on.
* platform/spi/cocoa/AVKitSPI.h: Add USE(APPLE_INTERNAL_SDK) guards around AVKit function bar SPI headers.
Additionally, define AVFunctionBarPlaybackControlsProvider in the case where AVKit SPI is unavailable.
2016-11-11 Ryosuke Niwa <rniwa@webkit.org>
event.composedPath() does not include window
https://bugs.webkit.org/show_bug.cgi?id=164609
<rdar://problem/29210383>
Reviewed by Antti Koivisto.
Fixed the bug by including WindowContext be a part of the regular EventPath. This also simplifies
dispatchEventInDOM which used to had a special logic for dispatching an event on the window.
Also fixed a bug in EventDispatcher::dispatchEvent that event.target would be nullptr when an event was
dispatched inside a disconnected shadow tree or prevented from propagating to the document tree.
Preserve the final target by simply saving event.target() prior to invoking the default event handler instead.
Test: fast/shadow-dom/event-path-with-window.html
* dom/EventDispatcher.cpp:
(WebCore::WindowEventContext): Deleted. Moved to EventPath.cpp.
(WebCore::dispatchEventInDOM): Removed the code for WindowContext. The generic event dispatching logic
will do the same work now.
(WebCore::EventDispatcher::dispatchEvent): Restore the original target instead of using that of WindowContext.
* dom/EventPath.cpp:
(WebCore::WindowEventContext): Moved from EventDispatcher.cpp. Also made it a subclass of EventContext.
(WebCore::WindowEventContext::handleLocalEvents): Added.
(WebCore::EventPath::EventPath): When the parent's nullptr, check if the current node is Document. If it is,
follow https://dom.spec.whatwg.org/#interface-document where it says:
"A document’s get the parent algorithm, given an event, returns null if event’s type attribute value is 'load'
or document does not have a browsing context, and the document’s associated Window object otherwise."
(WebCore::EventPath::setRelatedTarget): Skip over WindowContext.
(WebCore::EventPath::retargetTouch): Ditto.
(WebCore::EventPath::computePathUnclosedToTarget): When the target is DOMWindow, use its document as the target.
Also, include any event target that is not a node in the event path.
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support all the correct blend modes
https://bugs.webkit.org/show_bug.cgi?id=164669
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-11-11 Alex Christensen <achristensen@webkit.org>
Use SecurityOriginData as keys in StorageManager
https://bugs.webkit.org/show_bug.cgi?id=159834
<rdar://problem/27346948>
Reviewed by Brady Eidson.
No change in behavior.
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
(WebCore::SecurityOriginData::isEmpty):
(WebCore::SecurityOriginData::isHashTableDeletedValue):
(WebCore::SecurityOriginDataHashTraits::isEmptyValue):
(WebCore::SecurityOriginDataHash::hash):
(WebCore::SecurityOriginDataHash::equal):
Add some hash functions so a SecurityOriginData can be used as a key in a HashMap.
2016-11-11 Ryosuke Niwa <rniwa@webkit.org>
Hovering over a slotted Text node clears hover state
https://bugs.webkit.org/show_bug.cgi?id=164002
<rdar://problem/29040471>
Reviewed by Simon Fraser.
The bug was caused by HitTestResult::innerElement returning the parent element of a Text node without
taking the shadow root or slots into account. For hit testing, we always want to use the "flat tree"
or "composed tree" (imprecisely but close enough in this case).
Fixed the bug by making HitTestResult::innerElement use parentNodeInComposedTree. Also renamed it to
HitTestResult::targetElement to be consistent with HitTestResult::targetNode.
Tests: fast/shadow-dom/activate-over-slotted-content.html
fast/shadow-dom/hover-over-slotted-content.html
* dom/Document.cpp:
(WebCore::Document::prepareMouseEvent):
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay):
* page/EventHandler.cpp:
(WebCore::EventHandler::eventMayStartDrag):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::hoverTimerFired):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::handleTouchEvent):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::targetElement): Renamed from innerElement.
Now finds the parent element in the composed tree.
* rendering/HitTestResult.h:
(WebCore::HitTestResult::innerNode):
2016-11-11 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r208628
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal): Cast pointer arithmetic to
uint32_t to avoid warning.
2016-11-11 Brent Fulgham <bfulgham@apple.com>
Neutered ArrayBuffers are not properly serialized
https://bugs.webkit.org/show_bug.cgi?id=164647
<rdar://problem/29213490>
Reviewed by David Kilzer.
Correct binding logic to handle ImageBuffers being deserialized from neutered ArrayBuffers.
Test: fast/canvas/neutered-imagedata.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
2016-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
https://bugs.webkit.org/show_bug.cgi?id=164538
<rdar://problem/8418711>
Reviewed by Ryosuke Niwa.
Adds autocorrect and autocapitalize getters and setters to HTMLElements. These check the `autocorrect` and
`autocapitalize` attributes and return whether or not the element supports autocorrect, and the
autocapitalization type, respectively. By default, autocorrection is enabled and autocapitalization is enabled
on the sentence level for elements. Also refactors/renames WebAutocapitalizeType so that in WebCore, we deal
solely with AutocapitalizeTypes and WebKit1 converts from AutocapitalizeType to WebAutocapitalizeType as needed
for UIKit.
Tests: fast/events/ios/contenteditable-autocapitalize.html
fast/events/ios/contenteditable-autocorrect.html
* WebCore.xcodeproj/project.pbxproj:
* html/Autocapitalize.cpp:
(WebCore::autocapitalizeTypeForAttributeValue):
(WebCore::stringForAutocapitalizeType):
* html/Autocapitalize.h:
* html/AutocapitalizeTypes.h: Renamed from Source/WebCore/html/WebAutocapitalize.h.
Move WebAutocapitalizeType into AutocapitalizeTypes.h as simply AutocapitalizeType.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::autocapitalize):
(WebCore::HTMLElement::autocapitalizeType):
(WebCore::HTMLElement::setAutocapitalize):
(WebCore::HTMLElement::shouldAutocorrect):
(WebCore::HTMLElement::setAutocorrect):
* html/HTMLElement.h:
(WebCore::HTMLElement::autocorrect):
* html/HTMLElement.idl:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::shouldAutocorrect):
(WebCore::HTMLFormControlElement::autocapitalizeType):
(WebCore::HTMLFormControlElement::autocorrect): Deleted.
(WebCore::HTMLFormControlElement::setAutocorrect): Deleted.
(WebCore::HTMLFormControlElement::autocapitalize): Deleted.
(WebCore::HTMLFormControlElement::setAutocapitalize): Deleted.
Fold autocorrect/autocapitalize member functions into HTMLElement and remove element-specific code in
HTML(FormControl|Form)Element.cpp.
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::shouldAutocorrect):
(WebCore::HTMLFormElement::autocorrect): Deleted.
(WebCore::HTMLFormElement::setAutocorrect): Deleted.
(WebCore::HTMLFormElement::autocapitalizeType): Deleted.
(WebCore::HTMLFormElement::autocapitalize): Deleted.
(WebCore::HTMLFormElement::setAutocapitalize): Deleted.
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLTextAreaElement.idl:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for paths as basic shapes.
https://bugs.webkit.org/show_bug.cgi?id=164661
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapePath):
(WebCore::consumeBasicShape):
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support margin-box in shape parsing.
https://bugs.webkit.org/show_bug.cgi?id=164658
Reviewed by Sam Weinig.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-mask-source-type
https://bugs.webkit.org/show_bug.cgi?id=164657
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitMaskSourceType):
(WebCore::consumeBackgroundComponent):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-11 Antti Koivisto <antti@apple.com>
Updating class name doesn't update the slotted content's style
https://bugs.webkit.org/show_bug.cgi?id=164577
<rdar://problem/29205873>
Reviewed by Ryosuke Niwa.
Test: fast/shadow-dom/css-scoping-slotted-invalidation.html
Teach style invalidation code for attribute/class/id mutations about slotted rules.
* dom/ShadowRoot.cpp:
(WebCore::assignedShadowRootsIfSlotted):
Helper to find all assigned shadow roots (there may be more than one if slots are assigned to slots).
* dom/ShadowRoot.h:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostStyle): Deleted.
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostStyle): Deleted.
* style/ClassChangeInvalidation.h:
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
(WebCore::Style::mayBeAffectedByHostStyle): Deleted.
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):
Fix a bug in style sharing where we were checking wrong element for host rules.
Tested by the included test too (the last empty div).
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the spring animation timing function
https://bugs.webkit.org/show_bug.cgi?id=164654
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSpringFunction):
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeAnimationValue):
2016-11-11 Chris Dumez <cdumez@apple.com>
WorkerGlobalScope's indexedDB property should be on the prototype, not the instance
https://bugs.webkit.org/show_bug.cgi?id=164644
Reviewed by Brady Eidson.
WorkerGlobalScope's indexedDB property should be on the prototype, not the instance
as per:
- https://heycam.github.io/webidl/#es-attributes
This is because WorkerGlobalScope is not marked as [Global] or [PrimaryGlobal] in
the IDL:
- https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
DedicatedWorkerGlobalScope is the one that is marked as [Global] and that should
have its attributes on the instance:
- https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
We were getting this mostly right, except for runtime-enabled attributes / operations
which would end up on the instance instead of the prototype. This patch adds support
for [PrimaryGlobal] / [Global] IDL extended attributes which determine the location
of properties. It also improves support for runtime-enabled properties so that they
can now be on either the instance or the prototype, exactly as if they were not
runtimed-enabled.
This gives us 100% pass rate on:
- http://w3c-test.org/IndexedDB/interfaces.worker.html
No new tests, updated existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(IsGlobalOrPrimaryGlobalInterface):
(InterfaceRequiresAttributesOnInstance):
(AttributeShouldBeOnInstance):
(OperationShouldBeOnInstance):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceName::finishCreation):
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObject::finishCreation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactions::finishCreation):
* bindings/scripts/test/JS/JSTestCEReactions.h:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifier::finishCreation):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::finishCreation):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::finishCreation):
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::finishCreation):
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::finishCreation):
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::finishCreation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterable::finishCreation):
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListener::finishCreation):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructor::finishCreation):
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::finishCreation):
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministic::finishCreation):
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::finishCreation):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructors::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequence::finishCreation):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltins::finishCreation):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerialization::finishCreation):
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::finishCreation):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::finishCreation):
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/TestGlobalObject.idl:
* page/DOMWindow.idl:
* workers/DedicatedWorkerGlobalScope.idl:
2016-11-11 Antti Koivisto <antti@apple.com>
Shadow DOM: Toggling class in `.class ::slotted(*)` does not trigger style recalc
https://bugs.webkit.org/show_bug.cgi?id=160864
Reviewed by Ryosuke Niwa.
Also fix similar issue with ::host
Test: fast/shadow-dom/css-scoping-host-and-slotted-context-invalidation.html
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
If we have ::slotted rules and encounter a <slot>, invalidate the slotted host children.
(WebCore::StyleInvalidationAnalysis::invalidateStyle):
Invalidate the shadow host if we have ::host rules.
* css/StyleInvalidationAnalysis.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
Fix a bug where it was possible to mutate stylesheets in the inline stylesheet cache.
The included test covers this.
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
Handle the full invalidation case.
2016-11-11 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
https://bugs.webkit.org/show_bug.cgi?id=164641
Reviewed by Alex Christensen.
No new tests (Covered by at least 3 existing tests).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::close):
(WebCore::IDBDatabase::maybeCloseInServer):
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::databaseConnectionPendingClose):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/ServerOpenDBRequest.cpp:
(WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
(WebCore::IDBServer::ServerOpenDBRequest::notifyRequestBlocked): Deleted.
* Modules/indexeddb/server/ServerOpenDBRequest.h:
(WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedBlocked): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::allConnectionsAreClosedOrClosing):
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionIsClosing):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::databaseConnectionPendingClose):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix time unit parsing
https://bugs.webkit.org/show_bug.cgi?id=164649
Reviewed by Dean Jackson.
Make sure that a unitless value gets changed to milliseconds properly.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeTime):
2016-11-11 Keith Rollin <krollin@apple.com>
Reduce number of platformMemoryUsage calls
https://bugs.webkit.org/show_bug.cgi?id=164375
Reviewed by Andreas Kling.
platformMemoryUsage was being called all the time while logging the
results of various memory-purging operations. This logging is
subordinate to the needs of performance and so can be removed.
Behavior is now as follows:
- If memory-pressure relief logging is enabled, logging includes
memory usage information. On Cocoa, this logging is disabled by
default but can be enabled by setting LogMemoryJetsamDetails in
`defaults`.
- Otherwise, if release-logging is enabled (as it is on Cocoa),
abbreviated memory pressure relief logging is performed: the logging
lines are printed but without any memory usage information.
- Otherwise, no logging is performed.
No new tests -- no tests for logging.
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
2016-11-11 Eric Carlson <eric.carlson@apple.com>
[MediaStream] defer resolution of getUserMedia promise made in a background tab
https://bugs.webkit.org/show_bug.cgi?id=164643
<rdar://problem/29048317>
Reviewed by Brady Eidson.
Test: fast/mediastream/get-user-media-background-tab.html
Do not start producing data when the document does not allow media
to start playing. Instead, register with the document for a callback
when playback is allowed and start then.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::mediaCanStart):
(WebCore::MediaStream::startProducingData):
(WebCore::MediaStream::stopProducingData):
(WebCore::MediaStream::pageMutedStateDidChange):
* Modules/mediastream/MediaStream.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::mediaCanStart): Deal with API change.
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaCanStart): Ditto.
* html/HTMLMediaElement.h:
* page/MediaCanStartListener.h:
* page/Page.cpp:
(WebCore::Page::takeAnyMediaCanStartListener): Return the listener and document.
(WebCore::Page::setCanStartMedia): Pass the document to the listener.
* page/Page.h:
2016-11-11 Zalan Bujtas <zalan@apple.com>
RenderFlowThread's containing block cache should be invalidated before calling styleDidChange.
https://bugs.webkit.org/show_bug.cgi?id=164646
Reviewed by Simon Fraser.
We have to invalidate the containing block cache for RenderFlowThreads soon after the containing block context
changes. Invalidating it in RenderBlock::styleDidChange is too late since we might run some code in some
of the subclasses that use this stale containing block cache.
No known behaviour change.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange): This change could trigger double invalidation.
However running this code twice shouldn't impact performance greatly.
(WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
(WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::setStyle): We don't need to call the invalidation from initializeStyle(), since
we don't yet have cache at that point.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitInlines):
2016-11-11 Darin Adler <darin@apple.com>
Move Node from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164515
Reviewed by Sam Weinig.
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter): Call remove instead of removeByIndex.
Was renamed now that there is no conflict.
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore): Use ExceptionOr.
(WebCore::JSNode::replaceChild): Ditto.
(WebCore::JSNode::removeChild): Ditto.
(WebCore::JSNode::appendChild): Ditto.
* dom/Attr.cpp:
(WebCore::Attr::Attr): Take a reference.
(WebCore::Attr::create): Ditto.
(WebCore::Attr::createTextChild): Use a Ref.
(WebCore::Attr::setPrefix): Use ExceptionOr.
(WebCore::Attr::setNodeValue): Ditto.
(WebCore::Attr::attachToElement): Take a reference.
* dom/Attr.h: Updated for above. Also made setPrefix private.
* dom/CharacterData.cpp:
(WebCore::CharacterData::setNodeValue): Use ExceptionOr.
* dom/CharacterData.h: Updated for the above.
* dom/ContainerNode.cpp:
(WebCore::collectChildrenAndRemoveFromOldParent): Use ExceptionOr.
(WebCore::checkAcceptChild): Ditto.
(WebCore::checkAcceptChildGuaranteedNodeTypes): Ditto.
(WebCore::ContainerNode::ensurePreInsertionValidity): Ditto.
(WebCore::checkPreReplacementValidity): Ditto.
(WebCore::ContainerNode::insertBefore): Ditto.
(WebCore::ContainerNode::replaceChild): Ditto.
(WebCore::ContainerNode::removeChild): Ditto.
(WebCore::ContainerNode::appendChild): Ditto.
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
(WebCore::ContainerNode::cloneChildNodes): Ditto.
(WebCore::ContainerNode::append): Ditto.
(WebCore::ContainerNode::prepend): Ditto.
* dom/ContainerNode.h: Updated for above changes.
* dom/Document.cpp:
(WebCore::Document::setTitle): Removed unneeded ASSERT_NO_EXCEPTION.
(WebCore::Document::setBodyOrFrameset): Removed unneeded ignored
exception code.
* dom/Element.cpp:
(WebCore::Element::setPrefix): Use ExceptionOr.
(WebCore::Element::setAttributeNode): Updated for changes to Attr.
(WebCore::Element::setAttributeNodeNS): Ditto.
(WebCore::Element::setOuterHTML): Use ExceptionOr.
(WebCore::Element::ensureAttr): Updated for changes to Attr.
(WebCore::Element::insertAdjacent): Use ExceptionOr.
* dom/Element.h: Updated for above.
* dom/Node.cpp:
(WebCore::Node::setNodeValue): Use ExceptionOr.
(WebCore::Node::insertBefore): Ditto.
(WebCore::Node::replaceChild): Ditto.
(WebCore::Node::removeChild): Ditto.
(WebCore::Node::appendChild): Ditto.
(WebCore::Node::convertNodesOrStringsIntoNode): Ditto.
(WebCore::Node::before): Ditto.
(WebCore::Node::after): Ditto.
(WebCore::Node::replaceWith): Ditto.
(WebCore::Node::remove): Ditto.
(WebCore::Node::cloneNodeForBindings): Ditto.
(WebCore::Node::setPrefix): Ditto.
(WebCore::Node::checkSetPrefix): Ditto.
(WebCore::Node::setTextContent): Ditto.
* dom/Node.h: Updated for above.
* dom/Node.idl: Use non-legacy exceptions.
* dom/Range.cpp:
(WebCore::Range::processContents): Use ExceptionOr.
(WebCore::processContentsBetweenOffsets): Ditto.
(WebCore::processNodes): Ditto.
(WebCore::processAncestorsAndTheirSiblings): Ditto.
(WebCore::Range::insertNode): Ditto.
(WebCore::Range::surroundContents): Ditto.
* dom/Text.cpp:
(WebCore::Text::splitText): Use ExceptionOr.
(WebCore::Text::replaceWholeText): Removed unneeded IGNORE_EXCEPTION.
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply): Removed unneeded IGNORE_EXCEPTION.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executeInsertNode): Use ExceptionOr.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply): Removed unneeded IGNORE_EXCEPTION.
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doApply): Ditto.
(WebCore::MergeIdenticalElementsCommand::doUnapply): Use ExceptionOr.
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doUnapply): Removed unneeded IGNORE_EXCEPTION.
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren): Removed unneeded
ASSERT_NO_EXCEPTION.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::removeNode): Ditto.
(WebCore::ReplacementFragment::insertNodeBefore): Ditto.
(WebCore::ReplacementFragment::insertFragmentForTestRendering): Ditto.
(WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment): Ditto.
(WebCore::ReplaceSelectionCommand::insertAsListItems): Ditto.
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::executeApply): Use ExceptionOr.
(WebCore::SplitElementCommand::doUnapply): Removed unneeded IGNORE_EXCEPTION.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Use ExceptionOr.
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::executeApply): Removed unneeded
IGNORE_EXCEPTION.
(WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart): Removed unneeded ASSERT_NO_EXCEPTION
and IGNORE_EXCEPTION.
* editing/htmlediting.cpp:
(WebCore::createTabSpanElement): Ditto.
* editing/markup.cpp:
(WebCore::fillContainerFromString): Ditto.
(WebCore::createFragmentFromText): Ditto.
(WebCore::removeElementFromFragmentPreservingChildren): Ditto.
(WebCore::replaceChildrenWithFragment): Use ExceptionOr.
(WebCore::replaceChildrenWithText): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::addFragment): Removed unneeded exception
ignoring code.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree): Removed unneeded
ASSERT_NO_EXCEPTION.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry): Removed unneeded
IGNORE_EXCEPTION.
(WebCore::FTPDirectoryDocumentParser::createTDForFilename): Ditto.
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate): Ditto.
(WebCore::FTPDirectoryDocumentParser::createBasicDocument): Ditto.
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree): Ditto.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setText): Removed unneeded ASSERT_NO_EXCEPTION.
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Ditto.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::textToFragment): Use ExceptionOr.
(WebCore::HTMLElement::setOuterText): Ditto.
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::HTMLKeygenElement): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaControls): Ditto.
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot): Ditto.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr.
(WebCore::HTMLOptionElement::setText): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::remove): Call remove, not removeByIndex,
since we were able to change the name.
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::setTextContentInternal): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didAddUserAgentShadowRoot): Ditto.
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText): Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add): Use ExceptionOr.
(WebCore::HTMLSelectElement::remove): Renamed from removeByIndex since
there is no conflict with remove any more.
(WebCore::HTMLSelectElement::setOption): Call remove.
* html/HTMLSelectElement.h: Updated for above.
* html/HTMLSelectElement.idl: Got rid of ImplementedAs=removeByIndex.
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::HTMLTableElement): Initialize data members in
class definition instead of here.
(WebCore::HTMLTableElement::caption): Simplified using childrenOfType.
(WebCore::HTMLTableElement::setCaption): Use ExceptionOr.
(WebCore::HTMLTableElement::setTHead): Ditto.
(WebCore::HTMLTableElement::setTFoot): Ditto.
(WebCore::HTMLTableElement::deleteTFoot): Removed unneeded ASSERT_NO_EXCEPTION
and IGNORE_EXCEPTION.
(WebCore::HTMLTableElement::createTBody): Ditto.
(WebCore::HTMLTableElement::deleteCaption): Ditto.
(WebCore::HTMLTableElement::insertRow): Use ExceptionOr.
* html/HTMLTableElement.h: Updated for above.
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr.
(WebCore::HTMLTableRowElement::deleteCell): Ditto.
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::insertRow): Ditto.
(WebCore::HTMLTableSectionElement::deleteRow): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
(WebCore::HTMLTextAreaElement::setDefaultValue): Ditto.
(WebCore::HTMLTextAreaElement::updatePlaceholderText): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto.
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText): Ditto.
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure): Ditto.
(WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree): Ditto.
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree): Ditto.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree): Ditto.
(WebCore::TextFieldInputType::updatePlaceholderText): Ditto.
(WebCore::TextFieldInputType::createContainer): Ditto.
(WebCore::TextFieldInputType::createAutoFillButton): Ditto.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer): Ditto.
(WebCore::ValidationMessage::buildBubbleTree): Ditto.
(WebCore::ValidationMessage::deleteBubbleTree): Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::createTextTrackDisplay): Ditto.
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::MediaControlsApple): Initialize data members
in class definition instead of here.
(WebCore::MediaControlsApple::tryCreateControls): Use ExceptionOr.
* html/shadow/MediaControlsApple.h: Updated for above.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree): Removed unneeded ASSERT_NO_EXCEPTION
and IGNORE_EXCEPTION.
(WebCore::VTTCue::getDisplayTree): Ditto.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::appendTextTrackCueBox): Ditto.
* inspector/DOMEditor.cpp: Use ExceptionOr in action classes.
(WebCore::DOMEditor::DOMEditor): Take a reference.
(WebCore::DOMEditor::insertBefore): Use ExceptionOr.
(WebCore::DOMEditor::removeChild): Ditto.
(WebCore::DOMEditor::setAttribute): Ditto.
(WebCore::DOMEditor::removeAttribute): Ditto.
(WebCore::DOMEditor::setOuterHTML): Ditto.
(WebCore::DOMEditor::replaceWholeText): Ditto.
(WebCore::DOMEditor::replaceChild): Ditto.
(WebCore::DOMEditor::setNodeValue): Ditto.
(WebCore::populateErrorString): Ditto.
* inspector/DOMEditor.h: Updated for above changes.
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument): Updated to use references,
to use ExceptionOr, and to use a struct without a constructor for Digest.
(WebCore::DOMPatchSupport::DOMPatchSupport): Ditto.
(WebCore::DOMPatchSupport::patchNode): Ditto.
(WebCore::DOMPatchSupport::innerPatchNode): Ditto.
(WebCore::DOMPatchSupport::diff): Ditto.
(WebCore::DOMPatchSupport::innerPatchChildren): Ditto.
(WebCore::DOMPatchSupport::createDigest): Ditto.
(WebCore::DOMPatchSupport::insertBeforeAndMarkAsUsed): Ditto.
(WebCore::DOMPatchSupport::removeChildAndMoveToNew): Ditto.
(WebCore::DOMPatchSupport::markNodeAsUsed): Ditto.
* inspector/DOMPatchSupport.h: Updated for above.
* inspector/InspectorCSSAgent.cpp: Use ExceptionOr in the action classes.
(WebCore::InspectorCSSAgent::getStyleSheetText): Use ExceptionOr.
(WebCore::InspectorCSSAgent::setStyleSheetText): Ditto.
(WebCore::InspectorCSSAgent::setStyleText): Ditto.
(WebCore::InspectorCSSAgent::setRuleSelector): Ditto.
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Ditto.
(WebCore::InspectorCSSAgent::addRule): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): Ditto.
(WebCore::InspectorDOMAgent::setAttributeValue): Ditto.
(WebCore::InspectorDOMAgent::setAttributesAsText): Ditto.
(WebCore::InspectorDOMAgent::removeAttribute): Ditto.
(WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
(WebCore::InspectorDOMAgent::setNodeValue): Ditto.
(WebCore::InspectorDOMAgent::undo): Ditto.
(WebCore::InspectorDOMAgent::redo): Ditto.
* inspector/InspectorHistory.cpp:
(WebCore::InspectorHistory::Action::Action): Moved to header.
(WebCore::InspectorHistory::Action::~Action): Ditto.
(WebCore::InspectorHistory::Action::toString): Ditto.
(WebCore::InspectorHistory::Action::isUndoableStateMark): Ditto.
(WebCore::InspectorHistory::Action::mergeId): Ditto.
(WebCore::InspectorHistory::Action::merge): Ditto.
(WebCore::InspectorHistory::InspectorHistory): Deleted.
(WebCore::InspectorHistory::~InspectorHistory): Deleted.
(WebCore::InspectorHistory::perform): Updated exception handling.
(WebCore::InspectorHistory::markUndoableState): Ditto.
(WebCore::InspectorHistory::undo): Ditto.
(WebCore::InspectorHistory::redo): Ditto.
* inspector/InspectorHistory.h: Updated for above.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setDocumentContent): Use reference.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::text): Use ExceptionOr and renamed from
getText since this now has a return value.
(WebCore::InspectorStyle::populateAllProperties): Updated for above.
(WebCore::InspectorStyle::setText): Use ExceptionOr.
(WebCore::InspectorStyleSheet::setText): Ditto.
(WebCore::InspectorStyleSheet::ruleSelector): Ditto.
(WebCore::InspectorStyleSheet::setRuleSelector): Ditto.
(WebCore::InspectorStyleSheet::addRule): Ditto.
(WebCore::InspectorStyleSheet::deleteRule): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForStyle): Ditto.
(WebCore::InspectorStyleSheet::setStyleText): Ditto.
(WebCore::InspectorStyleSheet::text): Use ExceptionOr and renamed.
(WebCore::InspectorStyleSheet::checkPageStyleSheet): Deleted.
Just wrote this code inline in each place this was called since it's
just a single null check.
(WebCore::InspectorStyleSheetForInlineStyle::text): Use ExceptionOr
and renamed.
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Ditto.
(WebCore::InspectorStyle::getText): Deleted.
* inspector/InspectorStyleSheet.h: Updated for above changes.
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData): Removed unneeded
ASSERT_NO_EXCEPTION and IGNORE_EXCEPTION.
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText): Ditto.
(WebCore::SVGTRefElement::detachTarget): Ditto.
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView): Ditto.
2016-11-10 Jiewen Tan <jiewen_tan@apple.com>
Rename CryptoKeyUsage to CryptoKeyUsageBitmap and CryptoKey::Usage to CryptoKeyUsage
https://bugs.webkit.org/show_bug.cgi?id=164624
<rdar://problem/29210140>
Reviewed by Brent Fulgham.
This patch allows IDLType CryptoKeyUsage to be shared among different IDLs, i.e. CryptoKey.idl,
SubtleCrypto.idl and JsonWebKey.idl such that it can simplify the customized binding codes.
Covered by existing tests.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoKeySerializationJWK.cpp:
* bindings/js/JSCryptoKeySerializationJWK.h:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::toCryptoKeyUsageBitmap):
(WebCore::cryptoKeyUsageBitmapFromJSValue):
(WebCore::toKeyData):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::cryptoKeyUsageFromString): Deleted.
(WebCore::cryptoKeyUsagesFromJSValue): Deleted.
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* crypto/CryptoAlgorithm.cpp:
* crypto/CryptoAlgorithm.h:
* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKey.idl:
* crypto/CryptoKeySerialization.h:
* crypto/CryptoKeyUsage.h:
* crypto/CryptoKeyUsage.idl: Added.
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
* crypto/JsonWebKey.h:
* crypto/JsonWebKey.idl:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyAES.cpp:
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeySerializationRaw.cpp:
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix basic shape parsing
https://bugs.webkit.org/show_bug.cgi?id=164645
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShape):
2016-11-11 Zalan Bujtas <zalan@apple.com>
RenderFlowThread::removeLineRegionInfo shouldn't call HashMap::contains before HashMap::remove
https://bugs.webkit.org/show_bug.cgi?id=164639
Reviewed by Simon Fraser.
Also instead of asserting that the incoming renderer is not nullptr, we could just pass a reference in.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants):
(WebCore::canComputeRegionRangeForBox):
(WebCore::RenderBlock::computeRegionRangeForBoxChild):
(WebCore::RenderBlock::estimateRegionRangeForBoxChild):
(WebCore::RenderBlock::updateRegionRangeForBoxChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasRegionRangeInFlowThread):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::removeFlowChildInfo):
(WebCore::RenderFlowThread::validateRegions):
(WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
(WebCore::RenderFlowThread::removeLineRegionInfo):
(WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
(WebCore::RenderFlowThread::setRegionRangeForBox):
(WebCore::RenderFlowThread::hasCachedRegionRangeForBox):
(WebCore::RenderFlowThread::computedRegionRangeForBox):
(WebCore::RenderFlowThread::checkLinesConsistency):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
* rendering/RenderNamedFlowFragment.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
(WebCore::RenderNamedFlowThread::removeFlowChildInfo):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::removeRenderBoxRegionInfo):
* rendering/RenderRegion.h:
2016-11-11 Megan Gardner <megan_gardner@apple.com>
[Cocoa] Support wide gamut for Drag Image UI
https://bugs.webkit.org/show_bug.cgi?id=164490
Reviewed by Tim Horton.
Fixed an error in the support define for wide gamut on Mac.
The testing infrastructure to test this does not exist, and will be landing in another patch.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::extendedSRGBColorSpaceRef):
2016-11-11 Beth Dakin <bdakin@apple.com>
Get touch bar code building for open source builds
https://bugs.webkit.org/show_bug.cgi?id=164610
Reviewed by Wenson Hsieh.
* config.h:
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix SVG markers and colors
https://bugs.webkit.org/show_bug.cgi?id=164640
Reviewed by Dean Jackson.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSVGColor):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
2016-11-10 Wenson Hsieh <wenson_hsieh@apple.com>
Composition state should be cleared when changing focus to a non-editable element
https://bugs.webkit.org/show_bug.cgi?id=164595
<rdar://problem/26412551>
Reviewed by Enrica Casucci.
When canceling or confirming a composition, always ensure that the composition node and composition underlines
being tracked are reset, even when there is no current selection. This prevents us from getting into a bad state
where focus has already changed from an element with a pending composition to a different element and the
composition is canceled, but the Editor still maintains its composition node.
Test: editing/input/focus-change-with-marked-text.html
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
2016-11-11 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-svg-shadow
https://bugs.webkit.org/show_bug.cgi?id=164637
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-11 Alejandro G. Castro <alex@igalia.com>
[WebRTC][OpenWebRTC] Implement device permissions handling solution for owr backend in the UI process
https://bugs.webkit.org/show_bug.cgi?id=164010
Reviewed by Philippe Normand.
Move the capture of the sources for the OWR backend to the
WebProcess. In the UI we continue checking if the user allows
access to the audio and video capture. When device handling is
added in the future we will need some persistent ID and API to
pass from the UI process to the Web process.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
Add the proper audio and video sources to allow the UI message to
be properly rendered. We are adding the specific devices, even
though the dialog just asks for general audio and video. There was
already a FIXME about improving this.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): We are
capturing the devices here when the allowed message arrived from
the UI process. We store the completion handler to use it later
when the aync owr API finishes capture devices process.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): We
now call the completion handler in this callback called when the
owr library finishes the capture of the devices. Now this happens
in the WebProcess for OWR port.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
Add an attribute to store the completion handler.
2016-11-11 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] ASSERTION FAILED: !m_gridIsDirty in WebCore::RenderGrid::gridRowCount
https://bugs.webkit.org/show_bug.cgi?id=163450
Reviewed by Darin Adler.
The issue is that in the test case a simplifiedLayout() is performed.
So in RenderGrid::layoutBlock() we early return and the grid is not populated,
so the m_gridIsDirty flag is not cleared when we try to check the size of the grid
in RenderGrid::layoutPositionedObject().
We should avoid to do a simplified layout if we have to layout
some positioned grid items and the grid is dirty.
The problem was not only the ASSERT, but the current behavior was wrong too.
As we didn't do a proper layout of the grid container, the positioned item
won't be placed on the expected position. Added tests verifying this.
Tests: fast/css-grid-layout/grid-positioned-item-dynamic-change.html
fast/css-grid-layout/grid-simplified-layout-positioned.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::canPerformSimplifiedLayout): Check if we can perform or not
a simplified layout.
(WebCore::RenderBlock::simplifiedLayout): Extract initial check
into canPerformSimplifiedLayout().
* rendering/RenderBlock.h: Add new header for canPerformSimplifiedLayout().
* rendering/RenderGrid.cpp: Implement our own version of canPerformSimplifiedLayout()
to verify that the grid is not dirty if we have to layout some positioned items.
(WebCore::RenderGrid::canPerformSimplifiedLayout):
* rendering/RenderGrid.h: Add canPerformSimplifiedLayout() header.
2016-11-11 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: media tracks control support
https://bugs.webkit.org/show_bug.cgi?id=164618
<rdar://problem/27989483>
Reviewed by Dean Jackson.
We introduce the TracksSupport class to only enable the media tracks button
in the media controls when text tracks and/or multiple audio tracks are available.
Tests: media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html
media/modern-media-controls/tracks-support/tracks-support-no-tracks.html
media/modern-media-controls/tracks-support/tracks-support-text-tracks.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/tracks-support.js: Added.
(TracksSupport):
(TracksSupport.prototype.destroy):
(TracksSupport.prototype.get control):
(TracksSupport.prototype.get mediaEvents):
(TracksSupport.prototype.buttonWasClicked):
(TracksSupport.prototype.syncControl):
* WebCore.xcodeproj/project.pbxproj:
2016-11-10 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] DOMJIT accessor attribute in IDL should say like DOMJIT=Getter
https://bugs.webkit.org/show_bug.cgi?id=164632
Reviewed by Sam Weinig.
Currently, DOMJIT patchpoint is only allowed for getter in attributes.
To make it explicit, we use IDL attribute DOMJIT=Getter instead of
DOMJIT.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/TestDOMJIT.idl:
* dom/Document.idl:
* dom/Node.idl:
2016-11-10 Sam Weinig <sam@webkit.org>
[SVG] Start moving special casing of SVG out of the bindings - SVGPreserveAspectRatio
https://bugs.webkit.org/show_bug.cgi?id=164622
Reviewed by Darin Adler.
Part 2 of moving special casing of SVG out of the bindings.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
* bindings/scripts/CodeGenerator.pm:
(GenerateCompileTimeCheckForEnumsIfNeeded):
* bindings/scripts/IDLAttributes.txt:
Allow specifying a different scope for the constants to be declared in.
This allows us to have only one copy of the constants in the implementation
of SVGAngle/SVGAngleValue and SVGPreserveAspectRatio/SVGPreserveAspectRatioValue.
* loader/FrameLoader.cpp:
* rendering/svg/RenderSVGImage.h:
Remove unnecessary #include.
* svg/SVGAngle.h:
Remove redundant enum declaration.
* svg/SVGAngle.idl:
Specify a ConstantsScope of SVGAngleValue.
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::updateImageViewport):
* svg/PatternAttributes.h:
(WebCore::PatternAttributes::preserveAspectRatio):
(WebCore::PatternAttributes::setPreserveAspectRatio):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
* svg/SVGAnimatedPreserveAspectRatio.h:
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createPreserveAspectRatio):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::preserveAspectRatio):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::parseAttribute):
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::viewBoxToViewTransform):
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::parseAttribute):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::preserveAspectRatioString):
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
(WebCore::SVGViewSpec::reset):
(WebCore::SVGViewSpec::parseViewSpec):
* svg/SVGViewSpec.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::computeIntrinsicDimensions):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
(WebCore::FEImage::createWithImage):
(WebCore::FEImage::createWithIRIReference):
* svg/graphics/filters/SVGFEImage.h:
Replace SVGPreserveAspectRatio usage with SVGPreserveAspectRatioValue.
* svg/SVGPreserveAspectRatio.cpp: Removed.
* svg/SVGPreserveAspectRatio.h: Replaced.
* svg/SVGPreserveAspectRatio.idl:
* svg/SVGPreserveAspectRatioValue.cpp: Copied from Source/WebCore/svg/SVGPreserveAspectRatio.cpp.
* svg/SVGPreserveAspectRatioValue.h: Copied from Source/WebCore/svg/SVGPreserveAspectRatio.h.
Rename SVGPreserveAspectRatio to SVGPreserveAspectRatioValue and add a new SVGPreserveAspectRatio
that acts as the binding object.
2016-11-10 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Document#body should have DOMJIT patchpoint
https://bugs.webkit.org/show_bug.cgi?id=164627
Reviewed by Darin Adler.
This patch implements document.body accessor. To implement it, we need,
1. DOM traversing ability from ASM.
2. Checking HTMLElement.
3. Checking HTMLElement's localName.
The above features are already implemented in CSSJIT.
We extract some of utilities from CSSJIT to share them with DOMJIT.
Test: js/dom/domjit-accessor-document-body.html
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
(WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
(WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted.
(WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted.
* dom/Document.idl:
* dom/Element.h:
* dom/QualifiedName.h:
* domjit/DOMJITAbstractHeapRepository.yaml:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchTestIsElementFlagOnNode):
(WebCore::DOMJIT::branchTestIsHTMLFlagOnNode):
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::DocumentBodyDOMJIT::checkDOM):
(WebCore::loadLocalName):
(WebCore::DocumentBodyDOMJIT::callDOMGetter):
2016-11-10 John Wilander <wilander@apple.com>
Remove unused parameter name to fix build error on iOS
https://bugs.webkit.org/show_bug.cgi?id=163468
No review.
No new tests.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Removed parameter name 'pasteboardURL' in unimplemented function.
2016-11-10 Chris Dumez <cdumez@apple.com>
Speed up HTMLInputElement validation
https://bugs.webkit.org/show_bug.cgi?id=164603
Reviewed by Ryosuke Niwa.
Speed up HTMLInputElement validation by doing 1 virtual function call
instead of 9 and calling HTMLInputElement::value() only once per
validation instead of 9 times. Calling value() is expensive because
of sanitization.
No new tests, no Web-exposed behavior change.
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fallbackValue):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::isValid):
* html/FormAssociatedElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isValidFormControlElement):
(WebCore::HTMLFormControlElement::updateValidity):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isValid):
(WebCore::HTMLInputElement::value):
* html/HTMLInputElement.h:
* html/TextFieldInputType.cpp:
(WebCore::limitLength):
* html/ValidityState.idl:
2016-11-10 John Wilander <wilander@apple.com>
Add link information to data transfer pasteboard for drag and drop links
https://bugs.webkit.org/show_bug.cgi?id=163468
<rdar://problem/20634630>
Reviewed by Brent Fulgham.
Test: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
This test ensures data transfers still work for types 'text' and 'url', i.e. that we don't
regress in-page use of the drag pasteboard.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Now adds trustworthy link information to the drag pasteboard.
* platform/Pasteboard.h:
New function declaration Pasteboard::writeTrustworthyWebURLsPboardType.
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Empty, i.e. not implemented.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Empty, i.e. not implemented.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Calls ASSERT_NOT_REACHED() to make sure we don't use this function before we have
decided on a trustrworthy URL pasteboard type on iOS. Currently not used since we
don't support drag & drop on iOS.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Writes the given URL to the WebURLsWithTitlesPboardType. This pasteboard type
serves as a trusted drop source.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
Empty, i.e. not implemented.
2016-11-10 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r207182): [iOS] Crash because of passing freed CFDictionaryRef to CG when decoding a sub-sampled large image
https://bugs.webkit.org/show_bug.cgi?id=164617
Reviewed by Tim Horton.
This covered by the test fast/images/image-subsampling.html but it should
run with --guard-malloc --repeat-each=10 to show the bug or to verify the
fix.
imageSourceOptions() returns a non static RetainPtr<CFDictionaryRef> if
the subsamplingLevel is not zero. Because we are assigning the raw pointer
to a local variable in ImageDecoder::createFrameImageAtIndex(), CFRelease()
is called for the CFDictionaryRef immediately after this assignment. This
causes its memory to be freed in this case even before calling CG.
This bug does not happen if the subsamplingLevel is zero because we cache
the returned value in a static NeverDestroyed<RetainPtr<CFDictionaryRef> in
imageSourceOptions(). This cache prevents the CFDictionaryRef from being
freed in ImageDecoder::createFrameImageAtIndex() no matter where CFRelease()
is called.
The fix is hold the returned value in a RetainPtr<CFDictionaryRef>. This
will ensure the CFDictionaryRef raw pointer is valid till the end of
ImageDecoder::createFrameImageAtIndex().
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Ensure the pointer is retained.
2016-11-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add transparency layer support
https://bugs.webkit.org/show_bug.cgi?id=164614
Reviewed by Dean Jackson.
Provide a stackable implementation of transparency layers so that
multiple layers with opacity draw propery.
Tested by fast/layers/opacity-stacking.html and others.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::platformContext): Remove unneeded assertion.
(WebCore::GraphicsContextPlatformPrivate::renderTarget): Return current context taking
into account the presence of transparency layers.
(WebCore::GraphicsContextPlatformPrivate::setAlpha): Added.
(WebCore::GraphicsContextPlatformPrivate::currentGlobalAlpha): Get current global
alpha for current layer.
(WebCore::GraphicsContext::colorWithGlobalAlpha): Compute proper color taking into
account the current layer.
(WebCore::drawWithShadowHelper): Helper function to share code.
(WebCore::GraphicsContext::drawWithShadow): Use new helper function.
(WebCore::GraphicsContextPlatformPrivate::beginTransparencyLayer): Added.
(WebCore::GraphicsContext::beginPlatformTransparencyLayer): Call new implementation.
(WebCore::GraphicsContextPlatformPrivate::endTransparencyLayer): Added.
(WebCore::GraphicsContext::endPlatformTransparencyLayer): Call new implementation.
(WebCore::GraphicsContext::clearRect): Clear to transparent color.
(WebCore::GraphicsContext::setPlatformAlpha): Pass new alpha on to any active
transparency layer.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::renderTarget): Deleted.
2016-11-10 Dean Jackson <dino@apple.com>
Add CSS Color Level 4 to features.
* features.json:
2016-11-10 Zalan Bujtas <zalan@apple.com>
Move update image calls to RenderElement::styleDidChange.
https://bugs.webkit.org/show_bug.cgi?id=164623
Reviewed by Simon Fraser.
There should be no dependency on the image update between ::styleWillChange and ::styleDidChange.
Covered by existing tests.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::initializeStyle):
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::styleDidChange):
2016-11-10 Joseph Pecoraro <pecoraro@apple.com>
After r207459 ASSERT in CachedResourceLoader under InspectorPageAgent::cachedResource
https://bugs.webkit.org/show_bug.cgi?id=164621
Reviewed by Youenn Fablet.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
CachedResourceLoader expects a sanitized URL.
2016-11-10 Brady Eidson <beidson@apple.com>
IndexedDB 2.0 Support the IDBDatabase.onclose event.
https://bugs.webkit.org/show_bug.cgi?id=164602
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost): Fire "onclose" after "onerror"
* Modules/indexeddb/IDBDatabase.idl:
2016-11-10 Ryosuke Niwa <rniwa@webkit.org>
Copied text would contain text inside CDATA sections and comments
https://bugs.webkit.org/show_bug.cgi?id=164578
<rdar://problem/19834542>
Reviewed by Darin Adler.
The bug was caused by HTMLConverter::_traverseNode always including the content of a Text node.
Since Comment and CDataSection nodes are also Text nodes, we need to exclude them.
In the long term, we should check the visibility of the text as done in MarkupAccumulator.
Test: editing/mac/attributed-string/comment-cdata-section.html
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_traverseNode):
2016-11-10 Eric Carlson <eric.carlson@apple.com>
[MediaStream] apply constraints passed to getUserMedia()
https://bugs.webkit.org/show_bug.cgi?id=164561
Reviewed by Youenn Fablet.
<rdar://problem/29191384>
No new tests, updated existing tests.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass constraints into createMediaStream instead of applying
them after the stream has been created.
* WebCore.xcodeproj/project.pbxproj: Remove MediaConstraintsMock.cpp/.h.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Remove a bogus assert.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Drive-by fix: a stream
that is receiving media data is as ready as it will ever be so it's readyState should be
at HAVE_ENOUGH_DATA.
Simplify CaptureDeviceManager by removing all code for constraint validation because some
constraints can't be validated without a live capture device. Ports that are able to resolve
constraints without creating a live source can do so in a derived capture device class.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::bestSourcesForTypeAndConstraints): Return a list of UIDs, not a list
of live sources, because that is all the caller will use. This will allows ports to avoid
source creation in some cases.
(CaptureDeviceManager::sourceWithUID): Add parameters for new source constraints and invalid
constraint.
(CaptureDeviceManager::verifyConstraintsForMediaType): Deleted.
(CaptureDeviceManager::bestDeviceForFacingMode): Deleted.
(facingModeFromString): Deleted.
(CaptureDeviceManager::sessionSupportsConstraint): Deleted.
(CaptureDeviceManager::isSupportedFrameRate): Deleted.
* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureDeviceManager::defaultCaptureSession): Deleted.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::FlattenedConstraint::find): New, make it possible to examine resolved constraints.
* platform/mediastream/MediaConstraints.h:
(WebCore::NumericConstraint::fitnessDistance): Reject invalid constraints.
(WebCore::NumericConstraint::valueForCapabilityRange): New, resolve a constraint for a
capability range.
(WebCore::MediaTrackConstraintSetMap::width): Expose constraints held in the map.
(WebCore::MediaTrackConstraintSetMap::height):
(WebCore::MediaTrackConstraintSetMap::sampleRate):
(WebCore::MediaTrackConstraintSetMap::sampleSize):
(WebCore::MediaTrackConstraintSetMap::aspectRatio):
(WebCore::MediaTrackConstraintSetMap::frameRate):
(WebCore::MediaTrackConstraintSetMap::volume):
(WebCore::MediaTrackConstraintSetMap::echoCancellation):
(WebCore::MediaTrackConstraintSetMap::facingMode):
(WebCore::MediaTrackConstraintSetMap::deviceId):
(WebCore::MediaTrackConstraintSetMap::groupId):
Resolve and apply width, height, and frameRate all at once because the ability to support
one may depend on the value of another.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
(WebCore::applyNumericConstraint): Move the guts of the logic into valueForCapabilityRange.
(WebCore::RealtimeMediaSource::applySizeAndFrameRate):
(WebCore::RealtimeMediaSource::selectSettings):
(WebCore::RealtimeMediaSource::supportsConstraints):
(WebCore::RealtimeMediaSource::applyConstraints): Support null success/failure lambdas.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::create): Add parameter for creation constraints.
(WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Ditto.
Remove all constraint validation code, it is done by the audio and video capture sources. Add
support for stream creation constraints.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::captureDeviceList):
(WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
(WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Deleted.
(WebCore::AVCaptureDeviceManager::sourceWithUID): Deleted.
(WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Deleted.
(WebCore::AVCaptureDeviceManager::defaultCaptureSession): Deleted.
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Deleted.
(WebCore::AVCaptureDeviceManager::isSupportedFrameRate): Deleted.
(WebCore::AVCaptureDeviceManager::supportedConstraints): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaCaptureSource::constraints): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::~AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::startProducingData):
(WebCore::AVMediaCaptureSource::stopProducingData):
(WebCore::AVMediaCaptureSource::beginConfiguration):
(WebCore::AVMediaCaptureSource::commitConfiguration):
(WebCore::AVMediaCaptureSource::capabilities):
(WebCore::AVMediaCaptureSource::setupSession):
(WebCore::AVMediaCaptureSource::reset):
Validate and apply constraints, support source creation constraints, initialize capabilities
and supported constraints by examining device capabilities.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::updateSizeMinMax):
(WebCore::updateAspectRatioMinMax):
(WebCore::AVVideoCaptureSource::initializeCapabilities):
(WebCore::AVVideoCaptureSource::initializeSupportedConstraints):
(WebCore::AVVideoCaptureSource::applySize):
(WebCore::AVVideoCaptureSource::setPreset):
(WebCore::AVVideoCaptureSource::applyFrameRate):
(WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::currentFrameCGImage):
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Apply creation constraints, return null if they
can not be applied successfully.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
(WebCore::MockRealtimeVideoSource::createMuted):
Update RealtimeMediaSourceCenters for API changes.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream):
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
Mock media sources support constraint validation and application directly so "mock constraints"
are no longer necessary.
* platform/mock/MediaConstraintsMock.cpp: Removed.
* platform/mock/MediaConstraintsMock.h: Removed.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSource::createMuted):
(WebCore::MockRealtimeAudioSource::updateSettings):
(WebCore::MockRealtimeAudioSource::initializeCapabilities):
(WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSource::createMuted):
* platform/mock/MockRealtimeVideoSource.h:
* platform/mock/RTCPeerConnectionHandlerMock.cpp:
2016-11-10 Alex Christensen <achristensen@webkit.org>
Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164573
Reviewed by Brady Eidson.
No change in behavior.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasEntryForOriginNoLock):
(WebCore::DatabaseTracker::hasEntryForDatabase):
(WebCore::DatabaseTracker::originPath):
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
(WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::deleteOriginLockFor):
(WebCore::DatabaseTracker::quotaForOriginNoLock):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::addDatabase):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
* Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::getDatabaseIdentifier):
* dom/Document.cpp:
(WebCore::Document::origin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::databaseIdentifier): Deleted.
* page/SecurityOrigin.h:
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::databaseIdentifier):
* page/SecurityOriginData.h:
2016-11-10 Zalan Bujtas <zalan@apple.com>
RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants should be on RenderBlock.
https://bugs.webkit.org/show_bug.cgi?id=164601
Reviewed by Simon Fraser.
FlowThread containing blocks are cached at RenderBlocks. It makes no sense to call the invalidate function on a RenderElement.
Move invalidateFlowThreadContainingBlockIncludingDescendants to RenderBlock.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::invalidateFlowThreadContainingBlockIncludingDescendants):
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::splitInlines):
2016-11-10 Brent Fulgham <bfulgham@apple.com>
Local file restrictions should not block sessionStorage access.
https://bugs.webkit.org/show_bug.cgi?id=155609
<rdar://problem/25229461>
Reviewed by Andy Estes.
Re-landing this fix that was lost when the localStorage change was rolled out.
Use of 'sessionStorage' is governed by SecurityOrigin with third party access
set to 'ShouldAllowFromThirdParty::AlwaysAllowFromThirdParty'. We should not
reject local files for this combination of arguments.
Tested by storage/domstorage/sessionstorage/blocked-file-access.html.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccessStorage): For the case of sessionStorage,
allow local file access.
2016-11-10 Daniel Bates <dabates@apple.com>
REGRESSION (r195004): Scripts and plugins blocked for subsequent loads in same WebContent
process after receiving HTTP 0.9 response
https://bugs.webkit.org/show_bug.cgi?id=164387
<rdar://problem/28987537>
Reviewed by Brent Fulgham.
Fixes an issue where the HTTP 0.9 sandbox persisted across subsequent loads in the same
WebContent process.
Currently when an HTTP 0.9 response is received for a request made to a default port
(e.g. 80) we apply a sandbox policy on the FrameLoader for the main resource that
disallows scripts and plugins. A FrameLoader may be re-used for navigations. Therefore,
the sandbox policy applied to one site may be applied to another site. Moreover the
sandbox policy was applied to the FrameLoader of the main resource regardless of whether
the HTTP response was for a subresource. Instead we should apply the sandbox on a per-
Document basis and only if we receive an HTTP 0.9 response for the document when the
corresponding HTTP request was made to a default port.
As a side benefit of this change, we emit exactly one console message to Web Inspector
when the HTTP 0.9 sandbox is applied to a document as opposed to three console messages.
Moreover, we only emit this console message when the document load is not blocked.
Test: http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Disallow scripts and plugins if an HTTP 0.9
response was received for this document. Note that if this function is called for a
document associated with an HTTP 0.9 response then the corresponding HTTP request was
made to a default port. DocumentLoader::responseReceived() blocks the load for a document
with an HTTP 0.9 response corresponding to an HTTP request made to a non-default port.
This invariant is covered by the tests LayoutTests/http/tests/security/http-0.9/default-port-{plugin, script}-blocked.html.
(WebCore::Document::shouldEnforceHTTP0_9Sandbox): Added. Returns whether an HTTP 0.9 response
was received for this document.
* dom/Document.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Remove logic to apply sandbox policy to the
FrameLoader associated with the main resource. We will apply the sandbox during initialization
of the document.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse): Ditto.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Ditto.
2016-11-04 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::importKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164446
<rdar://problem/29123621>
Reviewed by Brent Fulgham.
This patch does following few things:
1. It updates the SubtleCrypto::importKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey.
It also refers to the latest Editor's Draft at a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey.
2. It implements importKey operations of following algorithms: AES-CBC, AES-KW,
HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It fixes some minor problems of SubtleCrypto::generateKey.
4. It addes move constructors for CryptoKeyAES, CryptoKeyHMAC, CryptoKeyRSA and
CryptoKeyDataRSAComponents.
5. It renames HmacKeyGenParams to HmacKeyParams to serve the purpose of both
HmacKeyGenParams and HmacImportParams which are essentially the same.
6. It enforces the key length in bits of CryptoKeyHMAC to be multiples of 8.
7. It also fixes the following bugs:
https://bugs.webkit.org/show_bug.cgi?id=126033,
https://bugs.webkit.org/show_bug.cgi?id=126034,
https://bugs.webkit.org/show_bug.cgi?id=151308.
P.S. We currently only support Raw and Jwk key format.
Tests: crypto/subtle/aes-cbc-import-jwk-key-length-128.html
crypto/subtle/aes-cbc-import-jwk-key-length-192.html
crypto/subtle/aes-cbc-import-jwk-key-length-256.html
crypto/subtle/aes-cbc-import-jwk-key-minimum.html
crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html
crypto/subtle/aes-cbc-import-raw-key-length-128.html
crypto/subtle/aes-cbc-import-raw-key-length-192.html
crypto/subtle/aes-cbc-import-raw-key-length-256.html
crypto/subtle/aes-import-key-malformed-parameters.html
crypto/subtle/aes-kw-import-jwk-key-length-128.html
crypto/subtle/aes-kw-import-jwk-key-length-192.html
crypto/subtle/aes-kw-import-jwk-key-length-256.html
crypto/subtle/aes-kw-import-raw-key.html
crypto/subtle/generate-key-malformed-parameters.html
crypto/subtle/hmac-import-jwk-key-minimum.html
crypto/subtle/hmac-import-jwk-key-non-extractable.html
crypto/subtle/hmac-import-jwk-key-sha1.html
crypto/subtle/hmac-import-jwk-key-sha224.html
crypto/subtle/hmac-import-jwk-key-sha256.html
crypto/subtle/hmac-import-jwk-key-sha384.html
crypto/subtle/hmac-import-jwk-key-sha512.html
crypto/subtle/hmac-import-malformed-parameters.html
crypto/subtle/hmac-import-raw-key-customized-length.html
crypto/subtle/hmac-import-raw-key.html
crypto/subtle/import-key-malformed-parameters.html
crypto/subtle/rsa-import-key-malformed-parameters.html
crypto/subtle/rsa-oaep-import-jwk-private-key.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html
crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html
crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html
crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html
crypto/workers/subtle/aes-import-jwk-key.html
crypto/workers/subtle/aes-import-raw-key.html
crypto/workers/subtle/hmac-import-jwk-key.html
crypto/workers/subtle/hmac-import-raw-key.html
crypto/workers/subtle/rsa-import-jwk-private-key.html
crypto/workers/subtle/rsa-import-jwk-public-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::cryptoKeyUsageFromString):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::toKeyData):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::JSSubtleCrypto::importKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::importKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/JsonWebKey.h: Added.
* crypto/JsonWebKey.idl: Added.
* crypto/RsaOtherPrimesInfo.h: Added.
* crypto/RsaOtherPrimesInfo.idl: Added.
* crypto/SubtleCrypto.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::CryptoKeyAES):
(WebCore::CryptoKeyAES::generate):
(WebCore::CryptoKeyAES::importRaw):
(WebCore::CryptoKeyAES::importJwk):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyDataRSAComponents.cpp:
(WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
* crypto/keys/CryptoKeyDataRSAComponents.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::CryptoKeyHMAC):
(WebCore::CryptoKeyHMAC::generate):
(WebCore::CryptoKeyHMAC::importRaw):
(WebCore::CryptoKeyHMAC::importJwk):
(WebCore::CryptoKeyHMAC::buildAlgorithm):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp: Added.
(WebCore::CryptoKeyRSA::importJwk):
* crypto/keys/CryptoKeyRSA.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: Added.
* crypto/parameters/HmacKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/HmacKeyGenParams.idl.
* crypto/parameters/RsaHashedImportParams.idl: Added.
2016-11-10 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: REGRESSION(r208467) Fix flaky crashes in IDB GC-related code.
https://bugs.webkit.org/show_bug.cgi?id=164596
Reviewed by Eric Carlson.
No new tests (Covered by existing tests).
We can't just WTFMove the pointers from the deleted-IDBObject maps...
We need to remove the entries, too.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
2016-11-10 Youenn Fablet <youennf@gmail.com>
MediaStreamTrack should use more Ref<> and less RefPtr<>
https://bugs.webkit.org/show_bug.cgi?id=164560
Reviewed by Eric Carlson.
No change of behavior.
Make MediaStreamTrack take a Ref<>& instead of a reference.
Using Ref<>&& instead of RefPtr<>&& in MediaStreamTrackPrivate.
Updating constness of some methods accordingly.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createReceiver):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::create):
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::clone):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::capabilities):
(WebCore::MediaStreamAudioSource::settings):
* Modules/webaudio/MediaStreamAudioSource.h:
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::create):
(WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
(WebCore::MediaStreamTrackPrivate::clone):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::setMuted):
(WebCore::MediaStreamTrackPrivate::source):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::initializeSettings):
(WebCore::AVMediaCaptureSource::settings):
(WebCore::AVMediaCaptureSource::initializeCapabilities):
(WebCore::AVMediaCaptureSource::capabilities):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::capabilities):
(WebCore::RealtimeMediaSourceOwr::settings):
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::initializeCapabilities):
(WebCore::MockRealtimeMediaSource::capabilities):
(WebCore::MockRealtimeMediaSource::initializeSettings):
(WebCore::MockRealtimeMediaSource::settings):
* platform/mock/MockRealtimeMediaSource.h:
2016-11-10 Per Arne Vollan <pvollan@apple.com>
[Win32] Crash in layout tests.
https://bugs.webkit.org/show_bug.cgi?id=164411
Reviewed by Mark Lam.
Use the calling convention expected by the callers of the generated functions.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
2016-11-10 Aaron Chu <aaron_chu@apple.com>
Web Inspector: AXI: clarify button roles (e.g. toggle or popup button)
https://bugs.webkit.org/show_bug.cgi?id=130726
<rdar://problem/16420420>
Reviewed by Brian Burg.
Test: accessibility/ax-differentiate-button-types.html
Added special case logic to make sure PopUpButtonRole and ToggleButtonRole to user ButtonRole as role.
Added an "isPopUpButton" property to be exposed to the Inspector's use.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::computedRoleString):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-11-10 Zan Dobersek <zdobersek@igalia.com>
[EME] Add no-op Web-facing APIs
https://bugs.webkit.org/show_bug.cgi?id=164028
Reviewed by Jer Noble.
Add no-op implementation of the Web-facing APIs as defined in
the EME specification. This will be the basis for implementing
the various algorithms the same specification defines, and for
implementing the relevant platform abstractions.
Dictionaries and enumerations defined by the specification are
defined in separate headers, and not in the implementation files
for the class where they are used. This will ease their use
across different implementation files.
BufferSource now exposes the Variant object it holds. This is
needed to support the iterable property on the MediaKeyStatusMap
class.
CodeGeneratorJS is fixed to support JS-to-native conversion of
sequences of dictionaries.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/MediaKeyMessageEvent.cpp: Added.
(WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
(WebCore::MediaKeyMessageEvent::eventInterface):
* Modules/encryptedmedia/MediaKeyMessageEvent.h: Added.
* Modules/encryptedmedia/MediaKeyMessageEvent.idl: Added.
* Modules/encryptedmedia/MediaKeyMessageEventInit.h: Added.
(WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit):
* Modules/encryptedmedia/MediaKeyMessageType.h: Added.
* Modules/encryptedmedia/MediaKeySession.cpp: Added.
(WebCore::MediaKeySession::create):
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::sessionId):
(WebCore::MediaKeySession::expiration):
(WebCore::MediaKeySession::keyStatuses):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::hasPendingActivity):
(WebCore::MediaKeySession::activeDOMObjectName):
(WebCore::MediaKeySession::canSuspendForDocumentSuspension):
(WebCore::MediaKeySession::stop):
* Modules/encryptedmedia/MediaKeySession.h: Added.
* Modules/encryptedmedia/MediaKeySession.idl: Added.
* Modules/encryptedmedia/MediaKeySessionType.h: Added.
* Modules/encryptedmedia/MediaKeyStatus.h: Added.
* Modules/encryptedmedia/MediaKeyStatusMap.cpp: Added.
(WebCore::MediaKeyStatusMap::size):
(WebCore::MediaKeyStatusMap::has):
(WebCore::MediaKeyStatusMap::get):
(WebCore::MediaKeyStatusMap::Iterator::Iterator):
(WebCore::MediaKeyStatusMap::Iterator::next):
* Modules/encryptedmedia/MediaKeyStatusMap.h: Added.
(WebCore::MediaKeyStatusMap::create):
(WebCore::MediaKeyStatusMap::createIterator):
* Modules/encryptedmedia/MediaKeyStatusMap.idl: Added.
* Modules/encryptedmedia/MediaKeySystemAccess.cpp: Added.
(WebCore::MediaKeySystemAccess::keySystem):
(WebCore::MediaKeySystemAccess::getConfiguration):
(WebCore::MediaKeySystemAccess::createMediaKeys):
* Modules/encryptedmedia/MediaKeySystemAccess.h: Added.
(WebCore::MediaKeySystemAccess::create):
* Modules/encryptedmedia/MediaKeySystemAccess.idl: Added.
* Modules/encryptedmedia/MediaKeySystemConfiguration.h: Added.
* Modules/encryptedmedia/MediaKeySystemConfiguration.idl: Added.
* Modules/encryptedmedia/MediaKeySystemMediaCapability.h: Added.
* Modules/encryptedmedia/MediaKeySystemMediaCapability.idl: Added.
* Modules/encryptedmedia/MediaKeys.cpp: Added.
(WebCore::MediaKeys::createSession):
(WebCore::MediaKeys::setServerCertificate):
* Modules/encryptedmedia/MediaKeys.h: Added.
(WebCore::MediaKeys::create):
* Modules/encryptedmedia/MediaKeys.idl: Added.
* Modules/encryptedmedia/MediaKeysRequirement.h: Added.
* Modules/encryptedmedia/NavigatorEME.cpp: Added.
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
* Modules/encryptedmedia/NavigatorEME.h: Added.
* Modules/encryptedmedia/NavigatorEME.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
(WebCore::BufferSource::variant):
* bindings/js/JSMediaKeySessionCustom.cpp: Added.
(WebCore::JSMediaKeySession::closed):
* bindings/js/JSMediaKeySystemAccessCustom.cpp: Added.
(WebCore::JSMediaKeySystemAccess::getConfiguration):
* bindings/scripts/CodeGeneratorJS.pm:
(GetNativeVectorInnerType):
* dom/EventNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaKeys):
(WebCore::HTMLMediaElement::setMediaKeys):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaEncryptedEvent.cpp: Added.
(WebCore::MediaEncryptedEvent::MediaEncryptedEvent):
(WebCore::MediaEncryptedEvent::eventInterface):
(WebCore::MediaEncryptedEvent::initDataType):
(WebCore::MediaEncryptedEvent::initData):
* html/MediaEncryptedEvent.h: Added.
* html/MediaEncryptedEvent.idl: Added.
* html/MediaEncryptedEventInit.h: Added.
(WebCore::MediaEncryptedEventInit::MediaEncryptedEventInit):
2016-11-10 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: update controls based on fullscreen playback on macOS
https://bugs.webkit.org/show_bug.cgi?id=164554
<rdar://problem/29183439>
Reviewed by Dean Jackson.
When toggling fullscreen on macOS, toggle between MacOSInlineMediaControls and MacOSFullscreenMediaControls.
To facilitate this, support objects are created and destroyed when changing the controls in order for the
right control objects to be hooked up to the media controller. A new destroy() method on MediaControllerSupport
subclasses can be overridden to remove event listeners added by support objects in their constructor.
Test: media/modern-media-controls/media-controller/media-controller-fullscreen-change.html
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.destroy):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.destroy):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._controlsClass):
2016-11-10 Carlos Garcia Campos <cgarcia@igalia.com>
[Linux] Memory values shown by memory pressure handler logger are not useful
https://bugs.webkit.org/show_bug.cgi?id=164589
Reviewed by Michael Catanzaro.
We are currently using the VmSize field from /proc/self/status which is the virtual memory size of the process
and doesn't normally change even when the memory pressure handler manages to release memory. So, most of the
time we see that there's no changes in memory usage in the logs.
We should use the actual memory used by the process, memory that the process can release and then it's relevant
for the memory pressure handler. Using other fields from /proc/self/status we could do something like VmRSS -
(RssFile + RssShme), but there's also /proc/self/statm that provides the same information in a single. The main
different is that statm provides both resident and shared memory directly, but in number of pages, so we need to
multiply by the size of the page.
This patch adds a method to parse /proc/self/statm in its given file, because I plan to use this for the linux
memory sampler that is incorrectly parsing /proc/self/statm.
* platform/Linux.cmake: Add new files to compilation.
* platform/linux/CurrentProcessMemoryStatus.cpp: Added.
(WebCore::systemPageSize): Return the page size.
(WebCore::currentProcessMemoryStatus): Parse /proc/self/statm and fill the given ProcessMemoryStatus.
* platform/linux/CurrentProcessMemoryStatus.h: Added.
* platform/linux/MemoryPressureHandlerLinux.cpp:
(WebCore::MemoryPressureHandler::processMemoryUsage(): Helper function to return the memory used by the process
in bytes.
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Use processMemoryUsage().
2016-10-14 Carlos Garcia Campos <cgarcia@igalia.com>
MemoryPressureHandler shouldn't know how to release WebCore memory
https://bugs.webkit.org/show_bug.cgi?id=160497
Reviewed by Michael Catanzaro.
All processes should set their own low memory handler, instead of leaving the web process using the default one
that needs to access APIs that are not in platform layer. This patch fixes all the layering violations in the
MemoryPressureHandler. Since the default implementation, that releases the WebCore memory, is shared by the
WebProcess in WebKit2 and WebKit1 ports, it has been moved to its own file to the WebCore layer.
* CMakeLists.txt: Add new files to compilation.
* PlatformMac.cmake: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Use WebCore::jettisonExpensiveObjectsOnTopLevelNavigation().
* page/MemoryRelease.cpp: Added.
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
(WebCore::platformReleaseMemory):
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
(WebCore::registerMemoryReleaseNotifyCallbacks):
* page/MemoryRelease.h: Added.
* page/cocoa/MemoryReleaseCocoa.mm: Added.
(WebCore::platformReleaseMemory):
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
(WebCore::registerMemoryReleaseNotifyCallbacks):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::MemoryPressureHandler):
(WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
(WebCore::MemoryPressureHandler::releaseMemory): Use the current handler if it has been set.
(WebCore::MemoryPressureHandler::platformReleaseMemory): Deleted.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setLowMemoryHandler):
(WebCore::MemoryPressureHandler::m_releaseMemoryBlock):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure): Call releaseMemory() instead of using the handler directly.
(WebCore::MemoryPressureHandler::platformReleaseMemory): Deleted.
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::MemoryPressureHandler::respondToMemoryPressure): Call releaseMemory() instead of using the handler directly.
2016-11-08 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Fix fr tracks sizing under min|max-size constraints
https://bugs.webkit.org/show_bug.cgi?id=150674
Reviewed by Darin Adler.
The min|max-sizes must be used to compute the flex fraction for indefinite free
spaces. According to the spec "If using this flex fraction would cause the grid to be
smaller than the grid container’s min-width/height (or larger than the grid container’s
max-width/height), then redo this step, treating the free space as definite and the
available grid space as equal to the grid container’s content box size when it’s sized to
its min-width/height (max-width/height)."
This only affects indefinite heights because during layout both definite sizes and any kind
of widths are properly constrained by min|max-width restrictions.
Tests: fast/css-grid-layout/flex-sizing-columns-min-max-width.html
fast/css-grid-layout/flex-sizing-rows-min-max-height.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::computeFlexSizedTracksGrowth):
* rendering/RenderGrid.h:
2016-11-10 Alejandro G. Castro <alex@igalia.com>
[WebRTC] [OpenWebRTC] RTX default parameters broken after r207952
https://bugs.webkit.org/show_bug.cgi?id=164541
Reviewed by Philippe Normand.
Fixed typo in refactoring.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
2016-11-08 Philippe Normand <pnormand@igalia.com>
[WebRTC] white-list turns urls from the RTCConfiguration
https://bugs.webkit.org/show_bug.cgi?id=164506
Reviewed by Alejandro G. Castro.
* Modules/mediastream/RTCConfiguration.cpp:
(WebCore::validateIceServerURL): Add the turns URL scheme to the
list of supported relay and signaling server protocols.
2016-11-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness
https://bugs.webkit.org/show_bug.cgi?id=161951
<rdar://problem/28295767>
Reviewed by Brian Burg.
Covered by existing tests that would ASSERT otherwise.
* inspector/InspectorClient.cpp:
(WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
When paused on an exception in the inspected page and evaluating
commands in the inspector frontend page (which evaluates JavaScript)
we ASSERT when entering the Global DOM VM with an existing exception.
This makes it so when we evaluate JavaScript in the frontend we
suspend / ignore the state of the VM for the inspected page, and
restore it when we return from the inspector.
2016-11-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Associate Worker Resources with the Worker and not the Page
https://bugs.webkit.org/show_bug.cgi?id=164342
<rdar://problem/29075775>
Reviewed by Timothy Hatcher.
Test: inspector/worker/resources-in-worker.html
Provide a way to associate an initiator identifier with a ResourceRequest.
This will allow Web Inspector to identify who started particular resource
loads. This is important to associate Worker(...), importScript(...), and
XMLHttpRequest / Fetch loads with that specific Worker.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::initiatorIdentifier):
(WebCore::ResourceRequestBase::setInitiatorIdentifier):
Optional initiator identifier. Currently used only be Web Inspector.
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::resourceRequestIdentifier):
Non-page execution contexts, like WorkerGlobalScope, should provide
a unique identifier that may be used to distinguish loads initiated
from within that context.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
XHR / Fetch loads should include the ScriptExecutionContext's
initiator identifier.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::WorkerScriptLoader):
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::createResourceRequest):
* workers/WorkerScriptLoader.h:
Provide a way to provide initiator identifier information for
Worker script loads. Currently this is `new Worker(...)` and
`importScripts(...)` resource loads.
* workers/Worker.cpp:
(WebCore::Worker::Worker):
(WebCore::Worker::create):
* workers/Worker.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerGlobalScope.h:
Give Worker itself the unique identifier, because `new Worker(...)`
loads happen before the WorkerGlobalScript (ScriptExecutionContext)
is actually created, but we want to associate it with this Worker.
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
* workers/WorkerInspectorProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
Pass the MainThread's Worker identifier through to the WorkerGlobalScope
created on the WorkerThread. They should be the same identifier.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
Pass the initiator identifier data to the frontend. This identifier is
equivalent to a "target identifier" in the frontend. Currently the only
non-Page targets are Workers.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
When using the memory cache we create a new resource request. Be sure
to copy over useful inspector data, like the initiator identifier,
from the original request.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
When rebuilding a ResourceRequest from NSURLRequest, copy over the
initiator identifier property that wouldn't otherwise have survived
the transition.
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Clean up some exception ordering.
https://bugs.webkit.org/show_bug.cgi?id=164566
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
2016-11-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208438.
crashes
Reverted changeset:
"[WK2][NETWORK_SESSION] Add support for downloading file
backed blobs"
https://bugs.webkit.org/show_bug.cgi?id=164458
http://trac.webkit.org/changeset/208438
2016-11-09 Said Abou-Hallawa <sabouhallawa@apple.com>
Change the decoding for some animated images to be asynchronous
https://bugs.webkit.org/show_bug.cgi?id=161566
Reviewed by Simon Fraser.
Tests: fast/images/slower-animation-than-decoding-image.html
fast/images/slower-decoding-than-animation-image.html
fast/images/stopped-animation-deleted-image.html
Request the next frame before firing the animation timer. The asynchronous
image decoding work queue notifies the BitmapImage when the frame finishes
decoding. If the timer fires before the frame is decoded, no repaint will
be requested. Only when the image frame is ready, the animation will be
advanced and the image will be repainted.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load): Cache the image settings in CachedImage.
(WebCore::CachedImage::createImage): No need to pass allowSubsampling to BitmapImage. It can be retrieved through Image::imageObserver().
(WebCore::CachedImage::changedInRect): Change the parameter to notifyObservers() to be a pointer.
* loader/cache/CachedImage.h: Cache the settings: allowSubsampling, allowAsyncImageDecoding and showDebugBackground through m_loader.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::dataChanged): Fix a logging message.
(WebCore::BitmapImage::draw): Store the current SubsamplingLevel to be used when requesting decoding the image of the next frame.
Draw a debug rectangle if the next frame is missed because it is being decoded and the setting showDebugBackground is on.
(WebCore::BitmapImage::startAnimation): Deleted. Moved to the header file.
(WebCore::BitmapImage::internalStartAnimation): Added. Request asynchronous image decoding for the next frame if required. Return the
result of starting the animation.
(WebCore::BitmapImage::advanceAnimation): Call internalAdvanceAnimation() if the frame image is not being decoded. If it is being decoded
and the setting showDebugBackground is on, force repaint so the debug rectangle is drawn.
(WebCore::BitmapImage::internalAdvanceAnimation): This is the old body of advanceAnimation().
(WebCore::BitmapImage::stopAnimation): Stop the asynchronous image decoding if it is started.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): This function is called from the async image decoding work queue when finishing decoding a native image frame.
* platform/graphics/BitmapImage.h:
(WebCore::BitmapImage::startAnimation): Added. It is now calls internalStartAnimation().
* platform/graphics/Color.h: Define a constant for the yellow color.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::clearMetadata): Delete unreferenced member.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Return true if the frame is requested for async decoding.
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageObserver.h: Add virtual functions for allowSubsampling, allowAsyncImageDecoding and showDebugBackground.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::maximumSubsamplingLevel): Move checking allowSubsampling() to the caller BitmapImage::draw().
* platform/graphics/ImageSource.h: Remove the setting allowSubsampling(); it can be retrieved from imageObserver().
(WebCore::ImageSource::setAllowSubsampling): Deleted.
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::shutdown): Stop the animation of an image when shutting down the resource.
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::shutdown): Ditto.
svg/graphics/SVGImageClients.h: Change the parameter to ImageObserver::changedInRect() to be a pointer.
(WebCore::SVGImageChromeClient::invalidateContentsAndRootView):
* testing/Internals.cpp:
(WebCore::Internals::setImageFrameDecodingDuration): Sets a fixed frame decoding duration for testing.
* testing/Internals.h:
* testing/Internals.idl: Adds an internal option for ImageFrameDecodingDuration.
2016-11-04 Brent Fulgham <bfulgham@apple.com>
Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
https://bugs.webkit.org/show_bug.cgi?id=155185
<rdar://problem/11101440>
Reviewed by Brady Eidson.
Add a new quirk for localStorage that defaults to 'on'. When active, this quirk says that
localStorage access should be granted, without needing to grant universal file access.
If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
grants universal file access.
Tests: storage/domstorage/localstorage/blocked-file-access-permitted-by-quirk.html
storage/domstorage/localstorage/blocked-file-access.html
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Set localStorage quirk mode based on settings.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin): Use more C++11 initializers.
(WebCore::SecurityOrigin::canAccessStorage): If the origin is a local file, and we are NOT in
localStorage quirks mode, and we have not been granted universal file access, prevent access
to DOM localStorage.
(WebCore::SecurityOrigin::setNeedsLocalStorageQuirk): Added.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::needsLocalStorageQuirk): Added.
* page/Settings.in:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): Make sure Workers know what the
localStorage quirks mode is set to.
2016-11-09 Alex Christensen <achristensen@webkit.org>
URLParser should not consider path of URLs with no host to start at the first slash after the colon
https://bugs.webkit.org/show_bug.cgi?id=164555
Reviewed by Tim Horton.
When we see a url that is only scheme:// we treated the // as the path. Firefox did this with unrecognized schemes,
but based on https://github.com/whatwg/url/issues/148 they seem willing to change. We had added similar behavior to
URL::parse, and I added this to URLParser in r206783 which this effectively reverts.
Covered by API and layout tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Don't move m_userStart to m_pathStart back by two when we see an empty host.
2016-11-09 Alex Christensen <achristensen@webkit.org>
Simplify logic of SecurityOrigin::databaseIdentifier
https://bugs.webkit.org/show_bug.cgi?id=164565
Reviewed by Brady Eidson.
No change in behavior.
SecurityOrigins with the file scheme need a special database identifier to be backwards-compatible with existing storage.
Instead of determining whether this is a file SecurityOrigin at parsing time and only using that information when
making the database identifier, just determine whether we need this quirk when making the database identifier.
I'm planning to move this logic to SecurityOriginData in another patch.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::databaseIdentifier):
* page/SecurityOrigin.h:
2016-11-09 Jaehun Lim <ljaehun.lim@samsung.com>
Unreviewed, build fix after r208460
isValidColorString() was renamed isValidSimpleColorString().
* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestions):
2016-11-09 Anders Carlsson <andersca@apple.com>
Fix STP build.
* WebCorePrefix.h:
2016-11-09 Simon Fraser <simon.fraser@apple.com>
Implement visual-viewport based position:fixed handling for Mac async scrolling
https://bugs.webkit.org/show_bug.cgi?id=164495
Reviewed by Tim Horton.
Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
so we push the enable flag to via the root state node, then push the layout viewport,
and the min/max scroll position that contstrain it, through frame state nodes.
When a scroll happens, we compute a new layout viewport when the visual viewport hits
an edge, and push that down through setScrollLayerPosition() since it's used to position
fixed and sticky layers.
When the main thread gets notified about an async scroll, we set the new layout viewport
on the FrameView, but do so in such a way that does not trigger layout. This is OK because
we do a RenderLayer update which udpates all the layoutViewport-dependent state, and is
necessary to avoid repaints every main thread update.
The iOS code is made to compile, but not work yet.
Tests: compositing/tiling/visiblerect-accumulated-offset.html
fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html
fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html
fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOrigin):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::visualViewportRect):
(WebCore::FrameView::unscaledMinimumScrollPosition):
(WebCore::FrameView::scrollPositionChanged):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::visualViewportEnabled):
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setLayoutViewport):
(WebCore::ScrollingStateFrameScrollingNode::setMinLayoutViewportOrigin):
(WebCore::ScrollingStateFrameScrollingNode::setMaxLayoutViewportOrigin):
(WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::visualViewportEnabled):
(WebCore::ScrollingTree::setVisualViewportEnabled):
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewport):
(WebCore::ScrollingTreeFrameScrollingNode::minLayoutViewportOrigin):
(WebCore::ScrollingTreeFrameScrollingNode::maxLayoutViewportOrigin):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: W3C test IndexedDB/idbtransaction_objectStoreNames.html fails.
https://bugs.webkit.org/show_bug.cgi?id=164528
Reviewed by Alex Christensen.
No new tests (Covered by existing test).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction): De-dupe the input names.
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Implement new IDBCursor.continuePrimaryKey function.
https://bugs.webkit.org/show_bug.cgi?id=164404
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/idbcursor-continue-primary-key-1-private.html
storage/indexeddb/modern/idbcursor-continue-primary-key-1.html
Also covered by existing tests.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::uncheckedIterateCursor):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::operator>):
(WebCore::IDBKeyData::operator<=):
(WebCore::IDBKeyData::operator>=):
* Modules/indexeddb/server/MemoryCursor.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::iterate):
* Modules/indexeddb/server/MemoryIndexCursor.h:
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
* Modules/indexeddb/server/MemoryObjectStoreCursor.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::isolatedCopy):
* Modules/indexeddb/shared/IDBIterateCursorData.h:
(WebCore::IDBIterateCursorData::encode):
(WebCore::IDBIterateCursorData::decode):
2016-11-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: set status label according to media state
https://bugs.webkit.org/show_bug.cgi?id=164557
<rdar://problem/29184097>
Reviewed by Dean Jackson.
Correctly set the StatusLabel text based on the media loading and network state.
Tests: http/tests/media/modern-media-controls/status-support/status-support-live-broadcast.html
http/tests/media/modern-media-controls/status-support/status-support-loading.html
media/modern-media-controls/status-support/status-support-error.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/status-support.js: Added.
(StatusSupport.prototype.get control):
(StatusSupport.prototype.get mediaEvents):
(StatusSupport.prototype.syncControl):
(StatusSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Zalan Bujtas <zalan@apple.com>
No need to set setFlowThreadState on RenderText in createTextRenderer.
https://bugs.webkit.org/show_bug.cgi?id=164559
Reviewed by Antti Koivisto.
setFlowThreadState in create*Renderer ensures that by the time we issue the initial call to
styleWillChange/styleDidChange through initializeStyle, the state is already set.
However since RenderText does not have its own style, it's sufficient to have the flow state set
through the normal RenderElement::insertChildInternal code path.
No change in functionality.
* style/RenderTreeUpdater.cpp:
(WebCore::createTextRenderer):
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
https://bugs.webkit.org/show_bug.cgi?id=164504
Reviewed by Darin Adler.
No new tests (Refactor, no behavior change).
This patch literally just takes the "key" and "count" arguments and encapsulates them in a struct.
That struct will then be easily expandable in the future (e.g. bug 164404).
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::uncheckedIterateCursor):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::iterateCursorOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::iterateCursor):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBIterateCursorData.cpp: Added.
(WebCore::IDBIterateCursorData::isolatedCopy):
* Modules/indexeddb/shared/IDBIterateCursorData.h: Added.
(WebCore::IDBIterateCursorData::encode):
(WebCore::IDBIterateCursorData::decode):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::iterateCursor):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Ryosuke Niwa <rniwa@webkit.org>
StyledElement::attributeChanged shouldn't do any work when the attribute value didn't change
https://bugs.webkit.org/show_bug.cgi?id=129476
Reviewed by Andreas Kling.
Avoid calling styleAttributeChanged and setPresentationAttributeStyleIsDirty
when the attribute value didn't change as in r164856.
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
2016-11-09 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Node::ownerDocument
https://bugs.webkit.org/show_bug.cgi?id=164004
Reviewed by Darin Adler.
Test: js/dom/domjit-accessor-owner-document.html
Still I cannot reproduce this crash in x64 environment, according to the crash log, it accesses 0x8 address.
This can happen if document() accidentally returns nullptr. In the C++ ownerDocument implementation,
if document() returns nullptr, it just returns nullptr. But in the DOMJIT implementation, we assume that
document() won't return nullptr and access the member of it.
This patch aligns the DOMJIT implementation strictly to the C++ one.
* dom/Node.idl:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
2016-11-09 Sam Weinig <sam@webkit.org>
[SVG] Start moving special casing of SVG out of the bindings - SVGAngle
https://bugs.webkit.org/show_bug.cgi?id=164496
Reviewed by Darin Adler.
There is quite a bit of special casing of SVG types in the bindings that adds
a lot of complexity and is relatively fragile, as it is based on type naming.
Instead of keeping the complexity in the bindings, I am going to move it into
the implementation, where it has also longed to be.
Starting small, with just SVGAngle. It has been split in two, with the existing
SVGAngle being renamed SVGAngleValue, and the bound instance, which used to be name
SVGPropertyTearOff<SVGAngle>, taking the name SVGAngle (and inheriting from
SVGPropertyTearOff<SVGAngleValue>).
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add SVGAngleValue.cpp
* bindings/scripts/CodeGenerator.pm:
Remove SVGAngle as a special case.
* svg/SVGAngle.cpp: Removed.
* svg/SVGAngle.h:
Added. Implements the SVGAngle interface explicitly, getting to
the SVGAngleValue through propertyReference().
* svg/SVGAngle.idl:
* svg/SVGAngleValue.cpp: Copied from Source/WebCore/svg/SVGAngle.cpp.
* svg/SVGAngleValue.h: Copied from Source/WebCore/svg/SVGAngle.h.
Move old SVGAngle implementation to SVGAngleValue.
* svg/SVGAnimatedAngle.cpp:
Replace SVGAngle usage with SVGAngleValue.
* svg/SVGAnimatedAngle.h:
Switch SVGAnimatedAngle to be a type alias. This remains SVGAnimatedPropertyTearOff<SVGAngle>
as SVGAnimatedPropertyTearOff has been changed to take the TearOff type as its parameter.
* svg/SVGAnimatedLength.h:
* svg/SVGAnimatedPreserveAspectRatio.h:
* svg/SVGAnimatedRect.h:
Switch to using type aliases and pass the TearOff to SVGAnimatedPropertyTearOff.
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createAngleAndEnumeration):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::angleAndEnumeration):
Use SVGAngleValue.
* svg/SVGComponentTransferFunctionElement.h:
Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::parseAttribute):
(WebCore::SVGMarkerElement::setOrient):
Switch to take an SVGAngleValue.
(WebCore::SVGMarkerElement::setOrientToAngle):
Update to pull the value out via propertyReference().
* svg/SVGMarkerElement.h:
Switch to take an SVGAngleValue.
* svg/SVGLengthList.h:
* svg/SVGNumberList.h:
* svg/SVGPathSegList.h:
* svg/SVGPointList.h:
* svg/SVGStringList.h:
* svg/SVGTransformList.h:
Switch to using type aliases in SVGPropertyTraits and add an alias for
ListItemTearOff.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createSVGAngle):
* svg/SVGSVGElement.h:
Change createSVGAngle to return a Ref<SVGAngle> and create one.
* svg/SVGSVGElement.idl:
Annotate IDL to indicate that a new value is being returned.
* svg/SVGTransform.cpp:
Remove unnecessary include of SVGAngle.h.
* svg/SVGViewSpec.cpp:
Add missing include of SVGElement.h (need because it removed from SVGPropertyTearOff).
* svg/properties/SVGAnimatedPropertyTearOff.h:
Change to be parameterized on the TearOffType, rather than the PropertyType itself. Get the
Property type from the TearOffType.
* svg/properties/SVGListProperty.h:
* svg/properties/SVGListPropertyTearOff.h:
Fix assumption that all TearOffTypes are just a SVGPropertyTearOff templatized on a property
type. This is no longer true for SVGAngle. Instead, get the TearOffType for lists via SVGPropertyTraits.
* svg/properties/SVGPropertyTearOff.h:
Make the PropertyType available by exposing it as a type alias.
2016-11-09 Darin Adler <darin@apple.com>
Move Range from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164457
Reviewed by Alex Christensen.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::rangeForNodeContents): Update to use ExceptionOr,
keeping behavior the same.
(WebCore::characterOffsetsInOrder): Ditto.
(WebCore::setRangeStartOrEndWithCharacterOffset): Changed argument to a
reference instead of a pointer. Use a boolean return value to indicate
success rather than an exception, since the callers don't need to know
which exception it is.
(WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): Updated for
the above.
(WebCore::AXObjectCache::nextBoundary): Ditto.
(WebCore::AXObjectCache::previousBoundary): Ditto.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
Update to use ExceptionOr, keeping behavior the same.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange): Ditto.
* accessibility/atk/WebKitAccessibleUtil.cpp:
(selectionBelongsToObject): Ditto.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _convertToNSRange:]): Ditto.
* dom/Node.cpp:
(WebCore::Node::textRects): Ditto.
* dom/Range.cpp:
(WebCore::Range::~Range): Remove old comment that no longer makes sense now
that the detach function no longer does anything.
(WebCore::checkForDifferentRootContainer): Updated to use ExceptionOr,
keeping behavior the same.
(WebCore::Range::setStart): Ditto.
(WebCore::Range::setEnd): Ditto.
(WebCore::Range::isPointInRange): Ditto.
(WebCore::Range::comparePoint): Ditto.
(WebCore::Range::compareNode): Ditto.
(WebCore::top): Added helper function so that compareBoundaryPoints doesn't
need to have two identical loops in it.
(WebCore::Range::compareBoundaryPoints): Updated to use ExceptionOr,
keeping behavior the same.
(WebCore::Range::compareBoundaryPointsForBindings): Ditto. Also use a switch
instead of relying on the order of the values to check for unsupported values.
(WebCore::Range::boundaryPointsValid): Ditto.
(WebCore::Range::deleteContents): Ditto.
(WebCore::Range::intersectsNode): Ditto.
(WebCore::Range::processContents): Ditto.
(WebCore::deleteCharacterData): Ditto.
(WebCore::processContentsBetweenOffsets): Ditto. Also changed to be a
non-member function and private to this file instead of in the class.
(WebCore::processNodes): Ditto. Also changed one argument to be a RefPtr
since the code relies on using it after mutating the DOM.
(WebCore::processAncestorsAndTheirSiblings): Ditto. Changed one argument type
to use ExceptionOr so the caller doesn't have to check the exception first.
(WebCore::Range::extractContents): Ditto.
(WebCore::Range::cloneContents): Ditto.
(WebCore::Range::insertNode): Ditto. Also fixed to only call nodeType once
instead of three times.
(WebCore::Range::toString): Ditto. Also fixed to call nodeType only once
per node instead of twice, to use downcast instead of static_cast, and to
use the word "node" instead of "n" for the local variable name.
(WebCore::Range::createContextualFragment): Ditto.
(WebCore::Range::checkNodeWOffset): Ditto.
(WebCore::Range::setStartAfter): Ditto.
(WebCore::Range::setEndBefore): Ditto.
(WebCore::Range::setEndAfter): Ditto.
(WebCore::Range::selectNode): Ditto.
(WebCore::Range::selectNodeContents): Ditto.
(WebCore::Range::surroundContents): Ditto.
(WebCore::Range::setStartBefore): Ditto.
(WebCore::Range::contains): Ditto. Except added code to handle exception
case to return false without asserting because I saw at least one crash
that seemed to imply this behavior was needed.
(WebCore::rangesOverlap): Ditto.
(WebCore::rangeOfContents): Ditto.
(WebCore::Range::expand): Ditto.
(WebCore::Range::getClientRects): Ditto.
(WebCore::Range::getBoundingClientRect): Ditto.
(WebCore::Range::borderAndTextQuads): Changed to use return value
instead of out argument, since it's a private function used only
within this class so it was easy to update all call sites.
(WebCore::Range::boundingRect): Updated for above. Also renamed since
there was no need for the name "internal" in this.
(WebCore::Range::absoluteBoundingRect): Ditto.
* dom/Range.h: Updated for above.
* dom/Range.idl: Use non-legacy exceptions. Also changed the default value
of the string argument to the expand function to the empty string rather
than "undefined", because the function silently does nothing when passed
any unrecognized string, and so this leaves behavior unchanged. I removed
the comment saying that the "undefined" default is wrong.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyAlternativeTextToRange): Updated
to use ExceptionOr but behave the same.
* editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling): Ditto.
(WebCore::Editor::markAndReplaceFor): Ditto.
(WebCore::isFrameInRange): Ditto. Also made a few style tweaks.
(WebCore::Editor::countMatchesForText): Ditto.
* editing/EditorCommand.cpp:
(WebCore::unionDOMRanges): Ditto.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification): Ditto.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingParagraph::offsetTo): Ditto.
* editing/TextCheckingHelper.h: Updated for above and also deleted
unneeded private function checkingRange, which just churned the
reference count unnecessarily; instead use m_checkingRange directly.
* editing/TextIterator.cpp:
(WebCore::TextIterator::getLocationAndLengthFromRange): Ditto.
* editing/VisiblePosition.cpp:
(WebCore::setStart): Ditto.
(WebCore::setEnd): Ditto.
* editing/VisibleSelection.cpp:
(WebCore::makeSearchRange): Ditto.
* editing/VisibleUnits.cpp:
(WebCore::suffixLengthForRange): Changed argument from RefPtr to
a reference.
(WebCore::prefixLengthForRange): Ditto.
(WebCore::previousBoundary): Updated for ExceptionOr and the change
above.
(WebCore::nextBoundary): Ditto.
* editing/VisibleUnits.h: Updated for above.
* editing/htmlediting.cpp:
(WebCore::comparePositions): Updated to use ExceptionOr but behave
the same.
(WebCore::visiblePositionForIndexUsingCharacterIterator): Ditto.
(WebCore::isNodeVisiblyContainedWithin): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::adjustedSelectionRange): Ditto.
* editing/markup.cpp:
(WebCore::createMarkupInternal): Ditto.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::addRange): Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
(WebCore::DOMSelection::containsNode): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Updated for change to
use ExceptionOr in Ragne::compareNode. Also refactored the function
to make the logic a little mroe straightforward and nest less of it
inside a loop.
* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges): Updated for ExceptionOr
without changing behavior.
* page/TextIndicator.cpp:
(WebCore::hasNonInlineOrReplacedElements): Ditto.
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges): Ditto.
2016-11-09 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix grid layout parsing
https://bugs.webkit.org/show_bug.cgi?id=164489
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFitContent):
(WebCore::isGridTrackFixedSized):
(WebCore::consumeGridTrackSize):
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::isCustomIdentValue):
(WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
(WebCore::CSSPropertyParser::consumeGridAreaShorthand):
(WebCore::consumeImplicitGridAutoFlow):
(WebCore::CSSPropertyParser::consumeGridShorthand):
2016-11-09 Darin Adler <darin@apple.com>
Move EventTarget from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164465
Reviewed by Youenn Fablet.
* Modules/indexeddb/IDBRequest.h: Added now-needed forward
class declarations.
* Modules/webaudio/AudioContext.h: Ditto.
* bindings/js/JSEventListener.cpp:
(WebCore::eventHandlerAttribute): Updated for name change of the
attributeEventListener function.
(WebCore::documentEventHandlerAttribute): Ditto.
* dom/Document.cpp:
(WebCore::Document::getWindowAttributeEventListener): Ditto.
* dom/EventTarget.cpp:
(WebCore::EventTarget::setAttributeEventListener): Updated for
name change.
(WebCore::EventTarget::attributeEventListener): Ditto.
(WebCore::EventTarget::dispatchEventForBindings): Use ExceptionOr.
(WebCore::legacyType): Use null instead of empty for no type, since
it's more efficient to check for null.
(WebCore::EventTarget::fireEventListeners): Check for null.
Also streamlined logic a little bit and removed a very old comment.
(WebCore::EventTarget::eventListeners): Renamed from getEventListeners.
* dom/EventTarget.h: Removed lots of unneeded declarations. Renamed
some functions to remove get prefix. Updated for above changes.
Moved one inline function out of the class header. Made the destructor
for EventTarget be inline to make the destructors for derived classes
slightly more efficient.
* dom/EventTarget.idl: Use non-legacy exception.
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument): Updated for name change.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment): Ditto.
* inspector/InspectorCSSAgent.h: Added now-needed forward declaration.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getEventListeners): Updated for name change.
* inspector/InspectorInstrumentation.h: Added now-needed forward declaration.
* page/DOMWindow.h: Ditto.
* xml/XMLHttpRequest.h: Ditto.
2016-11-09 Daniel Bates <dabates@apple.com>
Add test infrastructure and tests for existing HTTP 0.9 sandbox machinery
https://bugs.webkit.org/show_bug.cgi?id=164389
<rdar://problem/29101072>
Reviewed by Alex Christensen.
Add test infrastructure to support registering an arbitrary port as the default port
for a protocol. The behavior of various machinery, including the HTTP 0.9 machinery,
can be effected by whether the resource request was made using the default port for
the protocol. We expose window.internals.registerDefaultPortForProtocol() to allow
a test to override the default port associated with a protocol so as to support
testing these code paths using the existing port 8000 server started by run-webkit-httpd.
Without window.internals.registerDefaultPortForProtocol() we would need to teach
run-webkit-httpd to run a web server on port 80, which requires superuser privileges
(since it is a privileged port number) and is more likely to interfere with an
existing web server setup.
Tests: http/tests/security/http-0.9/default-port-plugin-blocked.html
http/tests/security/http-0.9/default-port-script-blocked.html
http/tests/security/http-0.9/iframe-blocked.html
http/tests/security/http-0.9/image-blocked.html
http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html
http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed.html
http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html
http/tests/security/http-0.9/worker-connect-src-blocked.html
http/tests/security/http-0.9/worker-importScripts-blocked.html
http/tests/security/http-0.9/xhr-asynchronous-blocked.html
* platform/URL.cpp:
(WebCore::defaultPortForProtocolMapForTesting): Added.
(WebCore::registerDefaultPortForProtocolForTesting): Adds the specified (protocol, port) to the
mapping used for testing.
(WebCore::clearDefaultPortForProtocolMapForTesting): Clears the protocol to default port testing map.
We call this function from Internals::resetToConsistentState() so that the mapping is cleared between
test runs.
(WebCore::defaultPortForProtocol): Modified to check the protocol to default port map for testing
before consulting URLParser::defaultPortForProtocol().
* platform/URL.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Clear the default port mapping used for testing.
(WebCore::Internals::registerDefaultPortForProtocol): Added.
* testing/Internals.h:
* testing/Internals.idl: Added declaration for registerDefaultPortForProtocol().
2016-11-09 Sam Weinig <sam@webkit.org>
[WebIDL] Add proper parsing for Promises
https://bugs.webkit.org/show_bug.cgi?id=164497
Reviewed by Tim Horton.
* bindings/scripts/IDLParser.pm:
(parseNonAnyType):
(parseStringType):
Require Promise types to declare the type they resolve to.
* bindings/js/JSDOMPromise.h:
Allow DOMPromise to be be parameterized on void. Add an SFINAE guarded
overload of resolve that takes no arguments when in a DOMPromise<void>.
* Modules/applepay/ApplePaySession.idl:
* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/WorkerGlobalScopeFetch.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCStatsReport.idl:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* Modules/streams/ReadableStreamSource.idl:
* Modules/streams/WritableStream.idl:
* Modules/webaudio/AudioContext.idl:
* bindings/scripts/test/TestNode.idl:
* bindings/scripts/test/TestObj.idl:
* crypto/SubtleCrypto.idl:
* crypto/WebKitSubtleCrypto.idl:
* css/FontFace.idl:
* css/FontFaceSet.idl:
* dom/CustomElementRegistry.idl:
* html/HTMLMediaElement.idl:
Update IDLs to specify the resolve type of promise types.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::start):
(WebCore::ReadableStreamSource::pull):
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::addReaction):
(WebCore::AudioContext::setState):
(WebCore::AudioContext::suspend):
(WebCore::AudioContext::resume):
(WebCore::AudioContext::close):
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
(WebCore::HTMLMediaElement::resolvePendingPlayPromises):
(WebCore::HTMLMediaElement::play):
* html/HTMLMediaElement.h:
Update implementations to use DOMPromise<void> rather than DOMPromise<nullptr_t>
and use the new resolve() overload.
2016-11-07 Brady Eidson <beidson@apple.com>
Followup to https://bugs.webkit.org/show_bug.cgi?id=164466 - Make an IDBTransaction* be an IDBTransaction&
Rubberstamped by Alex Christensen.
No new tests (No behavior change).
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::~IDBObjectStore):
(WebCore::IDBObjectStore::hasPendingActivity):
(WebCore::IDBObjectStore::name):
(WebCore::IDBObjectStore::setName):
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::autoIncrement):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
(WebCore::IDBObjectStore::markAsDeleted):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::ref):
(WebCore::IDBObjectStore::deref):
* Modules/indexeddb/IDBObjectStore.h:
2016-11-09 Zalan Bujtas <zalan@apple.com>
Move RenderNamedFlowThread nextRendererForElement logic to RenderTreeUpdater.
https://bugs.webkit.org/show_bug.cgi?id=164503
Reviewed by Antti Koivisto.
When we insert a renderer into the render tree, we need to know both its parent
and its next sibling. Normally the parent and the sibling are based on the DOM, but
when this renderer is part of a flow thread, its insertion sibling is not necessarily the DOM sibling.
To find the correct sibling, we call RenderNamedFlowThread's nextRendererForElement().
RenderNamedFlowThread keeps track of its children so that it can compute the next sibling
for the insertion point.
This patch eliminates the need for keeping track of the child renderers of each
flow by moving the 'next sibling' logic to RenderTreePosition.
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertedIntoTree):
(WebCore::RenderElement::willBeDestroyed):
(WebCore::RenderElement::removeFromRenderFlowThread):
(WebCore::RenderElement::renderNamedFlowThreadWrapper): Deleted.
* rendering/RenderElement.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::nextRendererForElement): Deleted.
(WebCore::RenderNamedFlowThread::addFlowChild): Deleted.
(WebCore::RenderNamedFlowThread::removeFlowChild): Deleted.
* rendering/RenderNamedFlowThread.h:
* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::previousSiblingRenderer):
(WebCore::RenderTreePosition::flowThreadInsertionContext):
* style/RenderTreePosition.h:
(WebCore::RenderTreePosition::RenderTreePosition):
(WebCore::RenderTreePosition::parent):
* style/RenderTreeUpdater.cpp:
(WebCore::registerElementForFlowThreadIfNeeded): We need to registed the element even when it does not create renderer (display: none).
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::moveToFlowThreadIfNeeded): Deleted.
2016-11-09 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Incomplete image decoding.
https://bugs.webkit.org/show_bug.cgi?id=164511
Reviewed by Darin Adler.
Create native decoder when all image data has been received.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::setData):
2016-11-09 Beth Dakin <bdakin@apple.com>
Attempted build fix.
* platform/spi/cocoa/AVKitSPI.h:
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Clean up more transaction abort behavior, including tweaks to Index/ObjectStore lifetime.
https://bugs.webkit.org/show_bug.cgi?id=164466
Reviewed by Alex Christensen.
No new tests (Covered by existing tests that now pass).
Previously, IDBIndex ref/deref didn't track a traditional ref count but instead kept the owning object store alive.
Now, IDBObjectStore ref/deref do the same thing for the owning transaction.
Now when a version change transaction is rolled back, some object stores and indexes get pulled out of the "deleted"
set and get promoted back up into the "referenced" set.
Now deleted object stores/indexes are considered opaque roots, as live objects in the deleted state *can* get back
to the owning objects.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::visitReferencedIndexes):
(WebCore::IDBObjectStore::ref):
(WebCore::IDBObjectStore::deref):
(WebCore::IDBObjectStore::create): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::transitionedToFinishing):
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::visitReferencedObjectStores):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* bindings/js/JSIDBTransactionCustom.cpp: Added.
(WebCore::JSIDBTransaction::visitAdditionalChildren):
2016-11-09 Simon Fraser <simon.fraser@apple.com>
Allow customization of TextStream-based logging for geometry types
https://bugs.webkit.org/show_bug.cgi?id=164460
Reviewed by Zalan Bujtas.
TextStream-based logging was constrained by the requirement to maintain compatibility
with DRT-style output, which includes cumbersome rect logging ("at (5,0) size 40x40")
and dumping LayoutRects as IntRects.
Add some formatting flags so that other TextStream clients (e.g. logging) can have
more readable output, and opt into automatic FormatNumberRespectingIntegers behavior.
TextStreams whose output appears in test results are given flags to avoid behavior
changes, but in the longer term test results should be updated.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* platform/graphics/FloatPoint.cpp:
(WebCore::operator<<):
* platform/graphics/FloatRect.cpp:
(WebCore::operator<<):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::layerTreeAsText):
* platform/graphics/IntRect.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutPoint.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutRect.cpp:
(WebCore::operator<<):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::replayDisplayListAsText):
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::asText):
* platform/text/TextStream.cpp:
(WebCore::TextStream::operator<<):
* platform/text/TextStream.h:
(WebCore::TextStream::TextStream):
(WebCore::TextStream::formattingFlags):
(WebCore::TextStream::setFormattingFlags):
(WebCore::TextStream::hasFormattingFlag):
(WebCore::TextStream::increaseIndent):
(WebCore::TextStream::decreaseIndent):
* rendering/RenderTreeAsText.cpp:
(WebCore::externalRepresentation):
(WebCore::counterValueForElement):
2016-11-09 Zalan Bujtas <zalan@apple.com>
RenderFlowThread::flowThreadRelativeWillBeRemoved should take RenderObject& instead of RenderObject*
https://bugs.webkit.org/show_bug.cgi?id=164543
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::removeChild):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
(WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
* rendering/RenderMultiColumnFlowThread.h:
2016-11-09 Jer Noble <jer.noble@apple.com>
REGRESSION (r208149): Media scrubber is not displayed in media controls
https://bugs.webkit.org/show_bug.cgi?id=164514
Reviewed by Darin Adler.
Fixes broken Media Controls API tests.
Added a new PlatformMediaSessionType; need to add that same type to the TYPE_TRAITS section of
MediaElementSession.h so that is<> and downcast<> work correctly.
* html/MediaElementSession.h:
(isType):
2016-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
When editing IME, `compositionend` events should fire after input events
https://bugs.webkit.org/show_bug.cgi?id=164324
<rdar://problem/29050438>
Reviewed by Darin Adler.
Moves where we dispatch `compositionend` events to after applying editing commands that fire `beforeinput` or
`input` events. Also augments existing layout tests to verify the change.
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
2016-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
Setting foreground color when text is selected should fire an input event with color data
https://bugs.webkit.org/show_bug.cgi?id=164241
<rdar://problem/29032759>
Reviewed by Darin Adler.
Refactors Editor::applyStyle and Editor::applyParagraphStyle to handle beforeinput and input event dispatch.
Instead of going through the ApplyStyleCommand to dispatch input events, override shouldDispatchInputEvents to
return false. This strategy also has the effect of unifying the way input events are dispatched in applyStyle,
in both codepaths where we computeAndSetTypingStyle and where we create and then apply a style command.
Test: fast/events/input-events-selection-forecolor-data.html
* editing/ApplyStyleCommand.h:
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::computeAndSetTypingStyle):
2016-11-08 Dean Jackson <dino@apple.com>
Rendering support for ExtendedColors
https://bugs.webkit.org/show_bug.cgi?id=164443
<rdar://problems/29123243>
Reviewed by Simon Fraser and Darin Adler.
Add support for rendering the new color() syntax, which
ends up as an ExtendedColor.
In order to make rendering code a little more readable, I
changed Color::hasAlpha to Color::isOpaque (since an alpha
of 100% is still an alpha), and added a Color::isVisible
helper (the color isn't completely transparent). These new
helpers support ExtendedColor forms.
Support for painting gradients and blending between colors
is still to come. I also added some FIXME comments
to show other places that don't handle ExtendedColors yet.
Tests: css3/color/backgrounds-and-borders.html
css3/color/box-shadows.html
css3/color/canvas.html
css3/color/composited-solid-backgrounds.html
css3/color/text.html
* css/CSSGradientValue.cpp: Add some notes that this is broken.
(WebCore::interpolate):
(WebCore::CSSGradientValue::knownToBeOpaque):
* editing/EditingStyle.cpp: Use new Color helpers.
(WebCore::isTransparentColorValue):
* editing/mac/EditorMac.mm: Use new Color helpers.
(WebCore::Editor::fontAttributesForSelectionStart):
* html/ColorInputType.cpp: No need to use the Color class at all here.
(WebCore::isValidSimpleColorString): Renamed from isValidColorString.
(WebCore::ColorInputType::sanitizeValue):
(WebCore::ColorInputType::typeMismatchFor):
(WebCore::isValidColorString): Deleted.
* html/canvas/CanvasRenderingContext2D.cpp: New helpers.
(WebCore::CanvasRenderingContext2D::shouldDrawShadows):
(WebCore::CanvasRenderingContext2D::didDraw):
* page/FrameView.cpp: Ditto.
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
(WebCore::FrameView::hasOpaqueBackground):
(WebCore::FrameView::setBaseBackgroundColor):
* platform/graphics/Color.cpp:
(WebCore::differenceSquared): Support ExtendedColor, but also
add a note to indicate that this method and its call sites
should use floats.
(WebCore::Color::serialized): New helper.
(WebCore::Color::cssText): Ditto.
(WebCore::Color::blend): Ditto.
(WebCore::Color::blendWithWhite):
(WebCore::Color::colorWithAlphaMultipliedBy): Implementation of new function.
(WebCore::Color::colorWithAlpha): Ditto.
(WebCore::Color::opaqueColor): New method to return an opaque version of the given color.
(WebCore::blend):
* platform/graphics/Color.h:
(WebCore::Color::isOpaque): New helper that is !hasAlpha().
(WebCore::Color::isVisible): New helper.
(WebCore::Color::alphaAsFloat): Gets the alpha value as a float. This replaces
a bunch of places that were calculating it manually each time. Meanwhile, we
might consider always exposing the primaries as floats... or at least
have that option.
(WebCore::isBlackColor): New helper - it was used in a couple of places.
(WebCore::isWhiteColor): Ditto.
(WebCore::Color::hasAlpha): Deleted.
* platform/graphics/Gradient.cpp: Add FIXME.
(WebCore::Gradient::addColorStop):
* platform/graphics/Gradient.h:
* platform/graphics/GraphicsContext.cpp: Use new helpers.
(WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::hasVisibleShadow):
* platform/graphics/Image.cpp: Ditto.
(WebCore::Image::fillWithSolidColor):
* platform/graphics/ShadowBlur.cpp: Ditto.
(WebCore::ShadowBlur::updateShadowBlurValues):
* platform/graphics/ca/GraphicsLayerCA.cpp: Ditto.
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::platformGradient): Add a FIXME to note that we can
add ExtendedColor support simply by using CGColors, rather than fetching
the components ourselves.
* platform/graphics/cg/GraphicsContextCG.cpp: New helpers.
(WebCore::calculateDrawingMode):
* platform/graphics/cocoa/FontCascadeCocoa.mm: New helpers.
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/mac/ColorMac.mm: Use the new helpers and Color::hash().
(WebCore::nsColor):
* platform/graphics/texmap/TextureMapperGL.cpp: New helpers.
(WebCore::TextureMapperGL::drawBorder):
* rendering/BorderEdge.cpp: Ditto.
(WebCore::BorderEdge::obscuresBackgroundEdge):
(WebCore::BorderEdge::obscuresBackground):
* rendering/RenderBox.cpp: Ditto.
(WebCore::RenderBox::getBackgroundPaintedExtent):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
(WebCore::RenderBox::backgroundHasOpaqueTopLayer):
* rendering/RenderBoxModelObject.cpp: Ditto.
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::colorNeedsAntiAliasAtCorner):
(WebCore::willBeOverdrawn):
(WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayerBacking.cpp:
(WebCore::canCreateTiledImage):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::viewHasTransparentBackground):
* rendering/RenderMenuList.cpp:
(RenderMenuList::getItemBackgroundColor):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::disabledTextColor):
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::isTransparent):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColor):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasBackground):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
* svg/SVGAnimatedColor.cpp: Add a FIXME to note this is broken.
(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
2016-11-09 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: StatusLabel
https://bugs.webkit.org/show_bug.cgi?id=164544
<rdar://problem/29179541>
Reviewed by Dean Jackson.
We add a new StatusLabel class to display a string of text in place of the TimeControl.
A followup patch will add the logic to display "Error", "Loading" and "Live Broadcast"
test under the right media state.
Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html
media/modern-media-controls/status-label/status-label.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline .time-label,):
(.media-controls.mac.inline .time-label): Deleted.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.):
* Modules/modern-media-controls/controls/status-label.css: Added.
(.status-label):
* Modules/modern-media-controls/controls/status-label.js: Added.
(StatusLabel.prototype.get text):
(StatusLabel.prototype.set text):
(StatusLabel.prototype.commitProperty):
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Chris Dumez <cdumez@apple.com>
[Mac] Stop using deprecated AppKit enumeration values
https://bugs.webkit.org/show_bug.cgi?id=164494
Reviewed by Darin Adler.
Stop using deprecated AppKit enumeration values.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_processElement):
(HTMLConverter::_addMarkersToList):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::keyEvent):
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::passSubframeEventToSubframe):
(WebCore::EventHandler::widgetDidHandleWheelEvent):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::setTextIndicator):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::paint):
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor):
* platform/mac/DragImageMac.mm:
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::mouseEventTypeForEvent):
(WebCore::clickCountForEvent):
(WebCore::isKeypadEvent):
(WebCore::windowsKeyCodeForKeyEvent):
(WebCore::isKeyUpEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::scrollbarControlSizeToNSControlSize):
* platform/mac/ThemeMac.mm:
(-[WebCoreThemeView window]):
(WebCore::controlSizeForFont):
(WebCore::controlSizeFromPixelSize):
(WebCore::setUpButtonCell):
(WebCore::stepperControlSizeForFont):
(WebCore::paintStepper):
(WebCore::ThemeMac::minimumControlSize):
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]):
(-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
(-[WebVideoFullscreenHUDWindowController init]):
(-[WebVideoFullscreenHUDWindowController keyDown:]):
(-[WebVideoFullscreenHUDWindowController windowDidLoad]):
* platform/mac/WebWindowAnimation.mm:
(WebWindowAnimationDurationFromDuration):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updateCachedSystemFontDescription):
(WebCore::RenderThemeMac::controlSizeForFont):
(WebCore::RenderThemeMac::controlSizeForCell):
(WebCore::RenderThemeMac::controlSizeForSystemFont):
(WebCore::RenderThemeMac::paintProgressBar):
(WebCore::RenderThemeMac::popupMenuSize):
(WebCore::RenderThemeMac::sliderThumbHorizontal):
(WebCore::RenderThemeMac::sliderThumbVertical):
2016-11-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: iOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=164513
<rdar://problem/27989475>
Reviewed by Dean Jackson.
We introduce a new IOSInlineMediaControls class which can be used to instantiate media controls
for inline playback on iOS.
Tests: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-constructor.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-controls-bar-styles.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-time-control-styles.html
media/modern-media-controls/ios-inline-media-controls/ios-inline-media-dropping-controls.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.css: Added.
(.media-controls.ios.inline > .controls-bar):
(.media-controls.ios.inline .time-control):
(.media-controls.ios.inline button):
(.media-controls.ios.inline button:active):
(.media-controls.ios.inline > .controls-bar button):
(.media-controls.ios.inline .buttons-container.right):
(.media-controls.ios.inline button.play-pause):
(.media-controls.ios.inline button.skip-back):
(.media-controls.ios.inline .scrubber.slider):
(.media-controls.ios.inline button.airplay):
(.media-controls.ios.inline button.pip):
(.media-controls.ios.inline button.fullscreen):
(.media-controls.ios.inline .time-label):
(.media-controls.ios.inline .scrubber.slider > .fill):
(.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/ios-inline-media-controls.js: Added.
(IOSInlineMediaControls.prototype.layout):
(IOSInlineMediaControls):
* Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Added.
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:
2016-11-09 Beth Dakin <bdakin@apple.com>
Support TouchBar in WebKit
https://bugs.webkit.org/show_bug.cgi?id=164437
-and corresponding-
rdar://problem/28876524
Reviewed by Darin Adler.
* WebCore.xcodeproj/project.pbxproj:
* platform/spi/cocoa/AVKitSPI.h:
* platform/spi/cocoa/NSTouchBarSPI.h: Added.
* platform/spi/mac/NSSpellCheckerSPI.h:
2016-11-09 Chris Dumez <cdumez@apple.com>
Use Blob URL instead of webkit-fake-url when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=49141
Reviewed by Darin Adler.
Use Blob URL instead of webkit-fake-url when pasting an image.
Tests: editing/pasteboard/paste-image-as-blob-url.html
editing/pasteboard/paste-image-using-image-data.html
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readImage):
(WebCore::Editor::createFragmentForImageAndURL):
2016-11-09 Michael Catanzaro <mcatanzaro@igalia.com>
Fix error message when SQLite initialization fails
https://bugs.webkit.org/show_bug.cgi?id=164462
Reviewed by Darin Adler.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::initializeSQLiteIfNecessary):
2016-11-08 Antoine Quint <graouts@apple.com>
[Modern Media Controls] UI Library: macOS fullscreen controls
https://bugs.webkit.org/show_bug.cgi?id=164414
<rdar://problem/27989474>
Reviewed by Dean Jackson.
We introduce a new MacOSFullscreenMediaControls class which can be used to instantiate media controls
for fullscreen playback on macOS. These controls can be dragged by the user.
Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-right-container-margin.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html
media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html
* Modules/modern-media-controls/controls/button.js:
(Button.prototype.set enabled):
Correctly notify the layoutDelegate when the enabled property changes, regardless of whether
the flag is on.
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype._updateImage):
(IconButton):
Correctly notify the layout delegate when the image metrics have changed so that it may perform
a layout. This issues became apparent with the new tests on Yosemite and caused some flakyness.
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
Fix a typo.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css: Added.
(.media-controls.mac.fullscreen > .controls-bar):
(.media-controls.mac.fullscreen .volume.slider):
(.media-controls.mac.fullscreen .buttons-container):
(.media-controls.mac.fullscreen .buttons-container.center):
(.media-controls.mac.fullscreen > .controls-bar button):
(.media-controls.mac.fullscreen button.rewind):
(.media-controls.mac.fullscreen button.play-pause):
(.media-controls.mac.fullscreen button.forward):
(.media-controls.mac.fullscreen .buttons-container.right):
(.media-controls.mac.fullscreen button.airplay):
(.media-controls.mac.fullscreen button.aspect-ratio):
(.media-controls.mac.fullscreen button.pip):
(.media-controls.mac.fullscreen button.tracks):
(.media-controls.mac.fullscreen button.fullscreen):
(.media-controls.mac.fullscreen .time-control):
(.media-controls.mac.fullscreen .time-label):
(.media-controls.mac.fullscreen .scrubber):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: Added.
(MacOSFullscreenMediaControls.prototype.layout):
(MacOSFullscreenMediaControls):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls):
Allow the layoutTraits property to be set to something other than just LayoutTraits.macOS
so that MacOSFullscreenMediaControls may set the LayoutTraits.Fullscreen bit.
* Modules/modern-media-controls/js-files:
Add a reference to the new macos-fullscreen-media-controls.js file.
* WebCore.xcodeproj/project.pbxproj:
Add references to the new macos-fullscreen-media-controls.js and
macos-fullscreen-media-controls.css files.
2016-11-09 Chris Dumez <cdumez@apple.com>
Shave 16 bytes off HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=164488
Reviewed by Sam Weinig.
Shave 16 bytes off HTMLInputElement (232 -> 216) by packing data members
better.
* html/HTMLFormControlElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
* html/HTMLTextFormControlElement.h:
2016-11-09 Youenn Fablet <youenn@apple.com>
[WebRTC] Introduce asynchronous backend for other RTCPeerConnection API
https://bugs.webkit.org/show_bug.cgi?id=164409
Reviewed by Eric Carlson.
Covered by existing tests.
Following on createOffer changes, applying the same changes to createAnswer, setLocalDescription, setRemoteDescription and addIceCandidate.
Also refactored ICE candidate event generation (done at PeerConnectionBackend).
Updated stop implementation to clean any promise that may be stored in PeerConnectionBackend.
The goal of this is to be more aligned with https://www.w3.org/TR/webrtc/.
Implementation of the various functions such as //www.w3.org/TR/webrtc/#set-description would be done in PeerConnectionBackend.
This will require additional code moved from MediaEndpointPeerConnection up to PeerConnectionBackend.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::doCreateAnswer):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::MediaEndpointPeerConnection::doSetLocalDescription):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::doSetRemoteDescription):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::doAddIceCandidate):
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::doStop):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
(WebCore::MediaEndpointPeerConnection::createAnswer): Deleted.
(WebCore::MediaEndpointPeerConnection::setLocalDescription): Deleted.
(WebCore::MediaEndpointPeerConnection::setRemoteDescription): Deleted.
(WebCore::MediaEndpointPeerConnection::addIceCandidate): Deleted.
(WebCore::MediaEndpointPeerConnection::stop): Deleted.
(WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState): Deleted.
(WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState): Deleted.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOffer):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswer):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::isLocalDescriptionTypeValidForState):
(WebCore::PeerConnectionBackend::setLocalDescription):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::isRemoteDescriptionTypeValidForState):
(WebCore::PeerConnectionBackend::setRemoteDescription):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidate):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::fireICECandidateEvent):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::stop):
* Modules/mediastream/PeerConnectionBackend.h:
2016-11-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream][Mac] Mark captured video frames as ready for display immediately
https://bugs.webkit.org/show_bug.cgi?id=164482
<rdar://problem/29139073>
Reviewed by Jer Noble.
* platform/cf/CoreMediaSoftLink.cpp: Add new constant.
* platform/cf/CoreMediaSoftLink.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForMediaData):
New, ask register for a callback when the sample buffer display layer is ready
for more media data.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer): Don't change
the sample timestamps, assume the caller has configured the sample correctly.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack): Don't
drop frames when the display layer isn't ready.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Call stopRequestingMediaData.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupCaptureSession): Tell the video output to always discard
late video frames, we don't need them.
(WebCore::AVVideoCaptureSource::processNewFrame): Add a kCMSampleAttachmentKey_DisplayImmediately
attachment.
2016-11-09 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Wrong selected element at a given index in a list box (redux)
https://bugs.webkit.org/show_bug.cgi?id=164430
Reviewed by Darin Adler.
This essentially undoes the implementation change resulting from r164577.
As stated in the ATK documentation, atk_selection_ref_selection() takes
"a gint specifying the index in the selection set. (e.g. the ith selection
as opposed to the ith child)." r164577 deliberately modified that, causing
atk_selection_ref_selection() to treat the index as if it were the position
with respect to all of the children. There is different API in ATK, namely
atk_object_ref_accessible_child(), when the ith child from the set of all
children is sought.
Tests: accessibility/aria-listbox-no-selection.html
accessibility/native-listbox-no-selection.html
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(optionFromSelection):
2016-11-09 Gyuyoung Kim <gyuyoung.kim@webkit.org>
[EFL] Use libgcrypt instead of GnuTLS for CryptoDigest
https://bugs.webkit.org/show_bug.cgi?id=164461
Reviewed by Michael Catanzaro.
As GTK port in r208297, EFL port starts to use libgcrypt instead of GnuTLS as well.
No new tests, no behavior change.
* PlatformEfl.cmake:
2016-11-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208422.
Roll r208382 back in since it was not responsible for the API
test failures seen on macOS.
Reverted changeset:
"Unreviewed, rolling out r208382."
https://bugs.webkit.org/show_bug.cgi?id=164319
http://trac.webkit.org/changeset/208422
2016-11-09 Csaba Osztrogonác <ossy@webkit.org>
One more URTBF after r208361.
* PlatformMac.cmake:
2016-11-09 Csaba Osztrogonác <ossy@webkit.org>
Typo fix after r162782
https://bugs.webkit.org/show_bug.cgi?id=164473
Unreviewed trivial fix.
* platform/ThreadGlobalData.cpp:
2016-11-07 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208382.
This change appears to have caused 3
SerializedCryptoKeyWrapTest API tests to fail on macOS.
Reverted changeset:
"[Readable Streams API] Implement ByteStreamController
error()"
https://bugs.webkit.org/show_bug.cgi?id=164319
http://trac.webkit.org/changeset/208382
2016-11-04 Filip Pizlo <fpizlo@apple.com>
WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
https://bugs.webkit.org/show_bug.cgi?id=152045
Reviewed by Andy Estes.
No new layout tests because no new behavior. The new WTF time classes have some unit tests
in TestWebKitAPI.
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* platform/MainThreadSharedTimer.h:
* platform/SharedTimer.h:
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::updateSharedTimer):
* platform/cf/MainThreadSharedTimerCF.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/efl/MainThreadSharedTimerEfl.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/win/MainThreadSharedTimerWin.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
2016-11-04 Zalan Bujtas <zalan@apple.com>
RenderFlowThread state reset cleanup.
https://bugs.webkit.org/show_bug.cgi?id=164426
Reviewed by Simon Fraser.
RenderFlowThread state reset is spread across several functions. This patch groups them
together in RenderObject::resetFlowThreadState().
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removeLeftoverAnonymousBlock):
(WebCore::RenderBlock::dropAnonymousBoxChild): This is now part of resetFlowThreadState() since resetFlowThreadState
gets called even when NotifyChildren is false.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal): Initialize the thread state before we notify the child.
(WebCore::RenderElement::removeChildInternal): Reset the state even when NotifyChildren is false.
(WebCore::RenderElement::willBeRemovedFromTree): This code is moved to removeFromRenderFlowThread().
(WebCore::RenderElement::removeFromRenderFlowThread):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::initializeFlowThreadState): This is in transition for webkit.org/b/164428 (RenderFlowThread state initialization cleanup.)
(WebCore::RenderObject::resetFlowThreadState):
(WebCore::RenderObject::setParent): This was seemingly a random place to put flow state initialization.
(WebCore::RenderObject::willBeRemovedFromTree): resetFlowThreadState() takes care of it now.
* rendering/RenderObject.h:
2016-11-04 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Add DOMJIT::Signature annotation to Document::getElementById
https://bugs.webkit.org/show_bug.cgi?id=164356
Reviewed by Filip Pizlo.
This patch implements DOMJIT::Signature annotation for getElementById.
Since getElementById is also implemented in DocumentFragment, we implement
the branchIfDocumentFragment/branchIfNotDocumentFragment for that.
In dromaeo, we have a test like this.
test( "getElementById", function(){
for ( var i = 0; i < num * 30; i++ ) {
ret = document.getElementById("testA" + num).nodeType;
ret = document.getElementById("testB" + num).nodeType;
ret = document.getElementById("testC" + num).nodeType;
ret = document.getElementById("testD" + num).nodeType;
ret = document.getElementById("testE" + num).nodeType;
ret = document.getElementById("testF" + num).nodeType;
}
});
In the above test, JSC already knows the following things.
1. Since nodeType is now handled as CallDOMGetter, we know that it is pure.
2. getElementById look up becomes PureGetById since document is impure object. But it is kept as PureGetById. So it does not write DOMState.
3. `"testA" + num` will be converted to constant string.
4. CallDOM for getElementById said it just reads(DOMState:DOM). And it saids that it returns the same value as long as DOMState is not clobbered.
5. CheckCell leading CallDOM ensures the inlined getElementById node. (CallDOM node).
The key thing is that no node clobbers DOMState during the loop. So CallDOM & CallDOMGetter can be hoisted.
This improves dom-query significantly. Dromaeo dom-query getElementById becomes 40x faster (247796 v.s. 6197).
Dromaeo dom-query getElementById (not in document) becomes 89x faster (630317.8 v.s. 7066.).
Tests: js/dom/domjit-function-get-element-by-id-changed.html
js/dom/domjit-function-get-element-by-id-licm.html
js/dom/domjit-function-get-element-by-id.html
* dom/NonElementParentNode.idl:
* domjit/DOMJITCheckDOM.h:
(WebCore::DOMJIT::TypeChecker<DocumentFragment>::branchIfFail):
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchIfDocumentFragment):
(WebCore::DOMJIT::branchIfNotDocumentFragment):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Rename unscaledUnobscuredVisibleContentSize and unscaledVisibleContentSizeIncludingObscuredArea for attempted clarity
https://bugs.webkit.org/show_bug.cgi?id=164438
Reviewed by Tim Horton.
unscaledUnobscuredVisibleContentSize() and unscaledVisibleContentSizeIncludingObscuredArea() were an endless source
of confusion.
Functions with "VisibleContent" in the name are usually expected to return document coordinates (affected by zooming),
so unscaledUnobscuredVisibleContentSize caused cognitive dissonance because of "unscaled" vs "visibleContent", and
"unobscured" vs "visible".
So rename:
unscaledUnobscuredVisibleContentSize -> sizeForUnobscuredContent
unscaledVisibleContentSizeIncludingObscuredArea -> sizeForVisibleContent
sizeForUnobscuredContent() can also be private to ScrollView.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
* platform/ScrollView.cpp:
(WebCore::ScrollView::unobscuredContentRectInternal):
(WebCore::ScrollView::sizeForVisibleContent):
(WebCore::ScrollView::sizeForUnobscuredContent): Don't compute unscaledVisibleContentSizeIncludingObscuredArea
before testing whether we have a platform widget.
(WebCore::ScrollView::layoutSize):
(WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea): Deleted.
(WebCore::ScrollView::unscaledUnobscuredVisibleContentSize): Deleted.
* platform/ScrollView.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::ensureRootLayer):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Layout viewport wrong with RTL documents
https://bugs.webkit.org/show_bug.cgi?id=164434
Reviewed by Tim Horton.
The layoutViewportRect was computed incorrectly in RTL documents, because
FrameView::unscaledMaximumScrollPosition() was wrong; it erroneously mapped
what it thought was a scrollOffset to a scrollPosition.
Unscaled scroll positions are in the same coordinate space as unscaledDocumentRect,
so we should not call scrollPositionFromOffset() in FrameView::unscaledMaximumScrollPosition().
Changed FrameView::unscaledMinimumScrollPosition() to also just grab the location of
unscaledDocumentRect, for symmetry.
Finally fixed the tiled scrolling indicator's viewport rect for zoomed RTL documents
by using the unscaled scroll origin.
Tests: fast/visual-viewport/rtl-nonzoomed-rects.html
fast/visual-viewport/rtl-zoomed-rects.html
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOrigin):
(WebCore::FrameView::unscaledScrollOrigin):
(WebCore::FrameView::unscaledMinimumScrollPosition):
(WebCore::FrameView::unscaledMaximumScrollPosition):
* page/FrameView.h:
2016-11-04 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for modern callback syntax
https://bugs.webkit.org/show_bug.cgi?id=164435
Reviewed by Chris Dumez.
Support new callback syntax:
callback Function = void (DOMString arg1, long arg2);
This replaces "callback interface" types with a Callback=FunctionOnly
extended attribute.
* Modules/geolocation/PositionCallback.idl:
* Modules/geolocation/PositionErrorCallback.idl:
* Modules/notifications/NotificationPermissionCallback.idl:
* Modules/quota/StorageErrorCallback.idl:
* Modules/quota/StorageQuotaCallback.idl:
* Modules/quota/StorageUsageCallback.idl:
* Modules/webaudio/AudioBufferCallback.idl:
* Modules/webdatabase/DatabaseCallback.idl:
* Modules/webdatabase/SQLStatementCallback.idl:
* Modules/webdatabase/SQLStatementErrorCallback.idl:
* Modules/webdatabase/SQLTransactionCallback.idl:
* Modules/webdatabase/SQLTransactionErrorCallback.idl:
* dom/RequestAnimationFrameCallback.idl:
* dom/StringCallback.idl:
* html/VoidCallback.idl:
* page/IntersectionObserverCallback.idl:
* css/MediaQueryListListener.idl:
Update to new syntax.
* css/MediaQueryListListener.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::styleResolverChanged):
Switch to using the now required 'handleEvent' name. This is an implementation detail
that we should change.
* bindings/scripts/CodeGenerator.pm:
Update document processing to allow a callback only file. Update callback
type checks to look for a regex that matches in the new format.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
(AddToIncludesForIDLType):
(AddToImplIncludes):
(AddToIncludes):
Abstract includes functions to allow passing in an include hash.
(GenerateCallbackFunctionHeader):
(GenerateCallbackFunctionImplementation):
(GenerateCallbackInterfaceHeader):
(GenerateCallbackInterfaceImplementation):
(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
to allow using it for both the new callbacks as well as the old callback interfaces.
* bindings/scripts/IDLParser.pm:
(Parse):
(applyTypedefs):
(applyTypedefsToOperation):
(parseCallbackRest):
Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
* bindings/scripts/IDLAttributes.txt:
Remove support for Callback=FunctionOnly.
* bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
* bindings/scripts/test/JS/JSTestCallback.h: Removed.
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
* bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestCallback.idl: Removed.
* bindings/scripts/test/TestCallbackFunction.idl:
* bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
* bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestTypedefs.idl:
Update existing tests and add new ones to test callback functions specifically.
2016-11-04 Alex Christensen <achristensen@webkit.org>
Move isDefaultPortForProtocol from URLParser.cpp back to URL.cpp
https://bugs.webkit.org/show_bug.cgi?id=164439
Reviewed by Daniel Bates.
No change in behaviour.
* platform/URL.cpp:
(WebCore::defaultPortForProtocol):
(WebCore::isDefaultPortForProtocol):
* platform/URLParser.cpp:
(WebCore::URLParser::defaultPortForProtocol):
(WebCore::URLParser::parsePort):
(WebCore::defaultPortForProtocol): Deleted.
(WebCore::isDefaultPortForProtocol): Deleted.
* platform/URLParser.h:
2016-11-04 Wenson Hsieh <wenson_hsieh@apple.com>
Safari does not emit composition end if blurred for dead key / Japanese IME
https://bugs.webkit.org/show_bug.cgi?id=164369
<rdar://problem/29050439>
Reviewed by Ryosuke Niwa.
On Mac, _before_ changing selection, try to finalize the composition by calling Editor::cancelComposition early.
This is because the focused element may have changed after performing the selection change, so we would
otherwise be dispatching the `compositionend` to the new focused element (or no compositionend at all) instead
of the element with the composition.
Doing this allows us to match Chrome and Firefox behavior. After canceling the composition, we then need to also
clear the system IME state. We do this on Mac WK1/WK2 through the cancelComposition() codepath, which ends up
calling into -discardMarkedText, which resets the marked text state. Some minor refactoring was performed to
accomplish this -- currently, discardedComposition sends a CompositionWasCanceled message over to the UI process
that discards the marked text, and then updates the editor state. This patch splits this into two separate
steps -- see the WebKit2 ChangeLog for more details.
Test: fast/events/ime-compositionend-on-selection-change.html
* editing/Editor.cpp:
(WebCore::Editor::selectionWillChange):
* editing/Editor.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
* editing/mac/EditorMac.mm:
(WebCore::Editor::selectionWillChange):
* loader/EmptyClients.h:
* page/EditorClient.h:
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
https://bugs.webkit.org/show_bug.cgi?id=164424
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
spec in flux/under discussion.
We'll update either source or the tests as things are resolved.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2016-11-04 Ryosuke Niwa <rniwa@webkit.org>
Load stylesheets in link elements inside a connected shadow tree
https://bugs.webkit.org/show_bug.cgi?id=160683
<rdar://problem/29040652>
Reviewed by Antti Koivisto.
Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
when it's connected to a document instead of always talking to document's style scope.
Tests: fast/shadow-dom/link-element-in-shadow-tree.html
fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
early when inDocument() is false.
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
(WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
a document instead of whenever its self-inclusive ancestor is inserted into a container.
(WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
calling removePendingSheet since the latter depends on m_styleScope being not null.
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
element has just become connected to a document.
(WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
* style/StyleScope.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedInto): Ditto.
(WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
2016-11-04 Said Abou-Hallawa <sabouhallawa@apple.com>
Add a setting and preferences to enable/disable async image decoding
https://bugs.webkit.org/show_bug.cgi?id=164417
Reviewed by Simon Fraser.
Add an asyncImageDecodingEnabled setting. This setting controls whether an
image "can" be asynchronously decoded on a separate thread or not. The
function ImageSource::isAsyncDecodingRequired() will be used in conjunction
with this setting to decide whether an image "should" be asynchronously
decoded or not.
* page/Settings.in:
2016-11-04 Tim Horton <timothy_horton@apple.com>
Apply post-landing review comments for r208347
* dom/Element.cpp:
(WebCore::Element::findAnchorElementForLink):
Use attributeWithoutSynchronization.
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
(WebCore::PrintContext::collectLinkedDestinations):
(WebCore::PrintContext::outputLinkedDestinations):
* page/PrintContext.h:
Pass Document by reference instead of Node by pointer,
use ElementTraversal instead of NodeTraversal to avoid
having to locally check the type, and null-check renderers.
2016-11-04 Myles C. Maxfield <mmaxfield@apple.com>
Implement WebGL2RenderingContext::copyBufferSubData()
https://bugs.webkit.org/show_bug.cgi?id=164008
Reviewed by Dean Jackson.
Similar to previous work regarding WebGL 2 buffers, this method implements
the ability to copy from one buffer to another without the data leaving
the GPU.
Test: fast/canvas/webgl/copyBufferSubData.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyBufferSubData):
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::associateCopyBufferSubData):
* html/canvas/WebGLBuffer.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::copyBufferSubData):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
https://bugs.webkit.org/show_bug.cgi?id=164420
Reviewed by Tim Horton.
Rename:
commitNewTreeState -> commitTreeState ("new" was redundant)
updateBeforeChildren -> commitStateBeforeChildren
updateAfterChildren -> commitStateAfterChildren
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNode):
(WebCore::ScrollingTree::commitNewTreeState): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::commitStateAfterChildren):
(WebCore::ScrollingTreeNode::updateAfterChildren): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Deleted.
(WebCore::ScrollingTreeScrollingNode::updateAfterChildren): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::commitTreeState):
(WebCore::ThreadedScrollingTree::commitNewTreeState): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren): Deleted.
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::commitNewTreeState): Deleted.
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFixedNode::updateBeforeChildren): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren): Deleted.
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeStickyNode::updateBeforeChildren): Deleted.
2016-11-03 Anders Carlsson <andersca@apple.com>
Add new 'other' Apple Pay button style
https://bugs.webkit.org/show_bug.cgi?id=164384
rdar://problem/28302528
Reviewed by Dean Jackson.
* DerivedSources.make:
* WebCorePrefix.h:
Add extension points.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
Add ApplePayButtonType::Other.
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
Add CSSValueOther.
* css/CSSValueKeywords.in:
Add other.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Add CSSValueOther.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add CSSValueOther.
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
Handle ApplePayButtonType::Other.
* rendering/style/RenderStyleConstants.h:
Add ApplePayButtonType::Other.
2016-11-04 Antti Koivisto <antti@apple.com>
slotted() pseudo does not work with ID selector
https://bugs.webkit.org/show_bug.cgi?id=160538
<rdar://problem/28534529>
Reviewed by Andreas Kling.
When we saw an id selector while addin rules we immediately threw it into the m_idRules
optimization bucket and bailed out. However selectors containing ::slotted must always end
up in m_slottedPseudoElementRules list no matter what else is there.
Fix by treating id like other selectors and only choosing the bucket after analysing all
the selector components.
Test: fast/shadow-dom/css-scoping-slot-with-id.html
* css/RuleSet.cpp:
(WebCore::RuleSet::addRule): Also made this use switch instead of a series of ifs.
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Handle IDBObjectStore rename behavior properly when version change transaction aborts.
https://bugs.webkit.org/show_bug.cgi?id=164416
Reviewed by Beth Dakin.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
2016-11-04 Keith Rollin <krollin@apple.com>
NetworkSession: Add NetworkDataTask implementation for blobs
https://bugs.webkit.org/show_bug.cgi?id=163939
Reviewed by Alex Christensen.
* WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
* fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
* platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
* platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
* platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Use IDB-specific exceptions in places where the generic exceptions are currently used.
https://bugs.webkit.org/show_bug.cgi?id=164406
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::setName):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
2016-11-04 Joanmarie Diggs <jdiggs@igalia.com>
AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
https://bugs.webkit.org/show_bug.cgi?id=164331
Reviewed by Chris Fleizach.
The ATK code is using is<AccessibilityListBox>() to identify native listboxes.
But is<AccessibilityListBox>() returns the value of isListBox() which returns
true both for AccessibilityListBox instances as well as for AccessibilityObject
instances which have an AccessibilityRole value of ListBoxRole. Because only
native listboxes should be AccessibilityListBoxes, add isNativeListBox() so
that we can distinguish native and ARIA listboxes.
Tests: accessibility/aria-listbox-clear-selection-crash.html
accessibility/listbox-clear-selection.html
* accessibility/AccessibilityListBox.h:
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isNativeListBox):
(WebCore::AccessibilityObject::isListBox):
2016-11-04 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
https://bugs.webkit.org/show_bug.cgi?id=164405
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::setName):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
2016-11-04 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ByteStreamController error()
https://bugs.webkit.org/show_bug.cgi?id=164319
Reviewed by Youenn Fablet.
Implemented error() method of ReadableByteStreamController.
Updated test expectations for error() and added IDL-related tests.
* Modules/streams/ReadableByteStreamController.js:
(error): Implemented.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController):
(isReadableByteStreamController): Added.
(readableByteStreamControllerError): Added.
(readableByteStreamControllerClearPendingPullIntos): Added.
* Modules/streams/ReadableStream.js:
(initializeReadableStream): More detailed error message.
* Modules/streams/ReadableStreamDefaultController.js:
(error): Removed unnecessary variable declaration.
* bindings/js/WebCoreBuiltinNames.h: Added totalQueuedBytes.
2016-11-03 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Handle IDBIndex rename behavior properly when version change transaction aborts.
https://bugs.webkit.org/show_bug.cgi?id=164403
Reviewed by Alex Christensen.
No new tests (Covered by existing test).
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): Only rollback the info if this index
already existed before this version change transaction.
2016-11-03 Youenn Fablet <youenn@apple.com>
[WebRTC] Introduce asynchronous backend createOffer API
https://bugs.webkit.org/show_bug.cgi?id=164365
Reviewed by Sam Weinig.
Covered by existing tests.
Removing PeerEndpointBackendClient as it is only RTCPeerConnection.
This allows removing virtual for some functions.
Moving MediaEndpointPeerClient::m_client to PeerEndpointBackendClient::m_peerConnection and making it a reference.
Implementing createOffer at PeerConnectionBackend by splitting it in four sub-functions:
- main createOffer, implemented at PeerConnectionBackend.
- doCreateOffer implemented by subclasses (MediaEndpointPeerConnection).
- createOfferSucceeded/createOfferFailed implemented by PeerConnectionBackend.
* CMakeLists.txt:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::createMediaEndpointPeerConnection):
(WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
(WebCore::MediaEndpointPeerConnection::doCreateOffer):
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::createReceiver):
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
(WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
(WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
(WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
(WebCore::MediaEndpointPeerConnection::createOffer): Deleted.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOffer):
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::createPeerConnectionBackend): Deleted.
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::PeerConnectionBackend):
(WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient): Deleted.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
* Modules/mediastream/RTCPeerConnection.h:
* WebCore.xcodeproj/project.pbxproj:
2016-11-03 Antti Koivisto <antti@apple.com>
REGRESSION (r207717): DumpRenderTree crashed in com.apple.WebCore: WebCore::Style::Scope::flushPendingUpdate + 16
https://bugs.webkit.org/show_bug.cgi?id=164397
<rdar://problem/29100135>
Reviewed by Ryosuke Niwa.
The problem here was that we were leaving stale pointers to Document::m_inDocumentShadowRoots set when
using fast-path document teardown.
(Patch and stories mostly by rniwa).
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::didInsertInDocumentShadowRoot):
(WebCore::Document::didRemoveInDocumentShadowRoot):
Improve asserts.
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot):
Remove the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
since the latter function tears down nodes via the deletion queue during a document destruction and use
notifyChildNodeRemoved() on nodes that outlive the shadow root.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::~ShadowRoot):
Take care to clean up inDocumentShadowRoots for fast-pathed destruction too.
(WebCore::ShadowRoot::insertedInto):
(WebCore::ShadowRoot::removedFrom):
Improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
m_inDocumentShadowRoots when the connected-ness changes.
2016-11-03 Simon Fraser <simon.fraser@apple.com>
Give all the geometry classes a single-argument scale() function for consistency
https://bugs.webkit.org/show_bug.cgi?id=164400
Reviewed by Zalan Bujtas.
Add single-argument scale() to FloatPoint, FloatQuad, FloatSize and LayoutPoint, as well
as adding one to GraphicsContext. Switch callers who passed the same value for sx and sy
to the new functions.
* dom/Document.cpp:
(WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::init):
(WebCore::MouseRelatedEvent::computeRelativePosition):
* dom/TreeScope.cpp:
(WebCore::TreeScope::nodeFromPoint):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
* platform/cocoa/ThemeCocoa.mm:
(WebCore::fitContextToBox):
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::scale):
* platform/graphics/FloatQuad.h:
(WebCore::FloatQuad::scale):
* platform/graphics/FloatSize.h:
(WebCore::FloatSize::scale):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::applyDeviceScaleFactor):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::scale):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::scale):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::update):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::drawConsuming):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/mac/ThemeMac.mm:
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::paintStepper):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::nodeAtPoint):
* rendering/RenderMediaControls.cpp:
(WebCore::getUnzoomedRectAndAdjustCurrentContext):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::selectionRectForTextFragment):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::blendAnimatedFloatPoint):
(WebCore::SVGPathBlender::blendArcToSegment):
* svg/SVGPathParser.cpp:
(WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
(WebCore::SVGPathParser::parseCurveToQuadraticSegment):
(WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
(WebCore::SVGPathParser::decomposeArcToCubic):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::localCoordinateSpaceTransform):
2016-11-03 Antti Koivisto <antti@apple.com>
REGRESSION (r207669): Crash under media controls shadow root construction
https://bugs.webkit.org/show_bug.cgi?id=164381
<rdar://problem/28935401>
Reviewed by Simon Fraser.
The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
callback should be used.
Test: media/media-controls-shadow-construction-crash.html
Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::finishedInsertingSubtree):
Move configureMediaControls() to finishedInsertingSubtree().
* html/HTMLMediaElement.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):
Add an assert to make the bad state easier to hit in tests.
2016-11-03 Ryosuke Niwa <rniwa@webkit.org>
Add an assertion to diagnose stress GC bots test failures
https://bugs.webkit.org/show_bug.cgi?id=164396
Reviewed by Antti Koivisto.
Added an assertion for calling ElementQueue::add while ElementQueue::invokeAll is in progress.
This should never happen as long as all DOM API has an appropriate CEReactions IDL attribute.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add):
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
* dom/CustomElementReactionQueue.h:
2016-11-03 Said Abou-Hallawa <sabouhallawa@apple.com>
Add the asynchronous image decoding mode
https://bugs.webkit.org/show_bug.cgi?id=155546
Reviewed by Simon Fraser.
The asynchronous image decoding feature targets enhancing the rendering
in two scenarios: the animated images and scrolling a page which large
images. Enabling this feature for these two scenarios will be landed
separately.
The goal of the asynchronous image decoding is to have the decoded image
frame ready before it has to be drawn. Drawing an image does not have to
wait the image frame to be decoded.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex): Use the negation of frameHasValidNativeImageAtIndex().
* platform/graphics/BitmapImage.h:
(WebCore::BitmapImage::frameIsBeingDecodedAtIndex): Answers whether a frame is being decoded.
(WebCore::BitmapImage::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
(WebCore::BitmapImage::frameHasInvalidNativeImageAtIndex): Deleted.
* platform/graphics/Image.h:
(WebCore::Image::newFrameNativeImageAvailableAtIndex): Notifies the image with the availability of a frame NativeImage.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::isBeingDecoded): Answers whether the frame is being decoded.
(WebCore::ImageFrame::hasValidNativeImage): Checks the validity of the frame.
(WebCore::ImageFrame::hasInvalidNativeImage): Deleted.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::~ImageFrameCache): Asserts the decoding loop was ended before deleting the ImageFrameCache.
(WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Rename this function to matches the other which take the frame index.
(WebCore::ImageFrameCache::setFrameMetadataAtIndex): Ditto.
(WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): It setts the ImageFrame's members and updates the decoded size.
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Replaces the frame NativeImage and notifies the Image with the new frame.
(WebCore::ImageFrameCache::decodingQueue): Ensures the decoding WorkQueue is created and returns it.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Starts a decoding WorkQueue which loops until m_frameRequestQueue is closed.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Allows ImageSource to send a request to start asynchronous frame image decoding.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Stops the decoding WorkQueue by closing m_frameRequestQueue.
(WebCore::ImageFrameCache::frameAtIndex): Call replaceFrameNativeImageAtIndex().
(WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Returns true if a request for the image frame is issued but not finished yet.
(WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
(WebCore::ImageFrameCache::setFrameNativeImage): Deleted. Was renamed to be setFrameNativeImageAtIndex.
(WebCore::ImageFrameCache::setFrameMetadata): Deleted. Was renamed to be setFrameMetadataAtIndex
(WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::create): The decoding queue needs to hold a reference to this class so it can stop decoding safely without blocking.
(WebCore::ImageFrameCache::hasDecodingQueue): Returns true if a decoding queue has started.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource): Call ImageFrameCache::create().
(WebCore::ImageSource::clear): Deleting the decoder is unnecessary for asynchronous decoding because ImageFrameCache manages all the memory.
(WebCore::ImageSource::destroyDecodedData):
(WebCore::ImageSource::destroyDecodedDataIfNecessary):
(WebCore::ImageSource::ensureDecoderAvailable):
(WebCore::ImageSource::dataChanged):
(WebCore::ImageSource::isAllDataReceived):
(WebCore::ImageSource::isAsyncDecodingRequired): Answers the question whether the async image decoding is required for this ImageSource.
(WebCore::ImageSource::frameImageAtIndex):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::decodedSize):
(WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
(WebCore::ImageSource::stopAsyncDecodingQueue):
(WebCore::ImageSource::isSizeAvailable):
(WebCore::ImageSource::frameCount):
(WebCore::ImageSource::repetitionCount):
(WebCore::ImageSource::filenameExtension):
(WebCore::ImageSource::hotSpot):
(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation):
(WebCore::ImageSource::singlePixelSolidColor):
(WebCore::ImageSource::frameIsBeingDecodedAtIndex):
(WebCore::ImageSource::frameIsCompleteAtIndex):
(WebCore::ImageSource::frameHasAlphaAtIndex):
(WebCore::ImageSource::frameHasImageAtIndex):
(WebCore::ImageSource::frameSubsamplingLevelAtIndex):
(WebCore::ImageSource::frameSizeAtIndex):
(WebCore::ImageSource::frameBytesAtIndex):
(WebCore::ImageSource::frameDurationAtIndex):
(WebCore::ImageSource::frameOrientationAtIndex):
Make m_frameCache a type Ref<ImageFrameCache>. Use '->' instead of '.' when accessing its members.
(WebCore::ImageSource::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
(WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
2016-11-03 Myles C. Maxfield <mmaxfield@apple.com>
[WebGL2] Implement getBufferSubData()
https://bugs.webkit.org/show_bug.cgi?id=164111
Reviewed by Dean Jackson.
The call exists in OpenGL 3.2 but in order to have parity with
OpenGL ES 3 we back it with glMapBufferRange() instead.
This patch simply adds surface area to GraphicsContext3D
until we can get an ANGLE implementation of it.
When testing this patch I discovered that r207649 incorrectly
interpreted arguments to bufferData() and bufferSubData() as
byte offsets. Instead, they should be element indices. This
patch fixes those functions to work correctly so that
getBufferSubData() can be tested correctly.
Tests: fast/canvas/webgl/webgl2-buffers.html
fast/canvas/webgl/getBufferSubData-webgl1.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::arrayBufferViewElementSize):
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
(WebCore::WebGL2RenderingContext::getBufferSubData):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getBufferSubData):
(WebCore::GraphicsContext3D::mapBufferRange):
(WebCore::GraphicsContext3D::unmapBuffer):
2016-11-03 Chris Dumez <cdumez@apple.com>
Unreviewed, mark support for the 'download' attribute as 'Done'.
* features.json:
2016-11-03 Chris Dumez <cdumez@apple.com>
[WK2][Cocoa] Implement user interface for HTML form validation
https://bugs.webkit.org/show_bug.cgi?id=164143
<rdar://problem/28944652>
Reviewed by Simon Fraser.
Add ValidationBubble class to show HTML form validation messages
using native dialogs. It currently has an implementation for both
Mac and iOS. It is in WebCore under platform/ so that it can be
used by both WebKit1 and WebKit2.
Update ownership of ValidationMessageClient so that is is owned
by the Page using a unique_ptr<>, which seems to be the modern
way of handling lifetime for page clients.
Test: fast/forms/validation-messages.html
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::updateValidationMessage):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h:
(WebCore::Page::validationMessageClient):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* platform/ValidationBubble.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
(WebCore::ValidationBubble::message):
* platform/ios/ValidationBubbleIOS.mm: Added.
(-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
(WebCore::ValidationBubble::ValidationBubble):
(WebCore::ValidationBubble::~ValidationBubble):
(WebCore::ValidationBubble::show):
(WebCore::ValidationBubble::setAnchorRect):
* platform/mac/ValidationBubbleMac.mm: Added.
(WebCore::ValidationBubble::ValidationBubble):
(WebCore::ValidationBubble::~ValidationBubble):
(WebCore::ValidationBubble::showRelativeTo):
2016-11-03 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Rename IDBKeyRange.contains to IDBKeyRange.includes.
https://bugs.webkit.org/show_bug.cgi?id=164383
Reviewed by Beth Dakin.
No new tests (Updated existing tests).
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::includes):
(WebCore::IDBKeyRange::contains): Deleted.
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:
2016-11-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208302.
This change causes LayoutTest crashes under GuardMalloc.
Reverted changeset:
"Load stylesheets in link elements inside a connected shadow
tree"
https://bugs.webkit.org/show_bug.cgi?id=160683
http://trac.webkit.org/changeset/208302
2016-11-03 Chris Dumez <cdumez@apple.com>
Unreviewed, add HTML5 specification for HTML Interactive Form Validation feature.
* features.json:
2016-11-03 Chris Dumez <cdumez@apple.com>
Unreviewed, add HTML Interactive Form Validation to features.json
* features.json:
2016-11-03 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, rolling out due to crash in Amazon web site
https://bugs.webkit.org/show_bug.cgi?id=164380
<rdar://problem/29094221>
* dom/Node.idl:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
2016-11-03 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support binary keys.
<rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/binary-keys-1-private.html
storage/indexeddb/modern/binary-keys-1.html
Changes to other existing tests.
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::createBinary):
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::compare):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::binary):
(WebCore::compareBinaryKeyData):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::operator==):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::hash):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
(WebCore::createIDBKeyFromValue):
* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
(WebCore::ThreadSafeDataBuffer::copyData):
(WebCore::ThreadSafeDataBuffer::size):
(WebCore::ThreadSafeDataBuffer::operator==):
(WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
2016-11-03 Tim Horton <timothy_horton@apple.com>
Printing to PDF should produce internal links when HTML has internal links
https://bugs.webkit.org/show_bug.cgi?id=112081
<rdar://problem/5955705>
Reviewed by Simon Fraser.
Patch originally by David Lattimore.
No new tests, as it's unclear how to test PDF output.
* dom/Element.cpp:
(WebCore::Element::findAnchorElementForLink):
* dom/Element.h:
Add findAnchorElementForLink, which looks up the anchor element corresponding
to the current element's href, and also returns the fragment name as an out parameter.
* page/PrintContext.cpp:
(WebCore::PrintContext::PrintContext):
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
(WebCore::PrintContext::end):
(WebCore::PrintContext::collectLinkedDestinations):
(WebCore::PrintContext::outputLinkedDestinations):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
Plumb internal links (fragment links) through to GraphicsContext, using
the fragment name from the page.
* page/PrintContext.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::supportsInternalLinks):
(WebCore::GraphicsContext::setDestinationForRect):
(WebCore::GraphicsContext::addDestinationAtPoint):
* platform/graphics/GraphicsContext.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::supportsInternalLinks):
(WebCore::GraphicsContext::setDestinationForRect):
(WebCore::GraphicsContext::addDestinationAtPoint):
Plumb internal links through to the CGContext. Apply the CTM, because
these functions expect positions in global coordinates.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::setURLForRect):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::setURLForRect):
Adjust setURLForRect to take a FloatRect, like everything else, and
stop rounding.
2016-11-03 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208298.
https://bugs.webkit.org/show_bug.cgi?id=163939
caused asan crashes
Reverted changeset:
"NetworkSession: Add NetworkDataTask implementation for blobs"
https://bugs.webkit.org/show_bug.cgi?id=163939
http://trac.webkit.org/changeset/208298
2016-11-03 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Native Windows widgets are drawn upside-down
https://bugs.webkit.org/show_bug.cgi?id=164370
Reviewed by Alex Christensen.
When we return from drawing in GDI code, we need to flip the resulting
bitmap so that it draws in the proper orientation in Direct2D.
Tested by existing widget tests.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Flip before drawing
to our Direct2D context.
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Remove PageThrottler & all related code
https://bugs.webkit.org/show_bug.cgi?id=164302
Reviewed by Ryosuke Niwa.
All relevant information now available from the ActivityState.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::updateAudioAssertionState): Deleted.
* html/HTMLMediaElement.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::completed):
(WebCore::FrameLoader::started):
* loader/FrameLoader.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pageActivityStateChanged): Deleted.
(WebCore::Page::pageThrottler): Deleted.
* page/PageThrottler.cpp: Removed.
* page/PageThrottler.h: Removed.
2016-11-03 Dan Bernstein <mitz@apple.com>
REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
https://bugs.webkit.org/show_bug.cgi?id=164340
<rdar://problem/29074344>
Reviewed by Tim Horton.
To give WebKit a chance to deliver the painting milestones to its client after the commit,
we must tell it about them before or during the commit. To that end, we should not defer
the call to firePaintRelatedMilestonesIfNeeded until after the commit.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed
m_paintRelatedMilestonesTimer initializer.
(WebCore::RenderLayerCompositor::didPaintBacking): Call
FrameView::firePaintRelatedMilestonesIfNeeded directly from here.
(WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted.
* rendering/RenderLayerCompositor.h:
2016-11-03 Antti Koivisto <antti@apple.com>
imported/mozilla/svg/paint-order-01.svg and imported/mozilla/svg/paint-order-02.svg are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=164355
Reviewed by Ryosuke Niwa.
Revert one change from https://trac.webkit.org/changeset/207669 to see if it is causing flakiness in
some XML based tests.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
2016-11-02 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, fix CLoop build after r208320.
https://bugs.webkit.org/show_bug.cgi?id=162980
Guard with ENABLE(JIT).
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2016-11-02 Brady Eidson <beidson@apple.com>
Expand upon IndexedDB status in features.json.
* features.json:
2016-11-02 Myles C. Maxfield <mmaxfield@apple.com>
CSS.supports("font-variation-settings", "'wght' 500") erroneously returns false
https://bugs.webkit.org/show_bug.cgi?id=164244
Reviewed by Michael Catanzaro.
Because we weren't passing a Document into CSSParserContext's constructor,
there was no way for our parser to know whether the runtime switch was on
or not. Instead, we can use the CallWith attribute in the IDL file to pass
in a Document.
Test: fast/text/variations/css-supports-runtime-switch.html
* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::supports):
* css/DOMCSSNamespace.h:
* css/DOMCSSNamespace.idl:
2016-11-02 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Add DOMJIT::Signature
https://bugs.webkit.org/show_bug.cgi?id=162980
Reviewed by Saam Barati and Sam Weinig.
We introduce DOMJIT::Signature. This signature object is automatically generated by IDL code generator.
It holds (1) types, (2) pointer to the unsafe function (the function without checks), and (3) the effect
of the function. We use constexpr to initialize DOMJIT::Signature without invoking global constructors.
Thus the content is embedded into the binary as the constant values.
We also clean up the IDL code generator related to DOMJIT part. Instead of switching things inside IDL
code generator, we use C++ template to dispatch things at compile time. This template meta programming
is highly utilized in IDL these days.
To make DOMJIT::Signature constexpr, we also need to define DOMJIT abstract heap things in the build time.
To do so, we introduce a tiny Ruby script to calculate the range of abstract heaps. We can offer the abstract
heap tree as YAML format and the script will produce a C++ header holding the calculated abstract heap ranges
* CMakeLists.txt:
* DerivedSources.make:
* ForwardingHeaders/bytecode/SpeculatedType.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
* ForwardingHeaders/domjit/DOMJITSignature.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.cpp.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePropertiesHashTable):
(GetUnsafeArgumentType):
(GetArgumentTypeFilter):
(GetResultTypeFilter):
(GenerateImplementation):
(UnsafeToNative):
(GenerateHashTableValueArray):
(ComputeFunctionSpecial):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
(WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionGetAttributeCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionItem):
(WebCore::jsTestDOMJITPrototypeFunctionItemCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
(WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionHasAttributeCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
(WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameCaller):
(WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
* bindings/scripts/test/TestDOMJIT.idl:
* dom/Element.idl:
* domjit/DOMJITAbstractHeapRepository.yaml: Added.
* domjit/DOMJITIDLConvert.h: Added.
(WebCore::DOMJIT::DirectConverter<IDLDOMString>::directConvert<StringConversionConfiguration::Normal>):
* domjit/DOMJITIDLType.h: Added.
* domjit/DOMJITIDLTypeFilter.h: Added.
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeFirstChildDOMJIT::callDOMGetter):
(WebCore::NodeLastChildDOMJIT::callDOMGetter):
(WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
(WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
(WebCore::NodeParentNodeDOMJIT::callDOMGetter):
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
* domjit/generate-abstract-heap.rb: Added.
2016-11-02 Simon Fraser <simon.fraser@apple.com>
Followup after r208314.
The style created for reflections contains transforms and a mask, so needs to get explicit
z-index on it. This doesn't change rendering, since this layer has no children.
Fixes assertions in various reflection tests.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
2016-11-02 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
https://bugs.webkit.org/show_bug.cgi?id=164350
rdar://problem/29053414
Reviewed by Dean Jackson.
After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle
with a non-1 opacity, but without the explicit z-index that triggers stacking context.
This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
save/restores.
This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim->animate()
can spit out a new style when in the StartWaitTimer sometimes, so "!keyframeAnim->waitingToStart() && !keyframeAnim->postActive()"
gave the wrong answser.
Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
when it actually produced a new style, and when true, do the setZIndex(0).
Test: animations/stacking-during-opacity-animation.html
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* page/animation/KeyframeAnimation.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::restore):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents): No functional change, but created scope for the
GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.
2016-11-02 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] [WebGL] Multisample resolve step may operate on stale data
https://bugs.webkit.org/show_bug.cgi?id=164347
Reviewed by Dean Jackson.
When antialiasing is enabled, WebKit internally creates a multisampled FBO
and uses that as the target of all the drawing commands. Then, just before
we actually put the image on the glass, we perform a “resolve” step which
averages all the samples to create the final image. However, it appears
that this resolve step only waits for commands to complete which were
already submitted to the hardware. OpenGL is allowed (indeed, expected) to
batch up drawing commands in main memory so it can submit them to the
hardware in fewer batches, but this means that the hardware may not know
about all the commands that the application submitted. Because of this,
the data the resolve step saw is the result of only some of the previous
draw calls - not all of them.
This doesn’t occur on macOS because we have a different code path there
for performing the resolve step. On iOS 9 and below, WebKit didn’t
implement multisampling in WebGL at all, which explains why this only
occurs on iOS 10.
Luckily, the OpenGL command glFlush() is exactly designed to submit any
pending commands to the hardware.
Test: fast/canvas/webgl/multisample-resolve-consistency.html
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2016-11-02 Brady Eidson <beidson@apple.com>
Give IDBKey(Data) a WTF::Variant overhaul.
https://bugs.webkit.org/show_bug.cgi?id=164332
Reviewed by Alex Christensen and Andy Estes.
No new tests (Refactor, no behavior change).
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::isValid):
(WebCore::IDBKey::compare):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::array):
(WebCore::IDBKey::string):
(WebCore::IDBKey::date):
(WebCore::IDBKey::number):
(WebCore::IDBKey::IDBKey): Deleted.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
(WebCore::IDBKeyData::operator==):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::hash):
(WebCore::IDBKeyData::string):
(WebCore::IDBKeyData::date):
(WebCore::IDBKeyData::number):
(WebCore::IDBKeyData::array):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
2016-11-01 Sam Weinig <sam@webkit.org>
[WebIDL] Move interfaces and typed arrays over to JSDOMConvert
https://bugs.webkit.org/show_bug.cgi?id=164256
Reviewed by Alex Christensen.
- Add the ability to pass an "exception thrower" functor to the convert functions.
This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
for now, but can be extended for more types as necessary to improve exception messages.
- Add support for using toJSNewlyCreated in JSDOMConvert.
* bindings/generic/IDLTypes.h:
(WebCore::IDLString::extractValueFromNullable):
Use forwarding to simplify extraction function.
(WebCore::IDLInterface::nullValue):
Update nullValue to work for both RefPtr<T> and T*.
(WebCore::IDLInterface::extractValueFromNullable):
Use forwarding to simplify extraction function.
* bindings/js/JSDOMConvert.h:
(WebCore::DefaultExceptionThrower::operator()):
Add a default "exception thrower" which throws a normal type error.
(WebCore::convert):
Add an overload of convert which takes an "exception thrower".
(WebCore::toJSNewlyCreated):
Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
which will return "newly created" values. This only works for types that implement
a toJSNewlyCreated function for themselves.
(WebCore::Converter<IDLNullable<T>>::convert):
Fix the return type of Converter<IDLNullable<T>> to be specialized when
T is an IDLInterface. In that case, we want to match the return type of
inner converter.
Also add implementation of convert overload that takes an "exception thrower".
(WebCore::JSConverter<IDLNullable<T>>::convert):
(WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
Reimplement conversion to use forwarding of the value.
(WebCore::Converter<IDLInterface<T>>::convert):
Add support for an "exception thrower".
(WebCore::Detail::getPtrOrRef):
Add helper functions that extract either a pointer or reference, depending on the type,
and const_casts it allowing the value to be used with toJS functions.
(WebCore::JSConverter<IDLInterface<T>>::convert):
Re-implement to support more varied input values.
(WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
Added. Forwards to overloaded toJSNewlyCreated functions.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add support for adding the right includes for SerializedScriptValue and Dictionary.
(GetArgumentExceptionThrower):
(GetAttributeExceptionThrower):
Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
being passed to setters and functions.
(GenerateParametersCheck):
Move around special cases so it is clear that it's not wrappers and typed arrays that
need specialization here, it is now just EventListener and XPathNSResolver.
(GetIDLInterfaceName):
Add helper to get the InterfaceName for use in IDLInterface template.
(GetBaseIDLType):
Use new GetIDLInterfaceName helper.
(IsValidContextForJSValueToNative):
Remove IDLOperation as a valid context. It is not.
(JSValueToNative):
Move JSDOMConvert based conversion to the bottom, to show that everything above it
is a special case that should be fixed. I have used explicit c-style if-statements
to make it clear what the types of the exceptional cases are.
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add wrapper types and typed arrays to the list needing state and globalObject.
(NativeToJSValue):
Move JSDOMConvert based conversion to the bottom, to show that everything above it
is a special case that should be fixed. I have used explicit c-style if-statements
to make it clear what the types of the exceptional cases are.
(JSValueToNativeIsHandledByDOMConvert): Deleted.
(NativeToJSValueIsHandledByDOMConvert): Deleted.
Remove predicates protecting use of JSDOMConvert now that it is the default.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.
2016-11-02 David Kilzer <ddkilzer@apple.com>
Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
<https://webkit.org/b/164333>
<rdar://problem/29072727>
Reviewed by Alex Christensen.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add implementation for new key method.
* page/DiagnosticLoggingKeys.h:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add declaration for new key method.
2016-11-02 Filip Pizlo <fpizlo@apple.com>
The GC should be in a thread
https://bugs.webkit.org/show_bug.cgi?id=163562
Reviewed by Geoffrey Garen and Andreas Kling.
No new tests because existing tests cover this.
We now need to be more careful about using JSLock. This fixes some places that were not
holding it. New assertions in the GC are more likely to catch this than before.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
2016-11-02 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
https://bugs.webkit.org/show_bug.cgi?id=164136
<rdar://problem/29028462>
Reviewed by Brian Burg.
Tests: inspector/worker/debugger-pause.html
inspector/worker/debugger-scripts.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
New file.
* inspector/PageDebuggerAgent.h:
* inspector/WorkerDebuggerAgent.cpp: Added.
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::breakpointActionLog):
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/WorkerDebuggerAgent.h: Added.
DebuggerAgent customizations for Workers.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Add the new agent.
* inspector/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
Implement the nested run loop for Workers.
2016-11-02 Simon Fraser <simon.fraser@apple.com>
Add Battery Status to features.json, marked as "Removed".
* features.json:
2016-11-02 Ryosuke Niwa <rniwa@webkit.org>
Load stylesheets in link elements inside a connected shadow tree
https://bugs.webkit.org/show_bug.cgi?id=160683
<rdar://problem/29040652>
Reviewed by Antti Koivisto.
Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
when it's connected to a document instead of always talking to document's style scope.
Also improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
m_inDocumentShadowRoots when the connected-ness changes.
This patch also removes the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
since the latter function tears down nodes via the deletion queue during a document destruction and use
notifyChildNodeRemoved() on nodes that outlive the shadow root.
Tests: fast/shadow-dom/link-element-in-shadow-tree.html
fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
* dom/Document.cpp:
(WebCore::Document::didInsertInDocumentShadowRoot): Assert that the shadow root is not in the set.
(WebCore::Document::didRemoveInDocumentShadowRoot): Assert that the shadow root is not in the document as
this function is now called after Node::removedFrom in ShadowRoot::removedFrom.
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot): See the description above.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedInto): Only call didInsertInDocumentShadowRoot when the this shadow root is
newly connected to a document so we can add assertions in didInsertInDocumentShadowRoot.
(WebCore::ShadowRoot::removedFrom): Ditto for the removal.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
early when inDocument() is false.
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
(WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
a document instead of whenever its self-inclusive ancestor is inserted into a container.
(WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
calling removePendingSheet since the latter depends on m_styleScope being not null.
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
element has just become connected to a document.
(WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
* style/StyleScope.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedInto): Ditto.
(WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
2016-11-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Clean up new parser's grid layout ifdefs/runtime checking
https://bugs.webkit.org/show_bug.cgi?id=164341
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-02 Alex Christensen <achristensen@webkit.org>
Remove Battery Status API from the tree
https://bugs.webkit.org/show_bug.cgi?id=164213
Reviewed by Sam Weinig.
* CMakeLists.txt:
* DerivedSources.cpp:
* Modules/battery: Removed.
* Modules/battery/BatteryClient.h: Removed.
* Modules/battery/BatteryController.cpp: Removed.
* Modules/battery/BatteryController.h: Removed.
* Modules/battery/BatteryManager.cpp: Removed.
* Modules/battery/BatteryManager.h: Removed.
* Modules/battery/BatteryManager.idl: Removed.
* Modules/battery/BatteryStatus.cpp: Removed.
* Modules/battery/BatteryStatus.h: Removed.
* Modules/battery/NavigatorBattery.cpp: Removed.
* Modules/battery/NavigatorBattery.h: Removed.
* Modules/battery/NavigatorBattery.idl: Removed.
* PlatformEfl.cmake:
* dom/EventTargetFactory.in:
* platform/efl/BatteryProviderEfl.cpp: Removed.
* platform/efl/BatteryProviderEfl.h: Removed.
* platform/efl/BatteryProviderEflClient.h: Removed.
* platform/glib/BatteryProviderUPower.cpp: Removed.
* platform/glib/BatteryProviderUPower.h: Removed.
* platform/glib/BatteryProviderUPowerClient.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::setBatteryStatus): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2016-11-02 Keith Rollin <krollin@apple.com>
NetworkSession: Add NetworkDataTask implementation for blobs
https://bugs.webkit.org/show_bug.cgi?id=163939
Reviewed by Alex Christensen.
* WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
* fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
* platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
* platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
* platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
2016-11-02 Olivier Blin <olivier.blin@softathome.com>
[GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation
https://bugs.webkit.org/show_bug.cgi?id=163125
Reviewed by Michael Catanzaro.
No new tests, already covered by existing SubtleCrypto tests.
* PlatformGTK.cmake: Use libgcrypt instead of gnutls.
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: Added. Adapted from the GnuTLS backend.
(WebCore::getGCryptDigestAlgorithm):
(WebCore::calculateSignature):
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* platform/crypto/gcrypt/CryptoDigestGCrypt.cpp: Added. Adapted from the GnuTLS backend.
(WebCore::CryptoDigest::CryptoDigest):
(WebCore::CryptoDigest::~CryptoDigest):
(WebCore::CryptoDigest::create):
(WebCore::CryptoDigest::addBytes):
(WebCore::CryptoDigest::computeHash):
2016-11-02 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
https://bugs.webkit.org/show_bug.cgi?id=162933
<rdar://problem/28570590>
Reviewed by Dean Jackson.
A debug assertion is triggered when an empty <mo> tag is used with a "stretchy" flag.
We shouldn't be trying to apply stretch operations on an empty MathML element. Create a
helper function (isStretchy) to encapsulate the fact that only non-empty elements with
the 'MathMLOperatorDictionary::Stretchy' operator flag should have stretching applied.
Test: mathml/empty-mo.html
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::stretchTo): Revise assertion to use new 'isStretchy' predicate.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isStretchy): Added.
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computeLineVerticalStretch): Use new 'isStretchy' predicate.
(WebCore::RenderMathMLRow::layoutRowItems): Ditto.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Ditto.
(WebCore::RenderMathMLUnderOver::verticalParameters): Ditto.
2016-11-01 Dean Jackson <dino@apple.com>
Filter functions grayscale/invert/opacity/sepia should clamp values over 100%, not fail
https://bugs.webkit.org/show_bug.cgi?id=164310
Reviewed by Sam Weinig.
When bringing up the new CSS parser, I discovered that our old parser was
not conforming to the specification.
Covered by existing tests.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseBuiltinFilterArguments): For these functions, clamp to
100% rather than fail.
2016-11-02 Brent Fulgham <bfulgham@apple.com>
WebKit nullptr dereference Archive Subframe
https://bugs.webkit.org/show_bug.cgi?id=164281
<rdar://problem/28943006>
Reviewed by Andy Estes.
If the page is torn down during a load, we can attempt to use a deallocated
(and nulled) document loader. Most places that use the "active document loader"
null-check it before using, but there was one place that did not. This patch
fixes that oversight.
Test: fast/dom/crash-with-bad-url.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame): Check that the active document
loader is non-null before using.
2016-11-02 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support scroll-snap-* properties
https://bugs.webkit.org/show_bug.cgi?id=164321
Reviewed by Simon Fraser.
* css/CSSPrimitiveValue.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertScrollSnapPoints):
(WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
(WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumePositionLonghand):
(WebCore::consumePositionX):
(WebCore::consumePositionY):
(WebCore::consumePositionList):
(WebCore::consumeScrollSnapDestination):
(WebCore::consumeScrollSnapPoints):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-11-02 David Kilzer <ddkilzer@apple.com>
Add logging for "WebKit encountered an internal error" messages
<https://webkit.org/b/164272>
<rdar://problem/28546064>
Reviewed by Alex Christensen.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::internalErrorKey):
(WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
(WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
(WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
- Add implementations for new key methods.
* page/DiagnosticLoggingKeys.h:
(WebCore::DiagnosticLoggingKeys::internalErrorKey):
(WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
(WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
(WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
- Add declarations for new key methods.
2016-11-02 Zalan Bujtas <zalan@apple.com>
[Tables] Simplified layout skips captions.
https://bugs.webkit.org/show_bug.cgi?id=164284
Reviewed by David Hyatt.
This patch ensures that we take care of simplified normalflow captions during layout.
Covered by fast/regions/table-caption-as-region.html
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layoutCaption):
(WebCore::RenderTable::layoutCaptions): _caption_side is 2bits, can't use bitmask.
(WebCore::RenderTable::simplifiedNormalFlowLayout):
(WebCore::RenderTable::layout):
* rendering/RenderTable.h:
2016-11-02 Youenn Fablet <youenn@apple.com>
REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
https://bugs.webkit.org/show_bug.cgi?id=163905
Reviewed by Antti Koivisto.
Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
Small refactoring to do more member fields initialization in StyleSheetContents header.
Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::addedToMemoryCache):
(WebCore::StyleSheetContents::removedFromMemoryCache):
* css/StyleSheetContents.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
https://bugs.webkit.org/show_bug.cgi?id=164315
Reviewed by Michael Catanzaro.
* platform/FileSystem.h:
* platform/glib/FileSystemGlib.cpp:
(WebCore::stringFromFileSystemRepresentation):
(WebCore::homeDirectoryPath):
(WebCore::listDirectory):
(WebCore::filenameToString): Deleted.
2016-11-02 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] mimax(auto, <flex>) should be serialized as <flex>
https://bugs.webkit.org/show_bug.cgi?id=164316
Reviewed by Sergio Villar Senin.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
properly this case.
* rendering/style/GridLength.h:
(WebCore::GridLength::isAuto): Add new function to check if GridLength
is or not "auto".
2016-11-02 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Enable creation of ReadableByteStreamController
https://bugs.webkit.org/show_bug.cgi?id=164014
Reviewed by Youenn Fablet.
Added support for creating ReadableByteStreamController. IDL is mostly
implemented but methods return TypeError. Tests have been added to ensure
behaviour. This part of Readable Streams API is associated to
a flag (READABLE_BYTE_STREAM_API).
Test: streams/readable-byte-stream-controller.html
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/streams/ReadableByteStreamController.idl: Added.
* Modules/streams/ReadableByteStreamController.js: Added.
(enqueue): Empty method for the moment, throws TypeError.
(error): Empty method for the moment, throws TypeError.
(close): Empty method for the moment, throws TypeError.
(byobRequest): Empty method for the moment, throws TypeError.
(desiredSize): Empty method for the moment, throws TypeError.
* Modules/streams/ReadableByteStreamInternals.js: Added.
(privateInitializeReadableByteStreamController):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableByteStreamController):
(WebCore::constructJSReadableStreamDefaultReader):
(WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
(WebCore::createReadableByteStreamControllerPrivateConstructor):
* bindings/js/JSReadableStreamPrivateConstructors.h:
* bindings/js/WebCoreBuiltinNames.h:
2016-11-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: fullscreen toggle support
https://bugs.webkit.org/show_bug.cgi?id=163728
<rdar://problem/27989486>
Reviewed by Darin Adler.
We introduce the FullscreenSupport class which brings support for entering and
exiting fullscreen by clicking on the fullscreen button in the media controls
and correctly reflecting the media's fullscreen state should it be changed
via the media API.
Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-click.html
media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/fullscreen-support.js: Added.
(FullscreenSupport):
(FullscreenSupport.prototype.get control):
(FullscreenSupport.prototype.get mediaEvents):
(FullscreenSupport.prototype.buttonWasClicked):
(FullscreenSupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:
2016-11-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: PiP support
https://bugs.webkit.org/show_bug.cgi?id=163730
<rdar://problem/27989485>
Reviewed by Dean Jackson.
We introduce the PiPSupport class which brings support for entering picture-in-picture
by clicking on the PiP button in the media controls and enabling the button only when
picture-in-picture mode is available.
Tests: media/modern-media-controls/pip-support/pip-support-click.html
media/modern-media-controls/pip-support/pip-support-enabled.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/pip-support.js: Added.
(PiPSupport.prototype.get control):
(PiPSupport.prototype.get mediaEvents):
(PiPSupport.prototype.buttonWasClicked):
(PiPSupport.prototype.syncControl):
(PiPSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-11-01 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=164240
Reviewed by Dean Jackson.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorPseudoElementTypeMap.in:
Add support for slotted.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator. Take :slotted out of
needsImplicitShadowCombinatorForMatching(), since our code doesn't do
this for :slotted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoClassFunction):
:host can be both an id and a function, so don't restrict it.
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack for :host (inside the hack we already plan on removing
once we turn on).
(WebCore::CSSSelectorParser::consumeCombinator):
Remove deep shadow combinator support, as we don't support matching
on it.
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
Make the split use our combinator, ShadowDescendant, and no longer do anything
special with :slotted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
2016-11-01 Wenson Hsieh <wenson_hsieh@apple.com>
Turn the Input Events runtime flag on by default
https://bugs.webkit.org/show_bug.cgi?id=164297
Reviewed by Ryosuke Niwa.
Set the initial value of inputEventsEnabled in Settings to true.
* page/Settings.in:
2016-11-01 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBIndex getAll/getAllKeys.
<rdar://problem/28806933> and https://bugs.webkit.org/show_bug.cgi?id=164294
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/idbindex-getall-1-private.html
storage/indexeddb/modern/idbindex-getall-1.html
storage/indexeddb/modern/idbindex-getallkeys-1-private.html
storage/indexeddb/modern/idbindex-getallkeys-1.html
Existing imported W3C tests.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::create):
(WebCore::IDBRequest::createIndexGet):
(WebCore::IDBRequest::createCount): Deleted.
(WebCore::IDBRequest::createGet): Deleted.
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllIndexRecords):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/server/IndexValueStore.cpp:
(WebCore::IDBServer::IndexValueStore::allValuesForKey):
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::getAllRecords):
* Modules/indexeddb/server/MemoryIndex.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
(WebCore::IDBServer::queryForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::queryForGetAllRecords): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2016-11-01 Ryosuke Niwa <rniwa@webkit.org>
Remove CUSTOM_ELEMENTS build flag
https://bugs.webkit.org/show_bug.cgi?id=164267
Reviewed by Antti Koivisto.
Removed the build flag. Also rebaselined the bindings tests.
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::customElementsEnabled):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* bindings/js/JSCustomElementInterface.cpp:
* bindings/js/JSCustomElementInterface.h:
* bindings/js/JSCustomElementRegistryCustom.cpp:
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::deleteProperty):
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength):
(WebCore::JSHTMLOptionsCollection::indexSetter):
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::JSHTMLSelectElement::indexSetter):
* bindings/js/JSMainThreadExecState.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::setJSTestCEReactionsAttributeWithCEReactionsFunction):
(WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsFunction):
(WebCore::setJSTestCEReactionsStringifierAttributeFunction):
(WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::setJSTestCEReactionsStringifierValueFunction):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/PropertySetCSSStyleDeclaration.cpp:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isDefinedElement):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
* dom/CustomElementReactionQueue.cpp:
* dom/CustomElementReactionQueue.h:
* dom/CustomElementRegistry.cpp:
* dom/CustomElementRegistry.h:
* dom/CustomElementRegistry.idl:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
(WebCore::createFallbackHTMLElement):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::setCustomElementReactionQueue):
* dom/Node.h:
(WebCore::Node::isFailedCustomElement):
* dom/make_names.pl:
(printWrapperFactoryCppFile):
* html/HTMLElement.idl:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
(WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
* html/parser/HTMLTreeBuilder.h:
(WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork):
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/DOMWindow.idl:
2016-11-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Airplay support
https://bugs.webkit.org/show_bug.cgi?id=163729
<rdar://problem/27989484>
Reviewed by Dean Jackson.
We introduce the AirplaySupport class which brings support for playing the media
via Airplay by clicking on the Airplay button in the media controls and correctly
reflecting when the media is played through Airplay via the media API. The enabled
state of the Airplay button is also tied to Airplay sources being available.
Test: media/modern-media-controls/airplay-support/airplay-support.html
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.get on):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js: Added.
(AirplaySupport.prototype.get control):
(AirplaySupport.prototype.get mediaEvents):
(AirplaySupport.prototype.buttonWasClicked):
(AirplaySupport.prototype.handleEvent):
(AirplaySupport.prototype.syncControl):
(AirplaySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:
2016-11-01 Dean Jackson <dino@apple.com>
Remove WebKitCSSFilterValue to make Hyatt happy
https://bugs.webkit.org/show_bug.cgi?id=164289
<rdar://problems/29050973>
Reviewed by Simon Fraser.
The new CSS parser should not use WebKitCSSFilterValue. It's non-standard,
very likely only used in our tests, doesn't provide much benefit, and will be
covered by the new CSSOM function interface.
Covered by modifying existing tests.
* DerivedSources.make: Remove WebKitCSSFilterValue.idl.
* WebCore.xcodeproj/project.pbxproj: Make CSSFunctionValue.h private so API testing
can see it.
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated): No WebKitCSSFilterValue.
* css/CSSComputedStyleDeclaration.cpp: Use CSSFunctionValue or CSSPrimitiveValue to
build up the computed style.
(WebCore::ComputedStyleExtractor::valueForFilter):
* css/CSSValue.cpp: No WebKitCSSFilterValue.
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isFilterImageValue):
(WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
* css/StyleResolver.cpp: Resolve against CSSFunctionValues with
CSSValueIDs as name, rather than WebKitCSSFilterValue.
(WebCore::filterOperationForType):
(WebCore::StyleResolver::createFilterOperations):
* css/StyleResolver.h:
* css/WebKitCSSFilterValue.cpp: Removed.
* css/WebKitCSSFilterValue.h: Removed.
* css/WebKitCSSFilterValue.idl: Removed.
* css/parser/CSSParser.cpp: Parse into CSSPrimitiveValue and CSSFunctionValue.
(WebCore::isValidPrimitiveFilterFunction):
(WebCore::CSSParser::parseBuiltinFilterArguments):
(WebCore::cssValueKeywordIDForFunctionName):
(WebCore::CSSParser::parseFilter):
(WebCore::filterInfoForName): Deleted.
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFilterFunction):
2016-11-01 Simon Fraser <simon.fraser@apple.com>
Add ViewportAPI to features.json
* features.json:
2016-11-01 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed build fix for r208240.
* inspector/InspectorInstrumentation.h:
Don't export an inlined function.
2016-11-01 Eric Carlson <eric.carlson@apple.com>
[MediaStream] restrict media capture secure connections
https://bugs.webkit.org/show_bug.cgi?id=164234
<rdar://problem/28944906>
Reviewed by Alex Christensen.
Tests: http/tests/ssl/media-stream/get-user-media-different-host.html
http/tests/ssl/media-stream/get-user-media-nested.html
http/tests/ssl/media-stream/get-user-media-secure-connection.html
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::isSecure): New.
(WebCore::canCallGetUserMedia): New.
(WebCore::UserMediaRequest::start): When the setting says the require secure a secure connection,
fail immediately if the page or one of its ancestors is not secure.
* page/Settings.cpp:
(WebCore::Settings::mediaCaptureRequiresSecureConnection): New.
(WebCore::Settings::setMediaCaptureRequiresSecureConnection): New.
* page/Settings.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::InternalSettings): Do not require a secure connection for media
capture during tests.
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Port Page timer throttling to use ActivityState instead of PageThrottler
https://bugs.webkit.org/show_bug.cgi?id=164291
Reviewed by Geoff Garen & Antti Koivisto.
ActivityState now conveys this information; after this change PageThrottler is redundant and can be removed.
* page/Page.cpp:
(WebCore::Page::updateTimerThrottlingState):
- determine page throttling mode based on IsAudible/IsLoading in ActivityState.
(WebCore::Page::setActivityState):
- call updateTimerThrottlingState if IsAudible/IsLoading change.
* page/Page.h:
(WebCore::Page::pageActivityStateChanged):
- no need to listen for PageActivityState changes from the PageThrottler.
2016-11-01 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Placard support
https://bugs.webkit.org/show_bug.cgi?id=163731
<rdar://problem/28869598>
Reviewed by Dean Jackson.
We introduce the PlacardSupport class which brings support for showing the
appropriate placard when the media is played via AirPlay or in picture-in-picture.
Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
media/modern-media-controls/placard-support/placard-support-pip.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/placard-support.js: Added.
(PlacardSupport):
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype.handleEvent):
(PlacardSupport.prototype._updatePlacard):
* WebCore.xcodeproj/project.pbxproj:
2016-11-01 Zalan Bujtas <zalan@apple.com>
ShowRenderTree: Add information about the type of the needsLayout bit.
https://bugs.webkit.org/show_bug.cgi?id=164287
Reviewed by Simon Fraser.
Currently showRenderTree only tells you whether a renderer's "needs layout bit" is set or not.
With certain type of layout bugs, it's essential to know the kind of layout a particular
renderer needs.
This patch extends the renderer output by listing all the layout bits set.
B------- -+ BODY RenderBody (0.00, 0.00) (0.00, 0.00) renderer->(0x) node->(0x) layout->[self][normal child]
Not testable.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::showRenderObject):
2016-11-01 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Use more references in inspector code
https://bugs.webkit.org/show_bug.cgi?id=164283
Reviewed by Timothy Hatcher.
(WebCore::frameForScriptExecutionContext):
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didLayoutImpl):
(WebCore::InspectorInstrumentation::willPaintImpl):
(WebCore::InspectorInstrumentation::didPaintImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
(WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted.
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameWindowDiscarded):
(WebCore::InspectorInstrumentation::didInstallTimer):
(WebCore::InspectorInstrumentation::didRemoveTimer):
(WebCore::InspectorInstrumentation::willFireTimer):
(WebCore::InspectorInstrumentation::didLayout):
(WebCore::InspectorInstrumentation::willComposite):
(WebCore::InspectorInstrumentation::didComposite):
(WebCore::InspectorInstrumentation::willPaint):
(WebCore::InspectorInstrumentation::didPaint):
(WebCore::InspectorInstrumentation::continueAfterPingLoader):
(WebCore::InspectorInstrumentation::scriptImported):
(WebCore::InspectorInstrumentation::didCommitLoad):
(WebCore::InspectorInstrumentation::frameDocumentUpdated):
(WebCore::InspectorInstrumentation::frameStartedLoading):
(WebCore::InspectorInstrumentation::frameStoppedLoading):
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
(WebCore::InspectorInstrumentation::workerStarted):
(WebCore::InspectorInstrumentation::workerTerminated):
(WebCore::InspectorInstrumentation::didHandleMemoryPressure):
(WebCore::InspectorInstrumentation::networkStateChanged):
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
Convert to references where possible.
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::frameDocumentUpdated):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameNavigated):
(WebCore::InspectorPageAgent::didPaint):
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.cpp:
(WebCore::InspectorReplayAgent::frameNavigated):
* inspector/InspectorReplayAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didLayout):
(WebCore::InspectorTimelineAgent::didPaint):
* inspector/InspectorTimelineAgent.h:
Pass references through InspectorInstrumentation to the Agents.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachPage):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
* page/Page.cpp:
(WebCore::networkStateChanged):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated):
* replay/ReplayController.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::workerStartMode):
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
* workers/WorkerInspectorProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
Pass references to InspectorInstrumentation.
2016-11-01 Alex Christensen <achristensen@webkit.org>
Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes
https://bugs.webkit.org/show_bug.cgi?id=164290
Reviewed by Tim Horton.
NSURL fails to parse these URLs, WebKit used to punycode encode them, but now we match Chrome and Firefox,
as well as what will likely become the standard once https://github.com/whatwg/url/issues/148 is resolved.
We continue to parse IPv6 address hosts because otherwise we wouldn't be able to tell where a port
starts in a URL with colons in the IPv6 address and before the port like "a://[b::c]:4"
Covered by new API tests and updated LayoutTests.
* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::parseHostAndPort):
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Add IsAudible, IsLoading to ActivityState
https://bugs.webkit.org/show_bug.cgi?id=164286
Reviewed by Geoff Garen.
By computing these values in the UIProcess and passing them to WebContent we can
more closely unify iOS & macOS throttling, and remove the PageThrottler class.
* page/ActivityState.h:
- added IsAudible, IsLoading
2016-10-31 Gavin Barraclough <barraclough@apple.com>
Rename ViewState to ActivityState
https://bugs.webkit.org/show_bug.cgi?id=164254
Reviewed by Andreas Kling.
We plan to add a couple more flags to ViewState that aren't directly related to the view
itself - whether there is an ongoing page load, and whether whether there is audio playback.
This will allow viewState (now activityState) to fully drive throttling decisions.
Renaming this bitfield accordingly.
* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::~GeolocationController):
(WebCore::GeolocationController::activityStateDidChange):
(WebCore::GeolocationController::viewStateDidChange): Deleted.
* Modules/geolocation/GeolocationController.h:
* WebCore.xcodeproj/project.pbxproj:
* page/ActivityState.h: Copied from Source/WebCore/page/ViewState.h.
* page/ActivityStateChangeObserver.h: Copied from Source/WebCore/page/ViewStateChangeObserver.h.
(WebCore::ActivityStateChangeObserver::~ActivityStateChangeObserver):
(WebCore::ViewStateChangeObserver::~ViewStateChangeObserver): Deleted.
* page/FocusController.cpp:
(WebCore::FocusController::FocusController):
(WebCore::FocusController::setFocused):
(WebCore::FocusController::setActivityState):
(WebCore::FocusController::setActive):
(WebCore::FocusController::setViewState): Deleted.
* page/FocusController.h:
(WebCore::FocusController::isActive):
(WebCore::FocusController::isFocused):
(WebCore::FocusController::contentIsVisible):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setIsInWindow):
(WebCore::Page::addActivityStateChangeObserver):
(WebCore::Page::removeActivityStateChangeObserver):
(WebCore::Page::updateTimerThrottlingState):
(WebCore::Page::setActivityState):
(WebCore::Page::isVisibleAndActive):
(WebCore::Page::setIsVisible):
(WebCore::Page::addViewStateChangeObserver): Deleted.
(WebCore::Page::removeViewStateChangeObserver): Deleted.
(WebCore::Page::setViewState): Deleted.
* page/Page.h:
(WebCore::Page::isVisible):
(WebCore::Page::isInWindow):
* page/PageThrottler.h:
* page/ViewState.h: Removed.
* page/ViewStateChangeObserver.h: Removed.
2016-11-01 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208100.
This change caused LayoutTest crashes under GuardMalloc.
Reverted changeset:
"MediaEndpoint::generateDtlsInfo is not needed"
https://bugs.webkit.org/show_bug.cgi?id=164130
http://trac.webkit.org/changeset/208100
2016-11-01 Claudio Saavedra <csaavedra@igalia.com>
Add missing inline include to JSDeviceMotionEventCustom
https://bugs.webkit.org/show_bug.cgi?id=164269
Reviewed by Michael Catanzaro.
Inlined JSObject functions are used through JSObject::get() get here,
so this fixes the build with -fvisibility-inlines-hidden.
* bindings/js/JSDeviceMotionEventCustom.cpp: Include JSObjectInlines.h
2016-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] generate-bindings-all.pl uses USES_TERMINAL which leaves a noisy line in interactive Ninja build
https://bugs.webkit.org/show_bug.cgi?id=163868
Reviewed by Michael Catanzaro.
It takes long time for generate-bindings-all.pl to generate all
bindings. So, it shows the progress while running and
USES_TERMINAL option of add_custom_target have been used to invoke
the command. However, USES_TERMINAL leaves a noisy line in
Ninja's neat build log of interactive build.
A new CMake option SHOW_BINDINGS_GENERATION_PROGRESS is added to
stop using USES_TERMINAL only in case of interactive Ninja build.
* bindings/scripts/generate-bindings-all.pl: Added a new switch
--showProgress. Removed $terminalWidth and getTerminalWidth which
are mainly for interactive Ninja build. Added printProgress.
2016-11-01 Ryosuke Niwa <rniwa@webkit.org>
Web Inspector: Add the support for custom elements
https://bugs.webkit.org/show_bug.cgi?id=164266
<rdar://problem/29038883>
Reviewed by Joseph Pecoraro.
Set "customElementState" property on each DOMNode object when building a protocol object for the node.
Also added InspectorInstrumentation::didChangeCustomElementState to track the changes to custom element states.
Tests: inspector/dom/customElementState.html
* dom/Element.cpp:
(WebCore::Element::setIsDefinedCustomElement): Invoke didChangeCustomElementState to update the state.
(WebCore::Element::setIsFailedCustomElement): Ditto.
(WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto.
(WebCore::Element::enqueueToUpgrade): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::customElementState): Added.
(WebCore::InspectorDOMAgent::buildObjectForNode): Set the custom element state.
(WebCore::InspectorDOMAgent::didChangeCustomElementState): Invoke customElementStateChanged.
* inspector/InspectorDOMAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didChangeCustomElementStateImpl): Added.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didChangeCustomElementState): Added.
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
Add StaticPasteboard.cpp to the cmake after r207841.
* CMakeLists.txt:
2016-10-31 Zalan Bujtas <zalan@apple.com>
Simple line layout: Clear needs layout flag even when only overflow is getting recomputed.
https://bugs.webkit.org/show_bug.cgi?id=164253
Reviewed by Antti Koivisto.
When a style change triggers visual overflow re-computation, we set StyleDifferenceLayout style diff
but in practice we don't actually make changes to the simple line structure. We just re-compute the visual overflow later.
This patch moves the 'clean the renderes' logic back to RenderBlockFlow::layoutSimpleLines so that
we set the needs layout bit to false regardless of whether we preformed layout.
Covered by fast/events/tabindex-focus-blur-all.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Add basic visual/layout viewport support for fixed position layout
https://bugs.webkit.org/show_bug.cgi?id=164261
Reviewed by Dean Jackson.
This patch adds a new behavior for position:fixed objects on zooming. Instead of
interpolating between two implicit viewports as we do now, have explicit and distinct
layout and visual viewports.
The layout viewport is always the size of the initial containing block (i.e. the RenderView).
Position:fixed and sticky elements are laid out relative to the layout viewport.
The visual viewport is the visible part of the view, in content coordinates.
When the user pans and zooms, the visual viewport changes. If it hits the edge of the
layout viepwort, it pushes the layout viewport in that direction; it's as if the user
is dragging the layout viewport around.
The layout viewport is maintained on FrameView, and has to be recomputed when the
scroll position changes, when the view size changes, and when the content size (which
affets min/max scroll position) changes. Layout viewport size and position are computed
in unzoomed coordinates, requiring some new functions on FrameView to return these.
Updated the TileCoverageMap to show the layout viewport visually.
Subsequent patches will plumb the layout and visual viewports through the scrolling tree.
Tests: fast/visual-viewport/nonzoomed-rects.html
fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html
fast/visual-viewport/zoomed-fixed.html
fast/visual-viewport/zoomed-rects.html
* page/FrameView.cpp:
(WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
(WebCore::FrameView::scrollPositionRespectingCustomFixedPosition):
(WebCore::FrameView::computeLayoutViewportOrigin):
(WebCore::FrameView::setLayoutViewportOrigin):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::minStableLayoutViewportOrigin):
(WebCore::FrameView::maxStableLayoutViewportOrigin):
(WebCore::FrameView::layoutViewportRect):
(WebCore::FrameView::visualViewportRect):
(WebCore::FrameView::viewportConstrainedVisibleContentRect):
(WebCore::FrameView::rectForFixedPositionLayout):
(WebCore::FrameView::scrollPositionForFixedPosition):
(WebCore::FrameView::unscaledMinimumScrollPosition):
(WebCore::FrameView::unscaledMaximumScrollPosition):
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::availableContentSizeChanged):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::useCustomFixedPositionLayoutRect):
* page/FrameView.h:
* page/Settings.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setLayoutViewportRect):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::TileCoverageMap):
(WebCore::TileCoverageMap::update):
* platform/graphics/ca/TileCoverageMap.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
* rendering/RenderTreeAsText.cpp:
(WebCore::externalRepresentation): Logging here is useful when debugging tests.
* testing/Internals.cpp:
(WebCore::Internals::layoutViewportRect): Expose these rects so tests can dump them.
(WebCore::Internals::visualViewportRect):
* testing/Internals.h:
* testing/Internals.idl:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Fix bindings tests after r208209.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjTypedArrayAttrFunction):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Warning: Multiple build commands for output file RenderThemeCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=164265
Reviewed by Ryosuke Niwa.
* WebCore.xcodeproj/project.pbxproj:
2016-10-29 Filip Pizlo <fpizlo@apple.com>
JSC should support SharedArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=163986
Reviewed by Keith Miller.
New tests added in the LayoutTests/workers/sab directory.
This teaches WebCore that a typed array could be shared or not. By default, WebCore will
reject shared typed arrays as if they were not typed arrays. This ensures that we don't get
race conditions in code that can't handle it.
If you postMessage a SharedArrayBuffer or something that wraps it, you will send the shared
memory to the other worker.
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::cachedKeyForKeyID):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::send):
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::getChannelData):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::send):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createRsaKeyGenParams):
* bindings/js/JSCryptoCustom.cpp:
(WebCore::JSCrypto::getRandomValues):
* bindings/js/JSCryptoOperationData.cpp:
(WebCore::cryptoOperationDataFromJSValue):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
(WebCore::toPossiblySharedArrayBufferView):
(WebCore::toUnsharedArrayBufferView):
(WebCore::toPossiblySharedInt8Array):
(WebCore::toPossiblySharedInt16Array):
(WebCore::toPossiblySharedInt32Array):
(WebCore::toPossiblySharedUint8Array):
(WebCore::toPossiblySharedUint8ClampedArray):
(WebCore::toPossiblySharedUint16Array):
(WebCore::toPossiblySharedUint32Array):
(WebCore::toPossiblySharedFloat32Array):
(WebCore::toPossiblySharedFloat64Array):
(WebCore::toUnsharedInt8Array):
(WebCore::toUnsharedInt16Array):
(WebCore::toUnsharedInt32Array):
(WebCore::toUnsharedUint8Array):
(WebCore::toUnsharedUint8ClampedArray):
(WebCore::toUnsharedUint16Array):
(WebCore::toUnsharedUint32Array):
(WebCore::toUnsharedFloat32Array):
(WebCore::toUnsharedFloat64Array):
(WebCore::toArrayBufferView): Deleted.
(WebCore::toInt8Array): Deleted.
(WebCore::toInt16Array): Deleted.
(WebCore::toInt32Array): Deleted.
(WebCore::toUint8Array): Deleted.
(WebCore::toUint8ClampedArray): Deleted.
(WebCore::toUint16Array): Deleted.
(WebCore::toUint32Array): Deleted.
(WebCore::toFloat32Array): Deleted.
(WebCore::toFloat64Array): Deleted.
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::extractTransferables):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readArrayBufferView):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::transferArrayBuffers):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBuffer):
(WebCore::structuredCloneArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Make UIScriptController::zoomToScale() work on Mac WK1 and WK2
https://bugs.webkit.org/show_bug.cgi?id=164238
Reviewed by Dean Jackson.
Test: fast/zooming/uiscript-zooming.html
Expose pageScaleFactor() for tests.
* testing/Internals.cpp:
(WebCore::Internals::pageScaleFactor):
* testing/Internals.h:
* testing/Internals.idl:
2016-10-31 Myles C. Maxfield <mmaxfield@apple.com>
Migrate CanvasRenderingContext's internal canvas pointer to a reference
https://bugs.webkit.org/show_bug.cgi?id=164259
Reviewed by Dean Jackson.
It is never nullptr.
No new tests because there is no behavior change.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::ref):
(WebCore::CanvasRenderingContext::deref):
(WebCore::CanvasRenderingContext::canvas):
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
(WebCore::CanvasRenderingContext2D::unwindStateStack):
(WebCore::CanvasRenderingContext2D::isAccelerated):
(WebCore::CanvasRenderingContext2D::realizeSaves):
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::resetTransform):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::clearCanvas):
(WebCore::CanvasRenderingContext2D::transformAreaToDevice):
(WebCore::CanvasRenderingContext2D::rectContainsCanvas):
(WebCore::CanvasRenderingContext2D::calculateCompositingBufferRect):
(WebCore::CanvasRenderingContext2D::compositeBuffer):
(WebCore::CanvasRenderingContext2D::createPattern):
(WebCore::CanvasRenderingContext2D::didDrawEntireCanvas):
(WebCore::CanvasRenderingContext2D::didDraw):
(WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
(WebCore::CanvasRenderingContext2D::drawingContext):
(WebCore::CanvasRenderingContext2D::getImageData):
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
(WebCore::CanvasRenderingContext2D::putImageData):
(WebCore::CanvasRenderingContext2D::setFont):
(WebCore::CanvasRenderingContext2D::toTextDirection):
(WebCore::CanvasRenderingContext2D::direction):
(WebCore::CanvasRenderingContext2D::platformLayer):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::markContextChanged):
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
(WebCore::WebGLRenderingContextBase::reshape):
(WebCore::WebGLRenderingContextBase::isContextLostOrPending):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printWarningToConsole):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::clampedCanvasSize):
* html/canvas/WebGLRenderingContextBase.h:
2016-10-31 Brady Eidson <beidson@apple.com>
Address style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
https://bugs.webkit.org/show_bug.cgi?id=164248
Unreviewed. Addressing review feedback (and then some) from Darin Adler on earlier patch.
No new tests (No behavior change).
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::renameIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
(WebCore::IDBClient::IDBConnectionProxy::createIndex):
(WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
(WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
(WebCore::IDBClient::IDBConnectionProxy::getRecord):
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
(WebCore::IDBClient::IDBConnectionProxy::getCount):
(WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
(WebCore::IDBClient::IDBConnectionProxy::openCursor):
(WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::error):
(WebCore::IDBResultData::openDatabaseSuccess):
(WebCore::IDBResultData::openDatabaseUpgradeNeeded):
(WebCore::IDBResultData::deleteDatabaseSuccess):
(WebCore::IDBResultData::putOrAddSuccess):
(WebCore::IDBResultData::getRecordSuccess):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getCountSuccess):
(WebCore::IDBResultData::openCursorSuccess):
(WebCore::IDBResultData::iterateCursorSuccess):
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
Enable custom elements by default everywhere
https://bugs.webkit.org/show_bug.cgi?id=164242
Reviewed by Antti Koivisto.
Set the status of Custom Elements API to "Done".
* features.json:
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207967.
This change seems to be the cause of at least one LayoutTest
becoming flaky.
Reverted changeset:
"REGRESSION(r207753-207755): ASSERTION FAILED:
m_parsedStyleSheetCache->isInMemoryCache()"
https://bugs.webkit.org/show_bug.cgi?id=163905
http://trac.webkit.org/changeset/207967
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Shadow DOM scoped styles are missing
https://bugs.webkit.org/show_bug.cgi?id=164247
<rdar://problem/29035061>
Reviewed by Antti Koivisto.
Test: inspector/css/shadow-scoped-style.html
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):
Only match :host pseudo class for NOPSEUDO. It doesn't make sense
with a pseudo element request (:host::before does not make sense).
* css/InspectorCSSOMWrappers.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
Simplify existing "once per document" wrapper collection.
(WebCore::InspectorCSSOMWrappers::maybeCollectFromStyleSheets):
(WebCore::InspectorCSSOMWrappers::collectScopeWrappers):
Include a path to add style sheets that weren't already collected.
This will be useful when trying the StyleScope stylesheets which
are different for different nodes.
* inspector/InspectorCSSAgent.cpp:
(WebCore::containingStyleScopeForElement):
(WebCore::InspectorCSSAgent::buildObjectForRule):
Collect rules for document and StyleScope sheets separately.
For elements with a shadow root, add the root's sheets as
well in case there are :host rules that affect the element.
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208180.
This change caused fast/shadow-dom/slotted-pseudo-element-css-
text.html to crash on macOS and iOS on every test run.
Reverted changeset:
"[CSS Parser] Support the shadow DOM"
https://bugs.webkit.org/show_bug.cgi?id=164240
http://trac.webkit.org/changeset/208180
2016-10-31 Nan Wang <n_wang@apple.com>
AX: aria-sort is not exposed on iOS
https://bugs.webkit.org/show_bug.cgi?id=164245
Reviewed by Chris Fleizach.
Exposed the aria-sort attribute value in accessibilitySortDirection.
Test: accessibility/ios-simulator/aria-sort-ios.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208178.
The test added with this change fails or times out on macOS
and iOS.
Reverted changeset:
"[Modern Media Controls] Media Controller: Airplay support"
https://bugs.webkit.org/show_bug.cgi?id=163729
http://trac.webkit.org/changeset/208178
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208182.
Both of the tests added with this change time out on macOS
Release.
Reverted changeset:
"[Modern Media Controls] Media Controller: Placard support"
https://bugs.webkit.org/show_bug.cgi?id=163731
http://trac.webkit.org/changeset/208182
2016-10-31 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
<rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
Reviewed by Darin Adler.
Tests: storage/indexeddb/modern/idbobjectstore-getall-1-private.html
storage/indexeddb/modern/idbobjectstore-getall-1.html
storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html
storage/indexeddb/modern/idbobjectstore-getallkeys-1.html
Existing imported W3C tests.
- Add new objects for "IDBGetAllRequestData" and "IDBGetAllResult" to represent these
new requests and responses.
- Add lots of boilerplate code to move these new objects around in the IDB machinery.
- Update "GetRecord" code to be shared with "GetAll" code where necessary.
- Other tweaks here and there.
* WebCore.xcodeproj/project.pbxproj:
* CMakeLists.txt:
* Modules/indexeddb/IDBGetAllResult.cpp: Added.
(WebCore::isolatedCopyOfVariant):
(WebCore::IDBGetAllResult::isolatedCopy):
(WebCore::IDBGetAllResult::addKey):
(WebCore::IDBGetAllResult::addValue):
(WebCore::IDBGetAllResult::keys):
(WebCore::IDBGetAllResult::values):
(WebCore::IDBGetAllResult::allBlobFilePaths):
* Modules/indexeddb/IDBGetAllResult.h: Added.
(WebCore::IDBGetAllResult::IDBGetAllResult):
(WebCore::IDBGetAllResult::type):
(WebCore::IDBGetAllResult::encode):
(WebCore::IDBGetAllResult::decode):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::getAllRecordsOnServer):
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
(WebCore::IDBClient::IDBConnectionToServer::didGetAllRecords):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllRecords):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::getAllRecords):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::queryForGetAllRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
(WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Added.
(WebCore::IDBGetAllRecordsData::isolatedCopy):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h: Added.
(WebCore::IDBGetAllRecordsData::encode):
(WebCore::IDBGetAllRecordsData::decode):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getAllResult):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode):
(WebCore::IDBResultData::decode):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didGetAllRecords):
(WebCore::InProcessIDBServer::getAllRecords):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
GTK+ and EFL build fixes after r208176.
* css/PropertySetCSSStyleDeclaration.cpp:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Fix #include case.
* page/IntersectionObserverEntry.h:
2016-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
[WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
https://bugs.webkit.org/show_bug.cgi?id=164236
<rdar://problem/28747712>
Reviewed by Beth Dakin.
Moves state that keeps track of whether or not a dictionary lookup is active from the WebPage to the Editor, so
that when clicking a text field or contenteditable in WK1 or WK2, we are able to avoid notifying the
WebEditorClient of the selection change.
Changes to WK2 are covered by existing unit tests in WKWebViewCandidateTests which verify that clicking does not
thrash candidate list visibility. A similar test will be added in the future for the WK1 case in CandidateTests.
* editing/Editor.h:
(WebCore::Editor::setIsGettingDictionaryPopupInfo):
(WebCore::Editor::isGettingDictionaryPopupInfo):
2016-10-31 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Placard support
https://bugs.webkit.org/show_bug.cgi?id=163731
<rdar://problem/28869598>
Reviewed by Dean Jackson.
We introduce the PlacardSupport class which brings support for showing the
appropriate placard when the media is played via AirPlay or in picture-in-picture.
Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
media/modern-media-controls/placard-support/placard-support-pip.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/placard-support.js: Added.
(PlacardSupport):
(PlacardSupport.prototype.get mediaEvents):
(PlacardSupport.prototype.handleEvent):
(PlacardSupport.prototype._updatePlacard):
* WebCore.xcodeproj/project.pbxproj:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Implement IntersectionObserver
https://bugs.webkit.org/show_bug.cgi?id=159475
Reviewed by Ryosuke Niwa.
Add bindings support for Intersection Observer
<https://wicg.github.io/IntersectionObserver/>
Code is wrapped in ENABLE(INTERSECTION_OBSERVER), and controlled by a runtime
Setting (off by default for now).
A minor bindings change was required to fix the callback code.
IntersectionObserver is just a shell for now.
Tests: intersection-observer/intersection-observer-entry-interface.html
intersection-observer/intersection-observer-interface.html
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldPassWrapperByReference):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
* page/IntersectionObserver.cpp: Added.
(WebCore::IntersectionObserver::IntersectionObserver):
(WebCore::IntersectionObserver::observe):
(WebCore::IntersectionObserver::unobserve):
(WebCore::IntersectionObserver::disconnect):
(WebCore::IntersectionObserver::takeRecords):
* page/IntersectionObserver.h: Added.
(WebCore::IntersectionObserver::create):
(WebCore::IntersectionObserver::root):
(WebCore::IntersectionObserver::rootMargin):
(WebCore::IntersectionObserver::thresholds):
* page/IntersectionObserver.idl: Added.
* page/IntersectionObserverCallback.h: Added.
(WebCore::IntersectionObserverCallback::~IntersectionObserverCallback):
* page/IntersectionObserverCallback.idl: Added.
* page/IntersectionObserverEntry.cpp: Added.
(WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
* page/IntersectionObserverEntry.h: Added.
(WebCore::IntersectionObserverEntry::create):
(WebCore::IntersectionObserverEntry::time):
(WebCore::IntersectionObserverEntry::rootBounds):
(WebCore::IntersectionObserverEntry::boundingClientRect):
(WebCore::IntersectionObserverEntry::intersectionRect):
(WebCore::IntersectionObserverEntry::target):
(WebCore::IntersectionObserverEntry::intersectionRatio):
* page/IntersectionObserverEntry.idl: Added.
* page/Settings.in:
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=164240
Reviewed by Dean Jackson.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorPseudoElementTypeMap.in:
Add support for slotted.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator. Take :slotted out of
needsImplicitShadowCombinatorForMatching(), since our code doesn't do
this for :slotted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoClassFunction):
:host can be both an id and a function, so don't restrict it.
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack for :host (inside the hack we already plan on removing
once we turn on).
(WebCore::CSSSelectorParser::consumeCombinator):
Remove deep shadow combinator support, as we don't support matching
on it.
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
Make the split use our combinator, ShadowDescendant, and no longer do anything
special with :slotted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Use #pragma once in WebCore
https://bugs.webkit.org/show_bug.cgi?id=164194
Rubber-stamped by Sam Weinig.
* accessibility/*.h:
* bindings/*.h:
* contentextensions/*.h:
* dom/*.h:
* html/*.h:
* page/*.h:
Use #pragma once in headers.
* html/parser/ParsingUtilities.h:
Add missing namespace.
* html/track/VTTScanner.h:
(WebCore::VTTScanner::skipWhile):
(WebCore::VTTScanner::skipUntil):
(WebCore::VTTScanner::collectWhile):
(WebCore::VTTScanner::collectUntil):
Include namespace.
2016-10-31 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: Airplay support
https://bugs.webkit.org/show_bug.cgi?id=163729
Reviewed by Dean Jackson.
We introduce the AirplaySupport class which brings support for playing the media
via Airplay by clicking on the Airplay button in the media controls and correctly
reflecting when the media is played through Airplay via the media API. The enabled
state of the Airplay button is also tied to Airplay sources being available.
Test: media/modern-media-controls/airplay-support/airplay-support.html
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.get on):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/airplay-support.js: Added.
(AirplaySupport.prototype.get control):
(AirplaySupport.prototype.get mediaEvents):
(AirplaySupport.prototype.buttonWasClicked):
(AirplaySupport.prototype.handleEvent):
(AirplaySupport.prototype.syncControl):
(AirplaySupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* WebCore.xcodeproj/project.pbxproj:
2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide an opportunity to clear ScriptValues associated with debugged target
https://bugs.webkit.org/show_bug.cgi?id=164167
<rdar://problem/29010148>
Reviewed by Mark Lam.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectedPageDestroyed):
Page is going away, discard values.
* inspector/WorkerInspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::workerTerminating):
Worker is going away, discard values.
2016-10-31 Ryosuke Niwa <rniwa@webkit.org>
CSSStyleDeclaration should be annotated with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163968
Reviewed by Antti Koivisto.
Added CEReactions to CSSStyleDeclaration.idl.
Test: fast/custom-elements/reactions/CSSStyleDeclaration.html
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* css/CSSStyleDeclaration.idl:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Remember the old value when this is
an inline style declaration for a custom element. Also store m_oldValue and m_customElement instead of
a mutation record so that we don't create a superfluous mutation record for custom elements.
(WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope): Enqueue attributeChangedCallback
when m_customElement is not null.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::observesStyleAttribute):
* dom/CustomElementReactionQueue.h:
2016-10-31 Jer Noble <jer.noble@apple.com>
Unreviewed build fix for the build fix; AVStreamDataParser not defined on iOS.
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Zalan Bujtas <zalan@apple.com>
LayoutTests/fast/frames/invalid-frameset.html is not clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=164230
Reviewed by Simon Fraser.
When a <frameset> has invalid children, in addition to clear the needs layout flag on the children
we also need to do clear the descendants too.
Covered by LayoutTests/fast/frames/invalid-frameset.html.
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames):
2016-10-31 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r208151; outputMIMECodecParameterForInputMIMECodecParameter not
defined pre-Sierra.
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Zalan Bujtas <zalan@apple.com>
ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
https://bugs.webkit.org/show_bug.cgi?id=164076
Reviewed by Antti Koivisto.
FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
measure text with zero font size at all.
Test: fast/text/simple-line-layout-with-zero-sized-font.html
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-named-image
https://bugs.webkit.org/show_bug.cgi?id=164235
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeWebkitNamedImage):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2016-10-28 Brent Fulgham <bfulgham@apple.com>
Do a better job of protecting Frame objects in the context of JavaScript calls
https://bugs.webkit.org/show_bug.cgi?id=164163
<rdar://problem/28955249>
Reviewed by Darin Adler.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Protected the Frame.
* editing/Editor.cpp:
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executeSwapWithMark): Ditto.
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Ditto.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard): Ditto.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::collapse): Ditto.
(WebCore::DOMSelection::collapseToEnd): Ditto.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Ditto.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::modify): Ditto.
(WebCore::DOMSelection::extend): Ditto.
(WebCore::DOMSelection::addRange): Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
* page/DragController.cpp:
(WebCore::setSelectionToDragCaret): Ditto.
(WebCore::DragController::startDrag): Ditto.
* page/Frame.cpp:
(WebCore::Frame::checkOverflowScroll): Ditto.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Ditto.
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure to fail on :role(a,b) and :dir(a,b)
https://bugs.webkit.org/show_bug.cgi?id=164233
Reviewed by Dean Jackson.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow unitless values on background-size in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=164232
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundSize):
2016-10-31 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r208151; _setPreventsSleepDuringVideoPlayback: only defined in non-simulator SDKs.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Nan Wang <n_wang@apple.com>
AX: iOS Voiceover does not announce previously selected value from input type="date" form field
https://bugs.webkit.org/show_bug.cgi?id=164176
Reviewed by Chris Fleizach.
Input type date is a popup button on iOS and its value was not exposed in stringValue() since
it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
the case in stringValue() and removing the AXTitle exposure.
Changes are covered in modified test.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue):
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::isInputTypePopupButton):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityLabel]):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Add requestIdleCallback to features.json.
* features.json:
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fully support prefixed background-size and box-shadows
https://bugs.webkit.org/show_bug.cgi?id=164228
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Get rid of CSSCustomIdentValue::creates
https://bugs.webkit.org/show_bug.cgi?id=164225
Reviewed by Zalan Bujtas.
Get rid of all instances of CSSCustomIdent::create, since our style
resolution code isn't prepared to handle that value type yet.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationName):
(WebCore::consumeTransitionProperty):
(WebCore::consumeAttr):
2016-10-31 Jer Noble <jer.noble@apple.com>
Opt-out of AVPlayer automatic sleep disabling
https://bugs.webkit.org/show_bug.cgi?id=163983
Reviewed by Eric Carlson.
In addition to the DisplaySleepDisabler, notify the MediaPlayerPrivateAVFoundationObjC object whether
it should disable display sleep. Provide all the necessary boilerplate to allow the media player private
to query the HTMLMediaPlayer so that the correct value can be set on AVPlayer upon creation.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateSleepDisabling):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setShouldDisableSleep):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldDisableSleep):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
Drive-by fix: Re-organize the contents of AVFoundationSPI.h so that there's a single top-level
#if USE(APPLE_INTERNAL_SDK) statement, rather than that conditional being sprinkled about the
file.
* platform/spi/mac/AVFoundationSPI.h:
2016-10-31 Jer Noble <jer.noble@apple.com>
REGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked.html timing out
https://bugs.webkit.org/show_bug.cgi?id=162496
Reviewed by Darin Adler.
The change to MockMediaSourcePrivate in r206300 revealed a true bug: seeks to the MediaSource's duration
will always fail. We should discard out of hand seeks which are greater than the duration, but allow seeks
directly to the duration.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::hasBufferedTime):
2016-10-31 Jer Noble <jer.noble@apple.com>
Allow multiple playing videos on a page with 'autoplay' and 'playsinline' attributes
https://bugs.webkit.org/show_bug.cgi?id=162366
<rdar://problem/28639600>
Reviewed by Eric Carlson.
Tests: media/video-concurrent-visible-playback.html
media/video-multiple-concurrent-playback.html
Separate out the concept of "video-only" from "video-with-audio" in PlatformMediaSession::MediaType,
and only set the ConcurrentPlaybackNotPermitted restriction for "video-with-audio". This allows multiple
silent video elements to play back simultaneously.
However, the bug in question also shows bad behavior when both concurrent playback and invisible playback
are not allowed. Namely, an invisible element will attempt to autoplay, interrupt visible elements, and
then fail to play due to it's non-visibility. Add an extra check to canTransitionFromAutoplayToPlay()
which asks the session if autoplay is allowed (which will return false if the element is not visible).
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
(WebCore::HTMLMediaElement::mediaType):
(WebCore::HTMLMediaElement::presentationType):
(WebCore::HTMLMediaElement::updateShouldAutoplay):
(WebCore::mediaElementIsAllowedToAutoplay): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted):
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
* testing/Internals.cpp:
(WebCore::Internals::setMediaSessionRestrictions):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support unprefixed cross-fade
https://bugs.webkit.org/show_bug.cgi?id=164224
Reviewed by Zalan Bujtas.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2016-10-31 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Simplify background-position-x/y style mapping
https://bugs.webkit.org/show_bug.cgi?id=164223
Reviewed by Zalan Bujtas.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis):
2016-10-31 Darin Adler <darin@apple.com>
Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
https://bugs.webkit.org/show_bug.cgi?id=164214
Reviewed by Alex Christensen.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeOptions): Use FetchHeaders& instead of
Ref<FetchHeaders> for return value.
(WebCore::FetchRequest::initializeWith): Ditto.
* Modules/fetch/FetchRequest.h: Updated for above.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Use SourceBuffer& instead of
SourceBuffer* for return value.
* Modules/mediasource/MediaSource.h: Updated for above.
* bindings/js/JSDOMBinding.h: Added overloads of checkSecurityForNode so
it works with a function returning a reference.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getCounterValue): Use Counter& instead of
Counter* for return value.
(WebCore::CSSPrimitiveValue::getRectValue): Use Rect& instead of
Rect* for return value.
* css/CSSPrimitiveValue.h: Updated for above.
* dom/ChildNode.idl: Use non-legacy exceptions.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::querySelector): Use ExceptionOr.
(WebCore::ContainerNode::querySelectorAll): Ditto.
(WebCore::ContainerNode::append): Ditto.
(WebCore::ContainerNode::prepend): Ditto.
* dom/ContainerNode.h: Updated for above.
* dom/Document.cpp:
(WebCore::Document::selectorQueryForString): Use ExceptionOr.
* dom/Document.h: Updated for above.
* dom/Element.cpp:
(WebCore::Element::attachShadow): Return ShadowRoot& instead of
Ref<ShadowRoot> since the shadow root is owned by the element, not
the caller.
(WebCore::Element::matches): Updated for change to make the
selectorQueryForString function use ExceptionOr.
(WebCore::Element::closest): Ditto.
(WebCore::contextNodeForInsertion): Return ContainerNode& instead of
ContainerNode*.
(WebCore::contextElementForInsertion): Updated for above.
* dom/Element.h: Updated for above.
* dom/Element.idl: Changed return type for closest and for
insertAdjacentElement to be nullable since both can return null.
* dom/ExceptionOr.h: Added a specialization for ExceptionOr<T&>.
* dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNode): Use ExceptionOr.
(WebCore::Node::before): Ditto.
(WebCore::Node::after): Ditto.
(WebCore::Node::replaceWith): Ditto.
* dom/Node.h: Updated for above changes.
* dom/ParentNode.idl: Use non-legacy exceptions.
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::queryAll): Changed return type to Ref.
(WebCore::SelectorQueryCache::add): Use ExceptionOr.
* dom/SelectorQuery.h: Updated for above changes.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument): Return
Document& instead of Document*.
* html/HTMLFrameOwnerElement.h: Updated for above change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack): Return TextTrack&
instead of Ref<TextTrack>.
* html/HTMLMediaElement.h: Updated for above.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
Updated for new exceptions.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::querySelector): Ditto.
(WebCore::InspectorDOMAgent::querySelectorAll): Ditto.
(WebCore::InspectorDOMAgent::performSearch): Ditto.
(WebCore::InspectorDOMAgent::highlightSelector): Ditto.
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::performSearch): Put a null check
here so callers don't have to do it. Pass references to the
individual functions since the pointer can't be null.
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
Updated to use reference and streamlined code a bit, using
containsIgnoringASCIICase instead of findIgnoringCase.
(WebCore::InspectorNodeFinder::matchesAttribute): Ditto.
(WebCore::InspectorNodeFinder::matchesElement): Ditto.
(WebCore::InspectorNodeFinder::searchUsingXPath): Ditto.
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors): Ditto.
Also updated for new exceptions in querySelectorAll.
* inspector/InspectorNodeFinder.h: Updated for above.
* page/Crypto.cpp:
(WebCore::Crypto::webkitSubtle): Return WebKitSubtleCrypto&
insetad of WebKitSubtleCrypto*.
* page/Crypto.h: Updated for above.
* testing/Internals.h: Removed declarations for functions already
removed: ensureShadowRoot and createShadowRoot.
2016-10-31 Darin Adler <darin@apple.com>
Convert Document from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164212
Reviewed by Alex Christensen.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer): Removed IGNORE_EXCEPTION.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom): Use releaseReturnValue
instead of ASSERT_NO_EXCEPTION.
(WebCore::ContainerNode::parserInsertBefore): Removed ASSERT_NO_EXCEPTION.
(WebCore::ContainerNode::parserAppendChild): Ditto.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Updated for new
exception handling.
(WebCore::DOMImplementation::createDocument): Ditto.
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation): Return ExceptionOr.
(WebCore::Document::createElementForBindings): Ditto.
(WebCore::Document::createCDATASection): Ditto.
(WebCore::Document::createProcessingInstruction): Ditto.
(WebCore::Document::importNode): Ditto.
(WebCore::Document::adoptNode): Ditto.
(WebCore::Document::createElementNS): Ditto.
(WebCore::Document::setXMLVersion): Ditto.
(WebCore::Document::setBodyOrFrameset): Ditto.
(WebCore::Document::processHttpEquiv): Ditto.
(WebCore::Document::createEvent): Ditto.
(WebCore::Document::cookie): Ditto.
(WebCore::Document::setCookie): Ditto.
(WebCore::Document::setDomain): Ditto.
(WebCore::Document::parseQualifiedName): Ditto. Also added an overload
that constructs a QualifiedName directly that most call sites can use.
(WebCore::Document::createAttribute): Return ExceptionOr.
(WebCore::Document::createAttributeNS): Ditto.
(WebCore::Document::createTouch): Removed unneeded ExceptionCode&.
* dom/Document.h: Updated for above.
* dom/Document.idl: Use non-legacy exceptions. Removed exception
entirely from createTouch.
* dom/Element.cpp:
(WebCore::Element::parseAttributeName): Updated to use the new
Document::parseQualifiedName.
* editing/EditorCommand.cpp:
(WebCore::executeFormatBlock): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeName): Updated for the new
exception handling.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies): Ditto.
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument): Use the
HTMLHtmlElement::create and HTMLBodyElement::create instead of using
createElementNS to make the simple document.
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName): Renamed, made this
a member function, updated to use the new Document::parseQualifiedName,
and also moved the code to get the attribute in here.
(WebCore::SVGSMILElement::constructAttributeName): Added. Helper function
for the two places we update the attribute name from attributeNameAttr.
(WebCore::SVGSMILElement::insertedInto): Use updateAttributeName.
(WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
* svg/animation/SVGSMILElement.h: Updated for the above.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::processingInstruction): Updated to understand
ExceptionOr rather than an out argument.
(WebCore::XMLDocumentParser::startDocument): Removed ASSERT_NO_EXCEPTION.
2016-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
Holding down a key to choose an accented character should fire "insertReplacementText" input events
https://bugs.webkit.org/show_bug.cgi?id=164209
<rdar://problem/29019305>
Reviewed by Darin Adler.
For TypingCommands that correspond to "insertReplacementText" inputTypes, vend dataTransfers for resulting
beforeinput and input events if the edited area is not an input field or textarea. To do this, convert the plain
text representation of the content to be inserted to HTML text using a helper function,
MarkupAccumulator::appendCharactersReplacingEntities, that is used when creating markup for Text nodes.
Tests: fast/events/before-input-prevent-insert-replacement.html
fast/events/input-event-insert-replacement.html
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::inputEventDataTransfer):
* editing/TypingCommand.h:
2016-10-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Miscellaneous bug fixes
https://bugs.webkit.org/show_bug.cgi?id=164211
Reviewed by Darin Adler.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
Make sure to properly reject invalid transform-origin-z values.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeAttribute):
Make attribute selector parsing strict about requiring a ] to end
the selector.
(WebCore::CSSSelectorParser::consumePseudo):
Force the nth-child "of" syntax to have whitespace after "of" but
before the selector. It is unclear if this should be a requirement
or not (spec is ambiguous), but for now we match the old parser.
(WebCore::CSSSelectorParser::consumeCombinator):
Fix a bug that caused the double child combinator to match even
when there was whitespace between the two > symbols.
2016-10-31 Youenn Fablet <youenn@apple.com>
RTCOfferAnswerOptions does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164216
Reviewed by Darin Adler.
Covered by existing tests.
Making RTCOffer/Answer options dictionaries as per specification.
Removing code that handles RTCOffer/Answer options dictionary since this is done by the binding generator.
Updated users of the options accordingly.
* CMakeLists.txt:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOffer):
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswer):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCOfferAnswerOptions.cpp: Removed.
* Modules/mediastream/RTCOfferAnswerOptions.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedCreateOffer):
(WebCore::RTCPeerConnection::queuedCreateAnswer):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* WebCore.xcodeproj/project.pbxproj:
2016-10-31 Youenn Fablet <youenn@apple.com>
fast/mediastream/RTCPeerConnection-* tests crashing under ASan
https://bugs.webkit.org/show_bug.cgi?id=164215
Reviewed by Philippe Normand.
Covered by ASAN bot tests.
* platform/mediastream/SDPProcessorScriptResource.cpp:
(WebCore::SDPProcessorScriptResource::scriptString):
2016-10-28 Philippe Normand <pnormand@igalia.com>
[OpenWebRTC] Initialize library one time only
https://bugs.webkit.org/show_bug.cgi?id=164118
Reviewed by Darin Adler.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
(WebCore::initializeOpenWebRTC): Prevent multiple initialisations of the library.
2016-10-30 Brent Fulgham <bfulgham@apple.com>
Unreviewed fix: Correct ChangeLog after my bad merge.
* ChangeLog
2016-10-30 Darin Adler <darin@apple.com>
Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164206
Reviewed by Chris Dumez.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertyNames): Use modern for loop, and
updates since the names function now returns a vector.
(WebCore::JSDOMStringMap::putDelegate): Use propagateException. Also return
true any time an exception is raised. Since true tells the caller to return
without doing any work, we always want to return that on an exception.
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::names): Renamed from getNames and made this
return a Vector instead of populating a passed-in vector.
(WebCore::DatasetDOMStringMap::setItem): Use ExceptionOr.
* dom/DatasetDOMStringMap.h: Updated for above.
* dom/Document.cpp:
(WebCore::Document::adoptNode): Updated to use ExceptionOr for
removeAttributeNode. Changed to use remove rather than removeChild for
better clarity.
* dom/Element.cpp:
(WebCore::Element::setAttribute): Use ExceptionOr.
(WebCore::Element::createShadowRoot): Deleted. Unused.
(WebCore::Element::attachShadow): Use ExceptionOr.
(WebCore::Element::shadowRootForBindings): Tweaked a bit.
(WebCore::Element::userAgentShadowRoot): Removed unneeded if statemment.
(WebCore::Element::ensureUserAgentShadowRoot): Tweaked a bit.
(WebCore::Element::setAttributeNode): Use ExceptionOr.
(WebCore::Element::setAttributeNodeNS): Ditto.
(WebCore::Element::removeAttributeNode): Ditto.
(WebCore::Element::parseAttributeName): Ditto. Also changed return result
to be a QualifiedName instead of using an out argument.
(WebCore::Element::setAttributeNS): Ditto.
(WebCore::Element::mergeWithNextTextNode): Ditto.
(WebCore::Element::setOuterHTML): Ditto.
(WebCore::Element::setInnerHTML): Ditto.
(WebCore::Element::matches): Ditto.
(WebCore::Element::closest): Ditto.
(WebCore::Element::insertAdjacent): Ditto.
(WebCore::Element::insertAdjacentElement): Ditto.
(WebCore::contextNodeForInsertion): Ditto.
(WebCore::contextElementForInsertion): Added. Helper for the
insertAdjacentHTML function to eliminate a local variable.
(WebCore::Element::insertAdjacentHTML): Use ExceptionOr.
(WebCore::Element::insertAdjacentText): Ditto.
* dom/Element.h: Updated for above.
* dom/Element.idl: Use non-legacy exceptions.
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::removeNamedItem): Use ExceptionOr.
(WebCore::NamedNodeMap::supportedPropertyNames): Updated to check
which strings should be removed without copying the strings.
(WebCore::NamedNodeMap::removeNamedItemNS): Use ExceptionOr.
(WebCore::NamedNodeMap::setNamedItem): Ditto. Removed overload for
legacy bindings; move that to the bindings themselves.
* dom/NamedNodeMap.h: Updated for above.
* dom/NamedNodeMap.idl: Use non-legacy exceptions.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText): Updated since mergeWithNextTextNode
now uses ExceptionOr.
* inspector/DOMEditor.cpp: Updated to use ExceptionOr.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::toErrorString): Added an overload for
Exception.
(WebCore::InspectorDOMAgent::setAttributesAsText): Updated to use ExceptionOr.
* inspector/InspectorDOMAgent.h: Updated for above.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Updated to
use the correct version of setAttribute; there was never a risk that there
would be an exception, but now that's clearer.
* testing/Internals.cpp:
(WebCore::Internals::ensureShadowRoot): Deleted. Was unused.
(WebCore::Internals::createShadowRoot): Ditto.
* testing/Internals.idl: Updated for above.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::handleNamespaceAttributes): Use updated parseAttributeName,
which uses ExceptionOr and a return value instead of an out argument.
(WebCore::handleElementAttributes): Ditto.
2016-10-30 Sam Weinig <sam@webkit.org>
[WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
https://bugs.webkit.org/show_bug.cgi?id=164208
Reviewed by Darin Adler.
Restructure IDLParsers structs to match modern WebIDL conventions:
- Rename structs to have more WebCore like naming, consistently using
the prefix IDL.
- Remove domSignature. Sinking it's properties into the structs that
contained it.
- Add IDLArgument, replacing the use of domSignatures for arguments.
IDLArgument is the subset of domSignatures needed for arguments.
- Rename domFunction to IDLOperation (matching WebILD nomenclature),
replace signature with its own name, type (for returnType), specials,
and extended attributes properties.
- Give IDLAttribute it's own name, type and extended attributes properties.
- Add IDLDictionaryMember, replacing the use of domSignature as the
type of members in IDLDictionary. Give it name, type, isRequired,
default and extendedAttributes properties.
- Renamed Typedef to be IDLTypedef. Remove the extended attributes
property as those are not allowed in typedefs per-PebIDL.
Also fix some parsing issues:
- Stop parsing 'in' directives in function arguments.
- Stop parsing extended attributes in typedefs.
- Support applying typedefs to types deep in aggregate types
(e.g. (sequence<(LONG or STRING)> or DOMString)?).
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/IDLParser.pm:
* bindings/scripts/generate-bindings.pl:
Update for new struct types.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestTypedefs.idl:
Remove test which tested extended attributes in typedefs,
and add a test which tests typedefs used in deep type structures.
* page/make_settings.pl:
Don't generate the 'in' prefix for arguments in IDL files.
2016-10-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix nth-child serialization
https://bugs.webkit.org/show_bug.cgi?id=164210
Reviewed by Darin Adler.
Our nth-child serialization preserves what the author originally
typed. Even though this is not spec-compliant (the latest CSS Syntax
spec has a dumbed down serialization process that doesn't preserve what
the author originally typed), I think it's better behavior to preserve
this text.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize):
Fix a bug in the serialization of number tokens that started with
a plus sign. Make sure the plus sign is preserved.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Grab the range of tokens from after the ( and up to the ) or the "of"
and then serialize them. Strip whitepsace from the ends and set that
as the selector argument.
2016-10-30 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Correct bookkeeping for begin/end draw pairs
https://bugs.webkit.org/show_bug.cgi?id=163898
Reviewed by Darin Adler.
Simon pointed out that GraphicsContext objects are generally only created at
the time we intend to do drawing, so calling 'BeginDraw' as part of object
construction, and 'EndDraw' at time of destruction should be sufficient.
As usual, he was correct.
This patch gets rid of unneeded code and greatly simplifies the Direct2D
drawing path.
Tested by existing layout tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill):Remove unneeded use
of 'RenderTargetScopedDrawing.h'.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Remove unneeded use
of RenderTargetScopedDrawing class.
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Enter
the 'BeginDraw' state at object creation.
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): End
draw state at object destruction.
(WebCore::GraphicsContextPlatformPrivate::clip): Remove unneeded call to 'beginDraw'.
(WebCore::GraphicsContextPlatformPrivate::beginDraw): Renamed from 'beginDrawIfNeeded'.
(WebCore::GraphicsContextPlatformPrivate::endDraw): Get rid of draw state flags.
(WebCore::GraphicsContext::beginDraw): Renamed from 'beginDrawIfNeeded'.
(WebCore::GraphicsContext::flush): Added.
(WebCore::GraphicsContext::drawWithoutShadow): Remove unneeded use of
RenderTargetScopedDrawing class.
(WebCore::GraphicsContext::drawWithShadow): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContext::didBeginDraw): Deleted.
(WebCore::GraphicsContextPlatformPrivate::beginDrawIfNeeded): Deleted.
(WebCore::GraphicsContext::beginDrawIfNeeded): Deleted.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Deleted.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Remove unneeded use of RenderTargetScopedDrawing class.
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::flushContext): Call new GraphicsContext 'flush' command.
(WebCore::ImageBuffer::draw): Remove unneeded use of RenderTargetScopedDrawing class.
* platform/graphics/win/NativeImageDirect2D.cpp: Ditto.
* platform/graphics/win/RenderTargetScopedDrawing.h: Removed.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage): Remove unneeded use of RenderTargetScopedDrawing class.
2016-10-30 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Clean up the two types of descendant relations in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=164203
Reviewed by Zalan Bujtas.
This patch gets rid of the separate boolean for double child and allows it
to be a unique relation type. Rename Descendant to DescendantSpace and
name the new relation DescendantDoubleChild.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
(WebCore::CSSSelector::hasDescendantRelation):
(WebCore::CSSSelector::hasDescendantOrChildRelation):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::setDescendantUseDoubleChildSyntax): Deleted.
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::SelectorChecker::determineLinkMatchType):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setDescendantUseDoubleChildSyntax): Deleted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isDescendantCombinator):
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCombinator):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2016-10-30 Frederic Wang <fwang@igalia.com>
Unreviewed gardening
Fix build error on WinCairo.
* platform/graphics/opentype/OpenTypeMathData.cpp:
2016-10-30 Frederic Wang <fwang@igalia.com>
Use HarfBuzz ot-math API to parse the OpenType MATH table
https://bugs.webkit.org/show_bug.cgi?id=162671
Reviewed by Michael Catanzaro.
No new tests, already covered by existing tests.
* platform/graphics/opentype/OpenTypeMathData.cpp: Add alternative implementation relying on
HarfBuzz's new OpenType MATH API.
* platform/graphics/opentype/OpenTypeMathData.h: Ditto.
(WebCore::OpenTypeMathData::hasMathData):
(WebCore::OpenTypeMathData::HbFontDeleter::operator()):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support unprefixed image-sets
https://bugs.webkit.org/show_bug.cgi?id=164198
Reviewed by Dean Jackson.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImage):
2016-10-30 Yusuke Suzuki <utatane.tea@gmail.com>
[DOM] Introduce WebCore::jsDynamicDowncast
https://bugs.webkit.org/show_bug.cgi?id=164137
Reviewed by Darin Adler.
In WebCore, we have several extended JSTypes, like JSElementType.
For these types, WebCore offers the faster casting function compared
to JSC::jsDynamicCast. For example, for JSElementType, we have
jsElementCast.
The problem is that we may fall into the slow code if we choose
JSC::jsDynamicCast by accident. Selecting the appropriate function
requires special care in the IDL code generator when we would like
to use faster casting functions.
This patch implements a new casting function, WebCore::jsDynamicDowncast.
It is a thin wrapper to the JSC::jsDynamicCast. But it selects the
faster casting functions correctly by template specialization.
We do not choose the way specializing JSC::jsDynamicCast directly.
If we forget to include the header that specializes JSC::jsDyanmicCast,
it does not cause any compile errors, but it causes performance regression.
This bug is hard to figure out. To avoid this problem, we add a new function.
Outside JSC, only Tools' DumpRenderTree uses JSC::jsDynamicCast.
This code has FIXME that we should use JSC APIs instead of directly calling
JSC thingy. So this should be solved in the layer of JSC APIs and changing
this jsDynamicCast to WebCore's jsDynamicDowncast and exposing WebCore's thingy
are not good change. So we leave the code as is.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMBinding.h:
(WebCore::castThisValue):
(WebCore::toArrayBufferView):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::toWrapped):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDocumentCustom.h:
(WebCore::jsDocumentCast):
* bindings/js/JSDynamicDowncast.h: Added.
(WebCore::JSDynamicCastTrait::cast):
(WebCore::JSDynamicCastTrait<JSNode>::cast):
(WebCore::JSDynamicCastTrait<JSElement>::cast):
(WebCore::JSDynamicCastTrait<JSDocument>::cast):
(WebCore::JSDynamicCastTrait<JSEvent>::cast):
(WebCore::jsDynamicDowncast):
* bindings/js/JSElementCustom.h:
(WebCore::jsElementCast):
* bindings/js/JSEventCustom.h:
(WebCore::jsEventCast):
* bindings/js/JSEventListener.cpp:
(WebCore::setDocumentEventHandlerAttribute):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::jsEventTargetCast):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::getSettings):
(WebCore::JSMediaStreamTrack::getCapabilities):
* bindings/js/JSNodeCustom.h:
(WebCore::jsNodeCast):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamDefaultReader):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::startReadableStream):
(WebCore::JSReadableStreamSource::start):
(WebCore::pullReadableStream):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::toJSDedicatedWorkerGlobalScope):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(GetCastingHelperForThisObject):
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::jsInterfaceNameConstructor):
(WebCore::setJSInterfaceNameConstructor):
(WebCore::JSInterfaceName::toWrapped):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute):
(WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::setJSTestActiveDOMObjectConstructor):
(WebCore::JSTestActiveDOMObject::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::BindingCaller<JSTestCEReactions>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactions>::castForOperation):
(WebCore::jsTestCEReactionsConstructor):
(WebCore::setJSTestCEReactionsConstructor):
(WebCore::JSTestCEReactions::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute):
(WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation):
(WebCore::jsTestCEReactionsStringifierConstructor):
(WebCore::setJSTestCEReactionsStringifierConstructor):
(WebCore::JSTestCEReactionsStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
(WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation):
(WebCore::jsTestCustomNamedGetterConstructor):
(WebCore::setJSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute):
(WebCore::jsTestEventConstructorConstructor):
(WebCore::setJSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::BindingCaller<JSTestEventTarget>::castForOperation):
(WebCore::jsTestEventTargetConstructor):
(WebCore::setJSTestEventTargetConstructor):
(WebCore::JSTestEventTarget::toWrapped):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::BindingCaller<JSTestException>::castForAttribute):
(WebCore::jsTestExceptionConstructor):
(WebCore::setJSTestExceptionConstructor):
(WebCore::JSTestException::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::jsTestGenerateIsReachableConstructor):
(WebCore::setJSTestGenerateIsReachableConstructor):
(WebCore::JSTestGenerateIsReachable::toWrapped):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute):
(WebCore::BindingCaller<JSTestGlobalObject>::castForOperation):
(WebCore::jsTestGlobalObjectConstructor):
(WebCore::setJSTestGlobalObjectConstructor):
(WebCore::JSTestGlobalObject::toWrapped):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::BindingCaller<JSTestInterface>::castForAttribute):
(WebCore::BindingCaller<JSTestInterface>::castForOperation):
(WebCore::jsTestInterfaceConstructor):
(WebCore::setJSTestInterfaceConstructor):
(WebCore::JSTestInterface::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::BindingCaller<JSTestIterable>::castForOperation):
(WebCore::jsTestIterableConstructor):
(WebCore::setJSTestIterableConstructor):
(WebCore::JSTestIterable::toWrapped):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute):
(WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation):
(WebCore::jsTestJSBuiltinConstructorConstructor):
(WebCore::setJSTestJSBuiltinConstructorConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation):
(WebCore::jsTestMediaQueryListListenerConstructor):
(WebCore::setJSTestMediaQueryListListenerConstructor):
(WebCore::JSTestMediaQueryListListener::toWrapped):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::jsTestNamedConstructorConstructor):
(WebCore::setJSTestNamedConstructorConstructor):
(WebCore::JSTestNamedConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::BindingCaller<JSTestNode>::castForAttribute):
(WebCore::BindingCaller<JSTestNode>::castForOperation):
(WebCore::jsTestNodeConstructor):
(WebCore::setJSTestNodeConstructor):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::BindingCaller<JSTestNondeterministic>::castForAttribute):
(WebCore::BindingCaller<JSTestNondeterministic>::castForOperation):
(WebCore::jsTestNondeterministicConstructor):
(WebCore::setJSTestNondeterministicConstructor):
(WebCore::JSTestNondeterministic::toWrapped):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::BindingCaller<JSTestObj>::castForAttribute):
(WebCore::BindingCaller<JSTestObj>::castForOperation):
(WebCore::jsTestObjConstructor):
(WebCore::setJSTestObjConstructor):
(WebCore::JSTestObj::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::jsTestOverloadedConstructorsConstructor):
(WebCore::setJSTestOverloadedConstructorsConstructor):
(WebCore::JSTestOverloadedConstructors::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation):
(WebCore::jsTestOverrideBuiltinsConstructor):
(WebCore::setJSTestOverrideBuiltinsConstructor):
(WebCore::JSTestOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::BindingCaller<JSTestSerialization>::castForAttribute):
(WebCore::BindingCaller<JSTestSerialization>::castForOperation):
(WebCore::jsTestSerializationConstructor):
(WebCore::setJSTestSerializationConstructor):
(WebCore::JSTestSerialization::toWrapped):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
(WebCore::JSTestSerializedScriptValueInterface::toWrapped):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::BindingCaller<JSTestTypedefs>::castForAttribute):
(WebCore::BindingCaller<JSTestTypedefs>::castForOperation):
(WebCore::jsTestTypedefsConstructor):
(WebCore::setJSTestTypedefsConstructor):
(WebCore::JSTestTypedefs::toWrapped):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject setValue:forKey:]):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::lengthGetter):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add font-variant-* keyword property support
https://bugs.webkit.org/show_bug.cgi?id=164195
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix text-emphasis-position parsing
https://bugs.webkit.org/show_bug.cgi?id=164197
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTextEmphasisPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Darin Adler <darin@apple.com>
Convert more of DOM from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164173
Reviewed by Ryosuke Niwa.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia): Use ExceptionOr.
(WebCore::MediaDevices::enumerateDevices): Ditto.
* Modules/mediastream/MediaDevices.h: Updated for above.
* Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions.
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
Added now-needed include of ExceptionCode.h.
* Modules/mediastream/RTCConfiguration.cpp:
(WebCore::parseIceServer): Use ExceptionOr.
(WebCore::RTCConfiguration::create): Ditto.
(WebCore::RTCConfiguration::initialize): Ditto.
* Modules/mediastream/RTCConfiguration.h: Updated for above.
* Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::create): Use ExceptionOr.
(WebCore::RTCDTMFSender::insertDTMF): Ditto.
* Modules/mediastream/RTCDTMFSender.h: Updated for above.
* Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create): Use ExceptionOr.
(WebCore::RTCDataChannel::setBinaryType): Ditto.
(WebCore::RTCDataChannel::send): Ditto.
(WebCore::RTCDataChannel::didReceiveRawData): Ditto.
* Modules/mediastream/RTCDataChannel.h: Updated for above.
Also changed return values to use const AtomicString& and
unsigned instead of unsigned long. Also made more private.
Also changed BinaryType into an enum class.
* Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create): Use ExceptionOr.
* Modules/mediastream/RTCIceCandidate.h: Updated for above.
* Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception.
* Modules/mediastream/RTCOfferAnswerOptions.cpp:
(WebCore::RTCOfferOptions::create): Use ExceptionOr.
(WebCore::RTCAnswerOptions::create): Ditto.
* Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above.
Also removed all virtual functions since nothing here is polymorphic
and initalized data members in the header.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr.
(WebCore::RTCPeerConnection::addTrack): Ditto.
(WebCore::RTCPeerConnection::removeTrack): Ditto.
(WebCore::RTCPeerConnection::addTransceiver): Ditto.
(WebCore::RTCPeerConnection::completeAddTransceiver): Ditto.
(WebCore::RTCPeerConnection::queuedCreateOffer): Ditto.
(WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto.
(WebCore::RTCPeerConnection::setConfiguration): Ditto.
(WebCore::RTCPeerConnection::createDataChannel): Ditto.
* Modules/mediastream/RTCPeerConnection.h: Updated for above.
* Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr.
* Modules/mediastream/RTCRtpSender.h: Updated for above.
* Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception.
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::create): Use ExceptoinOr.
* Modules/mediastream/RTCSessionDescription.h: Updated for above.
(WebCore::RTCSessionDescription::~RTCSessionDescription):
* Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions.
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::verifyCustomHandlerURL): Just return a boolean, no exception.
(WebCore::verifyProtocolHandlerScheme): Ditto.
(WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr.
(WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto.
(WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto.
* Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above.
* Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions.
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException.
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether
we need to call propagateException explicitly, if return value processing is not
going to propagate the exception for us.
(GenerateParametersCheck): Moved the code from GenerateReturnParameters inline
because it's almost as short as the function call. Use the newly created
NeedsExplicitPropagateExceptionCall function, which properly handles the case
where the return value is a promise.
(GenerateReturnParameters): Deleted.
* dom/CharacterData.cpp:
(WebCore::CharacterData::substringData): Use ExceptionOr.
(WebCore::CharacterData::insertData): Ditto.
(WebCore::CharacterData::deleteData): Ditto.
(WebCore::CharacterData::replaceData): Ditto.
* dom/CharacterData.h: Updated for above.
* dom/CharacterData.idl: Use non-legacy exceptions.
* dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems
like dead code that doesn't compile.
* dom/DataTransferItemList.idl: Use non-legacy exceptions.
* dom/MessagePort.idl: Use non-legacy exceptions, except this has
already been converted and was a custom binding.
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe): Use ExceptionOr.
* dom/MutationObserver.h: Updated for above.
* dom/MutationObserver.idl: Use non-legacy exception.
* dom/Range.cpp:
(WebCore::deleteCharacterData): Updated use of calls that now use
ExceptionOr.
(WebCore::Range::processContentsBetweenOffsets): Ditto.
(WebCore::Range::insertNode): Ditto.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr.
* dom/ShadowRoot.h: Updated for above.
* dom/ShadowRoot.idl: Use non-legacy exception.
* dom/Text.cpp:
(WebCore::Text::splitText): Use ExceptionOr.
(WebCore::Text::replaceWholeText): Removed unused ExceptionCode&.
* dom/Text.h: Updated for above.
* dom/Text.idl: Use non-legacy exception.
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition): Rewrote to use data rather than
substringData; more efficient.
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with
functions that return ExceptionOr.
(WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
Use WTFMove to avoid a little bit of reference count churn.
(WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION.
(WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode.
(WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply): Updated to work with functions
that return ExceptionCode.
(WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION.
(WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work
with functions that return ExceptionCode.
* html/HTMLTextFormControlElement.cpp:
Added now-needed include of ExceptionCode.h.
* inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls
to replaceWholeText, which never throws an exception.
2016-10-29 Dean Jackson <dino@apple.com>
Parse color() function
https://bugs.webkit.org/show_bug.cgi?id=164146
<rdar://problems/29007218>
Reviewed by Darin Adler.
Support the new CSS color() function:
https://drafts.csswg.org/css-color/#color-function
There are separate code paths for the old and new CSS parser.
Tests: css3/color/color-function-computed-style.html
css3/color/color-function-parsing.html
* css/CSSComputedStyleDeclaration.cpp: Use Color directly, not via rgb().
(WebCore::ComputedStyleExtractor::currentColorOrValidColor):
(WebCore::ComputedStyleExtractor::valueForShadow):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSValueKeywords.in: Note that there is a color function, but the
keyword is already defined. Also add keywords for the color spaces.
* css/SVGCSSValueKeywords.in: sRGB is used outside of SVG now.
* css/parser/CSSParser.cpp: Old CSS parser code to handle color().
(WebCore::isPercent): Helper to tell if a ValueWithCalculation is a percentage or not.
(WebCore::CSSParser::parseColorInt): Renamed.
(WebCore::CSSParser::parseColorDouble): Helper to get a Number/Percentage into a double
(WebCore::CSSParser::parseRGBParameters):
(WebCore::CSSParser::parseColorFunctionParameters):
(WebCore::CSSParser::parseHSLParameters):
(WebCore::CSSParser::parseColorFromValue):
(WebCore::CSSParser::colorIntFromValue): Deleted.
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParserHelpers.cpp: New CSS parser code to handle color().
(WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
* platform/graphics/Color.h:
(WebCore::Color::isValid): An extended color is valid.
(WebCore::Color::rgb): Move the code to a standalone inline
so that I could add a longer comment.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Alpha output is only needed if != 1.
* platform/graphics/cg/ColorCG.cpp: Handle ExtendedColor -> CGColor.
(WebCore::leakCGColor):
(WebCore::cachedCGColor):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Disable -webkit-text-size-adjust when the context says to.
https://bugs.webkit.org/show_bug.cgi?id=164191
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Match old parser's image-rendering values
https://bugs.webkit.org/show_bug.cgi?id=164190
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-text value for background-clip and -webkit-background-clip
https://bugs.webkit.org/show_bug.cgi?id=164189
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundBox):
(WebCore::consumePrefixedBackgroundBox):
2016-10-29 Joseph Pecoraro <pecoraro@apple.com>
Remove some unnecessary includes
https://bugs.webkit.org/show_bug.cgi?id=164174
Reviewed by Darin Adler.
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=164187
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitAspectRatio):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the caps lock indicator appearance
https://bugs.webkit.org/show_bug.cgi?id=164186
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the alt property
https://bugs.webkit.org/show_bug.cgi?id=164184
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAlt):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-hyphenate-limit-* properties
https://bugs.webkit.org/show_bug.cgi?id=164183
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeHyphenateLimit):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix transform-origin and perspective-origin to parse as shorthands
https://bugs.webkit.org/show_bug.cgi?id=164178
Reviewed by Zalan Bujtas.
* css/CSSPropertyNames.in:
Patch the transform-origin-x/y and perspective-origin-x/y properties
to use new converters that can handle keywords.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponentX):
(WebCore::StyleBuilderConverter::convertPositionComponentY):
Add the new converters. They just call convertPositionComponent method
that we already use for object-position and background-position.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
(WebCore::CSSPropertyParser::consumePerspectiveOrigin):
Changed to treat the properties as shorthands and add the longhand
properties once parsed.
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
Move the parsing into the shorthand method, since we're still treating
these properties as shorthands.
2016-10-29 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-background-composite
https://bugs.webkit.org/show_bug.cgi?id=164179
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBackgroundComponent):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-29 Youenn Fablet <youenn@apple.com>
REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=163922
Reviewed by Alex Christensen.
Test: http/tests/security/cached-svg-image-with-css-cross-domain.html
Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients.
Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setBodyDataFrom):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::mayTryReplaceEncodedData):
2016-10-29 Youenn Fablet <youenn@apple.com>
REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds
https://bugs.webkit.org/show_bug.cgi?id=163814
<rdar://problem/28917420>
Reviewed by Darin Adler.
Tests: http/tests/xmlhttprequest/resetting-timeout-to-zero.html
http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setTimeout): If the XHR timeout is active, resetting the timeout to zero should lead to using the default network timeout.
Since it is difficult to update the timeout once the request is sent, we mimic the default network timeout with a 60 seconds XHR timeout.
(WebCore::XMLHttpRequest::createRequest): Setting network timeout to infinity if the XHR timeout is active.
2016-10-29 Youenn Fablet <youenn@apple.com>
MediaEndpoint::generateDtlsInfo is not needed
https://bugs.webkit.org/show_bug.cgi?id=164130
Reviewed by Eric Carlson.
No change of behavior.
Removing MediaEndpoint::generateDtlsInfo as it can be called directly from createMediaEndpointOwr.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::createMediaEndpointOwr):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::generateDtlsInfo): Deleted.
* platform/mock/MockMediaEndpoint.h:
2016-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, add Input Events to the features list.
* features.json:
2016-10-28 Darin Adler <darin@apple.com>
Fix mismerge that broke a CEReactions test.
* html/HTMLOptionsCollection.idl: Add back CEReactions to the remove function.
2016-10-28 Darin Adler <darin@apple.com>
Move all classes in the HTML directory from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163876
Reviewed by Sam Weinig.
* bindings/js/JSDOMBinding.cpp:
(WebCore::shouldAllowAccessToNode): Deleted.
(WebCore::BindingSecurity::shouldAllowAccessToFrame): Moved function into the
BindingSecurity namespace. Also changed arguments to references.
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): Ditto.
(WebCore::BindingSecurity::shouldAllowAccessToNode): Changed argument type
from pointer to reference.
* bindings/js/JSDOMBinding.h: Removed top level shouldAllowAccessTo functions,
moving all of them into the BindingSecurity namespace. Changed BindingSecurity
from a class into a namespace. Added new checkSecurityForNode functions that
can be used directly to implement CheckSecurityForNode; they turn the node
into a null, which is no change in behavior from what bindings already did.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Changed argument
type for passed-in string to const String& instead of String&.
(WebCore::JSDOMWindow::getOwnPropertySlot): Updated for BindingSecurity changes.
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex): Ditto.
(WebCore::JSDOMWindow::put): Ditto.
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::attributesFor3DContext): Renamed from get3DContextAttributes and
changed to use a return value instead of an out argument.
(WebCore::JSHTMLCanvasElement::getContext): Updated for the above.
(WebCore::JSHTMLCanvasElement::toDataURL): Rewrote to handle ExceptionOr
and also to use Optional<double> instead of const double*.
* bindings/js/JSHTMLFrameElementCustom.cpp:
(WebCore::JSHTMLFrameElement::setLocation): Moved the logic from
allowSettingJavascriptURL in here and updated for BindingSecurity changes.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength): Use propagateException.
Also streamlined the code a bit.
(WebCore::JSHTMLOptionsCollection::indexSetter): Updated for new name and
argument types for selectElementIndexSetter.
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter): Updated name and argument types and
to use propagateException.
(WebCore::JSHTMLSelectElement::indexSetter): Updated for above.
* bindings/js/JSHTMLSelectElementCustom.h: Ditto.
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate): Updated for changes to
BindingSecurity.
(WebCore::JSLocation::putDelegate): Ditto. Also rearranged logic a bit.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canAccessFromCurrentOrigin): Updated for
changes to BindingSecurity.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed old support for CheckSecurityForNode.
(NativeToJSValue): Added new support for CheckSecurityForNode, which uses
the new checkSecurityForNode function, and works properly with ExceptionOr.
* bindings/scripts/test/JS/JSTestObj.cpp: Updated for change below.
* dom/ChildNode.idl: Move the remove function to non-legacy exception.
Needed now because this needs to match the one in HTMLSelectElement.
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin): Refactored a little bit.
(WebCore::Element::mergeWithNextTextNode): Support ExceptionOr for remove.
(WebCore::Element::setOuterHTML): Support ExceptionOr for
createFragmentForInnerOuterHTML.
(WebCore::Element::setInnerHTML): Ditto.
(WebCore::Element::insertAdjacentHTML): Ditto.
* dom/Node.cpp:
(WebCore::Node::remove): Use ExceptionOr.
(WebCore::Node::normalize): Remove use of IGNORE_EXCEPTION.
* dom/Node.h: Use ExceptionOr for remove.
* dom/Range.cpp:
(WebCore::Range::insertNode): Updated for change to remove.
(WebCore::Range::createContextualFragment): Updated for change
to WebCore::createContextualFragment.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr for
createFragmentForInnerOuterHTML and replaceChildrenWithFragment.
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doUnapply): Remove IGNORE_EXCEPTION.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doApply): Ditto.
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doApply): Ditto.
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::doUnapply): Ditto.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doUnapply): Ditto.
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
* editing/Editor.cpp:
(WebCore::Editor::insertDictationPhrases): Deleted. Moved this
iOS-specific function to EditorIOS.mm.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
(WebCore::Editor::confirmMarkedText): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION.
(WebCore::Editor::fontAttributesForSelectionStart): Ditto.
(WebCore::Editor::insertDictationPhrases): Moved here from Editor.cpp.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. Also
updated code that used remove to not pass an ExceptionCode.
(WebCore::Editor::confirmMarkedText): Ditto.
(WebCore::Editor::setTextAsChildOfElement): Ditto.
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION.
(WebCore::Editor::fontAttributesForSelectionStart): Ditto.
* editing/markup.cpp:
(WebCore::createFragmentForInnerOuterHTML): Use ExceptionOr.
(WebCore::createContextualFragment): Ditto.
(WebCore::replaceChildrenWithFragment): Ditto.
(WebCore::replaceChildrenWithText): Ditto.
* editing/markup.h: Updated for above changes.
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
Removed ASSERT_NO_EXCEPTION.
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::setValueAsDate): Use ExceptionOr.
(WebCore::BaseDateAndTimeInputType::setValueAsDecimal): Ditto.
* html/BaseDateAndTimeInputType.h: Updated for above changes.
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::setValueAsDate): Use ExceptionOr.
* html/DateTimeLocalInputType.h: Updated for above changes.
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::validateToken): Use ExceptionOr.
(WebCore::DOMTokenList::validateTokens): Ditto.
(WebCore::DOMTokenList::addInternal): Ditto.
(WebCore::DOMTokenList::add): Ditto.
(WebCore::DOMTokenList::removeInternal): Ditto.
(WebCore::DOMTokenList::remove): Ditto.
(WebCore::DOMTokenList::toggle): Ditto.
(WebCore::DOMTokenList::replace): Ditto.
(WebCore::DOMTokenList::supports): Ditto.
* html/DOMTokenList.h: Updated for above changes.
* html/DOMTokenList.idl: Use non-legacy exceptions.
* html/DOMURL.cpp:
(WebCore::DOMURL::DOMURL): Just take the two URL objects and let
the create functions do all the processing.
(WebCore::DOMURL::create): Use ExceptionOr, and move the processing
of the URLs here out of the constructors.
(WebCore::DOMURL::setHref): Use ExceptionOr.
* html/DOMURL.h: Updated for above changes.
* html/DOMURL.idl: Use non-legacy exceptions.
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry): Remove
IGNORE_EXCEPTION and use releaseReturnValue().
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toDataURL): Use ExceptionOr.
* html/HTMLCanvasElement.h: Updated for above changes.
* html/HTMLCanvasElement.idl: Use non-legacy exception.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::textToFragment): Use ExceptionOr.
(WebCore::HTMLElement::setInnerText): Ditto.
(WebCore::HTMLElement::setOuterText): Ditto.
(WebCore::HTMLElement::setContentEditable): Ditto.
(WebCore::HTMLElement::translateAttributeMode): Deleted.
(WebCore::HTMLElement::translate): Moved the logic from the
translateAttributeMode function in here.
* html/HTMLElement.h: Updated for above changes.
* html/HTMLElement.idl: Use non-legacy exceptions.
* html/HTMLEmbedElement.idl: Use non-legacy exception.
* html/HTMLFrameElement.idl: Ditto.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument): Use ExceptionOr.
* html/HTMLFrameOwnerElement.h: Updated for above.
* html/HTMLIFrameElement.idl: Use non-legacy exception.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::stepUp): Use ExceptionOr.
(WebCore::HTMLInputElement::stepDown): Ditto.
(WebCore::HTMLInputElement::setValue): Ditto.
(WebCore::HTMLInputElement::setValueAsDate): Ditto.
(WebCore::HTMLInputElement::setValueAsNumber): Ditto.
(WebCore::HTMLInputElement::setSize): Ditto.
(WebCore::HTMLInputElement::maxLengthAttributeChanged): Use the
new internalSetMaxLength function; old code relied on a setMaxLength
that was different from the one exposed to bindings.
(WebCore::HTMLInputElement::minLengthAttributeChanged): Ditto.
(WebCore::HTMLInputElement::setRangeText): Use ExceptionOr.
* html/HTMLInputElement.h: Updated for above changes. Also use
data member initialization for InputElementClickState instead of
a constructor.
* html/HTMLInputElement.idl: Use non-legacy exception.
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::setLoop): Use ExceptionOr.
(WebCore::HTMLMarqueeElement::renderMarquee): Tweaked.
* html/HTMLMarqueeElement.h: Updated for above changes.
* html/HTMLMarqueeElement.idl: Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::TrackGroup::TrackGroup):
Initialize most data members in class definition rather than
the constructor.
(WebCore::HTMLMediaElement::HTMLMediaElement): Ditto.
(WebCore::HTMLMediaElement::~HTMLMediaElement): Updated since
removeMediaElement now takes a reference.
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Use
a modern for loop to streamline code.
(WebCore::HTMLMediaElement::textTrackModeChanged): Updated since
track now returns a reference.
(WebCore::HTMLMediaElement::setCurrentTimeForBindings): Renamed
to prevent ambiguity with the other version that has slightly
different semantics and overloading and changed to use ExceptionOr.
(WebCore::HTMLMediaElement::playInternal): Updated to use reference.
(WebCore::HTMLMediaElement::setVolume): Use ExceptionOr.
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Take a
reference instead of a PassRefPtr.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidRemoveAudioTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidRemoveTextTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidRemoveVideoTrack): Ditto.
(WebCore::HTMLMediaElement::addTextTrack): Use ExceptionOr.
(WebCore::HTMLMediaElement::didAddTextTrack): Use a reference.
(WebCore::HTMLMediaElement::didRemoveTextTrack): Ditto.
(WebCore::HTMLMediaElement::maxBufferedTime): Update to use different
interface to time ranges that does not need to deal with exceptions.
(WebCore::HTMLMediaElement::setController): Pass references.
(WebCore::HTMLMediaElement::outOfBandTrackSources): Use reference.
* html/HTMLMediaElement.h: Updated for above.
* html/HTMLMediaElement.idl: Use non-legacy exceptions.
* html/HTMLObjectElement.idl: Use non-legacy exception.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr.
* html/HTMLOptionElement.h: Updated for above change.
* html/HTMLOptionElement.idl: Use non-legacy exception.
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::setLength): Use ExceptionOr.
* html/HTMLOptionsCollection.h: Updated for above change.
* html/HTMLOptionsCollection.idl: Use non-legacy exception.
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::setValue): Removed non-finite handling
because that is now handled by the bindings.
(WebCore::HTMLProgressElement::setMax): Ditto.
* html/HTMLProgressElement.h: Updated for above.
* html/HTMLProgressElement.idl: Changed attributes to be double instead
of unrestricted double, and this was able to remove exceptions.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::removeByIndex): Drop IGNORE_EXCEPTION.
(WebCore::HTMLSelectElement::remove): Use ExceptionOr.
(WebCore::HTMLSelectElement::setOption): Ditto.
(WebCore::HTMLSelectElement::setLength): Ditto.
* html/HTMLSelectElement.h: Updated for above changes.
* html/HTMLSelectElement.idl: Use non-legacy exceptions.
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::setCaption): Use ExceptionOr.
(WebCore::HTMLTableElement::setTHead): Ditto.
(WebCore::HTMLTableElement::setTFoot): Ditto.
(WebCore::HTMLTableElement::createTHead): Streamline a bit.
(WebCore::HTMLTableElement::deleteTHead): Ditto.
(WebCore::HTMLTableElement::createTFoot): Ditto.
(WebCore::HTMLTableElement::deleteTFoot): Ditto.
(WebCore::HTMLTableElement::createTBody): Ditto.
(WebCore::HTMLTableElement::createCaption): Ditto.
(WebCore::HTMLTableElement::insertRow): Use ExceptionOr.
(WebCore::HTMLTableElement::deleteRow): Ditto.
* html/HTMLTableElement.h: Updated for above changes.
* html/HTMLTableElement.idl: Use non-legacy exceptions.
* html/HTMLTableRowElement.cpp:
(WebCore::findTable): Added.
(WebCore::HTMLTableRowElement::rowIndex): Streamline a bit using the
findTable function above.
(WebCore::findRows): Added.
(WebCore::HTMLTableRowElement::sectionRowIndex): Streamline a bit using
the findRows function above.
(WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr.
(WebCore::HTMLTableRowElement::deleteCell): Ditto.
(WebCore::HTMLTableRowElement::setCells): Deleted.
* html/HTMLTableRowElement.h: Updated for the above. The setCells function
was dead code.
* html/HTMLTableRowElement.idl: Use non-legacy exceptions.
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle):
Tweaked a bit to use early return.
(WebCore::HTMLTableSectionElement::insertRow): Use ExceptionOr.
(WebCore::HTMLTableSectionElement::deleteRow): Ditto.
(WebCore::HTMLTableSectionElement::numRows): Use childrenOfType.
(WebCore::HTMLTableSectionElement::align): Deleted.
(WebCore::HTMLTableSectionElement::setAlign): Deleted.
(WebCore::HTMLTableSectionElement::ch): Deleted.
(WebCore::HTMLTableSectionElement::setCh): Deleted.
(WebCore::HTMLTableSectionElement::chOff): Deleted.
(WebCore::HTMLTableSectionElement::setChOff): Deleted.
(WebCore::HTMLTableSectionElement::vAlign): Deleted.
(WebCore::HTMLTableSectionElement::setVAlign): Deleted.
* html/HTMLTableSectionElement.h: Updated for the above.
* html/HTMLTableSectionElement.idl: Use non-legacy exception.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLengthAttributeChanged): Use the new
internalSetMaxLength function; old code relied on a setMaxLength
that was different from the one exposed to bindings.
(WebCore::HTMLTextAreaElement::minLengthAttributeChanged): Ditto.
(WebCore::HTMLTextAreaElement::updatePlaceholderText): Removed
ASSERT_NO_EXCEPTION.
* html/HTMLTextAreaElement.idl: Use non-legacy exceptions.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText): Use ExceptionOr.
(WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto.
(WebCore::HTMLTextFormControlElement::setMaxLength): Ditto.
(WebCore::HTMLTextFormControlElement::setMinLength): Ditto.
* html/HTMLTextFormControlElement.h: Updated for above changes.
Also renamed the setMin/MaxLength function overloads for internal use
to internSetMin/MaxLength and made them protected.
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::~HTMLTrackElement): Call clearElement on the
track to break the connection. Before this was done as a side effect of
clearClient, but that is called in other cases where we do not want to
clear the link back to the track element.
(WebCore::HTMLTrackElement::insertedInto): Removed code that uses the
track function for its side effect of creating a track; no longer needed.
Rewrote this so it's more symmetric with removedFrom.
(WebCore::HTMLTrackElement::removedFrom): Pass reference. Also reordered
and removed an unnecessary check for null parent.
(WebCore::HTMLTrackElement::parseAttribute): Use track.
(WebCore::HTMLTrackElement::kind): Ditto.
(WebCore::HTMLTrackElement::track): Renamed ensureTrack to this. Also
removed the redundant code to call setTrackElement; we no longer change
the track element on a track until the track element is destroyed.
(WebCore::HTMLTrackElement::scheduleLoad): Use track.
(WebCore::HTMLTrackElement::loadTimerFired): Ditto.
(WebCore::HTMLTrackElement::setReadyState): Ditto.
(WebCore::HTMLTrackElement::readyState): Ditto.
(WebCore::HTMLTrackElement::mediaElement): Rearranged to use early return.
* html/HTMLTrackElement.h: Updated for above changes.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitEnterFullscreen): Use ExceptionOr.
* html/HTMLVideoElement.h: Removed the functions used just for
capitalization reasons; that's now handled in the bindings.
* html/HTMLVideoElement.idl: Use non-legacy bindings and ImplementedAs.
* html/ImageData.cpp:
(WebCore::ImageData::create): Return ExceptionOr.
* html/ImageData.h: Updated for above changes.
* html/ImageData.idl: Use non-legacy exceptions.
* html/InputType.cpp:
(WebCore::InputType::setValueAsDate): Use ExceptionOr.
(WebCore::InputType::setValueAsDouble): Ditto.
(WebCore::InputType::setValueAsDecimal): Ditto.
(WebCore::InputType::applyStep): Ditto.
(WebCore::InputType::stepUp): Ditto.
(WebCore::InputType::stepUpFromRenderer): Removed IGNORE_EXCEPTION.
* html/InputType.h: Updated for the above.
* html/MediaController.cpp:
(MediaController::addMediaElement): Take a reference instead of a pointer.
(MediaController::removeMediaElement): Ditto.
(MediaController::containsMediaElement): Ditto.
(MediaController::setVolume): Use ExceptionOr.
(MediaController::bringElementUpToSpeed): Take a reference.
* html/MediaController.h: Updated for above changes. Also made lots of
function overrides private.
* html/MediaController.idl: Use non-legacy exception.
* html/MediaControllerInterface.h: Use ExceptionOr for setVolume.
* html/NumberInputType.cpp:
(WebCore::RealNumberRenderSize::max): Use aggregate initialization instead
of a constructor.
(WebCore::calculateRenderSize): Ditto.
(WebCore::NumberInputType::setValueAsDouble): Use ExceptionOr.
(WebCore::NumberInputType::setValueAsDecimal): Ditto.
* html/NumberInputType.h: Updated for above changes.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::RangeInputType): Initialize scalar data member
in class definition instead of here.
(WebCore::RangeInputType::setValueAsDecimal): Use ExceptionOr.
(WebCore::RangeInputType::handleKeydownEvent): Removed IGNORE_EXCEPTION.
* html/RangeInputType.h: Updated for above changes.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText): Removed
ASSERT_NO_EXCEPTION.
* html/TimeRanges.cpp:
(WebCore::TimeRanges::start): Use ExceptionOr.
(WebCore::TimeRanges::end): Ditto.
* html/TimeRanges.h: Updated for the above.
* html/TimeRanges.idl: Use non-legacy exceptions.
* html/URLUtils.idl: Use non-legacy exception.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer): Removed
ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION, and other exception-ignoring idioms.
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto.
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlVolumeSliderElement::defaultEventHandler): Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::setPosition): Ditto.
(WebCore::MediaControlPanelElement::resetPosition): Ditto.
(WebCore::MediaControlStatusDisplayElement::update): Ditto.
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Ditto.
(WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler): Ditto.
(WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler): Ditto.
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::updateCurrentTimeDisplay): Ditto.
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::updateCurrentTimeDisplay): Ditto.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::LoadableTextTrack): Take reference.
(WebCore::LoadableTextTrack::~LoadableTextTrack): Deleted.
(WebCore::LoadableTextTrack::clearClient): Deleted override. We no longer
want to clear m_trackElement when clearing the client.
(WebCore::LoadableTextTrack::setTrackElement): Deleted.
(WebCore::LoadableTextTrack::id): Changed to use
attributeWithoutSynchronization for better performance and idAttr instead
of a string constant.
* html/track/LoadableTextTrack.h: Updated for above changes. Added a new
clearElement function. Made the element and isDefault functions private.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::~VTTCue): Removed ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION,
and other exception-ignoring idioms.
(WebCore::VTTCue::removeDisplayTree): Ditto.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::displayLastTextTrackCueBox): Ditto.
(WebCore::VTTRegion::willRemoveTextTrackCueBox): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend):
Rewrote to avoid multiplehash table lookups and added a FIXME about
the peculiar code here.
(WebCore::InspectorDOMAgent::resolveNode): Streamlined.
(WebCore::InspectorDOMAgent::nodeAsScriptValue): Use the new
checkSecurityForNode instead of the old shouldAllowAccessToNode.
* platform/graphics/ImageBuffer.h: Take Optional<double> instead of
const double* in toDataURL. Renamed ImageDataToDataURL to just dataURL.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::addAudioTrack): Take a reference instead of PassRefPtr.
(WebCore::MediaPlayer::removeAudioTrack): Ditto.
(WebCore::MediaPlayer::addTextTrack): Ditto.
(WebCore::MediaPlayer::removeTextTrack): Ditto.
(WebCore::MediaPlayer::addVideoTrack): Ditto.
(WebCore::MediaPlayer::removeVideoTrack): Ditto.
* platform/graphics/MediaPlayer.h: Updated for the above.
* platform/graphics/PlatformTimeRanges.h: Exported a couple of functions
that are now used in WebKit.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::clearTextTracks): Use a modern for loop.
(WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
Fixed a bug that would cause this function to fail to process half the tracks.
Also updated for the change from PassRefPtr to references.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::determineChangedTracksFromNewTracksAndOldItems): Pass references.
(WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): Ditto.
(WebCore::assetMetadataKeyNames): Tweaked formatting.
(WebCore::itemKVOProperties): Ditto.
(WebCore::playerKVOProperties): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfType): Pass references.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::toDataURL): Use Optional<double>
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createBitmapImageAfterScalingIfNeeded): Use auto.
(WebCore::encodeImage): Ditto. Also renamed from CGImageEncodeToData.
(WebCore::dataURL): Ditto. Also renamed from CGImageToDataURL and from
ImageDataToDataURL.
(WebCore::ImageBuffer::toDataURL): Ditto.
* platform/graphics/efl/ImageBufferEfl.cpp:
(WebCore::encodeImageJPEG): Use Optional<double>
(WebCore::ImageBuffer::toDataURL): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Pass
a reference instead of pointer.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContents): Ditto.
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage): Use Optional<double>
(WebCore::ImageBuffer::toDataURL): Ditto.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow @font-face src descriptor's format function to contain identifiers
https://bugs.webkit.org/show_bug.cgi?id=164169
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceSrcURI):
2016-10-28 Jer Noble <jer.noble@apple.com>
WebAudio does not resume when moving from background to foreground tab.
https://bugs.webkit.org/show_bug.cgi?id=164043
Reviewed by Darin Adler.
Test: webaudio/page-canstartmedia.html
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::mediaCanStart):
2016-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
https://bugs.webkit.org/show_bug.cgi?id=164077
<rdar://problem/28987810>
Reviewed by Simon Fraser.
Fixes candidate insertion on iOS, so that it fires input events of type "insertReplacementText" and adds two
iOS unit tests covering this change as well as the test infrastructure needed to support these tests. See
comments below for more details.
Tests: fast/events/ios/before-input-events-prevent-candidate-insertion.html
fast/events/ios/input-events-insert-replacement-text.html
* dom/TextEvent.h:
Adds isAutocompletion() to TextEvent, as well as the TextEventInputAutocompletion text input type. When the
Editor handles this TextEvent, it will use this information when creating or modifying the corresponding typing
command.
* dom/TextEventInputType.h:
* editing/Editor.cpp:
(WebCore::Editor::insertText):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
* editing/Editor.h:
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
Now takes whether the command is autocorrection into account. If so, the corresponding edit action should be
EditActionInsertReplacement rather than EditActionTypingInsertText.
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::deleteSelection):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
* editing/TypingCommand.h:
Adds a new TypingCommand option, IsAutocompletion.
2016-10-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207700.
https://bugs.webkit.org/show_bug.cgi?id=164168
We are ready after r208086 (Requested by alexchristensen on
#webkit).
Reverted changeset:
"Unreviewed, rolling out r207582."
https://bugs.webkit.org/show_bug.cgi?id=163819
http://trac.webkit.org/changeset/207700
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Allow unknown properties in will-change
https://bugs.webkit.org/show_bug.cgi?id=164165
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWillChange):
2016-10-28 Alex Christensen <achristensen@webkit.org>
Partially revert 207805 after resolution in URL spec issue 87
https://bugs.webkit.org/show_bug.cgi?id=164142
Reviewed by Andy Estes.
Covered by updated layout tests and API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
Treat %2e%2e as .. and %2e as . but only if it is entirety of the path segment.
There are tests for URLs like http://host/abc%2edef which have not changed because
the %2e is not the entirety of the path segment.
2016-10-28 Alex Christensen <achristensen@webkit.org>
URLParser should not try to interpret host of URLs with unrecognized schemes as IPv4 address
https://bugs.webkit.org/show_bug.cgi?id=164154
Reviewed by Andy Estes.
This is needed to match behavior of all browsers.
This is being discussed in the spec at https://github.com/whatwg/url/issues/148
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
Only try to parse and canonicalize the host as an IPv4 address if the scheme is special (http, wss, etc.)
2016-10-28 Chris Dumez <cdumez@apple.com>
DOMStringMap reports properties as non-enumerable
https://bugs.webkit.org/show_bug.cgi?id=164114
Reviewed by Sam Weinig.
DOMStringMap's named properties should be configurable, enumerable
and writable as per:
- https://heycam.github.io/webidl/#getownproperty-guts (2.7-9)
- https://html.spec.whatwg.org/multipage/dom.html#domstringmap
Firefox and Chrome agree with the specification. However, WebKit
was doing the complete opposite.
No new tests, updated existing test.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
2016-10-28 Ryosuke Niwa <rniwa@webkit.org>
Add CEReactions to the remaining HTML DOM APIs
https://bugs.webkit.org/show_bug.cgi?id=163969
Reviewed by Chris Dumez.
Added CEReactions to the remaining DOM and HTML APIs as needed.
Tests: fast/custom-elements/reactions-for-indieui.html
fast/custom-elements/reactions/Document.html
fast/custom-elements/reactions/HTMLAnchorElement.html
fast/custom-elements/reactions/HTMLOptionElement.html
fast/custom-elements/reactions/HTMLOptionsCollection.html
fast/custom-elements/reactions/HTMLOutputElement.html
fast/custom-elements/reactions/HTMLSelectElement.html
fast/custom-elements/reactions/HTMLTableElement.html
fast/custom-elements/reactions/HTMLTableRowElement.html
fast/custom-elements/reactions/HTMLTableSectionElement.html
fast/custom-elements/reactions/HTMLTitleElement.html
fast/custom-elements/reactions/ShadowRoot.html
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength):
(WebCore::JSHTMLOptionsCollection::indexSetter):
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::JSHTMLSelectElement::indexSetter):
* dom/CharacterData.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/ShadowRoot.idl:
* html/HTMLAnchorElement.idl:
* html/HTMLDocument.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTitleElement.idl:
2016-10-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: volume control support
https://bugs.webkit.org/show_bug.cgi?id=163727
Reviewed by Dean Jackson.
We introduce the VolumeSupport class which brings support for modifying the media
volume by interacting with the mute volume slider in the media controls and correctly
reflecting the media's volume should it be changed via the media API.
Tests: media/modern-media-controls/volume-support/volume-support-click.html
media/modern-media-controls/volume-support/volume-support-drag.html
media/modern-media-controls/volume-support/volume-support-media-api-mute.html
media/modern-media-controls/volume-support/volume-support-media-api.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/volume-support.js: Added.
(VolumeSupport.prototype.get control):
(VolumeSupport.prototype.get mediaEvents):
(VolumeSupport.prototype.controlValueWillStartChanging):
(VolumeSupport.prototype.controlValueDidChange):
(VolumeSupport.prototype.syncControl):
(VolumeSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-28 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Rename CallDOM to CallDOMGetter
https://bugs.webkit.org/show_bug.cgi?id=164157
Reviewed by Keith Miller.
No behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* domjit/JSDocumentDOMJIT.cpp:
(WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
(WebCore::DocumentDocumentElementDOMJIT::callDOM): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMGetterForOffsetAccess):
(WebCore::NodeFirstChildDOMJIT::callDOMGetter):
(WebCore::NodeLastChildDOMJIT::callDOMGetter):
(WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
(WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
(WebCore::NodeParentNodeDOMJIT::callDOMGetter):
(WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
(WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
(WebCore::createCallDOMForOffsetAccess): Deleted.
(WebCore::NodeFirstChildDOMJIT::callDOM): Deleted.
(WebCore::NodeLastChildDOMJIT::callDOM): Deleted.
(WebCore::NodeNextSiblingDOMJIT::callDOM): Deleted.
(WebCore::NodePreviousSiblingDOMJIT::callDOM): Deleted.
(WebCore::NodeParentNodeDOMJIT::callDOM): Deleted.
(WebCore::NodeNodeTypeDOMJIT::callDOM): Deleted.
(WebCore::NodeOwnerDocumentDOMJIT::callDOM): Deleted.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font-family parsing inside @font-face
https://bugs.webkit.org/show_bug.cgi?id=164155
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
Use the full font-family parsing that returns a CSSValueList,
since we can handle multiple families.
2016-10-28 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Implement ImageBufferData::putData.
https://bugs.webkit.org/show_bug.cgi?id=164151
Reviewed by Brent Fulgham.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData):
(WebCore::ImageBufferData::putData):
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support hanging-punctuation
https://bugs.webkit.org/show_bug.cgi?id=164153
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeHangingPunctuation):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-28 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Document::documentElement
https://bugs.webkit.org/show_bug.cgi?id=164113
Reviewed by Sam Weinig.
Test: js/dom/domjit-accessor-document-element.html
This patch implements document.documentElement DOMJIT accessor.
Similar to ownerDocument accessor, the way to access to document.documentElement
from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing
functionality: using documentElementMemoryOffset().
document.documentElement is frequently called in jQuery. Especially, every time
we call jQuery.attr(), this is called.
To implement Document accessor, we clean up some code in DOMJITHelpers.
We create the cpp file for DOMJITHelpers and move some helpers to it.
And we also implement DOMJIT::checkDOM<DOMInterface> for convenience.
It returns appropriate CheckDOM patchpoint implementation.
This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54).
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
* dom/Document.idl:
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
(WebCore::DOMJIT::TypeChecker<Node>::branchIfFail):
(WebCore::DOMJIT::TypeChecker<Document>::branchIfFail):
(WebCore::DOMJIT::TypeChecker<Event>::branchIfFail):
(WebCore::DOMJIT::TypeChecker<Element>::branchIfFail):
(WebCore::DOMJIT::checkDOM):
* domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
(WebCore::DOMJIT::loadDocument):
(WebCore::DOMJIT::loadDocumentElement):
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::toWrapperSlow):
(WebCore::DOMJIT::loadDocument): Deleted.
* domjit/JSDocumentDOMJIT.cpp: Added.
(WebCore::DocumentDocumentElementDOMJIT::checkDOM):
(WebCore::DocumentDocumentElementDOMJIT::callDOM):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::callDOM):
(WebCore::toWrapperSlow): Deleted.
(WebCore::checkNode): Deleted.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support initial-letter
https://bugs.webkit.org/show_bug.cgi?id=164150
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeInitialLetter):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-28 Simon Fraser <simon.fraser@apple.com>
Remove some unused code in RenderLayerCompositor::computeExtent()
https://bugs.webkit.org/show_bug.cgi?id=163934
Reviewed by Zalan Bujtas.
viewportRect was never used.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeExtent):
2016-10-28 Sam Weinig <sam@webkit.org>
[WebIDL] Update parser and code generators to only access type information through the type property
https://bugs.webkit.org/show_bug.cgi?id=164141
Reviewed by Anders Carlsson.
Update IDLParser structs:
- domSignature: Rename idlType to type. Specify that type is a domType.
- domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
- domFunction: Specify that signature is a domSignature.
- domAttribute: Remove unused type. Specify that signature is a domSignature.
- domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
- domConstant: Specify that type is a domType.
- domEnum: Specify that type is a domType.
- domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
- Typedef: Rename idlType to type and specify that it is a domType.
* bindings/scripts/IDLParser.pm:
Remove redundant properties and specify type info in structs where possible.
* bindings/scripts/CodeGenerator.pm:
(IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
(IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
(GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
(GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
Update to always access type information through type accessors. Remove use of removed
properties.
* bindings/scripts/CodeGeneratorJS.pm:
(IsNullableType): Deleted.
(StripNullable): Deleted.
Remove unused functions.
Update to always access type information through type accessors. Remove use of removed
properties.
* bindings/scripts/generate-bindings.pl:
Update to always access type information through type accessors. Remove use of removed
properties.
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support bopomofo Ruby
https://bugs.webkit.org/show_bug.cgi?id=164148
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-canvas images
https://bugs.webkit.org/show_bug.cgi?id=164144
Reviewed by Simon Fraser.
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeWebkitCanvas):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2016-10-27 Geoffrey Garen <ggaren@apple.com>
One file per class for Executable.h/.cpp
https://bugs.webkit.org/show_bug.cgi?id=164099
Reviewed by Saam Barati.
* ForwardingHeaders/runtime/Executable.h: Removed.
* ForwardingHeaders/runtime/FunctionExecutable.h: Copied from Source/WebCore/ForwardingHeaders/runtime/Executable.h.
* bindings/js/JSLazyEventListener.cpp:
* bindings/js/JSMainThreadExecStateInstrumentation.h:
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Clean up gradient parsing
https://bugs.webkit.org/show_bug.cgi?id=164139
Reviewed by Dean Jackson.
* css/CSSGradientValue.cpp:
(WebCore::positionFromValue):
(WebCore::CSSGradientValue::computeEndPoint):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
2016-10-28 Dean Jackson <dino@apple.com>
New CSS Parser should use Colors not RGBA32s
https://bugs.webkit.org/show_bug.cgi?id=164124
<rdar://problem/29000373>
Reviewed by Darin Adler.
The old parser has moved from using RGBA32 values to using
Colors directly. This was so we could support ExtendedColors
via the new color() syntax.
Update the new CSS parser to do the same.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseRGBParameters):
(WebCore::CSSPropertyParserHelpers::parseHSLParameters):
(WebCore::CSSPropertyParserHelpers::parseHexColor):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
(WebCore::CSSPropertyParserHelpers::consumeColor):
2016-10-28 Dean Jackson <dino@apple.com>
Allow new CSS parser to handle insertRule, etc via parseRule
https://bugs.webkit.org/show_bug.cgi?id=164122
<rdar://problem/29000101>
Reviewed by Darin Adler.
Call the new CSS parser from CSSParser::parseRule if enabled. This
allows style added via the CSSOM insertRule to go through
the parser.
I tested this across our layout tests that use insertRule. It
works fine, but does cause some filter tests to fail. This is
because the new parser does not generate WebKitCSSFilterValues,
but I think the CSSFunctionValue is good enough. I'll remove
WebKitCSSFilterValue separately.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.
2016-10-28 Simon Fraser <simon.fraser@apple.com>
Wrong blur radius for filter: drop-shadow()
https://bugs.webkit.org/show_bug.cgi?id=163667
Reviewed by Darin Adler.
The "stdDev" parameter to <feDropShadow> and <feGaussianBlur> represents the standard
deviation (σ) of the Gaussian blur function. CSS filters drop-shadow() and blur() follow
this with their radius parameter.
However, CSS box-shadow and text-shadow use 2σ to describe the blur radius, since this
is conveniently close to the number of pixels the effect of the blur extends out.
feDropShadow, which is used by non-accelerated filter: drop-shadow(), was using
the wrong blur radius because it passed its stdDev directly to ShadowBlur. ShadowBlur
was written for CSS box-shadow, so expected its input "blur radius" to be twice the
stdDev.
Tests: css3/filters/drop-shadow-blur-radius.html
svg/filters/feDropShadow-blur-radius.html
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
2016-10-28 Youenn Fablet <youenn@apple.com>
Expose RTCPeerConnection unprefixed
https://bugs.webkit.org/show_bug.cgi?id=164060
Reviewed by Darin Adler.
Covered by rebased and activated tests.
* Modules/mediastream/RTCPeerConnection.idl:
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support the marquee properties
https://bugs.webkit.org/show_bug.cgi?id=164132
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitMarqueeIncrement):
(WebCore::consumeWebkitMarqueeRepetition):
(WebCore::consumeWebkitMarqueeSpeed):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
2016-10-28 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Miscellaneous bug fixes
https://bugs.webkit.org/show_bug.cgi?id=164131
Reviewed by Zalan Bujtas.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
The prefix was incorrectly dropped from -webkit-column-progression.
Put it back.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponent):
(WebCore::StyleBuilderConverter::convertObjectPosition):
Fix object-position parsing so that the position components can
be ids.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent):
The new parser doesn't make a list for content:none, since none can't be
a component of a list anyway. Add code to handle this case in the
apply function.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Put the prefix back on -webkit-column-progression.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Same.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
Make sure match type is checked, since our code asserts if it isn't.
* css/parser/CSSPropertyParser.cpp:
(WebCore::validWidthOrHeightKeyword):
(WebCore::consumeLineGrid):
(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the line-grid properties and for -webkit-nbsp-mode.
2016-10-28 Antti Koivisto <antti@apple.com>
Always use iOS preload behavior
https://bugs.webkit.org/show_bug.cgi?id=164127
Reviewed by Andreas Kling.
On non-iOS platforms we were delaying issuing lower priority preload (images mostly) until document has body.
This should be unnecessary as networking layer prioritization should ensure higher priority resources are
loaded earlier. Testing on iOS has showed that more aggressive behavior is a win.
This patch switches to iOS behavior on all platforms (and simplified the logic).
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::preload):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::performPostLoadActions):
(WebCore::CachedResourceLoader::preload):
(WebCore::CachedResourceLoader::isPreloaded):
(WebCore::CachedResourceLoader::checkForPendingPreloads): Deleted.
(WebCore::CachedResourceLoader::requestPreload): Deleted.
(WebCore::CachedResourceLoader::clearPendingPreloads): Deleted.
* loader/cache/CachedResourceLoader.h:
2016-10-28 Youenn Fablet <youenn@apple.com>
[Fetch] Ensure redirection count is no more than 20 in case of cross origin requests
https://bugs.webkit.org/show_bug.cgi?id=164117
Reviewed by Sam Weinig.
Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker.html
imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin.html
Introducing a ResourceLoaderOptions that defines the maximum redirection count.
By default, it is set to 20 as per fetch specification.
This option is used by SubresourceLoader to cancel load if its redirection count is above that maximum.
DocumentThreadableLoader stopping redirections to make preflight if needed, it now uses the maxRedirectCount loader option to ensure
that the total number of redirections is 20.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/SubresourceLoader.h:
2016-10-28 Fujii Hironori <Hironori.Fujii@sony.com>
generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
https://bugs.webkit.org/show_bug.cgi?id=164054
Reviewed by Michael Catanzaro.
generate-bindings-all.pl determines which IDL to recompile by
comparing timestamps of generated files, source IDL and its
dependencies. But this is not enough. If a new supplemental IDL
is added, its supplemented IDL needs to be recompiled even though
the timestamp of the supplemental IDL is older than the
generated files.
* bindings/scripts/generate-bindings-all.pl: Read supplemental
dependency file both before and after invoking preprocess-idls.pl.
Recompile IDL files if its supplemental dependencies are added or
removed.
2016-10-28 Youenn Fablet <youenn@apple.com>
PeerMediaDescription does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164059
Reviewed by Darin Adler.
No change of behavior.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
(WebCore::createSourceMap):
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::configurationFromJSON):
(WebCore::configurationToJSON):
(WebCore::SDPProcessor::generateCandidateLine):
(WebCore::SDPProcessor::parseCandidateLine):
* platform/mediastream/IceCandidate.h:
* platform/mediastream/MediaEndpointSessionConfiguration.h:
(WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
(WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
(WebCore::MediaEndpointSessionConfiguration::clone):
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::addPayload):
(WebCore::PeerMediaDescription::addSsrc):
(WebCore::PeerMediaDescription::clearSsrcs):
(WebCore::PeerMediaDescription::addIceCandidate):
(WebCore::PeerMediaDescription::create): Deleted.
(WebCore::PeerMediaDescription::~PeerMediaDescription): Deleted.
(WebCore::PeerMediaDescription::type): Deleted.
(WebCore::PeerMediaDescription::setType): Deleted.
(WebCore::PeerMediaDescription::port): Deleted.
(WebCore::PeerMediaDescription::setPort): Deleted.
(WebCore::PeerMediaDescription::address): Deleted.
(WebCore::PeerMediaDescription::setAddress): Deleted.
(WebCore::PeerMediaDescription::mode): Deleted.
(WebCore::PeerMediaDescription::setMode): Deleted.
(WebCore::PeerMediaDescription::mid): Deleted.
(WebCore::PeerMediaDescription::setMid): Deleted.
(WebCore::PeerMediaDescription::payloads): Deleted.
(WebCore::PeerMediaDescription::setPayloads): Deleted.
(WebCore::PeerMediaDescription::rtcpMux): Deleted.
(WebCore::PeerMediaDescription::setRtcpMux): Deleted.
(WebCore::PeerMediaDescription::rtcpAddress): Deleted.
(WebCore::PeerMediaDescription::setRtcpAddress): Deleted.
(WebCore::PeerMediaDescription::rtcpPort): Deleted.
(WebCore::PeerMediaDescription::setRtcpPort): Deleted.
(WebCore::PeerMediaDescription::mediaStreamId): Deleted.
(WebCore::PeerMediaDescription::setMediaStreamId): Deleted.
(WebCore::PeerMediaDescription::mediaStreamTrackId): Deleted.
(WebCore::PeerMediaDescription::setMediaStreamTrackId): Deleted.
(WebCore::PeerMediaDescription::dtlsSetup): Deleted.
(WebCore::PeerMediaDescription::setDtlsSetup): Deleted.
(WebCore::PeerMediaDescription::dtlsFingerprintHashFunction): Deleted.
(WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction): Deleted.
(WebCore::PeerMediaDescription::dtlsFingerprint): Deleted.
(WebCore::PeerMediaDescription::setDtlsFingerprint): Deleted.
(WebCore::PeerMediaDescription::cname): Deleted.
(WebCore::PeerMediaDescription::setCname): Deleted.
(WebCore::PeerMediaDescription::ssrcs): Deleted.
(WebCore::PeerMediaDescription::iceUfrag): Deleted.
(WebCore::PeerMediaDescription::setIceUfrag): Deleted.
(WebCore::PeerMediaDescription::icePassword): Deleted.
(WebCore::PeerMediaDescription::setIcePassword): Deleted.
(WebCore::PeerMediaDescription::iceCandidates): Deleted.
(WebCore::PeerMediaDescription::clone): Deleted.
(WebCore::PeerMediaDescription::PeerMediaDescription): Deleted.
* platform/mediastream/mac/MediaEndpointMac.cpp:
(WebCore::MediaEndpointMac::addRemoteCandidate):
(WebCore::MediaEndpointMac::OnIceCandidate):
* platform/mediastream/mac/MediaEndpointMac.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateSendConfiguration):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::updateConfigurationMids):
2016-10-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: scrubbing support
https://bugs.webkit.org/show_bug.cgi?id=163726
<rdar://problem/27989481>
Reviewed by Dean Jackson.
We introduce the ScrubberSupport class which brings support for scrubbing the media
by interacting with the scrubber in the media controls and correctly reflecting
the media's current time as set via the media API.
Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
media/modern-media-controls/scrubber-support/scrubber-support-drag.html
media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/scrubbing-support.js: Added.
(ScrubbingSupport.prototype.get control):
(ScrubbingSupport.prototype.get mediaEvents):
(ScrubbingSupport.prototype.controlValueWillStartChanging):
(ScrubbingSupport.prototype.controlValueDidChange):
(ScrubbingSupport.prototype.controlValueDidStopChanging):
(ScrubbingSupport.prototype.syncControl):
(ScrubbingSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-28 Alex Christensen <achristensen@webkit.org>
Fix Windows WebGL build after r208022
https://bugs.webkit.org/show_bug.cgi?id=164091
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::Extensions3DOpenGLES):
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::getExtensions):
2016-10-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Fetch ReadableStream should only clone the second branch
https://bugs.webkit.org/show_bug.cgi?id=164058
Reviewed by Darin Adler.
Covered by rebased tests.
* Modules/streams/ReadableStreamInternals.js:
(readableStreamTeePullFunction):
2016-10-27 Alex Christensen <achristensen@webkit.org>
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=164101
Reviewed by Darin Adler.
ShCheckVariablesWithinPackingLimits has changed signatures from taking a ShVariableInfo* and length
to taking a std::vector<sh::ShaderVariable> which requires more information about the shader variables
than we kept in GraphicsContext3D::SymbolInfo. I removed the SymbolInfo class because it was redundant
with ANGLE's sh::ShaderVariable and now unused.
Covered by existing WebGL tests.
* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWin.cmake:
* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::appendSymbol):
(WebCore::getStructInfo):
(WebCore::getSymbolInfo):
(WebCore::ANGLEWebKitBridge::compileShaderSource):
* platform/graphics/ANGLEWebKitBridge.h:
(WebCore::ANGLEShaderSymbol::isSampler): Deleted.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo): Deleted.
(WebCore::GraphicsContext3D::SymbolInfo::operator==): Deleted.
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking):
(WebCore::GraphicsContext3D::precisionsMatch):
(WebCore::GraphicsContext3D::mappedSymbolName):
(WebCore::GraphicsContext3D::originalSymbolName):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
Remove RenderStyle::isRunningAcceleratedAnimation()
https://bugs.webkit.org/show_bug.cgi?id=164109
Reviewed by David Hyatt.
RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
has to manually get the animated style.
The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
accelerated transitions seems to work fine without it, so remove it.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
(WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
2016-10-27 Myles C. Maxfield <mmaxfield@apple.com>
Teach WebGL code about new buffer targets in WebGL2
https://bugs.webkit.org/show_bug.cgi?id=163924
Reviewed by Dean Jackson.
WebGL 2 adds new buffer targets. Instead of completely reimplementing
the functions again for WebGL 2, we can simply check if we are using
a new kind of context to conditionally enable support.
Test: fast/canvas/webgl/webgl2-buffer-targets.html
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::associateBufferDataImpl):
(WebCore::WebGLBuffer::associateBufferSubDataImpl):
(WebCore::WebGLBuffer::setTarget):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::getBufferParameter):
(WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
* html/canvas/WebGLRenderingContextBase.h:
2016-10-27 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enhance grid-auto-flow parsing to allow dense first.
https://bugs.webkit.org/show_bug.cgi?id=164110
Reviewed by Simon Fraser.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridAutoFlow):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
constify the CSSValue arguments to StyleBuilderConverter functions
https://bugs.webkit.org/show_bug.cgi?id=164106
Reviewed by Zalan Bujtas.
Make almost all the CSSValue& arguments const (this makes it clear that they
are in params, not out params). Only a few that are CSSImageValues are non-const,
because they fall into a non-const code path.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLengthOrAuto):
(WebCore::StyleBuilderConverter::convertLengthSizing):
(WebCore::StyleBuilderConverter::convertLengthMaxSizing):
(WebCore::StyleBuilderConverter::convertComputedLength):
(WebCore::StyleBuilderConverter::convertLineWidth):
(WebCore::StyleBuilderConverter::convertSpacing):
(WebCore::StyleBuilderConverter::convertToRadiusLength):
(WebCore::StyleBuilderConverter::convertRadius):
(WebCore::StyleBuilderConverter::convertObjectPosition):
(WebCore::StyleBuilderConverter::convertTextDecoration):
(WebCore::StyleBuilderConverter::convertNumber):
(WebCore::StyleBuilderConverter::convertNumberOrAuto):
(WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
(WebCore::StyleBuilderConverter::convertTransform):
(WebCore::StyleBuilderConverter::convertString):
(WebCore::StyleBuilderConverter::convertStringOrAuto):
(WebCore::StyleBuilderConverter::convertStringOrNone):
(WebCore::StyleBuilderConverter::valueToEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextAlign):
(WebCore::StyleBuilderConverter::convertClipPath):
(WebCore::StyleBuilderConverter::convertResize):
(WebCore::StyleBuilderConverter::convertMarqueeRepetition):
(WebCore::StyleBuilderConverter::convertMarqueeSpeed):
(WebCore::StyleBuilderConverter::convertQuotes):
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::convertReflection):
(WebCore::StyleBuilderConverter::convertInitialLetter):
(WebCore::StyleBuilderConverter::convertTextStrokeWidth):
(WebCore::StyleBuilderConverter::convertLineBoxContain):
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
(WebCore::StyleBuilderConverter::convertScrollSnapPoints):
(WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
(WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
(WebCore::StyleBuilderConverter::createGridTrackBreadth):
(WebCore::StyleBuilderConverter::createGridTrackSize):
(WebCore::StyleBuilderConverter::createGridTrackList):
(WebCore::StyleBuilderConverter::createGridPosition):
(WebCore::StyleBuilderConverter::convertGridTrackSizeList):
(WebCore::StyleBuilderConverter::convertGridTrackSize):
(WebCore::StyleBuilderConverter::convertGridPosition):
(WebCore::StyleBuilderConverter::convertGridAutoFlow):
(WebCore::StyleBuilderConverter::convertWordSpacing):
(WebCore::StyleBuilderConverter::convertPerspective):
(WebCore::StyleBuilderConverter::convertMarqueeIncrement):
(WebCore::StyleBuilderConverter::convertFilterOperations):
(WebCore::StyleBuilderConverter::convertFontFeatureSettings):
(WebCore::StyleBuilderConverter::convertFontVariationSettings):
(WebCore::StyleBuilderConverter::convertTouchCallout):
(WebCore::StyleBuilderConverter::convertTapHighlightColor):
(WebCore::StyleBuilderConverter::convertOverflowScrolling):
(WebCore::StyleBuilderConverter::convertSVGLength):
(WebCore::StyleBuilderConverter::convertSVGLengthVector):
(WebCore::StyleBuilderConverter::convertStrokeDashArray):
(WebCore::StyleBuilderConverter::convertPaintOrder):
(WebCore::StyleBuilderConverter::convertOpacity):
(WebCore::StyleBuilderConverter::convertSVGURIReference):
(WebCore::StyleBuilderConverter::convertSVGColor):
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
(WebCore::StyleBuilderConverter::convertContentAlignmentData):
(WebCore::StyleBuilderConverter::convertGlyphOrientation):
(WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
(WebCore::StyleBuilderConverter::convertLineHeight):
(WebCore::StyleBuilderConverter::convertFontSynthesis):
(WebCore::StyleBuilderConverter::convertPageBreakBetween):
(WebCore::StyleBuilderConverter::convertPageBreakInside):
(WebCore::StyleBuilderConverter::convertColumnBreakBetween):
(WebCore::StyleBuilderConverter::convertColumnBreakInside):
(WebCore::StyleBuilderConverter::convertRegionBreakBetween):
(WebCore::StyleBuilderConverter::convertRegionBreakInside):
(WebCore::StyleBuilderConverter::convertHangingPunctuation):
2016-10-27 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for a reference box to -webkit-clip-path
https://bugs.webkit.org/show_bug.cgi?id=164107
Reviewed by Simon Fraser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShape):
(WebCore::consumeBasicShapeOrBox):
(WebCore::consumeWebkitClipPath):
2016-10-27 Yusuke Suzuki <utatane.tea@gmail.com>
[DOM] Add JSEventType
https://bugs.webkit.org/show_bug.cgi?id=164096
Reviewed by Darin Adler.
Event is inherited by many Event classes. But, Event's accessors and interfaces are
frequently called. For example, event.{type, target, srcElement} for accessors. And
event.stopPropagation() and event.preventDefault() functions.
However, since the user-visible event instance is typically the instance of the subclass,
jsDynamicCast<JSEvent*>() walks several classes before it succeeds. It is costly.
In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
function jsEventCast. That supports a super fast cast operation. And it paves the way
for implementing DOM accessors of Event in DOMJIT.
No behavior change.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSEventCustom.h: Added.
(WebCore::jsEventCast):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSTypeForNode):
(GenerateHeader):
(GetCastingHelperForThisObject):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::createStructure):
* dom/Event.idl:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchIfEvent):
(WebCore::DOMJIT::branchIfNotEvent):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
Rename StyleRareNonInheritedData::opacity to m_opacity
https://bugs.webkit.org/show_bug.cgi?id=164104
Reviewed by Dave Hyatt.
Pure rename.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::opacity):
(WebCore::RenderStyle::setOpacity):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore::StyleRareNonInheritedData::hasOpacity):
2016-10-27 Simon Fraser <simon.fraser@apple.com>
If an animation's keyframes affect stacking context properties, create stacking context while the animation is running
https://bugs.webkit.org/show_bug.cgi?id=164094
Reviewed by Dean Jackson.
The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it
clear that a keyframe animation animating properties which can affect stacking context
should establish stacking context while it's running, or filling-forwards. This is part
of the "the user agent must act as if the will-change property...includes all the properties
animated by the animation" clause.
Implement by having CompositeAnimation::animate() track whether running animations should
create stacking context, replacing existing code in AnimationController::updateAnimations()
which only looked at opacity and transform. Transitions are also checked to see if they need
to trigger stacking context.
This allows for the removal of a 0.9999 hack when blending opacity.
Tests: animations/stacking-context-fill-forwards.html
animations/stacking-context-not-fill-forwards.html
animations/stacking-context-unchanged-while-running.html
* page/animation/AnimationController.cpp:
(WebCore::AnimationController::updateAnimations):
* page/animation/CSSPropertyAnimation.cpp:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::computeStackingContextImpact):
(WebCore::KeyframeAnimation::animate):
* page/animation/KeyframeAnimation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform):
* rendering/style/WillChangeData.cpp:
(WebCore::WillChangeData::propertyCreatesStackingContext):
(WebCore::propertyCreatesStackingContext): Deleted.
* rendering/style/WillChangeData.h:
2016-10-27 Sam Weinig <sam@webkit.org>
[WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
https://bugs.webkit.org/show_bug.cgi?id=164089
Reviewed by Alex Christensen.
Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
- domInterface gains type and parentType.
- domConstant gains type.
- domEnum gains type.
- domDictionary gains type and parentType.
With these structs now containing domTypes, we can update the CodeGenerators to operate on
domTypes exclusively, rather than types as strings. This allows us to consistently have access
to information such as subtypes and nullability.
* bindings/scripts/CodeGenerator.pm:
Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
still operates on a type name, since it is called late in code generation on the textual
form of type names in the include list.
* bindings/scripts/CodeGeneratorJS.pm:
Update to use domTypes.
* bindings/scripts/IDLParser.pm:
- Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
and populate them.
- Remove type accessors from domSignature (domType is accessible from idlType).
- Remove special cases for sequence and FrozenArray, now that they are always
accessed as domTypes.
* html/HTMLEmbedElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument):
* html/HTMLFrameOwnerElement.h:
* html/HTMLIFrameElement.idl:
* html/HTMLObjectElement.idl:
Fix interfaces declaring getSVGDocument() to correctly have it return
a Document, rather than an SVGDocument, which does exist anymore. To
make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
to return a Document.
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).
2016-10-27 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
https://bugs.webkit.org/show_bug.cgi?id=164091
Reviewed by Dean Jackson.
In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL
context to a 3.2-compatible context to make sure the new symbols are
accepted. Eventually, this 3.2-compatible context will have to be
reverted and replaced with an ANGLE context. The current 3.2-compatible
context is just for testing.
Test: fast/canvas/webgl/webgl2-context-creation.html
* html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
(WebCore::WebGLBuffer::associateBufferData):
* html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
of the unique_ptr constructor.
(WebCore::WebGLRenderingContextBase::create):
* platform/graphics/GraphicsContext3D.h: GraphicsContext should know
if it is using a 3.2-compatible context because some parts of 2.1 are
removed in these contexts, and replaced with new things which aren't
in 2.1.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
OpenGL 3.2 context.
(WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
exactly what we want. In OpenGL3.2, point sprites are always enabled,
so there's no need to enable them in those contexts.
(WebCore::GraphicsContext3D::isGLES2Compliant):
* platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
is used instead. Unfortunately, glGetString() is not available in
OpenGL 2.1 contexts, so we need to use one or the other based on the
version of the context we're using.
(WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
(WebCore::Extensions3DOpenGL::getExtensions):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
Instead of modifying getExtensions() to use glGetStringi(), it makes
better sense to modify this function because getExtensions() returns
a string. Building up a string just to split it up again is silly, so
modifying this function instead makes more sense.
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
removed in OpenGL 3.2 contexts. However, it is replaced by
GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
recommended instead, but that isn't available in OpenGL 3.2.
(WebCore::GraphicsContext3D::getExtensions):
2016-10-27 Megan Gardner <megan_gardner@apple.com>
Add support for wide gamut for ShareableBitmap for image popovers
https://bugs.webkit.org/show_bug.cgi?id=164001
Reviewed by Simon Fraser.
Add a function to return a CGColorSpaceRef for extended sRGB.
This is currently untestable, so no tests added.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::extendedSRGBColorSpaceRef):
2016-10-25 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Create a RAII Helper Class for the Render Target
https://bugs.webkit.org/show_bug.cgi?id=164005
Reviewed by Alex Christensen.
Tested by existing SVG, image, and Canvas layout tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill): Use new convenience helper class.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::didBeginDraw):
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
assertion that we are in a valid state when cleaning up the graphics context.
(WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
as the Clip layer is only valid during a Draw operation.
(WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
(WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
(WebCore::GraphicsContext::beginDrawIfNeeded): Added.
(WebCore::GraphicsContext::endDraw): Added.
(WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
(WebCore::GraphicsContext::drawWithShadow): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContext::setDidBeginDraw): Deleted.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
a separate boolean.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::drawNativeImage): Ditto.
* platform/graphics/win/RenderTargetHelper.h: Added.
(WebCore::RenderTargetHelper::RenderTargetHelper):
(WebCore::RenderTargetHelper::~RenderTargetHelper):
(WebCore::RenderTargetHelper::endDraw):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.
2016-10-27 Wenson Hsieh <wenson_hsieh@apple.com>
Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163948
<rdar://problem/28921433>
Reviewed by Darin Adler.
Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
(renamed from EditActionDrag, which is no longer necessary after this patch).
When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
means that we currently fire two input events on the source and destination elements (i.e. given by the start
and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
need to fire events in this order:
1. beforeinput ("deleteByDrag") on the source
2. Update DOM
3. input ("deleteByDrag") on the source
4. beforeinput ("insertFromDrop") on the destination
5. Update DOM
6. input ("insertFromDrop") on the destination
To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
events, and also handle preventDefault() separately.
Tests: fast/events/before-input-events-prevent-drag-and-drop.html
fast/events/input-events-drag-and-drop.html
fast/events/input-events-insert-by-drop.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::composition):
Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
now perform the assertion here instead.
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::shouldDispatchInputEvents):
This is true by default, which means that if apply() is called for a composite edit command that does not
override this to return false, it will try to dispatch input events. In most cases, the parent command will call
on the child command to doApply(), bypassing this check.
(WebCore::CompositeEditCommand::composition): Deleted.
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
(WebCore::EditCommand::isEditingTextAreaOrTextInput):
(WebCore::EditCommand::setStartingSelection):
(WebCore::EditCommand::setEndingSelection):
(WebCore::EditCommand::setParent):
* editing/Editor.cpp:
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
After applying editing, only adjust the current selection and notify clients of selection change if the applied
command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
command have been applied. In particular, we should not register the applied command as an undo step.
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply):
(WebCore::MoveSelectionCommand::editingAction):
* editing/MoveSelectionCommand.h:
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
For the cases where we're not deleting text from the drag source (i.e. we're just applying a
ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.
2016-10-27 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Implement GraphicsContext::releaseWindowsContext.
https://bugs.webkit.org/show_bug.cgi?id=163988
Reviewed by Brent Fulgham.
This method is needed to draw native controls.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext):
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Worker should recover if Inspector is closed and never sent Worker.initialized command
https://bugs.webkit.org/show_bug.cgi?id=164073
Reviewed by Brian Burg.
Test: inspector/worker/worker-recover-if-inspector-close.html
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
Ensure we stop the debugger only task loop if needed when the last debugger
message comes in.
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include ConsoleAgent in Workers - real console.log support
https://bugs.webkit.org/show_bug.cgi?id=163844
<rdar://problem/28903328>
Reviewed by Brian Burg.
Test: inspector/worker/console-basic.html
This introduces a real ConsoleAgent in the Worker InspectorController.
We no longer need to pass partial ConsoleMessage objects to be logged
through the Page, we can just send the full ConsoleMessages to a
frontend once it connects to the Worker.
In order to guarantee that the Worker InspectorController is properly
all Workers will start paused if there is an Inspector attached to
the Page. The frontend _must_ call the new Worker.initialized method
after sending its setup commands to the Worker. This ensures we get
handle all initialization commands (like Agent.enable(), and
setting state like breakpoints) before any script executes in the
Worker. This mirrors the Inspector.initialized method that does the
same thing for JSContext auto-attach of the Main target.
In the backend, the wait until initialized state is just running
the WorkerThread's RunLoop in a special debugger mode to only process
debugger commands until we are ready. This will effectively be
the same as pausing so it is generalized into WorkerThread.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
New files.
* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::initialized):
(WebCore::InspectorWorkerAgent::shouldWaitForDebuggerOnStart):
* inspector/InspectorWorkerAgent.h:
Add the new initialized method. This just uses the proxy to send
a message to be handled on the Worker Thread and unpause.
* inspector/WorkerConsoleAgent.cpp:
(WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
(WebCore::WorkerConsoleAgent::addInspectedNode):
* inspector/WorkerConsoleAgent.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Add a ConsoleAgent to WorkerInspectorController.
* workers/WorkerInspectorProxy.h:
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::workerStartMode):
(WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
(WebCore::WorkerInspectorProxy::connectToWorkerInspector):
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
(WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
Use the debugger mode when sending messages to the WorkerThread.
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/WorkerReportingProxy.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
Remove legacy partial console support.
* workers/WorkerRunLoop.h:
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::debuggerMode):
* workers/WorkerThread.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::startRunningDebuggerTasks):
(WebCore::WorkerThread::stopRunningDebuggerTasks):
General code for spinning the WorkerThread and only processing debugger
(Inspector) commands. Use this when starting the thread to ensure the
frontend initializes the Worker's Agents before any JavaScript executes.
* page/PageConsoleClient.cpp:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::count):
(WebCore::WorkerConsoleClient::time):
(WebCore::WorkerConsoleClient::timeEnd):
* inspector/InspectorConsoleInstrumentation.h: Removed.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::startConsoleTimingImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStartImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::takeHeapSnapshot):
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::consoleTimeStamp):
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):
Implement a few more basic console APIs that required ConsoleAgent.
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
https://bugs.webkit.org/show_bug.cgi?id=163835
<rdar://problem/28901465>
Reviewed by Brian Burg.
Tests: inspector/unit-tests/target-manager.html
inspector/worker/runtime-basic.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
New file.
* inspector/InspectorWebAgentBase.h:
(WebCore::WorkerAgentContext::WorkerAgentContext):
New agent context creation struct for Workers.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Create a RuntimeAgent for Workers.
* inspector/WorkerRuntimeAgent.cpp: Added.
(WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
(WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
(WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):
* inspector/WorkerRuntimeAgent.h: Added.
Workers currently only ever have a single execution context.
2016-10-27 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
https://bugs.webkit.org/show_bug.cgi?id=163817
<rdar://problem/28899063>
Reviewed by Brian Burg.
Test: inspector/worker/worker-create-and-terminate.html
From the perspective of an Inspector frontend, Workers are
like a special JavaScript context, separate from the page, that
may have its own set of Agents. This patch adds the necessary
backend infrastructure to provide WorkerGlobalObject with an
InspectorController and the means to communicate with a frontend
through a Page's WorkerAgent.
Pages now get a WorkerAgent. This informs the frontend about
created and terminated Workers. It also provides a communication
channel to dispatch and return inspector protocol messages to
each of the Workers. The Page side always interacts with the
WorkerInspectorProxy on the main thread. The Page's Worker Agent
can sends and receives messages to WorkerInspectorControllers.
WorkerGlobalScopes now get a WorkerInspectorController which
will eventually contain its own set of agents. There are no
agents yet, but they will be added individually in follow-up
patches. The Worker side always interacts with the
WorkerGlobalScope on the worker thread. WorkerInspectorController
dispatches messages on its agents.
All communication with Worker agents goes through Worker.sendMessageToWorker,
which tunnels the command request to the Worker's InspectorController
and agents. At the protocol level, worker agent command responses and
worker agent events are sent as events through Worker.dispatchMessageFromWorker.
On the frontend, the message dispatcher code will pair up replies with
their commands, and no-reply messages as events, like normal. So calling
worker agent methods in the frontend will be no different from the
existing callback/promise-based ways.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Add new files.
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
(WebCore::WorkerScriptController::initScript):
* bindings/js/WorkerScriptController.h:
Some cleanup.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorWorkerAgent):
(WebCore::InstrumentingAgents::setInspectorWorkerAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::workerStartedImpl):
(WebCore::InspectorInstrumentation::workerTerminatedImpl):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::workerStarted):
(WebCore::InspectorInstrumentation::workerTerminated):
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
Give the Page a WorkerAgent and Instrumentation methods for
Worker creation and termination.
* inspector/InspectorWorkerAgent.h: Added.
* inspector/InspectorWorkerAgent.cpp: Added.
(WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
(WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
(WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorWorkerAgent::enable):
(WebCore::InspectorWorkerAgent::disable):
(WebCore::InspectorWorkerAgent::workerStarted):
(WebCore::InspectorWorkerAgent::workerTerminated):
(WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
(WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
(WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy):
Handle connecting to Workers. This performs the "connectFrontend"
and "disconnectFrontend" dance with each Worker's InspectorController.
We only connect to workers when the Worker domain is enabled.
(WebCore::InspectorWorkerAgent::sendMessageToWorker):
(WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
Proxying messages to individual messages happens through the
WorkerInspectorProxy. That takes care of passing messages
across threads for us.
* workers/WorkerInspectorProxy.cpp: Added.
(WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
(WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
(WebCore::WorkerInspectorProxy::~WorkerInspectorProxy):
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
(WebCore::WorkerInspectorProxy::connectToWorkerInspector):
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
(WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
(WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
* workers/WorkerInspectorProxy.h: Added.
(WebCore::WorkerInspectorProxy::PageChannel::~PageChannel):
(WebCore::WorkerInspectorProxy::url):
(WebCore::WorkerInspectorProxy::identifier):
(WebCore::WorkerInspectorProxy::scriptExecutionContext):
The WorkerInspectorProxy simplifies the cross thread communication
between the Page Inspector and Worker Inspector. It also provides
a clean interface between the two sides.
* inspector/WorkerToPageFrontendChannel.h: Added.
* inspector/WorkerInspectorController.h: Added.
* inspector/WorkerInspectorController.cpp: Added.
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::~WorkerInspectorController):
(WebCore::WorkerInspectorController::workerTerminating):
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):
(WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
(WebCore::WorkerInspectorController::functionCallHandler):
(WebCore::WorkerInspectorController::evaluateHandler):
(WebCore::WorkerInspectorController::vm):
A basic InspectorController for a WorkerGlobalScope.
No agents yet, they will come soon.
* inspector/WorkerScriptDebugServer.h:
* inspector/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
(WebCore::WorkerScriptDebugServer::attachDebugger):
(WebCore::WorkerScriptDebugServer::detachDebugger):
(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
(WebCore::WorkerScriptDebugServer::reportException):
(WebCore::WorkerScriptDebugServer::interruptAndRunTask):
A basic WorkerScriptDebug server for a WorkerGlobalScope.
Not really used until we implement DebuggerAgent, but needed for InspectorEnvironment.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
(WebCore::WorkerGlobalScope::inspectorController):
Give the WorkerGlobalScope an InspectorController.
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
Ensure the Worker InspectorController is immediately on
the WorkerThread when it is about to be closed.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
(WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerReportingProxy.h:
Call into the WorkerInspectorProxy for any inspector related logic,
such as creation, termination, and messages received from the Worker.
2016-10-27 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Implement CSS variables
https://bugs.webkit.org/show_bug.cgi?id=164075
Reviewed by Dean Jackson.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add CSSCustomPropertyValue.cpp to the project.
* css/CSSCustomPropertyValue.cpp: Added.
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences):
* css/CSSCustomPropertyValue.h:
These functions abstract the old and new implementations of CSS
variables so that the callers don't have to worry about it.
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
Make sure CSSVariableReferenceValue and CSSPendingSubstitutionValue
have equals implemented.
(WebCore::CSSValue::isInvalidCustomPropertyValue): Deleted.
This code was dead and never called.
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyValue):
(WebCore::CSSValue::hasVariableReferences):
Add a helper function for asking if a CSSValue has variable references.
This abstracts the old and new implementations so that callers can
ask if the value has variables without caring which implementation is
being used.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::checkVariablesForCycles):
* css/CSSValueList.h:
In order to abstract the old and new variables implementations, custom
properties now store CSSCustomPropertyValue as their values instead of
raw values. The old implementation needs to be patched to deal with this
wrapper being present now.
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::checkVariablesForCycles):
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
(WebCore::CSSVariableData::resolveVariableFallback):
(WebCore::CSSVariableData::resolveVariableReference):
(WebCore::CSSVariableData::resolveVariableReferences):
(WebCore::CSSVariableData::resolveTokenRange):
* css/CSSVariableData.h:
Implementation of cycle checking and variable resolution. The logic of
this implementation is the same as the old. It walks CSSParserTokens
instead of the old CSSParser structures.
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::customCSSText):
Add support for serialization caching, just like the old implementation
had in CSSVariableDependentValue.
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles):
* css/CSSVariableReferenceValue.h:
Add cycle checking and variable resolution helper functions.
* css/CSSVariableValue.cpp:
(WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
Patched to account for the change in storage of custom properties to
have custom property value wrappers.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::borderSpacingValue):
(WebCore::StyleProperties::getLayeredShorthandValue):
(WebCore::StyleProperties::getShorthandValue):
(WebCore::StyleProperties::getCommonValue):
(WebCore::StyleProperties::getPropertyCSSValue):
(WebCore::StyleProperties::asText):
Clean up the resolution of pending substitution values. Instead of hacking
it into every possible StyleShorthandProperty crawling function, obtain
the shorthand for the property up front, access the first longhand, and
if we see a pending substitution value, perform the substitution.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue):
* css/StyleResolver.h:
Add support for the new implementation in all the same places as the old.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseValueWithVariableReferences):
(WebCore::CSSParser::parseVariableDependentValue): Deleted.
* css/parser/CSSParser.h:
Rename parseVariableDependentValue to parseValueWithVariableReferences,
since it is operating on three distinct value types now. Turn on new
parser support for parseInlineStyleDeclaration.
* css/parser/CSSParserImpl.cpp:
(WebCore::filterProperties):
(WebCore::CSSParserImpl::parseVariableValue): Deleted.
(WebCore::CSSParserImpl::parseCustomPropertySet): Deleted.
* css/parser/CSSParserImpl.h:
Remove parser functions that aren't relevant to our implementation
of CSS variables.
* css/parser/CSSVariableParser.cpp:
(WebCore::classifyVariableRange):
Add support for the CSS4 'revert' keyword to the new variable parser.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
Modified to store CSSCustomPropertyValues as the values always now and
to use the method abstractions on CSSCustomPropertyValue to resolve
cycles and perform substitutions.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setCustomPropertyValue):
(WebCore::RenderStyle::getCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator==):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::getCustomPropertyValue):
Tighten up the map to store CSSCustomPropertyValue instead of just
CSSValue.
2016-10-27 Zalan Bujtas <zalan@apple.com>
RenderMultiColumnFlowThread::processPossibleSpannerDescendant should take RenderObject& instead of RenderObject*
https://bugs.webkit.org/show_bug.cgi?id=164072
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::findSetRendering):
(WebCore::isValidColumnSpanner):
(WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
(WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
(WebCore::RenderMultiColumnFlowThread::findSetRendering): Deleted.
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::precedesRenderer):
(WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
(WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::insertedIntoTree):
2016-10-27 Brent Fulgham <bfulgham@apple.com>
Prevent hit tests from being performed on an invalid render tree
https://bugs.webkit.org/show_bug.cgi?id=163877
<rdar://problem/28675761>
Reviewed by Simon Fraser.
Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did
so only for the main frame. It was still possible to enter cross-frame hit testing with a
subframe needing style recalc. In that situation, the subframe's updateLayout() would get
called, which could trigger a compositing change that marked the parent frame as needing style
recalc. A subsequent layout on the parent frame (for example by hit testing traversing into
a second subframe) could then mutate the parent frame's layer tree while hit testing was
traversing it.
This patch modifies the hit test logic to ensure that a recursive layout is performed so that
we always perform hit tests on a clean set of frames. It also adds some assertions to warn
us if we encounter this invalid state.
Tested by fast/layers/prevent-hit-test-during-layout.html.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing
during style recalculation.
* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree
when hit testing.
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing
when we schedule a layout.
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest): Mark RenderView as in an active hit test.
* rendering/RenderView.h:
2016-10-27 Zan Dobersek <zdobersek@igalia.com>
BufferSource should behave as an union
https://bugs.webkit.org/show_bug.cgi?id=164056
Reviewed by Chris Dumez.
WebIDL typedefs BufferSource as (ArrayBufferView or ArrayBuffer).
To follow that definition, IDLBufferSource is now type-aliased
to IDLUnion<IDLInterface<ArrayBufferView>, IDLInterface<ArrayBuffer>>.
Converter<IDLBufferSource> template specialization can now be
removed since the default specialization for IDLUnion will be
used.
C++ implementations still work through a BufferSource object.
That class now has an implicit constructor that consumes the
Variant object. The data() and length() methods on the class
now iterate the variant to find an existing object that can
provide a pointer to the data or the length of it.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
* bindings/generic/IDLTypes.h:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
(WebCore::BufferSource::data):
(WebCore::BufferSource::length):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLBufferSource>::convert): Deleted.
2016-10-27 Chris Dumez <cdumez@apple.com>
Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
https://bugs.webkit.org/show_bug.cgi?id=164063
Reviewed by Sam Weinig.
Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
that we support having IDL string enumerations in their own IDL file.
No new tests, no Web-exposed behavior change.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
* dom/CustomElementRegistry.cpp:
(WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
* dom/Element.cpp:
(WebCore::Element::bindingsOffsetParent):
(WebCore::Element::addShadowRoot):
(WebCore::Element::attachShadow):
(WebCore::Element::shadowRootForBindings):
(WebCore::Element::userAgentShadowRoot):
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Element.h:
* dom/Element.idl:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForElement):
* dom/Node.cpp:
(WebCore::Node::isUnclosedNode):
(WebCore::Node::assignedSlotForBindings):
(WebCore::Node::isInUserAgentShadowTree):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
* dom/ShadowRoot.h:
* dom/ShadowRoot.idl:
* dom/ShadowRootMode.h: Added.
* dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::didChangeSlot):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::create):
* inspector/InspectorDOMAgent.cpp:
(WebCore::shadowRootType):
* rendering/HitTestResult.cpp:
(WebCore::moveOutOfUserAgentShadowTree):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionPseudoStyle):
* rendering/RenderLayer.cpp:
(WebCore::rendererForScrollbar):
* style/StyleScope.cpp:
(WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
(WebCore::Style::Scope::didChangeStyleSheetEnvironment):
* svg/SVGElement.cpp:
(WebCore::SVGElement::correspondingUseElement):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType):
2016-10-27 Chris Dumez <cdumez@apple.com>
Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=164062
Reviewed by Darin Adler.
Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable:
- https://html.spec.whatwg.org/#canvasuserinterface
Firefox and Chrome agree with the specification.
Test: fast/canvas/draw-focus-if-needed-null-element.html
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
2016-10-27 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT][CSSJIT] Share code with DOMJIT
https://bugs.webkit.org/show_bug.cgi?id=164006
Reviewed by Mark Lam.
Move CSSJIT's getDocument function to DOMJIT and share it with DOMJIT.
And rename it to "loadDocument", it is closer name to the JSC's convention.
No behavior change.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSpecialFailureInQuirksModeForActiveAndHoverIfNeeded):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
(WebCore::SelectorCompiler::getDocument): Deleted.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::loadDocument):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::callDOM):
2016-10-27 Youenn Fablet <youenn@apple.com>
REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
https://bugs.webkit.org/show_bug.cgi?id=163905
Reviewed by Antti Koivisto.
Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
Small refactoring to do more member fields initialization in StyleSheetContents header.
Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::addedToMemoryCache):
(WebCore::StyleSheetContents::removedFromMemoryCache):
* css/StyleSheetContents.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
2016-10-27 Sergio Villar Senin <svillar@igalia.com>
Unreviewed. Build fix for gcc.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
2016-10-27 Youenn Fablet <youenn@apple.com>
MediaPayload does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=164015
Reviewed by Eric Carlson.
No change of behavior.
Making MediaPayload a struct and no-longer ref-counted.
Small performance improvements in MediaEndpointOwr.
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::configurationFromJSON):
(WebCore::configurationToJSON):
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaPayload.h:
(WebCore::MediaPayload::addParameter):
(WebCore::MediaPayload::create): Deleted.
(WebCore::MediaPayload::~MediaPayload): Deleted.
(WebCore::MediaPayload::type): Deleted.
(WebCore::MediaPayload::setType): Deleted.
(WebCore::MediaPayload::encodingName): Deleted.
(WebCore::MediaPayload::setEncodingName): Deleted.
(WebCore::MediaPayload::clockRate): Deleted.
(WebCore::MediaPayload::setClockRate): Deleted.
(WebCore::MediaPayload::channels): Deleted.
(WebCore::MediaPayload::setChannels): Deleted.
(WebCore::MediaPayload::ccmfir): Deleted.
(WebCore::MediaPayload::setCcmfir): Deleted.
(WebCore::MediaPayload::nackpli): Deleted.
(WebCore::MediaPayload::setNackpli): Deleted.
(WebCore::MediaPayload::nack): Deleted.
(WebCore::MediaPayload::setNack): Deleted.
(WebCore::MediaPayload::parameters): Deleted.
(WebCore::MediaPayload::clone): Deleted.
(WebCore::MediaPayload::MediaPayload): Deleted.
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::payloads):
(WebCore::PeerMediaDescription::addPayload):
(WebCore::PeerMediaDescription::setPayloads):
(WebCore::PeerMediaDescription::clone):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
(WebCore::MediaEndpointOwr::filterPayloads):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
(WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
(WebCore::MockMediaEndpoint::filterPayloads):
2016-10-26 Dan Bernstein <mitz@apple.com>
Improved the last build fix.
Darin pointed out I could have kept the function inline and just removed the WEBCORE_EXPORT.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::document): Deleted.
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::document):
2016-10-26 Chris Dumez <cdumez@apple.com>
[Web IDL] Add support for having string enumerations in their own IDL file
https://bugs.webkit.org/show_bug.cgi?id=164025
Reviewed by Darin Adler.
Add support for having string enumerations in their own IDL file to facilitate
sharing them. Use this new support to implement IDBTransactionMode enumeration
for IndexedDB:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBTransactionMode
No new tests, rebaselined existing tests.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::startVersionChangeTransaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
* Modules/indexeddb/IDBTransaction.h:
(WebCore::IDBTransaction::mode):
(WebCore::IDBTransaction::isVersionChange):
(WebCore::IDBTransaction::isReadOnly):
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBTransactionMode.h: Added.
* Modules/indexeddb/IDBTransactionMode.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
(WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
(WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::begin):
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
(WebCore::IDBServer::SQLiteIDBTransaction::mode):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::isVersionChange):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::isReadOnly):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::clientTransaction):
(WebCore::IDBTransactionInfo::versionChange):
(WebCore::IDBTransactionInfo::loggingString):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::mode):
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
(IsEnumType):
(GetEnumByName):
(IsExternalEnumType):
(ValidEnumValues):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumeration):
(AddToImplIncludesForIDLType):
(GetEnumerationClassName):
(GenerateEnumerationHeader):
(GenerateEnumerationImplementation):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationsImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateEnumerationsHeaderContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgCaller):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: Added.
(WebCore::convertEnumerationToJS):
(WebCore::parseEnumeration<TestStandaloneEnumeration>):
(WebCore::convertEnumeration<TestStandaloneEnumeration>):
(WebCore::expectedEnumerationValues<TestStandaloneEnumeration>):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneEnumeration.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
* inspector/InspectorIndexedDBAgent.cpp:
2016-10-26 Dan Bernstein <mitz@apple.com>
Fixed the WebKit2 build.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::document): Moved the definition of this function to here from…
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::document): …here, so that the WebKit2 build doesn’t encounter an
exported inline function.
2016-10-26 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Node::ownerDocument
https://bugs.webkit.org/show_bug.cgi?id=164004
Reviewed by Darin Adler.
Test: js/dom/domjit-accessor-owner-document.html
Implement Node.ownerDocument DOMJIT accessor.
According to the result of the profiler, jQuery's prop()
function is frequently called in Ember.js SpeedoMeter.
And this function calls jQuery.isXMLDoc(). And this isXMLDoc()
function calls element.ownerDocument accessor. And our WebKit
inspector also uses ownerDocument accessor frequently.
Interesting thing is this ownerDocument functionality is used
in CSSJIT, so CSSJIT has similar helper function to look up the
owner document of the element. As a result, all the necessary
functionality is already implemented, DOMJIT just utilizes it.
For example, Node::treeScopeMemoryOffset() and
TreeScope::documentScopeMemoryOffset() is implemented before this
patch.
In the future, we will convert CSSJIT's Assembler& to CCallHelpers&
and share the code with DOMJIT[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=164006
* dom/Node.idl:
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
(WebCore::NodeOwnerDocumentDOMJIT::callDOM):
2016-10-26 Chris Dumez <cdumez@apple.com>
Replace IDBKeyPath with a WTF::Variant
https://bugs.webkit.org/show_bug.cgi?id=163909
Reviewed by Darin Adler.
Replace IDBKeyPath class with the IDBKeyPathVariant type entirely
and rename IDBKeyPathVariant to IDBKeyPath.
Unfortunately, IDBKeyPath still needs some special handling when
returned to the JavaScript because we do not have a toJS() accepting
a WTF::Variant as input yet.
There should be no significant behavior change except that
IDBIndex.keyPath / IDBObjectStore.keyPath now returns an array of
Strings instead of a DOMStringList object when the IDBKeyPath
contains a vector. This is a progression and matches the
specification:
- https://www.w3.org/TR/IndexedDB/#widl-IDBIndex-keyPath
- https://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-keyPath
No new tests, rebaselined existing tests.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::isolatedCopy):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::isIDBKeyPathValid):
(WebCore::IDBKeyPathIsolatedCopy):
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPathIsolatedCopy):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyPath):
(WebCore::deserializeIDBKeyPath):
* Modules/indexeddb/server/IDBSerialization.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::createNewObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::IDBIndexInfo):
(WebCore::IDBIndexInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBIndexInfo.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
(WebCore::IDBObjectStoreInfo::createNewIndex):
(WebCore::IDBObjectStoreInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::keyPath):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
(WebCore::createKeyPathArray):
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:
* inspector/InspectorIndexedDBAgent.cpp:
2016-10-26 Zalan Bujtas <zalan@apple.com>
Ignore out-of-flow siblings when searching for a spanner candidate.
https://bugs.webkit.org/show_bug.cgi?id=164042.
<rdar://problem/28758456>
Reviewed by Simon Fraser.
While searching for the spanner candidates in a flow thread, we have to take into account
whether renderers are in- or out-of-flow.
What it means is that while traversing the renderer tree to find the the candidate
renderer (next sibling/ancestor's next child in pre-order traversal), we have to check if the candidate
is in the same layout context too.
Test: fast/multicol/crash-when-spanner-candidate-is-out-of-flow.html
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::spannerPlacehoderCandidate):
(WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
2016-10-26 Brian Burg <bburg@apple.com>
Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
https://bugs.webkit.org/show_bug.cgi?id=164046
Reviewed by Joseph Pecoraro.
* inspector/InspectorClient.cpp:
(WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
* inspector/InspectorClient.h:
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::sendMessageToFrontend):
2016-10-26 Chris Dumez <cdumez@apple.com>
The URLSearchParams constructor should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163906
Reviewed by Darin Adler.
The URLSearchParams constructor should take a union in parameter:
- https://url.spec.whatwg.org/#urlsearchparams
No new tests, no web-exposed behavior change.
* html/URLSearchParams.h:
(WebCore::URLSearchParams::create):
* html/URLSearchParams.idl:
2016-10-26 Sam Weinig <sam@webkit.org>
[WebIDL] Move more string conversions over to JSDOMConvert
https://bugs.webkit.org/show_bug.cgi?id=164021
Reviewed by Tim Horton.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::toDataURL):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
Switch to convert functions.
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesKeyGenParams):
(WebCore::createRsaKeyGenParams):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/JSDOMBinding.cpp:
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt8EnforceRange):
(WebCore::toUInt8EnforceRange):
(WebCore::toInt8Clamp):
(WebCore::toUInt8Clamp):
(WebCore::toInt8):
(WebCore::toUInt8):
(WebCore::toInt16EnforceRange):
(WebCore::toUInt16EnforceRange):
(WebCore::toInt16Clamp):
(WebCore::toUInt16Clamp):
(WebCore::toInt16):
(WebCore::toUInt16):
Use updated IntegerConversionConfiguration naming.
(WebCore::valueToStringTreatingNullAsEmptyString): Deleted.
(WebCore::valueToStringWithUndefinedOrNullCheck): Deleted.
(WebCore::valueToUSVStringTreatingNullAsEmptyString): Deleted.
(WebCore::valueToUSVStringWithUndefinedOrNullCheck): Deleted.
* bindings/js/JSDOMBinding.h:
Remove unused functions.
* bindings/js/JSDOMConvert.h:
(WebCore::convert):
Add StringConversionConfiguration, to match IntegerConversionConfiguration which moved here,
and make them both enum classes. Remove SFINAE based overloading of convert<>, which is not
needed if we get rid of the default parameter, which we can, since the two parameter convert
routes to the right place.
(WebCore::Converter<IDLNullable<T>>::convert):
Add overloads converts that take a Integer/String configuration.
(WebCore::Converter<IDLByte>::convert):
(WebCore::Converter<IDLOctet>::convert):
(WebCore::Converter<IDLShort>::convert):
(WebCore::Converter<IDLUnsignedShort>::convert):
(WebCore::Converter<IDLLong>::convert):
(WebCore::Converter<IDLUnsignedLong>::convert):
(WebCore::Converter<IDLLongLong>::convert):
(WebCore::Converter<IDLUnsignedLongLong>::convert):
Use updated IntegerConversionConfiguration naming.
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
Add a configuration parameter, similar to the one used for integers
that changes the behavior of string conversions to return an empty
string for null.
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorCreate):
(WebCore::IteratorTraits>::asJS):
(WebCore::appendForEachArguments):
Simplify a bit by extracting the SFINAE helpers into a EnableIfMap and EnableIfSet.
* bindings/scripts/CodeGeneratorJS.pm:
(GetIntegerConversionConfiguration):
(GetStringConversionConfiguration):
(JSValueToNativeIsHandledByDOMConvert):
(JSValueToNative):
Add support for converting more string types and passing the StringConversionConfiguration.
2016-10-26 Dan Bernstein <mitz@apple.com>
When pasting web archive, width specifiers in srcset attribute change into density specifiers
https://bugs.webkit.org/show_bug.cgi?id=164027
<rdar://problem/28964948>
Reviewed by Tim Horton.
Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
specifier.
2016-10-26 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: playback support
https://bugs.webkit.org/show_bug.cgi?id=163678
<rdar://problem/27989479>
Reviewed by Dean Jackson.
We introduce the PlaybackSupport class which brings support for playing and pausing
the media by clicking on the play/pause button in the media controls and correctly
reflecting the media's playback state as the media is played or paused via the media API.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/playback-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(PlaybackSupport.prototype.get control):
(PlaybackSupport.prototype.get mediaEvents):
(PlaybackSupport.prototype.buttonWasClicked):
(PlaybackSupport.prototype.syncControl):
(PlaybackSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-26 Chris Dumez <cdumez@apple.com>
Regression(r203848): 百度糯米 app fails to load content due to a JavaScript error
https://bugs.webkit.org/show_bug.cgi?id=163967
<rdar://problem/28707838>
Reviewed by Ryosuke Niwa.
Add quirk for 百度糯米 app making the 2 last parameters to Event.prototype.initEvent()
optional.
No new tests, change only impacts this specific application.
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/Event.cpp:
(WebCore::Event::initEventForBindings):
* dom/Event.h:
* dom/Event.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isBaiduNuomi):
2016-10-26 Chris Dumez <cdumez@apple.com>
First parameter to TextTrack.addCue() / removeCue() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=164020
Reviewed by Eric Carlson.
First parameter to TextTrack.addCue() / removeCue() should not be nullable:
- https://html.spec.whatwg.org/#texttrack
Firefox and Chrome agree with the specification.
Test: media/track/texttrack-addCue-null.html
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::removeDataCue):
(WebCore::InbandDataTextTrack::removeCue):
* html/track/InbandDataTextTrack.h:
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
(WebCore::InbandGenericTextTrack::removeCue):
* html/track/InbandGenericTextTrack.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue):
(WebCore::TextTrack::removeCue):
* html/track/TextTrack.h:
* html/track/TextTrack.idl:
2016-10-26 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: elapsed and remaining time support
https://bugs.webkit.org/show_bug.cgi?id=163679
<rdar://problem/28851675>
Reviewed by Dean Jackson.
We introduce the ElapsedTimeSupport and RemainingTimeSupport classes which bring
support for displaying the elapsed and remaining time in the time control.
Tests: media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
media/modern-media-controls/remaining-time-support/remaining-time-support.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/elapsed-time-support.js: Added.
(ElapsedTimeSupport.prototype.get control):
(ElapsedTimeSupport.prototype.get mediaEvents):
(ElapsedTimeSupport.prototype.syncControl):
(ElapsedTimeSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/remaining-time-support.js: Added.
(RemainingTimeSupport.prototype.get control):
(RemainingTimeSupport.prototype.get mediaEvents):
(RemainingTimeSupport.prototype.syncControl):
(RemainingTimeSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-26 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
https://bugs.webkit.org/show_bug.cgi?id=164019
Reviewed by Zalan Bujtas.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSCustomPropertyDeclaration.cpp: Removed.
* css/CSSCustomPropertyDeclaration.h: Removed.
Get rid of CSSCustomPropertyDeclaration.
* css/CSSCustomPropertyValue.h:
Add new constructors to handle the new variable data format (either a CSSValueId or a
CSSVariableData object that holds parser tokens).
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
Get rid of CSSCustomPropertyDeclaration cases.
* css/CSSVariableData.h:
Switch to CSSCustomPropertyValue.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
We've renamed the old parser variable data to deprecatedValue to make it clear it's going
to be removed eventually.
* css/parser/CSSParserImpl.cpp:
(WebCore::filterProperties):
(WebCore::CSSParserImpl::consumeVariableValue):
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* css/parser/CSSVariableParser.h:
Switch to CSSCustomPropertyValue.
2016-10-26 Youenn Fablet <youenn@apple.com>
Enable SDPProcessor for Mac bots
https://bugs.webkit.org/show_bug.cgi?id=163940
Reviewed by Eric Carlson.
Covered by activated tests.
Activating processing of SDPProcessor scripts for Mac bots.
Moving platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp to platform/mediastream/SDPProcessorScriptResource.cpp.
This file is not tied to openwebrtc and allows retrieving the SDPProcessor script resource file content.
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/SDPProcessorScriptResource.cpp:
(WebCore::SDPProcessorScriptResource::scriptString):
* platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Removed.
2016-10-26 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Get functional pseudos parsing
https://bugs.webkit.org/show_bug.cgi?id=164018
Reviewed by Zalan Bujtas.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
Remove the ( check so that we can parse strings that end in (.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack that adds a ( to the end of the string so that it will be found in the map.
2016-10-26 Zan Dobersek <zdobersek@igalia.com>
Unreviewed. Fixing compiler warnings in PlaybackPipeline
that are popping up in GTK+ builds.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::addSourceBuffer):
(WebCore::PlaybackPipeline::attachTrack):
2016-10-26 Youenn Fablet <youennf@gmail.com>
IceCandidate does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163944
Reviewed by Eric Carlson.
No change of behavior.
Simplifying IceCandidate class into a simple structure, no longer refcounted.
Updated call sites accordingly.
Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::createCandidateObject):
(WebCore::createCandidate):
(WebCore::iceCandidateFromJSON):
(WebCore::configurationToJSON):
(WebCore::SDPProcessor::parseCandidateLine):
* Modules/mediastream/SDPProcessor.h:
(WebCore::SDPProcessor::ParsingResult::parsingStatus):
(WebCore::SDPProcessor::ParsingResult::candidate):
* platform/mediastream/IceCandidate.h:
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::iceCandidates):
(WebCore::PeerMediaDescription::addIceCandidate):
(WebCore::PeerMediaDescription::clone):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::addRemoteCandidate):
(WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
(WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::addRemoteCandidate):
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
* platform/mock/MockMediaEndpoint.h:
2016-10-26 Andreas Kling <akling@apple.com>
Fix mach port leak in ResourceUsageThread.
<https://webkit.org/b/164012>
Reviewed by Antti Koivisto.
The threads returned by task_threads() need to be deallocated.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::cpuUsage):
2016-10-26 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
WebRTC: The RTCTrackEventInit dictionary needs required members
https://bugs.webkit.org/show_bug.cgi?id=158536
Reviewed by Chris Dumez.
Update RTCTrackEvent IDL as per specification.
No additional test required, rebase existing tests.
* Modules/mediastream/RTCTrackEvent.idl:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][GTK+][MSE] Unreviewed debug build fix.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::resetPipeline):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
https://bugs.webkit.org/show_bug.cgi?id=162928
Reviewed by Xabier Rodriguez-Calvar.
Consolidate all the source file tree changes after refactoring.
This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
* platform/GStreamer.cmake:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[MSE][GStreamer] Enable QUOTA_EXCEEDED_ERR support for GStreamer
https://bugs.webkit.org/show_bug.cgi?id=162922
Reviewed by Xabier Rodriguez-Calvar.
QUOTA_EXCEEDED_ERR should be reported by SourceBuffer when appropriate, at least on the
GStreamer implementation.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferInternal):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[MSE] Expose additional MediaSource methods to MediaSourcePrivate
https://bugs.webkit.org/show_bug.cgi?id=162920
Reviewed by Xabier Rodriguez-Calvar.
The GStreamer MSE platform implementation needs to report duration changes and trigger
monitorSourceBuffers() calls.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::durationChanged):
* Modules/mediasource/MediaSource.h:
* platform/graphics/MediaSourcePrivateClient.h:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] ClearKey decryption support
https://bugs.webkit.org/show_bug.cgi?id=162918
Reviewed by Xabier Rodriguez-Calvar.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: Added.
(webkit_media_clear_key_decrypt_class_init):
(webkit_media_clear_key_decrypt_init):
(webKitMediaClearKeyDecryptorFinalize):
(webKitMediaClearKeyDecryptorRequestDecryptionKey):
(webKitMediaClearKeyDecryptorHandleKeyResponse):
(webKitMediaClearKeyDecryptorSetupCipher):
(webKitMediaClearKeyDecryptorDecrypt):
(webKitMediaClearKeyDecryptorReleaseCipher):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] Base class for decryption support
https://bugs.webkit.org/show_bug.cgi?id=162915
Reviewed by Xabier Rodriguez-Calvar.
Add common encryption base class.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Added.
(webkit_media_common_encryption_decrypt_class_init):
(webkit_media_common_encryption_decrypt_init):
(webKitMediaCommonEncryptionDecryptorFinalize):
(webkitMediaCommonEncryptionDecryptTransformCaps):
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
(webKitMediaCommonEncryptionDecryptorChangeState):
(webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
(webKitMediaCommonEncryptionDecryptDefaultReleaseCipher):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] Utility function to create decryptor
https://bugs.webkit.org/show_bug.cgi?id=162914
Reviewed by Xabier Rodriguez-Calvar.
Add a utility function to find a suitable GStreamer decryptor element.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::createGstDecryptor):
(WebCore::gstRegistryHasElementForMediaType): Deleted.
* platform/graphics/gstreamer/GStreamerUtilities.h:
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE][EME] Remove MSE code from regular player and add EME support
https://bugs.webkit.org/show_bug.cgi?id=162911
Now that the MSE responsibility has been refactored to the dedicated
MediaPlayerPrivateGStreamerMSE subclass, the regular player no longer needs the MSE code,
just to expose some more methods to the subclass. Float timestamps have been migrated to
double. Also, small changes to accomodate the EME support are needed.
This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support) and
Žan Doberšek <zandobersek@gmail.com> (double timestamps).
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::busMessageCallback):
(WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
(WebCore::initializeGStreamerAndRegisterWebKitElements):
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::doSeek):
(WebCore::MediaPlayerPrivateGStreamer::paused):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::buffered):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
(WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::durationChanged):
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::commitLoad): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::pause): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::setRate): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::loadStateChanged): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::timeChanged): Deleted.
(WebCore::mimeTypeSet): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerPrivateGStreamer::configurePlaySink):
(WebCore::MediaPlayerPrivateGStreamer::isMediaSource):
(WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][EME] Add EME support to base private player
https://bugs.webkit.org/show_bug.cgi?id=162908
Reviewed by Xabier Rodriguez-Calvar.
Add encryption key management support.
This patch is authored by Philippe Normand <philn@igalia.com>.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::registerWebKitGStreamerElements):
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::needKey):
(WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession):
(WebCore::MediaPlayerPrivateGStreamerBase::keyAdded):
(WebCore::MediaPlayerPrivateGStreamerBase::createSession):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
(WebCore::MediaPlayerPrivateGStreamerBase::extendedSupportsType):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::pipeline):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] WebKitMediaSourceGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162902
Reviewed by Xabier Rodriguez-Calvar.
Move WebKitMediaSourceGStreamer to the mse directory, split public and private header
sections, manage stream data throttling and seek synchronization, audio/video/text stream
counting, improve GStreamer duration query, stream initialization, remove
MediaSourceClientGStreamer logic (factored out to its own class in another patch) and
interaction with MediaPlayerPrivateGStreamerMSE, PlaybackPipeline and
SourceBufferPrivateGStreamer.
* platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: Removed.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: Added.
(disabledAppsrcNeedData):
(disabledAppsrcEnoughData):
(disabledAppsrcSeekData):
(enabledAppsrcEnoughData):
(enabledAppsrcSeekData):
(getStreamByAppsrc):
(webkit_media_src_init):
(webKitMediaSrcFinalize):
(webKitMediaSrcSetProperty):
(webKitMediaSrcGetProperty):
(webKitMediaSrcDoAsyncStart):
(webKitMediaSrcDoAsyncDone):
(webKitMediaSrcChangeState):
(webKitMediaSrcGetSize):
(webKitMediaSrcQueryWithParent):
(webKitMediaSrcUpdatePresentationSize):
(webKitMediaSrcLinkStreamToSrcPad):
(webKitMediaSrcLinkParser):
(webKitMediaSrcFreeStream):
(webKitMediaSrcCheckAllTracksConfigured):
(webKitMediaSrcUriGetType):
(webKitMediaSrcGetProtocols):
(webKitMediaSrcGetUri):
(webKitMediaSrcSetUri):
(webKitMediaSrcUriHandlerInit):
(seekNeedsDataMainThread):
(notifyReadyForMoreSamplesMainThread):
(applicationMessageCallback):
(webKitMediaSrcSetMediaPlayerPrivate):
(webKitMediaSrcSetReadyForSamples):
(webKitMediaSrcPrepareSeek):
(WTF::adoptGRef):
(WTF::refGPtr<WebKitMediaSrc>):
(WTF::derefGPtr<WebKitMediaSrc>):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Playback pipeline
https://bugs.webkit.org/show_bug.cgi?id=162901
Reviewed by Xabier Rodriguez-Calvar.
Encapsulate the responsibility to interact with the GStreamer playback pipeline and the
different streams managed by the WebKitMediaSrc element into a new PlaybackPipeline class.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added.
(getStreamByTrackId):
(getStreamBySourceBufferPrivate):
(pushSample):
(WebCore::PlaybackPipeline::create):
(WebCore::PlaybackPipeline::PlaybackPipeline):
(WebCore::PlaybackPipeline::~PlaybackPipeline):
(WebCore::PlaybackPipeline::setWebKitMediaSrc):
(WebCore::PlaybackPipeline::webKitMediaSrc):
(WebCore::PlaybackPipeline::addSourceBuffer):
(WebCore::PlaybackPipeline::removeSourceBuffer):
(WebCore::PlaybackPipeline::attachTrack):
(WebCore::PlaybackPipeline::reattachTrack):
(WebCore::PlaybackPipeline::notifyDurationChanged):
(WebCore::PlaybackPipeline::markEndOfStream):
(WebCore::PlaybackPipeline::flushAndEnqueueNonDisplayingSamples):
(WebCore::PlaybackPipeline::enqueueSample):
(WebCore::PlaybackPipeline::pipeline):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE][EME] MSE specialization of Media Player Private for GStreamer
https://bugs.webkit.org/show_bug.cgi?id=162900
Reviewed by Xabier Rodriguez-Calvar.
Refactor MSE-specific logic to its own GStreamer player. This new MSE player coordinates
data appending, media playback and interaction with MediaSource by delegating to
AppendPipeline (one instance per SourceBuffer), PlaybackPipeline and
MediaSourceClientGStreamerMSE/MediaSourcePrivateClient respectively.
This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Added.
(dumpReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
(WebCore::initializeGStreamerAndRegisterWebKitMSEElement):
(WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable):
(WebCore::MediaPlayerPrivateGStreamerMSE::MediaPlayerPrivateGStreamerMSE):
(WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::pause):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationMediaTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::seek):
(WebCore::MediaPlayerPrivateGStreamerMSE::configurePlaySink):
(WebCore::MediaPlayerPrivateGStreamerMSE::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamerMSE::seeking):
(WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted):
(WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
(WebCore::MediaPlayerPrivateGStreamerMSE::setRate):
(WebCore::MediaPlayerPrivateGStreamerMSE::buffered):
(WebCore::MediaPlayerPrivateGStreamerMSE::sourceChanged):
(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
(WebCore::MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered):
(WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient):
(WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
(WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerMSE::markEndOfStream):
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Added.
(WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourcePrivateClient):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] MediaSourceGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162899
Reviewed by Žan Doberšek.
Move MediaSourceGStreamer to the mse directory, manage SourceBufferPrivates and delegate WebKitMediaSrc operations to the MSE private player.
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp.
(WebCore::MediaSourceGStreamer::open):
(WebCore::MediaSourceGStreamer::MediaSourceGStreamer):
(WebCore::MediaSourceGStreamer::~MediaSourceGStreamer):
(WebCore::MediaSourceGStreamer::addSourceBuffer):
(WebCore::MediaSourceGStreamer::removeSourceBuffer):
(WebCore::MediaSourceGStreamer::durationChanged):
(WebCore::MediaSourceGStreamer::markEndOfStream):
(WebCore::MediaSourceGStreamer::unmarkEndOfStream):
(WebCore::MediaSourceGStreamer::readyState):
(WebCore::MediaSourceGStreamer::setReadyState):
(WebCore::MediaSourceGStreamer::waitForSeekCompleted):
(WebCore::MediaSourceGStreamer::seekCompleted):
(WebCore::MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState):
(WebCore::MediaSourceGStreamer::buffered):
* platform/graphics/gstreamer/mse/MediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
https://bugs.webkit.org/show_bug.cgi?id=162898
Reviewed by Xabier Rodriguez-Calvar.
Moved SourceBufferPrivateGStreamer to an mse directory and added unimplemented features (abort, enqueueing and sample flow control).
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp: Removed.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Added.
(WebCore::SourceBufferPrivateGStreamer::create):
(WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
(WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
(WebCore::SourceBufferPrivateGStreamer::setClient):
(WebCore::SourceBufferPrivateGStreamer::append):
(WebCore::SourceBufferPrivateGStreamer::abort):
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
(WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
(WebCore::SourceBufferPrivateGStreamer::readyState):
(WebCore::SourceBufferPrivateGStreamer::setReadyState):
(WebCore::SourceBufferPrivateGStreamer::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateGStreamer::enqueueSample):
(WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setActive):
(WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] MediaSourceClientGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=162896
Reviewed by Xabier Rodriguez-Calvar.
This class encapsulates the MediaSource interaction responsibility for the
GStreamer platform.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Added.
(WebCore::MediaSourceClientGStreamerMSE::create):
(WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::~MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::duration):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::append):
(WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flushAndEnqueueNonDisplayingSamples):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
(WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Added.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] GStreamer Media Sample
https://bugs.webkit.org/show_bug.cgi?id=162894
Reviewed by Xabier Rodriguez-Calvar.
Implement the MediaSample interface for the GStreamer platform.
* platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp: Added.
(WebCore::GStreamerMediaSample::GStreamerMediaSample):
(WebCore::GStreamerMediaSample::create):
(WebCore::GStreamerMediaSample::createFakeSample):
(WebCore::GStreamerMediaSample::applyPtsOffset):
(WebCore::GStreamerMediaSample::offsetTimestampsBy):
(WebCore::GStreamerMediaSample::~GStreamerMediaSample):
* platform/graphics/gstreamer/mse/GStreamerMediaSample.h: Added.
(WebCore::GStreamerMediaSample::presentationTime):
(WebCore::GStreamerMediaSample::decodeTime):
(WebCore::GStreamerMediaSample::duration):
(WebCore::GStreamerMediaSample::trackID):
(WebCore::GStreamerMediaSample::setTrackID):
(WebCore::GStreamerMediaSample::sizeInBytes):
(WebCore::GStreamerMediaSample::sample):
(WebCore::GStreamerMediaSample::presentationSize):
(WebCore::GStreamerMediaSample::setTimestamps):
(WebCore::GStreamerMediaSample::isDivisable):
(WebCore::GStreamerMediaSample::divide):
(WebCore::GStreamerMediaSample::flags):
(WebCore::GStreamerMediaSample::platformSample):
(WebCore::GStreamerMediaSample::dump):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] GStreamer Media Description
https://bugs.webkit.org/show_bug.cgi?id=162893
Reviewed by Xabier Rodriguez-Calvar.
Implement the MediaDescription interface for the GStreamer platform.
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp: Added.
(WebCore::GStreamerMediaDescription::codec):
(WebCore::GStreamerMediaDescription::isVideo):
(WebCore::GStreamerMediaDescription::isAudio):
(WebCore::GStreamerMediaDescription::isText):
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.h: Added.
(WebCore::GStreamerMediaDescription::create):
(WebCore::GStreamerMediaDescription::~GStreamerMediaDescription):
(WebCore::GStreamerMediaDescription::GStreamerMediaDescription):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE][EME] Append Pipeline
https://bugs.webkit.org/show_bug.cgi?id=162874
Reviewed by Žan Doberšek.
This patch is co-authored with Xabier Rodriguez-Calvar <calvaris@igalia.com> (data starve
and last sample detection, debug features) and Philippe Normand <philn@igalia.com> (EME
support).
* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added.
(WebCore::dumpAppendState):
(WebCore::appendPipelineElementMessageCallback):
(WebCore::appendPipelineApplicationMessageCallback):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::clearPlayerPrivate):
(WebCore::AppendPipeline::handleElementMessage):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
(WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft):
(WebCore::AppendPipeline::id):
(WebCore::AppendPipeline::setAppendState):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::checkEndOfAppend):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::appsinkEOS):
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::trackId):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::setAppsrcDataLeavingProbe):
(WebCore::AppendPipeline::removeAppsrcDataLeavingProbe):
(WebCore::AppendPipeline::abort):
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft):
(WebCore::AppendPipeline::reportAppsrcNeedDataReceived):
(WebCore::AppendPipeline::handleNewAppsinkSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineAppsinkCapsChanged):
(WebCore::appendPipelineAppsrcDataLeaving):
(WebCore::appendPipelinePadProbeDebugInformation):
(WebCore::appendPipelineAppsrcNeedData):
(WebCore::appendPipelineDemuxerPadAdded):
(WebCore::appendPipelineDemuxerPadRemoved):
(WebCore::appendPipelineAppsinkNewSample):
(WebCore::appendPipelineAppsinkEOS):
* platform/graphics/gstreamer/mse/AppendPipeline.h: Added.
(WebCore::AppendPipeline::appendState):
(WebCore::AppendPipeline::mediaSourceClient):
(WebCore::AppendPipeline::sourceBufferPrivate):
(WebCore::AppendPipeline::bus):
(WebCore::AppendPipeline::pipeline):
(WebCore::AppendPipeline::appsrc):
(WebCore::AppendPipeline::appsink):
(WebCore::AppendPipeline::demuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkCaps):
(WebCore::AppendPipeline::track):
(WebCore::AppendPipeline::streamType):
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Drain query support
https://bugs.webkit.org/show_bug.cgi?id=162872
Reviewed by Žan Doberšek.
Under some circumstances, GStreamer deadlocks completely during MSE seeks on OpenGL ES
systems. This is because the video sink still holds samples. Proper DRAIN support
fixes this issue and is also good for all the platforms, not only OpenGL ES.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerDrain):
(WebCore::MediaPlayerPrivateGStreamerBase::drainCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::drain):
(webkitVideoSinkQuery):
(webkitVideoSinkEvent):
(webkit_video_sink_class_init):
(VideoRenderRequestScheduler::stop): Deleted.
(webkitVideoSinkProposeAllocation): Deleted.
2016-10-26 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Track enhancements for MSE support
https://bugs.webkit.org/show_bug.cgi?id=162869
Reviewed by Xabier Rodriguez-Calvar.
Add 'id' field to Audio/VideoTrackPrivateGStreamer. Make TrackPrivateBaseGStreamer
work anyway in cases where the demuxer isn't contained in a GstPlaybin.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2016-10-26 Youenn Fablet <youenn@apple.com>
Make CachedResourceLoader originsMatch check more efficient
https://bugs.webkit.org/show_bug.cgi?id=163938
Reviewed by Darin Adler.
No change of behavior.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
(WebCore::originsMatch): Moved to SecurityOrigin.cpp.
* page/SecurityOrigin.cpp:
(WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
(WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol):
(WebCore::SecurityOrigin::host):
(WebCore::SecurityOrigin::domain):
2016-10-25 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Tell IDL result type to DFG to drop type checks in AI
https://bugs.webkit.org/show_bug.cgi?id=163900
Reviewed by Sam Weinig.
Add TestDOMJIT.idl for bindings generation tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GetResultTypeFilter):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
(WebCore::JSTestDOMJITPrototype::create):
(WebCore::JSTestDOMJITPrototype::createStructure):
(WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
(WebCore::JSTestDOMJITConstructor::prototypeForStructure):
(WebCore::JSTestDOMJITConstructor::initializeProperties):
(WebCore::JSTestDOMJITPrototype::finishCreation):
(WebCore::JSTestDOMJIT::JSTestDOMJIT):
(WebCore::JSTestDOMJIT::createPrototype):
(WebCore::JSTestDOMJIT::prototype):
(WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
(WebCore::jsTestDOMJITAnyAttr):
(WebCore::jsTestDOMJITAnyAttrGetter):
(WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
(WebCore::jsTestDOMJITBooleanAttr):
(WebCore::jsTestDOMJITBooleanAttrGetter):
(WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
(WebCore::jsTestDOMJITByteAttr):
(WebCore::jsTestDOMJITByteAttrGetter):
(WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteAttr):
(WebCore::jsTestDOMJITOctetAttr):
(WebCore::jsTestDOMJITOctetAttrGetter):
(WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
(WebCore::jsTestDOMJITShortAttr):
(WebCore::jsTestDOMJITShortAttrGetter):
(WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITShortAttr):
(WebCore::jsTestDOMJITUnsignedShortAttr):
(WebCore::jsTestDOMJITUnsignedShortAttrGetter):
(WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
(WebCore::jsTestDOMJITLongAttr):
(WebCore::jsTestDOMJITLongAttrGetter):
(WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongAttr):
(WebCore::jsTestDOMJITUnsignedLongAttr):
(WebCore::jsTestDOMJITUnsignedLongAttrGetter):
(WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
(WebCore::jsTestDOMJITLongLongAttr):
(WebCore::jsTestDOMJITLongLongAttrGetter):
(WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
(WebCore::jsTestDOMJITUnsignedLongLongAttr):
(WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
(WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
(WebCore::jsTestDOMJITFloatAttr):
(WebCore::jsTestDOMJITFloatAttrGetter):
(WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
(WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
(WebCore::jsTestDOMJITDoubleAttr):
(WebCore::jsTestDOMJITDoubleAttrGetter):
(WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
(WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
(WebCore::jsTestDOMJITDomStringAttr):
(WebCore::jsTestDOMJITDomStringAttrGetter):
(WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
(WebCore::jsTestDOMJITByteStringAttr):
(WebCore::jsTestDOMJITByteStringAttrGetter):
(WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
(WebCore::jsTestDOMJITUsvStringAttr):
(WebCore::jsTestDOMJITUsvStringAttrGetter):
(WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
(WebCore::jsTestDOMJITNodeAttr):
(WebCore::jsTestDOMJITNodeAttrGetter):
(WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
(WebCore::jsTestDOMJITBooleanNullableAttr):
(WebCore::jsTestDOMJITBooleanNullableAttrGetter):
(WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
(WebCore::jsTestDOMJITByteNullableAttr):
(WebCore::jsTestDOMJITByteNullableAttrGetter):
(WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
(WebCore::jsTestDOMJITOctetNullableAttr):
(WebCore::jsTestDOMJITOctetNullableAttrGetter):
(WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
(WebCore::jsTestDOMJITShortNullableAttr):
(WebCore::jsTestDOMJITShortNullableAttrGetter):
(WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
(WebCore::jsTestDOMJITUnsignedShortNullableAttr):
(WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
(WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
(WebCore::jsTestDOMJITLongNullableAttr):
(WebCore::jsTestDOMJITLongNullableAttrGetter):
(WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
(WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
(WebCore::jsTestDOMJITLongLongNullableAttr):
(WebCore::jsTestDOMJITLongLongNullableAttrGetter):
(WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
(WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
(WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
(WebCore::jsTestDOMJITFloatNullableAttr):
(WebCore::jsTestDOMJITFloatNullableAttrGetter):
(WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
(WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
(WebCore::jsTestDOMJITDoubleNullableAttr):
(WebCore::jsTestDOMJITDoubleNullableAttrGetter):
(WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
(WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
(WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
(WebCore::jsTestDOMJITDomStringNullableAttr):
(WebCore::jsTestDOMJITDomStringNullableAttrGetter):
(WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
(WebCore::jsTestDOMJITByteStringNullableAttr):
(WebCore::jsTestDOMJITByteStringNullableAttrGetter):
(WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
(WebCore::jsTestDOMJITUsvStringNullableAttr):
(WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
(WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
(WebCore::jsTestDOMJITNodeNullableAttr):
(WebCore::jsTestDOMJITNodeNullableAttrGetter):
(WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
(WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
(WebCore::JSTestDOMJIT::getConstructor):
(WebCore::JSTestDOMJIT::visitChildren):
* bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
(WebCore::JSTestDOMJIT::create):
(WebCore::JSTestDOMJIT::createStructure):
(WebCore::JSTestDOMJIT::wrapped):
(WebCore::JSTestDOMJIT::finishCreation):
* bindings/scripts/test/TestDOMJIT.idl: Added.
2016-10-25 Brent Fulgham <bfulgham@apple.com>
[Win] Unreviewed build fix.
* platform/graphics/GraphicsContext.h: Add missing declaration.
2016-10-25 Ryosuke Niwa <rniwa@webkit.org>
Updating attribute by textContent must create a single mutation record and custom element reaction
https://bugs.webkit.org/show_bug.cgi?id=164003
Reviewed by Chris Dumez.
The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent
Test: fast/dom/MutationObserver/text-content-on-attr.html
* dom/Node.cpp:
(WebCore::Node::setTextContent):
2016-10-25 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Use smart pointers for Direct2D Path types
https://bugs.webkit.org/show_bug.cgi?id=163994
Reviewed by Alex Christensen.
Tested by existing path tests.
* platform/graphics/Path.h:
(WebCore::Path::platformPath): Use a COMPtr for m_path.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::systemFactory): Present better D2D debug output
when running a debug build.
(WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
native GDI device context.
(WebCore::GraphicsContext::platformStrokeStyle): Added.
(WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
avoid doing math on infinities.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::scratchRenderTarget): Added.
(WebCore::Path::~Path): Switch to COMPtr implementation.
(WebCore::Path::ensurePlatformPath): Ditto.
(WebCore::Path::appendGeometry): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::initializePathState): Ditto.
(WebCore::Path::strokeContains): Provide an implementation.
(WebCore::Path::transform): Ditto.
(WebCore::Path::addEllipse): No need for explicit construction of the
D2D1::Point2F object.
(WebCore::Path::clear): Switch to COMPtr implementation.
2016-10-25 Nan Wang <n_wang@apple.com>
LayoutTest accessibility/mac/meter-gauge-value-description.html failing
https://bugs.webkit.org/show_bug.cgi?id=163997
<rdar://problem/28948637>
Reviewed by Chris Fleizach.
I hand-edited the Localizable.strings file in a previous patch and my changes
were replaced by running update-webkit-localizable-strings script. Changed the
key to be the same as the value to keep consistency with other entries.
Re-enabled the failing test.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):
2016-10-25 Filip Pizlo <fpizlo@apple.com>
HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
https://bugs.webkit.org/show_bug.cgi?id=163947
Reviewed by Geoffrey Garen.
No new tests because no new behavior.
* platform/ios/WebSafeGCActivityCallbackIOS.h:
* platform/ios/WebSafeIncrementalSweeperIOS.h:
2016-10-25 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Improvements to selector parsing
https://bugs.webkit.org/show_bug.cgi?id=163964
Reviewed by Zalan Bujtas.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setNth):
* css/CSSSelector.h:
(WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parserAppendRule):
(WebCore::StyleSheetContents::ruleAt):
(WebCore::StyleSheetContents::ruleCount):
(WebCore::StyleSheetContents::clearRules):
(WebCore::StyleSheetContents::wrapperInsertRule):
(WebCore::StyleSheetContents::wrapperDeleteRule):
* css/StyleSheetContents.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSelector):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setAttribute):
(WebCore::CSSParserSelector::setArgument):
(WebCore::CSSParserSelector::setNth):
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeLangArgumentList):
(WebCore::CSSSelectorParser::consumeCompoundSelector):
(WebCore::CSSSelectorParser::consumeAttribute):
(WebCore::isPseudoClassFunction):
(WebCore::isPseudoElementFunction):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeCombinator):
2016-10-25 Beth Dakin <bdakin@apple.com>
Numbered list should be represented without ‘…’
https://bugs.webkit.org/show_bug.cgi?id=163992
-and corresponding-
rdar://problem/28911337
Reviewed by Darin Adler.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::insertListTypeNumbered):
2016-10-25 Daniel Bates <dabates@apple.com>
REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
https://bugs.webkit.org/show_bug.cgi?id=163978
<rdar://problem/25962131>
Reviewed by Darin Adler.
During the tokenization process of an HTML tag the start and end positions of each of its
attributes is tracked so that the XSS Auditor can request a snippet around a suspected
injected attribute. We need to take care to consider document.write() boundaries when
tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
receives the correct snippet. Following r178265 we no longer consider document.write()
boundaries when tracking the start and end positions of attributes. So, the substring
represented by the start and end positions of an attribute may correspond to some other
attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
snippet it requested may not be the snippet that it intended to request.
Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html
* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
start position.
(WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
longer adjust it here because it was adjusted with respect to the attribute base offset, which
takes into account document.write() boundaries.
* html/parser/HTMLToken.h:
(WebCore::HTMLToken::setAttributeBaseOffset): Added.
(WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
(WebCore::HTMLToken::endAttribute): Ditto.
* html/parser/HTMLTokenizer.h:
(WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.
2016-10-25 Chris Dumez <cdumez@apple.com>
IDBDatabase.transaction() should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163966
Reviewed by Sam Weinig.
IDBDatabase.transaction() should take a union in parameter:
- https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode
No new tests, no expected Web-exposed behavior change.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
2016-10-25 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
<rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954
Reviewed by Andy Estes.
No new tests (Covered by changes to existing tests)
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::create):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestOpenCursor):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
if the cursor is KeyAndValue.
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
object store cursor if it's both KeyAndValue.
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
* Modules/indexeddb/shared/IDBCursorInfo.h:
2016-10-25 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.dataTransfer for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163213
<rdar://problem/28700407>
Reviewed by Ryosuke Niwa.
Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
"insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
and getData("text/html"), respectively.
To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
for the requested type and returns the result, if any.
An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
plaintext strings, and then vend this information to its dispatched input events by overriding
CompositeEditCommand::inputEventDataTransfer.
Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
it, then simulate selecting the content and generating markup from the selection to create a sanitized
DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.
Tests: fast/events/input-events-paste-rich-datatransfer.html
fast/events/input-events-spell-checking-datatransfer.html
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformWin.cmake:
Add StaticPasteboard.cpp.
* WebCore.xcodeproj/project.pbxproj:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::DataTransfer):
(WebCore::DataTransfer::createForInputEvent):
Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
given HTML text.
* dom/DataTransfer.h:
* dom/InputEvent.cpp:
(WebCore::InputEvent::create):
(WebCore::InputEvent::InputEvent):
(WebCore::InputEvent::dataTransfer):
* dom/InputEvent.h:
* dom/InputEvent.idl:
Add the InputEvent.dataTransfer attribute.
* dom/Node.cpp:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::inputEventDataTransfer):
Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
this is null.
* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
(WebCore::ReplaceRangeWithTextCommand::doApply):
(WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
* editing/ReplaceRangeWithTextCommand.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::willApplyCommand):
Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
inserted in the process.
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
(WebCore::ReplaceSelectionCommand::ensureReplacementFragment):
Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
ReplacementFragment may be initialized either in willApplyCommand or in doApply.
* editing/ReplaceSelectionCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::willApplyCommand):
(WebCore::SpellingCorrectionCommand::doApply):
(WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
* editing/SpellingCorrectionCommand.h:
Using the replacement text fragment, create and return a DataTransfer for input events.
* platform/Pasteboard.h:
* platform/StaticPasteboard.cpp: Added.
(WebCore::StaticPasteboard::create):
(WebCore::StaticPasteboard::StaticPasteboard):
(WebCore::StaticPasteboard::hasData):
(WebCore::StaticPasteboard::types):
(WebCore::StaticPasteboard::readString):
* platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::writeMarkup):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeMarkup):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeMarkup):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::writeMarkup):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
unimplemented on these platforms.
2016-10-25 Andy Estes <aestes@apple.com>
Implement rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=155166
<rdar://problem/25193787>
Reviewed by Brent Fulgham.
Added support for rel=noopener to a and area elements.
Tests: fast/dom/Window/a-rel-noopener.html
fast/dom/Window/area-rel-noopener.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
(WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
two values.
(WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
(WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
(WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
FrameLoader::urlSelected() if rel=noopener was specified.
* html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
(HTMLAnchorElement is still 128 bytes on 64-bit).
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
urlSelected() that did not take a downloadAttribute parameter.
* loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
and set a default argument for downloadAttribute instead of having a second version of
urlSelected().
2016-10-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Reviewed by Jer Noble.
No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
and webaudio/web-audio-is-playing.html.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
actually producing data.
* page/MediaProducer.h: Add HasMediaCaptureDevice bit.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
(WebCore::Internals::isPagePlayingAudio): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207827 and r207828.
https://bugs.webkit.org/show_bug.cgi?id=163965
Caused LayoutTest webaudio/web-audio-is-playing.html to time
out on macOS. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207827
"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207828
2016-10-25 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: skip back support
https://bugs.webkit.org/show_bug.cgi?id=163725
<rdar://problem/27989480>
Reviewed by Dean Jackson.
We introduce the SkipBackSupport class which brings support for skipping back
30 seconds into the media by clicking on the skip back button in the media controls.
Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(SkipBackSupport.prototype.get control):
(SkipBackSupport.prototype.buttonWasClicked):
(SkipBackSupport):
* WebCore.xcodeproj/project.pbxproj:
2016-10-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207578.
https://bugs.webkit.org/show_bug.cgi?id=163962
Broke quip.com so that user can no longer type a space
(Requested by rniwa on #webkit).
Reverted changeset:
"Add a plain space instead of between text nodes"
https://bugs.webkit.org/show_bug.cgi?id=123163
http://trac.webkit.org/changeset/207578
2016-10-25 Chris Dumez <cdumez@apple.com>
LOG_WITH_STREAM() macro should not have a semi colon at the end
https://bugs.webkit.org/show_bug.cgi?id=163951
Reviewed by Simon Fraser.
* platform/LogMacros.h:
2016-10-25 Chris Dumez <cdumez@apple.com>
IDBObjectStore.createIndex() should take a union in parameter
https://bugs.webkit.org/show_bug.cgi?id=163935
Reviewed by Darin Adler.
IDBObjectStore.createIndex() should take a union in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
No new tests, no expected Web-exposed behavior change.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::isIDBKeyPathValid):
(WebCore::IDBKeyPath::isValid): Deleted.
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPath::isNull):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
2016-10-24 Sam Weinig <sam@webkit.org>
[WebIDL] Move more types over to the new JSConverter based toJS functions
https://bugs.webkit.org/show_bug.cgi?id=163920
Reviewed by Darin Adler.
- Adds WebIDL-extension type IDLDate, and use it for Date conversions.
- Move JSDOMIterator over to using IDLType based conversions. Make them more
explicit by adding a traits template argument which describes the iterator.
- Add correct parsing for WebIDL iterable, parsing the parameter types into
domTypes.
- Support non-Optional nullable types via trait-like functions on IDLTypes.
* bindings/generic/IDLTypes.h:
(WebCore::IDLType::isNullValue):
(WebCore::IDLType::extractValueFromNullable):
(WebCore::IDLString::isNullValue):
(WebCore::IDLString::extractValueFromNullable):
(WebCore::IDLInterface::isNullValue):
(WebCore::IDLInterface::extractValueFromNullable):
(WebCore::IDLDate::isNullValue):
(WebCore::IDLDate::extractValueFromNullable):
Add isNullValue and extractValueFromNullable functions to allow non-Optional
based nullable types.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::stylePropertyGetter):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
Switch to IDLType based toJS.
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringOrNull): Deleted.
(WebCore::jsDateOrNull): Deleted.
* bindings/js/JSDOMBinding.h:
(WebCore::jsPair): Deleted.
(WebCore::toJSNullableString): Deleted.
Remove now unusued toJS functions.
* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLNullable<T>>::convert):
Use new functions to detect and extract nullable values.
(WebCore::Converter<IDLBufferSource>::convert):
Moved to be with the other converters.
(WebCore::Converter<IDLDate>::convert):
(WebCore::JSConverter<IDLDate>::convert):
Added.
* bindings/js/JSDOMIterator.h:
(WebCore::jsPair):
(WebCore::iteratorCreate):
(WebCore::IteratorTraits>::asJS):
(WebCore::appendForEachArguments):
(WebCore::iteratorForEach):
(WebCore::IteratorTraits>::destroy):
(WebCore::IteratorTraits>::next):
(WebCore::IteratorTraits>::finishCreation):
(WebCore::IteratorInspector::decltype): Deleted.
(WebCore::IteratorInspector::test): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
(WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
(WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
(WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
Switch to new Traits based model, and have the generated code pass in
the type (map or set) and key/value types. With the explicit types known,
we can use the new toJS functions.
Also, moved the jsPair functions here from JSDOMBinding.h, since this was
the only place it was used.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationIterableFunctions):
Add iterator trait definition and update for new parameters to JSDOMIterator
and JSDOMIteratorPrototype.
(GetBaseIDLType):
Add IDLDate, and move IDLBufferSource up to the simple path.
(JSValueToNativeIsHandledByDOMConvert):
Allow Date.
(JSValueToNative):
Remove special case for Date.
(NativeToJSValueIsHandledByDOMConvert):
Allow Date and remove restriction of nullable string-like types.
(NativeToJSValueDOMConvertNeedsState):
Add Date to list of types needing state.
(NativeToJSValue):
Remove special cases for Date and nullable-strings.
* bindings/scripts/IDLParser.pm:
(parseOptionalIterableInterface):
Add correct parsing of iterable.
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update test results.
2016-10-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Reviewed by Jer Noble.
No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
actually producing data.
* page/MediaProducer.h: Add HasMediaCaptureDevice bit.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
(WebCore::Internals::isPagePlayingAudio): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-25 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support new IDBTransaction interfaces.
<rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927
Reviewed by Sam Weinig.
Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
storage/indexeddb/modern/idbtransaction-objectstores-1.html
At least partially passing results on 5 previously failed W3C tests.
The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStoreNames):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
2016-10-25 Youenn Fablet <youenn@apple.com>
MediaEndpointConfiguration does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163888
Reviewed by Eric Carlson.
No change of behavior.
Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
This allows ensuring that the configuration is not null and removes the need to ref-count it.
Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
Updated MediaEndpointOwr and mock implementations accordingly.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setConfiguration):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
(WebCore::MediaEndpointConfiguration::iceServers):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::setConfiguration):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
* platform/mock/MockMediaEndpoint.h:
2016-10-25 Youenn Fablet <youenn@apple.com>
CachedResourceLoader should set headers of the HTTP request prior checking for the cache
https://bugs.webkit.org/show_bug.cgi?id=163103
Reviewed by Darin Adler.
No expected change of behavior.
Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
This allows simplifying vary header checks and is more inline with the fetch specification.
To compute the referrer value, we need to know whether the request is cross-origin.
A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.
We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
This could be done as a follow-up patch.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::load):
(WebCore::CachedResource::varyHeaderValuesMatch):
(WebCore::addAdditionalRequestHeadersToRequest): Deleted.
(WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateForAccessControl):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
(WebCore::isRequestCrossOrigin):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setOrigin):
2016-10-25 Andreas Kling <akling@apple.com>
More PassRefPtr purging in WebCore.
<https://webkit.org/b/163895>
Reviewed by Antti Koivisto.
Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::contentToCSSValue):
(WebCore::shapePropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertQuotes):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::usesMenuList):
(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* html/InputType.cpp:
(WebCore::InputType::themeSupportsDataListUI):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldHaveSpinButton):
(WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
* page/FrameView.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
(WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
(WebCore::PropertyWrapperShape::PropertyWrapperShape):
(WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
* platform/PopupMenuClient.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::createScrollbar):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::createNativeScrollbar):
* platform/Scrollbar.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/FilterEffectRenderer.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::createLocalTransformState):
(WebCore::RenderLayer::hitTestLayerByApplyingTransform):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.cpp:
(RenderMenuList::createScrollbar):
* rendering/RenderMenuList.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::createCustomScrollbar):
* rendering/RenderScrollbar.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::createScrollbar):
* rendering/RenderSearchField.h:
* rendering/RenderTheme.h:
(WebCore::RenderTheme::defaultTheme):
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::create):
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeEfl.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeMac.mm:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderTheme::themeForPage):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidget):
* rendering/RenderWidget.h:
* rendering/style/CursorData.h:
(WebCore::CursorData::CursorData):
(WebCore::CursorData::setImage):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::setImage):
* rendering/style/QuotesData.cpp:
(WebCore::QuotesData::create):
* rendering/style/QuotesData.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCursor):
(WebCore::RenderStyle::setCursorList):
(WebCore::RenderStyle::setQuotes):
(WebCore::RenderStyle::setWillChange):
(WebCore::RenderStyle::setContent):
(WebCore::RenderStyle::setListStyleImage):
(WebCore::RenderStyle::setBorderImageSource):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setMaskImage):
(WebCore::RenderStyle::setMaskBoxImageSource):
(WebCore::RenderStyle::setBoxReflect):
(WebCore::RenderStyle::setShapeOutside):
(WebCore::RenderStyle::setClipPath):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::cssValue):
* rendering/style/StyleGeneratedImage.h:
* rendering/style/StyleImage.h:
* rendering/style/StyleMultiColData.h:
* rendering/style/StyleRareInheritedData.h:
2016-10-24 Ryosuke Niwa <rniwa@webkit.org>
Custom elements reactions should have a queue per element
https://bugs.webkit.org/show_bug.cgi?id=163878
Reviewed by Antti Koivisto.
This patch splits the custom elements reaction queue into per element to match the latest HTML specifications:
https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reaction-queue
and introduces the backup element queue:
https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue
In terms of code changes, CustomElementReactionStack now holds onto ElementQueue, an ordered list of elements,
and make each ElementRareData keep its own CustomElementReactionQueue. CustomElementReactionQueue is created
for each custom element when it is synchronously constructed or enqueued to upgrade.
Because each reaction queue is now specific to each element, CustomElementReactionQueue instead of
CustomElementReactionQueueItem stores JSCustomElementInterface.
The backup element queue is created as a singleton returned by CustomElementReactionStack's backupElementQueue,
and ensureBackupQueue() schedules a new mirotask to process the backup queue when there isn't already one.
ensureCurrentQueue() now returns a reference to CustomElementReactionQueue instead of a pointer since it can
fallback to the backup queue when the stack is empty as specified:
https://html.spec.whatwg.org/multipage/scripting.html#enqueue-an-element-on-the-appropriate-element-queue
Note that ensureCurrentQueue() may insert the same element multiple times into the element queue for now since
avoiding this duplication would require either doing O(n) iteration on m_elements or adding a HashSet.
We can revisit this in the future if the reaction queue is found to grow beyond a few entries since elements in
the element queue will have duplicates only when each reaction queue has more than one item.
Tests: fast/custom-elements/backup-element-queue.html
fast/custom-elements/custom-element-reaction-queue.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
(WebCore::CustomElementReactionQueueItem::invoke): Removed the check for isFailedCustomElement since the queue
is explicitly cleared in Element::setIsFailedCustomElement.
(WebCore::CustomElementReactionQueue::CustomElementReactionQueue): Now takes JSCustomElementInterface since
each item in the queue no longer stores Element or JSCustomElementInterface.
(WebCore::CustomElementReactionQueue::clear):
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
(WebCore::CustomElementReactionQueue::invokeAll):
(WebCore::CustomElementReactionStack::ElementQueue::add): Added.
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Added.
(WebCore::CustomElementReactionStack::ensureCurrentQueue):
(WebCore::BackupElementQueueMicrotask): Added.
(WebCore::CustomElementReactionStack::ensureBackupQueue): Added.
(WebCore::CustomElementReactionStack::processBackupQueue): Added.
(WebCore::CustomElementReactionStack::backupElementQueue): Added.
* dom/CustomElementReactionQueue.h:
* dom/CustomElementRegistry.cpp:
(WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
* dom/Document.cpp:
(WebCore::createFallbackHTMLElement):
* dom/Element.cpp:
(WebCore::Element::setIsDefinedCustomElement): Create a new reaction queue if there isn't already one; when
this element had been upgraded, the reaction queue have already been created in Element::enqueueToUpgrade.
(WebCore::Element::setIsFailedCustomElement): Clear the reaction queue when the upgrading had failed.
(WebCore::Element::enqueueToUpgrade): Added.
(WebCore::Element::reactionQueue): Added.
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::ElementRareData::customElementReactionQueue): Replaced customElementInterface.
(WebCore::ElementRareData::setCustomElementReactionQueue): Replaced setCustomElementReactionQueue.
2016-10-24 Jiewen Tan <jiewen_tan@apple.com>
Update SubtleCrypto::generateKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=163718
<rdar://problem/28864380>
Reviewed by Chris Dumez.
This patch does following few things:
1. It updates the SubtleCrypto::generateKey method to match the latest spec:
https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey.
It also refers to the latest Editor's Draft at a certain degree:
https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-generateKey.
2. It implements generateKey operations of following algorithms: AES-CBC, AES-KW,
HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It replaces SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS with
SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS_DEPRECATED for deprecated params.
4. It fixes https://bugs.webkit.org/show_bug.cgi?id=129750 as well.
Tests: crypto/subtle/aes-cbc-generate-key-length-128.html
crypto/subtle/aes-cbc-generate-key-length-192.html
crypto/subtle/aes-cbc-generate-key-length-256.html
crypto/subtle/aes-generate-key-malformed-parameters.html
crypto/subtle/aes-kw-generate-key.html
crypto/subtle/generate-key-malformed-paramters.html
crypto/subtle/hmac-generate-key-customized-length.html
crypto/subtle/hmac-generate-key-hash-object.html
crypto/subtle/hmac-generate-key-malformed-parameters.html
crypto/subtle/hmac-generate-key-sha1.html
crypto/subtle/hmac-generate-key-sha224.html
crypto/subtle/hmac-generate-key-sha256.html
crypto/subtle/hmac-generate-key-sha384.html
crypto/subtle/hmac-generate-key-sha512.html
crypto/subtle/rsa-generate-key-malformed-parameters.html
crypto/subtle/rsa-oaep-generate-key.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html
crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html
crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
crypto/webkitSubtle/hmac-generate-key.html:
crypto/workers/subtle/aes-generate-key.html
crypto/workers/subtle/hmac-generate-key.html
crypto/workers/subtle/rsa-generate-key.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp: Added.
(WebCore::toHashIdentifier):
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::createAlgorithm):
(WebCore::rejectWithException):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::JSSubtleCrypto::generateKey):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::JSWebKitSubtleCrypto::generateKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::generateKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h: Added.
(WebCore::CryptoAlgorithmParameters::CryptoAlgorithmParameters):
(WebCore::CryptoAlgorithmParameters::~CryptoAlgorithmParameters):
(WebCore::CryptoAlgorithmParameters::parametersClass):
* crypto/CryptoAlgorithmParameters.idl: Added.
* crypto/CryptoAlgorithmParametersDeprecated.h:
* crypto/CryptoKey.cpp:
(WebCore::CryptoKey::setUsagesBitmap):
* crypto/CryptoKey.h:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::generate):
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::generate):
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesKeyGenParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: Added.
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
(WebCore::CryptoAlgorithmRsaKeyGenParams::arrayToVector):
* crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h:
* crypto/parameters/HmacKeyGenParams.idl: Added.
* crypto/parameters/RsaHashedKeyGenParams.idl: Added.
* crypto/parameters/RsaKeyGenParams.idl: Added.
2016-10-24 Chris Dumez <cdumez@apple.com>
IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
https://bugs.webkit.org/show_bug.cgi?id=163916
Reviewed by Darin Adler.
IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
Align our IDL with the specification.
No new tests, no expected Web-exposed behavior change.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::IDBKeyPath):
* Modules/indexeddb/IDBKeyPath.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBDatabaseCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(GenerateConstructorDefinition):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
* dom/MessageEvent.h:
* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):
2016-10-24 Alex Christensen <achristensen@webkit.org>
URLParser should match old URL::parse with %2E in path
https://bugs.webkit.org/show_bug.cgi?id=163929
Reviewed by Alexey Proskuryakov.
Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::isPercentEncodedDot): Deleted.
2016-10-24 Zalan Bujtas <zalan@apple.com>
Do not update selection rect on dirty lineboxes.
https://bugs.webkit.org/show_bug.cgi?id=163862
<rdar://problem/28813156>
Reviewed by Simon Fraser.
In certain cases RenderBlock::updateFirstLetter() triggers
unwanted render tree mutation while the caller assumes intact renderers.
This patch ensures that no renderers gets destroyed while computing the preferred widths
when we are outside of layout context.
Test: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter):
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter):
* rendering/RenderTable.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter):
* rendering/svg/RenderSVGText.h:
2016-10-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207795.
Introduced API test failures on iOS and macOS.
Reverted changeset:
"URLParser should match old URL::parse with %2E in path"
https://bugs.webkit.org/show_bug.cgi?id=163929
http://trac.webkit.org/changeset/207795
2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix Windows build after r207787
https://bugs.webkit.org/show_bug.cgi?id=163657
Make the constructor public in DOMJIT::AbstractHeapRepository to make Windows bot green.
It's a bit unfortunate that we need to introduce a workaround here.
* domjit/DOMJITAbstractHeapRepository.h:
2016-10-24 Chris Dumez <cdumez@apple.com>
event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
https://bugs.webkit.org/show_bug.cgi?id=19893
<rdar://problem/6055546>
Reviewed by Ryosuke Niwa.
We now write selection as HTML as well to the pasteboard so that
event.(dataTransfer|clipboardData).getData('text/html') now works.
I have verified manually that it is still possible to copy text from
Safari and paste it to Excel 2011 Mac after this change. The text is
now pasted as HTML instead of text, which is fine because Excel can
display HTML.
No new tests, unskipped existing tests.
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::selectionInHTMLFormat):
(WebCore::Editor::writeSelectionToPasteboard):
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):
2016-10-24 Alex Christensen <achristensen@webkit.org>
URLParser should match old URL::parse with %2E in path
https://bugs.webkit.org/show_bug.cgi?id=163929
Reviewed by Alexey Proskuryakov.
Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
* platform/URLParser.cpp:
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::isPercentEncodedDot): Deleted.
2016-10-24 Per Arne Vollan <pvollan@apple.com>
[Win] CMake build type is not set.
https://bugs.webkit.org/show_bug.cgi?id=163917
Reviewed by Alex Christensen.
The CMAKE_BUILD_TYPE variable should be set to Debug or Release.
* WebCore.vcxproj/WebCore.proj:
2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix Windows build after r207787
https://bugs.webkit.org/show_bug.cgi?id=163657
According to the similar code in WebKit, I guess that
Visual C++ requires friend class declaration is done
in the private section to access private members.
And I also changed ::instance to ::shared to align to
the existing WebCore code.
* domjit/DOMJITAbstractHeapRepository.cpp:
(WebCore::DOMJIT::AbstractHeapRepository::shared):
(WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
* domjit/DOMJITAbstractHeapRepository.h:
* domjit/JSNodeDOMJIT.cpp:
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
2016-10-24 Simon Fraser <simon.fraser@apple.com>
Fix the lifetime of strings used in LOG_WITH_STREAM
https://bugs.webkit.org/show_bug.cgi?id=163923
Reviewed by Brent Fulgham.
Make sure the const char* passed to WTFLog() outlives the call.
Removed logFunctionResult which wasn't used anywhere else, and encourages this bad
pattern.
* platform/LogMacros.h:
* platform/Logging.cpp:
(WebCore::logFunctionResult): Deleted.
2016-10-24 Chris Dumez <cdumez@apple.com>
Reduce special handling for typed arrays in JSDOMConvert.h
https://bugs.webkit.org/show_bug.cgi?id=163907
Reviewed by Sam Weinig.
Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static
function on JSGenericTypedArrayView, similarly to other wrapper types.
No new tests, no web-exposed behavior change.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted.
2016-10-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207783.
This change appears to have caused fast/selectors/invalid-
functional-pseudo-class.html to crash on iOS and macOS
Reverted changeset:
"[CSS Parser] Fix :lang argument parsing"
https://bugs.webkit.org/show_bug.cgi?id=163913
http://trac.webkit.org/changeset/207783
2016-10-24 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support new IDBKeyRange interfaces.
<rdar://problem/28806929> and https://bugs.webkit.org/show_bug.cgi?id=163910
Reviewed by Andy Estes.
No new tests (Covered by additions to existing test)
The "new IDBKeyRanges interfaces" really just means adding the instance method IDBKeyRange.contains.
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::contains):
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:
2016-10-23 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
https://bugs.webkit.org/show_bug.cgi?id=163657
Reviewed by Saam Barati.
CallDOMPatchpoint now has the way to tell its effects to DFG and FTL compilers.
WebCore DOMJIT::AbstractHeapRepository will construct the hierarchy of the abstract
heap. And then it encodes these information into the pairs of the integers.
And this patch also changes the DOMJIT::PatchpointParams' parameter order.
So we change them in all the DOMJIT::CallDOMPatchpoint sites.
* CMakeLists.txt:
* ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* ForwardingHeaders/domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* ForwardingHeaders/domjit/DOMJITHeapRange.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* WebCore.xcodeproj/project.pbxproj:
* domjit/DOMJITAbstractHeapRepository.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
(WebCore::DOMJIT::AbstractHeapRepository::AbstractHeapRepository):
(WebCore::DOMJIT::AbstractHeapRepository::instance):
* domjit/DOMJITAbstractHeapRepository.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): Deleted.
(WebCore::DOMJITHelpers::branchIfNotWeakIsLive): Deleted.
(WebCore::DOMJITHelpers::tryLookUpWrapperCache): Deleted.
(WebCore::DOMJITHelpers::toWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfDOMWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNotDOMWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNode): Deleted.
(WebCore::DOMJITHelpers::branchIfNotNode): Deleted.
(WebCore::DOMJITHelpers::branchIfElement): Deleted.
(WebCore::DOMJITHelpers::branchIfNotElement): Deleted.
(WebCore::DOMJITHelpers::branchIfDocumentWrapper): Deleted.
(WebCore::DOMJITHelpers::branchIfNotDocumentWrapper): Deleted.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::callDOM):
2016-10-24 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix :lang argument parsing
https://bugs.webkit.org/show_bug.cgi?id=163913
Reviewed by Zalan Bujtas.
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
Modify the map to support versions of the function pseudos
without the left paren included.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setLangArgumentList):
* css/parser/CSSParserValues.h:
Add a helper to just directly pass an AtomicString Vector through.
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeLangArgumentList):
(WebCore::CSSSelectorParser::consumePseudo):
Add a new consumeLangArgumentList to collect the languages into
an AtomicString Vector.
2016-10-24 Alex Christensen <achristensen@webkit.org>
Fix AppleWin build after r207720.
* html/canvas/OESVertexArrayObject.cpp:
2016-10-24 Alex Christensen <achristensen@webkit.org>
Fix AppleWin build after r207720.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2016-10-24 Alex Christensen <achristensen@webkit.org>
Fix Windows build after r207767 and r207769
* css/CSSAllInOne.cpp:
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::getProtectionSpace):
2016-10-24 Per Arne Vollan <pvollan@apple.com>
[Win] AVCF based media engine does not block cross-site/cross-domain loads.
https://bugs.webkit.org/show_bug.cgi?id=163783
Reviewed by Brent Fulgham.
Prevent cross-site/cross-domain loads by setting appropriate AVCF options.
No new tests; covered by media/video-canvas-source.html. Media tests are
currently skipped on Windows.
* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL):
(WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
(WebCore::AVFWrapper::createAssetForURL):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2016-10-24 Anders Carlsson <andersca@apple.com>
Fix build with newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=163908
rdar://problem/28852016
Reviewed by Tim Horton.
Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):
2016-10-24 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary unused variable stubs
https://bugs.webkit.org/show_bug.cgi?id=163688
Reviewed by Simon Fraser.
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::toDictionary):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::toDictionary):
2016-10-24 Alex Christensen <achristensen@webkit.org>
Try to fix Windows build after r207767
https://bugs.webkit.org/show_bug.cgi?id=163891
* DerivedSources.cpp:
2016-10-24 Zan Dobersek <zdobersek@igalia.com>
[CodeGenerator] Only allow a single interface or standalone dictionary per WebIDL file
https://bugs.webkit.org/show_bug.cgi?id=163889
Reviewed by Chris Dumez.
Assert that there's only one interface or standalone dictionary
per WebIDL input file, and exit from the generator otherwise.
This avoids potential linking issues where multiple enumeration
and dictionary bindings code can be generated if the source
WebIDL for them is specified in a file that contains multiple
interfaces or standalone dictionaries.
Additionally, the generator now also exits if it fails to
generate code for any interface of standalone dictionary. This
should avoid processing WebIDL files that are empty in
substance.
TestException.idl and TestInterface.idl files have their second
interfaces removed. In place of those a new testing IDL file is
added, TestInterfaceLeadingUnderscore.idl. Like the two removed
interfaces, it tests that the leading underscode in the
identifier is removed by the generator.
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: Added.
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::create):
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure):
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
(WebCore::JSTestInterfaceLeadingUnderscoreConstructor::prototypeForStructure):
(WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
(WebCore::JSTestInterfaceLeadingUnderscore::JSTestInterfaceLeadingUnderscore):
(WebCore::JSTestInterfaceLeadingUnderscore::createPrototype):
(WebCore::JSTestInterfaceLeadingUnderscore::prototype):
(WebCore::JSTestInterfaceLeadingUnderscore::destroy):
(WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
(WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
(WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::getConstructor):
(WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestInterfaceLeadingUnderscoreOwner::finalize):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: Renamed from Source/WebCore/bindings/scripts/test/JS/JSreadonly.h.
(WebCore::JSTestInterfaceLeadingUnderscore::create):
(WebCore::JSTestInterfaceLeadingUnderscore::createStructure):
(WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
(WebCore::wrapperOwner):
(WebCore::wrapperKey):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSattribute.cpp: Removed.
* bindings/scripts/test/JS/JSattribute.h: Removed.
* bindings/scripts/test/JS/JSreadonly.cpp: Removed.
* bindings/scripts/test/TestException.idl:
* bindings/scripts/test/TestInterface.idl:
* bindings/scripts/test/TestInterfaceLeadingUnderscore.idl: Copied from Source/WebCore/bindings/scripts/test/TestException.idl.
2016-10-21 Alex Christensen <achristensen@webkit.org>
URL::port should return Optional<uint16_t>
https://bugs.webkit.org/show_bug.cgi?id=163806
Reviewed by Darin Adler.
A URL without a port is different than a URL with port 0.
This matches the spec, Chrome, and Firefox.
Covered by newly-passing web platform tests.
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
(WebCore::IDBDatabaseIdentifier::hash):
(WebCore::IDBDatabaseIdentifier::isValid):
(WebCore::IDBDatabaseIdentifier::isEmpty):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::hostName):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
(WebCore::ContentExtensions::applyBlockedStatusToRequest):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
* html/URLUtils.h:
(WebCore::URLUtils<T>::protocol):
(WebCore::URLUtils<T>::host):
(WebCore::URLUtils<T>::port):
* loader/CrossOriginAccessControl.cpp:
(WebCore::isValidCrossOriginRedirectionURL):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
(WebCore::isRemoteWebArchive):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse):
* loader/cache/CachedResource.cpp:
(WebCore::shouldCacheSchemeIndefinitely):
(WebCore::CachedResource::freshnessLifetime):
* page/Location.cpp:
(WebCore::Location::protocol):
(WebCore::Location::host):
(WebCore::Location::port):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isSecure):
(WebCore::SecurityOrigin::canDisplay):
(WebCore::SecurityOrigin::toRawString):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::databaseIdentifier):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::port):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::debugString):
* page/SecurityOriginData.h:
(): Deleted.
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
(WebCore::ContentSecurityPolicy::allowResourceFromSource):
(WebCore::ContentSecurityPolicy::allowConnectToSource):
(WebCore::ContentSecurityPolicy::allowBaseURI):
(WebCore::stripURLForUseInReport):
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
(WebCore::ContentSecurityPolicySource::portMatches):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parsePort):
* page/csp/ContentSecurityPolicySourceList.h:
* platform/SchemeRegistry.h:
* platform/URL.cpp:
(WebCore::URL::protocol):
(WebCore::URL::port):
(WebCore::URL::serialize):
(WebCore::portAllowed):
(WebCore::defaultPortsMap): Deleted.
(WebCore::defaultPortForProtocol): Deleted.
(WebCore::isDefaultPortForProtocol): Deleted.
* platform/URL.h:
(WebCore::URL::hasPort): Deleted.
* platform/URLParser.cpp:
(WebCore::defaultPortForProtocol):
(WebCore::isDefaultPortForProtocol):
(WebCore::URLParser::parsePort):
(WebCore::isDefaultPort): Deleted.
* platform/network/CredentialStorage.cpp:
(WebCore::originStringFromURL):
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::create):
(WebCore::ResourceHandle::loadResourceSynchronously):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::port):
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::protocol):
(WebCore::WorkerLocation::host):
(WebCore::WorkerLocation::port):
2016-10-24 Zan Dobersek <zdobersek@igalia.com>
[CodeGeneratorJS] Support enums for standalone dictionaries
https://bugs.webkit.org/show_bug.cgi?id=163885
Reviewed by Youenn Fablet.
Add support for enumerations in WebIDL files that specify
standalone dictionaries. Implementation of this is pretty
straight-forward and mirrors interface and callback generators
by calling GenerateEnumerations{Header,Implementation}Content()
functions in GenerateDictionary{Header,Implementation}().
In GenerateEnumerationsImplementationContent(), the
NeverDestroyed.h header is added to the implementation includes
since that class is used to hold an array of possible enum
values.
A test enum is added to the TestStandaloneDictionary.idl file
and the baselines are updated to reflect the new capability.
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionary):
(GenerateEnumerationsImplementationContent):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertEnumerationToJS):
(WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
(WebCore::convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
(WebCore::expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:
2016-10-24 Dave Hyatt <hyatt@apple.com>
Remove CSSCharsetRule from the CSS OM
https://bugs.webkit.org/show_bug.cgi?id=163891
Reviewed by Darin Adler.
Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
change. This eliminates the weird overloading of isCharsetRule to match both
CSSCharsetRule and StyleRuleCharset (only used by the new parser).
Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
by the new parser properly.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSCharsetRule.cpp: Removed.
* css/CSSCharsetRule.h: Removed.
* css/CSSCharsetRule.idl: Removed.
* css/CSSPropertySourceData.h:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::item):
(WebCore::CSSStyleSheet::rules):
* css/CSSStyleSheet.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
* inspector/InspectorStyleSheet.cpp:
(WebCore::asCSSRuleList):
2016-10-24 Zan Dobersek <zdobersek@igalia.com>
[CodeGeneratorJS] Standalone dictionaries have misplaced build guards
https://bugs.webkit.org/show_bug.cgi?id=163881
Reviewed by Chris Dumez.
Build guards that are generated from the Conditional attribute
on WebIDL dictionary declarations properly guard the relevant
convertDictionary() functions for WebIDL files that also specify
interfaces. But for standalone dictionaries these build guards
should guard the complete header and implementation files, much
like this is done for files that originate from interfaces or
callbacks.
Before this patch, guarding a standalone dictionary resulted in
malformed output because GenerateHeaderContentHeader() and
GenerateImplementationContentHeader() functions both generated
the #if macro that would guard the whole file, but
GenerateDictionary{Header,Implementation}() didn't generate the
closing #endif.
CodeGeneratorJS.pm now passes the conditional string, if any,
to GenerateDictionary{Header,Implementation}Content() functions
in case of a non-standalone dictionary. Otherwise, the
conditional string, if any, is used to guard the complete
header and implementation files.
Generator tests are updated to cover various build guard
combinations on dictionaries in TestObj.idl, and the standalone
dictionary WebIDL file now has a Conditional attribute to check
that the build guards cover complete generated header and
implementation files.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionariesHeaderContent):
(GenerateDictionaryImplementationContent):
(GenerateDictionariesImplementationContent):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneDictionary.idl:
2016-10-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Separate media capture and audio playback muting
https://bugs.webkit.org/show_bug.cgi?id=163855
<rdar://problem/28827186>
Reviewed by Darin Adler.
Test: fast/mediastream/MediaStream-page-muted.html
Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
Fix a couple of bugs in the mock media capture device uncovered by new test case.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::pageMutedStateDidChange): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume): Ditto.
(WebCore::HTMLMediaElement::effectiveMuted): Ditto.
* page/MediaProducer.h: Add MutedState enum.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
* page/Page.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
(WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
* platform/mock/MockRealtimeMediaSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.
* testing/Internals.cpp:
(WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-24 Darin Adler <darin@apple.com>
Try to fix Windows build.
* bindings/js/JSWebGL2RenderingContextCustom.cpp: Rearranged includes
so they are inside the conditional as they should be.
2016-10-24 Youenn Fablet <youenn@apple.com>
Activate WEB_RTC compilation flags for Mac bots
https://bugs.webkit.org/show_bug.cgi?id=163886
Reviewed by Eric Carlson.
Covered by existing tests.
Fixing compilation errors due to missing WEBCORE_EXPORT, missing method and missing override keywords.
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::generate):
(WebCore::SDPProcessor::parse):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::createMuted):
2016-10-24 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBIndex name assignment.
<rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/index-rename-1-private.html
storage/indexeddb/modern/index-rename-1.html
Touches a *lot* of code sites, but none of them are particularly interesting.
They are all just getting the new name spread out to all of the various objects that need it.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::renameIndex):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::IDBIndex):
(WebCore::IDBIndex::setName):
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::renameReferencedIndex):
(WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::renameIndexOnServer):
(WebCore::IDBTransaction::didRenameIndexOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::renameIndex):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::renameIndex):
(WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::createTransactionOperation):
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::renameIndex):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryIndex.h:
(WebCore::IDBServer::MemoryIndex::rename):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::renameIndex):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBIndexInfo.h:
(WebCore::IDBIndexInfo::rename):
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::infoForExistingIndex):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::renameIndexSuccess):
* Modules/indexeddb/shared/IDBResultData.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didRenameIndex):
(WebCore::InProcessIDBServer::renameIndex):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2016-10-24 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix -webkit-box-reflect parsing
https://bugs.webkit.org/show_bug.cgi?id=163890
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeReflect):
Do a WTFMove on the mask instead of a .releaseNonNull(), since mask can be a nullptr.
Exactly matches the old parser.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
(WebCore::CSSPropertyParserHelpers::consumeUrl):
(WebCore::CSSPropertyParserHelpers::consumeColor):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
Clean up all instances of CSSPrimitiveValue::create to use the CSSValuePool.
2016-10-21 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Concatenate JS and CSS files into a single JS and CSS resources
https://bugs.webkit.org/show_bug.cgi?id=163785
<rdar://problem/28890058>
Reviewed by Darin Adler.
Concatenate CSS and JS resources for modern media controls into single JS and CSS files
during build and load these single resources alone at runtime.
* Modules/modern-media-controls/js-files: Added.
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-24 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Unprefix -webkit-writing-mode
https://bugs.webkit.org/show_bug.cgi?id=163870
Reviewed by Zalan Bujtas.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
Change -webkit-writing mode to writing-mode.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator WritingMode):
(WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
values to the WritingMode converters.
* css/CSSPropertyNames.in:
Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
instead of to -webkit-writing-mode.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWritingMode):
(WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
the underlying converter for WritingMode now handles those values.
* css/StyleResolver.cpp:
(WebCore::extractDirectionAndWritingMode):
Rename -webkit-writing-mode to writing-mode.
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
and the normal values.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Same deal here.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionRects):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRects):
Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
the SVG-specific one.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isVerticalWritingMode):
Add a helper function for asking if something is vertical writing mode.
* rendering/style/SVGRenderStyle.cpp:
* rendering/style/SVGRenderStyle.h:
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::SVGRenderStyle::diff):
Remove the SVG writing mode code.
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
Make sure to force SVG font descriptions to be horizontal, since SVG controls
its own glyph orientation.
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGInlineTextBox):
* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::executeQuery):
Changed to access the RenderStyle writing mode instead of the SVG-specific one.
2016-10-23 Antti Koivisto <antti@apple.com>
Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
https://bugs.webkit.org/show_bug.cgi?id=163875
Reviewed by Andreas Kling.
Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::hasValidStyleForProperty):
For non-inherited properties we don't need to update style even if some ancestor style is invalid
as long as explicit 'inherit' is not being used.
We still need to update if we find out that the whole subtree we are in is invalid.
(WebCore::updateStyleIfNeededForProperty):
Pass the property.
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::updateStyleIfNeededForElement): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue):
Mark style as using explicit inheritance if 'currentcolor' value is used.
2016-10-24 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
https://bugs.webkit.org/show_bug.cgi?id=163242
Reviewed by Darin Adler.
Test: http/tests/security/cross-origin-cached-images-canvas.html
We were previously on Origin HTTP header to check whether requests were made from different origins.
This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::isRequestMatchingResourceOrigin):
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2016-10-24 Youenn Fablet <youenn@apple.com>
Remove CachedResource::passesSameOriginPolicyCheck
https://bugs.webkit.org/show_bug.cgi?id=163593
Reviewed by Andreas Kling.
No change of behavior.
Removing no-longer used code.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::redirectReceived):
(WebCore::CachedResource::passesAccessControlCheck): Deleted.
(WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
(WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::response):
2016-10-24 Youenn Fablet <youenn@apple.com>
Redirections should be upgraded if CSP policy says so
https://bugs.webkit.org/show_bug.cgi?id=163544
Reviewed by Darin Adler.
Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
to the initial request, but for redirection requests.
Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
Minor refactoring in CachedResourceRequest to share some code.
Fixing some constness issues.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::updateRequestAfterRedirection):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::upgradeInsecureResourceRequestIfNeeded):
(WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
* loader/cache/CachedResourceRequest.h:
2016-10-22 Sam Weinig <sam@webkit.org>
[WebIDL] Add IDLType based toJS conversion
https://bugs.webkit.org/show_bug.cgi?id=163861
Reviewed by Darin Adler.
Adds toJS<IDLType>() functions to be the new way of converting
from implementation types to JS types. These are implemented via
a similar mechanism to the convert<IDL>() functions, though specializations
of a JSConverter struct (rather than the Converter structs). This allows
us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
* Modules/geolocation/Geoposition.idl:
* dom/Event.idl:
Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
for now it allows us to simplify the type system.
* bindings/js/JSDOMBinding.h:
(WebCore::JSValueTraits::arrayJSValue): Deleted.
(WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
(WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
(WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
(WebCore::jsArray): Deleted.
(WebCore::jsFrozenArray): Deleted.
(WebCore::NativeValueTraits<String>::nativeValue): Deleted.
(WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
(WebCore::NativeValueTraits<float>::nativeValue): Deleted.
(WebCore::NativeValueTraits<double>::nativeValue): Deleted.
(WebCore::toNullableJSNumber): Deleted.
(WebCore::toJSArray): Deleted.
(WebCore::toJSBoolean): Deleted.
(WebCore::toJSNumber): Deleted.
(WebCore::toJSString): Deleted.
Remove many now-unneeded conversion functions.
* bindings/js/JSDOMConvert.h:
(WebCore::toJS):
Add 5 primary toJS functions which take combinations of the following
arguments: ExecState, JSDOMGlobalObject, ThrowScope. All take the value
to be converted as well, except in the case of the throwScope ones, where
they take the value in an ExceptionOr<>.
To simplify the implementations of the JSConverter specializations, avoiding
the need for each one to implement their conversion up to 3 times (one for just
the value, one for the value and the ExecState, and one for the value, the ExecState
and the global object), each JSConverter instead specifies whether it's converter
needs an ExecState or global object via a static constexpr. We then use the
JSConverterOverloader template, to call the correct function. This can probably be
improved in the future, by inferring the number of arguments needed via SFINAE, but
this seemed like a more straightforward first cut.
(WebCore::JSConverter<IDLNullable<T>>::convert):
(WebCore::JSConverter<IDLBoolean>::convert):
(WebCore::JSConverter<IDLInterface<T>>::convert):
(WebCore::JSConverter<IDLAny>::convert):
(WebCore::JSConverter<IDLByte>::convert):
(WebCore::JSConverter<IDLOctet>::convert):
(WebCore::JSConverter<IDLShort>::convert):
(WebCore::JSConverter<IDLUnsignedShort>::convert):
(WebCore::JSConverter<IDLLong>::convert):
(WebCore::JSConverter<IDLUnsignedLong>::convert):
(WebCore::JSConverter<IDLLongLong>::convert):
(WebCore::JSConverter<IDLUnsignedLongLong>::convert):
(WebCore::JSConverter<IDLFloat>::convert):
(WebCore::JSConverter<IDLUnrestrictedFloat>::convert):
(WebCore::JSConverter<IDLDouble>::convert):
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
(WebCore::JSConverter<IDLDOMString>::convert):
(WebCore::JSConverter<IDLUSVString>::convert):
(WebCore::JSConverter<IDLSequence<T>>::convert):
(WebCore::JSConverter<IDLFrozenArray<T>>::convert):
(WebCore::JSConverter<IDLEnumeration<T>>::convert):
(WebCore::JSConverter<IDLUnion<T...>>::convert):
There is slightly more duplication than I would have liked, for instance we have a
specialization for each numeric type, even though they are all the same, but that is
something that can be improved going forward.
(WebCore::Converter<IDLUnion<T...>>::convert)
Fix the normal IDLUnion converter to work with boolean types. This was caught by the
test case I added via TypeConversions.idl.
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
* bindings/js/JSDataTransferCustom.cpp:
(WebCore::JSDataTransfer::types):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::getCapabilities):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::value):
Switch to use new toJS<> functions.
* bindings/scripts/CodeGeneratorJS.pm:
(AddStringifierOperationIfNeeded):
Fix stringifier function signature to contain an idlType.
(GenerateEnumerationsHeaderContent):
Remove now unnecessary JSValueTraits specializations.
(JSValueToNativeIsHandledByDOMConvert):
Renamed from IsHandledByDOMConvert, since that name is now ambiguous.
(JSValueToNative):
Update for new name of IsHandledByDOMConvert.
(NativeToJSValueIsHandledByDOMConvert):
Predicate guarding what types currently work with the new conversion system.
(NativeToJSValueDOMConvertNeedsState):
Predicate for determining if the ExecState is needed in the conversion function.
(NativeToJSValueDOMConvertNeedsGlobalObject):
Predicate for determining if the global object is needed in the conversion function.
(NativeToJSValue):
Move things around a little bit and start converting use the new toJS<> when possible.
* bindings/scripts/IDLParser.pm:
(parseAttributeOrOperationRest):
Fix a missing place where were not setting the idlType.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
Update test results.
* testing/TypeConversions.h:
(WebCore::TypeConversions::testUnion):
(WebCore::TypeConversions::setTestUnion):
(WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
(WebCore::TypeConversions::typeConversionsDictionaryUnionValue):
* testing/TypeConversions.idl:
Add a testUnion attribute, now that we can return unions to JS.
2016-10-23 Zalan Bujtas <zalan@apple.com>
Unreviewed, rolling out r207727.
broke 15 selection test cases.
Reverted changeset:
"Do not update selection rect on dirty lineboxes."
https://bugs.webkit.org/show_bug.cgi?id=163862
http://trac.webkit.org/changeset/207727
2016-10-23 Chris Dumez <cdumez@apple.com>
addEventListener() / removeEventListener() should use a union for last parameter
https://bugs.webkit.org/show_bug.cgi?id=163863
Reviewed by Darin Adler.
addEventListener() / removeEventListener() should use a union for last parameter:
- https://dom.spec.whatwg.org/#eventtarget
No new tests, no Web-exposed behavior change.
* bindings/js/JSDOMConvert.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListenerForBindings):
(WebCore::EventTarget::removeEventListenerForBindings):
* dom/EventTarget.h:
* dom/EventTarget.idl:
2016-10-23 Zalan Bujtas <zalan@apple.com>
Do not update selection rect on dirty lineboxes.
https://bugs.webkit.org/show_bug.cgi?id=163862
<rdar://problem/28813156>
Reviewed by Simon Fraser.
In addition to checking whether the renderer needs layout, we also need to check if its preferred
width is clean and stop computing the selection rects, if needed (while adding a renderer to the tree,
there's a transition phase where the parent's preferred width dirty bit is already set, but it does
not yet need layout).
Tests: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):
2016-10-22 Myles C. Maxfield <mmaxfield@apple.com>
ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
https://bugs.webkit.org/show_bug.cgi?id=163459
Reviewed by Darin Adler.
The CSS Units and Values spec states that font-relative units, when used
in the font-size property, are resolved against the parent element. When
calc() is specified, we were trying to resolve them against the current
element, which is impossible because of the circular dependency. Instead,
we should resolve against the parent style the same way as when calc()
isn't specified.
Test: fast/text/font-size-calc.html
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontSize):
2016-10-22 Chris Dumez <cdumez@apple.com>
[Web IDL] Two types are distinguishable for overload resolution if at most one of the two includes a nullable type
https://bugs.webkit.org/show_bug.cgi?id=163791
Reviewed by Sam Weinig.
Update overload resolution in the bindings generator so that 2 nullable types
are no longer considered as distinguishable, as per Web IDL:
- https://heycam.github.io/webidl/#dfn-distinguishable
* bindings/scripts/CodeGeneratorJS.pm:
(AreTypesDistinguishableForOverloadResolution):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
* bindings/scripts/test/TestObj.idl:
2016-10-22 Chris Dumez <cdumez@apple.com>
WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163859
Reviewed by Darin Adler.
WebGLRenderingContextBase.texSubImage2D() should use a union instead of overloading:
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
No new tests, no Web-exposed behavior change.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-22 Dan Bernstein <mitz@apple.com>
Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
https://bugs.webkit.org/show_bug.cgi?id=163497
Reviewed by Simon Fraser.
Test: css3/filters/backdrop/dynamic-with-clip-path.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
structuralLayerChangeFlags to ensure that the mask layer is updated.
2016-10-22 Simon Fraser <simon.fraser@apple.com>
Backdrop filter doesn't show if removed then re-added
https://bugs.webkit.org/show_bug.cgi?id=163860
Reviewed by Dan Bernstein.
When a backdrop filter is removed the re-added, updateBackdropFiltersRect() never
runs the second time because m_backdropFiltersRect doesn't change. However, we need
to run that code to size and position the newly re-created backdrop layer, so run
it explicitly if we just created the backdrop layer. This is similar to how
updateContentsImage() calls updateContentsRects().
Test: css3/filters/backdrop/add-remove-add-backdrop-filter.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setBackdropFilters):
(WebCore::GraphicsLayerCA::updateBackdropFilters):
2016-10-22 Simon Fraser <simon.fraser@apple.com>
Fix repainting of slow repaint objects in WK1 when page scale is applied
https://bugs.webkit.org/show_bug.cgi?id=163854
Reviewed by Zalan Bujtas.
RenderObject::repaintSlowRepaintObject() always set the repaint container to the RenderView
if it was null. This is before the call to clippedOverflowRectForRepaint(). If that function
is called with a null repaintContainer, it maps the rect up through the RenderView's transform
(which represents page scale), which is what we want here. Passing the RenderView itself
stops the transform from being applied, which led to the bug.
WebKit2 doesn't suffer from this bug because containerForRepaint() always returns the
composited RenderView.
Test: fast/repaint/zoomed-fixed-background.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintSlowRepaintObject):
2016-10-22 Darin Adler <darin@apple.com>
Move HTML canvas and tracks from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163853
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj: Added CanvasPath.idl.
* bindings/js/JSWebGL2RenderingContextCustom.cpp: Tweaked a bit.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::JSWebGLRenderingContextBase::getExtension): Tweaked a bit.
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
Removed unneeded exception handling.
(WebCore::JSWebGLRenderingContextBase::getParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getProgramParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getShaderParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getSupportedExtensions): Use a
modern for loop.
(WebCore::JSWebGLRenderingContextBase::getUniform): Removed unneeded
exception handling.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext): Pass a reference.
(WebCore::HTMLCanvasElement::reset): Use is<CanvasRenderingContext2D>.
(WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Ditto.
(WebCore::HTMLCanvasElement::setTracksDisplayListReplay) Ditto.:
(WebCore::HTMLCanvasElement::displayListAsText): Ditto.
(WebCore::HTMLCanvasElement::replayDisplayListAsText): Ditto.
(WebCore::HTMLCanvasElement::clearImageBuffer): Ditto.
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::CanvasGradient): Streamlined.
(WebCore::CanvasGradient::addColorStop): Use ExceptionOr.
* html/canvas/CanvasGradient.h: Updated for above changes.
* html/canvas/CanvasGradient.idl: Use non-legacy exception.
* html/canvas/CanvasPath.cpp:
(WebCore::CanvasPath::arcTo): Use ExceptionOr.
(WebCore::CanvasPath::arc): Ditto.
(WebCore::CanvasPath::ellipse): Ditto.
* html/canvas/CanvasPath.h: Updated for above changes.
* html/canvas/CanvasPath.idl: Use non-legacy exceptions.
* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::create): Use Ref&&.
(WebCore::CanvasPattern::CanvasPattern): Ditto.
(WebCore::CanvasPattern::parseRepetitionType): Return a boolean
instead of using an ExceptionCode.
* html/canvas/CanvasPattern.h: Updated for above changes.
* html/canvas/CanvasRenderingContext.cpp:
(CanvasRenderingContext::wouldTaintOrigin): Reordered function so
that it's safe to call it on an image element without a cached
image, or a cached image without an underlying image.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
Take a reference.
(WebCore::CanvasRenderingContext2D::drawImage): Use ExceptionOr.
(WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
(WebCore::CanvasRenderingContext2D::createLinearGradient): Ditto.
(WebCore::CanvasRenderingContext2D::createRadialGradient): Ditto.
(WebCore::CanvasRenderingContext2D::createPattern): Ditto.
(WebCore::CanvasRenderingContext2D::createImageData): Ditto.
(WebCore::CanvasRenderingContext2D::getImageData): Ditto.
(WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Ditto.
(WebCore::CanvasRenderingContext2D::putImageData): Removed unneeded
ExceptionCode because this does not throw exceptions; the only one
was for non-finite numeric values but this is now handled by bindings.
(WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Ditto.
* html/canvas/CanvasRenderingContext2D.h: Updated for above.
* html/canvas/CanvasRenderingContext2D.idl: Use non-legacy exceptions
and removed exceptions entirely in other cases.
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::OESVertexArrayObject): Take a reference.
(WebCore::OESVertexArrayObject::~OESVertexArrayObject): Deleted.
(WebCore::OESVertexArrayObject::isVertexArrayOES): Use && instead of
multiple return statements.
(WebCore::OESVertexArrayObject::bindVertexArrayOES): Removed unneeded
ExceptionCode since this does not throw an exception.
* html/canvas/OESVertexArrayObject.h: Updated for above.
* html/canvas/OESVertexArrayObject.idl: Removed unneeded exception.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
Removed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGL2RenderingContext::texSubImage2DBase): Ditto.
(WebCore::WebGL2RenderingContext::texSubImage2DImpl): Ditto.
(WebCore::WebGL2RenderingContext::texSubImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGL2RenderingContext::validateTexFuncParameters): Removed
unneeded ExceptionCode.
(WebCore::WebGL2RenderingContext::getParameter): Ditto.
* html/canvas/WebGL2RenderingContext.h: Updated for above.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension): Pass a reference.
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
Remvoed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
(WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
(WebCore::WebGLRenderingContext::texSubImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGLRenderingContext::getParameter): Removed unneeded
ExceptionCode.
* html/canvas/WebGLRenderingContext.h: Updated for above changes.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2DBase):
Remvoed unneeded ExceptionCode since this does not throw an exception.
(WebCore::WebGLRenderingContextBase::texImage2DImpl): Ditto.
(WebCore::WebGLRenderingContextBase::texImage2D): Removed unneeded
ExceptionCode for some overloads, for the others, use ExceptionOr
for the security exception. Moved security exception code here from
the validate functions.
(WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
Moved the security exception out of here to the call sites.
(WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement): Ditto.
(WebCore::WebGLRenderingContextBase::validateHTMLVideoElement): Ditto.
* html/canvas/WebGLRenderingContextBase.h: Updated for above changes.
* html/canvas/WebGLRenderingContextBase.idl: Use non-legacy exceptions
in some cases and no exceptions at all in many others.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Use a reference instead of a pointer.
* html/track/DataCue.h: Use pragma once.
* html/track/DataCue.idl: Use non-legacy exception for constructor
attribute, even though it is custom and so it has no effect.
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::create): Use RefPtr&&.
(WebCore::InbandDataTextTrack::InbandDataTextTrack): Ditto.
(WebCore::InbandDataTextTrack::addDataCue): Stop using
ASSERT_NO_EXCEPTION.
(WebCore::InbandDataTextTrack::removeDataCue): Stop using
IGNORE_EXCEPTION.
(WebCore::InbandDataTextTrack::removeCue): Use ExceptionOr.
Also use remove instead of find/remove.
* html/track/InbandDataTextTrack.h: Updated for above changes.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Deleted.
(WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Deleted.
(WebCore::GenericTextTrackCueMap::add): Take references intead of
pointers.
(WebCore::GenericTextTrackCueMap::find): Ditto. Also use get
instead of find.
(WebCore::GenericTextTrackCueMap::remove): Ditto. Also use take
instead of double hashing to both find and remove.
(WebCore::InbandGenericTextTrack::updateCueFromCueData): Stop using
IGNORE_EXCEPTION. Also got rid of code that is converting a double
to a long and then back to a double by using lround. Instead just
use std::round, which keeps it a double. But also, why does this need
to round?!
(WebCore::InbandGenericTextTrack::addGenericCue): Updated to use
reference to work with m_cueMap.
(WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeCue): Use ExceptionOr.
(WebCore::InbandGenericTextTrack::newCuesParsed): Removed
ASSERT_NO_EXCEPTION.
* html/track/InbandGenericTextTrack.h: Updated for above changes.
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Removed
ASSERT_NO_EXCEPTION.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue): Use ExcepctionOr.
(WebCore::TextTrack::removeCue): Ditto.
(WebCore::TextTrack::addRegion): Ditto.
(WebCore::TextTrack::removeRegion): Ditto.
* html/track/TextTrack.h: Updated for above changes.
* html/track/TextTrack.idl: Ditto.
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueShadowPseudoId): Moved this here
since it does not need to be inlined in the header.
(WebCore::TextTrackCue::~TextTrackCue): Deleted.
(WebCore::TextTrackCue::setStartTime): Removed ExceptionCode&
since the exceptions were for non-finite values, but this is
now handled by the bindings.
(WebCore::TextTrackCue::setEndTime): Ditto.
* html/track/TextTrackCue.h: Updated for the above.
* html/track/TextTrackCue.idl: Removed SetterMayThrowLegacyException
and made startTime and endTime be double rather than unrestricted double.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
Use a reference instead of a pointer.
(WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialize
m_defaultPosition in the class definition instead of here.
(WebCore::TextTrackCueGeneric::createDisplayTree): Return a Ref.
(WebCore::TextTrackCueGeneric::setLine): Use ExceptionOr.
(WebCore::TextTrackCueGeneric::setPosition): Ditto.
(WebCore::TextTrackCueGeneric::setFontSize): Updated since
displayTreeInternal() now returns a reference.
* html/track/TextTrackCueGeneric.h: Updated for above changes.
Also fixed some arguument types and made some more things private.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::createDisplayTree): Return a Ref.
(WebCore::VTTCue::displayTreeInternal): Return a reference.
(WebCore::VTTCue::setVertical): Use ExceptionOr.
(WebCore::VTTCue::setLine): Ditto.
(WebCore::VTTCue::setPosition): Ditto.
(WebCore::VTTCue::setSize): Ditto.
(WebCore::VTTCue::setAlign): Ditto.
(WebCore::VTTCue::getDisplayTree): Return a reference.
(WebCore::VTTCue::removeDisplayTree): Updated since
displayTreeInternal returns a reference.
(WebCore::VTTCue::setFontSize): Ditto.
* html/track/VTTCue.h: Updated for the above.
* html/track/VTTCue.idl: Use non-legacy exceptions and also
restricted doubles.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::VTTRegion): Moved default values all into
the class definition.
(WebCore::VTTRegion::setWidth): Removed the check for non-finite
since the bindings now handle that. Use ExcpetionOr.
(WebCore::VTTRegion::setHeight): Ditto.
(WebCore::VTTRegion::setRegionAnchorX): Ditto.
(WebCore::VTTRegion::setRegionAnchorY): Ditto.
(WebCore::VTTRegion::setViewportAnchorX): Ditto.
(WebCore::VTTRegion::setViewportAnchorY): Ditto.
(WebCore::upKeyword): Added. Shared by the code below.
(WebCore::VTTRegion::scroll): Rewrote to be simpler.
(WebCore::VTTRegion::setScroll): Rewrote to be simpler.
(WebCore::VTTRegion::updateParametersFromRegion): Read and
write data members directly to avoid awkward code that is otherwise
required just to copy from one object to the other. Also take a
const& instead of a pointer for the thing to update from.
(WebCore::VTTRegion::parseSettingValue): Use upKeyword.
(WebCore::VTTRegion::appendTextTrackCueBox): Take a Ref&&.
(WebCore::VTTRegion::getDisplayTree): Do the downcast to Document
here instead of using the helper function.
(WebCore::VTTRegion::prepareRegionDisplayTree): Ditto.
* html/track/VTTRegion.h: Updated for the above.
* html/track/VTTRegion.idl: Use non-legacy exceptions and also
use restricted dobules, not unrestricted.
2016-10-22 Chris Dumez <cdumez@apple.com>
WebGLRenderingContextBase.texImage2D() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163856
Reviewed by Darin Adler.
WebGLRenderingContextBase.texImage2D() should use a union instead of overloading:
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-22 Antti Koivisto <antti@apple.com>
REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20%
https://bugs.webkit.org/show_bug.cgi?id=163851
Reviewed by Darin Adler.
The test calls Scope::flushPendingUpdate a lot and nothing ever happens there.
Add a separate invalidity bit for descendant scopes and inline the fast path.
* style/StyleScope.cpp:
(WebCore::Style::Scope::flushPendingSelfUpdate):
(WebCore::Style::Scope::flushPendingDescendantUpdates):
(WebCore::Style::Scope::scheduleUpdate):
(WebCore::Style::Scope::flushPendingUpdate): Deleted.
* style/StyleScope.h:
(WebCore::Style::Scope::hasPendingUpdate):
(WebCore::Style::Scope::flushPendingUpdate):
2016-10-22 Darin Adler <darin@apple.com>
Move SVG from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163837
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj: Added SVGGraphicsElement.idl.
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::value): Use toJSNumber.
(WebCore::JSSVGLength::setValue): Use propagateException.
(WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Properly handle SetterMayThrowException
in the special case for SVG setters.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialBaselineShiftValue): Removed
ASSERT_NO_EXCEPTION, no longer needed.
(WebCore::SVGRenderStyle::initialKerning): Ditto.
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::setGlyphRef): Use ExceptionOr.
(WebCore::SVGAltGlyphElement::setFormat): Ditto.
(WebCore::SVGAltGlyphElement::hasValidGlyphElements): Tweaked a bit.
* svg/SVGAltGlyphElement.h: Updated for above changes.
* svg/SVGAltGlyphElement.idl: Use non-legacy exceptions.
* svg/SVGAngle.cpp:
(WebCore::SVGAngle::valueAsString): Removed unneeded String globals.
(WebCore::parseAngleType): Rewrote to be simpler and more direct.
(WebCore::SVGAngle::setValueAsString): Use ExceptionOr.
(WebCore::SVGAngle::newValueSpecifiedUnits): Ditto.
(WebCore::SVGAngle::convertToSpecifiedUnits): Ditto.
* svg/SVGAngle.h: Updated for above changes. Initialized data members
here in the class definite and removed constructor; default now works.
* svg/SVGAngle.idl: Use non-legacy exceptions.
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue): Update since
CalcMode is now an enum class.
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): Ditto.
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::hasValidAttributeType): Update
since AttributeType is now an enum class.
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::calculateDistance): Removed
ASSERT_NO_EXCEPTION, no longer needed.
* svg/SVGAnimatedBoolean.idl: Use non-legacy exception.
* svg/SVGAnimatedEnumeration.idl: Ditto.
* svg/SVGAnimatedInteger.idl: Ditto.
* svg/SVGAnimatedLength.cpp:
(WebCore::sharedSVGLength): Deleted.
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes): Removed
ASSERT_NO_EXCEPTION, no longer needed.
(WebCore::parseLengthFromString): Ditto. Also rewrote to not use
a shared SVGLength; no benefit to doing that.
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes): Ditto.
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedNumber.idl: Use non-legacy exception.
* svg/SVGAnimatedString.idl: Ditto.
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString): Updated since
setValueAsString now uses ExceptionOr.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::SVGAnimationElement): Initialized scalars
in the class definition instead of here.
(WebCore::SVGAnimationElement::getSimpleDuration): Removed uneeded ExceptionCode&.
(WebCore::SVGAnimationElement::setCalcMode): Updated since CalcMode is now an enum class.
(WebCore::SVGAnimationElement::setAttributeType): Updated since AttributeType
is now an enum class.
(WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): Ditto.
(WebCore::SVGAnimationElement::calculatePercentForSpline): Ditto.
(WebCore::SVGAnimationElement::calculatePercentFromKeyPoints): Ditto.
(WebCore::SVGAnimationElement::calculatePercentForFromTo): Ditto.
(WebCore::SVGAnimationElement::currentValuesFromKeyPoints): Ditto.
(WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Ditto.
(WebCore::SVGAnimationElement::startedActiveInterval): Ditto.
(WebCore::SVGAnimationElement::updateAnimation): Ditto.
(WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Ditto.
* svg/SVGAnimationElement.h: Changed CalcMode into an enum class.
Updated for above changes.
* svg/SVGAnimationElement.idl: Removed MayThrowLegacyException from
getSimpleDuration.
* svg/SVGColor.cpp:
(WebCore::SVGColor::SVGColor): Updated to take scalar in the straightforward
manner instead of constt SVGColorType&.
(WebCore::SVGColor::setRGBColor): Use ExceptionOr.
(WebCore::SVGColor::setRGBColorICCColor): Ditto.
(WebCore::SVGColor::setColor): Ditto.
* svg/SVGColor.h: Updated for above changes. Removed unneeded destructor.
* svg/SVGColor.idl: Use non-legacy exceptions.
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::SVGGlyphRefElement): Initialize data members
in class definition, not here.
(WebCore::parseFloat): Added helper. Used in parseAttribute.
(WebCore::SVGGlyphRefElement::parseAttribute): Updated to use parseFloat helper.
(WebCore::SVGGlyphRefElement::glyphRef): Deleted.
(WebCore::SVGGlyphRefElement::setGlyphRef): Deleted.
(WebCore::SVGGlyphRefElement::setX): Removed unused Exception& argument.
(WebCore::SVGGlyphRefElement::setY): Ditto.
(WebCore::SVGGlyphRefElement::setDx): Ditto.
(WebCore::SVGGlyphRefElement::setDy): Ditto.
* svg/SVGGlyphRefElement.h: Updated for above changes.
* svg/SVGGlyphRefElement.idl: Use Reflect on glyphRef. Removed incorrect
SetterMayThrowLegacyException attributes for x, y, dx, and dy. Longer term
it might be nice to use [Reflect] on these too.
* svg/SVGGraphicsElement.idl: Use non-legacy exception.
* svg/SVGLength.cpp:
(WebCore::parseLengthType): Changed argument type since caller does not
need to know how many characters are consumed.
(WebCore::SVGLength::SVGLength): Removed IGNORE_EXCEPTION and ASSERT_NO_EXCEPTION.
Also removed the copy constructor, letting the compiler generate the default.
(WebCore::SVGLength::setValueAsString): Use ExceptionOr.
(WebCore::SVGLength::construct): Updated since setValueAsString uses ExceptionOr.
(WebCore::SVGLength::value): Ditto.
(WebCore::SVGLength::valueForBindings): Use ExceptionOr. Also renamed to
disambiguate with the version used outside of bindings.
(WebCore::SVGLength::setValue): Use ExceptionOr.
(WebCore::SVGLength::newValueSpecifiedUnits): Ditto.
(WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
(WebCore::SVGLength::fromCSSPrimitiveValue): Updated since newValueSpecifiedUnits
uses ExceptionOr.
(WebCore::SVGLength::lengthModeForAnimatedLengthAttribute): Rewrote map generation
code to be more efficient and not unrolled. Only do one hash table lookup.
* svg/SVGLength.h: Updated for above changes.
* svg/SVGLength.idl: Use non-legacy exceptions.
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength): Update since function
uses ExceptionOr.
(WebCore::SVGLengthContext::convertValueToUserUnits): Use ExceptionOr.
(WebCore::SVGLengthContext::convertValueFromUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage): Ditto.
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): Ditto.
(WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): Ditto.
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): Ditto.
(WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): Ditto.
* svg/SVGLengthContext.h: Updatedfor above changes.
* svg/SVGLengthList.cpp:
(WebCore::SVGLengthList::parse): Updated since setValueAsString uses
ExceptionOr now.
* svg/SVGLengthList.h: Removed unneeded constructor.
* svg/SVGLengthList.idl: Use non-legacy exceptions.
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement): Use ExceptionOr.
* svg/SVGLocatable.h: Updated for above change.
* svg/SVGMarkerElement.h:
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
Updated since setValueAsString uses ExceptionOr now.
* svg/SVGMatrix.h: Use ExceptionOr.
* svg/SVGMatrix.idl: Use non-legacy exceptions.
* svg/SVGNumberList.h: Removed unneeded constructor.
* svg/SVGNumberList.idl: Use non-legacy exceptions.
* svg/SVGPaint.cpp:
(WebCore::SVGPaint::setPaint): Use ExceptionOr.
* svg/SVGPaint.h: Updated for above chagne.
* svg/SVGPaint.idl: Use non-legacy exception.
* svg/SVGPathSegList.h: Tweaked a bit.
* svg/SVGPathSegList.idl: Use non-legacy exceptions.
* svg/SVGPointList.h: Removed unneeded constructor.
* svg/SVGPointList.idl: Use non-legacy exceptions.
* svg/SVGPreserveAspectRatio.cpp:
(WebCore::SVGPreserveAspectRatio::setAlign): Use ExceptionOr.
(WebCore::SVGPreserveAspectRatio::setMeetOrSlice): Ditto.
* svg/SVGPreserveAspectRatio.h: Updated for above changes.
* svg/SVGPreserveAspectRatio.idl: Use non-legacy exceptions.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentView): Pass a reference.
* svg/SVGStringList.h: Tweaked a bit.
* svg/SVGStringList.idl: Use non-legacy exceptions.
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::setType): Removed unneeded ExceptionCode&.
(WebCore::SVGStyleElement::setMedia): Ditto.
(WebCore::SVGStyleElement::setTitle): Deleted.
* svg/SVGStyleElement.h: Updated for above changes, and made the title
function override be private.
* svg/SVGStyleElement.idl: Use Reflect for title. Removed unneeded
SetterMayThrowLegacyException on all attributes.
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::textLengthAnimated): Removed
ASSERT_NO_EXCEPTION, won't work any more.
(WebCore::SVGTextContentElement::getSubStringLength): Use ExceptionOr.
Also remove redundant call to updateLayoutIgnorePendingStylesheets,
called by getNumberOfChars.
(WebCore::SVGTextContentElement::getStartPositionOfChar): Ditto.
(WebCore::SVGTextContentElement::getEndPositionOfChar): Ditto.
(WebCore::SVGTextContentElement::getExtentOfChar): Ditto.
(WebCore::SVGTextContentElement::getRotationOfChar): Ditto.
(WebCore::SVGTextContentElement::selectSubString): Ditto.
* svg/SVGTextContentElement.h: Updated for above changes.
* svg/SVGTextContentElement.idl: Use non-legacy exceptions.
* svg/SVGTransformList.h: Removed unneeded constructor.
* svg/SVGTransformList.idl: Use non-legacy exceptions.
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec): Updated to take a reference.
(WebCore::SVGViewSpec::setZoomAndPan): Use ExceptionOr.
(WebCore::SVGViewSpec::setTransformString): Deleted.
(WebCore::SVGViewSpec::viewBoxString): Use m_viewBox directly.
(WebCore::SVGViewSpec::preserveAspectRatioString): Use
m_preserveAspectRatio directly.
(WebCore::SVGViewSpec::viewTarget): Use is<SVGElement>.
(WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Use
m_contextElement directly.
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
Ditto.
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Ditto.
(WebCore::SVGViewSpec::parseViewSpec): Set m_viewTargetString directly.
* svg/SVGViewSpec.h: Updated for above changes. Removed unneeded virtual
destructor, unneeded using for ref/deref, unused functions including
setTransformString, setViewTargetString, non-exception setZoomAndPan,
contextElement, viewBoxBaseValue, and preserveAspectRatioBaseValue.
* svg/SVGViewSpec.idl: Use non-legacy exceptions. Also specify
ImplementationLacksVTable.
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
Use ExceptionOr.
* svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
* svg/properties/SVGListProperty.h: Ditto.
* svg/properties/SVGListPropertyTearOff.h: Ditto.
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::clear): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::getItem): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::replaceItem): Ditto.
(WebCore::SVGPathSegListPropertyTearOff::removeItem): Ditto.
* svg/properties/SVGPathSegListPropertyTearOff.h: Ditto.
* svg/properties/SVGPropertyTearOff.h: Ditto. Also added an overload
of create that knows how to deal with exceptions.
* svg/properties/SVGStaticListPropertyTearOff.h: Ditto.
* svg/properties/SVGTransformListPropertyTearOff.h: Ditto.
2016-10-22 Chris Dumez <cdumez@apple.com>
WebGLRenderingContextBase.bufferData() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163795
Reviewed by Darin Adler.
WebGLRenderingContextBase.bufferData() / bufferSubData() should use a union
instead of overloading:
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
No new tests, no web-exposed behavior change.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCEReactions.h:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-22 Darin Adler <darin@apple.com>
[Cocoa] REGRESSION (r204508): Crash in init_WebCreateFragment when pasting (seen in multiple apps using legacy WebKit)
https://bugs.webkit.org/show_bug.cgi?id=163839
Reviewed by Dan Bernstein.
* editing/cocoa/EditorCocoa.mm: Use the appropriate SOFT_LINK macros to find
the WebKitLegacy platform in the correct location for iOS and macOS.
2016-10-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
Bindings error message for missing required dictionary member should be more explicit
https://bugs.webkit.org/show_bug.cgi?id=163665
Reviewed by Darin Adler.
Add throwRequiredMemberTypeError function to throw a TypeError exception with an error
message indicating the missing required member.
No new test required, rebase existing tests.
* bindings/js/JSDOMBinding.cpp:
(WebCore::throwRequiredMemberTypeError):
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2016-10-22 Ryosuke Niwa <rniwa@webkit.org>
Upgrading custom element should enqueue attributeChanged and connected callbacks
https://bugs.webkit.org/show_bug.cgi?id=163840
Reviewed by Darin Adler.
When upgrading a custom element, enqueue attributeChanged and connectedCallbacks as needed as specified
in step 3 and 4 of: https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element
Test: fast/custom-elements/upgrading-enqueue-reactions.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement): Enqueue
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueueItem::invoke): Don't invoke callbacks when the custom element had
failed to upgrade.
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Added.
(WebCore::CustomElementReactionQueue::invokeAll): Upgrading a custom element may enqueue more reactions.
Keep invoking reactions until the queue becomes empty.
* dom/CustomElementReactionQueue.h:
* dom/Range.idl: Added a forgotten CEReactions here.
2016-10-21 David Kilzer <ddkilzer@apple.com>
Bug 163762: IntSize::area() should used checked arithmetic
<https://webkit.org/b/163762>
Reviewed by Darin Adler.
No new tests since no change in nominal behavior.
* platform/graphics/IntSize.h:
(WebCore::IntSize::area): Change to return a
Checked<unsigned, T> value. Use WTF:: namespace to avoid
including another header.
* platform/graphics/IntRect.h:
(WebCore::IntRect::area): Ditto.
The remaining changes are to use the Checked<unsigned> return
value of IntSize::area() and IntRect::area() correctly in
context, in addition to items noted below.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin):
Declare contentWidth and contentHeight as float values to
prevent overflow when computing the area, and to make the
inequality comparison in the return statement uses the same type
for both sides.
* html/ImageData.cpp:
(WebCore::ImageData::ImageData):
* html/MediaElementSession.cpp:
(WebCore::isElementRectMostlyInMainFrame):
* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::setSize): Restructure logic to
compute area only once.
(WebCore::ImageBackingStore::clear):
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::frameBytes):
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::maximumSubsamplingLevel):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::backingStoreBytesForSize):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::asUnmultipliedImage):
(WebCore::FilterEffect::asPremultipliedImage):
(WebCore::FilterEffect::copyUnmultipliedImage):
(WebCore::FilterEffect::copyPremultipliedImage):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData): Update overflow check,
rename local variable to numBytes, and compute numBytes once.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
* platform/ios/LegacyTileLayerPool.mm:
(WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
2016-10-21 Gavin Barraclough <barraclough@apple.com>
WebPageProxy should not need PageActivityState
https://bugs.webkit.org/show_bug.cgi?id=163821
Reviewed by Geoff Garen.
The PageActivityState is currently plumbed back from WebCore up to the UI process, to
determine whether to enabled process suppression. However the information it contains
(whether a page load is ongoing, whether audio is playing) is already available via
other means. Remove this use of PageActivityState.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaState):
- Fix a bug in how we compute IsPlayingAudio - if the volume of the MediaElement is
set to zero, then audio is not playing (we were already checking muted).
* page/ChromeClient.h:
- removed setPageActivityState
* page/Page.cpp:
(WebCore::Page::setPageActivityState): Deleted.
- setPageActivityState -> pageActivityStateChanged, remove call to ChromeClient
* page/Page.h:
(WebCore::Page::pageActivityStateChanged):
- setPageActivityState -> pageActivityStateChanged
* page/PageThrottler.cpp:
(WebCore::PageThrottler::setActivityFlag):
- setPageActivityState -> pageActivityStateChanged
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web ID] Overload resolution is wrong if one of the types is a nullable union
https://bugs.webkit.org/show_bug.cgi?id=163816
Reviewed by Alex Christensen.
Overload resolution was wrong if one of the types was a nullable union. This
is because we never considered the union type itself, only its subtypes.
Therefore, we checked if any of the union's subtypes were nullable but we
failed to check if the union itself was nullable.
See:
- https://heycam.github.io/webidl/#es-overloads (Step 11.3.)
No new tests, extended bindings tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GetOverloadThatMatchesIgnoringUnionSubtypes):
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
* bindings/scripts/test/TestObj.idl:
2016-10-21 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Dynamically generate media capture sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=154861
<rdar://problem/24909411>
Reviewed by Tim Horton.
No new tests, some of these changes are covered by existing tests and some can only be tested
with physical capture devices.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: AVSampleBufferAudioRenderer
and AVSampleBufferRenderSynchronizer are now declared in AVFoundationSPI.h.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Initialize
AVSampleBufferRenderSynchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Fail if AVSampleBufferRenderSynchronizer
isn't available.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Take a MediaSample&
instead of a PlatformSample&.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Add the sample buffer display
later to the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Remove the sample buffer display
later from the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stash the current clock time in
m_pausedTime, but leave the clock running. Pause the synchronizer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime): Return the clock time
when playing, m_pausedTime time when paused because we leave the clock running forever.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: AVSampleBufferAudioRenderer
is now declared in AVFoundationSPI.h.
* platform/spi/mac/AVFoundationSPI.h: Add AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer.
2016-10-21 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207582.
https://bugs.webkit.org/show_bug.cgi?id=163819
Not quite ready rdar://problem/28897179 (Requested by
alexchristensen on #webkit).
Reverted changeset:
"Re-enable URLParser for non-Safari Cocoa apps after r207321"
https://bugs.webkit.org/show_bug.cgi?id=163690
http://trac.webkit.org/changeset/207582
2016-10-21 Gavin Barraclough <barraclough@apple.com>
WebPage should take UserActivity directly for user input
https://bugs.webkit.org/show_bug.cgi?id=163813
Reviewed by Anders Carlsson.
When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
isn't really achieving the desired effect. The page setting the flag in the throttler to get
the activity to be set is now a less effective way of achieving this goal, since the
PageActivityState bounces back across to the UI process & then messages back to the WebContent
process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
from the initial message isn't lost.
* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
(WebCore::m_userInputHysteresis): Deleted.
* page/PageThrottler.h:
(WebCore::PageThrottler::didReceiveUserInput): Deleted.
- removed PageActivityState::UserInputActivity, didReceiveUserInput, m_userInputHysteresis.
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
https://bugs.webkit.org/show_bug.cgi?id=163460
<rdar://problem/28784142>
Reviewed by Darin Adler.
Adds basic support for the composition inputTypes in the InputEvent spec. See w3.org/TR/input-events,
github.com/w3c/input-events/issues/41 and github.com/w3c/input-events/issues/42 for more details. While input
events are fired in the correct order with respect to each other, additional work will be required to ensure
that input events are fired in the correct order with respect to composition(start|update|end) events and
textInput events. This is held off until the expected ordering of events is officially defined in the spec.
Tests: fast/events/before-input-events-prevent-insert-composition.html
fast/events/before-input-events-prevent-recomposition.html
fast/events/input-events-ime-composition.html
fast/events/input-events-ime-recomposition.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::isBeforeInputEventCancelable):
Adds a new virtual method hook for subclasses to mark their `beforeinput` events as non-cancelable (see
TypingCommand::isBeforeInputEventCancelable). By default, `beforeinput` events are cancelable.
* editing/EditAction.h:
Adds 4 new EditActions corresponding to the 4 composition-related inputTypes. These are:
EditActionTypingDeletePendingComposition => "deleteCompositionText"
EditActionTypingDeleteFinalComposition => "deleteByComposition"
EditActionTypingInsertPendingComposition => "insertCompositionText"
EditActionTypingInsertFinalComposition => "insertFromComposition"
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::setComposition):
In setComposition(text, mode), tweak the logic for committing a composition to always delete the selection
before inserting the final composition text. In setComposition(text, underlines, start, end), catch the case
where we're beginning to recompose an existing range in the DOM and delete the recomposed text first.
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::deleteSelection):
Adds a TextCompositionType parameter so that call sites (see Editor::setComposition) can indicate what state the
edited composition is in. This allows us to differentiate between deletion of finalized composition text in
preparation of recomposing a range in the DOM, and deletion of composition text that has not yet been committed
in preparation for inserting a finalized composition into the DOM.
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::isBeforeInputEventCancelable):
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
* editing/TypingCommand.h:
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure shadow user agent sheets parse in UASheetMode
https://bugs.webkit.org/show_bug.cgi?id=163810
Reviewed by Dean Jackson.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForElement):
(WebCore::makeInlineStyleSheetCacheKey):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::parserContextForForElement): Deleted.
2016-10-21 Jer Noble <jer.noble@apple.com>
YouTube stalls when seeking beyond buffered range
https://bugs.webkit.org/show_bug.cgi?id=162813
Reviewed by Eric Carlson.
When seeking a MediaPlayerPrivateMediaSourceAVFObjC, we will first seek the AVSampleBufferRenderSynchronizer,
flush and enqueue non-displaying frames, enqueue regular frames, then begin playback. The above stall will occur
when we enqueue so many non- displaying frames that the display layer is not ready for normal ones before
playback begins. Then, when the synchronizer attempts to synchronize the enqueued audio and video renderers, the
only available samples are back at the original media time, and so it "seeks" by updating the CMTimebase back to
the original media time, causing playback to appear "stalled". The overall solution is to "flush" the contents
of the renderers before the seek, so that the synchronizer doesn't reset the currentTime, and to only restart
the synchronizer when there are visible (or audible) samples available for display.
Breaking the fix down into sections:
= Don't enqueue too many non-displaying samples at once:
- Rename SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples() to SourceBufferPrivate::flush(), and no longer
pass in an array of non-displaying samples.
- Add a new virtual method to MediaSample, createNonDisplayingCopy(), used by SourceBuffer to enqueue non-displaying
samples.
- in SourceBuffer::reenqueueMediaForTime(), use that new createNonDisplayingCopy() method to enqueue non-displaying
samples in the same queue as regular samples.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::reenqueueMediaForTime):
* platform/MediaSample.h:
(WebCore::MediaSample::isNonDisplaying):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::flush):
(WebCore::SourceBufferPrivate::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::CMSampleBufferIsNonDisplaying):
(WebCore::MediaSampleAVFObjC::flags):
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::createNonDisplayingCopy): Moved to MediaSampleAVFObjC.
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Renamed -> flush().
* platform/mock/mediasource/MockBox.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::flags):
(WebCore::MockMediaSample::createNonDisplayingCopy):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
= Don't start playing until all renderers have visible/audible samples:
- SourceBufferPrivateAVFObjC will notify its associated MediaPlayerPrivateMediaSourceAVFObjC when
it flushes and receives visible/audible samples.
- The MediaPlayer will store audio renderers as keys to a HashMap which allows it to track which
have available samples.
- This requires changing all the places where we loop over the available renderers.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::flush):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::allRenderersHaveAvailableSamples):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::willSeek):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
= Don't display new samples mid-seek.
- MediaSource should clear its m_pendingSeekTime ivar, which is used whyn SourceBuffer queries whether or not a
seek is pending, when instructing its SourceBuffers to seekToTime().
- This allows SourceBuffer to decline to enqueue new samples during a MediaSource seek operation.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::completeSeek):
2016-10-20 Dean Jackson <dino@apple.com>
SVG should not paint selection within a mask
https://bugs.webkit.org/show_bug.cgi?id=163772
<rdar://problem/28705129>
Reviewed by Simon Fraser.
When masking content, we shouldn't paint the text
selection as we are rendering into the masking
offscreen buffer.
Test: svg/masking/mask-should-not-paint-selection.html
* rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
PaintBehaviorSkipSelectionHighlight is true.
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
to the PaintInfo.
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web IDL] MediaControlsHost has invalid operation overloads
https://bugs.webkit.org/show_bug.cgi?id=163793
Reviewed by Darin Adler.
MediaControlsHost has invalid operation overloads:
- sortedTrackListForMenu()
- displayNameForTrack()
The parameter is nullable for both overloads which is not valid IDL.
- sortedTrackListForMenu(): The parameter is no longer nullable. This is a minor
behavior change and it should be safe since this is Apple-specific and only
called from mediaControlsApple.js which uses HTMLMediaElement.videoTracks and
HTMLMediaElement.audioTracks as input, both of which are not nullable.
Note that we could have also kept one of the parameters as nullable to not
change behavior but allowing null does not seem useful here.
- displayNameForTrack(): Use a union instead of overloading, no behavior change.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::sortedTrackListForMenu):
(WebCore::MediaControlsHost::displayNameForTrack):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
2016-10-21 Jeremy Jones <jeremyj@apple.com>
Implement basic pointer lock behavior for WebKit and WebKit2.
https://bugs.webkit.org/show_bug.cgi?id=162745
Reviewed by Simon Fraser.
When ENABLE_POINTER_LOCK is enabled, these tests now pass with DumpRenderTree.
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-element-not-in-dom.html
LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
LayoutTests/pointer-lock/mouse-event-api.html
Export pointer lock symbols and cancel pointer lock on "escape".
* dom/Document.h: Export symbols.
* dom/Element.h: Export symbols.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Cancel pointer lock on "escape".
* page/PointerLockController.cpp: Add missing include.
* page/PointerLockController.h: Export symbols.
2016-10-21 Jer Noble <jer.noble@apple.com>
WebCore::PlatformMediaSession::stopSession + 13
https://bugs.webkit.org/show_bug.cgi?id=163799
Reviewed by Eric Carlson.
Because m_sessions can be mutated by removeSession() while iterating over m_sessions, and because
PlatformMediaSessions are not refcounted, it is not enough to copy m_sessions into a copied Vector
before iterating. Instead, wrap iteration of m_sessions in a convenience function, which sets an
iteration counter which, when cleared, removes all null entries from m_session. In parallel, modify
removeSession() to check this iteration counter, and replace the session with a null value rather
than mutating the m_sessions vector itself.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::has):
(WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
(WebCore::PlatformMediaSessionManager::canProduceAudio):
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::currentSessionsMatching):
(WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
(WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
(WebCore::PlatformMediaSessionManager::systemWillSleep):
(WebCore::PlatformMediaSessionManager::systemDidWake):
(WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
(WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
(WebCore::PlatformMediaSessionManager::forEachSession):
(WebCore::PlatformMediaSessionManager::anyOfSessions):
* platform/audio/PlatformMediaSessionManager.h:
2016-10-21 Darin Adler <darin@apple.com>
Move some more assorted classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163775
Reviewed by Chris Dumez.
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch): Remove unnecessary calls to
WorkerGlobalScope::scriptExcutionObject, which just returns the scope itself.
* Modules/notifications/Notification.cpp: Added now-needed include.
* Modules/webdatabase/DOMWindowWebDatabase.cpp: Ditto.
* WebCore.xcodeproj/project.pbxproj: Added WindowOrWorkerGlobalScope.idl.
* bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp:
(WebCore::JSDedicatedWorkerGlobalScope::postMessage): Pass a reference instead
of a pointer to handlePostMessage.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::postMessage): Ditto.
* bindings/js/JSMessagePortCustom.h: Use pragma once. Change handlePostMessage
to take a reference to the object instead of a pointer, and also to use
propagateException since postMessage now uses ExceptionOr.
* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorker::postMessage): Pass a reference instead of a pointer to
handlePostMessage.
(WebCore::constructJSWorker): Use the version of toJSNewlyCreated that handles
propagating an exception from ExceptionOr.
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Use auto.
Remove unnecessary round trip through the scriptExecutionContext function.
(WebCore::JSWorkerGlobalScope::importScripts): Use reserveInitialCapacity and
uncheckedAppend to build up the vector of strings. Use propagateException
to deal with ExceptionOr result.
* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort): Initialize boolean data members in the
class definition instead of here.
(WebCore::MessagePort::postMessage): Use ExceptionOr.
(WebCore::MessagePort::entangle): Use an rvalue reference.
(WebCore::MessagePort::dispatchMessages): Use ExceptionOr.
(WebCore::MessagePort::disentanglePorts): Ditto. Also use a more efficient
idiom that does half as much hashing as the old algorithm, and got rid an
unneeded local variable.
(WebCore::MessagePort::entanglePorts): Use an rvalue reference.
* dom/MessagePort.h: Updated for above changes.
* fileapi/FileReader.cpp:
(WebCore::FileReader::create): Use auto.
(WebCore::FileReader::FileReader): Initialize scalars in the class definition.
(WebCore::FileReader::~FileReader): Call cancel on the loader directly
instead of sharing code with the stop function.
(WebCore::FileReader::stop): Moved the body of the terminate function here.
(WebCore::FileReader::readAsArrayBuffer): Use ExceptionOr.
(WebCore::FileReader::readAsBinaryString): Ditto.
(WebCore::FileReader::readAsText): Ditto.
(WebCore::FileReader::readAsDataURL): Ditto.
(WebCore::FileReader::readInternal): Ditto. Also add a cast now that
we derive privately from FileReaderLoaderClient.
(WebCore::FileReader::abort): Call stop instead of terminate.
(WebCore::FileReader::terminate): Deleted. Moved code into stop.
(WebCore::FileReader::didReceiveData): Moved comment to where the constant is.
* fileapi/FileReader.h: Updated for above changes. Made more functions private
and used final instead of override.
* fileapi/FileReader.idl: Use non-legacy exceptions.
* fileapi/FileReaderSync.cpp:
(WebCore::FileReaderSync::readAsArrayBuffer): Use ExceptionOr.
(WebCore::FileReaderSync::readAsBinaryString): Ditto.
(WebCore::FileReaderSync::readAsText): Ditto.
(WebCore::FileReaderSync::readAsDataURL): Ditto.
(WebCore::FileReaderSync::startLoading): Ditto.
(WebCore::FileReaderSync::startLoadingString): Added. Helper to cut down on
repeated code in functions above.
* fileapi/FileReaderSync.h: Updated for above changes.
* fileapi/FileReaderSync.idl: Use non-legacy exceptions.
* page/Base64Utilities.cpp:
(WebCore::Base64Utilities::btoa): Use ExceptionOr.
(WebCore::Base64Utilities::atob): Ditto.
* page/Base64Utilities.h: Updated for above changes.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::navigator): Pass a reference to the frame.
(WebCore::DOMWindow::postMessage): Use ExceptionOr when calling
MessagePort::disentanglePorts. Also udpated for changes to the
PostMessageTimer.
* page/Navigator.cpp:
(WebCore::Navigator::Navigator): Take a reference.
(WebCore::shouldHideFourDot): Ditto
(WebCore::Navigator::appVersion): Pass a reference.
(WebCore::Navigator::plugins): Return a reference.
(WebCore::Navigator::mimeTypes): Ditto.
* page/Navigator.h: Updated for above changes. Also marked the
class final and moved derivation from RefCounted to NavigatorBase.
* page/NavigatorBase.h: Addded derivation from RefCounted since
both derived classes want that, and the destructor is already virtual.
* page/WindowOrWorkerGlobalScope.idl: Use non-legacy exceptions.
* page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::~WorkerNavigator): Deleted.
* page/WorkerNavigator.h: Moved derivation from RefCounted to
NavigatorBase. Also marked class final.
* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::resolveURL): Use ExceptionOr.
* workers/AbstractWorker.h: Updated for above changes.
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create): Use RefPtr&&
instead of PassRefPtr.
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
Ditto.
(WebCore::DedicatedWorkerGlobalScope::postMessage): Use ExceptionOr.
(WebCore::DedicatedWorkerGlobalScope::importScripts): Ditto.
* workers/DedicatedWorkerGlobalScope.h: Updated for above changes.
* workers/DedicatedWorkerGlobalScope.idl: Use non-legacy exceptions.
* workers/Worker.cpp:
(WebCore::Worker::create): Use ExceptionOr.
(WebCore::Worker::postMessage): Ditto.
* workers/Worker.h: Updated for above changes.
* workers/Worker.idl: Use non-legacy exception.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): Moved initialization
of m_closing to class definition.
(WebCore::WorkerGlobalScope::~WorkerGlobalScope): Removed call to
deleted notifyObserversOfStop function.
(WebCore::WorkerGlobalScope::importScripts): Use ExceptionOr. Also use
reserveInitialCapacity and uncheckedAppend to build a vector.
(WebCore::WorkerGlobalScope::addConsoleMessage): Use an rvalue reference.
Also moved the body of one of the addMessageToWorkerConsole overloads into
one of the overloads of this function, and changed the other to call addMessage.
(WebCore::WorkerGlobalScope::addMessage): Moved the body of the other
addMessageToWorkerConsole here.
(WebCore::WorkerGlobalScope::addMessageToWorkerConsole): Deleted.
(WebCore::WorkerGlobalScope::Observer::Observer): Deleted.
(WebCore::WorkerGlobalScope::Observer::~Observer): Deleted.
(WebCore::WorkerGlobalScope::Observer::stopObserving): Deleted.
(WebCore::WorkerGlobalScope::registerObserver): Deleted.
(WebCore::WorkerGlobalScope::unregisterObserver): Deleted.
(WebCore::WorkerGlobalScope::notifyObserversOfStop): Deleted.
* workers/WorkerGlobalScope.h: Removed unneeded includes. Moved many virtual
function overrides into the private section. Marked many functions final instead
of just override. Removed unused Observer class and m_workerObservers set.
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop): Removed call to deleted
WorkerGlobalScope::notifyObserversOfStop function.
2016-10-21 Antti Koivisto <antti@apple.com>
Tighten ComputedStyleExtractor to use Element instead of Node
https://bugs.webkit.org/show_bug.cgi?id=163798
Reviewed by Andreas Kling.
Also make its functions non-const as they may compute style.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::styleElementForNode):
(WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
If we are called with a Node figure out the style Element in constructor.
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
(WebCore::ComputedStyleExtractor::styledElement):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::copyProperties):
(WebCore::elementOrItsAncestorNeedsStyleRecalc):
Use composed tree iterator for increased correctness in shadow trees.
(WebCore::updateStyleIfNeededForElement):
(WebCore::computeRenderStyleForProperty):
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::customPropertyText):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::CSSComputedStyleDeclaration::item):
(WebCore::ComputedStyleExtractor::propertyMatches):
(WebCore::ComputedStyleExtractor::copyProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
(WebCore::ComputedStyleExtractor::copyPropertiesInSet):
(WebCore::CSSComputedStyleDeclaration::getPropertyValue):
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
(WebCore::ComputedStyleExtractor::styledNode): Deleted.
(WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::updateStyleIfNeededForNode): Deleted.
* css/CSSComputedStyleDeclaration.h:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeEquivalentProperties):
* editing/EditingStyle.h:
2016-10-21 Chris Dumez <cdumez@apple.com>
WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163792
Reviewed by Darin Adler.
WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage3D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
2016-10-21 Zalan Bujtas <zalan@apple.com>
Do not mutate the render tree while collecting selection repaint rects.
https://bugs.webkit.org/show_bug.cgi?id=163800
<rdar://problem/28806886>
Reviewed by David Hyatt.
RenderListItem not only mutates the tree while in layout but it also uses
the old descendant context to find the insertion point.
This patch strictly ensures that we only do it while in layout and never
in other cases such as collecting repaint rects.
This gets redundant when webkit.org/b/163789 is fixed.
Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support horizontal-bt writing mode
https://bugs.webkit.org/show_bug.cgi?id=163797
Reviewed by Zalan Bujtas.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-20 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Correct some memory leaks and other minor bugs
https://bugs.webkit.org/show_bug.cgi?id=163769
Reviewed by Alex Christensen.
Several D2D handles were being leaked.
Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
would be drawn.
Tested by existing layout tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/FloatRectDirect2D.cpp:
(WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
(WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
we use inside WebKit.
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill): Don't terminate on this error case.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient): Don't leak gradients.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
(WebCore::GraphicsContext::brushWithColor): Added.
(WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
in the right order (hint: it's not distributive).
(WebCore::GraphicsContext::drawWithShadow): Use convenience method.
(WebCore::GraphicsContext::fillRect): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::clearRect): Ditto.
(WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
(WebCore::GraphicsContext::setPlatformFillColor): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::polygonPathFromPoints): No need to convert manually.
(WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
(WebCore::Path::appendGeometry): Ditto.
(WebCore::Path::createGeometryWithFillMode): Ditto.
(WebCore::Path::Path): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::strokeBoundingRect): Provide an implementation.
(WebCore::Path::addRect): No need for manual casting here.
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Fix minor style issue in the signature of StaticRange::create
https://bugs.webkit.org/show_bug.cgi?id=163786
<rdar://problem/28853079>
Reviewed by Alex Christensen.
Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.
* dom/StaticRange.cpp:
(WebCore::StaticRange::create):
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for -webkit-line-box-contain
https://bugs.webkit.org/show_bug.cgi?id=163794
Reviewed by Zalan Bujtas.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLineBoxContain):
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-21 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Add support for @-webkit-region rules
https://bugs.webkit.org/show_bug.cgi?id=163787
Reviewed by Zalan Bujtas.
* css/StyleRule.cpp:
(WebCore::StyleRuleRegion::StyleRuleRegion):
* css/StyleRule.h:
* css/parser/CSSAtRuleID.cpp:
(WebCore::cssAtRuleID):
* css/parser/CSSAtRuleID.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeAtRule):
(WebCore::CSSParserImpl::consumePageRule):
(WebCore::CSSParserImpl::consumeRegionRule):
* css/parser/CSSParserImpl.h:
2016-10-21 David Kilzer <ddkilzer@apple.com>
Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
<https://webkit.org/b/163757>
Reviewed by Brent Fulgham.
No new tests since there is no change in nominal behavior.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
IntSize::unclampedArea() where manual calculations were used
previously. Also gets rid of more safeCast<size_t>() use.
2016-10-21 Chris Dumez <cdumez@apple.com>
[Web IDL] Support unions in our overload resolution algorithm
https://bugs.webkit.org/show_bug.cgi?id=163764
Reviewed by Darin Adler.
Support unions in our overload resolution algorithm as per:
- https://heycam.github.io/webidl/#es-overloads
- https://heycam.github.io/webidl/#dfn-distinguishable
* bindings/scripts/CodeGeneratorJS.pm:
(IsIDLTypeDistinguishableWithUnionForOverloadResolution):
(AreTypesDistinguishableForOverloadResolution):
(GetOverloadThatMatches):
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
2016-10-21 Chris Dumez <cdumez@apple.com>
AudioNode.connect(): First parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=163773
Reviewed by Darin Adler.
AudioNode.connect()'s first parameter should not be nullable:
- https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.
We were throwing a SYNTAX_ERR when passing null, we now throw
a TypeError instead.
No new tests, updated existing test.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect):
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect):
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNode.idl:
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Implement InputEvent.getTargetRanges() for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162947
<rdar://problem/28853079>
Reviewed by Darin Adler.
Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
an editing command on a contenteditable area.
Tests: fast/events/before-input-delete-empty-list-target-ranges.html
fast/events/before-input-delete-text-target-ranges.html
fast/events/before-input-replace-text-target-ranges.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
(WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
* dom/DOMAllInOne.cpp:
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
* dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
(WebCore::StaticRange::StaticRange):
(WebCore::StaticRange::create):
(WebCore::StaticRange::createFromRange):
Convenience method for creating a StaticRange from a Range's start/end container and offset.
(WebCore::StaticRange::startContainer):
(WebCore::StaticRange::endContainer):
(WebCore::StaticRange::collapsed):
* dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
(WebCore::StaticRange::startOffset):
(WebCore::StaticRange::endOffset):
* dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::targetRanges):
Virtual method that returns a list of target ranges which are associated with this command.
(WebCore::CompositeEditCommand::targetRangesForBindings):
Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
a textarea or plain text input into account.
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/EditCommand.cpp:
(WebCore::EditCommand::frame):
* editing/EditCommand.h:
(WebCore::EditCommand::document):
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
the default action.
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
TypingCommand).
* editing/Editor.h:
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::targetRanges):
* editing/ReplaceRangeWithTextCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::targetRanges):
* editing/SpellingCorrectionCommand.h:
* editing/TypingCommand.cpp:
(WebCore::editActionIsDeleteByTyping):
(WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
(WebCore::TypingCommand::willApplyCommand):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
* editing/TypingCommand.h:
2016-10-21 Antti Koivisto <antti@apple.com>
Style resolver should be updated lazily
https://bugs.webkit.org/show_bug.cgi?id=163721
Reviewed by Andreas Kling.
Currently when stylesheets change in some way we generally update style resolvers and
invalidate style immediately. We should do this lazily to avoid unnecessary work.
Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::updateStyleIfNeededForNode):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::setDisabled):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
Initialize root style font with null font selector.
This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
media query evaluation requires font information before it is ready.
Exposed by increased laziness in this patch.
* dom/Document.cpp:
(WebCore::Document::setContentLanguage):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::didInsertInDocumentShadowRoot):
(WebCore::Document::didRemoveInDocumentShadowRoot):
* dom/Document.h:
(WebCore::Document::inDocumentShadowRoots):
Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
* dom/Element.cpp:
(WebCore::Element::computedStyle):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
(WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
Since updates are now done lazily we don't need a special timer for extension stylesheets.
* dom/ExtensionStyleSheets.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::insertedInto):
(WebCore::ShadowRoot::removedFrom):
(WebCore::ShadowRoot::styleScope):
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp:
(WebCore::Style::Scope::setPreferredStylesheetSetName):
(WebCore::Style::Scope::setSelectedStylesheetSetName):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::flushPendingUpdate):
Also flush descendant shadow roots.
(WebCore::Style::Scope::scheduleUpdate):
(WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
Make lazy.
(WebCore::Style::Scope::didChangeStyleSheetContents):
Make lazy.
(WebCore::Style::Scope::didChangeStyleSheetEnvironment):
Environment changes also affect author shadow roots.
(WebCore::Style::Scope::styleSheetsForStyleSheetList):
(WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
(WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
(WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
* style/StyleScope.h:
(WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
(WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
(WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
inserted stylesheets. Previously this was racy and the patch affected order of things.
(WebCore::Internals::styleChangeType):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):
2016-10-21 Xabier Rodriguez Calvar <calvaris@igalia.com> and Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
https://bugs.webkit.org/show_bug.cgi?id=163778
Reviewed by Philippe Normand.
Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
No change of behavior.
* PlatformGTK.cmake:
* platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
(WebCore::SDPProcessorScriptResource::scriptString): Deleted.
* platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
(WebCore::SDPProcessorScriptResource::scriptString):
2016-10-21 Miguel Gomez <magomez@igalia.com>
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
https://bugs.webkit.org/show_bug.cgi?id=163511
Reviewed by Carlos Garcia Campos.
Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
RenderVideo, even when accelerated compositing is enabled.
Covered by existent tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2016-10-21 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
https://bugs.webkit.org/show_bug.cgi?id=163327
Reviewed by Philippe Normand.
Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
is still done with MockMediaEndpoint.
[1] http://www.openwebrtc.org/
Testing: Added manual test (webrtc-one-tab-p2p.html)
* CMakeLists.txt:
* platform/GStreamer.cmake:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
(WebCore::createMediaEndpointOwr):
(WebCore::MediaEndpointOwr::MediaEndpointOwr):
(WebCore::MediaEndpointOwr::~MediaEndpointOwr):
(WebCore::MediaEndpointOwr::setConfiguration):
(WebCore::cryptoDataCallback):
(WebCore::MediaEndpointOwr::generateDtlsInfo):
(WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
(WebCore::payloadsContainType):
(WebCore::MediaEndpointOwr::filterPayloads):
(WebCore::MediaEndpointOwr::updateReceiveConfiguration):
(WebCore::findRtxPayload):
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::addRemoteCandidate):
(WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
(WebCore::MediaEndpointOwr::createMutedRemoteSource):
(WebCore::MediaEndpointOwr::replaceSendSource):
(WebCore::MediaEndpointOwr::stop):
(WebCore::MediaEndpointOwr::transceiverIndexForSession):
(WebCore::MediaEndpointOwr::sessionMid):
(WebCore::MediaEndpointOwr::matchTransceiverByMid):
(WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
(WebCore::MediaEndpointOwr::dispatchGatheringDone):
(WebCore::MediaEndpointOwr::processIceTransportStateChange):
(WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
(WebCore::MediaEndpointOwr::unmuteRemoteSource):
(WebCore::MediaEndpointOwr::prepareSession):
(WebCore::MediaEndpointOwr::prepareMediaSession):
(WebCore::parseHelperServerUrl):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
(WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
(WebCore::gotCandidate):
(WebCore::candidateGatheringDone):
(WebCore::iceConnectionStateChange):
(WebCore::gotIncomingSource):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
(WebCore::OwrTransceiver::create):
(WebCore::OwrTransceiver::~OwrTransceiver):
(WebCore::OwrTransceiver::mid):
(WebCore::OwrTransceiver::session):
(WebCore::OwrTransceiver::owrIceState):
(WebCore::OwrTransceiver::setOwrIceState):
(WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
(WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
(WebCore::OwrTransceiver::OwrTransceiver):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
(WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
Add support for an initially muted source. This is used for early
creation of remote sources.
2016-10-21 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Content Alignment broken with indefinite sized grid container
https://bugs.webkit.org/show_bug.cgi?id=163724
Reviewed by Manuel Rego Casasnovas.
The Grid Tracks sizing algorithm receives as parameter the
available space to be used as space for tracks. We hold a variable
to store the remaining free space for each dimension.
When the grid container size is indefinite we can't compute the
available free space after computing track sizes until such
indefinite size is resolved.
No new tests, just added some additional test cases.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
after doing layout and resolving the indefinite height.
2016-10-21 Jer Noble <jer.noble@apple.com>
CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
https://bugs.webkit.org/show_bug.cgi?id=163735
Reviewed by Eric Carlson.
Test: media/media-source/media-source-sample-wrong-track-id.html
When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
object to contain that track's samples. One of the fields in TrackBuffer, description, is
normally filled out when an initialization segment is received, but with this default
TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
Rather than adding a null-check on trackBuffer.description, drop any sample that has a
trackID which was not present during a previous initialization segment.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Configures but fails to link with ENABLE_OPENGL=OFF
https://bugs.webkit.org/show_bug.cgi?id=163449
Reviewed by Michael Catanzaro.
Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::~PlatformDisplayX11):
2016-10-20 Filip Pizlo <fpizlo@apple.com>
The tracking of the coarse-grain Heap state (allocating or not, collector or not, eden vs full) should respect the orthogonality between allocating and collecting
https://bugs.webkit.org/show_bug.cgi?id=163738
Reviewed by Geoffrey Garen.
No new tests because no change in behavior.
* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectNow):
2016-10-20 Chris Dumez <cdumez@apple.com>
[Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
https://bugs.webkit.org/show_bug.cgi?id=163767
Reviewed by Darin Adler.
Start using signature->idlType instead of signature->type in the overload resolution code
to prepare for union type support.
* bindings/scripts/CodeGeneratorJS.pm:
(ComputeEffectiveOverloadSet):
(AreTypesDistinguishableForOverloadResolution):
(GetDistinguishingArgumentIndex):
(GetOverloadThatMatches):
(GenerateOverloadedFunctionOrConstructor):
2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
Implement WebGL2 bufferData() and bufferSubData() methods
https://bugs.webkit.org/show_bug.cgi?id=163759
Reviewed by Dean Jackson.
These new overloads simply clip the input array buffer.
Test: fast/canvas/webgl/bufferData-offset-length.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
2016-10-20 Chris Dumez <cdumez@apple.com>
"Download Linked File" context menu action should use 'download' attribute as suggested filename
https://bugs.webkit.org/show_bug.cgi?id=163742
<rdar://problem/28840734>
Reviewed by Darin Adler.
Add convenience method to HitTestResult to return the URL element's
download attribute.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::URLElementDownloadAttribute):
* rendering/HitTestResult.h:
2016-10-20 Nan Wang <n_wang@apple.com>
AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
https://bugs.webkit.org/show_bug.cgi?id=163763
Reviewed by Chris Fleizach.
Test: accessibility/mac/aria-tree-with-presentation-role.html
Web authors sometimes use presentation role in the aria tree to hide elements. We should
consider this a valid case if they specify tree items and groups correctly.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
* accessibility/AccessibilityTree.cpp:
(WebCore::AccessibilityTree::nodeHasTreeItemChild):
(WebCore::AccessibilityTree::isTreeValid):
* accessibility/AccessibilityTree.h:
2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
Many WebGL functions which don't throw are marked as possibly throwing
https://bugs.webkit.org/show_bug.cgi?id=163747
Reviewed by Dean Jackson.
Mechanically remove the exception code.
No new tests because there is no behavior change.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::JSWebGLRenderingContextBase::getUniform):
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::activeTexture):
(WebCore::WebGLRenderingContextBase::attachShader):
(WebCore::WebGLRenderingContextBase::bindAttribLocation):
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::bindFramebuffer):
(WebCore::WebGLRenderingContextBase::bindRenderbuffer):
(WebCore::WebGLRenderingContextBase::bindTexture):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::compileShader):
(WebCore::WebGLRenderingContextBase::createShader):
(WebCore::WebGLRenderingContextBase::detachShader):
(WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):
(WebCore::WebGLRenderingContextBase::getActiveAttrib):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
(WebCore::WebGLRenderingContextBase::getBufferParameter):
(WebCore::WebGLRenderingContextBase::getProgramParameter):
(WebCore::WebGLRenderingContextBase::getProgramInfoLog):
(WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
(WebCore::WebGLRenderingContextBase::getShaderParameter):
(WebCore::WebGLRenderingContextBase::getShaderInfoLog):
(WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
(WebCore::WebGLRenderingContextBase::getShaderSource):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::linkProgram):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::shaderSource):
(WebCore::WebGLRenderingContextBase::videoFrameToImage):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::uniform1f):
(WebCore::WebGLRenderingContextBase::uniform1fv):
(WebCore::WebGLRenderingContextBase::uniform1i):
(WebCore::WebGLRenderingContextBase::uniform1iv):
(WebCore::WebGLRenderingContextBase::uniform2f):
(WebCore::WebGLRenderingContextBase::uniform2fv):
(WebCore::WebGLRenderingContextBase::uniform2i):
(WebCore::WebGLRenderingContextBase::uniform2iv):
(WebCore::WebGLRenderingContextBase::uniform3f):
(WebCore::WebGLRenderingContextBase::uniform3fv):
(WebCore::WebGLRenderingContextBase::uniform3i):
(WebCore::WebGLRenderingContextBase::uniform3iv):
(WebCore::WebGLRenderingContextBase::uniform4f):
(WebCore::WebGLRenderingContextBase::uniform4fv):
(WebCore::WebGLRenderingContextBase::uniform4i):
(WebCore::WebGLRenderingContextBase::uniform4iv):
(WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
(WebCore::WebGLRenderingContextBase::useProgram):
(WebCore::WebGLRenderingContextBase::validateProgram):
(WebCore::WebGLRenderingContextBase::vertexAttribPointer):
(WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
(WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374
Reviewed by Darin Adler.
Because of platform lack of support for variations in in-memory fonts,
this feature should be disabled on the affected OSes.
No tests because there is no behavior change (on the relevant platforms).
* Configurations/FeatureDefines.xcconfig:
2016-10-20 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore name assignment.
<rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
Reviewed by Alex Christensen.
Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
storage/indexeddb/modern/objectstore-rename-1.html
Touches a *lot* of code sites, but none of them are particularly interesting.
They are all just getting the new name spread out to all of the various objects that need it.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::renameObjectStore):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::renameObjectStoreOnServer):
(WebCore::IDBTransaction::didRenameObjectStoreOnServer):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::renameObjectStore):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.h:
(WebCore::IDBServer::MemoryObjectStore::rename):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::renameObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::rename):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::renameObjectStoreSuccess):
* Modules/indexeddb/shared/IDBResultData.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didRenameObjectStore):
(WebCore::InProcessIDBServer::renameObjectStore):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2016-10-20 Chris Dumez <cdumez@apple.com>
Make table.deleteRow(-1) a no-op when there are no rows
https://bugs.webkit.org/show_bug.cgi?id=163746
Reviewed by Alex Christensen.
Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
- https://github.com/whatwg/html/pull/1924
This is more consistent with the behavior of tbody.deleteRow(-1) and
tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
same change via:
- https://codereview.chromium.org/2427963004/
No new tests, updated existing tests.
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::deleteRow):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Make sure to handle prefixed transform-style
https://bugs.webkit.org/show_bug.cgi?id=163756
Reviewed by Dean Jackson.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix crash when parsing -webkit-margin-collapse
https://bugs.webkit.org/show_bug.cgi?id=163753
Reviewed by Dean Jackson.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
2016-10-20 Chris Dumez <cdumez@apple.com>
Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
https://bugs.webkit.org/show_bug.cgi?id=163715
Reviewed by Darin Adler.
Enable strict type checking for typed arrays in the bindings, similarly
do what we do for other wrapper types, as per Web IDL.
No new tests, updated existing tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):
2016-10-20 Myles C. Maxfield <mmaxfield@apple.com>
Improve error message when passing a null ArrayBuffer to bufferData()
https://bugs.webkit.org/show_bug.cgi?id=163745
Reviewed by Dean Jackson.
Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
Update the idl file to accept a nullable ArrayBuffer, and throw
the relevant error with a more helpful error string.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
2016-10-20 Zalan Bujtas <zalan@apple.com>
Stop searching for first-letter containers at multi-column boundary.
https://bugs.webkit.org/show_bug.cgi?id=163739
<rdar://problem/28810750>
We should not cross the multi-column boundary while searching for the first-letter container.
While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
container and end up adding a new wrapper under the original container (from where we are moving the renderers).
Reviewed by David Hyatt.
Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
2016-10-19 Dean Jackson <dino@apple.com>
Support CSS Shapes Level 1 without a prefix
https://bugs.webkit.org/show_bug.cgi?id=163709
<rdar://problem/28859369>
Reviewed by Myles Maxfield.
Support the unprefixed form of CSS Shapes, now that
it is in CR.
We have a few failing tests:
- Some image-based shaping failures, now skipped.
https://bugs.webkit.org/show_bug.cgi?id=163706
- Some false negatives, where my understanding
of the CSS OM seems to suggest that the W3C tests
are incorrect.
https://bugs.webkit.org/show_bug.cgi?id=163708
Tests: imported/w3c/csswg-test/css-shapes-1
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix region, column and page break parsing
https://bugs.webkit.org/show_bug.cgi?id=163743
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add the missing values for break support.
* css/parser/CSSPropertyParser.cpp:
(WebCore::isLegacyBreakProperty):
(WebCore::CSSPropertyParser::parseValueStart):
Add a special case for handling legacy break properties. Blink treats them like
shorthands, but we can't do that without breaking the old parser, so for now
we add a special case.
(WebCore::mapFromPageBreakBetween):
(WebCore::mapFromColumnBreakBetween):
(WebCore::mapFromRegionBreakBetween):
Updated to have the AvoidXXX values (where XXX is Column/Page/Region).
(WebCore::CSSPropertyParser::parseShorthand):
Remove the consumeLegacyBreak from the shorthand function, since we can't treat
the legacy break properties as shorthands yet.
2016-10-20 Sam Weinig <sam@webkit.org>
Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
https://bugs.webkit.org/show_bug.cgi?id=163713
Reviewed by Dan Bernstein.
Switch uses of WTF::visit to use WTF::switchOn.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source):
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* testing/TypeConversions.h:
(WebCore::TypeConversions::typeConversionsDictionaryUnionType):
2016-10-20 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix font family parsing and add CSS region property parsing
https://bugs.webkit.org/show_bug.cgi?id=163741
Reviewed by Zalan Bujtas.
* css/parser/CSSParser.cpp:
(WebCore::isKeywordPropertyID):
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValue):
Modify the old CSSParser to have its own keyword check, since keywords were
incorrectly added to the new parser when this check was consolidated. Column
and region breaks are considered keyword properties by the old parser, but
not by the new parser, since the new parser special cases them and maps them
into the generic break property.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Update for regions to make sure all the region properties are there. Remove the
column and region break properties, since they're not supposed to be here in the
new parser.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFamilyName):
Fix font parsing to make font family values so that fonts work.
(WebCore::consumeFlowProperty):
Add a function for handling -webkit-flow-from and -webkit-flow-into.
(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the region properties.
(WebCore::mapFromRegionBreakBetween):
(WebCore::mapFromColumnRegionOrPageBreakInside):
(WebCore::mapFromLegacyBreakProperty):
(WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
(WebCore::mapFromColumnOrPageBreakInside): Deleted.
Update to handle the region break properties in the same way that column break
properties are handled.
2016-10-20 Jer Noble <jer.noble@apple.com>
CRASH in WebCore::MediaSource::seekToTime + 185
https://bugs.webkit.org/show_bug.cgi?id=163652
Reviewed by Eric Carlson.
Test: media/media-source/media-source-seek-detach-crash.html
Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
dereferenced. The one place where m_private is cleared without setting the state to closed
is stop(), so make stop() set the state to closed as well (without firing any events).
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::completeSeek):
(WebCore::MediaSource::monitorSourceBuffers):
(WebCore::MediaSource::streamEndedWithError):
(WebCore::MediaSource::stop):
2016-10-20 Andreas Kling <akling@apple.com>
Drop StyleResolver and SelectorQueryCache when entering PageCache.
<https://webkit.org/b/154238>
Reviewed by Antti Koivisto.
Stop keeping these around for cached pages to save lots of memory.
We can easily rebuild them if a cached navigation occurs, and this
way we also don't need to worry about invalidating style for cached
pages in all the right places.
Restoring a cached page will now lead to a forced style recalc.
We don't try to defer this (beyond a zero-timer) since it's going
to happen anyway, and it's nicer to front-load the cost rather than
stuttering on the first user content interaction.
* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
(WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
(WebCore::CachedPage::markForFullStyleRecalc): Deleted.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
(WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
* history/PageCache.h:
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Page.cpp:
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::setPagination):
(WebCore::Page::setPaginationLineGridEnabled):
(WebCore::Page::setVisitedLinkStore):
2016-10-20 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] Build fix after r207616
https://bugs.webkit.org/show_bug.cgi?id=163333
Reviewed by Carlos Garcia Campos.
EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::initializeEGLDisplay):
2016-10-20 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] CMake does not support the dep files for implicit dependency
https://bugs.webkit.org/show_bug.cgi?id=161433
Reviewed by Brent Fulgham.
Created a Perl script to generate all IDL bindings for CMake.
This script can regenerate outdated bindings by based on the
supplemental dependency and dep files created by
'--write-dependencies' switch of generate-bindings.pl.
add_custom_target is used to invoke the script instead of
add_custom_command because Ninja deletes all output files before
executing the command in case of add_custom_command.
USES_TERMINAL option of add_custom_target has two effects:
1) Not buffering output of the command
2) Invoking the command in the special Ninja pool which inhibits parallel build
One needs to use CMake 3.2 or later to enable this feature.
* CMakeLists.txt: Specified target names for
GENERATE_BINDINGS. Added dependency for the targets.
* bindings/scripts/generate-bindings-all.pl: Added.
2016-10-20 Adam Jackson <ajax@redhat.com>
Prefer eglGetPlatformDisplay to eglGetDisplay
https://bugs.webkit.org/show_bug.cgi?id=163333
Reviewed by Carlos Garcia Campos.
eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
what kind of display it is, so let's use it.
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::initializeEGLDisplay):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Avoid including egl.h headers in internal headers
https://bugs.webkit.org/show_bug.cgi?id=163722
Reviewed by Žan Doberšek.
egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::~GLContextEGL):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWayland.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceWayland):
(WebCore::GLContextEGL::createWaylandContext):
(WebCore::GLContextEGL::destroyWaylandWindow):
* platform/graphics/egl/GLContextEGLX11.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceX11):
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::createWindowContext):
(WebCore::GLContextGLX::createContext):
(WebCore::GLContextGLX::GLContextGLX):
* platform/graphics/glx/GLContextGLX.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
* platform/graphics/x11/PlatformDisplayX11.cpp:
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Avoid strstr() when checking (E)GL extensions
https://bugs.webkit.org/show_bug.cgi?id=161958
Reviewed by Žan Doberšek.
Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
list, and use it instead of strstr().
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::isExtensionSupported):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createSurfacelessContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::hasSGISwapControlExtension):
2016-10-20 Per Arne Vollan <pvollan@apple.com>
[Win][Direct2D] Implement ImageBufferData::getData.
https://bugs.webkit.org/show_bug.cgi?id=163668
Reviewed by Brent Fulgham.
Render data to a bitmap in system memory, which data can be read from.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
Wrong use of EGL_DEPTH_SIZE
https://bugs.webkit.org/show_bug.cgi?id=155536
Reviewed by Michael Catanzaro.
What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
* PlatformEfl.cmake: Add new file to compilation.
* PlatformGTK.cmake: Ditto.
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
* platform/graphics/x11/XErrorTrapper.cpp: Added.
(WebCore::xErrorTrappersMap):
(WebCore::XErrorTrapper::XErrorTrapper):
(WebCore::XErrorTrapper::~XErrorTrapper):
(WebCore::XErrorTrapper::errorCode):
(WebCore::XErrorTrapper::errorEvent):
* platform/graphics/x11/XErrorTrapper.h: Added.
(WebCore::XErrorTrapper::XErrorTrapper):
2016-10-20 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
https://bugs.webkit.org/show_bug.cgi?id=146232
Update MediaStreamTrackEvent IDL as per specification.
Reviewed by Darin Adler.
No additional test required, rebase existings tests.
* Modules/mediastream/MediaStreamTrackEvent.idl:
2016-10-19 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: mute support
https://bugs.webkit.org/show_bug.cgi?id=163677
<rdar://problem/28851582>
Reviewed by Dean Jackson.
We introduce the MuteSupport class which brings support for muting the media
by clicking on the mute button in the media controls and correctly reflecting
the media's muted state should the media be muted via the media API.
Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
media/modern-media-controls/mute-support/mute-support-media-api.html
media/modern-media-controls/mute-support/mute-support-muted.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(MuteSupport.prototype.get control):
(MuteSupport.prototype.get mediaEvents):
(MuteSupport.prototype.buttonWasClicked):
(MuteSupport.prototype.syncControl):
(MuteSupport):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-19 Alex Christensen <achristensen@webkit.org>
Revert r207151
https://bugs.webkit.org/show_bug.cgi?id=163675
Reviewed by Brent Fulgham.
This code is still useful for comparison with Windows. I'll remove it again soon.
No new tests. No change in behavior.
* WebCore.xcodeproj/project.pbxproj:
* WebCorePrefix.h:
* loader/DocumentLoader.h:
* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cf/ResourceLoaderCFNet.cpp:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponse):
* loader/mac/DocumentLoaderMac.cpp:
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponse):
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
(WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
* platform/mac/WebCoreSystemInterface.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ProtectionSpace.h:
* platform/network/ProtectionSpaceBase.cpp:
* platform/network/ResourceHandle.cpp:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/ResourceRequestBase.cpp:
* platform/network/cf/AuthenticationCF.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
(WebCore::AuthenticationChallenge::authenticationClient): Deleted.
(WebCore::AuthenticationChallenge::platformCompare): Deleted.
(WebCore::createCF): Deleted.
(WebCore::core): Deleted.
* platform/network/cf/AuthenticationCF.h:
* platform/network/cf/AuthenticationChallenge.h:
* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage):
(WebCore::CredentialStorage::saveToPersistentStorage):
* platform/network/cf/LoaderRunLoopCF.cpp:
* platform/network/cf/LoaderRunLoopCF.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStorage):
* platform/network/cf/ProtectionSpaceCFNet.cpp:
* platform/network/cf/ProtectionSpaceCFNet.h:
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::shouldSniffConnectionProperty):
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::unschedule):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cf/ResourceResponse.h:
* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::cfURLResponse):
* platform/network/cf/SynchronousLoaderClientCFNet.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/cocoa/CredentialCocoa.h:
* platform/network/cocoa/CredentialCocoa.mm:
(WebCore::Credential::Credential):
(WebCore::Credential::cfCredential):
* platform/network/cocoa/ProtectionSpaceCocoa.h:
* platform/network/cocoa/ProtectionSpaceCocoa.mm:
(WebCore::ProtectionSpace::ProtectionSpace):
(WebCore::ProtectionSpace::cfSpace):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::nsURLRequest):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo):
(WebCore::ResourceResponse::nsURLResponse):
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/ios/QuickLook.h:
* platform/network/ios/QuickLook.mm:
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
(-[WebQuickLookHandleAsDelegate detachHandle]):
(WebCore::QuickLookHandle::create):
(WebCore::QuickLookHandle::cfResponse):
* platform/network/mac/AuthenticationMac.mm:
(-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
(-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
(WebCore::core):
(WebCore::mac):
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
(WebCore::addCookie):
(WebCore::cookieStorage):
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/FormDataStreamMac.h:
* platform/network/mac/FormDataStreamMac.mm:
* platform/network/mac/ResourceErrorMac.mm:
(NSErrorFromCFError):
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::nsError):
(WebCore::ResourceError::operator NSError *):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/ResourceRequestMac.mm: Added.
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::updateNSURLRequest):
* platform/network/mac/SynchronousLoaderClient.mm:
* platform/network/mac/WebCoreResourceHandleAsDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
* platform/network/mac/WebCoreURLResponse.mm:
* platform/win/TemporaryLinkStubs.cpp:
* testing/js/WebCoreTestSupportPrefix.h:
2016-10-19 Jer Noble <jer.noble@apple.com>
REGRESSION (r206025): All YouTube videos play with black bars on all four sides
https://bugs.webkit.org/show_bug.cgi?id=163308
Reviewed by Darin Adler.
Test: media/media-source/media-source-resize.html
After r206025, we do not fire resize events when the size change notification happens equal-
to-or-before the current time, which can happen at the very beginning of a stream. Take care
of this case by checking that the target time isn't actually in the past inside of
sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
previous size (such as after a flush due to a seek).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2016-10-19 Nan Wang <n_wang@apple.com>
AX: [Mac] Mark element AXAPI should comform to specs
https://bugs.webkit.org/show_bug.cgi?id=163707
Reviewed by Chris Fleizach.
Created a new role for mark elements on Mac and exposed the role
description.
Changes are covered in modified test expectaions.
* English.lproj/Localizable.strings:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXMarkText):
* platform/LocalizedStrings.h:
2016-10-19 Alex Christensen <achristensen@webkit.org>
Re-enable URLParser for non-Safari Cocoa apps after r207321
https://bugs.webkit.org/show_bug.cgi?id=163690
Reviewed by Darin Adler.
I disabled the URLParser for non-Safari applications in r207305
to give me time to make URLParser more compatible, which I did in r207321
Updated some API tests which will be investigated in
https://bugs.webkit.org/show_bug.cgi?id=163127
* platform/URLParser.cpp:
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setURLParserEnabled): Deleted.
* testing/js/WebCoreTestSupport.h:
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
CSS font-variation-settings does not handle uppercase axis names in variable fonts
https://bugs.webkit.org/show_bug.cgi?id=163546
Reviewed by Dean Jackson.
Remove the extra toASCIILower() call.
Test: fast/text/variations/case-axis-names.html
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontVariationTag):
2016-10-19 Anders Carlsson <andersca@apple.com>
Remove m_redirectURLs from HistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163704
Reviewed by Dan Bernstein.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
* history/HistoryItem.h:
2016-10-19 Joone Hur <joone.hur@intel.com>
Add a plain space instead of between text nodes
https://bugs.webkit.org/show_bug.cgi?id=123163
Reviewed by Ryosuke Niwa.
When we rebalance white spaces, can be added as space
under some conditions. This patch adds a condition that the next
sibling text node should not exist.
No new tests, updated existing test.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
* editing/htmlediting.cpp:
(WebCore::stringWithRebalancedWhitespace):
* editing/htmlediting.h:
2016-10-19 Sam Weinig <sam@webkit.org>
Add support for sequences and dictionaries in unions
https://bugs.webkit.org/show_bug.cgi?id=163695
Reviewed by Chris Dumez.
Tests:
- Updated js/dom/webidl-type-mapping.html
* bindings/generic/IDLTypes.h:
Add additional helper predicates and fix formatting.
* bindings/js/JSDOMBinding.h:
Export hasIteratorMethod for use in testing.
* bindings/js/JSDOMConvert.h:
- Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
- Add support for unions conversion step 12 (parts 1-3).
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
Support complex default value computations for unions using the convert infrastructure.
(GenerateParametersCheck):
(GenerateConstructorDefinition):
Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update bindings test results.
* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):
(WebCore::TypeConversions::typeConversionsDictionaryLongValue):
(WebCore::TypeConversions::typeConversionsDictionaryStringValue):
(WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
(WebCore::TypeConversions::typeConversionsDictionaryUnionType):
* testing/TypeConversions.idl:
Add some complex types to allow testing IDL conversions from tests.
2016-10-19 Ryosuke Niwa <rniwa@webkit.org>
Annotate more DOM and HTML IDLs with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163653
Reviewed by Darin Adler.
Added CEReactions to more IDL files.
Test: fast/custom-elements/reactions-for-webkit-extensions.html
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
adding CEReactions in IDL.
(WebCore::JSDOMStringMap::putDelegate): Ditto.
* dom/Document.idl:
* dom/Element.idl:
* html/HTMLElement.idl:
* page/DOMSelection.idl:
2016-10-19 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207557.
This change caused animations/font-variations tests to time
out on pre-Sierra Macs.
Reverted changeset:
"[macOS] [iOS] Disable variation fonts on macOS El Capitan and
iOS 9"
https://bugs.webkit.org/show_bug.cgi?id=163374
http://trac.webkit.org/changeset/207557
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Support -webkit-border-fit
https://bugs.webkit.org/show_bug.cgi?id=163687
Reviewed by Zalan Bujtas.
Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
https://bugs.webkit.org/show_bug.cgi?id=163685
Reviewed by Zalan Bujtas.
Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
that the old parser did and lowercase the class and ids in place.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
2016-10-19 Nan Wang <n_wang@apple.com>
AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
https://bugs.webkit.org/show_bug.cgi?id=163682
Reviewed by Chris Fleizach.
There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
Test: accessibility/mac/search-predicate-crash.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::findMatchingObjects):
2016-10-19 David Kilzer <ddkilzer@apple.com>
Bug 163670: Refine assertions in WebCore::ImageData constructors
<https://webkit.org/b/163670>
<rdar://problem/27497338>
Reviewed by Brent Fulgham.
No new tests because there is no change in nominal behavior.
* html/ImageData.cpp:
(WebCore::ImageData::ImageData(const IntSize&)): Change to use
ASSERT() since the worst-case scenario here is a nullptr deref.
Switch to IntSize::area() to compute the area.
(WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
Add ASSERT() identical to the previous constructor, and change
ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
not nullptr and the length check fails. Switch to
IntSize::area() to compute the area.
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374
Reviewed by Darin Adler.
Because of platform lack of support for variations in in-memory fonts,
this feature should be disabled on the affected OSes.
No tests because there is no behavior change (on the relevant platforms).
* Configurations/FeatureDefines.xcconfig:
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix background-position parsing
https://bugs.webkit.org/show_bug.cgi?id=163681
Reviewed by Dean Jackson.
The new parser has a more efficient parsed representation of background positions. When
background-position is "center" or when no length unit is specified for a dimension,
then rather than creating a pair, the new parser makes a singleton primitive value.
Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
(top,50%) as appropriate and also handling top/left without any associated length.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
2016-10-19 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Media Controller: click-to-start support
https://bugs.webkit.org/show_bug.cgi?id=163659
<rdar://problem/28845656>
Reviewed by Dean Jackson.
We introduce the MediaControllerSupport class which will allow a number of media controller
features to be implemented by subclasses each devoted to implementing a specific subset of
media controller features. With this bug, we add the correct behavior for click-to-start,
only showing the start button under the right circumstances.
A MediaController object indicates which media control to attach click event listeners to
through the `control` property, and a list of media events it should register on the media
element through the `mediaEvents` property. Then, as the user interacts with the specified
control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
methods are called to allow for the media state to be correctly set and represented in the
media controls. Custom event handling for the specified events can also be achieved by
subclassing the `handleEvent()` method.
Tests: media/modern-media-controls/start-support/start-support-audio.html
media/modern-media-controls/start-support/start-support-autoplay.html
media/modern-media-controls/start-support/start-support-click-to-start.html
media/modern-media-controls/start-support/start-support-error.html
media/modern-media-controls/start-support/start-support-fullscreen.html
media/modern-media-controls/start-support/start-support-manual-play.html
media/modern-media-controls/start-support/start-support-no-source.html
* Modules/modern-media-controls/media/media-controller-support.js: Added.
(MediaControllerSupport):
(MediaControllerSupport.prototype.get control):
(MediaControllerSupport.prototype.get mediaEvents):
(MediaControllerSupport.prototype.buttonWasClicked):
(MediaControllerSupport.prototype.handleEvent):
(MediaControllerSupport.prototype.syncControl):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.buttonWasClicked): Deleted.
* Modules/modern-media-controls/media/start-support.js: Added.
(StartSupport.prototype.get control):
(StartSupport.prototype.get mediaEvents):
(StartSupport.prototype.buttonWasClicked):
(StartSupport.prototype.handleEvent):
(StartSupport.prototype.syncControl):
(StartSupport.prototype._shouldShowStartButton):
(StartSupport):
2016-10-19 Aaron Chu <aaron_chu@apple.com>
Web Inspector: AXI: expose computed tree node and heading level
https://bugs.webkit.org/show_bug.cgi?id=130825
<rdar://problem/16442349>
Reviewed by Joseph Pecoraro.
Exposing two new accessibility properties: Heading Level and Hierarchical Level.
Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-10-19 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Implement MediaEndpointPeerConnection::stop()
https://bugs.webkit.org/show_bug.cgi?id=163660
Reviewed by Philippe Normand.
Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
Testing: This fix deals with cleanup and tearing down resources down in the platform layer
and is not covered by automated tests. It is however observable in the manual test added
in [1] where the remote videos should stop when the connections are closed.
[1] http://webkit.org/b/163327
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::stop):
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix -webkit-mask-box-image parsing
https://bugs.webkit.org/show_bug.cgi?id=163676
Reviewed by Dean Jackson.
-webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
-webkit-border-image.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][EFL] Build fix after r207543.
https://bugs.webkit.org/show_bug.cgi?id=163671
Unreviewed.
Fix typo on the filename of the included header:
Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
* css/parser/CSSPropertyParser.cpp:
2016-10-19 Zalan Bujtas <zalan@apple.com>
Use anonymous table row for new child at RenderTableRow::addChild() if available.
https://bugs.webkit.org/show_bug.cgi?id=163651
<rdar://problem/28705022>
Reviewed by David Hyatt.
We should try to prevent the continuation siblings from getting separated and inserted into
wrapper renderers. It makes finding these continuation siblings difficult.
This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
beforeChild/new child.
Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::showRenderObject): Add continuation information.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
2016-10-19 Joseph Pecoraro <pecoraro@apple.com>
Cleanup WebCore/workers
https://bugs.webkit.org/show_bug.cgi?id=163635
Reviewed by Chris Dumez.
* workers/*:
Cleanup like pragma once, nullptr, remove stale includes, declarations.
2016-10-19 Chris Dumez <cdumez@apple.com>
MouseEvent's coordinates should be 0 for simulated clicks
https://bugs.webkit.org/show_bug.cgi?id=163648
Reviewed by Darin Adler.
MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
by JavaScript (i.e. via element.click()). This behavior matches Chrome
and Firefox.
WebKit was computing actual coordinates for the element which was
expensive, especially because computing screenX / screenY required
a synchronous IPC with the UI process.
Test: fast/events/element-click-no-coords.html
* dom/Element.cpp:
(WebCore::Element::dispatchSimulatedClick):
* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent):
(WebCore::simulateClick):
* dom/SimulatedClick.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::click):
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix transform parsing
https://bugs.webkit.org/show_bug.cgi?id=163671
Reviewed by Dean Jackson.
The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
meant it could be used to handle transform values, with the function name representing the
transform operation efficiently as a CSSValueID.
The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
just make the new parser build WebkitCSSTransformValues too.
The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
IDL. To be safe, I am not eliminating it (even though Blink has).
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::transformOperationForCSSValueID):
(WebCore::consumeTransformValue):
2016-10-19 Darin Adler <darin@apple.com>
Move XPath from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163656
Reviewed by Chris Dumez.
* dom/Document.cpp:
(WebCore::Document::createExpression): Use ExceptionOr.
(WebCore::Document::createNSResolver): Return Ref.
(WebCore::Document::evaluate): Use ExceptionOr.
* dom/Document.h: Updated for above changes.
* dom/Document.idl: Use non-legacy exceptions for the functions above.
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
with new interface.
* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser): Marked inline.
(WebCore::DOMParser::create): Moved here from header.
(WebCore::DOMParser::parseFromString): Use ExceptionOr.
* xml/DOMParser.h: Updated for above changes.
* xml/DOMParser.idl: Use non-legacy exception.
* xml/XPathEvaluator.cpp:
(WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
(WebCore::XPathEvaluator::evaluate): Ditto.
* xml/XPathEvaluator.h: Updated for above changes.
* xml/XPathEvaluator.idl: Use non-legacy exceptions.
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::createExpression): Use ExceptionOr.
(WebCore::XPathExpression::evaluate): Ditto.
* xml/XPathExpression.h: Updated for above changes.
* xml/XPathExpression.idl: Use non-legacy exceptions.
* xml/XPathGrammar.y: Added include of XPathStep.h.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::Parser): Initialize three scalar data members
in the class definition rather than here.
(WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
* xml/XPathParser.h: Updated for above changes.
* xml/XPathResult.cpp:
(WebCore::XPathResult::XPathResult): Use a reference rather than a
pointer for the document. Alao initialize two scalar data members
in the class definition rather than here.
(WebCore::XPathResult::convertTo): Use ExceptionOr.
(WebCore::XPathResult::numberValue): Ditto.
(WebCore::XPathResult::stringValue): Ditto.
(WebCore::XPathResult::booleanValue): Ditto.
(WebCore::XPathResult::singleNodeValue): Ditto.
(WebCore::XPathResult::snapshotLength): Ditto.
(WebCore::XPathResult::iterateNext): Ditto.
(WebCore::XPathResult::snapshotItem): Ditto.
* xml/XPathResult.h: Updated for the changes above.
* xml/XPathResult.idl: Use non-legacy exceptions.
2016-10-19 Nan Wang <n_wang@apple.com>
AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
https://bugs.webkit.org/show_bug.cgi?id=163610
Reviewed by Chris Fleizach.
Exposed the goodness of the meter value in AXValueDescription.
Test: accessibility/mac/meter-gauge-value-description.html
* English.lproj/Localizable.strings:
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* platform/LocalizedStrings.cpp:
(WebCore::AXMeterGaugeRegionOptimumText):
(WebCore::AXMeterGaugeRegionSuboptimalText):
(WebCore::AXMeterGaugeRegionLessGoodText):
* platform/LocalizedStrings.h:
2016-10-19 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix named color parsing
https://bugs.webkit.org/show_bug.cgi?id=163662
Reviewed by Zalan Bujtas.
Named color parsing in the old parser for extended colors relied on constructing a Color with the
name and doing a lookup that way.
The new parser allows the back end to hold a primitive identifier value for extended colors.
StyleColor contains a helper function for looking up the correct color.
This patch switches both the old and the new parsers over to the new StyleColor function.
Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
detects parsing failure that way.
* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::operator=):
* css/StyleColor.cpp:
(WebCore::StyleColor::isColorKeyword):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue):
(WebCore::colorForCSSValue): Deleted.
2016-10-19 Youenn Fablet <youenn@apple.com>
Remove SecurityOrigin::taintsCanvas
https://bugs.webkit.org/show_bug.cgi?id=163594
Reviewed by Darin Adler.
No change of behavior.
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canReceiveDragData):
(WebCore::SecurityOrigin::taintsCanvas): Deleted.
* page/SecurityOrigin.h:
2016-10-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Fix compound selector parsing.
https://bugs.webkit.org/show_bug.cgi?id=163649
Reviewed by Darin Adler.
The new CSS parser is failing to handle compound selectors. The code has an assumption that the
first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
name used in Blink, RelationType, and to make the ordering be exactly the same.
* css/CSSSelector.h:
(WebCore::CSSSelector::relation):
(WebCore::CSSSelector::setRelation):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::canMatchHoverOrActiveInQuirksMode):
(WebCore::SelectorChecker::determineLinkMatchType):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::insertTagHistory):
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setRelation):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCombinator):
* css/parser/CSSSelectorParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
(WebCore::SelectorCompiler::constructFragmentsInternal):
2016-10-19 Javier Fernandez <jfernandez@igalia.com>
Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
https://bugs.webkit.org/show_bug.cgi?id=163572
Reviewed by Sergio Villar Senin.
We only allow the new CSS Box Alignment syntax when the Grid Layout
feature is enabled. Due to flexbox backward compatibility we have
implemented a different code path for the style initial/default values
assignment. However, we have incorrectly resolved both align-content
and justify-content to 'flex-start' when grid layout is disabled.
This patch changes the approach, so we set 'normal' (the value specified
by the new syntax) for both properties, but using the values defined in
the old syntax (Flexbox specification) at computed style resolution.
Since 'stretch' is the default value for the align-content property, this
issue implies that any flexbox line with an undefined height will be
laid out incorrectly, if not explicitly set via CSS, because flex items
can't use the available height, even though they use 'stretch' for their
'align-self' properties.
Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::propertyValue):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialContentAlignment):
2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] REGRESSION(r207396) Build broken with Clang.
https://bugs.webkit.org/show_bug.cgi?id=163599
Suggested and reviewed by Darin Adler.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getStringValue):
2016-10-19 Darin Adler <darin@apple.com>
Try to fix build.
* page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build after r207522.
* page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build after r207519.
The build error is:
IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
CodeGeneratorTestRunner.pm and used by TestRunner.idl.
* bindings/scripts/IDLAttributes.txt: Bring back PassContext.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build with GCC 4.9 after r207463.
Add constructors to MediaConstraintsData.
* Modules/mediastream/MediaConstraintsImpl.h:
(WebCore::MediaConstraintsData::MediaConstraintsData):
2016-10-19 Jer Noble <jer.noble@apple.com>
[Mac][MSE] Movies with a 'mehd' box have a zero-duration
https://bugs.webkit.org/show_bug.cgi?id=163641
Reviewed by Darin Adler.
Test: media/media-source/media-source-init-segment-duration.html
The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
AVAsset -overallDurationHint property.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
* platform/spi/mac/AVFoundationSPI.h:
2016-10-18 Darin Adler <darin@apple.com>
Move many miscellaneous classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163645
Reviewed by Ryosuke Niwa.
* bindings/js/JSCryptoCustom.cpp:
(WebCore::JSCrypto::getRandomValues): Use propagateException.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage): Ditto.
(WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
(WebCore::JSDOMWindow::setInterval): Ditto.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Use propagateException.
(WebCore::JSStorage::deleteProperty): Ditto.
(WebCore::JSStorage::getOwnPropertyNames): Ditto.
(WebCore::JSStorage::putDelegate): Ditto.
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::update): Use ExceptionOr.
(WebCore::DOMApplicationCache::swapCache): Ditto.
* loader/appcache/DOMApplicationCache.h: Update for above changes.
* loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues): Use ExceptionOr.
(WebCore::Crypto::webkitSubtle): Ditto.
* page/Crypto.h: Updated for above changes.
* page/Crypto.idl: Use non-legacy exceptions.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow): Initialize many data members in
the class definition instead of here.
(WebCore::DOMWindow::page): Use nullptr.
(WebCore::DOMWindow::screen): Ditto.
(WebCore::DOMWindow::crypto): Ditto.
(WebCore::DOMWindow::locationbar): Ditto.
(WebCore::DOMWindow::menubar): Ditto.
(WebCore::DOMWindow::personalbar): Ditto.
(WebCore::DOMWindow::scrollbars): Ditto.
(WebCore::DOMWindow::statusbar): Ditto.
(WebCore::DOMWindow::toolbar): Ditto.
(WebCore::DOMWindow::applicationCache): Ditto.
(WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
(WebCore::DOMWindow::localStorage): Ditto.
(WebCore::DOMWindow::postMessage): Ditto.
(WebCore::DOMWindow::frameElement): Use nullptr.
(WebCore::DOMWindow::self): Ditto.
(WebCore::DOMWindow::opener): Ditto.
(WebCore::DOMWindow::parent): Ditto.
(WebCore::DOMWindow::top): Ditto.
(WebCore::DOMWindow::getComputedStyle): Use Ref.
(WebCore::DOMWindow::setTimeout): Use ExceptionOr.
(WebCore::DOMWindow::setInterval): Ditto.
(WebCore::didAddStorageEventListener): Use a reference instead of a
pointer, and ignore return value instead of using IGNORE_EXCEPTION.
(WebCore::DOMWindow::addEventListener): Pass reference to function above.
(WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
* page/DOMWindow.h: Updated for changes above. Also changed indentatation.
* page/DOMWindow.idl: Use non-legacy exceptions.
* page/EventSource.cpp:
(WebCore::EventSource::create): Use ExceptionOr.
* page/EventSource.h: Updated for change above.
* page/EventSource.idl: Use non-legacy exception.
* page/Location.cpp:
(WebCore::Location::setProtocol): Use ExceptionOr.
* page/Location.h: Updated for change above.
* page/Location.idl: Use non-legacy exception.
* page/Performance.cpp:
(WebCore::Performance::Performance): Remove unnecessary initialization of
smart pointer to null, and moved initialization of m_resourceTimingBufferSize
to the header.
(WebCore::Performance::navigation): Made non-const and return a reference.
(WebCore::Performance::timing): Ditto.
(WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
a const& instead of passing in a copy.
(WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
(WebCore::Performance::webkitClearMarks): Ditto.
(WebCore::Performance::webkitMeasure): Ditto.
(WebCore::Performance::webkitClearMeasures): Ditto.
(WebCore::Performance::reduceTimeResolution): Use std::floor.
* page/Performance.h: Updated for above changes. Removed unneeded includes.
Made more things private. Removed unneeded reference counting of UserTiming.
* page/Performance.idl: Use non-legacy exceptions.
* page/PerformanceUserTiming.cpp:
(WebCore::restrictedMarkFunction): Removed unneeded class name.
(WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
(WebCore::UserTiming::mark): Use ExceptionOr.
(WebCore::UserTiming::findExistingMarkStartTime): Ditto.
(WebCore::UserTiming::measure): Ditto.
(WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
* page/PerformanceUserTiming.h: Updated for above changes. Removed reference
counting since this is a single-owner object.
* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
* page/UserMessageHandler.h: Updated for above change.
* page/UserMessageHandler.idl: Use non-legacy exception.
* storage/Storage.cpp:
(WebCore::Storage::length): Use ExceptionOr.
(WebCore::Storage::key): Ditto.
(WebCore::Storage::getItem): Ditto.
(WebCore::Storage::setItem): Ditto.
(WebCore::Storage::removeItem): Ditto.
(WebCore::Storage::clear): Ditto.
(WebCore::Storage::contains): Ditto.
* storage/Storage.h: Updated for above change.
* storage/Storage.idl: Use non-legacy exceptions.
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
Updated for ExceptionOr.
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
2016-10-18 Darin Adler <darin@apple.com>
Move internal testing classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163553
Reviewed by Ryosuke Niwa.
* bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
is now needed in the testing library.
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Added code to handle the jsArray case with an exception.
* css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
CSS_SCROLL_SNAP is not enabled.
* dom/Element.cpp:
(WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
There is no reason it needs to be a RefPtr.
* dom/Element.h: Updated for above change.
* svg/SVGPathStringBuilder.h: Exported class and made more public so it can
be used in test code.
* svg/SVGPathUtilities.cpp:
(WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
so moved into there.
(WebCore::buildStringFromPath): Deleted. Ditto.
* svg/SVGPathUtilities.h: Removed buildStringFromPath.
* testing/InternalSettings.cpp: Simplified the guard macro and used the all
capitals style that our style guide prescribes for non-function-like macros.
(WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
(WebCore::InternalSettings::resetToConsistentState): Updated since settings
returns a reference.
(WebCore::InternalSettings::settings): Changed to return a reference and
assert that m_page is not null; functions all check m_page for null first.
(WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
ExceptionOr, do an m_page check, and use settings that returns a reference.
(WebCore::InternalSettings::setStandardFontFamily): Ditto.
(WebCore::InternalSettings::setSerifFontFamily): Ditto.
(WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
(WebCore::InternalSettings::setFixedFontFamily): Ditto.
(WebCore::InternalSettings::setCursiveFontFamily): Ditto.
(WebCore::InternalSettings::setFantasyFontFamily): Ditto.
(WebCore::InternalSettings::setPictographFontFamily): Ditto.
(WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
(WebCore::InternalSettings::setMediaTypeOverride): Ditto.
(WebCore::InternalSettings::setCanStartMedia): Ditto.
(WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
(WebCore::InternalSettings::setEditingBehavior): Ditto.
(WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
(WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
(WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
(WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
(WebCore::InternalSettings::setImagesEnabled): Ditto.
(WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
(WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
(WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
(WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
(WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
(WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
(WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
(WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
(WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
(WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
(WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
(WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
(WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
(WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
(WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
(WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
(WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
(WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
(WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
(WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
(WebCore::InternalSettings::systemLayoutDirection): Ditto.
(WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
(WebCore::InternalSettings::variationFontsEnabled): Ditto.
(WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
(WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
* testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
it private instead of public.
* testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
exception for setIndexedDBWorkersEnabled.
* testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
(WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
(WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
(WebCore::Internals::animationsAreSuspended): Ditto.
(WebCore::Internals::suspendAnimations): Ditto.
(WebCore::Internals::resumeAnimations): Ditto.
(WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
(WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
(WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
(WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
(WebCore::Internals::elementRenderTreeAsText): Ditto.
(WebCore::Internals::ensureShadowRoot): Ditto.
(WebCore::Internals::createShadowRoot): Ditto.
(WebCore::Internals::shadowRootType): Ditto.
(WebCore::Internals::isTimerThrottled): Ditto.
(WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
(WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
(WebCore::Internals::absoluteCaretBounds): Ditto.
(WebCore::Internals::inspectorHighlightRects): Ditto.
(WebCore::Internals::inspectorHighlightObject): Ditto.
(WebCore::Internals::markerCountForNode): Ditto.
(WebCore::Internals::markerAt): Ditto.
(WebCore::Internals::markerRangeForNode): Ditto.
(WebCore::Internals::markerDescriptionForNode): Ditto.
(WebCore::Internals::dumpMarkerRects): Ditto.
(WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
(WebCore::Internals::setScrollViewPosition): Ditto.
(WebCore::Internals::setViewBaseBackgroundColor): Ditto.
(WebCore::Internals::setPagination): Ditto.
(WebCore::Internals::setPaginationLineGridEnabled): Ditto.
(WebCore::Internals::configurationForViewport): Ditto.
(WebCore::Internals::wasLastChangeUserEdit): Ditto.
(WebCore::Internals::scrollElementToRect): Ditto.
(WebCore::Internals::autofillFieldName): Ditto.
(WebCore::Internals::paintControlTints): Ditto.
(WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
(WebCore::Internals::setDelegatesScrolling): Ditto.
(WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
(WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
(WebCore::Internals::wheelEventHandlerCount): Ditto.
(WebCore::Internals::touchEventHandlerCount): Ditto.
(WebCore::Internals::nodesFromRect): Ditto.
(WebCore::Internals::setBatteryStatus): Ditto.
(WebCore::Internals::setDeviceProximity): Ditto.
(WebCore::Internals::hasSpellingMarker): Ditto.
(WebCore::Internals::hasAutocorrectedMarker): Ditto.
(WebCore::Internals::handleAcceptedCandidate): Ditto.
(WebCore::Internals::isOverwriteModeEnabled): Ditto.
(WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
(WebCore::Internals::countMatchesForText): Ditto.
(WebCore::Internals::countFindMatches): Ditto.
(WebCore::Internals::setInspectorIsUnderTest): Ditto.
(WebCore::Internals::hasGrammarMarker): Ditto.
(WebCore::Internals::numberOfScrollableAreas): Ditto.
(WebCore::Internals::isPageBoxVisible): Ditto.
(WebCore::Internals::layerTreeAsText): Ditto.
(WebCore::Internals::repaintRectsAsText): Ditto.
(WebCore::Internals::scrollingStateTreeAsText): Ditto.
(WebCore::Internals::mainThreadScrollingReasons): Ditto.
(WebCore::Internals::nonFastScrollableRects): Ditto.
(WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
(WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
(WebCore::Internals::displayListForElement): Ditto.
(WebCore::Internals::replayDisplayListForElement): Ditto.
(WebCore::Internals::garbageCollectDocumentResources): Ditto.
(WebCore::Internals::insertAuthorCSS): Ditto.
(WebCore::Internals::insertUserCSS): Ditto.
(WebCore::Internals::pageProperty): Ditto.
(WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
(WebCore::Internals::setPageScaleFactor): Ditto.
(WebCore::Internals::setPageZoomFactor): Ditto.
(WebCore::Internals::setTextZoomFactor): Ditto.
(WebCore::Internals::setUseFixedLayout): Ditto.
(WebCore::Internals::setFixedLayoutSize): Ditto.
(WebCore::Internals::setViewExposedRect): Ditto.
(WebCore::Internals::setHeaderHeight): Ditto.
(WebCore::Internals::setFooterHeight): Ditto.
(WebCore::Internals::setTopContentInset): Ditto.
(WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
(WebCore::Internals::startTrackingRepaints): Ditto.
(WebCore::Internals::stopTrackingRepaints): Ditto.
(WebCore::Internals::startTrackingLayerFlushes): Ditto.
(WebCore::Internals::layerFlushCount): Ditto.
(WebCore::Internals::startTrackingStyleRecalcs): Ditto.
(WebCore::Internals::styleRecalcCount): Ditto.
(WebCore::Internals::startTrackingCompositingUpdates): Ditto.
(WebCore::Internals::compositingUpdateCount): Ditto.
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
(WebCore::Internals::getCurrentCursorInfo): Ditto.
(WebCore::Internals::mediaElementHasCharacteristic): Ditto.
(WebCore::Internals::captionsStyleSheetOverride): Ditto.
(WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
(WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
(WebCore::Internals::setCaptionDisplayMode): Ditto.
(WebCore::Internals::selectionBounds): Ditto.
(WebCore::Internals::isVibrating): Ditto.
(WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
(WebCore::Internals::beginMediaSessionInterruption): Ditto.
(WebCore::Internals::setMediaSessionRestrictions): Ditto.
(WebCore::Internals::postRemoteControlCommand): Ditto.
(WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
(WebCore::Internals::installMockPageOverlay): Ditto.
(WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
(WebCore::Internals::scrollSnapOffsets): Ditto.
(WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
the path string in here for now since it's only used for this testing.
(WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
* testing/Internals.h: Updated for above changes.
* testing/Internals.idl: Use non-legacy exceptions.
2016-10-18 Chris Dumez <cdumez@apple.com>
[Web IDL] Drop webkit-specific extended attributes that are no longer useful
https://bugs.webkit.org/show_bug.cgi?id=163643
Reviewed by Ryosuke Niwa.
Drop webkit-specific IDL extended attributes that are no longer useful:
- [CustomReturn]: I believe this used to be for ObjC bindings. It has
no impact in JS bindings.
- [Deletable]: It only had an impact on static attributes and was only
used on HTMLAllCollection.all, which is not static. I updated the
bindings generator to so that static attributes are now configurable
by default (unless marked as [Unforgeable], as per Web IDL [1]. This
causes Notification.permission (This only static attribute we have)
to become deletable. This behavior is consistent with the specification
and with Chrome. I added test coverage for this.
- [ImplementationNamespace]: Implemented but unused.
- [PassContext]: Not implemented and unused.
- [TypedArray=*]: Not implemented and unused.
[1] https://heycam.github.io/webidl/#es-attributes
Test: fast/notifications/notification-permisssion-deletable.html
* bindings/scripts/CodeGeneratorJS.pm:
(GetNamespaceForInterface):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* dom/Node.idl:
* html/HTMLDocument.idl:
2016-10-18 Sam Weinig <sam@webkit.org>
Replace std::experimental::variant with WTF::Variant (or similar)
https://bugs.webkit.org/show_bug.cgi?id=163626
Reviewed by Chris Dumez.
Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
into the WTF namespace.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isBlob):
(WebCore::FetchBody::isFormData):
(WebCore::FetchBody::isArrayBuffer):
(WebCore::FetchBody::isArrayBufferView):
(WebCore::FetchBody::isURLSearchParams):
(WebCore::FetchBody::isText):
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::formDataBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
(WebCore::FetchBody::textBody):
(WebCore::FetchBody::urlSearchParamsBody):
* bindings/generic/IDLTypes.h:
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::hasException):
(WebCore::ExceptionOr<ReturnType>::releaseException):
(WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source):
* dom/MessageEvent.h:
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
* dom/Node.h:
* html/HTMLOptionsCollection.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
* html/HTMLSelectElement.h:
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
2016-10-18 Chris Dumez <cdumez@apple.com>
Unreviewed, rebaseline bindings tests after Sam's r207505.
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
(WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
(WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
(WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
(WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
(WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
2016-10-18 Chris Dumez <cdumez@apple.com>
[Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
https://bugs.webkit.org/show_bug.cgi?id=163630
Reviewed by Darin Adler.
Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
IDL now that all our events use proper constructors instead.
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(IsConstructable):
* bindings/scripts/IDLAttributes.txt:
* dom/Event.h:
(WebCore::Event::create):
* dom/Event.idl:
* dom/UIEvent.h:
(WebCore::UIEvent::create):
* dom/UIEvent.idl:
2016-10-18 Chris Dumez <cdumez@apple.com>
Changing details.open should cause a toggle event to be fired asynchronously
https://bugs.webkit.org/show_bug.cgi?id=163568
Reviewed by Darin Adler.
Changing details.open should cause a toggle event to be fired asynchronously:
- https://html.spec.whatwg.org/#details-notification-task-steps
Firefox and Chrome implement this, we don't.
Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
* dom/EventNames.h:
* dom/GlobalEventHandlers.idl:
* html/HTMLAttributeNames.in:
* html/HTMLDetailsElement.cpp:
(WebCore::detailToggleEventSender):
(WebCore::HTMLDetailsElement::~HTMLDetailsElement):
(WebCore::HTMLDetailsElement::dispatchPendingEvent):
(WebCore::HTMLDetailsElement::parseAttribute):
* html/HTMLDetailsElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
2016-10-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enable basic parser testing.
https://bugs.webkit.org/show_bug.cgi?id=163639
Reviewed by Dean Jackson.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
eventually, but it's better to not assert on that for now.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::isHostPseudoSelector):
Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::addExpandedPropertyForValue):
copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
(WebCore::parseSingleShadow):
(WebCore::CSSPropertyParser::consumeFont):
Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
some of the font properties should be reset as part of this shorthand but aren't.
'
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeInteger):
Just return a number for now instead of the parser_integer type.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
Also replace the contact by me since I'm most familiar with this feature.
* features.json:
2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
Also update my contact information since I'm no longer on Twitter.
* features.json:
2016-10-18 Chris Dumez <cdumez@apple.com>
Provide better form validation messages
https://bugs.webkit.org/show_bug.cgi?id=163584
Reviewed by Darin Adler.
Provide better form validation messages that match more closely the ones
from Chrome and Firefox.
No new tests, updated existing tests.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::validationMessageValueMissingText):
(WebCore::validationMessageValueMissingForCheckboxText):
(WebCore::validationMessageValueMissingForFileText):
(WebCore::validationMessageValueMissingForMultipleFileText):
(WebCore::validationMessageValueMissingForRadioText):
(WebCore::validationMessageValueMissingForSelectText):
(WebCore::validationMessageTypeMismatchText):
(WebCore::validationMessageTypeMismatchForEmailText):
(WebCore::validationMessageTypeMismatchForMultipleEmailText):
(WebCore::validationMessageTypeMismatchForURLText):
(WebCore::validationMessagePatternMismatchText):
(WebCore::validationMessageTooShortText):
(WebCore::validationMessageTooLongText):
(WebCore::validationMessageRangeUnderflowText):
(WebCore::validationMessageRangeOverflowText):
(WebCore::validationMessageStepMismatchText):
(WebCore::validationMessageBadInputForNumberText):
2016-10-18 Dave Hyatt <hyatt@apple.com>
Fix GTK build.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-18 Sam Weinig <sam@webkit.org>
Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
https://bugs.webkit.org/show_bug.cgi?id=163625
Reviewed by Chris Dumez.
- Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
- Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
- Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
- Move MessagePorts and ArrayBuffers more where possible.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::state):
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::trySerializeDetail):
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::sanitizedErrorValue):
(WebCore::ErrorEvent::trySerializeError):
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::trySerializeState):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DOMWindow.h:
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/DedicatedWorkerGlobalScope.h:
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/Worker.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
Updated for new SerializedScriptValue interface/vector naming.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::extractTransferables):
(WebCore::fillMessagePortArray): Deleted.
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
Rename fillMessagePortArray to extractTransferables to better express what it does.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::fillTransferMap):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::transferArrayBuffers):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:
Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
* bindings/scripts/CodeGeneratorJS.pm:
(GetNativeVectorType):
Remove special case for MessagePort.
(JSValueToNative):
(NativeToJSValue):
Updated for new SerializedScriptValue interface.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::trySerializeData):
* dom/MessageEvent.h:
Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
* dom/MessageEvent.idl:
Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
custom, as we don't quite generate these correctly yet.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::disentanglePorts):
(WebCore::MessagePort::entanglePorts):
* dom/MessagePort.h:
Update interface to take MessagePort vectors by rvalue reference.
2016-10-18 Chris Dumez <cdumez@apple.com>
[iOS] Drop JSDictionary::convertValue() overload taking a TouchList
https://bugs.webkit.org/show_bug.cgi?id=163620
Reviewed by Sam Weinig.
Drop JSDictionary::convertValue() overload taking a TouchList now that
TouchEvent is using a proper constructor with a TouchEventInit
dictionary on iOS.
* bindings/js/JSDictionary.cpp:
2016-10-18 Dean Jackson <dino@apple.com>
Remove CSS_SHAPES feature definition. This should always be on.
https://bugs.webkit.org/show_bug.cgi?id=163628
<rdar://problem/28834613>
Reviewed by Tim Horton.
CSS Shapes is in Candidate Recommendation. It's a core part
of CSS. It should always be enabled.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::shapePropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertShapeValue):
* css/parser/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseShapeProperty):
* css/parser/CSSParser.h:
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForShapeOutside):
(WebCore::buildObjectForElementData):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/RenderBlock.cpp:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionNewFloats):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::~RenderBox):
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
(WebCore::isCandidateForOpaquenessTest):
(WebCore::RenderBox::imageChanged):
* rendering/RenderBox.h:
(WebCore::RenderBox::markShapeOutsideDependentsForLayout):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::updateShapeImage):
(WebCore::RenderElement::initializeStyle):
(WebCore::RenderElement::setStyle):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasShapeOutside):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/line/LineWidth.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
(WebCore::LineWidth::wrapNextToShapeOutside):
(WebCore::LineWidth::fitBelowFloats):
* rendering/line/LineWidth.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/shapes/ShapeOutsideInfo.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
(WebCore::RenderStyle::changeRequiresRepaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialShapeImageThreshold):
* rendering/style/ShapeValue.cpp:
* rendering/style/ShapeValue.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingResources):
2016-10-18 Chris Dumez <cdumez@apple.com>
convertDictionary<>() no longer needs to return an Optional<> type
https://bugs.webkit.org/show_bug.cgi?id=163624
Reviewed by Sam Weinig.
convertDictionary<>() no longer needs to return an Optional<> type now
that our dictionary structures are all default constructible after
<https://trac.webkit.org/changeset/206974>.
* bindings/js/JSDOMConvert.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
2016-10-18 Chris Dumez <cdumez@apple.com>
Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
https://bugs.webkit.org/show_bug.cgi?id=163608
Reviewed by Ryosuke Niwa.
Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
- https://html.spec.whatwg.org/#htmlselectelement
- https://html.spec.whatwg.org/#htmloptionscollection
No new tests, rebaseline existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::constructJSTestOverloadedConstructorsWithSequence1):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
* html/HTMLOptGroupElement.idl:
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add):
* html/HTMLOptionsCollection.h:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
(WebCore::HTMLSelectElement::setOption):
(WebCore::HTMLSelectElement::setLength):
* html/HTMLSelectElement.h:
* html/HTMLSelectElement.idl:
2016-10-18 Aaron Chu <aaron_chu@apple.com>
Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
https://bugs.webkit.org/show_bug.cgi?id=163088
<rdar://problem/16421985>
Reviewed by Darin Adler.
Changed code in InspectDOMAgent so that it determines the focusability of a Node based
on the AccessibilityNodeObject and not the Element class.
Covered by existing tests:
LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2016-10-18 Anders Carlsson <andersca@apple.com>
Get rid of more WebHistoryItem cruft
https://bugs.webkit.org/show_bug.cgi?id=163623
Reviewed by Tim Horton.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
(WebCore::HistoryItem::setViewportArguments):
(WebCore::HistoryItem::bookmarkID): Deleted.
(WebCore::HistoryItem::setBookmarkID): Deleted.
(WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
(WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
2016-10-18 Dave Hyatt <hyatt@apple.com>
Fix Windows build.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2016-10-18 Antoine Quint <graouts@apple.com>
Modern media controls don't update their rendering correctly
https://bugs.webkit.org/show_bug.cgi?id=163603
<rdar://problem/28826022>
Reviewed by Dean Jackson.
There are rendering issues when we use an absolutely-positioned element
as the top-most element in a media element's shadow root (webkit.org/b/163592).
Since we only need for that element to be positioned, we can use "position: relative"
instead, which removes the rendering issues.
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
(.media-controls,): Deleted.
2016-10-18 Dean Jackson <dino@apple.com>
Add preliminary support for extended colors to WebCore::Color
https://bugs.webkit.org/show_bug.cgi?id=162878
<rdar://problem/28596413>
Follow-up review comments from Darin Adler.
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop): Use nullptr.
* platform/graphics/Color.cpp:
(WebCore::Color::Color): Explicitly zero before assigning the pointer.
* platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
(WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
to static constants.
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
(WebCore::Color::asUint64): Deleted.
* platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
(WTF::ColorHash::hash):
2016-10-18 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
https://bugs.webkit.org/show_bug.cgi?id=163581
<rdar://problem/27739558>
Reviewed by Simon Fraser.
The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
StopAssistingNode not getting sent to the UI process.
Test: fast/forms/ios/hide-keyboard-on-node-removal.html
* dom/Document.cpp:
(WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
Chrome::elementDidBlur explicitly.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
2016-10-17 Anders Carlsson <andersca@apple.com>
Move some history specific HistoryItem code to WebHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163567
Reviewed by Tim Horton.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::addRedirectURL): Deleted.
(WebCore::HistoryItem::redirectURLs): Deleted.
(WebCore::HistoryItem::setRedirectURLs): Deleted.
* history/HistoryItem.h:
2016-10-18 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Get all the properties turned on
https://bugs.webkit.org/show_bug.cgi?id=163605
Reviewed by Dean Jackson.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFunctionValue.h:
* css/CSSPendingSubstitutionValue.cpp: Added.
(WebCore::CSSPendingSubstitutionValue::customCSSText):
* css/CSSPendingSubstitutionValue.h: Added.
(WebCore::CSSPendingSubstitutionValue::create):
(WebCore::CSSPendingSubstitutionValue::shorthandValue):
(WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
(WebCore::CSSPendingSubstitutionValue::equals):
(WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isPendingSubstitutionValue):
* css/CSSValueKeywords.in:
* css/StylePropertyShorthand.cpp:
(WebCore::transitionShorthandForParsing):
* css/StylePropertyShorthand.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::completeURL):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContext::completeURL):
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::parseAsCSSPropertyID):
(WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
* css/parser/CSSParserToken.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
(WebCore::CSSPropertyParser::addProperty):
(WebCore::CSSPropertyParser::addExpandedPropertyForValue):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::consumeCSSWideKeyword):
(WebCore::consumeTransformOrigin):
(WebCore::consumeWillChange):
(WebCore::consumeFontFeatureTag):
(WebCore::consumeFontFeatureSettings):
(WebCore::consumePage):
(WebCore::consumeQuotes):
(WebCore::FontVariantLigaturesParser::consumeLigature):
(WebCore::FontVariantLigaturesParser::finalizeValue):
(WebCore::consumeFontVariantLigatures):
(WebCore::consumeFontVariantCaps):
(WebCore::FontVariantNumericParser::consumeNumeric):
(WebCore::FontVariantNumericParser::finalizeValue):
(WebCore::consumeFontVariantNumeric):
(WebCore::consumeFontVariantCSS21):
(WebCore::consumeFontVariantList):
(WebCore::consumeFontWeight):
(WebCore::consumeFamilyName):
(WebCore::consumeGenericFamily):
(WebCore::consumeFontFamily):
(WebCore::consumeSpacing):
(WebCore::consumeTabSize):
(WebCore::consumeTextSizeAdjust):
(WebCore::consumeFontSize):
(WebCore::consumeLineHeight):
(WebCore::createPrimitiveValuePair):
(WebCore::consumeCounter):
(WebCore::consumePageSize):
(WebCore::consumeSize):
(WebCore::consumeTextIndent):
(WebCore::validWidthOrHeightKeyword):
(WebCore::consumeMaxWidthOrHeight):
(WebCore::consumeWidthOrHeight):
(WebCore::consumeMarginOrOffset):
(WebCore::consumeClipComponent):
(WebCore::consumeClip):
(WebCore::consumeTouchAction):
(WebCore::consumeLineClamp):
(WebCore::consumeLocale):
(WebCore::consumeColumnWidth):
(WebCore::consumeColumnCount):
(WebCore::consumeColumnGap):
(WebCore::consumeColumnSpan):
(WebCore::consumeZoom):
(WebCore::consumeAnimationIterationCount):
(WebCore::consumeAnimationName):
(WebCore::consumeTransitionProperty):
(WebCore::consumeCubicBezier):
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeAnimationValue):
(WebCore::isValidAnimationPropertyList):
(WebCore::consumeAnimationPropertyList):
(WebCore::CSSPropertyParser::consumeAnimationShorthand):
(WebCore::consumeZIndex):
(WebCore::parseSingleShadow):
(WebCore::consumeShadow):
(WebCore::consumeFilterFunction):
(WebCore::consumeFilter):
(WebCore::consumeTextDecorationLine):
(WebCore::consumeTextEmphasisStyle):
(WebCore::consumeOutlineColor):
(WebCore::consumeLineWidth):
(WebCore::consumeBorderWidth):
(WebCore::consumeTextStrokeWidth):
(WebCore::consumeColumnRuleWidth):
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::consumeTransformValue):
(WebCore::consumeTransform):
(WebCore::consumePositionLonghand):
(WebCore::consumePositionX):
(WebCore::consumePositionY):
(WebCore::consumePaintStroke):
(WebCore::consumePaintOrder):
(WebCore::consumeNoneOrURI):
(WebCore::consumeFlexBasis):
(WebCore::consumeStrokeDasharray):
(WebCore::consumeBaselineShift):
(WebCore::consumeRxOrRy):
(WebCore::consumeCursor):
(WebCore::consumeAttr):
(WebCore::consumeCounterContent):
(WebCore::consumeContent):
(WebCore::consumePositionList):
(WebCore::consumeScrollSnapCoordinate):
(WebCore::consumeScrollSnapPoints):
(WebCore::consumeBorderRadiusCorner):
(WebCore::consumeVerticalAlign):
(WebCore::consumeShapeRadius):
(WebCore::consumeBasicShapeCircle):
(WebCore::consumeBasicShapeEllipse):
(WebCore::consumeBasicShapePolygon):
(WebCore::complete4Sides):
(WebCore::consumeRadii):
(WebCore::consumeBasicShapeInset):
(WebCore::consumeBasicShape):
(WebCore::consumeWebkitClipPath):
(WebCore::consumeShapeOutside):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeBorderImageRepeatKeyword):
(WebCore::consumeBorderImageRepeat):
(WebCore::consumeBorderImageSlice):
(WebCore::consumeBorderImageOutset):
(WebCore::consumeBorderImageWidth):
(WebCore::consumeBorderImageComponents):
(WebCore::consumeWebkitBorderImage):
(WebCore::consumeReflect):
(WebCore::consumeImageOrientation):
(WebCore::consumeBackgroundBlendMode):
(WebCore::consumeBackgroundAttachment):
(WebCore::consumeBackgroundBox):
(WebCore::consumeBackgroundComposite):
(WebCore::consumePrefixedBackgroundBox):
(WebCore::consumeBackgroundSize):
(WebCore::consumeGridAutoFlow):
(WebCore::consumeBackgroundComponent):
(WebCore::addBackgroundValue):
(WebCore::consumeCommaSeparatedBackgroundComponent):
(WebCore::consumeSelfPositionKeyword):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeAlignItems):
(WebCore::consumeJustifyItems):
(WebCore::consumeFitContent):
(WebCore::consumeCustomIdentForGridLine):
(WebCore::consumeGridLine):
(WebCore::isGridTrackFixedSized):
(WebCore::consumeGridBreadth):
(WebCore::consumeGridTrackSize):
(WebCore::consumeGridLineNames):
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::consumeGridTemplatesRowsOrColumns):
(WebCore::consumeGridTemplateAreas):
(WebCore::consumeFontFaceUnicodeRange):
(WebCore::consumeFontFaceSrcURI):
(WebCore::consumeFontFaceSrcLocal):
(WebCore::consumeFontFaceSrc):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
(WebCore::CSSPropertyParser::consumeBorderSpacing):
(WebCore::consumeSingleViewportDescriptor):
(WebCore::CSSPropertyParser::parseViewportDescriptor):
(WebCore::consumeColumnWidthOrCount):
(WebCore::CSSPropertyParser::consumeColumns):
(WebCore::CSSPropertyParser::consumeShorthandGreedily):
(WebCore::CSSPropertyParser::consumeFlex):
(WebCore::CSSPropertyParser::consumeBorder):
(WebCore::CSSPropertyParser::consume4Values):
(WebCore::CSSPropertyParser::consumeBorderImage):
(WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
(WebCore::consumeBackgroundPosition):
(WebCore::consumeRepeatStyleComponent):
(WebCore::consumeRepeatStyle):
(WebCore::CSSPropertyParser::consumeBackgroundShorthand):
(WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
(WebCore::CSSPropertyParser::consumeGridAreaShorthand):
(WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
(WebCore::CSSPropertyParser::consumeGridShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
(WebCore::unresolvedCSSPropertyID): Deleted.
* css/parser/CSSPropertyParser.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeIdent):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
* css/parser/CSSPropertyParserHelpers.h:
2016-10-18 Brent Fulgham <bfulgham@apple.com>
Correct Document::removeAllEventListeners
https://bugs.webkit.org/show_bug.cgi?id=163558
<rdar://problem/28716840>
Reviewed by Chris Dumez.
Tested by fast/dom/node-move-to-new-document-crash-main.html.
* dom/Document.cpp:
(WebCore::Document::removeAllEventListeners): Clear out the wheel and
touch event targets when clearing all data.
2016-10-18 Dean Jackson <dino@apple.com>
Remove dependency cycle with UIKit
https://bugs.webkit.org/show_bug.cgi?id=163577
<rdar://problem/28786160>
Reviewed by Tim Horton.
Soft link against UIKit. Followup patch because
I screwed up and forgot to edit the simulator
configuration.
* Configurations/WebCoreTestSupport.xcconfig:
2016-10-18 Said Abou-Hallawa <sabouhallawa@apple.com>
SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
https://bugs.webkit.org/show_bug.cgi?id=116470
Reviewed by Simon Fraser.
When we encounter a shorthand css property, we set m_implicitShorthand
to true to tell addProperty() later that the individual properties are
all set through a short hand one. We need to make sure that setting
m_implicitShorthand to true will not be leaked after finishing parsing
the short hand property.
Test: fast/css/implicit-property-restore.html
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseBorderRadius):
(WTF::ImplicitScope::ImplicitScope): Deleted.
(WTF::ImplicitScope::~ImplicitScope): Deleted.
Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
Restore m_implicitShorthand value after setting it temporarily to true.
2016-10-18 Chris Dumez <cdumez@apple.com>
Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163580
Reviewed by Sam Weinig.
Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://html.spec.whatwg.org/#the-trackevent-interface
No new tests, updated existing tests.
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
* html/track/TrackEvent.idl:
2016-10-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207409.
https://bugs.webkit.org/show_bug.cgi?id=163602
Introduced many test failures and timeouts, causing release
bot to exit early (Requested by mcatanzaro on #webkit).
Reverted changeset:
"[GTK] Several tests crashing on debug bot in (anonymous
namespace)::MediaPlayerPrivateGStreamerBase::repaint"
https://bugs.webkit.org/show_bug.cgi?id=163511
http://trac.webkit.org/changeset/207409
2016-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>
Reviewed by Darin Adler.
Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
access happens in the UI process.
No new tests, updated results of existing tests.
* CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
(WebCore::MediaConstraintsImpl::initialize): Deleted.
* Modules/mediastream/MediaConstraintsImpl.h:
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
(WebCore::MediaDevicesEnumerationRequest::create):
(WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
(WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
(WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
(WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
(WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
(WebCore::MediaDevicesEnumerationRequest::start):
(WebCore::MediaDevicesEnumerationRequest::cancel):
(WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
(WebCore::MediaDevicesEnumerationRequest::finish):
* Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
(WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
(WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
(WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
* Modules/mediastream/MediaDevicesRequest.h:
* Modules/mediastream/UserMediaClient.h:
* Modules/mediastream/UserMediaController.h:
(WebCore::UserMediaController::enumerateMediaDevices): New.
(WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
(WebCore::UserMediaController::checkUserMediaPermission): Deleted.
(WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
* Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
* Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
(WebCore::UserMediaRequest::start):
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::deny):
(WebCore::UserMediaRequest::constraintsValidated): Deleted.
(WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
(WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
(WebCore::UserMediaRequest::constraintsInvalid): Deleted.
(WebCore::UserMediaRequest::didCreateStream): Deleted.
(WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
(WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
* Modules/mediastream/UserMediaRequest.h:
* WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::CaptureDevice):
(WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
(WebCore::CaptureDevice::setLabel): Ditto.
(WebCore::CaptureDevice::setGroupId): Ditto.
(WebCore::CaptureDevice::setKind): Ditto.
* platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::encode): New.
(WebCore::MediaConstraint::decode): Ditto.
(WebCore::NumericConstraint::encode): Ditto.
(WebCore::NumericConstraint::decode): Ditto.
* platform/mediastream/MediaStreamCreationClient.h: Deleted.
* platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
group id, we don't support it.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
(WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
* platform/mock/MockRealtimeMediaSourceCenter.h:
2016-10-18 Zan Dobersek <zdobersek@igalia.com>
[WebIDL] Support BufferSource
https://bugs.webkit.org/show_bug.cgi?id=163541
Reviewed by Youenn Fablet.
Add support for the BufferSource typedef in WebIDL. The implementation
adds the necessary handling for this type in the generator scripts and
the specialization of the Converter<> template for the IDLBufferSource
struct that enables exposing ArrayBuffer or ArrayBufferView objects by
having WebCore::BufferSource objects pointing to their data.
The SourceBuffer interface in the MSE module has the appendBuffer()
operation modified to accept a BufferSource parameter, instead of
overloading it for ArrayBuffer and ArrayBufferView parameters.
The bindings generator tests cover BufferSource as both an operation
parameter and as a dictionary member.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
(WebCore::SourceBuffer::appendBufferInternal):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/BufferSource.h: Added.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLBufferSource>::convert):
* bindings/scripts/CodeGenerator.pm:
(SkipIncludeHeader):
(IsWrapperType):
* bindings/scripts/CodeGeneratorJS.pm:
(AddClassForwardIfNeeded):
(GetBaseIDLType):
(IsHandledByDOMConvert):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
* bindings/scripts/test/TestObj.idl:
2016-10-18 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Different width of grid container between initial load and refresh
https://bugs.webkit.org/show_bug.cgi?id=163535
Reviewed by Manuel Rego Casasnovas.
Grid's layout logic manages two different override sizes; one it's
designed to implement the grid item's stretching behavior, identified
with the concept of 'overrideContentLogicalSize'; there is another
override size, known as overrideContainingBlockContentLogicalSize,
used to implement the Grid Area abstraction, which will behave as
the actual containing block of any grid item.
During grid's layout logic these override sizes are set according
to the CSS style rules. This affects how the grid container and its
children are going to be sized during layout. Grid Tracks sizing
algorithm depends on these override sizes.
In order to ensure that the tracks sizing algorithm produces the
same results when it's run consecutively several times, we need to
clear these override sizes and perform a layout of the affected grid
items. Otherwise, the affected items will return sizing values which
depend on the override values set in the previous layout, which in
some cases, like orthogonal flows, may change through different runs
of the sizing algorithm.
Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
2016-10-18 Youenn Fablet <youenn@apple.com>
CachedResourceLoader should not need to remove fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=163015
Reviewed by Darin Adler.
No expected change for non-window port.
For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
before querying the memory cache.
Removing the fragment identifier from the request stored in CachedResourceRequest.
The fragment identifier is stored in a separate field.
This allows CachedResourceLoader to not care about fragment identifier.
CachedResource can then get access to it.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::finishRequestInitialization): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource):
Updated the method taking a const String& to strip the fragment identifier if needed.
Updated the method taking a const URL& to assert if the fragment identifier is present.
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
(WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::releaseFragmentIdentifier):
(WebCore::CachedResourceRequest::clearFragmentIdentifier):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
(WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequest):
* loader/cache/MemoryCache.h:
2016-10-18 Antti Koivisto <antti@apple.com>
Rename setNeedsStyleRecalc to invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=163542
Reviewed by Darin Adler.
Also rename StyleChangeType enum and some related functions for clarity. For example
element.setNeedsStyleRecalc(SyntheticStyleChange);
becomes
element.invalidateStyleAndLayerComposition();
* WebCore.xcodeproj/project.pbxproj:
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::setCSSTarget):
(WebCore::unwrapFullScreenRenderer):
(WebCore::Document::setAnimatingFullScreen):
* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setFocus):
(WebCore::Element::setHovered):
(WebCore::Element::attributeChanged):
(WebCore::Element::invalidateStyle):
(WebCore::Element::invalidateStyleAndLayerComposition):
(WebCore::Element::invalidateStyleForSubtree):
(WebCore::Element::invalidateStyleAndRenderersForSubtree):
Move public invalidation functions to Element tightening typing.
Use separate functions instead of enum values.
This way the call sites look nicer and only useful combinations are exposed.
(WebCore::Element::addShadowRoot):
(WebCore::checkForEmptyStyleChange):
(WebCore::checkForSiblingStyleChanges):
(WebCore::Element::needsStyleInvalidation):
(WebCore::Element::setContainsFullScreenElement):
* dom/Element.h:
(WebCore::Element::setHasFocusWithin):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::adjustStyleValidity):
Update validity and mode separately. There was a potential bug here where
SyntheticStyleChange could overwrite FullStyleChange (no known repro).
(WebCore::Node::updateAncestorsForStyleRecalc):
(WebCore::Node::invalidateStyle):
(WebCore::Node::insertedInto):
(WebCore::Node::setNeedsStyleRecalc): Deleted.
* dom/Node.h:
(WebCore::Node::needsStyleRecalc):
(WebCore::Node::styleValidity):
(WebCore::Node::styleResolutionShouldRecompositeLayer):
(WebCore::Node::setHasValidStyle):
(WebCore::Node::styleChangeType): Deleted.
(WebCore::Node::clearNeedsStyleRecalc): Deleted.
(WebCore::Node::setStyleChange): Deleted.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::remove):
(WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setResetStyleInheritance):
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::addSlotElementByName):
(WebCore::SlotAssignment::removeSlotElementByName):
(WebCore::SlotAssignment::didChangeSlot):
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::invalidateStyleAttribute):
* dom/Text.cpp:
(WebCore::Text::updateRendererAfterContentChange):
* dom/VisitedLinkState.cpp:
(WebCore::VisitedLinkState::invalidateStyleForAllLinks):
(WebCore::VisitedLinkState::invalidateStyleForLink):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::focusedOrActiveStateChanged):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
* html/FileInputType.cpp:
(WebCore::FileInputType::setValue):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
(WebCore::HTMLElement::calculateAndAdjustDirectionality):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::addInvalidDescendant):
(WebCore::HTMLFieldSetElement::removeInvalidDescendant):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::disabledStateChanged):
(WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
(WebCore::HTMLFormControlElement::requiredAttributeChanged):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::updateValidity):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerFormElement):
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::resetDefaultButton):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::parseAttribute):
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::runPostTypeUpdateTasks):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::setIndeterminate):
(WebCore::HTMLInputElement::setAutoFilled):
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
(WebCore::HTMLObjectElement::childrenChanged):
(WebCore::HTMLObjectElement::renderFallbackContent):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::parseAttribute):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::setSelectedState):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::setDisplayState):
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
(WebCore::HTMLPlugInImageElement::finishParsingChildren):
(WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
(WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
(WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didElementStateChange):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::setRecalcListItems):
(WebCore::HTMLSelectElement::parseMultipleAttribute):
(WebCore::HTMLSelectElement::reset):
* html/HTMLTableElement.cpp:
(WebCore::isTableCellAncestor):
(WebCore::setTableCellsChanged):
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
* html/InputType.cpp:
(WebCore::InputType::setValue):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::minOrMaxAttributeChanged):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::subtreeHasChanged):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::updateSelectedChild):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear):
(WebCore::AnimationControllerPrivate::updateAnimations):
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::AnimationController::cancelAnimations):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::updateDragState):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::popParent):
(WebCore::Style::clearNeedsStyleResolution):
(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleUpdate.h:
* style/StyleValidity.h: Added.
StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
Move to a file of its own.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
* svg/SVGElement.cpp:
(WebCore::SVGElement::willRecalcStyle):
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::invalidateShadowTree):
* testing/Internals.cpp:
(WebCore::styleValidityToToString):
(WebCore::Internals::styleChangeType):
(WebCore::styleChangeTypeToString): Deleted.
2016-10-17 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Constrain by min|max-height on auto repeat computation
https://bugs.webkit.org/show_bug.cgi?id=163540
Reviewed by Darin Adler.
The max-height (if definite) is used to compute the number of auto repeat rows whenever the
height is indefinite. We were using the min-height only in case both values were indefinite.
Although not explicitly mentioned by grid specs, it's reasonable to assume that
the min-height trumps the used value of height/max-height like it always does, per CSS
2.2. Note that the number of rows still needs to fit within that size even if using
min-height, because we're just using min-height to compute the used value of the height
property. If both height and max-height are indefinite we keep doing the same, i.e., compute
the minimum number of rows that fulfill min-height (if definite).
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
2016-10-17 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
https://bugs.webkit.org/show_bug.cgi?id=163586
Reviewed by Saam Barati.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::toWrapperSlow):
2016-10-18 Ryuan Choi <ryuan.choi@navercorp.com>
[EFL] Build break since r207442
https://bugs.webkit.org/show_bug.cgi?id=163587
Unreviewed.
Since r207442, setRGB is moved to private.
* rendering/RenderThemeEfl.cpp:
(WebCore::fillColorsFromEdjeClass):
2016-10-17 Dean Jackson <dino@apple.com>
Remove dependency cycle with UIKit
https://bugs.webkit.org/show_bug.cgi?id=163577
<rdar://problem/28786160>
Reviewed by Tim Horton.
Soft link against UIKit.
* Configurations/WebCoreTestSupport.xcconfig:
* testing/Internals.mm:
2016-10-17 Dean Jackson <dino@apple.com>
Allow creation of ExtendedColors and make Color immutable
https://bugs.webkit.org/show_bug.cgi?id=163557
<rdar://problem/28805360>
Reviewed by Darin Adler and Dave Hyatt.
1. Support the creation of ExtendedColor objects via the
Color class.
2. Fix the remaining few places where a Color object is
modified after creation, instead creating a new Color.
Move all the mutation methods into the private section,
making Color now immutable.
Changes to Color are covered by existing tests. Changes
to ExtendedColor are covered by the ExtendedColor API test.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::fastParseColor): Return a new named Color.
* dom/Document.cpp:
(WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
where possible.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
use the string "black" here - we have a constant value.
* platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
* platform/graphics/Color.cpp:
(WebCore::findNamedColor): Move this up in the file.
(WebCore::Color::Color): Copy in the code from setNamedColor. Also
add a constructor for ExtendedColor.
(WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
(WebCore::Color::cssText): Ditto.
(WebCore::Color::setNamedColor): Deleted.
(WebCore::Color::tagAsExtended): Deleted.
* platform/graphics/Color.h: Add a new constructor.
(WebCore::Color::setRGB): Move to private.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Implement serializer.
* platform/graphics/ExtendedColor.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
2016-10-17 Simon Fraser <simon.fraser@apple.com>
Implement DOMRect/DOMRectReadOnly
https://bugs.webkit.org/show_bug.cgi?id=163464
Reviewed by Darin Adler.
Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
https://dev.w3.org/fxtf/geometry/
DOMRects allow negative height/width and require double storage, so we can't just
use FloatRect for storage. They also require handling of NaN and Infinity.
To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
custom min/max functions that return NaN if either argument is NaN, so add
nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
Test: fast/dom/domrect.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMRect.h: Added.
(WebCore::DOMRect::create):
(WebCore::DOMRect::fromRect):
(WebCore::DOMRect::setX):
(WebCore::DOMRect::setY):
(WebCore::DOMRect::setWidth):
(WebCore::DOMRect::setHeight):
(WebCore::DOMRect::DOMRect):
* dom/DOMRect.idl: Added.
* dom/DOMRectInit.h: Added.
* dom/DOMRectInit.idl: Added.
* dom/DOMRectReadOnly.h: Added.
(WebCore::DOMRectReadOnly::create):
(WebCore::DOMRectReadOnly::fromRect):
(WebCore::DOMRectReadOnly::x):
(WebCore::DOMRectReadOnly::y):
(WebCore::DOMRectReadOnly::width):
(WebCore::DOMRectReadOnly::height):
(WebCore::DOMRectReadOnly::top):
(WebCore::DOMRectReadOnly::right):
(WebCore::DOMRectReadOnly::bottom):
(WebCore::DOMRectReadOnly::left):
(WebCore::DOMRectReadOnly::DOMRectReadOnly):
* dom/DOMRectReadOnly.idl: Added.
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Basic MediaController
https://bugs.webkit.org/show_bug.cgi?id=163539
<rdar://problem/28797542>
Reviewed by Darin Adler.
We add a new main.js file which acts as the entry point by implementing the createControls()
function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
been created. That functions creates an instance of the new MediaController class, which is
the controller object that will handle communication between the media controls and the media
element. At first, this MediaController class is very limited and assumes macOS inline
layout traits and forces a start button to be shown over the media, which can be played
to start the media and show the full controls. More functionality will be added by future patches.
Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
media/modern-media-controls/media-controller/media-controller-constructor.html
media/modern-media-controls/media-controller/media-controller-resize.html
* Modules/modern-media-controls/main.js: Added.
(createControls):
* Modules/modern-media-controls/media/media-controller.js: Added.
(MediaController):
(MediaController.prototype.set pageScaleFactor):
(MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
(MediaController.prototype.handleEvent):
(MediaController.prototype.buttonWasClicked):
(MediaController.prototype._updateControlsSize):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-17 Anders Carlsson <andersca@apple.com>
Remove an unused HistoryItem function
https://bugs.webkit.org/show_bug.cgi?id=163565
Reviewed by Tim Horton.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::isAncestorOf): Deleted.
* history/HistoryItem.h:
2016-10-17 Nan Wang <n_wang@apple.com>
AX: [Mac] mapping for output elements
https://bugs.webkit.org/show_bug.cgi?id=163471
Reviewed by Chris Fleizach.
Mapped the output element to status role and exposed its text content
as AXTitle.
Test: accessibility/mac/output-element.html
* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isOutput):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXOutputText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXOutputText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXOutputText):
2016-10-17 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Use DOMJIT::Patchpoint in IC
https://bugs.webkit.org/show_bug.cgi?id=163223
Reviewed by Saam Barati.
Make DOMJITPatchpointParams non-const.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::toWrapper):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeNodeTypeDOMJIT::callDOM):
2016-10-17 Chris Dumez <cdumez@apple.com>
Move form.reportValidity() behind InteractiveFormValidation setting
https://bugs.webkit.org/show_bug.cgi?id=163550
Reviewed by Darin Adler.
Move form.reportValidity() behind InteractiveFormValidation setting for consistency
given that the two features are strongly related.
Also enable the setting by default so we can get feedback on the implementation.
Demos:
- Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
- Report validity: https://googlechrome.github.io/samples/report-validity/
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
(WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
https://bugs.webkit.org/show_bug.cgi?id=163502
<rdar://problem/28792017>
Reviewed by Darin Adler.
Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
may load images from the modern-media-controls directory in the WebCore.framework bundle.
We use this new method in the iconService singleton when a `mediaControlsHost` is set,
which will be set in a later patch.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::base64StringForIconAndPlatform):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
(const.iconService.new.IconService):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
(WebCore::RenderTheme::mediaControlsScript): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
https://bugs.webkit.org/show_bug.cgi?id=163501
<rdar://problem/28792014>
Reviewed by Darin Adler.
Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
concatenated CSS sources for the media controls shadow root via JS. Actually using this
API will be done in a later patch. We also no longer inject those styles as a user-agent
stylesheet when the runtime flag is on since it will no longer be necessary.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::shadowRootCSSText):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2016-10-17 Simon Fraser <simon.fraser@apple.com>
Implement DOMPoint/DOMPointReadOnly
https://bugs.webkit.org/show_bug.cgi?id=133916
Reviewed by Darin Adler.
Patch mostly by Dirk Schultz <krit@webkit.org>.
Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
(although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
with Chrome).
Test: geometry/DOMPoint-001.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPoint.h: Added.
* dom/DOMPoint.idl: Added.
* dom/DOMPointInit.h: Added.
* dom/DOMPointInit.idl: Added.
* dom/DOMPointReadOnly.h: Added.
(WebCore::DOMPointReadOnly::create):
(WebCore::DOMPointReadOnly::fromPoint):
(WebCore::DOMPointReadOnly::x):
(WebCore::DOMPointReadOnly::y):
(WebCore::DOMPointReadOnly::z):
(WebCore::DOMPointReadOnly::w):
(WebCore::DOMPointReadOnly::DOMPointReadOnly):
* dom/DOMPointReadOnly.idl: Added.
2016-10-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
https://bugs.webkit.org/show_bug.cgi?id=163500
<rdar://problem/28792010>
Reviewed by Darin Adler.
Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
directory.
Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
scripts and styles in RenderTheme when the runtime flag is on.
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet):
(WebCore::RenderThemeMac::mediaControlsScript):
2016-10-17 Simon Fraser <simon.fraser@apple.com>
Fix typo in error message.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
2016-10-17 Fujii Hironori <Hironori.Fujii@sony.com>
preprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
https://bugs.webkit.org/show_bug.cgi?id=163435
Reviewed by Alex Christensen.
cl.exe outputs processing filenames to stderr. Suppress this
annoying messages by using open3 instead of open2.
* bindings/scripts/preprocessor.pm:
(applyPreprocessor): Use open3 in case of Windows Perl.
2016-10-17 Mark Lam <mark.lam@apple.com>
Use the reject() helper function for conditionally throwing TypeErrors.
https://bugs.webkit.org/show_bug.cgi?id=163491
Reviewed by Filip Pizlo.
No new tests because this patch does not introduce new behavior.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createRsaKeyGenParams):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):
2016-10-17 Miguel Gomez <magomez@igalia.com>
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
https://bugs.webkit.org/show_bug.cgi?id=163511
Reviewed by Carlos Garcia Campos.
Perform the video repaint in the main thread when accelerated compositing is disabled.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2016-10-17 Konstantin Tokarev <annulen@yandex.ru>
Eleminate code duplication between ResourceRequest encoding/decoding implementations
https://bugs.webkit.org/show_bug.cgi?id=163507
Reviewed by Carlos Garcia Campos.
ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
ditto for decoding implementations.
No new tests needed.
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::encodeBase):
(WebCore::ResourceRequestBase::decodeBase):
(WebCore::ResourceRequestBase::encodeWithoutPlatformData):
(WebCore::ResourceRequestBase::decodeWithoutPlatformData):
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData):
(WebCore::ResourceRequest::decodeWithPlatformData):
2016-10-17 Michael Catanzaro <mcatanzaro@igalia.com>
Move user agent quirks to cross-platform location
https://bugs.webkit.org/show_bug.cgi?id=163508
Reviewed by Carlos Garcia Campos.
Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.
* PlatformGTK.cmake:
* platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
* platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
(WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
only apply to sites if the base domain matches google.*, not any base domain that starts
with google.
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
* platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
(WebCore::UserAgentQuirks::UserAgentQuirks):
(WebCore::UserAgentQuirks::add):
(WebCore::UserAgentQuirks::contains):
(WebCore::UserAgentQuirks::isEmpty):
* platform/efl/UserAgentEfl.cpp:
(WebCore::standardUserAgentForURL):
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::standardUserAgentForURL):
(): Deleted.
(WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
(WebCore::UserAgentQuirks::add): Deleted.
(WebCore::UserAgentQuirks::contains): Deleted.
(WebCore::UserAgentQuirks::isEmpty): Deleted.
(WebCore::urlRequiresChromeBrowser): Deleted.
(WebCore::urlRequiresMacintoshPlatform): Deleted.
2016-10-17 Alberto Garcia <berto@igalia.com>
[GTK] gobject-introspection on package build with webkit2gtk fails without active X session
https://bugs.webkit.org/show_bug.cgi?id=163105
Reviewed by Carlos Garcia Campos.
Don't call XCompositeQueryExtension() or XDamageQueryExtension()
if m_display is NULL.
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXComposite):
(WebCore::PlatformDisplayX11::supportsXDamage):
2016-10-16 Nan Wang <n_wang@apple.com>
AX: [Mac] roleDescription for AXTextField input types
https://bugs.webkit.org/show_bug.cgi?id=163419
<rdar://problem/28766192>
Reviewed by Darin Adler.
Provided more detailed role description for input types that
exposed as standard text fields on the mac.
Changes are covered in modified test expectation.
* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXEmailFieldText):
(WebCore::AXTelephoneFieldText):
(WebCore::AXURLFieldText):
(WebCore::AXDateFieldText):
(WebCore::AXTimeFieldText):
2016-10-16 Chris Dumez <cdumez@apple.com>
Update WebKit localizable strings
https://bugs.webkit.org/show_bug.cgi?id=163513
Reviewed by Dan Bernstein.
Update WebKit localizable strings as it was missing the "too short" one needed
by form validation. This was causing a "Localized string not found" message to
be shown when testing the following sample on WebKit ToT:
- https://googlechrome.github.io/samples/report-validity/
* English.lproj/Localizable.strings:
2016-10-16 Chris Dumez <cdumez@apple.com>
REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
https://bugs.webkit.org/show_bug.cgi?id=163506
<rdar://problem/28792483>
Reviewed by Darin Adler.
As per the NSEvent documentation [1], calling [NSEvent characters] is only
valid on key up / key down events and will raise an NSInternalInconsistencyException
if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
is called with the third kind of key event (NSFlagsChanged) which is used for
detecting modifier keys. We normally detect the modifier key and return early before
calling [NSEvent characters]. However, in some rare cases, we fail to detect the
modifier key and we fall through.
To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
fail to detect the modifier key and before calling [NSEvent characters].
[1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters
No new test, not easily testable.
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
2016-10-16 Darin Adler <darin@apple.com>
Move CSS classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163494
Reviewed by Sam Weinig.
Removed the "get" prefix from the names of many CSSPrimitiveValue
functions to match WebKit coding style and to disambiguate them
from the public CSS DOM functions that raise exceptions.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::propertyNamePrefix): Use enum class.
(WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
(WebCore::stylePropertyGetter): Refactor to simplify structure.
(WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
(WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
and use propagateException to handle ExcpetionOr.
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
(WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
initialize a global here.
* bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
functions returning ExceptionOr<String>.
* bindings/scripts/gobject-generate-headers.pl: Deleted.
* css/BasicShapeFunctions.cpp:
(WebCore::convertToLengthSize): Use pairValue.
(WebCore::convertToCenterCoordinate): Use valueID and pairValue.
(WebCore::cssValueToBasicShapeRadius): Ditto.
* css/CSSBasicShapes.cpp:
(WebCore::serializePositionOffset): Ditto.
(WebCore::buildSerializablePositionOffset): Ditto.
(WebCore::CSSBasicShapeCircle::cssText): Ditto.
(WebCore::CSSBasicShapeEllipse::cssText): Ditto.
(WebCore::updateCornerRadiusWidthAndHeight): Ditto.
* css/CSSBorderImageSliceValue.h: Use quadValue.
* css/CSSCalculationValue.cpp:
(WebCore::determineCategory): Use floatValue and doubleValue.
* css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
* css/CSSCharsetRule.idl: Use non-legacy exceptions.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
(WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
(WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
(WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
(WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
a Ref instead of a RefPtr.
* css/CSSComputedStyleDeclaration.h: Updated for above changes.
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
(WebCore::CSSCrossfadeValue::image): Ditto.
(WebCore::CSSCrossfadeValue::blend): Use doubleValue.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::calculateStyleMask): Use valueID.
(WebCore::CSSFontFace::calculateWeightMask): Ditto.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
(WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
(WebCore::CSSFontFaceSet::check): Ditto.
* css/CSSFontFaceSet.h: Updated for above changes.
* css/CSSGradientValue.cpp:
(WebCore::compareStops): Use doubleValue.
(WebCore::CSSGradientValue::addStops): Use floatValue.
(WebCore::positionFromValue): Use floatValue and valudID.
(WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
(WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
(WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
(WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
(WebCore::CSSRadialGradientValue::createGradient): Use valueID.
* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
(WebCore::CSSGroupingRule::deleteRule): Ditto.
* css/CSSGroupingRule.h: Updated for above changes.
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
(WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::fillImageSet): Use floatValue.
* css/CSSMediaRule.idl: Use non-legacy exceptions.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
(WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
since getDoubleValue is unused, moving the call to clampTo into this function.
Also changed this to use ExceptionOr.
(WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
(WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
and an out argument to return the value and check for type failure.
(WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getStringValue): Ditto.
(WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
(WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
(WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
(WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
(WebCore::CSSPrimitiveValue::getPairValue): Deleted.
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
* css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
out of the class definition. Updated for the above changes.
* css/CSSPrimitiveValue.idl: Use non-legacy exceptions.
* css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.
* css/CSSRule.cpp:
(WebCore::CSSRule::setCssText): Use ExceptionOr.
* css/CSSRule.h: Updated for above change.
* css/CSSRule.idl: Use non-legacy exceptions.
* css/CSSStyleDeclaration.h: Use ExceptionOr.
* css/CSSStyleDeclaration.idl: Use non-legacy exceptions.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
(WebCore::CSSStyleSheet::insertRule): Ditto.
(WebCore::CSSStyleSheet::deleteRule): Ditto.
(WebCore::CSSStyleSheet::addRule): Ditto.
* css/CSSStyleSheet.h: Updated for the above changes.
* css/CSSStyleSheet.idl: Use non-legacy exceptions.
* css/CSSSupportsRule.idl: Use non-legacy exceptions.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
(WebCore::convertToLengthSize): Ditto.
(WebCore::CSSToStyleMap::mapFillSize): Ditto.
(WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
(WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
(WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
(WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
(WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
(WebCore::CSSToStyleMap::mapAnimationName): Ditto.
(WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
(WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
(WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
(WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
(WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.
* css/CSSValue.h: Use ExceptionOr.
* css/CSSValue.idl: Use non-legacy exceptions.
* css/Counter.h: Use stringValue instead of getStringValue, etc.
* css/FontFace.cpp:
(WebCore::FontFace::create): Use ExceptionOr.
(WebCore::FontFace::setFamily): Ditto.
(WebCore::FontFace::setStyle): Ditto.
(WebCore::FontFace::setWeight): Ditto.
(WebCore::FontFace::setStretch): Ditto.
(WebCore::FontFace::setUnicodeRange): Ditto.
(WebCore::FontFace::setVariant): Ditto.
(WebCore::FontFace::setFeatureSettings): Ditto.
* css/FontFace.h: Updated for above changes.
* css/FontFace.idl: Use non-legacy exceptions.
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load): Use ExceptionOr.
(WebCore::FontFaceSet::check): Ditto.
* css/FontFaceSet.h: Updated for above changes.
* css/FontFaceSet.idl: Use non-legacy exceptions.
* css/FontVariantBuilder.cpp:
(WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
(WebCore::extractFontVariantNumeric): Ditto.
(WebCore::extractFontVariantEastAsian): Ditto.
* css/MediaList.cpp:
(WebCore::MediaList::setMediaText): Use ExceptionOr.
(WebCore::MediaList::deleteMedium): Ditto.
(WebCore::MediaList::appendMedium): Ditto.
* css/MediaList.h: Updated for above changes.
* css/MediaList.idl: Use non-legacy exceptions.
* css/MediaQueryEvaluator.cpp:
(WebCore::doubleValue): Use valueID instead of getValueID, etc.
(WebCore::colorGamutEvaluate): Ditto.
(WebCore::invertedColorsEvaluate): Ditto.
(WebCore::orientationEvaluate): Ditto.
(WebCore::evaluateResolution): Ditto.
(WebCore::computeLength): Ditto.
(WebCore::viewModeEvaluate): Ditto.
(WebCore::hoverEvaluate): Ditto.
(WebCore::pointerEvaluate): Ditto.
(WebCore::prefersReducedMotionEvaluate): Ditto.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
(WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
* css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
Also marked a couple additional functions private.
* css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
* css/StyleBuilderCustom.h: Ditto.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
(WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
(WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
(WebCore::StyleResolver::createFilterOperations): Ditto.
* css/TransformFunctions.cpp:
(WebCore::transformsForValue): Ditto.
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
getting rid of the one that uses an ExceptionCode.
(WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
(WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
(WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
(WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
(WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
(WebCore::WebKitCSSMatrix::scale): Ditto.
(WebCore::WebKitCSSMatrix::rotate): Ditto.
(WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
(WebCore::WebKitCSSMatrix::skewX): Ditto.
(WebCore::WebKitCSSMatrix::skewY): Ditto.
(WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
* css/WebKitCSSMatrix.h: Updated for above changes.
* css/WebKitCSSMatrix.idl: Use non-legacy extensions.
* css/makeprop.pl:
(handleCurrentColorValue): Use valueID instead of getValueID.
(generateValueSetter): Ditto.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
(WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
(WebCore::CSSParser::parseFillPosition): Ditto.
(WebCore::CSSParser::parseFillRepeat): Ditto.
(WebCore::CSSParser::parseGridPosition): Ditto.
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
(WebCore::isGridTrackFixedSized): Ditto.
(WebCore::CSSParser::parseRadialGradient): Ditto.
(WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
setPrimitiveType here. The createParserOperator returns an object that
already has the correct primitive type.
* css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
getXXXValue functions, but not sure if it's right since it is commented out
code that I did not compile.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
(WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
(WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
(WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
(WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
* dom/Range.cpp: Added now-needed include of ExceptionCode.h.
* dom/SelectorQuery.cpp: Ditto.
* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier): Use valueID instead of getValueID, etc.
(WebCore::ApplyStyleCommand::computedFontSize): Ditto.
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty): Ditto.
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
(WebCore::EditingStyle::extractFontSizeDelta): Ditto.
(WebCore::EditingStyle::textDirection): Ditto.
(WebCore::EditingStyle::prepareToApplyAt): Ditto.
(WebCore::EditingStyle::textDirectionForSelection): Ditto.
(WebCore::fontWeightIsBold): Ditto.
(WebCore::legacyFontSizeFromCSSValue): Ditto.
(WebCore::isTransparentColorValue): Ditto.
(WebCore::hasTransparentBackgroundColor): Ditto.
(WebCore::backgroundColorInEffect): Ditto.
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
what we do by default for things returning ExceptionOr.
* editing/RemoveCSSPropertyCommand.cpp:
(WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
(WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
* editing/cocoa/HTMLConverter.mm:
(floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
* editing/markup.cpp:
(WebCore::propertyMissingOrEqualToNone): Ditto.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
(WebCore::InspectorStyleSheet::deleteRule): Ditto.
(WebCore::InspectorStyleSheet::setStyleText): Ditto.
* svg/SVGLength.cpp:
(WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.
2016-10-16 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Styles for StartButton are missing
https://bugs.webkit.org/show_bug.cgi?id=163499
<rdar://problem/28792009>
Reviewed by Darin Adler.
Add styling for StartButton so that instances are always displayed in the center of their container.
Test: media/modern-media-controls/start-button/start-button-styles.html
* Modules/modern-media-controls/controls/start-button.css: Added.
(button.start):
(button.start > *):
(button.start > div):
(button.start > img):
(button.start:active > img):
2016-10-16 Simon Fraser <simon.fraser@apple.com>
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466
Follow-up fix to die if "serializer {...}" lists an attribute not present
on the interface. I don't think this is testable with the current bindings tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
2016-10-16 Simon Fraser <simon.fraser@apple.com>
Add the "Geometry Interfaces" to features.json.
* features.json:
2016-10-16 Carlos Garcia Campos <cgarcia@igalia.com>
Document request not updated after willSendRequest is called for a redirect
https://bugs.webkit.org/show_bug.cgi?id=163436
Reviewed by Michael Catanzaro.
The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
Covered by GTK+ unit tests.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
* loader/DocumentLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
and called for a redirection.
2016-10-15 Said Abou-Hallawa <sabouhallawa@apple.com>
Delete the animated image catchup code
https://bugs.webkit.org/show_bug.cgi?id=163410
Reviewed by Simon Fraser.
This patch fixes two issues in the animated image workflow:
1) Setting the animation timer should follow the following rules:
-- Initial case: Which happens before drawing the first frame. We
should set the timer to fire after the current_frame_duration.
-- Late case (Slow animation): This happens if the current_time is
past the next_frame_desired_time. In this case we should fire the
timer immediately.
-- Early case (Fast animation): This happens when there is still time
before the next_frame_desired_time. In this case we should set the
timer to fire after the difference between the next_frame_desired_time
and the current_time.
2) Deleting the code for catching up the current_frame:
This code used to run in the slow animation case. It was never used
on iOS. It was trying to adjust the current_frame according to the
current_time as if there were no delay. It turned out that this might
cause a bigger delay because most likely the decoder decodes the image
frames incrementally; i.e. to decode frame k, it has to have frame
(k - 1) decoded.
Test: fast/images/ordered-animated-image-frames.html
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Remove the iOS specific code.
(WebCore::BitmapImage::startAnimation): Move the animation finishing code from
BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
duration code as it is described above.
(WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
into this function.
(WebCore::BitmapImage::resetAnimation):
(WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
(WebCore::Image::startAnimation):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::startAnimation):
* svg/graphics/SVGImage.h:
Remove the catchup code form the Image and SVGImage classes.
2016-10-15 Darin Adler <darin@apple.com>
Move Web SQL database and WebSockets off legacy exceptions
https://bugs.webkit.org/show_bug.cgi?id=163284
Reviewed by Chris Dumez.
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
* Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
* Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
* Modules/webdatabase/SQLResultSet.cpp:
(WebCore::SQLResultSet::SQLResultSet): Move initialization of
many data members into the class definition.
(WebCore::SQLResultSet::insertId): Use ExceptionOr.
(WebCore::SQLResultSet::rowsAffected): Moved into class definition.
(WebCore::SQLResultSet::rows): Ditto.
(WebCore::SQLResultSet::setInsertId): Ditto.
(WebCore::SQLResultSet::setRowsAffected): Ditto.
* Modules/webdatabase/SQLResultSet.h: Updated for above.
* Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
Added a FIXME about the mismatch between long and int64_t.
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::execute): Use reference instead of pointer.
* Modules/websockets/WebSocket.cpp:
(WebCore::isValidProtocolString): Use StringView.
(WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
spelling error in the name of this function.
(WebCore::WebSocket::WebSocket): Move initialization of many data
members into the class definition.
(WebCore::WebSocket::create): Use ExceptionOr.
(WebCore::WebSocket::connect): Ditto.
(WebCore::WebSocket::send): Ditto.
(WebCore::WebSocket::close): Ditto.
(WebCore::WebSocket::binaryType): Update to use enum class.
(WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
use enum class.
(WebCore::WebSocket::didReceiveBinaryData): Ditto.
* Modules/websockets/WebSocket.h: Updated for above. Changed the
BinaryType enum into an enum class.
* Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
Updated for name change to subprotocolSeparator.
* dom/ExceptionOr.h: Added a constructor for scalar types that does not
require an rvalue reference. We can refine this more later, but for now
this is sufficient to obviate the need for WTFMove where it otherwise would
have been needed in the code above.
* inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
* page/DOMWindow.idl: Touched this file to work around bugs in the dependency
analysis of the current CMake build system, since otherwise it doesn't process the
change to the partial interface WebSocket. Edited lots of comments, removed many
others, and tweaked formatting.
2016-10-14 Sam Weinig <sam@webkit.org>
MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
https://bugs.webkit.org/show_bug.cgi?id=163475
Reviewed by Simon Fraser.
Start fleshing out union support, starting with MessageEvent.
- Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.
* bindings/generic/IDLTypes.h:
Switch IDLInterface to use RefPtr<T> as its implementation type.
* bindings/js/JSDOMConvert.h:
(WebCore::Detail::VariadicConverterBase::convert):
- Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
and window shell, and not always an optimization, e.g. in the case of a single interface.
- Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
handles window and window shell correctly.
- Also fix an issue where we would wrongly assert that one interface had to match.
* bindings/js/JSDOMWrapper.h:
(WebCore::isJSDOMWrapperType): Deleted.
Remove unused predicate.
* bindings/scripts/IDLParser.pm:
(parseType):
Add missing support for nullable unions.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add new tests for unions (both non-null and nullable) in dictionaries.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
* dom/ContainerNode.h:
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
(WebCore::Node::before):
(WebCore::Node::after):
(WebCore::Node::replaceWith):
* dom/Node.h:
Add using declaration for NodeOrString and change it to use RefPtr<Node>.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::source):
(WebCore::isValidSource): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::event):
Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
observable, and will rectified in subsequent patches.
2016-10-15 Chris Dumez <cdumez@apple.com>
Add support for reportValidity() on form and form control elements
https://bugs.webkit.org/show_bug.cgi?id=163479
Reviewed by Darin Adler.
Add support for reportValidity() on form and form control elements:
- https://html.spec.whatwg.org/#dom-form-reportvalidity
- https://html.spec.whatwg.org/#dom-cva-reportvalidity
Firefox and Chrome already support this.
Demo: https://googlechrome.github.io/samples/report-validity/
No new tests, rebaselined existing tests.
* html/HTMLButtonElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
Add reportValidity() operation.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::checkValidity):
(WebCore::HTMLFormControlElement::reportValidity):
Add implementation for reportValidity() for form control elements.
First, it calls checkValidity() and returns early if there is no
constraint violation. if the JS canceled the 'invalid' event
fired by checkValidity(), then return early as well, as per the
specification. If the element is focusable, we scroll to it,
focus it and show the validation message. Otherwise, we log a
error message to the console. The last part of the behavior
matches what we already did in HTMLFormElement::validateInteractively()
and complies with the behavior in the specification.
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
Add utility function to scroll to the form control element, focus
it and show its validation message. This code was moved from
HTMLFormElement::validateInteractively() so that it could be reused
in HTMLFormControlElement::reportValidity().
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::validateInteractively):
Move the early abort checks to the existing call site (prepareForSubmission)
so that we can reuse this method for reportValidity().
(WebCore::HTMLFormElement::prepareForSubmission):
Only call validateInteractively() if we really should validate. Those checks
used to be in validateInteractively() but I moved them here so we could more
easily reuse validateInteractively().
(WebCore::HTMLFormElement::checkValidity):
(WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
Update Vector type to be a Vector of HTMLFormControlElement given that we
only add HTMLFormControlElement objects to it and that it results it simpler
code.
(WebCore::HTMLFormElement::reportValidity):
Add implementation for reportValidity() for form elements. The
implementation calls our already existing validateInteractively()
method, as per the specification.
* html/HTMLFormElement.h:
* html/HTMLObjectElement.h:
reportValidity() returns true unconditionally for object elements,
similarly to checkValidity().
2016-10-15 Simon Fraser <simon.fraser@apple.com>
Sort the project file.
* WebCore.xcodeproj/project.pbxproj:
2016-10-15 Simon Fraser <simon.fraser@apple.com>
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466
Reviewed by Darin Adler.
Fix the code generator to generate code for serializer = { attribute }.
In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
to detect these; it needs to create the domSerializable() now. Basic support
for isSerializableAttribute() is added (primitive types only).
GenerateSerializerFunction is fixed to output code for the serializable attributes
in the order specified in "serializer = {}", as specified in WebIDL.
Removed custom serialization for ClientRect and PerformanceTiming.
Other minor cleanup to always get $interfaceName from $interface->name, and to fix
ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSClientRectCustom.cpp: Removed.
* bindings/js/JSPerformanceTimingCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateSerializerFunction):
* bindings/scripts/IDLParser.pm:
(parseSerializerRest):
(parseSerializationPattern):
(parseSerializationAttributes):
(isSerializableAttribute):
(applyMemberList):
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
* bindings/scripts/test/JS/JSTestSerialization.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
* dom/ClientRect.idl:
* page/PerformanceTiming.idl:
2016-10-15 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Restore user agent quirk for Yahoo
https://bugs.webkit.org/show_bug.cgi?id=163481
Reviewed by Carlos Garcia Campos.
finance.yahoo.com is sending a mobile version in response to our standard user agent.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2016-10-15 Chris Dumez <cdumez@apple.com>
Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=163472
Reviewed by Sam Weinig.
Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
- https://html.spec.whatwg.org/#dom-media-volume
This is because the attribute is of type double (not unrestricted double in the IDL).
Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
No new tests, rebaselined existing test.
* html/HTMLMediaElement.idl:
2016-10-15 Zalan Bujtas <zalan@apple.com>
CounterNode::resetRenderers is so inefficient.
https://bugs.webkit.org/show_bug.cgi?id=163480
Reviewed by Simon Fraser.
CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
and sets the dirty bit on them.
This patch does all that in a loop, instead of traversing the linked tree on each removal.
No change in functionality.
* rendering/CounterNode.cpp:
(WebCore::CounterNode::CounterNode):
(WebCore::CounterNode::~CounterNode):
(WebCore::CounterNode::nextInPreOrderAfterChildren):
(WebCore::CounterNode::lastDescendant):
(WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
(WebCore::CounterNode::removeRenderer):
(WebCore::CounterNode::resetRenderers):
(WebCore::CounterNode::insertAfter):
(WebCore::CounterNode::removeChild):
* rendering/CounterNode.h:
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::RenderCounter::RenderCounter):
(WebCore::RenderCounter::~RenderCounter):
(WebCore::RenderCounter::originalText):
(WebCore::updateCounters):
(WebCore::RenderCounter::invalidate): Deleted.
* rendering/RenderCounter.h:
2016-10-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] macOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=163444
<rdar://problem/27989473>
Reviewed by Dean Jackson.
Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
media/modern-media-controls/macos-media-controls/macos-media-controls.html
* Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
(.media-controls.mac.inline > .controls-bar):
(.media-controls.mac.inline > .controls-bar > *):
(.media-controls.mac.inline button):
(.media-controls.mac.inline button:active):
(.media-controls.mac.inline > .controls-bar button):
(.media-controls.mac.inline > .controls-bar,):
(.media-controls.mac.inline button.play-pause):
(.media-controls.mac.inline button.skip-back):
(.media-controls.mac.inline .scrubber.slider):
(.media-controls.mac.inline button.mute):
(.media-controls.mac.inline button.airplay):
(.media-controls.mac.inline button.pip):
(.media-controls.mac.inline button.tracks):
(.media-controls.mac.inline button.fullscreen):
(.media-controls.mac.inline .time-label):
(.media-controls.mac.inline .volume-slider-container):
(.media-controls.mac.inline .volume-slider-container:before):
(.media-controls.mac.inline .volume.slider):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
(MacOSInlineMediaControls.prototype.layout):
(MacOSInlineMediaControls.prototype.handleEvent):
* Modules/modern-media-controls/controls/macos-media-controls.js: Added.
(MacOSMediaControls):
2016-10-14 Antti Koivisto <antti@apple.com>
100% CPU on homedepot.com page
https://bugs.webkit.org/show_bug.cgi?id=163452
<rdar://problem/28730708>
Reviewed by Simon Fraser.
The site has a keyframe animation on body. Currently this causes the animation to invalidate the
style of the entire document.
Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
that causes full subtree invalidation. However animation only ever affect individual elements and
the normal style resolution mechanism should be able to deal with things like inheritance as needed.
Test: fast/animation/animation-style-update-size.html
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* dom/Document.h:
(WebCore::Document::lastStyleUpdateSizeForTesting):
Testing support.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
Don't force subtree style resolution for SyntheticStyleChange.
* style/StyleUpdate.h:
(WebCore::Style::Update::size):
* testing/Internals.cpp:
(WebCore::Internals::lastStyleUpdateSize):
* testing/Internals.h:
* testing/Internals.idl:
2016-10-14 Chris Dumez <cdumez@apple.com>
Setting HTMLMediaElement.muted to the same value should not fire a volume change event
https://bugs.webkit.org/show_bug.cgi?id=163474
Reviewed by Eric Carlson.
Setting HTMLMediaElement.muted to the same value should not fire a volume
change event:
- https://html.spec.whatwg.org/#dom-media-muted
Chrome and Firefox agree with the specification.
No new tests, rebaselined existing test.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
2016-10-14 Dean Jackson <dino@apple.com>
Add Display P3 ColorSpace
https://bugs.webkit.org/show_bug.cgi?id=162880
<rdar://problem/28598564>
Reviewed by Sam Weinig.
Re-landing with a version that hopefully compiles on El Capitan.
Add a new ColorSpace for Display P3.
This will be tested once the Color class can create
objects that reference other color spaces.
* platform/graphics/ColorSpace.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::cachedCGColorSpace):
2016-10-14 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Minor cleanups
https://bugs.webkit.org/show_bug.cgi?id=162953
Reviewed by Dean Jackson.
Code cleanup. No change in behavior.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameBytesAtIndex):
2016-10-14 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2016-10-14 Anders Carlsson <andersca@apple.com>
Pass on networking settings to the PKPaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=163462
rdar://problem/28567629
Reviewed by Dan Bernstein.
Add new SPI.
* platform/spi/cocoa/PassKitSPI.h:
2016-10-14 Dean Jackson <dino@apple.com>
CSS parsing should use Color not RGBA32
https://bugs.webkit.org/show_bug.cgi?id=163423
<rdar://problem/28766903>
Reviewed by Simon Fraser.
Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
In order to allow CSS to use the ExtendedColor variant of
Color, we need to stop using RGBA32. This is a fairly big
change that goes through all the places in the parser
related to colors, and moves them from RGBA32 to Color.
No change in functionality, so covered by existing tests.
* WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
* css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
rather than an unsigned int for colors.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getRGBColorValue):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
* css/CSSPrimitiveValue.h: Move to Color* and also use some
nullptrs.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
constructor.
* css/CSSValuePool.cpp: Move to Color.
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createColorValue):
* css/CSSValuePool.h: Change the ColorValueCache to a new type.
* css/StyleResolver.cpp: Move to Color.
(WebCore::StyleResolver::colorFromPrimitiveValue):
* css/parser/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseColorFromString):
(WebCore::CSSParser::parseSystemColor):
(WebCore::fastParseColorInternal):
(WebCore::CSSParser::fastParseColor):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
(WebCore::CSSParserFastPaths::parseColor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColor):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
* editing/EditingStyle.cpp:
(WebCore::cssValueToColor):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::rgbaBackgroundColorInEffect):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::isTransparentColorValue):
(WebCore::cssValueToRGBA): Deleted.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
remind myself to come back when colorWithOverrideAlpha has been updated.
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::isCurrentColorString):
(WebCore::parseColor):
(WebCore::currentColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/canvas/CanvasStyle.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::colorFromRGBColorString):
* platform/graphics/Color.h: Add new constructors for the special
empty and deleted Color values used in HashTables.
(WebCore::Color::Color):
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
* platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
(WTF::ColorHash::hash):
(WTF::ColorHash::equal):
(WTF::HashTraits<WebCore::Color>::emptyValue):
(WTF::HashTraits<WebCore::Color>::constructDeletedValue):
(WTF::HashTraits<WebCore::Color>::isDeletedValue):
2016-10-14 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Implement basic SVG support
https://bugs.webkit.org/show_bug.cgi?id=163349
Reviewed by Brent Fulgham.
Direct2D needs access to the target graphics context when generating bitmap
images so that it can properly match pixel format and other settings.
Add implementations for a number of drawing primitives used in the SVG
test cases. Correct some differences between CG and Direct2D for drawing
different primitives.
No new tests. Tested by existing 'svg' tests.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex): Take optional target graphics
context. Also pass the graphics context to the image decoder.
(WebCore::BitmapImage::nativeImage): Accept an optional target context.
(WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
(WebCore::BitmapImage::draw): Pass target graphics context to the
'frameImageAtIndex' method.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create): Moved from header. Add create function that
takes an optional GraphicsContext argument.
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageFrameCache.cpp: Add missing include needed to build
under Direct2D.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setDecoderTargetContext): Added.
(WebCore::ImageSource::setRenderTarget): Deleted.
* platform/graphics/ImageSource.h:
* platform/graphics/Pattern.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::endDraw): Log error state instead of crashing
each time.
(WebCore::GraphicsContext::drawEllipse): Ellipses are defined in D2D as a center, an
X-radius, and a Y-radius.
(WebCore::GraphicsContext::applyStrokePattern):
(WebCore::GraphicsContext::applyFillPattern):
(WebCore::GraphicsContext::clearRect): Use 'Clear' function if possible. Don't clear
anything if the clear rect is outside the drawing area.
(WebCore::GraphicsContext::strokeRect): Provide implementation (needed by SVG).
(WebCore::GraphicsContext::platformFillEllipse): Ellipses are defined in D2D as
a center, an X-radius, and a Y-radius.
(WebCore::GraphicsContext::platformStrokeEllipse): Ditto.
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer): Accept optional GraphicsContext argument.
(WebCore::ImageBuffer::ImageBuffer): Ditto.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::setTargetContext): Renamed from 'setRenderTarget'.
(WebCore::ImageDecoder::createFrameImageAtIndex): Take optional GraphicsContext argument.
(WebCore::ImageDecoder::setRenderTarget): Deleted.
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/graphics/win/ImageDirect2D.cpp:
(WebCore::BitmapImage::setRenderTarget): Deleted.
* platform/graphics/win/NativeImageDirect2D.cpp: Add missing include.
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern): Revise for new signature.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass GraphicsContext
to ImageBuffer constructor.
(WebCore::FilterEffectRendererHelper::beginFilterEffect): Pass target context to
filter when allocating backing store.
* rendering/FilterEffectRenderer.h: Add GraphicsContext as argument to constructor.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasFilterThatIsPainting): Supply GraphicsContext argument when
building new FilterEffectRenderer and helper.
(WebCore::RenderLayer::setupFilters): Ditto.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame): Revise to take optional GraphicsContext
argument.
(WebCore::SVGImage::nativeImage): Ditto.
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::nativeImageForCurrentFrame): Ditto.
* svg/graphics/SVGImageForContainer.h:
2016-10-14 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r207319.
Regressed Dromaeo and may have caused crashes under
GuardMalloc (rdar://problem/28780835)
Reverted changeset:
"[Web IDL] Add support for [SameObject] extended attribute"
https://bugs.webkit.org/show_bug.cgi?id=163414
http://trac.webkit.org/changeset/207319
2016-10-14 Anders Carlsson <andersca@apple.com>
Clean up BackForwardClient
https://bugs.webkit.org/show_bug.cgi?id=163454
Reviewed by Sam Weinig.
Remove iOS specific member functions that are only used from WebKit.
* history/BackForwardClient.h:
* loader/EmptyClients.cpp:
2016-10-13 Anders Carlsson <andersca@apple.com>
Move BackForwardList from WebCore to WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=163418
Reviewed by Tim Horton.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::BackForwardController):
* history/BackForwardController.h:
* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
* page/Page.cpp:
(WebCore::Page::Page):
2016-10-14 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Changing the argument on fit-content() doesn't cause the grid to be relayout
https://bugs.webkit.org/show_bug.cgi?id=163434
Reviewed by Sergio Villar Senin.
When fit-content() was implemented a new attribute
m_fitContentTrackBreadth was added to GridTrackSize.
However we forgot to include it in the == operator implementation,
so we were missing the changes on that value.
Now if you change the argument of a fit-content() track,
the track size is properly recomputed.
Test: fast/css-grid-layout/grid-change-fit-content-argument.html
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::operator==): Check m_fitContentTrackBreadth.
2016-10-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207317.
https://bugs.webkit.org/show_bug.cgi?id=163448
This change caused an existing LayoutTest to fail on all
platforms (Requested by ryanhaddad on #webkit).
Reverted changeset:
"CSS parsing should use Color not RGBA32"
https://bugs.webkit.org/show_bug.cgi?id=163423
http://trac.webkit.org/changeset/207317
2016-10-14 Antti Koivisto <antti@apple.com>
Share inline stylesheets between shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163353
Reviewed by Ryosuke Niwa and Andreas Kling.
If shadow trees have identical inline stylesheets the data structures can be shared.
In future this will also allow sharing style resolvers.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::createInline):
Move StyleSheetContents construction to the client.
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
(WebCore::CSSParserContextHash::equal):
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
Make CSSParserContext hashable.
* dom/ExtensionStyleSheets.cpp:
(WebCore::createExtensionsStyleSheet):
(WebCore::ExtensionStyleSheets::pageUserSheet):
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
Don't use CSSStyleSheet::createInline, these are not really inline stylesheets.
Code cleanups.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForForElement):
(WebCore::makeInlineStyleSheetCacheKey):
(WebCore::inlineStyleSheetCache):
Implement a simple cache for sharing stylesheets with identical text and context.
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::clearCache):
* dom/InlineStyleSheetOwner.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2016-10-14 Chris Dumez <cdumez@apple.com>
[Mac] Allow throttling of background tabs that have media elements with no audible audio
https://bugs.webkit.org/show_bug.cgi?id=163402
<rdar://problem/28056151>
Reviewed by Gavin Barraclough.
Allow throttling of background tabs that have media elements with no audible audio.
We were taking an media assertion from the PageThrottler as soon as there was a
media element playing on the page. This prevented throttling of background tabs
even if those media elements had no audible audio, which was unfortunate.
We now have more fine-grained rules for when HTMLMediaElement should take an
assertion. I also added release logging to help debug such issues in the
future.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::updateAudioAssertionState):
(WebCore::HTMLMediaElement::effectiveMuted): Deleted.
* html/HTMLMediaElement.h:
2016-10-14 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Cleanup patch, fix small inconsistencies
https://bugs.webkit.org/show_bug.cgi?id=163329
Reviewed by Youenn Fablet.
Cleanup patch, fixed 3 small inconsistences between implementation and spec.
No change in behaviour.
* Modules/streams/ReadableStream.idl: Added optional parameter in getReader.
* Modules/streams/ReadableStreamDefaultController.js:
(error): Call readableStreamDefaultControllerError instead of readableStreamError.
* Modules/streams/ReadableStreamInternals.js: Added missing ASSERT in readableStreamDefaultControllerCallPullIfNeeded.
2016-10-14 Youenn Fablet <youenn@apple.com>
http://trac.webkit.org/changeset/207330 broke Mac Windows build
https://bugs.webkit.org/show_bug.cgi?id=163442
Unreviewed.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy): Do not explicitly use CFURLRequestCachePolicy enumeration values.
2016-10-14 Zan Dobersek <zdobersek@igalia.com>
[Cairo] GraphicsContext3D::ImageExtractor fails to extract images
https://bugs.webkit.org/show_bug.cgi?id=163439
Reviewed by Carlos Garcia Campos.
In the Cairo implementation of GraphicsContext3D::ImageExtractor,
don't check for frame completeness at index 0. This information
is now cached only after the frame for that index is decoded and
marked as completed, which is done after this check.
Becuase of this the current check forces extractImage() to return
early and abort WebGL texture uploads from image sources.
This bug was most likely exposed after the refactoring in r206481.
https://trac.webkit.org/changeset/206481
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2016-10-14 Youenn Fablet <youenn@apple.com>
MediaResourceLoader should use CachedResource::ressourceError to do CORS checks
https://bugs.webkit.org/show_bug.cgi?id=163279
Reviewed by Darin Adler.
Covered by existing tests.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived): Making use of CachedResource::ressourceError to detect CORS failures.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Activating loader options checks
before reusing the resource.
(WebCore::isResourceSuitableForDirectReuse): Disabling direct reuse of MediaResource since reuse of raw
resources does not work yet for media resources.
2016-10-14 Youenn Fablet <youenn@apple.com>
Make NetworkCache aware of fetch cache mode
https://bugs.webkit.org/show_bug.cgi?id=163332
Reviewed by Antti Koivisto.
Tests: imported/w3c/web-platform-tests/fetch/api/request/request-cache-default-conditional.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-default.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-force-cache.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-cache.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-store.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html
imported/w3c/web-platform-tests/fetch/api/request/request-cache-reload.html
* loader/cache/CachedResourceLoader.cpp:
(WebCore::updateRequestAccordingCacheMode): Setting request cache policy according cache mode.
Basically, these two are about the same.
(WebCore::CachedResourceLoader::determineRevalidationPolicy): Making use of cache policy instead of cache mode.
* platform/network/ResourceRequestBase.h: Adding new cache policies, aligned with fetch cache modes.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy): If policy is not supported by CFNetwork, fallback to ReloadIgnoringCacheData.
This is the best approximate we might find.
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest): Only updating cache policy, if cache policy is the default.
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cocoa/ResourceRequestCocoa.mm: Doing the same modifications as for ResourceRequestCFNet.
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::toPlatformRequestCachePolicy):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
2016-10-13 Youenn Fablet <youenn@apple.com>
Binding generated code for private operations should assert for casted-this checks
https://bugs.webkit.org/show_bug.cgi?id=163326
Reviewed by Darin Adler.
Covered by existing tests.
Private operations are not exposed to user scripts and are only called by built-in scripts or other WebKit-controlled code.
The call sites already ensure that the caller is of the right type so there is no need to do that work twice.
Introducing a casted-this-error Assert mode for casted-this checks, which may be reused for other binding generated code.
Updated binding generator to use that mode for private operations.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::callPromiseOperation):
(WebCore::BindingCaller::callOperation):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionPrivateMethod):
2016-10-13 Carlos Garcia Campos <cgarcia@igalia.com>
WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
https://bugs.webkit.org/show_bug.cgi?id=146306
Reviewed by Darin Adler.
Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
different URL than the previous one.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setRequest):
2016-10-13 Youenn Fablet <youenn@apple.com>
Update serializer and iterator binding generated code
https://bugs.webkit.org/show_bug.cgi?id=163325
Reviewed by Darin Adler.
No change of behavior.
Covered by existing tests and rebased binding generated code.
Making use of BindingCaller::callOperation within serializer and iterator operations.
Refactored serializer code to use direct attribute getters.
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorCreate):
(WebCore::iteratorForEach):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
(GenerateImplementationIterableFunctions):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
(WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
(WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
(WebCore::jsTestIterablePrototypeFunctionEntries):
(WebCore::jsTestIterablePrototypeFunctionKeysCaller):
(WebCore::jsTestIterablePrototypeFunctionKeys):
(WebCore::jsTestIterablePrototypeFunctionValuesCaller):
(WebCore::jsTestIterablePrototypeFunctionValues):
(WebCore::jsTestIterablePrototypeFunctionForEachCaller):
(WebCore::jsTestIterablePrototypeFunctionForEach):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
(WebCore::jsTestNodePrototypeFunctionSymbolIterator):
(WebCore::jsTestNodePrototypeFunctionEntriesCaller):
(WebCore::jsTestNodePrototypeFunctionEntries):
(WebCore::jsTestNodePrototypeFunctionKeysCaller):
(WebCore::jsTestNodePrototypeFunctionKeys):
(WebCore::jsTestNodePrototypeFunctionValuesCaller):
(WebCore::jsTestNodePrototypeFunctionValues):
(WebCore::jsTestNodePrototypeFunctionForEachCaller):
(WebCore::jsTestNodePrototypeFunctionForEach):
(WebCore::jsTestNodePrototypeFunctionToJSON):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSON):
2016-10-13 Alex Christensen <achristensen@webkit.org>
Fix API test after r207318.
https://bugs.webkit.org/show_bug.cgi?id=162951
This fixes the API test WebKit2.PendingAPIRequestURL which asserted when trying to hash a null String.
* loader/DocumentLoader.cpp:
(WebCore::isRemoteWebArchive):
If the mimeType is a null String, it is not in the set webArchiveMIMETypes, so return false instead of hashing it.
2016-10-13 Alex Christensen <achristensen@webkit.org>
Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
https://bugs.webkit.org/show_bug.cgi?id=163413
Reviewed by Tim Horton.
This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
in the hosts of URLs with unrecognized schemes. Safari treats such characters as the host, while Firefox
and Chrome treat such characters as part of the path, starting with the "//" after the ':'
Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
Covered by updated API and layout tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::percentDecode):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::hasInvalidDomainCharacter):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::formURLDecode):
(WebCore::percentDecode): Deleted.
(WebCore::domainToASCII): Deleted.
(WebCore::hasInvalidDomainCharacter): Deleted.
(WebCore::formURLDecode): Deleted.
* platform/URLParser.h:
2016-10-13 Chris Dumez <cdumez@apple.com>
[Web IDL] Add support for [SameObject] extended attribute
https://bugs.webkit.org/show_bug.cgi?id=163414
Reviewed by Darin Adler.
Add support for [SameObject] Web IDL extended attribute:
- https://heycam.github.io/webidl/#SameObject
Start using it on DOM / HTML attributes where the specification
mandates it.
Test: js/dom/SameObject-support.html
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldCacheAttribute):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* dom/DataTransfer.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/MutationRecord.idl:
* dom/Node.idl:
* dom/NodeIterator.idl:
* dom/ParentNode.idl:
* dom/TreeWalker.idl:
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLButtonElement.idl:
* html/HTMLDataListElement.idl:
* html/HTMLDocument.idl:
* html/HTMLElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLIFrameElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLLinkElement.idl:
* html/HTMLMapElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLMeterElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLProgressElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTextAreaElement.idl:
* page/Location.idl:
* page/Navigator.idl:
2016-10-13 Andy Estes <aestes@apple.com>
[iOS] Support Web Archive previews generated by QuickLook
https://bugs.webkit.org/show_bug.cgi?id=162951
<rdar://problem/28607920>
Reviewed by Brady Eidson.
QuickLook might generate a Web Archive preview for some resource types, but WebKit would
refuse to load it due to the prohibition on loading remote Web Archives. Even though the
original resource might be from a remote origin, the QuickLook-generated preview is a
trusted local resource, so allow it to be loaded.
No test possible.
* loader/DocumentLoader.cpp:
(WebCore::isRemoteWebArchive): Added. Moved the remote web archive check from
continueAfterContentPolicy() to here, and added a check for responses containing the
QuickLook preview protocol.
(WebCore::DocumentLoader::continueAfterContentPolicy): Called isRemoteWebArchive().
2016-10-13 Dean Jackson <dino@apple.com>
CSS parsing should use Color not RGBA32
https://bugs.webkit.org/show_bug.cgi?id=163423
<rdar://problem/28766903>
Reviewed by Simon Fraser.
In order to allow CSS to use the ExtendedColor variant of
Color, we need to stop using RGBA32. This is a fairly big
change that goes through all the places in the parser
related to colors, and moves them from RGBA32 to Color.
No change in functionality, so covered by existing tests.
* WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
* css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
rather than an unsigned int for colors.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getRGBColorValue):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
* css/CSSPrimitiveValue.h: Move to Color* and also use some
nullptrs.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
constructor.
* css/CSSValuePool.cpp: Move to Color.
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createColorValue):
* css/CSSValuePool.h: Change the ColorValueCache to a new type.
* css/StyleResolver.cpp: Move to Color.
(WebCore::StyleResolver::colorFromPrimitiveValue):
* css/parser/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseColorFromString):
(WebCore::CSSParser::parseSystemColor):
(WebCore::fastParseColorInternal):
(WebCore::CSSParser::fastParseColor):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
(WebCore::CSSParserFastPaths::parseColor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColor):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
* editing/EditingStyle.cpp:
(WebCore::cssValueToColor):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::rgbaBackgroundColorInEffect):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::isTransparentColorValue):
(WebCore::cssValueToRGBA): Deleted.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
remind myself to come back when colorWithOverrideAlpha has been updated.
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::isCurrentColorString):
(WebCore::parseColor):
(WebCore::currentColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/canvas/CanvasStyle.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::colorFromRGBColorString):
* platform/graphics/Color.h: Add new constructors for the special
empty and deleted Color values used in HashTables.
(WebCore::Color::Color):
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
* platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
(WTF::ColorHash::hash):
(WTF::ColorHash::equal):
(WTF::HashTraits<WebCore::Color>::emptyValue):
(WTF::HashTraits<WebCore::Color>::constructDeletedValue):
(WTF::HashTraits<WebCore::Color>::isDeletedValue):
2016-10-13 Nan Wang <n_wang@apple.com>
AX: [Mac] better accessibility support for Summary elements
https://bugs.webkit.org/show_bug.cgi?id=163367
<rdar://problem/28745010>
Reviewed by Chris Fleizach.
Exposed summary elements as AXButton and used the text node's content
as AXTitle. Also exposed the details parent's expanded status on the summary
element, so that users would see it as a collapsed/expanded button.
Changes are covered in the modified tests.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::parentObjectUnignored):
(WebCore::AccessibilityObject::scrollViewAncestor):
(WebCore::AccessibilityObject::headingElementForNode):
(WebCore::AccessibilityObject::matchedParent):
(WebCore::AccessibilityObject::isDescendantOfObject):
(WebCore::AccessibilityObject::isInsideARIALiveRegion):
(WebCore::AccessibilityObject::elementAccessibilityHitTest):
(WebCore::AccessibilityObject::isExpanded):
(WebCore::AccessibilityObject::isARIAHidden):
(WebCore::AccessibilityObject::focusableAncestor):
(WebCore::AccessibilityObject::editableAncestor):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isSummary):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
(-[WebAccessibilityObjectWrapper tableCellParent]):
(-[WebAccessibilityObjectWrapper tableParent]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
(-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
(-[WebAccessibilityObjectWrapper detailParentForObject:]):
(matchedParent): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2016-10-13 Zalan Bujtas <zalan@apple.com>
[Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails.
https://bugs.webkit.org/show_bug.cgi?id=163399
Reviewed by David Hyatt.
When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic
should dismiss the RenderTable as the parent and find a more appropriate ancestor.
RenderTables assumes a certain descendant tree structure which might not be available in the continuation.
Will be testable with webkit.org/b/162834
* rendering/RenderInline.cpp:
(WebCore::canUseAsParentForContinuation):
(WebCore::RenderInline::addChildToContinuation):
2016-10-13 Alex Christensen <achristensen@webkit.org>
Disable URLParser for non-Safari iOS and Mac apps for now
https://bugs.webkit.org/show_bug.cgi?id=163397
Reviewed by Tim Horton.
r207268 was an awful hack, and it was insufficient.
Disable the URLParser for other apps for now. Hopefully we can enable it everywhere soon.
No change in behavior for testing infrastructure.
Old URLs were well tested before making the switch, and nothing has changed for them.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* platform/URLParser.h:
2016-10-13 Chris Dumez <cdumez@apple.com>
Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*]
https://bugs.webkit.org/show_bug.cgi?id=163390
Reviewed by Darin Adler.
Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*] as the
modern way of doing this is to use a constructor that takes in a
dictionary. I am working on getting rid of this extended attribute
entirely but the remaining uses require better support for union types.
* Modules/applepay/ApplePayValidateMerchantEvent.idl:
* Modules/indexeddb/IDBVersionChangeEvent.idl:
* Modules/mediastream/RTCTrackEvent.idl:
* bindings/scripts/CodeGenerator.pm:
(IsConstructorTemplate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition):
(IsConstructable):
* bindings/scripts/IDLAttributes.txt:
* dom/Event.idl:
* dom/ProgressEvent.idl:
* dom/UIEvent.idl:
* html/track/TrackEvent.idl:
2016-10-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207297.
This change broke the iOS build.
Reverted changeset:
"Disable URLParser for non-Safari iOS and Mac apps for now"
https://bugs.webkit.org/show_bug.cgi?id=163397
http://trac.webkit.org/changeset/207297
2016-10-13 Anders Carlsson <andersca@apple.com>
Get rid of the HistoryItemVector typedef
https://bugs.webkit.org/show_bug.cgi?id=163398
Reviewed by Beth Dakin.
Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
* history/BackForwardList.cpp:
(WebCore::BackForwardList::backListWithLimit):
(WebCore::BackForwardList::forwardListWithLimit):
(WebCore::BackForwardList::entries):
* history/BackForwardList.h:
* history/HistoryItem.cpp:
(WebCore::HistoryItem::children):
* history/HistoryItem.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentFramesMatchItem):
2016-10-13 Antoine Quint <graouts@apple.com>
[Modern Media Controls] MediaControls base class
https://bugs.webkit.org/show_bug.cgi?id=163387
<rdar://problem/28753955>
Reviewed by Dean Jackson.
Introducing the new MediaControls class which will serve as a basis for all media controls.
We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
iOS inline in future patches.
Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
media/modern-media-controls/media-controls/media-controls-placard.html
media/modern-media-controls/media-controls/media-controls-start-button.html
* Modules/modern-media-controls/controls/media-controls.css: Added.
(.media-controls,):
* Modules/modern-media-controls/controls/media-controls.js: Added.
(MediaControls.):
(MediaControls.prototype.get showsStartButton):
(MediaControls.prototype.set showsStartButton):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.showPlacard):
(MediaControls.prototype.hidePlacard):
2016-10-13 Alex Christensen <achristensen@webkit.org>
Disable URLParser for non-Safari iOS and Mac apps for now
https://bugs.webkit.org/show_bug.cgi?id=163397
Reviewed by Tim Horton.
r207268 was an awful hack, and it was insufficient.
Disable the URLParser for other apps for now. Hopefully we can enable it everywhere soon.
No change in behavior for testing infrastructure.
Old URLs were well tested before making the switch, and nothing has changed for them.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* platform/URLParser.h:
2016-10-13 Antoine Quint <graouts@apple.com>
[Modern Media Controls] TimeControl and TimeLabel
https://bugs.webkit.org/show_bug.cgi?id=163356
<rdar://problem/28741376>
Reviewed by Dean Jackson.
We introduce the TimeControl and TimeLabel classes. A TimeControl object
provides two TimeLabels, one for the elapsed time, one for the remaining
time, and a Scrubber in between them. Depending on a TimeControl's width,
it will adjust its layout such that the scrubber takes all the available
space between the labels, and can indicate whether it's large enough to
meet the minimal required width to show the scrubber, such that a container
node may decide not to show the TimeControl at all.
TimeLabel nodes simply show an integer time value in miliseconds in a
nicely formatted way.
Tests: media/modern-media-controls/time-control/time-control.html
media/modern-media-controls/time-label/time-label.html
* Modules/modern-media-controls/controls/time-control.js: Added.
(TimeControl.prototype.get width):
(TimeControl.prototype.set width):
(TimeControl.prototype.get isSufficientlyWide):
* Modules/modern-media-controls/controls/time-label.css: Added.
(.time-label):
* Modules/modern-media-controls/controls/time-label.js: Added.
(TimeLabel.prototype.get value):
(TimeLabel.prototype.set value):
(TimeLabel.prototype.commitProperty):
(TimeLabel.prototype._formattedTime):
2016-10-13 Jer Noble <jer.noble@apple.com>
CRASH at WebCore::SourceBuffer::removeCodedFrames + 37
https://bugs.webkit.org/show_bug.cgi?id=163336
Reviewed by Alex Christensen.
Test: media/media-source/media-source-remove-crash.html
A null-deref crash can occur if a SourceBuffer is removed from a MediaSource after
SourceBuffer.remove() is called, but before the removeTimer is fired.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeTimerFired):
2016-10-13 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] SHOULD NEVER BE REACHED ../../Source/WebCore/platform/URL.cpp(1291) : void WebCore::URL::parse(const WTF::String&)
https://bugs.webkit.org/show_bug.cgi?id=163392
Reviewed by Alex Christensen.
Fix the URL constructor to work with URLParser.
* platform/soup/URLSoup.cpp:
(WebCore::URL::URL):
2016-10-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207286.
Caused LayoutTest http/tests/misc/acid3.html to fail.
Reverted changeset:
"Share inline stylesheets between shadow trees"
https://bugs.webkit.org/show_bug.cgi?id=163353
http://trac.webkit.org/changeset/207286
2016-10-13 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Use min-size instead of min-content contribution for intrinsic maximums resolution
https://bugs.webkit.org/show_bug.cgi?id=163283
Reviewed by Manuel Rego Casasnovas.
This was recently modified in the specs
https://hg.csswg.org/drafts/diff/575fb847e29d/css-grid/Overview.bs. Specifically this is
addressing the last one. It used to be "min-content contribution" but now it says "min-size
contribution".
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
2016-10-11 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Fix intrinsic maximums resolution with fit-content and auto
https://bugs.webkit.org/show_bug.cgi?id=163282
Reviewed by Manuel Rego Casasnovas.
The step 2.5 in section 12.5 https://drafts.csswg.org/css-grid/#algo-content of the specs,
details how to sizes tracks with intrinsic max track sizing functions.
Not so long ago there were only two max track sizing functions min-content and max-content
(auto was always resolved to max-content). However there were some recent changes that force
us to consider 2 new values: auto (which is not internally translated to max-content
although it still works the same) and specially the newly added fit-content.
Some of the new test cases are commented due to bug http://wkb.ug/163283.
Test: fast/css-grid-layout/grid-intrinsic-maximums.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
(WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
(WebCore::GridTrackSize::hasIntrinsicMaxTrackBreadth):
(WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
2016-10-13 Miguel Gomez <magomez@igalia.com>
[GTK] Video playback doesn't work properly with accelerated compositing disabled
https://bugs.webkit.org/show_bug.cgi?id=163386
Reviewed by Carlos Garcia Campos.
Trigger a repaint of the player when a new frame arrives and accelerated compositing is disabled.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2016-10-13 Antti Koivisto <antti@apple.com>
Share inline stylesheets between shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163353
Reviewed by Ryosuke Niwa and Andreas Kling.
If shadow trees have identical inline stylesheets the data structures can be shared.
In future this will also allow sharing style resolvers.
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
(WebCore::CSSParserContextHash::equal):
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
(WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
Make CSSParserContext hashable.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::makeInlineStyleSheetCacheKey):
(WebCore::inlineStyleSheetCache):
Implement a simple cache for sharing stylesheets with identical text and context.
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::clearCache):
* dom/InlineStyleSheetOwner.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
2016-10-13 Antti Koivisto <antti@apple.com>
Revert patch landed with wrong commit message.
2016-10-12 Per Arne Vollan <pvollan@apple.com>
[Win] Encode function pointers.
https://bugs.webkit.org/show_bug.cgi?id=163331
Reviewed by Brent Fulgham.
We should encode stored function pointers.
* platform/win/SoftLinking.h:
2016-10-13 Youenn Fablet <youenn@apple.com>
Remove CachedResourceRequest::mutableResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=163277
Reviewed by Sam Weinig.
No change of behavior.
Removing CachedResourceRequest::mutableResourceRequest requires call sites to either update the ResourceRequest
before creating the CachedResourceRequest or to add methods at CachedResourceRequest.
Adding CachedResourceRequest::releaseResourceRequest for CachedResource constructor.
Most new CachedResourceRequest methods are used by CachedResourceLoader which is passed a CachedResourceRequest.
This allows code in CachedResourceLoader to be easier to read.
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::loadBestFitImage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::loadImage):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestScriptWithCache):
* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):
(WebCore::CrossOriginPreflightChecker::doPreflight):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::prepareFetch):
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::acceptHeaderValueFromType): Deleted.
(WebCore::updateRequestAccordingCacheMode): Deleted.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
(WebCore::CachedResourceRequest::updateForAccessControl):
(WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
(WebCore::CachedResourceRequest::setDomainForCachePartition):
(WebCore::acceptHeaderValueFromType):
(WebCore::CachedResourceRequest::setAcceptHeaderIfNone):
(WebCore::CachedResourceRequest::updateAccordingCacheMode):
(WebCore::CachedResourceRequest::removeFragmentIdentifierIfNeeded):
(WebCore::CachedResourceRequest::applyBlockedStatus):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::releaseResourceRequest):
(WebCore::CachedResourceRequest::setCachingPolicy):
(WebCore::CachedResourceRequest::mutableResourceRequest): Deleted.
(WebCore::CachedResourceRequest::setCacheModeToNoStore): Deleted.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
2016-10-13 Antti Koivisto <antti@apple.com>
Support scoped style for user agent shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163212
<rdar://problem/28715318>
Reviewed by Ryosuke Niwa and Andreas Kling.
This patch adds support for user agent shadow trees that have scoped style. This means
that the shadows can be styled via <style> elements contained in the tree instead of
using pseudo elements on the global UA sheet. Since the style is scoped it can use
normal id and class selectors.
Elements in the shadow tree can still be exposed for author styling if needed by giving
them pseudo ids
The patch also uses the new mechanism for the <meter> element.
The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
structures. This can be improved later.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/ElementRuleCollector.cpp:
(WebCore::MatchRequest::MatchRequest):
(WebCore::ElementRuleCollector::addMatchedRule):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).
* css/ElementRuleCollector.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::MatchResult::addMatchedProperties):
(WebCore::StyleResolver::CascadedProperties::addImportantMatches):
* css/StyleResolver.h:
* css/html.css:
(meter::-webkit-meter-inner-element): Deleted.
(meter::-webkit-meter-bar): Deleted.
(meter::-webkit-meter-optimum-value): Deleted.
(meter::-webkit-meter-suboptimum-value): Deleted.
(meter::-webkit-meter-even-less-good-value): Deleted.
Remove meter pseudo elements from the UA sheet.
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::childShouldCreateRenderer):
Don't create shadow renderers when we have appearance (are using RenderMeter).
(WebCore::setValueClass):
Move this logic here from MeterShadowElement.cpp.
Set both class and pseudo id. The latter is needed to keep author styling working.
(WebCore::HTMLMeterElement::didElementStateChange):
(WebCore::HTMLMeterElement::renderMeter):
RenderMeter is now only instantiated when appearance is enabled.
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
Build the shadow tree out of <div>s instead of special shadow elements.
* html/HTMLMeterElement.h:
* html/shadow/MeterShadowElement.cpp: Removed.
* html/shadow/MeterShadowElement.h: Removed.
Not needed anymore.
* html/shadow/meterElementShadow.css: Added.
(div#inner):
(div#bar):
(div#value):
(div#value.optimum):
(div#value.suboptimum):
(div#value.even-less-good):
Stylesheet for meter element shadow tree using normal id and class selectors.
* style/StyleScope.cpp:
(WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):
* style/StyleScope.h:
2016-10-12 Chris Dumez <cdumez@apple.com>
[Web IDL] Drop support for legacy [ConstructorConditional=*]
https://bugs.webkit.org/show_bug.cgi?id=163368
Reviewed by Ryosuke Niwa.
Drop support for legacy [ConstructorConditional=*] webkit-specific IDL
extended attribute. This was introduced to disable DOM4 event
constructors at compile time. However, nowadays, those constructors are
enabled everywhere.
* Configurations/FeatureDefines.xcconfig:
* bindings/scripts/CodeGenerator.pm:
(GenerateConstructorConditionalString): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::getConstructData): Deleted.
* bindings/scripts/test/TestInterface.idl:
* dom/UIEvent.idl:
2016-10-12 Chris Dumez <cdumez@apple.com>
The bindings generator should provide a better error message when it does not find a dictionary definition
https://bugs.webkit.org/show_bug.cgi?id=163377
Reviewed by Ryosuke Niwa.
The bindings generator should provide a better error message when it does
not find a dictionary definition.
* bindings/scripts/CodeGenerator.pm:
(GetDictionaryByName):
* bindings/scripts/CodeGeneratorJS.pm:
(assert):
(GenerateDictionaryImplementationContent):
(GenerateHeader):
(GenerateDictionaryHeader):
2016-10-12 Chris Dumez <cdumez@apple.com>
Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163369
Reviewed by Ryosuke Niwa.
Update WebKitMediaKeyMessageEvent / WebKitMediaKeyNeededEvent to stop
using legacy [ConstructorTemplate=Event] and use regular constructors
instead.
This also adds support for having dictionary members that are typed
arrays because this was needed.
Test: fast/events/webkit-media-key-events-constructor.html
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
(WebCore::WebKitMediaKeyMessageEvent::create):
(WebCore::WebKitMediaKeyMessageEvent::createForBindings): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
(WebCore::WebKitMediaKeyNeededEvent::create):
(WebCore::WebKitMediaKeyNeededEvent::createForBindings): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
2016-10-12 Chris Dumez <cdumez@apple.com>
Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
https://bugs.webkit.org/show_bug.cgi?id=163358
Reviewed by Kent Tamura.
Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements.
As per the specification, we only want optgroup elements that are direct
children of the select element. This also matches the behavior of Chrome.
Test: fast/dom/HTMLSelectElement/nested-optgroup.html
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::recalcListItems):
2016-10-12 Zalan Bujtas <zalan@apple.com>
RenderRubyRun should not mark child renderers dirty at the end of layout.
https://bugs.webkit.org/show_bug.cgi?id=163359
<rdar://problem/28711840>
Reviewed by David Hyatt.
The current layout logic does not support marking renderers dirty for subsequent layouts.
Layout needs to exit with a clean tree.
Should relayoutChild be insufficient, we could also mark the base/text dirty for the justified content.
Test: fast/ruby/rubyrun-has-bad-child.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateRubyForJustifiedText):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layout):
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderRubyRun.h:
2016-10-12 Simon Fraser <simon.fraser@apple.com>
Crash when using megaplan.ru
https://bugs.webkit.org/show_bug.cgi?id=163276
rdar://problem/28446672
Reviewed by Sam Weinig.
Make sure we allocate enough space in the vector of CGPoints that we use for path building.
Test: css3/masking/large-clip-path.html
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::polygonPathFromPoints):
2016-10-12 Alex Christensen <achristensen@webkit.org>
Fix out-of-bounds reading in URLParser when parsing improperly percent-encoded values
https://bugs.webkit.org/show_bug.cgi?id=163376
Reviewed by Saam Barati.
Covered by new API tests, which used to crash under asan.
* platform/URLParser.cpp:
(WebCore::percentDecode):
If you subtract 2 from size_t's smaller than 2, you're gonna have a bad time.
2016-10-12 Alex Christensen <achristensen@webkit.org>
Mail needs nonspecial URLs to keep case in host and not have slash after host
https://bugs.webkit.org/show_bug.cgi?id=163373
Reviewed by Saam Barati.
Mail uses urls like scheme://HoSt which were not changed when canonicalized
before enabling the URLParser but now are canonicalized to scheme://host/
I manually verified this fixes the issue.
This should be reverted once Mail will accept modern canonicalized URLs.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:
If the application is mail and the scheme is nonspecial, don't make the host lower case and don't add a slash after the host.
2016-10-11 Dean Jackson <dino@apple.com>
Add preliminary support for extended colors to WebCore::Color
https://bugs.webkit.org/show_bug.cgi?id=162878
<rdar://problem/28596413>
Reviewed by Darin Adler.
Add an ExtendedColor class that will hold the data necessary
for wider-than-sRGB (and more precise) colors. In order to
avoid increasing the size of Color, implement a tagged
pointer that is either referencing an ExtendedColor, or
is a 64-bit number with the top 32-bits being the RGBA, and
the bottom 2 bits indicating an invalid RGBA or a valid RGBA,
plus the tag.
Add copy constructors and operator= so that the new Color objects
are correctly copied.
There isn't yet a way to create an ExtendedColor. That's coming
in a followup patch (and will require changes to the CSS parser).
Covered by existing tests, and new API tests in Color.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj: Add new files.
* platform/graphics/Color.cpp: Update everything to use m_rgbaAndFlags
instead of m_color + m_valid.
(WebCore::Color::Color):
(WebCore::Color::~Color):
(WebCore::Color::operator=):
(WebCore::Color::nameForRenderTreeAsText):
(WebCore::Color::setNamedColor):
(WebCore::Color::light):
(WebCore::Color::dark):
(WebCore::Color::setValid):
(WebCore::Color::setExtended):
(WebCore::Color::isExtended):
(WebCore::Color::asExtended):
* platform/graphics/Color.h: Implement the tagged union.
(WebCore::Color::Color):
(WebCore::Color::isValid):
(WebCore::Color::red):
(WebCore::Color::green):
(WebCore::Color::blue):
(WebCore::Color::alpha):
(WebCore::Color::rgb):
(WebCore::Color::setRGB):
(WebCore::operator==):
* platform/graphics/ExtendedColor.cpp: New file. Holds floating point
red, green, blue and alpha, plus a color space.
(WebCore::ExtendedColor::create):
(WebCore::ExtendedColor::~ExtendedColor):
(WebCore::ExtendedColor::ref):
(WebCore::ExtendedColor::deref):
* platform/graphics/ExtendedColor.h:
(WebCore::ExtendedColor::red):
(WebCore::ExtendedColor::green):
(WebCore::ExtendedColor::blue):
(WebCore::ExtendedColor::alpha):
(WebCore::ExtendedColor::colorSpace):
(WebCore::ExtendedColor::ExtendedColor):
* platform/graphics/cg/ColorCG.cpp: Update the constructors for
the platform specific color classes.
(WebCore::Color::Color):
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::Color):
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::Color):
* rendering/RenderEmbeddedObject.cpp: Use NeverDestroyed.
(WebCore::replacementTextRoundedRectPressedColor):
(WebCore::replacementTextRoundedRectColor):
(WebCore::replacementTextColor):
(WebCore::unavailablePluginBorderColor):
* rendering/RenderFrameSet.cpp: Ditto.
(WebCore::borderStartEdgeColor):
(WebCore::borderEndEdgeColor):
(WebCore::borderFillColor):
* rendering/RenderTableCell.cpp: This grows in size slightly
because it can no longer pack bits.
2016-10-12 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Sliders: scrubber and volume
https://bugs.webkit.org/show_bug.cgi?id=163328
<rdar://problem/28733838>
Reviewed by Dean Jackson.
We add a new Slider class that provides a custom slider backed by an
invisible <input type="range"> element and a fill underlay to provide
a custom color between the left edge of the slider and the slider thumb.
As the slider's value changes, a UI delegate receives messages to track
such changes.
Tests: media/modern-media-controls/scrubber/scrubber.html
media/modern-media-controls/slider/slider-constructor.html
media/modern-media-controls/slider/slider-fill.html
media/modern-media-controls/slider/slider-styles.html
media/modern-media-controls/volume-slider/volume-slider-value.html
media/modern-media-controls/volume-slider/volume-slider.html
* Modules/modern-media-controls/controls/scrubber.css: Added.
(.scrubber.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/scrubber.js: Added.
(Scrubber):
* Modules/modern-media-controls/controls/slider.css: Added.
(.slider):
(.slider > input,):
(.slider > .fill):
(.slider > input):
(.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/slider.js: Added.
(Slider.prototype.get value):
(Slider.prototype.set value):
(Slider.prototype.get width):
(Slider.prototype.set width):
(Slider.prototype.handleEvent):
(Slider.prototype.commitProperty):
(Slider.prototype._handleInputEvent):
(Slider.prototype._handleChangeEvent):
(Slider.prototype._updateFill):
* Modules/modern-media-controls/controls/volume-slider.css: Added.
(.volume.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/volume-slider.js: Added.
(VolumeSlider):
2016-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
Add experimental support for the "formatForeColor" inputType
https://bugs.webkit.org/show_bug.cgi?id=163348
<rdar://problem/28739334>
Reviewed by Ryosuke Niwa.
Adds support for the "formatForeColor" attribute. This patch introduces a simple hook in Editor.cpp to extract
data for an input event from an EditingStyle when performing an editing action.
Test: fast/events/input-events-forecolor-data.html
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
Added a new static helper to compute the data attribute of an InputEvent when handling a style change.
(WebCore::Editor::computeAndSetTypingStyle):
2016-10-12 Chris Dumez <cdumez@apple.com>
[Web IDL] Generated bindings include the wrong header when ImplementedAs is used on a dictionary
https://bugs.webkit.org/show_bug.cgi?id=163352
Reviewed by Ryosuke Niwa.
Generated bindings include the wrong header when ImplementedAs is used
on a dictionary.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeader):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterCaller):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
(WebCore::convertDictionary<TestStandaloneDictionary>): Deleted.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:
2016-10-12 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore
https://bugs.webkit.org/show_bug.cgi?id=163245
Reviewed by Filip Pizlo.
Node.nodeType accessor is so frequently called. For example, jQuery's $ function uses
this to distinguish DOM objects from the other JS objects. So every time you call `$(dom)`,
nodeType accessor is called. In addition to that, jQuery's prev, next, parent etc. also uses
this `nodeType`. And Ember.js also uses it. And ... So this function is super critical for DOM
performance.
The challenge is that there is no room for putting NodeType into C++ Node class. Node class
has a 32bit field to store some data. However, these bits are already exhausted. Extending
Node class is unacceptable since it significantly enlarges memory consumption of WebKit (Node
is everywhere!). Unfortunately, current Node::nodeType is implemented as a virtual function
even though this function is frequently called from JS world.
Interestingly, we already store some duplicate data in JSObject, JSC::JSType. WebCore already
extends it with JSElementType, JSNodeType, and JSDocumentWrapperType. And these types are
corresponding to specific NodeTypes. For example, JSElementType should have ELEMENT_NODE type.
This patch further extends this JSC::JSType in WebCore side safely. We embed NodeType bits into
JSC::JSType. This design offers significantly faster nodeType implementation. Furthermore, it
makes DOMJIT easy for nodeType accessor.
Even without the IC change[1], Dromaeo dom-query shows 8 - 10% improvement,
1452.96 runs/s vs 1578.56 runs/s. We can expect that this improvement will be applied to the
other benchmarks / real applications when the IC change is landed.
[1]: https://bugs.webkit.org/show_bug.cgi?id=163226
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSNodeCustom.h:
(WebCore::JSNode::nodeType):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSTypeForNode):
(GenerateHeader):
* dom/Node.idl:
* dom/NodeConstants.h: Copied from Source/JavaScriptCore/domjit/DOMJITGetterSetter.h.
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
(WebCore::NodeNodeTypeDOMJIT::checkDOM):
(WebCore::NodeNodeTypeDOMJIT::callDOM):
2016-10-12 Chris Dumez <cdumez@apple.com>
Update more events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163339
Reviewed by Ryosuke Niwa.
Update more events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.
No new tests, updated existing tests.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
(WebCore::JSTestEventConstructorConstructor::construct):
(WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
(WebCore::JSTestEventConstructor::JSTestEventConstructor):
(WebCore::JSTestEventConstructor::createPrototype):
(WebCore::JSTestEventConstructorPrototype::create): Deleted.
(WebCore::JSTestEventConstructorPrototype::createStructure): Deleted.
(WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): Deleted.
(WebCore::setJSTestEventConstructorConstructor): Deleted.
(WebCore::JSTestEventConstructor::getConstructor): Deleted.
* bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::wrapped):
(WebCore::JSTestEventConstructor::create): Deleted.
(WebCore::toJS): Deleted.
(WebCore::toJSNewlyCreated): Deleted.
* bindings/scripts/test/TestEventConstructor.idl:
* css/CSSFontFaceLoadEvent.cpp:
(WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent):
* css/CSSFontFaceLoadEvent.h:
* css/CSSFontFaceLoadEvent.idl:
* html/canvas/WebGLContextEvent.cpp:
(WebCore::WebGLContextEvent::WebGLContextEvent):
* html/canvas/WebGLContextEvent.h:
* html/canvas/WebGLContextEvent.idl:
* storage/StorageEvent.cpp:
(WebCore::StorageEvent::create):
(WebCore::StorageEvent::StorageEvent):
* storage/StorageEvent.h:
* storage/StorageEvent.idl:
2016-10-12 Andreas Kling <akling@apple.com>
Make Document::existingAXObjectCache() fast with accessibility disabled.
<https://webkit.org/b/163347>
Reviewed by Antti Koivisto.
Instruments says we were spending 2.3% of Dromaeo/dom-modify.html in this function,
traversing ancestors. Track whether we've ever had a cache, and use that knowledge
to return early if possible.
* dom/Document.cpp:
(WebCore::Document::existingAXObjectCache):
(WebCore::Document::axObjectCache):
2016-10-12 Jeremy Huddleston Sequoia <jeremyhu@apple.com>
[SOUP] trunk r207192 fails to compile due to missing std::function being unavailable (missing #include <functional>)
https://bugs.webkit.org/show_bug.cgi?id=163340
Reviewed by Michael Catanzaro.
* platform/network/soup/SoupNetworkSession.h: Add missing #include <functional>
2016-10-12 Brent Fulgham <bfulgham@apple.com>
[WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
https://bugs.webkit.org/show_bug.cgi?id=163149
<rdar://problem/28629774>
Reviewed by Dean Jackson.
Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateVertexAttributes):
2016-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
Now playing media sessions are always cleared for the active foreground tab
https://bugs.webkit.org/show_bug.cgi?id=163310
<rdar://problem/28573301>
Reviewed by Jer Noble.
Currently, we clear out Now Playing info whenever we set the visibility of Now Playing controls to Never. This
is incorrect, as the Now Playing session needs to still be active (just not visible) in this state. Instead, we
should not be taking the active/foregrounded-ness of a media session for Now Playing into account in
MediaElementSession::canShowControlsManager so that even if a media session is in the active/foreground tab, we
will update the Now Playing session with the latest info. However, when setting the visibility, we now check
and see if the session allows Now Playing visibility, and set the Now Playing visibility to Always or Never
depending on the answer.
Tweaked existing unit tests in NowPlayingControlsTests.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
(WebCore::MediaElementSession::allowsNowPlayingControlsVisibility):
(WebCore::MediaElementSession::pageAllowsNowPlayingControls): Deleted.
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::allowsNowPlayingControlsVisibility):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2016-10-12 Zalan Bujtas <zalan@apple.com>
Refactor LineLayoutState's float box handling.
https://bugs.webkit.org/show_bug.cgi?id=163286
Reviewed by David Hyatt.
We keep track of float boxes both per line (RootInlineBox::m_floats) and
per flow block (LineLayoutState::m_floats) during layout.
As we lay out the lines and iterate through RootInlineBox::m_floats, we
increment LineLayoutState::m_floatIndex. This LineLayoutState::m_floatIndex is
later used to find the matching float box in the per-block-flow float list.
This logic works fine as long as the lists and the index manipulation are tightly coded.
However due to the complexity of the line/float layout code, this is no longer the case.
This patch makes float box handling more secure by changing this index based setup
to a list iterator. It helps to eliminate potential vector overflow issues.
LineLayoutState::FloatList (new class) keeps track of all the floats for the block flow.
It groups the float box related functions/members and provides an iterator interface to ensure safer
syncing between this and the line based floats.
No change in functionality.
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
(WebCore::repaintDirtyFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::checkFloatInCleanLine):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::determineEndPosition):
(WebCore::RenderBlockFlow::repaintDirtyFloats): Deleted.
(WebCore::RenderBlockFlow::checkFloatsInCleanLine): Deleted.
* rendering/line/LineLayoutState.h:
(WebCore::FloatWithRect::create):
(WebCore::FloatWithRect::renderer):
(WebCore::FloatWithRect::rect):
(WebCore::FloatWithRect::everHadLayout):
(WebCore::FloatWithRect::adjustRect):
(WebCore::FloatWithRect::FloatWithRect):
(WebCore::LineLayoutState::FloatList::append):
(WebCore::LineLayoutState::FloatList::setLastFloat):
(WebCore::LineLayoutState::FloatList::lastFloat):
(WebCore::LineLayoutState::FloatList::setLastCleanFloat):
(WebCore::LineLayoutState::FloatList::lastCleanFloat):
(WebCore::LineLayoutState::FloatList::floatWithRect):
(WebCore::LineLayoutState::FloatList::begin):
(WebCore::LineLayoutState::FloatList::end):
(WebCore::LineLayoutState::FloatList::find):
(WebCore::LineLayoutState::FloatList::isEmpty):
(WebCore::LineLayoutState::LineLayoutState):
(WebCore::LineLayoutState::floatList):
(WebCore::LineLayoutState::lastFloat): Deleted.
(WebCore::LineLayoutState::setLastFloat): Deleted.
(WebCore::LineLayoutState::floats): Deleted.
(WebCore::LineLayoutState::floatIndex): Deleted.
(WebCore::LineLayoutState::setFloatIndex): Deleted.
2016-10-12 Said Abou-Hallawa <sabouhallawa@apple.com>
Unreviewed, fix Windows build break after r207182.
* platform/graphics/cg/ImageDecoderCG.cpp:
2016-10-12 Chris Dumez <cdumez@apple.com>
Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163319
Reviewed by Darin Adler.
Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.
No new tests, updated existing tests.
* dom/AutocompleteErrorEvent.h:
* dom/AutocompleteErrorEvent.idl:
* dom/BeforeLoadEvent.h:
* dom/BeforeLoadEvent.idl:
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::CompositionEvent):
* dom/CompositionEvent.h:
* dom/CompositionEvent.idl:
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::ErrorEvent):
* dom/ErrorEvent.h:
* dom/ErrorEvent.idl:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::FocusEvent):
* dom/FocusEvent.h:
* dom/FocusEvent.idl:
* dom/HashChangeEvent.h:
* dom/HashChangeEvent.idl:
* dom/OverflowEvent.cpp:
(WebCore::OverflowEvent::OverflowEvent):
* dom/OverflowEvent.h:
* dom/OverflowEvent.idl:
* dom/PageTransitionEvent.cpp:
(WebCore::PageTransitionEvent::PageTransitionEvent):
* dom/PageTransitionEvent.h:
* dom/PageTransitionEvent.idl:
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent):
(WebCore::PopStateEvent::create):
* dom/PopStateEvent.h:
* dom/PopStateEvent.idl:
* dom/SecurityPolicyViolationEvent.h:
* dom/SecurityPolicyViolationEvent.idl:
* dom/TouchEvent.cpp:
(WebCore::TouchEvent::TouchEvent):
* dom/TouchEvent.h:
* dom/TouchEvent.idl:
* dom/TransitionEvent.cpp:
(WebCore::TransitionEvent::TransitionEvent):
* dom/TransitionEvent.h:
* dom/TransitionEvent.idl:
* dom/WebKitAnimationEvent.cpp:
(WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
* dom/WebKitAnimationEvent.h:
* dom/WebKitAnimationEvent.idl:
* dom/WebKitTransitionEvent.cpp:
(WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
* dom/WebKitTransitionEvent.h:
* dom/WebKitTransitionEvent.idl:
2016-10-12 Chris Dumez <cdumez@apple.com>
Stop using PassRefPtr in platform/efl
https://bugs.webkit.org/show_bug.cgi?id=163321
Reviewed by Laszlo Gombos.
Stop using PassRefPtr in platform/efl.
* platform/efl/BatteryProviderEfl.cpp:
(WebCore::batteryProperties):
(WebCore::BatteryProviderEfl::setBatteryStatus):
(WebCore::BatteryProviderEfl::dispatchEvent):
* platform/efl/BatteryProviderEfl.h:
* platform/efl/BatteryProviderEflClient.h:
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
(WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
(WebCore::PlatformSpeechSynthesisProviderEfl::speak):
* platform/efl/PlatformSpeechSynthesisProviderEfl.h:
2016-10-12 Youenn Fablet <youenn@apple.com>
Attribute setter binding generated code should use more references
https://bugs.webkit.org/show_bug.cgi?id=163275
Reviewed by Alex Christensen.
No change of behavior.
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2016-10-11 Youenn Fablet <youenn@apple.com>
Refactor binding generated casted-this checks for methods
https://bugs.webkit.org/show_bug.cgi?id=163198
Reviewed by Darin Adler.
Covered by existing tests and binding rebased tests..
Introducing BindingCaller::callMethod and callPromiseMethod to encapsulate casted-this checks for methods.
This is supported for all methods except seralizer and iterators methods.
Introduced castForMethod similarly to castForAttribute.
Moved this from static methods of JSClass to static methods of BindingCaller<JSClass>
This allows removing the corresponding declarations from JSClass header file.
Note the difference of handling thisValue between the two in case of CustomProxyToJSObject.
This should be made more consistent.
In case of bad casted this check, CustomProxyToJSObject objects will throw a TypeError with an error message like other methods.
Before the patch, a TypeError without error message was thrown.
EventTarget being different, added a specialization of BindingCaller for it.
This allows also removing some binding generated code dedicated to EventTarget.
A similar approach might also be done for CustomProxyToJSObject objects to further simplify the binding generator.
* bindings/js/JSDOMBinding.cpp:
(WebCore::rejectPromiseWithThisTypeError):
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::callPromiseMethod):
(WebCore::BindingCaller::callMethod):
* bindings/js/JSEventTargetCustom.h:
(WebCore::BindingCaller<JSEventTarget>::callMethod):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
(GenerateFunctionCastedThis): Deleted.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
2016-10-11 Youenn Fablet <youenn@apple.com>
MediaResourceLoader::requestResource should take a ResourceRequest&& as input
https://bugs.webkit.org/show_bug.cgi?id=160397
Reviewed by Alex Christensen.
No change in behavior.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource): Passing a ResourceRequest&& as input parameter.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h: Ditto.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart): Creating an extra copy since MediaResourceLoader::requestResource expects a Resourcerequest&&.
2016-10-11 Chris Dumez <cdumez@apple.com>
Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163312
Reviewed by Ryosuke Niwa.
Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://drafts.csswg.org/css-animations/#interface-animationevent
* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):
* dom/AnimationEvent.h:
* dom/AnimationEvent.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163311
Reviewed by Ryosuke Niwa.
Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor instead, as in the specification:
- https://www.w3.org/TR/2015/WD-proximity-20150903/#deviceproximityevent-interface
* Modules/proximity/DeviceProximityEvent.cpp:
(WebCore::DeviceProximityEvent::DeviceProximityEvent):
* Modules/proximity/DeviceProximityEvent.h:
(WebCore::DeviceProximityEvent::create):
(WebCore::DeviceProximityEventInit::DeviceProximityEventInit): Deleted.
* Modules/proximity/DeviceProximityEvent.idl:
2016-10-11 Gyuyoung Kim <gyuyoung.kim@webkit.org>
Unreviewed, EFL build fix because of r207173.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::forcedPrefersReducedMotionValue):
2016-10-11 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Add the option to immediately decode an image frame and control its memory caching
https://bugs.webkit.org/show_bug.cgi?id=163298
Reviewed by Simon Fraser.
This patch fixes two things. (1) An option is added to immediately decode an
image frame. This can be done by adding kCGImageSourceShouldCacheImmediately
to the ImageSource options dictionary. (2) BitmapImage should also control
when the image frame is actually deleted from memory. This can be done by
calling CGImageSourceCreateThumbnailAtIndex(). CG does not keep a reference
to the returned CGImageRef.
* platform/graphics/ImageFrame.h: Adding the DecodingMode enum class.
Ideally this should be a member of ImageDecoder class. But since we
have three header files for ImageDecoder, this can be added here till
the three files combined in one header file.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setRenderTarget): Deleted.
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setRenderTarget):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::setRenderTarget): Deleted.
Unrelated change. The native image decoder is available from the ImageSource.
ImageSource::setTarget() does not need not to get it through ImageFrameCache.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions): Clean this function by using CFMutableDictionary.
(WebCore::imageSourceOptions): Cache two default ImageSource options and create new
ones for the non default cases.
(WebCore::ImageDecoder::createFrameImageAtIndex): Use the appropriate ImageSource function
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:
Change functions' signature to include a DecodingMode argument.
2016-10-11 Chris Dumez <cdumez@apple.com>
select.options may return too many option elements
https://bugs.webkit.org/show_bug.cgi?id=163296
Reviewed by Ryosuke Niwa.
select.options may return too many option elements. We're only supposed
to return the option element children of the select element, and the
option element children of all the optgroup element children of the
select element, in tree order:
- https://html.spec.whatwg.org/#dom-select-options
- https://html.spec.whatwg.org/#concept-select-option-list
Firefox and Chrome agrees with the specification. However, WebKit was
returning all the option elements that are descendants of the select
element.
Test: imported/w3c/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html
* html/HTMLOptionsCollection.h:
2016-10-11 Alex Christensen <achristensen@webkit.org>
Fix assertion when creating first WebCore::URL from non-main thread after r207162
https://bugs.webkit.org/show_bug.cgi?id=163304
Reviewed by Filip Pizlo.
This fixes assertions when running UserContentWorld.NormalWorld API tests.
* platform/text/TextEncodingRegistry.cpp:
(WebCore::buildBaseTextCodecMaps):
(WebCore::atomicCanonicalTextEncodingName):
The new URLParser requires a TextEncoding& in its constructor, which defaults to UTF8Encoding.
When creating the first TextEncoding in a process, it calls buildBaseTextCodecMaps which asserts
it's on the main thread because it initializes static variables. Since we are getting a lock right
after this call anyway, just put this function call inside the lock.
2016-10-11 Dean Jackson <dino@apple.com>
color-gamut media query shouldn't ASSERT on invalid values
https://bugs.webkit.org/show_bug.cgi?id=163303
<rdar://problem/28724566>
Reviewed by Simon Fraser.
Remove the ASSERT_NOT_REACHED in the evaluation, since it
can be hit when there is a valid CSS keyword that is not
expected in the query.
Updated fast/media/mq-color-gamut.html
* css/MediaQueryEvaluator.cpp:
(WebCore::colorGamutEvaluate):
2016-10-11 Chris Dumez <cdumez@apple.com>
Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163289
Reviewed by Sam Weinig.
Update MediaStream events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.
* Modules/mediastream/MediaStreamEvent.cpp:
(WebCore::MediaStreamEvent::create):
(WebCore::MediaStreamEvent::MediaStreamEvent):
* Modules/mediastream/MediaStreamEvent.h:
* Modules/mediastream/MediaStreamEvent.idl:
* Modules/mediastream/MediaStreamTrackEvent.cpp:
(WebCore::MediaStreamTrackEvent::create):
(WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
* Modules/mediastream/MediaStreamTrackEvent.h:
* Modules/mediastream/MediaStreamTrackEvent.idl:
* Modules/mediastream/OverconstrainedErrorEvent.h:
(WebCore::OverconstrainedErrorEvent::create):
(WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
(WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent): Deleted.
* Modules/mediastream/OverconstrainedErrorEvent.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
(WebCore::RTCDTMFToneChangeEvent::create):
(WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
* Modules/mediastream/RTCDTMFToneChangeEvent.h:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCTrackEvent.cpp:
(WebCore::RTCTrackEvent::create):
(WebCore::RTCTrackEvent::RTCTrackEvent):
* Modules/mediastream/RTCTrackEvent.h:
* Modules/mediastream/RTCTrackEvent.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163288
Reviewed by Darin Adler.
Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
and use a constructor as in the specification:
- https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent
* Modules/indieui/UIRequestEvent.cpp:
(WebCore::UIRequestEvent::create):
(WebCore::UIRequestEvent::UIRequestEvent):
(WebCore::UIRequestEvent::createForBindings): Deleted.
* Modules/indieui/UIRequestEvent.h:
* Modules/indieui/UIRequestEvent.idl:
2016-10-11 Dean Jackson <dino@apple.com>
Implement prefers-reduced-motion media query
https://bugs.webkit.org/show_bug.cgi?id=163250
<rdar://problem/28704129>
Reviewed by Simon Fraser.
Implement the prefers-reduced-motion media query, as
described in https://github.com/w3c/csswg-drafts/issues/442.
Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
fast/media/mq-prefers-reduced-motion.html
* Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.
* css/CSSValueKeywords.in: New keyword for "reduce".
* css/MediaFeatureNames.h: Add prefers-reduced-motion.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* platform/Theme.h: New API to detect the system accessibility settings.
(WebCore::Theme::userPrefersReducedMotion):
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
(WebCore::ThemeIOS::userPrefersReducedMotion):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::userPrefersReducedMotion):
* testing/Internals.cpp: Expose the same API to internals, so that
a test can examine the value too.
(WebCore::Internals::userPrefersReducedMotion):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion):
* page/Settings.h: New setting to override the system value...
* page/Settings.in:
* testing/InternalSettings.cpp: ... plumbed through internals.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::forcedPrefersReducedMotionValue):
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::userPrefersReducedMotion):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion):
2016-10-10 Ryosuke Niwa <rniwa@webkit.org>
Annotate DOM API with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163268
Reviewed by Darin Adler.
Added CEReactions IDL attribute to APIs defined in https://dom.spec.whatwg.org.
No new tests since existing tests cover the code change.
Added a dedicated code generation test: JSTestCEReactions.idl and TestCEReactionsStringifier.idl.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Generate CustomElementReactionStack in attribute setters. In the case of PutForwards,
check the extended attributes of the target attribute's stringifier.
* bindings/scripts/test/JS/JSTestCEReactions.cpp: Added.
* bindings/scripts/test/JS/JSTestCEReactions.h: Added.
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: Added.
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: Added.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack): Deleted.
* bindings/scripts/test/TestCEReactions.idl: Added.
* bindings/scripts/test/TestCEReactionsStringifier.idl: Added.
* bindings/scripts/test/TestObj.idl:
* dom/Attr.idl:
* dom/ChildNode.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/ParentNode.idl:
* dom/Range.idl:
* html/DOMTokenList.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update CloseEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163293
Reviewed by Darin Adler.
Update CloseEvent to stop using legacy [ConstructorTemplate=Event] and
use a regular constructor as in the specification:
- https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
No new tests, updated existing test.
* Modules/websockets/CloseEvent.h:
(WebCore::CloseEvent::create):
(WebCore::CloseEvent::CloseEvent):
* Modules/websockets/CloseEvent.idl:
2016-10-11 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] DOMJIT::Patchpoint should have a way to receive constant folded arguments
https://bugs.webkit.org/show_bug.cgi?id=163224
Reviewed by Filip Pizlo.
* domjit/DOMJITHelpers.h:
(WebCore::DOMJITHelpers::toWrapper):
* domjit/JSNodeDOMJIT.cpp:
(WebCore::createCallDOMForOffsetAccess):
2016-10-11 Alex Christensen <achristensen@webkit.org>
Enable URLParser by default
https://bugs.webkit.org/show_bug.cgi?id=162660
<rdar://28601706>
Reviewed by Sam Weinig.
Covered by updates to many LayoutTests.
* platform/URLParser.cpp:
Make the default value true for URLParser::enabled.
This is the most impactful and well-documented one-line change I've ever written.
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
https://bugs.webkit.org/show_bug.cgi?id=163244
<rdar://problem/27250015>
Reviewed by Jer Noble.
Adds a new setting to toggle requiring a user gesture to load a video (enabled by default).
Disable this setting for apps built against iOS 9 or earlier.
Tests: media/loadedmetadata-fires-without-user-gesture-when-setRequiresUserGestureToLoadVideo-false.html
media/require-user-gesture-to-load-video.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Only require a user gesture to load a video
when Settings::requiresUserGestureToLoadVideo() is true.
* page/Settings.cpp: Enable setting requiresUserGestureToLoadVideo by default.
* page/Settings.in: Add setting, requiresUserGestureToLoadVideo.
2016-10-11 Sam Weinig <sam@webkit.org>
Fix the iOS build.
* bindings/js/JSDOMConvert.h:
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] Sandbox QuickLook previews
https://bugs.webkit.org/show_bug.cgi?id=163240
<rdar://problem/25961633>
Fix bad merge following r207151.
* platform/network/cf/ResourceResponse.h: Define m_isQuickLook.
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] Sandbox QuickLook previews
https://bugs.webkit.org/show_bug.cgi?id=163240
<rdar://problem/25961633>
Reviewed by Brent Fulgham.
Use a unique origin for- and limit the capabilities of- QuickLook previews.
Tests: http/tests/quicklook/at-import-stylesheet-blocked.html
http/tests/quicklook/base-url-blocked.html
http/tests/quicklook/cross-origin-iframe-blocked.html
http/tests/quicklook/csp-header-ignored.html
http/tests/quicklook/document-domain-is-empty-string.html
http/tests/quicklook/external-stylesheet-blocked.html
http/tests/quicklook/hide-referer-on-navigation.html
http/tests/quicklook/submit-form-blocked.html
http/tests/quicklook/top-navigation-blocked.html
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Call ContentSecurityPolicy::didReceiveHeader().
(WebCore::Document::processReferrerPolicy): Do not process referrer policy for QuickLook previews.
(WebCore::Document::initSecurityContext): Apply sandbox for QuickLook previews.
(WebCore::Document::shouldEnforceQuickLookSandbox): Added.
(WebCore::Document::applyQuickLookSandbox): Added.
* dom/Document.h:
* page/csp/ContentSecurityPolicy.h: Change accessibility of didReceiveHeader() from private to public.
(WebCore::ContentSecurityPolicy::processHTTPEquiv): Deleted.
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::isQuickLook): Added.
(WebCore::ResourceResponse::setIsQuickLook): Added.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Modified to mark
resource response as a QuickLook preview, if appropriate. Also remove the name of the first argument
and the need to use UNUSED_PARAM(connection) as we no longer make use of the first argument
following r207151.
* platform/network/ios/QuickLook.mm:
(-[WebResourceLoaderQuickLookDelegate _sendDidReceiveResponseIfNecessary]): Ditto.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto. Fix style nits,
including renaming the function argument "r" to "resource" to better describe its purpose.
2016-10-11 Alex Christensen <achristensen@webkit.org>
Fix bindings tests after r207150.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
2016-10-11 Alex Christensen <achristensen@webkit.org>
URLParser should percent-encode non-ASCII and non-printable characters in fragment
https://bugs.webkit.org/show_bug.cgi?id=163287
Reviewed by Brady Eidson.
Based on discussion in https://github.com/whatwg/url/issues/150
If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
this change later after enabling the URL parser. Making this change keeps behavior matching Safari
and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.
Covered by updated API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::syntaxViolation):
(WebCore::URLParser::currentPosition):
(WebCore::URLParser::parse):
(WebCore::URLParser::fragmentSyntaxViolation): Deleted.
* platform/URLParser.h:
No more non-ASCII characters in canonicalized URLs.
2016-10-11 Alex Christensen <achristensen@webkit.org>
Remove dead networking code
https://bugs.webkit.org/show_bug.cgi?id=163263
Reviewed by Daniel Bates.
There are no more Cocoa platforms using CFURLConnection.
USE(CFNETWORK) is being replaced by USE(CFURLCONNECTION) and it is only used on the AppleWin port.
No change in behavior.
* WebCore.xcodeproj/project.pbxproj:
* WebCorePrefix.h:
* loader/DocumentLoader.h:
* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cf/ResourceLoaderCFNet.cpp:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponse): Deleted.
* loader/mac/DocumentLoaderMac.cpp:
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponse): Deleted.
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
(WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted.
(WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted.
* platform/mac/WebCoreSystemInterface.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ProtectionSpace.h:
* platform/network/ProtectionSpaceBase.cpp:
* platform/network/ResourceHandle.cpp:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponse):
(WebCore::ResourceHandleClient::shouldCacheResponse):
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/ResourceRequestBase.cpp:
* platform/network/cf/AuthenticationCF.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::createCF):
(WebCore::core):
* platform/network/cf/AuthenticationCF.h:
* platform/network/cf/AuthenticationChallenge.h:
* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage):
(WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
* platform/network/cf/LoaderRunLoopCF.cpp:
* platform/network/cf/LoaderRunLoopCF.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStorage):
* platform/network/cf/ProtectionSpaceCFNet.cpp:
* platform/network/cf/ProtectionSpaceCFNet.h:
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::shouldSniffConnectionProperty):
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::schedule): Deleted.
(WebCore::ResourceHandle::unschedule): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
(WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction): Deleted.
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::cfURLResponse):
(WebCore::ResourceResponse::platformCertificateInfo):
* platform/network/cf/SynchronousLoaderClientCFNet.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
(WebCore::adjustMIMETypeIfNecessary):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/cocoa/CredentialCocoa.h:
* platform/network/cocoa/CredentialCocoa.mm:
(WebCore::Credential::Credential): Deleted.
(WebCore::Credential::cfCredential): Deleted.
* platform/network/cocoa/ProtectionSpaceCocoa.h:
* platform/network/cocoa/ProtectionSpaceCocoa.mm:
(WebCore::ProtectionSpace::ProtectionSpace): Deleted.
(WebCore::ProtectionSpace::cfSpace): Deleted.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::nsURLRequest):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo):
(WebCore::ResourceResponse::nsURLResponse): Deleted.
(WebCore::ResourceResponse::ResourceResponse): Deleted.
* platform/network/ios/QuickLook.h:
* platform/network/ios/QuickLook.mm:
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
(-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
(WebCore::QuickLookHandle::create): Deleted.
(WebCore::QuickLookHandle::cfResponse): Deleted.
* platform/network/ios/ResourceHandleIOS.mm: Removed.
* platform/network/ios/ResourceRequestIOS.mm: Removed.
* platform/network/mac/AuthenticationMac.mm:
(-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted.
(-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted.
(WebCore::core): Deleted.
(WebCore::mac): Deleted.
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
(WebCore::cookieStorage):
(WebCore::addCookie):
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/FormDataStreamMac.h:
* platform/network/mac/FormDataStreamMac.mm:
* platform/network/mac/ResourceErrorMac.mm:
(NSErrorFromCFError): Deleted.
(WebCore::ResourceError::ResourceError): Deleted.
(WebCore::ResourceError::nsError): Deleted.
(WebCore::ResourceError::operator NSError *): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueWillCacheResponse):
(WebCore::ResourceHandle::getConnectionTimingData): Deleted.
* platform/network/mac/ResourceRequestMac.mm: Removed.
* platform/network/mac/SynchronousLoaderClient.mm:
(WebCore::SynchronousLoaderClient::platformBadResponseError):
* platform/network/mac/WebCoreResourceHandleAsDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):
* platform/win/TemporaryLinkStubs.cpp:
* testing/js/WebCoreTestSupportPrefix.h:
2016-10-10 Sam Weinig <sam@webkit.org>
Use IDLTypes in more places
https://bugs.webkit.org/show_bug.cgi?id=163247
Reviewed by Darin Adler.
Switch JS -> Native type conversions to use convert<IDLType>(...) rather
than convert<NativeType>(...). This allows us to differentiate things like
conversion from JSValue to DOMString vs. JSValue to USVString which have different
rules.
* bindings/generic/IDLTypes.h:
Add predicate for integer types.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::createAesKeyGenParams):
(WebCore::createRsaKeyGenParams):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
Switch to new convert<IDLType> style.
* bindings/js/JSDOMBinding.h:
(WebCore::toRefPtrNativeArray): Deleted.
(WebCore::toNativeArray): Deleted.
These can now be called as convert<IDLSequence<IDLInterface<T>>> and convert<IDLType> respectively.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLNullable<T>>::convert):
(WebCore::Converter<IDLBoolean>::convert):
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::Converter<IDLByte>::convert):
(WebCore::Converter<IDLOctet>::convert):
(WebCore::Converter<IDLShort>::convert):
(WebCore::Converter<IDLUnsignedShort>::convert):
(WebCore::Converter<IDLLong>::convert):
(WebCore::Converter<IDLUnsignedLong>::convert):
(WebCore::Converter<IDLLongLong>::convert):
(WebCore::Converter<IDLUnsignedLongLong>::convert):
(WebCore::Converter<IDLFloat>::convert):
(WebCore::Converter<IDLUnrestrictedFloat>::convert):
(WebCore::Converter<IDLDouble>::convert):
(WebCore::Converter<IDLUnrestrictedDouble>::convert):
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
(WebCore::Detail::ArrayConverter::convert):
(WebCore::Converter<IDLSequence<T>>::convert):
(WebCore::Converter<IDLFrozenArray<T>>::convert):
(WebCore::Converter<IDLDictionary<T>>::convert):
(WebCore::Converter<IDLEnumeration<T>>::convert):
(WebCore::Detail::VariadicConverterBase::convert):
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
(WebCore::convertWrapperType): Deleted.
(WebCore::convertWrapperTypeSequence): Deleted.
(WebCore::Converter<bool>::convert): Deleted.
(WebCore::Converter<String>::convert): Deleted.
(WebCore::Converter<Vector<T>>::convert): Deleted.
(WebCore::Converter<int8_t>::convert): Deleted.
(WebCore::Converter<uint8_t>::convert): Deleted.
(WebCore::Converter<int16_t>::convert): Deleted.
(WebCore::Converter<uint16_t>::convert): Deleted.
(WebCore::Converter<int32_t>::convert): Deleted.
(WebCore::Converter<uint32_t>::convert): Deleted.
(WebCore::Converter<int64_t>::convert): Deleted.
(WebCore::Converter<uint64_t>::convert): Deleted.
Switch Converter to be specialized on IDLTypes. Add support for IDLNullable, IDLSequence, and IDLFrozenArray.
* bindings/scripts/CodeGenerator.pm:
(GetFlattenedMemberTypes): Deleted.
(GetNumberOfNullableMemberTypes): Deleted.
(GetIDLUnionMemberTypes): Deleted.
(GetBaseIDLType): Deleted.
(GetIDLType): Deleted.
Move IDLType conversion logic to CodeGeneratorJS so it can use GetEnumerationClassName and GetDictionaryClassName.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add support for sequences, FrozenArrays and external dictionaries.
(GenerateEnumerationsImplementationContent):
(GenerateEnumerationsHeaderContent):
Change the name of parse<enum> and convert<enum> to parseEnumeration<enum> and convertEnumeration<enum>
to make them more consistent with dictionary conversion specialization and not interfere with the convert
function specialization.
(GenerateDictionaryImplementationContent):
Simplify by using convert<IDLType>.
(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
(GetBaseIDLType):
(GetIDLType):
Moved from CodeGenerator.pm
(IsHandledByDOMConvert):
(JSValueToNative):
Start switching JSValueToNative over to using convert<IDLType>. Use IsHandledByDOMConvert as a predicate
for what is supported.
* bindings/scripts/IDLParser.pm:
(applyTypedefs):
(cloneType):
(applyTypedefsForSignature):
(parseTypedef):
(parseOperationOrIterator):
(parseSpecialOperation):
Make typedefs work with aggregate types (unions, sequences and FrozenArrays).
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results.
* bindings/scripts/test/TestTypedefs.idl:
Add additional tests for typedefs that use unions and sequences.
* testing/InternalSettings.idl:
Change the name of a parameter to avoid a name collision.
2016-10-11 Konstantin Tokarev <annulen@yandex.ru>
Fixed compilation with !ENABLE(SVG_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=163281
Reviewed by Csaba Osztrogonác.
No new tests needed.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2016-10-11 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r207140.
* PlatformAppleWin.cmake: Add missing compile file.
2016-10-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add initial Pattern handling implementation
https://bugs.webkit.org/show_bug.cgi?id=163270
Reviewed by Simon Fraser.
Provide an implemenation of Patterns for Direct2D.
No new tests. Covered by fast/borders/border-image-01.html and others.
* platform/graphics/GraphicsContext.h:
* platform/graphics/Pattern.h: Add D2D definitions.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::solidStrokeBrush): Use a more generic return type.
(WebCore::GraphicsContext::solidFillBrush): Ditto.
(WebCore::GraphicsContext::patternStrokeBrush): Added.
(WebCore::GraphicsContext::patternFillBrush): Added.
(WebCore::GraphicsContext::drawPattern): Provide D2D implementation.
(WebCore::GraphicsContext::applyStrokePattern): Ditto.
(WebCore::GraphicsContext::applyFillPattern): Ditto.
(WebCore::GraphicsContext::drawPath): Use stroke pattern if available.
(WebCore::GraphicsContext::fillPath): Use fill pattern if available.
(WebCore::GraphicsContext::strokePath): Use stroke pattern if available.
(WebCore::GraphicsContext::fillRect): Use fill pattern if available.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/PatternDirect2D.cpp: Added.
2016-10-11 Per Arne Vollan <pvollan@apple.com>
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=163272
Reviewed by Brent Fulgham.
When compiling with older SDKs, some CoreText symbols are redefined.
This patch checks if the relevant CoreText header file has been
included before defining the symbol.
* platform/spi/win/CoreTextSPIWin.h:
2016-10-11 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Buttons container
https://bugs.webkit.org/show_bug.cgi?id=163238
<rdar://problem/28701864>
Reviewed by Dean Jackson.
We add a new ButtonsContainer class which contains a group of Button objects
and positions them based on the provided padding and margin between buttons.
Buttons that aren't enabled or marked as dropped are not added to the tree of
LayoutNodes, and thus the DOM.
Additionally, we fix a few issues we found while working on tests for ButtonsContainer
where LayoutNodes would schedule layout callbacks even when they would not do any work
during the layout callback due to not resetting the `needsLayout` flag to false and
removing any scheduled tasks when a layout was completed.
Finally, we fix a few style issues that had not been caught so far and an unused
`size` property on IconButton.
Tests: media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
media/modern-media-controls/buttons-container/buttons-container-constructor.html
media/modern-media-controls/buttons-container/buttons-container-layout.html
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton.prototype.set on):
(AirplayButton):
* Modules/modern-media-controls/controls/buttons-container.css:
(.buttons-container):
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.get buttons):
(ButtonsContainer.prototype.set buttons):
(ButtonsContainer.prototype.layout):
* Modules/modern-media-controls/controls/icon-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set needsLayout):
(LayoutNode.prototype.markDirtyProperty):
(LayoutNode.prototype._markNodeManipulation):
(LayoutNode.prototype._updateDirtyState):
(performScheduledLayout):
(elementFromString):
* Modules/modern-media-controls/controls/scheduler.js:
(const.scheduler.new.prototype.unscheduleLayout):
2016-10-11 Youenn Fablet <youenn@apple.com>
[Fetch API] Support Request cache mode
https://bugs.webkit.org/show_bug.cgi?id=162281
Reviewed by Alex Christensen.
Covered by updated test.
Added support for only-if-cached mode at Request level.
Added support for cache mode at CachedResourceLoader, by setting HTTP headers and ResourceRequest cache policy
based on https://fetch.spec.whatwg.org/#concept-request-cache-mode and https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
Disabled default cache policy computation (done in FrameLoader) when cache mode is different from the default.
Activated no-store cache mode for EventSource as per https://html.spec.whatwg.org/#the-eventsource-interface.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setCache): Adding support for only-if-cached.
(WebCore::buildOptions): Throw if only-if-cached and fetch mode is not same-origin.
* loader/FetchOptions.h: Adding support for only-if-cached.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::defaultRequestCachingPolicy): Introduced to ease readability.
(WebCore::FrameLoader::addExtraFieldsToRequest): Updating cache policy only if request has the default cache policy.
This allows bypassing the default behavior for fetch cache mode different from "default".
* loader/FrameLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::updateRequestAccordingCacheMode): Introduced to set headers and request cache policy according fetch cache mode.
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy): Ensure bypassing the memory cache in no-store and reload cases.
We reload in case of cache mode=reload to refresh the meory cache entry.
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setCacheModeToNoStore):
* page/EventSource.cpp:
(WebCore::EventSource::connect): Use no-store cache mode as per https://html.spec.whatwg.org/#the-eventsource-interface.
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::addIfNotPresent): Helper routine.
* platform/network/HTTPHeaderMap.h:
* platform/network/HTTPHeaderValues.cpp:
* platform/network/HTTPHeaderValues.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
(WebCore::ResourceRequestBase::addHTTPHeaderField):
(WebCore::ResourceRequestBase::hasHTTPHeaderField):
* platform/network/ResourceRequestBase.h:
2016-10-10 Antti Koivisto <antti@apple.com>
Stop copying author shadow pseudo rules into shadow tree style resolver
https://bugs.webkit.org/show_bug.cgi?id=163232
Reviewed by Darin Adler.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
If we are resolving a user agent shadow tree also look up pseudo element rules from the host scope author sheet.
This is needed to keep web exposed ::-webkit-foo pseudo elements working.
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
Factor to a function.
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::copyShadowPseudoElementRulesFrom): Deleted.
* css/RuleSet.h:
* dom/Document.cpp:
(WebCore::Document::userAgentShadowTreeStyleResolver):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateStyleResolver):
No need to awkwardly copy these rules anymore.
2016-10-11 Chris Dumez <cdumez@apple.com>
Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163266
Reviewed by Darin Adler.
Update IDBVersionChangeEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor instead, as in the specification:
- http://w3c.github.io/IndexedDB/#request-idbversionchangeevent
This patch also fixes a bug where the IDBVersionChangeEvent was ignoring the
EventInit dictionary members passed by the JavaScript (e.g. bubbles).
No new tests, updated existing test.
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/IDBVersionChangeEvent.idl:
* bindings/js/JSDOMConvert.h:
(WebCore::convertNullable):
(WebCore::convert): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
* bindings/scripts/test/TestObj.idl:
2016-10-11 Chris Dumez <cdumez@apple.com>
Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163265
Reviewed by Darin Adler.
Update WebKitPlaybackTargetAvailabilityEvent to stop using legacy
[ConstructorTemplate=Event] and use a regular constructor instead.
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
(WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
(WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent): Deleted.
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
2016-10-10 Zan Dobersek <zdobersek@igalia.com>
Add ENABLE_ENCRYPTED_MEDIA configuration option
https://bugs.webkit.org/show_bug.cgi?id=163219
Reviewed by Darin Adler.
* Configurations/FeatureDefines.xcconfig:
Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
to enable or disable the new EME implementation at build-time.
* DerivedSources.make: Group the legacy option and the new option together.
2016-10-10 Youenn Fablet <youenn@apple.com>
CachedResourceRequest constructor should be made more efficient
https://bugs.webkit.org/show_bug.cgi?id=163210
Reviewed by Alex Christensen.
No change of behavior.
Refactoring to use one CachedResourceRequest constructor that will move its request and charset to improve efficiency.
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
2016-10-10 Adam Bergkvist <adam.bergkvist@ericsson.com> and Alejandro G. Castro <alex@igalia.com>
WebRTC: Make MediaEndpointPeerConnection handle remotely assigned mids correctly
https://bugs.webkit.org/show_bug.cgi?id=163202
Reviewed by Eric Carlson.
An RTCRtpTransceiver has a null mid until it's been associated with a
media description (with a mid) [1]. During that time, it's identified by
a provisional mid that might become its real mid, but the transceiver
can also get its mid assigned by a remote media description. In the
second case, the mid value is initially unknown. A transceiver's
RTCRtpSender must directly (synchronously in the script) provide a muted
remote source that is playable by, for example, a media element. This
source is initially registered in the MediaEndpoint (WebRTC backend)
with the transceiver's provisional mid. So, if the real mid is set by a
remote description, the registered mid must be updated to preserve the
association between the registered source and the transceiver.
[1] https://w3c.github.io/webrtc-pc/archives/20160913/webrtc.html#dom-rtcrtptransceiver-mid
Test: fast/mediastream/RTCPeerConnection-remotely-assigned-transceiver-mid.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
Don't break after finding the first transceiver in the loop that builds the send source map.
Update the mid used to register the muted remote source if the a transceiver's mid gets
assigned by a remote media description.
(WebCore::createSourceMap):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::updateReceiveConfiguration):
(WebCore::MockMediaEndpoint::updateSendConfiguration):
(WebCore::MockMediaEndpoint::createMutedRemoteSource):
(WebCore::MockMediaEndpoint::replaceMutedRemoteSourceMid):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
Add "unmute-remote-sources-by-mid" action that emulates data arriving on media descriptions
which unmutes the remote sources.
(WebCore::MockMediaEndpoint::updateConfigurationMids):
(WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
(WebCore::MockMediaEndpoint::unmuteTimerFired):
* platform/mock/MockMediaEndpoint.h:
2016-10-10 Darin Adler <darin@apple.com>
Move audio module off of legacy exceptions
https://bugs.webkit.org/show_bug.cgi?id=163269
Reviewed by Alex Christensen.
* Modules/webaudio/AnalyserNode.cpp:
(WebCore::AnalyserNode::setFftSize): Use ExceptionOr.
(WebCore::AnalyserNode::setMinDecibels): Ditto.
(WebCore::AnalyserNode::setMaxDecibels): Ditto.
(WebCore::AnalyserNode::setSmoothingTimeConstant): Ditto.
* Modules/webaudio/AnalyserNode.h: Update for above.
* Modules/webaudio/AnalyserNode.idl: Ditto.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
Initialize m_needAutomaticPull in class definition.
(WebCore::AudioBasicInspectorNode::connect): Use ExceptionOr.
(WebCore::AudioBasicInspectorNode::disconnect): Ditto.
* Modules/webaudio/AudioBasicInspectorNode.h: Updated for above.
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::createFromAudioFileData): Use reference.
(WebCore::AudioBuffer::AudioBuffer): Initialize m_gain in class definition.
(WebCore::AudioBuffer::getChannelData): Use ExceptionOr.
(WebCore::AudioBuffer::channelData): Rename to disambiguate with getChannelData.
(WebCore::AudioBuffer::zero): Use modern for loop.
* Modules/webaudio/AudioBuffer.h: Update for above.
* Modules/webaudio/AudioBuffer.idl: Ditto.
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process): Use reference.
(WebCore::AudioBufferSourceNode::setBuffer): Use channelData.
(WebCore::AudioBufferSourceNode::start): Use ExceptionOr.
(WebCore::AudioBufferSourceNode::startPlaying): Ditto.
* Modules/webaudio/AudioBufferSourceNode.h: Update for above.
* Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createBuffer): Use ExceptionOr.
(WebCore::AudioContext::createMediaElementSource): Ditto.
(WebCore::AudioContext::createMediaStreamSource): Ditto.
(WebCore::AudioContext::createScriptProcessor): Ditto.
(WebCore::AudioContext::createDelay): Ditto.
(WebCore::AudioContext::createChannelSplitter): Ditto.
(WebCore::AudioContext::createChannelMerger): Ditto.
(WebCore::AudioContext::createPeriodicWave): Ditto.
* Modules/webaudio/AudioContext.h: Update for above.
* Modules/webaudio/AudioContext.idl: Ditto.
* Modules/webaudio/AudioDestinationNode.h: Use unsigned instead
of unsigned long for maxChannelCount.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect): Use ExceptionOr.
(WebCore::AudioNode::disconnect): Ditto.
(WebCore::AudioNode::channelCount): Use unsigned.
(WebCore::AudioNode::setChannelCount): Use ExceptionOr and unsigned.
(WebCore::AudioNode::setChannelCountMode): Ditto.
(WebCore::AudioNode::setChannelInterpretation): Ditto.
* Modules/webaudio/AudioNode.h: Update for above.
* Modules/webaudio/AudioNode.idl: Ditto.
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
Initialize data members in class definition.
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo): Take
a reference instead of a pointer to the audio bus.
(WebCore::AudioScheduledSourceNode::start): Use ExceptionOr.
(WebCore::AudioScheduledSourceNode::stop): Ditto.
* Modules/webaudio/AudioScheduledSourceNode.h: Update for above.
* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::ConvolverNode): Initialize m_normalize
in class definition.
(WebCore::ConvolverNode::setBuffer): Use ExceptionOr.
* Modules/webaudio/ConvolverNode.h: Update for above.
* Modules/webaudio/ConvolverNode.idl: Ditto.
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode):
Initialize m_numberOfInputChannels in class definition.
(WebCore::DefaultAudioDestinationNode::maxChannelCount): Use unsigned.
(WebCore::DefaultAudioDestinationNode::setChannelCount): Use ExceptionOr.
* Modules/webaudio/DefaultAudioDestinationNode.h: Update for changes above.
* Modules/webaudio/DelayNode.cpp:
(WebCore::DelayNode::DelayNode): Moved exception logic out of constructor.
(WebCore::DelayNode::create): Added. Moved exception logic in here.
(WebCore::DelayNode::delayTime): Moved typecast here from header.
* Modules/webaudio/DelayNode.h: Update for above.
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::OfflineAudioContext): Marked inline.
(WebCore::OfflineAudioContext::create): Use ExceptionOr.
(WebCore::OfflineAudioContext::~OfflineAudioContext): Deleted. Unneeded.
* Modules/webaudio/OfflineAudioContext.h: Update for above.
* Modules/webaudio/OfflineAudioContext.idl: Ditto.
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::offlineRender): Use channelData.
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::OscillatorNode): Updated for change to setType.
(WebCore::OscillatorNode::setType): Use ExceptionOr.
(WebCore::OscillatorNode::process): Use a reference.
* Modules/webaudio/OscillatorNode.h: Update for above.
* Modules/webaudio/OscillatorNode.idl: Ditto.
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::process): Use channelData.
* bindings/js/JSDOMBinding.h: Added overloads of toJS to it can be used on
references to array buffers and array buffer views, not just pointers.
2016-10-10 Youenn Fablet <youenn@apple.com>
Change HTTPHeaderValues from a struct to a namespace
https://bugs.webkit.org/show_bug.cgi?id=163203
Reviewed by Alex Christensen.
No change of behavior.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* platform/network/HTTPHeaderValues.cpp:
(WebCore::HTTPHeaderValues::textPlainContentType):
(WebCore::HTTPHeaderValues::formURLEncodedContentType):
(WebCore::HTTPHeaderValues::TextPlainContentType): Deleted.
(WebCore::HTTPHeaderValues::FormURLEncodedContentType): Deleted.
* platform/network/HTTPHeaderValues.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
2016-10-10 Chris Dumez <cdumez@apple.com>
Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163254
Reviewed by Darin Adler.
Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor instead, as in the specification:
- https://www.w3.org/TR/uievents/#interface-mouseevent
- https://www.w3.org/TR/uievents/#interface-wheelevent
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateDictionaryHeader):
Fix our broken dependency tracking when it comes to dictionaries.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
* dom/MouseEvent.h:
* dom/MouseEvent.idl:
* dom/MouseEventInit.h: Added.
* dom/MouseEventInit.idl: Added.
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
* dom/WheelEvent.h:
* dom/WheelEvent.idl:
2016-10-10 Chris Dumez <cdumez@apple.com>
Add support for languagechange event
https://bugs.webkit.org/show_bug.cgi?id=163222
Reviewed by Ryosuke Niwa.
Add support for languagechange event:
- https://html.spec.whatwg.org/#dom-navigator-languages
Firefox and Chrome already support this.
Test: fast/dom/window-languagechange-event.html
* dom/EventNames.h:
* html/HTMLAttributeNames.in:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* page/DOMWindow.cpp:
(WebCore::languagesChangedCallback):
(WebCore::DOMWindow::DOMWindow):
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::languagesChanged):
(WebCore::DOMWindow::canShowModalDialog): Deleted.
(WebCore::DOMWindow::removeEventListener): Deleted.
* page/DOMWindow.h:
* page/WindowEventHandlers.idl:
2016-10-10 Chris Dumez <cdumez@apple.com>
Update GamepadEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163243
Reviewed by Darin Adler.
Update GamepadEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor as in the specification:
- https://w3c.github.io/gamepad/#gamepadevent-interface
* Modules/gamepad/GamepadEvent.cpp:
(WebCore::GamepadEvent::GamepadEvent):
* Modules/gamepad/GamepadEvent.h:
(WebCore::GamepadEvent::create):
(WebCore::GamepadEvent::~GamepadEvent): Deleted.
* Modules/gamepad/GamepadEvent.idl:
2016-10-10 Darin Adler <darin@apple.com>
Move Fetch from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163195
Reviewed by Chris Dumez.
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader): Use ExceptionOr.
(WebCore::FetchHeaders::append): Ditto.
(WebCore::FetchHeaders::remove): Ditto.
(WebCore::FetchHeaders::get): Ditto.
(WebCore::FetchHeaders::has): Ditto.
(WebCore::FetchHeaders::set): Ditto.
(WebCore::FetchHeaders::filterAndFill): Ditto.
(WebCore::FetchHeaders::Iterator::next): Got rid of unneeded code to
clear out m_keys after the last call to next, since it will be deleted
as soon as the iterator is deleted.
* Modules/fetch/FetchHeaders.h: Use pragma once. Use ExceptionOr.
* Modules/fetch/FetchHeaders.idl: Move to non-legacy exceptions.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody): Use ExceptionOr.
(WebCore::FetchRequest::clone): Ditto.
* Modules/fetch/FetchRequest.h: Use pragma once. Use ExceptionOr.
* Modules/fetch/FetchRequest.idl: Move to non-legacy exceptions.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect): Use ExceptionOr.
(WebCore::FetchResponse::setStatus): Ditto.
* Modules/fetch/FetchResponse.h: Use ExceptionOr.
* Modules/fetch/FetchResponse.idl: Move to non-legacy exceptions.
* bindings/js/JSDOMBinding.h: Added implementation of toJSNullableString.
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Call toJSNullableString and toJSString for
functions that return ExceptionOr<String>.
2016-10-10 Nan Wang <n_wang@apple.com>
AX: Expose invalid status for input types with that information
https://bugs.webkit.org/show_bug.cgi?id=163252
<rdar://problem/28704409>
Reviewed by Chris Fleizach.
For input types with invalid input value, we should expose the invalid
status to the assitive technology.
Test: accessibility/mac/invalid-status-for-input-types.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::invalidStatus):
2016-10-10 Konstantin Tokarev <annulen@yandex.ru>
Added override specifier to PluginViewBase::isPluginViewBase()
https://bugs.webkit.org/show_bug.cgi?id=163218
Reviewed by Alex Christensen.
No new tests needed.
* plugins/PluginViewBase.h:
2016-10-10 Alex Christensen <achristensen@webkit.org>
Don't run SecurityOrigin's port through URLParser
https://bugs.webkit.org/show_bug.cgi?id=163253
Reviewed by Brady Eidson.
No change in behavior.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier):
(WebCore::SecurityOrigin::create):
We used to parse URLs like "file://:0/" which are valid when using URL::parse
but aren't valid when we start using the URLParser, which matches other browsers' failure
to parse URLs with a port but no host. There is no reason to write and parse the port.
Setting m_port directly accomplishes the same thing.
2016-10-10 Said Abou-Hallawa <sabouhallawa@apple.com>
<Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero
https://bugs.webkit.org/show_bug.cgi?id=138555
Reviewed by Simon Fraser.
Ensure the dashArray has at least one non-zero element before calling
GraphicsContext::setLineDash(). Call GraphicsContext::setStrokeStyle()
instead, if the dashArray does not have one.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
2016-10-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Correct Radial Graident Bug
https://bugs.webkit.org/show_bug.cgi?id=163241
Reviewed by Darin Adler.
Radial gradients were not working correctly under Direct2D because the
points and radius values used were incorrect. D2D wants a center point and
an offset, not a start and end point. It wants an X and Y radius (for an
ellipse), not a radius at the start point, and a radius at the end point.
Covered by existing fast/gradients/css-radial-gradients.html (and others).
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled): Remove 'notImplemented' code path.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient): Use correct input values to
the Radial Gradient constructor.
(WebCore::Gradient::fill): Generate a gradient if we have no active
one to use.
2016-10-10 Jiewen Tan <jiewen_tan@apple.com>
Rename CryptoAlgorithmParameters to CryptoAlgorithmParametersDeprecated
https://bugs.webkit.org/show_bug.cgi?id=163163
<rdar://problem/28681544>
Reviewed by Brent Fulgham.
Replace all uses of 'CryptoAlgorithmParameters' with 'CryptoAlgorithmParametersDeprecated' in preparation for a new CryptoAlgorithmParameters type.
No changes of behaviors. No new tests.
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
* bindings/js/JSCryptoAlgorithmDictionary.h:
* bindings/js/JSCryptoKeySerializationJWK.cpp:
* bindings/js/JSCryptoKeySerializationJWK.h:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
* crypto/CryptoAlgorithm.cpp:
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParametersDeprecated.h: Renamed from Source/WebCore/crypto/CryptoAlgorithmParameters.h.
* crypto/CryptoKeySerialization.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
* crypto/algorithms/CryptoAlgorithmSHA512.h:
* crypto/keys/CryptoKeySerializationRaw.cpp:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
* crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h.
* crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacParams.h.
* crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h.
* crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h.
* crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmRsaSsaParams.h.
2016-10-10 Darin Adler <darin@apple.com>
Move NotificationCenter from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163217
Reviewed by Chris Dumez.
* Modules/notifications/DOMWindowNotifications.cpp:
(WebCore::DOMWindowNotifications::webkitNotifications): Pass reference to
document instead of pointer. Also use auto and early return.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification): Move checks that can lead to
throwing an exception out of the constructor into the create function.
(WebCore::Notification::create): Changed to use ExceptionOr. Also moved
checks that can lead to throwing an exception here.
(WebCore::Notification::show): Update since NotificationController::client
now returns a reference.
(WebCore::Notification::permission): Ditto.
(WebCore::Notification::requestPermission): Ditto.
* Modules/notifications/Notification.h: Updated for above changes.
* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::create): Take a reference to the script execution
context instead of a pointer.
(WebCore::NotificationCenter::NotificationCenter): Ditto.
(WebCore::NotificationCenter::createNotification): Use ExceptionOr.
(WebCore::NotificationCenter::requestPermission): Take an rvalue reference.
* Modules/notifications/NotificationCenter.h: Use pragma once.
Marked the class final. Updated for changes above.
* Modules/notifications/NotificationCenter.idl: Use non-legacy exceptions.
* Modules/notifications/NotificationController.cpp:
(WebCore::NotificationController::NotificationController): Use a reference rather
than a pointer for m_client, since it is never null.
(WebCore::NotificationController::~NotificationController): Ditto.
(WebCore::NotificationController::clientFrom): Updated for the change above.
* Modules/notifications/NotificationController.h: Updated for the change above.
* Modules/notifications/WorkerGlobalScopeNotifications.cpp:
(WebCore::WorkerGlobalScopeNotifications::webkitNotifications): Updated to
pass a reference for the script execution context. Also added FIXME about the
fact that the client is always null.
2016-10-10 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Placards
https://bugs.webkit.org/show_bug.cgi?id=163110
<rdar://problem/28669342>
Reviewed by Dean Jackson.
Inline media controls need to display placards when the video is no longer playing inline,
such as when the video is playing fullscreen or via AirPlay. To that end, we introduce a
new Placard class and two subclasses for display during fullscreen or AirPlay playback.
Note that localization will be done in a later patch.
Tests: media/modern-media-controls/airplay-placard/airplay-placard.html
media/modern-media-controls/pip-placard/pip-placard.html
media/modern-media-controls/placard/placard.html
* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/pip-placard.js:
(PiPPlacard):
* Modules/modern-media-controls/controls/placard.css:
(.placard):
(.placard .container):
(.placard .icon):
(.placard .title,):
(.placard .title):
(.placard .description):
* Modules/modern-media-controls/controls/placard.js:
(Placard.):
* Modules/modern-media-controls/images/iOS/airplay-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/airplay-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/airplay-placard@3x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-placard@1x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-placard@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-placard@3x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-placard@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-placard@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-placard@2x.png: Added.
2016-10-10 Chris Dumez <cdumez@apple.com>
Add support for Navigator.languages attribute
https://bugs.webkit.org/show_bug.cgi?id=163220
Reviewed by Darin Adler.
Add support for Navigator.languages attribute:
- https://html.spec.whatwg.org/#navigatorlanguage
Firefox and Chrome already support this.
Currently, we always return a single language for privacy reasons so
this API does not actually bring anything new besides interoperability
with other browsers and compliance with the HTML specification.
No new tests, rebaselined existing tests.
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::languages):
* page/NavigatorBase.h:
* page/NavigatorLanguage.idl:
2016-10-10 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Implement dashed and dotted border line drawing
https://bugs.webkit.org/show_bug.cgi?id=163235
Reviewed by Alex Christensen.
Covered by existing fast/border tests.
* platform/graphics/GraphicsContext.cpp: Use custom 'setPlatformStrokeStyle' for D2D.
* platform/graphics/Path.cpp:
(WebCore::Path::length): Don't use default implementation for Direct2D.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::brushWithColor): Initialize pointer to nullptr.
(WebCore::GraphicsContext::drawRect): Use proper stroke style.
(WebCore::GraphicsContextPlatformPrivate::setLineCap): Added.
(WebCore::GraphicsContextPlatformPrivate::setLineJoin): Added.
(WebCore::GraphicsContextPlatformPrivate::setStrokeStyle): Added.
(WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Added.
(WebCore::GraphicsContextPlatformPrivate::setDashOffset): Added.
(WebCore::GraphicsContextPlatformPrivate::setPatternWidth): Added.
(WebCore::GraphicsContextPlatformPrivate::setPatternOffset): Added.
(WebCore::GraphicsContextPlatformPrivate::setStrokeThickness): Added.
(WebCore::GraphicsContextPlatformPrivate::setDashes): Added.
(WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Added.
(WebCore::GraphicsContextPlatformPrivate::strokeStyle): Added.
(WebCore::GraphicsContext::drawLine): Use proper stroke style.
(WebCore::GraphicsContext::drawEllipse): Ditto.
(WebCore::GraphicsContext::drawPath): Ditto.
(WebCore::GraphicsContext::strokePath): Ditto.
(WebCore::GraphicsContext::setPlatformStrokeStyle): Added.
(WebCore::GraphicsContext::setMiterLimit): Tell D2D context about miter limit.
(WebCore::GraphicsContext::setLineCap): Ditto for line cap.
(WebCore::GraphicsContext::setLineDash): Ditto for dashes.
(WebCore::GraphicsContext::setLineJoin): Ditto for join style.
(WebCore::GraphicsContext::setPlatformStrokeThickness): Ditto for stroke thickness.
(WebCore::GraphicsContext::platformStrokeEllipse): Use proper stroke style.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::currentPoint): Zero-initialize a value.
(WebCore::Path::length): Added.
2016-10-10 Chris Dumez <cdumez@apple.com>
Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163221
Reviewed by Darin Adler.
Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://xhr.spec.whatwg.org/#firing-events-using-the-progressevent-interface
* dom/ProgressEvent.cpp:
(WebCore::ProgressEvent::ProgressEvent):
* dom/ProgressEvent.h:
(WebCore::ProgressEvent::create):
* dom/ProgressEvent.idl:
2016-10-10 Wenson Hsieh <wenson_hsieh@apple.com>
Address some review feedback from r206979 and r207010
https://bugs.webkit.org/show_bug.cgi?id=163236
Reviewed by Tim Horton.
In TypingCommand.h, some methods on TypingCommand should be marked as final to reflect the fact that they
override methods in CompositeEditCommand. Also, HTMLFormControlElement::dispatchFormControlInputEvent does not
need to specify HTMLElement::dispatchInputEvent() when calling dispatchInputEvent().
No new tests, since there is no behavior change.
* editing/TypingCommand.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
2016-10-10 Chris Dumez <cdumez@apple.com>
Update MessageEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163187
Reviewed by Darin Adler.
Update MessageEvent to stop using legacy [ConstructorTemplate=Event] and
use a regular constructor as in the specification:
- https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces
No new tests, updated existing test.
* bindings/js/JSDOMBinding.h:
(WebCore::toRefPtrNativeArray):
* bindings/js/JSDOMConvert.h:
(WebCore::convertWrapperTypeSequence):
(WebCore::convertWrapperType): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
(GetNativeType):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::trySerializeData):
(WebCore::MessageEvent::createForBindings): Deleted.
(WebCore::MessageEvent::initMessageEvent): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
2016-10-10 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Buttons
https://bugs.webkit.org/show_bug.cgi?id=163109
<rdar://problem/28668954>
Reviewed by Dean Jackson.
We introduce specific IconButton subclasses for the various buttons we will be using
in media controls on macOS (inline and fullscreen) and iOS. One class, StartButton, is
a subclass of Button and not IconButton because we're only interested in having it display
an <img> element rather than use a mask and requires additional DOM structure.
Tests: media/modern-media-controls/airplay-button/airplay-button-on.html
media/modern-media-controls/airplay-button/airplay-button.html
media/modern-media-controls/aspect-ratio-button/aspect-ratio-button.html
media/modern-media-controls/forward-button/forward-button.html
media/modern-media-controls/fullscreen-button/fullscreen-button.html
media/modern-media-controls/mute-button/mute-button.html
media/modern-media-controls/pip-button/pip-button.html
media/modern-media-controls/play-pause-button/play-pause-button.html
media/modern-media-controls/rewind-button/rewind-button.html
media/modern-media-controls/skip-back-button/skip-back-button.html
media/modern-media-controls/start-button/start-button.html
media/modern-media-controls/tracks-button/tracks-button.html
* Modules/modern-media-controls/controls/airplay-button.css:
(button.airplay.on):
* Modules/modern-media-controls/controls/airplay-button.js:
(AirplayButton):
(AirplayButton.prototype.set on):
* Modules/modern-media-controls/controls/aspect-ratio-button.js:
(AspectRatioButton):
(AspectRatioButton.prototype.get scalesToFill):
(AspectRatioButton.prototype.set scalesToFill):
* Modules/modern-media-controls/controls/forward-button.js:
(ForwardButton):
* Modules/modern-media-controls/controls/fullscreen-button.js:
(FullscreenButton):
* Modules/modern-media-controls/controls/icon-button.js:
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/mute-button.js:
(MuteButton):
(MuteButton.prototype.get muted):
(MuteButton.prototype.set muted):
* Modules/modern-media-controls/controls/pip-button.js:
(PiPButton):
* Modules/modern-media-controls/controls/play-pause-button.js:
(PlayPauseButton):
(PlayPauseButton.prototype.get playing):
(PlayPauseButton.prototype.set playing):
* Modules/modern-media-controls/controls/rewind-button.js:
(RewindButton):
* Modules/modern-media-controls/controls/skip-back-button.js:
(SkipBackButton):
* Modules/modern-media-controls/controls/start-button.js:
(StartButton):
* Modules/modern-media-controls/controls/tracks-button.js:
(TracksButton):
* Modules/modern-media-controls/images/iOS/airplay@1x.png: Added.
* Modules/modern-media-controls/images/iOS/airplay@2x.png: Added.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Added.
* Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Added.
* Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Added.
* Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Added.
* Modules/modern-media-controls/images/iOS/pause@1x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-in@1x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-in@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pip-in@3x.png: Added.
* Modules/modern-media-controls/images/iOS/play@1x.png: Added.
* Modules/modern-media-controls/images/iOS/play@2x.png: Added.
* Modules/modern-media-controls/images/iOS/play@3x.png: Added.
* Modules/modern-media-controls/images/iOS/start@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay@1x.png: Added.
* Modules/modern-media-controls/images/macOS/airplay@2x.png: Added.
* Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/forward@1x.png: Added.
* Modules/modern-media-controls/images/macOS/forward@2x.png: Added.
* Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Added.
* Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection@1x.png: Added.
* Modules/modern-media-controls/images/macOS/media-selection@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in@2x.png: Added.
* Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/play@1x.png: Added.
* Modules/modern-media-controls/images/macOS/play@2x.png: Added.
* Modules/modern-media-controls/images/macOS/rewind@1x.png: Added.
* Modules/modern-media-controls/images/macOS/rewind@2x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Added.
* Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Added.
* Modules/modern-media-controls/images/macOS/volume@1x.png: Added.
* Modules/modern-media-controls/images/macOS/volume@2x.png: Added.
2016-10-10 Nan Wang <n_wang@apple.com>
AX: Update AXPlaceHolder algorithm
https://bugs.webkit.org/show_bug.cgi?id=163229
Reviewed by Chris Fleizach.
From https://w3c.github.io/html-aam/
When the placeholder and aria-placeholder attributes are both present, we
should expose the value of the placeholder attribute. Updated the algorithm
for that.
Changes are covered in the modified test.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::placeholderValue):
2016-10-10 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Implement Node accessors in DOMJIT
https://bugs.webkit.org/show_bug.cgi?id=163005
Reviewed by Filip Pizlo.
This patch implements DOMJIT accessors in WebCore. We plan to offer 2 things in DOMJIT.
1. Hand written DOM inlining.
We inject DOMJIT::Patchpoint compiler into JSC. And JSC uses this to inline DOM operation,
and drop type checks. Since the operation is fully inlined, potentially it has large
performance boost. Note that CSS Selector JIT compiler already does the similar things:
accessing parentNode etc. directly by using offsets.
2. Exposing signature information.
We will offer function type signature by some representation and pass it to JSC.
JSC will use to drop type checks. Since IDL code generator already knows this,
we can automatically generate such a information. Since we don't perform any inlining,
the performance boost may be limited. But it's worth doing.
This patch implements the first one, hand written DOM inlining facility. We add a new IDL attribute,
"DOMJIT". This means that "This readonly attribute have a DOMJIT patchpoint compiler".
We annotate several accessors at first. "firstChild", "lastChild", "nextSibling", "previousSibling",
and "parentNode". And we implement DOMJIT::Patchpoint for that in JSNodeDOMJIT.cpp.
This patchpoint will be integrated into JSC's DFG and FTL. And these tiers can drop type checks and
inline the entire code of these accessors. JSC compiler still does not know much about DOM. And WebCore
does not know much about each tier of JSC. WebCore just offers the generic patchpoints and they are
used in both DFG and FTL tiers. The layer separation is still kept.
While very small microbenchmark[1] shows performance benefit, still we cannot improve DOM
benchmarks due to the lack of following implementations. Once the following implementations
are implemented, we will get performance boost.
1. Super polymorphic sites.
This inlining is super effective if we run some microbenchmarks. However, Dromaeo does not
show so much performance benefit. This is because Dromaeo's dom-traverse.html is super
polymorphic call site where JSC gives up optimization. For example, in the following
dromaeo's benchmark, we can see so various DOM nodes at the `cur.firstChild` site, like,
HTMLDivElement, HTMLAnchorElement, Text, Comment etc. JSC gives up optimization since we
encounter so many Structures. This should be optimized since they share the large part of
prototype-chain and they hit the exactly same CustomGetter, Node.prototype.firstChild.
We will handle this and when we optimize it, this DOMJIT works well on Dromaeo.
test( "firstChild", function(){
var nodes = document.body.childNodes, nl = nodes.length;
for ( var i = 0; i < num; i++ ) {
for ( var j = 0; j < nl; j++ ) {
var cur = nodes[j];
while ( cur )
cur = cur.firstChild;
ret = cur;
}
}
});
2. Emit code in IC.
Currently, we only optimize DOMJIT accessors in DFG and FTL. However, we should leverage
this DOMJIT::Patchpoint to emit inlined code even in Inline Caching (IC). We will emit
CheckDOM's code for IC's guard phase, and emit CallDOM's code for IC's get phase. This
offers performance benefit even if we live in baseline JIT code. And this should be easy.
[1]: With the following one, we can see 3x improvement (26ms v.s. 80ms).
var element = document.getElementsByTagName('div')[3];
var before = Date.now();
for (var i = 0; i < 1e7; ++i)
element.firstChild;
console.log(Date.now() - before);
* CMakeLists.txt:
* ForwardingHeaders/domjit/DOMJITGetterSetter.h:
* ForwardingHeaders/domjit/DOMJITPatchpoint.h: Copied from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h.
* ForwardingHeaders/domjit/DOMJITPatchpointParams.h: Copied from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::offsetOfWrapped):
(WebCore::JSDOMWrapper::wrapped): Deleted.
* bindings/js/ScriptWrappable.h:
(WebCore::ScriptWrappable::offsetOfWrapper):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSCAttributesForAttribute):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateHashTableValueArray):
* bindings/scripts/IDLAttributes.txt:
* dom/ContainerNode.h:
(WebCore::ContainerNode::lastChildMemoryOffset):
(WebCore::ContainerNode::lastChild): Deleted.
* dom/Node.h:
(WebCore::Node::flagIsContainer):
(WebCore::Node::flagIsText): Deleted.
* dom/Node.idl:
* domjit/DOMJITHelpers.h: Added.
(WebCore::DOMJITHelpers::branchIfNotWorldIsNormal):
(WebCore::DOMJITHelpers::branchIfNotWeakIsLive):
(WebCore::DOMJITHelpers::tryLookUpWrapperCache):
(WebCore::DOMJITHelpers::toWrapper):
(WebCore::DOMJITHelpers::branchIfDOMWrapper):
(WebCore::DOMJITHelpers::branchIfNotDOMWrapper):
(WebCore::DOMJITHelpers::branchIfNode):
(WebCore::DOMJITHelpers::branchIfNotNode):
(WebCore::DOMJITHelpers::branchIfElement):
(WebCore::DOMJITHelpers::branchIfNotElement):
(WebCore::DOMJITHelpers::branchIfDocumentWrapper):
(WebCore::DOMJITHelpers::branchIfNotDocumentWrapper):
* domjit/JSNodeDOMJIT.cpp: Added.
(WebCore::toWrapperSlow):
(WebCore::createCallDOMForOffsetAccess):
(WebCore::checkNode):
(WebCore::NodeFirstChildDOMJIT::checkDOM):
(WebCore::NodeFirstChildDOMJIT::callDOM):
(WebCore::NodeLastChildDOMJIT::checkDOM):
(WebCore::NodeLastChildDOMJIT::callDOM):
(WebCore::NodeNextSiblingDOMJIT::checkDOM):
(WebCore::NodeNextSiblingDOMJIT::callDOM):
(WebCore::NodePreviousSiblingDOMJIT::checkDOM):
(WebCore::NodePreviousSiblingDOMJIT::callDOM):
(WebCore::NodeParentNodeDOMJIT::checkDOM):
(WebCore::NodeParentNodeDOMJIT::callDOM):
2016-10-10 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.data for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163113
<rdar://problem/28681935>
Reviewed by Darin Adler.
Introduces InputEvent.data, a string attribute that, if non-null, indicates the text to be inserted by an input
event. For text areas and text inputs, the 'insertText', 'insertFromPaste', 'insertFromDrop', and
'insertReplacementText' input types should cause subsequent `input` and `beforeinput` events to have non-null
data. However, for contenteditable areas, only 'insertText' leads to having data in resulting InputEvents.
To implement this, we introduce a new virtual method, CompositeEditCommand::inputEventData, which gives
composite editing commands the chance to vend a data string for input events they might fire (by default, this
is null).
Tests: fast/events/input-events-paste-data.html
fast/events/input-events-typing-data.html
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
Currently, our InputEventInit struct is wrong. According to the UI-Events spec at www.w3.org/TR/uievents/, the
init struct for an InputEvent should contain a data string (added in this patch) as well as an isComposing flag
(to be added in a future patch along with composition support). While adding support for the data attribute, we
tweak the InputEvent IDL and headers slightly to adjust for this.
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
* dom/Node.h:
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::inputEventData):
* editing/EditCommand.cpp:
(WebCore::EditCommand::isEditingTextAreaOrTextInput):
* editing/EditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::inputEventData):
* editing/ReplaceRangeWithTextCommand.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::inputEventData):
* editing/ReplaceSelectionCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::inputEventData):
* editing/SpellingCorrectionCommand.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::inputEventData):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
* editing/TypingCommand.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore::HTMLInputElement::setValueFromRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
2016-10-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206972.
https://bugs.webkit.org/show_bug.cgi?id=163227
Making EWS flaky (Requested by bfulgham_ on #webkit).
Reverted changeset:
"[CMake] CMake does not support the dep files for implicit
dependency"
https://bugs.webkit.org/show_bug.cgi?id=161433
http://trac.webkit.org/changeset/206972
2016-10-10 Darin Adler <darin@apple.com>
Move media source from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163201
Reviewed by Chris Dumez.
* Modules/mediasource/MediaSource.cpp: Removed unneeded includes.
(WebCore::MediaSource::create): Use auto.
(WebCore::MediaSource::MediaSource): Initialize m_mediaElement in class definition.
(WebCore::MediaSource::setLiveSeekableRange): Use ExceptionOr.
(WebCore::MediaSource::clearLiveSeekableRange): Ditto.
(WebCore::MediaSource::setDuration): Ditto.
(WebCore::MediaSource::setDurationInternal): Ditto.
(WebCore::MediaSource::endOfStream): Ditto.
(WebCore::MediaSource::streamEndedWithError): Use bufferedInternal.
(WebCore::MediaSource::addSourceBuffer): Use ExceptionOr.
(WebCore::MediaSource::removeSourceBuffer): Ditto.
(WebCore::MediaSource::detachFromElement): Use removeSourceBuffer
without IGNORE_EXCEPTION since that is now the default behavior.
(WebCore::MediaSource::activeRanges): Use bufferedInternal.
(WebCore::MediaSource::createSourceBufferPrivate): Use ExceptionOr.
* Modules/mediasource/MediaSource.h: Removed unneeded includes.
Made more things private and also private rather than protected.
* Modules/mediasource/MediaSource.idl: Use non-legacy exceptions.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::buffered): Use ExceptionOr.
(WebCore::SourceBuffer::setTimestampOffset): Ditto.
(WebCore::SourceBuffer::setAppendWindowStart): Ditto.
(WebCore::SourceBuffer::setAppendWindowEnd): Ditto.
(WebCore::SourceBuffer::appendBuffer): Ditto.
(WebCore::SourceBuffer::abort): Ditto.
(WebCore::SourceBuffer::remove): Ditto.
(WebCore::SourceBuffer::appendBufferInternal): Ditto.
(WebCore::SourceBuffer::setMode): Ditto.
* Modules/mediasource/SourceBuffer.h: Removed unneeded includes.
Updated for above changes. Made more things private.
* Modules/mediasource/SourceBuffer.idl: Use non-legacy exceptions.
* platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h:
Added now-needed include of MediaSourcePrivate.h.
2016-10-10 Jer Noble <jer.noble@apple.com>
Address flaky airplay-* LayouTests
https://bugs.webkit.org/show_bug.cgi?id=163044
Reviewed by Brent Fulgham.
Two separate problems conspired to make airplay tests a bit flaky:
For one, when the HTMLMediaElement clears its MediaPlayer, it won't necessarily notify
clients that it has stopped playing to a wireless target. The WebMediaSessionManager may
eventually cause this value to reset, but it's asynchronous, and may fire after the next
test starts. Reset this state explicitly.
For two, the state of the mock playback target picker was not being reset between test
invocations.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaPlayer):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2016-10-10 Brent Fulgham <bfulgham@apple.com>
Correct typo in comment (patining -> painting).
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::centerLineAndCutOffCorners):
2016-10-10 Brent Fulgham <bfulgham@apple.com>
Reduce code duplication between CG, Cairo, and Direct2D
https://bugs.webkit.org/show_bug.cgi?id=163157
Reviewed by Darin Adler.
Move a number of routines that have been copied-and-pasted to different
platform files into the main GraphicsContext.cpp file.
No new tests because there is no change in behavior.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::dashedLineCornerWidthForStrokeWidth): Added.
(WebCore::GraphicsContext::dashedLinePatternWidthForStrokeWidth): Added.
(WebCore::GraphicsContext::dashedLinePatternOffsetForPatternAndStrokeWidth): Added.
(WebCore::GraphicsContext::centerLineAndCutOffCorners): Added.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLine): Call new helper function.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLine): Ditto.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawLine): Ditto.
2016-10-10 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r206731): [SOUP] Network process crash in gotHeadersCallback
https://bugs.webkit.org/show_bug.cgi?id=163170
Reviewed by Michael Catanzaro.
Do not assume NetworkingContext is non-null and valid before using it.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::gotHeadersCallback):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2016-10-10 Youenn Fablet <youenn@apple.com>
Images and scripts should be said as clean based on CachedResource::isCORSSameOrigin
https://bugs.webkit.org/show_bug.cgi?id=162390
Reviewed by Darin Adler.
No observable change of behavior.
Renaming CachedResource::isClean to isCORSSameOrigin to match html spec terminology.
Making use of it to check whether images taint canvas and whether script errors should be sanitized.
Some asserts are added to ensure that a resource fetched using one origin is not reused for another origin.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::sanitizeScriptError):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::isOriginClean):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin):
* loader/cache/CachedResource.h:
2016-10-10 Youenn Fablet <youenn@apple.com>
[Fetch API] Memory cache should not bypass redirect mode
https://bugs.webkit.org/show_bug.cgi?id=162959
Reviewed by Darin Adler.
Test: http/tests/fetch/redirectmode-and-preload.html
Ensure reloading of resources if the redirect modes are different between request and cached resource, and
cached resource has redirections.
As a temporary workaround, we activate resource update for raw resources in
shouldUpdateCachedResourceWithCurrentRequest but disable it in canUpdateFromResource.
This allows handling reloading of resources with different redirection mode in canUpdateFromResource.
A future patch should allow loading cached raw resources from other cached raw resources.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasRedirections):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
(WebCore::canUpdateFromResource):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
2016-10-10 Youenn Fablet <youenn@apple.com>
Attribute getter binding generated code should use more references
https://bugs.webkit.org/show_bug.cgi?id=163179
Reviewed by Darin Adler.
No change of behavior.
Using more references in attribute getter generated code since BindingCaller::attribute can do the
pointer-to-references checks once for all.
Needed to update GenerateCallWith and NativeToJSValue to handle the case where references (attribute getters) or
pointers (methods and attribute setters) are to be used.
Future refactoring should allign methods/attribute setters to attribute getters.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateCallWith):
(NativeToJSValue):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
2016-10-10 Youenn Fablet <youenn@apple.com>
Fix Mac Win build after https://trac.webkit.org/changeset/206966
https://bugs.webkit.org/show_bug.cgi?id=163199
Unreviewed.
* bindings/js/JSDOMBinding.h: Marking rejectPromiseWithGetterTypeError as WEBCORE_EXPORT.
2016-10-09 Antti Koivisto <antti@apple.com>
Enable optimized stylesheet updates in shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163180
Reviewed by Darin Adler.
When we get a new stylesheet (for example when load completes) we invalidate only
those elements in DOM that are affected by the new sheet. This patch makes the
optimization also work in shadow trees.
Test: fast/shadow-dom/scoped-style-invalidation.html
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateStyle):
* css/StyleInvalidationAnalysis.h:
* dom/Document.cpp:
(WebCore::Document::didRemoveAllPendingStylesheet):
* style/StyleScope.cpp:
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
2016-10-10 Youenn Fablet <youenn@apple.com>
Refactor binding generated casted-this checks for attribute setters
https://bugs.webkit.org/show_bug.cgi?id=163181
Reviewed by Darin Adler.
No change of behavior.
Covered by existing tests and binding expectations.
Adding support for attribute setter in BindingCaller.
Updating binding generator to make use of it.
Future refactoring should use more reference and rename castedThis to thisObject, like for getters.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::setAttribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2016-10-09 Darin Adler <darin@apple.com>
Move encrypted media from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163194
Reviewed by Youenn Fablet.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::createSession): Take a reference instead of a pointer.
* Modules/encryptedmedia/CDM.h: Updated for above change.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::create): Take a reference instead of a pointer.
(WebCore::WebKitMediaKeySession::MediaKeySession): Ditto.
(WebCore::WebKitMediaKeySession::~MediaKeySession): Removed unneeded code that
sets m_session to null.
(WebCore::WebKitMediaKeySession::keyRequestTimerFired): Use auto.
(WebCore::WebKitMediaKeySession::update): Use ExceptionOr.
(WebCore::WebKitMediaKeySession::addKeyTimerFired): Use m_keys directly instead
of calling the keys function.
(WebCore::WebKitMediaKeySession::sendError): Set m_error directly instead of
calling the setError function.
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory): Use auto.
(WebCore::WebKitMediaKeySession::hasPendingActivity): Check m_session directly
instead of writing !isClosed.
(WebCore::WebKitMediaKeySession::setError): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Use pragma once. Removed
unneeded includes. Changed create to take a reference instead of a pointer.
Made most members and base classes private instead of public. Also removed
a few now-unneeded functions. Made everything that was formerly protected
private instead, since the two are the same in a final class.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Removed unneeded comments.
Moved from MayThrowLegacyException to MayThrowException.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::create): Use ExceptionOr.
(WebCore::WebKitMediaKeys::MediaKeys): Made argument be an rvalue reference.
Also initialize m_mediaElement in the class definition.
(WebCore::WebKitMediaKeys::~MediaKeys): Call detachKeys instead of setKeys(nullptr).
(WebCore::WebKitMediaKeys::createSession): Use ExceptionOr. Also pass reference
insteead of pointer to create. Also removed unneeded separate checks for null
strings in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::isTypeSupported): Removed unneeded checks for null strings
in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::cdmMediaPlayer): Tweaked a bit.
(WebCore::WebKitMediaKeys::cachedKeyForKeyId): Use auto.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Use pragma once. Removed unneeded includes.
Changed cdm() function to return a reference. Initialize m_mediaElement.
Use private instead of protected.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Use ConstructorMayThrowException
and MayThrowException instead of the legacy versions.
2016-10-09 Zan Dobersek <zdobersek@igalia.com>
ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
https://bugs.webkit.org/show_bug.cgi?id=162982
Reviewed by Jer Noble.
Have the Web-exposed interfaces guarded by ENABLE_LEGACY_ENCRYPTED_MEDIA also use
the WebKit prefix in the implementations. This will prevent conflicts between
interfaces with same names in both the legacy API and the future EME API.
Most of the interfaces in this legacy API already used the WebKit prefix when
exposed via JS bindings. The only exception is MediaKeyNeededEvent, which gets
prefixed in this patch.
The interface implementations for this legacy API are also moved under the
Modules/encryptedmedia/legacy/ directory.
No new tests -- covered by existing tests (with the relevant changes reflected
in the updated baselines).
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::update):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::~WebKitMediaKeyMessageEvent):
(WebCore::WebKitMediaKeyMessageEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h.
(WebCore::WebKitMediaKeyMessageEvent::create):
(WebCore::WebKitMediaKeyMessageEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp.
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::~WebKitMediaKeyNeededEvent):
(WebCore::WebKitMediaKeyNeededEvent::eventInterface):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h.
(WebCore::WebKitMediaKeyNeededEvent::create):
(WebCore::WebKitMediaKeyNeededEvent::createForBindings):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp.
(WebCore::WebKitMediaKeySession::create):
(WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::setError):
(WebCore::WebKitMediaKeySession::close):
(WebCore::WebKitMediaKeySession::cachedKeyForKeyId):
(WebCore::WebKitMediaKeySession::sessionId):
(WebCore::WebKitMediaKeySession::generateKeyRequest):
(WebCore::WebKitMediaKeySession::keyRequestTimerFired):
(WebCore::WebKitMediaKeySession::update):
(WebCore::WebKitMediaKeySession::addKeyTimerFired):
(WebCore::WebKitMediaKeySession::sendMessage):
(WebCore::WebKitMediaKeySession::sendError):
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
(WebCore::WebKitMediaKeySession::hasPendingActivity):
(WebCore::WebKitMediaKeySession::stop):
(WebCore::WebKitMediaKeySession::activeDOMObjectName):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp.
(WebCore::WebKitMediaKeys::create):
(WebCore::WebKitMediaKeys::WebKitMediaKeys):
(WebCore::WebKitMediaKeys::~WebKitMediaKeys):
(WebCore::WebKitMediaKeys::createSession):
(WebCore::WebKitMediaKeys::isTypeSupported):
(WebCore::WebKitMediaKeys::setMediaElement):
(WebCore::WebKitMediaKeys::cdmMediaPlayer):
(WebCore::WebKitMediaKeys::keyAdded):
(WebCore::WebKitMediaKeys::cachedKeyForKeyId):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Renamed from Source/WebCore/Modules/encryptedmedia/MediaKeys.idl.
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::setMediaKeys):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::keys):
* html/HTMLMediaElement.idl:
* html/WebKitMediaKeyError.h: Renamed from Source/WebCore/html/MediaKeyError.h.
(WebCore::WebKitMediaKeyError::create):
(WebCore::WebKitMediaKeyError::WebKitMediaKeyError):
* html/WebKitMediaKeyError.idl: Renamed from Source/WebCore/html/MediaKeyError.idl.
* testing/MockCDM.cpp:
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::update):
2016-10-09 Zan Dobersek <zdobersek@igalia.com>
Remove stale ENABLE(ENCRYPTED_MEDIA) code in HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=163111
Reviewed by Alex Christensen.
Remove three method implementations in HTMLMediaElement which had their
declarations and the related WebIDL entries removed in the first ENCRYPTED_MEDIA
purge in r206440.
No new tests -- no changes in behavior.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::webkitGenerateKeyRequest): Deleted.
(WebCore::HTMLMediaElement::webkitAddKey): Deleted.
(WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
2016-10-09 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.inputType for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163025
<rdar://problem/28658092>
Reviewed by Darin Adler.
Adds support for the inputType attribute of InputEvent. To do this, we introduce a helper to
map EditActions to inputType names, and also split out ambiguous EditActions (such as
EditActionTyping) into more specific subtypes (such as EditActionTypingDeleteBackward,
EditActionTypingInsertParagraph, etc.), each of which corresponds to an inputType.
In places where we create CompositeEditCommands, we now pass in these specific EditActions
where appropriate, and when dispatching `beforeinput` and `input` events, we ask the
CompositeEditCommand for its input type name, which it derives from its editingAction.
Tests: fast/events/before-input-prevent-biu.html
fast/events/before-input-prevent-cut.html
fast/events/before-input-prevent-paste.html
fast/events/before-input-prevent-typing.html
fast/events/before-input-prevent-undo.html
* dom/InputEvent.h:
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
* dom/Node.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::inputEventTypeName):
Allows a CompositeEditCommand to specify the inputType its corresponding `beforeinput` and `input` events
should have.
* editing/CompositeEditCommand.h:
(WebCore::CompositeEditCommand::shouldStopCaretBlinking): Deleted.
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/EditCommand.h:
* editing/Editor.cpp:
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::willUnapplyEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::computeAndSetTypingStyle):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::editingAction):
* editing/InsertListCommand.h:
(WebCore::InsertListCommand::preservesTypingStyle): Deleted.
(WebCore::InsertListCommand::editingAction): Deleted.
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::inputEventTypeName):
The editingAction() of a TypingCommand is the first editing action the TypingCommand was initialized using.
Since subsequent typing commands update the last open typing command, we override inputEventTypeName here to
use the last updated editing action rather than the default (initial) editing action.
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertParagraphSeparator):
* editing/TypingCommand.h:
2016-10-09 Darin Adler <darin@apple.com>
Move ApplePaySession from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163191
Reviewed by Sam Weinig.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Use ExceptionOr.
(WebCore::ApplePaySession::ApplePaySession): Moved initialization
of two of the data members to class definition.
(WebCore::ApplePaySession::supportsVersion): Use ExceptionOr.
(WebCore::ApplePaySession::canMakePayments): Ditto.
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard): Ditto.
(WebCore::ApplePaySession::openPaymentSetup): Ditto.
(WebCore::ApplePaySession::begin): Ditto.
(WebCore::ApplePaySession::abort): Ditto.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
(WebCore::ApplePaySession::completeShippingMethodSelection): Ditto.
(WebCore::ApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::ApplePaySession::completePaymentMethodSelection): Ditto.
(WebCore::ApplePaySession::completePayment): Ditto.
(WebCore::ApplePaySession::validateMerchant): Use auto and get instead of
using a RefPtr type and * for event dispatching.
(WebCore::ApplePaySession::didAuthorizePayment): Ditto.
(WebCore::ApplePaySession::didSelectShippingMethod): Ditto.
(WebCore::ApplePaySession::didSelectShippingContact): Ditto.
(WebCore::ApplePaySession::didSelectPaymentMethod): Ditto.
(WebCore::ApplePaySession::didCancelPayment): Ditto.
(WebCore::ApplePaySession::paymentCoordinator): Moved dereferencing
inside the downcast.
* Modules/applepay/ApplePaySession.h: Updated for changes above.
* Modules/applepay/ApplePaySession.idl: Use MayThrowException.
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
Use propagateException.
(WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
* bindings/js/JSDOMBinding.h: Added implementation of toJSBoolean.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition): Generate the different arguments for
toJSNewlyCreated when ConstructorMayThrowException is specified that
activate the version of that function that handles exceptions.
* bindings/scripts/IDLAttributes.txt: Added ConstructorMayThrowException.
2016-10-09 Darin Adler <darin@apple.com>
Replace all uses of ExceptionCodeWithMessage with WebCore::Exception
https://bugs.webkit.org/show_bug.cgi?id=163178
Reviewed by Sam Weinig.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBCursor::update): Return ExceptionOr instead of using an
ExceptionCodeWithMessage out argument.
(WebCore::IDBCursor::advance): Ditto.
(WebCore::IDBCursor::continueFunction): Ditto.
(WebCore::IDBCursor::deleteFunction): Ditto.
* Modules/indexeddb/IDBCursor.h: Updated for above changes.
* Modules/indexeddb/IDBCursor.idl: Sorted extended attributes alphabetically.
Use MayThrowException instead of MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBDatabase::transaction): Ditto.
(WebCore::IDBDatabase::deleteObjectStore): Ditto.
* Modules/indexeddb/IDBDatabase.h: Updated for above changes.
* Modules/indexeddb/IDBDatabase.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBFactory::openInternal): Ditto.
(WebCore::IDBFactory::deleteDatabase): Ditto.
(WebCore::IDBFactory::cmp): Ditto.
* Modules/indexeddb/IDBFactory.h: Updated for above changes.
* Modules/indexeddb/IDBFactory.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::doCount): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::doGet): Ditto.
(WebCore::IDBIndex::getKey): Ditto.
(WebCore::IDBIndex::doGetKey): Ditto.
* Modules/indexeddb/IDBIndex.h: Updated for above changes.
* Modules/indexeddb/IDBIndex.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only): Return ExceptionOr instead of
using an ExceptionCode out argument.
(WebCore::IDBKeyRange::lowerBound): Ditto.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
* Modules/indexeddb/IDBKeyRange.h: Updated for above changes.
* Modules/indexeddb/IDBKeyRange.idl: Use MayThrowException instead of
MayThrowLegacyException.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::add): Ditto.
(WebCore::IDBObjectStore::put): Ditto.
(WebCore::IDBObjectStore::putForCursorUpdate): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::doDelete): Ditto.
(WebCore::IDBObjectStore::clear): Ditto.
(WebCore::IDBObjectStore::createIndex): Ditto.
(WebCore::IDBObjectStore::index): Ditto.
(WebCore::IDBObjectStore::deleteIndex): Ditto.
(WebCore::IDBObjectStore::count): Ditto.
(WebCore::IDBObjectStore::doCount): Ditto.
* Modules/indexeddb/IDBObjectStore.h: Updated for above changes.
* Modules/indexeddb/IDBObjectStore.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::errorCode): Deleted. Was dead code.
(WebCore::IDBRequest::error): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
* Modules/indexeddb/IDBRequest.h: Updated for above changes.
* Modules/indexeddb/IDBRequest.idl: Use GetterMayThrowException instead of
GetterMayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::stringToMode): Return an Optional instead of
using an ExceptionCode out argument, since this function just needs to
indicate failure, not actually throw an exception.
(WebCore::IDBTransaction::db): Tweaked code a bit.
(WebCore::IDBTransaction::error): Return a pointer instead of a RefPtr.
(WebCore::IDBTransaction::objectStore): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::abortDueToFailedRequest): Call internalAbort.
(WebCore::IDBTransaction::abort): Return ExceptionOr instead of
using an ExceptionCodeWithMessage out argument.
(WebCore::IDBTransaction::internalAbort): Added a version that asserts
instead of throwing an exception for internal use.
(WebCore::IDBTransaction::stop): Call internalAbort.
* Modules/indexeddb/IDBTransaction.h: Updated for above changes.
* Modules/indexeddb/IDBTransaction.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::openDatabase): Updated to return
a Ref instead of a RefPtr, since the function can never return null.
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase): Ditto.
* Modules/indexeddb/client/IDBConnectionProxy.h: Updated for above changes.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): Updated
exception handling to use ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.cpp:
(WebCore::MediaEndpointSessionDescription::create): Ditto.
* Modules/mediastream/MediaEndpointSessionDescription.h: Updated for above change.
* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException): Added overload for Exception.
(WebCore::throwDOMException): Deleted overload for ExceptionCodeWithMessage.
Updated code to call the new createDOMException function.
(WebCore::setDOMExceptionSlow): Ditto.
(WebCore::setDOMException): Ditto.
* bindings/js/JSDOMBinding.h: Added overload of createDOMException that takes
an Exception. Deleted functions dealing with ExceptionCodeWithMessage. Fixed
interface of toJSNumber and toJSNullableNumber and implemented toJSNumber.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Added overload that takes an Exception.
* bindings/js/JSDOMPromise.h: Updated for above change.
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState): Use propagateException to deal with
ExceptionOr instead of ExceptionCodeWithMessage.
(WebCore::JSHistory::replaceState): Ditto.
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore): Use toJS and
to deal with ExceptionOr rather than setDOMException to deal
with ExceptionCodeWithMessage.
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result): Use propagateException and
Exception rather than setDOMException and ExceptionCodeWithMessage.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Removed support for GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
(GenerateReturnParameters): Ditto.
(GenerateImplementationFunctionCall): Ditto.
(GenerateConstructorDefinition): Ditto.
* bindings/scripts/IDLAttributes.txt: Removed GetterMayThrowLegacyExceptionWithMessage,
SetterMayThrowLegacyExceptionWithMessage, and MayThrowLegacyExceptionWithMessage.
* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
* bindings/scripts/test/TestObj.idl: Removed tests cases for now-removed attributes.
* dom/CustomElementRegistry.idl: Use MayThrowException instead of
MayThrowLegacyExceptionWithMessage.
* dom/ExceptionCode.h: Removed ExceptionCodeWithMessage. Also updated to use pragma
once, removed include of WTFString.h and switched to using instead of typedef.
* history/HistoryItem.h: Return a pointer instead of a RefPtr from stateObject
to cut down a little on unnecessary reference count churn.
* inspector/InspectorIndexedDBAgent.cpp: Updated all the code that uses IDB
classes to use the new versions rather than the old ExceptionCodeWithMessage versions.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::history): Pass a reference instead of a pointer.
* page/History.cpp:
(WebCore::History::History): Take a reference instead of a pointer.
(WebCore::History::length): Tweaked to use a local variable.
(WebCore::History::state): Return a pointer instead of a PassRefPtr.
(WebCore::History::stateInternal): Ditto. Also use early return consistently.
(WebCore::History::isSameAsCurrentState): Updated for above change.
(WebCore::History::stateObjectAdded): Return ExceptionOr rather than taking an
ExceptionCodeWithMessage out argument.
* page/History.h: Use pragma once. Removed some unneeded includes. Marked class final.
Updated for changes above.
* page/History.idl: Use MayThrowException instead of MayThrowLegacyException.
2016-10-07 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level
https://bugs.webkit.org/show_bug.cgi?id=163145
Reviewed by Darin Adler.
The bug was caused by Document::invalidateNodeListAndCollectionCaches removing all node lists regardless
of whether they have been invalidated or not.
Fixed the bug by removing only those node lists that got invalidated via LiveNodeList::invalidateCache.
Test: fast/dom/NodeList/form-labels-length.html
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::unregisterNodeListForInvalidation): Removed the conditional which allowed removal to
happen while m_listsInvalidatedAtDocument is empty inside invalidateNodeListAndCollectionCaches.
* dom/Document.h:
* dom/Node.cpp:
(WebCore::Document::invalidateNodeListAndCollectionCaches): Just remove the node lists being invalidated via
LiveNodeList's invalidateCache, which calls unregisterNodeListForInvalidation, instead of removing them all.
We make a copy of the list of node lists into a local vector because mutating HashMap while iterating over it
is not a safe operation.
2016-10-09 Chris Dumez <cdumez@apple.com>
Update generated bindings code so that dictionary structures no longer need explicit constructors
https://bugs.webkit.org/show_bug.cgi?id=163188
Reviewed by Darin Adler.
Update generated bindings code so that dictionary structures no longer
need explicit constructors. We now call the default constructor and
then initialize the members one by one.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<TestStandaloneDictionary>):
* dom/ClipboardEvent.h:
* dom/CustomEvent.h:
* dom/EventInit.h:
(WebCore::EventInit::EventInit): Deleted.
* dom/EventModifierInit.h:
(WebCore::EventModifierInit::EventModifierInit): Deleted.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/UIEventInit.h:
(WebCore::UIEventInit::UIEventInit): Deleted.
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):
2016-10-09 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] CMake does not support the dep files for implicit dependency
https://bugs.webkit.org/show_bug.cgi?id=161433
Reviewed by Brent Fulgham.
Created a Perl script to generate all IDL bindings for CMake.
This script can regenerate outdated bindings by based on the
supplemental dependency and dep files created by
'--write-dependencies' switch of generate-bindings.pl.
add_custom_target is used to invoke the script instead of
add_custom_command because Ninja deletes all output files before
executing the command in case of add_custom_command.
USES_TERMINAL option of add_custom_target has two effects:
1) Not buffering output of the command
2) Invoking the command in the special Ninja pool which inhibits parallel build
One needs to use CMake 3.2 or later to enable this feature.
* CMakeLists.txt: Specified target names for
GENERATE_BINDINGS. Added dependency for the targets.
* bindings/scripts/generate-bindings-all.pl: Added.
2016-10-09 Chris Dumez <cdumez@apple.com>
Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163176
Reviewed by Darin Adler.
Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor instead, like in the specification:
- https://www.w3.org/TR/uievents/#interface-keyboardevent
Also add support for passing modifierAltGraph / modifierCapsLock
in the inialization dictionary as we support those modifiers via
getModifierState().
No new tests, extended existing test.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventModifierInit.h: Added.
(WebCore::EventModifierInit::EventModifierInit):
* dom/EventModifierInit.idl: Added.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create): Deleted.
* dom/UIEventInit.h: Added.
(WebCore::UIEventInit::UIEventInit):
* dom/UIEventInit.idl: Added.
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::altGraphKey):
(WebCore::UIEventWithKeyState::capsLockKey):
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
(WebCore::UIEventWithKeyState::ctrlKey): Deleted.
(WebCore::UIEventWithKeyState::shiftKey): Deleted.
(WebCore::UIEventWithKeyState::altKey): Deleted.
(WebCore::UIEventWithKeyState::metaKey): Deleted.
2016-10-09 Youenn Fablet <youenn@apple.com>
Promise attribute getters should reject promises in case of casted-this errors
https://bugs.webkit.org/show_bug.cgi?id=163167
Reviewed by Darin Adler.
Covered by updated test and binding test.
* bindings/js/JSDOMBinding.cpp:
(WebCore::throwGetterTypeError):
(WebCore::rejectPromiseWithGetterTypeError): Added to reject promises for attribute getters
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute): Introducing promise rejection for type cast errors.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp: Rebased test. As can be seen, only custom promise attributes are supported.
(WebCore::jsTestObjTestReadOnlyPromiseAttribute):
(WebCore::jsTestObjTestReadOnlyPromiseAttributeGetter):
* bindings/scripts/test/TestObj.idl:
2016-10-08 Chris Dumez <cdumez@apple.com>
[Mac] Write WebArchive to the pasteboard when copying image in WebKit
https://bugs.webkit.org/show_bug.cgi?id=163100
Reviewed by Darin Adler.
Write WebArchive to the pasteboard when copying image in WebKit. This
fixes pasting such images to a content editable field in WebKit because
Web archives take priority over RTFD when reading from the pasteboard
in WebKit.
Using RTFD when pasting the image in WebKit was causing issues because:
1. The pasted image would not be displayed because our RTFD import code
is buggy.
2. The pasted image URL was a webkit-fake-url://
3. Formatting associated to the image (e.g. inline style) would be lost
No new tests, unskipped existing test on WebKit2.
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::imageInWebArchiveFormat):
(WebCore::Editor::writeImageToPasteboard):
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::writableTypesForImage):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::Pasteboard): Deleted.
(WebCore::Pasteboard::createForCopyAndPaste): Deleted.
2016-10-08 Chris Dumez <cdumez@apple.com>
Update CustomEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163174
Reviewed by Darin Adler.
Update CustomEvent to stop using legacy [ConstructorTemplate=Event] and
use an actual constructor instead, like in the specification:
- https://dom.spec.whatwg.org/#interface-customevent
There is a very minor behavior change when explictly passing undefined
as detail value in CustomEventInit. We used to initialize detail to
undefined but we now initialize it to null instead, which is its default
value. The new behavior matches the one of Chrome and Firefox.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
* bindings/scripts/test/TestObj.idl:
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::CustomEvent):
* dom/CustomEvent.h:
* dom/CustomEvent.idl:
* dom/Document.cpp:
(WebCore::Document::createEvent):
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:
2016-10-08 Chris Dumez <cdumez@apple.com>
Add support for ClipboardEvent
https://bugs.webkit.org/show_bug.cgi?id=163164
Reviewed by Darin Adler.
Add support for ClipboardEvent:
- https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces
Firefox and Chrome both already support this.
This gives us 5 more points on html5test.com.
Tests: editing/pasteboard/clipboard-event.html
fast/events/clipboard-event-constructor.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp:
(WebCore::toJSNewlyCreated): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(WillConvertUndefinedToDefaultParameterValue):
We use [] as implicit default value for dictionary parameters. This change
is so we call convertDictionary<>() even if the parameter is undefined
because we want to pass a struct to the implementation initialized with
the default member values defined in the IDL.
* dom/ClipboardEvent.cpp:
(WebCore::ClipboardEvent::ClipboardEvent):
(WebCore::ClipboardEvent::eventInterface):
* dom/ClipboardEvent.h:
* dom/ClipboardEvent.idl: Added.
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:
* dom/Event.idl:
* dom/EventInit.h: Added.
* dom/EventInit.idl: Added.
* dom/EventNames.in:
* dom/MouseEvent.h:
(WebCore::MouseEvent::dataTransfer):
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):
2016-10-06 Darin Adler <darin@apple.com>
Next step on moving to modern way to return DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163016
Reviewed by Ryosuke Niwa.
* Modules/fetch/FetchRequest.idl:
Added MayThrowException to initializeWith since it throws an exception.
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
(WebCore::reportCurrentException):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::reportException):
Use JSC::Exception explicitly to avoid ambiguity with WebCore::Exception,
or in some cases use auto instead.
* bindings/js/JSDOMBinding.cpp:
(WebCore::hasUnpairedSurrogate): Factored this inline function out of valueToUSVString
for clarity.
(WebCore::createDOMException): Removed unused TRY_TO_CREATE_EXCEPTION macro.
(WebCore::propagateExceptionSlowPath): Added.
(WebCore::propagateException): Added.
(WebCore::setDOMException): Removed overload that takes an exception code and message
string separately; no longer needed.
* bindings/js/JSDOMBinding.h: Include the ExceptionOr header
rather than forward declaring. Added more of the ExceptionOr handling
functions; some just declared and not yet defined. Updated for changes
to ExceptionOr interface. Removed the createDOMException function that takes
only an exception code; not needed outside JSDOMBinding.cpp.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send): Rewrote this to use ExceptionOr instead
of ExceptionCode. Added some FIXMEs as well.
(WebCore::JSXMLHttpRequest::responseText): Ditto.
(WebCore::JSXMLHttpRequest::retrieveResponse): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Fixed if statements to follow WebKit coding style
rather than using extra braces. Added call to propagateException for SetterMayThrowException.
(GenerateSerializerFunction): Fixed if statements as above.
(GenerateParametersCheck): Ditto. Also added call to propagateException for functions with
void return type and MayThrowException.
(GenerateReturnParameters): Tweaked coding style a bit.
(addIterableProperties): Fixed if statements as above.
(NativeToJSValue): Added code to handle various cases of GetterMayThrowException
and MayThrowException.
(GenerateConstructorDefinition): Used encodedJSValue() instead of
JSValue::encode(JSValue()), a longer way to say the same thing.
* bindings/scripts/IDLAttributes.txt: Added GetterMayThrowException,
MayThrowException, and SetterMayThrowException.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:
Regenerated results.
* bindings/scripts/test/TestObj.idl: Added some test cases.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType): Tweaked formatting.
(WebCore::DOMImplementation::createDocument): Ditto.
* dom/DOMImplementation.idl: Added MayThrowException to two functions since
I am abandoning, for now, the ability to throw exceptions without any extended
attribute in the IDL file. This feature may return at some point if we figure
out a way to do it for functions without return values as well as functions with.
* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Rewrote to streamline logic.
(WebCore::Document::pointerLockElement): Ditto.
(WebCore::Document::inputCursor): Added. No need for this to be inlined.
(WebCore::Document::setInputCursor): Changed to take Ref&&.
(WebCore::Document::getSelection): Added. Moved here from TreeScope.
* dom/Document.h: Updated for above changes.
* dom/Document.idl: Tweaked formatting.
* dom/Exception.h: Merged the two constructors into one with a default
argument value, which should be equally efficient. Added releaseMessage function.
Added assertion that this is only created for actual exceptions with non-zero
ExceptionCode. Unlike ExceptionCode, which has a value of 0 which means no
exception, we do not create an Exception if there is no exception.
* dom/ExceptionOr.h: Renamed takeReturnValue to releaseReturnValue. Replaced
exceptionCode and exceptionMessage with releaseException. Added ExceptionOr<void>
specialization.
* dom/TreeScope.cpp:
(WebCore::TreeScope::~TreeScope): Removed code dealing with
m_selection, which is now in Document.
(WebCore::TreeScope::getSelection): Deleted.
* dom/TreeScope.h: Removed DOMSelection.
* page/DOMSelection.cpp:
(WebCore::selectionShadowAncestor): Changed to take a reference rather than
a guaranteed-non-null pointer.
(WebCore::DOMSelection::DOMSelection): Changed to take a Frame& instead of
of a TreeScope*.
(WebCore::DOMSelection::clearTreeScope): Deleted.
(WebCore::DOMSelection::isCollapsed): Updated call to selectionShadowAncestor.
(WebCore::DOMSelection::type): Took out obsolete uneeeded comment. Got rid
of case where this returns a null string. Use ASCIILiteral.
(WebCore::DOMSelection::rangeCount): Streamlined code.
(WebCore::DOMSelection::collapse): Removed redundant check of m_frame for
null which is already handled by the isValidForPosition function.
Removed non-helpful FIXME.
(WebCore::DOMSelection::collapseToEnd): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::collapseToStart): Ditto.
(WebCore::DOMSelection::setBaseAndExtent): Removed redundant check of m_frame
for null which is already handled by the isValidForPosition function. Removed
non-helpful FIXME.
(WebCore::DOMSelection::setPosition): Ditto.
(WebCore::DOMSelection::extend): Changed to use ExceptionOr instead of
ExceptionCode.
(WebCore::DOMSelection::getRangeAt): Ditto.
(WebCore::DOMSelection::isValidForPosition): Changed to return false when
m_frame is null rather than asserting is is non-null and having every caller
check m_frame before calling this.
* page/DOMSelection.h: Use #pragma once. Fix indentation. Removed unneeded
comments. Use ExceptionOr rather than ExceptionCode.
* page/DOMSelection.idl: Move from MayThrowLegacyException to MayThrowException.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::resetDOMWindowProperties): Sorted properties alphabetically
to make it more obvious if any are accidentally omitted or listed twice.
(WebCore::DOMWindow::getSelection): Changed ownership so that the window owns
the selection like all the other objects, rather than having it be owned by the
document instead.
* page/DOMWindow.h: Added m_selection, sorted all the other related properties
alphabetically so it's easy to compare the list here with elsewhere.
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated): Updated to call setInputCursor
with a reference rather than a pointer.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseText): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::responseXML): Ditto.
(WebCore::XMLHttpRequest::setTimeout): Ditto.
(WebCore::XMLHttpRequest::setResponseType): Ditto.
(WebCore::XMLHttpRequest::setWithCredentials): Ditto.
(WebCore::XMLHttpRequest::open): Ditto.
(WebCore::XMLHttpRequest::prepareToSend): Changed to return an
Optional<ExceptionOr> to reflect the three different states: an exception,
a value to return without sending, or "continue with the send algorithm".
The old code did this with a boolean plus an exception code. This sounds
confusing but is easy to read at the call sites, so probably OK to keep.
(WebCore::XMLHttpRequest::send): Use ExceptionOr rather than ExceptionCode.
(WebCore::XMLHttpRequest::sendBytesData): Ditto.
(WebCore::XMLHttpRequest::createRequest): Ditto.
(WebCore::XMLHttpRequest::overrideMimeType): Ditto.
(WebCore::XMLHttpRequest::setRequestHeader): Ditto.
* xml/XMLHttpRequest.h: Updated for changes above.
* xml/XMLHttpRequest.idl: Sorted interface extended attributes alphabetically.
Changed from MayThrowLegacyException to MayThrowException.
2016-10-06 Sam Weinig <sam@webkit.org>
Autogenerate passing union types as part of a functions variadic arguments
https://bugs.webkit.org/show_bug.cgi?id=162919
Reviewed by Darin Adler.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove deleted files.
* bindings/generic/IDLTypes.h:
Switch to use std::reference_wrapper as it's implementation type. We may need more
granularity here in the future, but this will work for now.
* bindings/js/JSCharacterDataCustom.cpp: Removed.
* bindings/js/JSDocumentTypeCustom.cpp: Removed.
* bindings/js/JSNodeOrString.cpp: Removed.
* bindings/js/JSNodeOrString.h: Removed.
* bindings/js/JSDOMBinding.h:
(WebCore::VariadicHelperBase::convert): Deleted.
(WebCore::toArguments): Deleted.
Moved to JSDOMConvert.h and renamed to convertVariadicArguments and make
it work in terms of IDLTypes.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLInterface<T>>::convert):
(WebCore::VariadicConverterBase::convert):
(WebCore::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::prepend): Deleted.
(WebCore::JSDocument::append): Deleted.
* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::JSDocumentFragment::prepend): Deleted.
(WebCore::JSDocumentFragment::append): Deleted.
* bindings/js/JSElementCustom.cpp:
(WebCore::JSElement::before): Deleted.
(WebCore::JSElement::after): Deleted.
(WebCore::JSElement::replaceWith): Deleted.
(WebCore::JSElement::prepend): Deleted.
(WebCore::JSElement::append): Deleted.
Remove now generated functions.
* bindings/scripts/CodeGenerator.pm:
(assert):
Add assert to help debugging.
(ParseInterface):
Don't treat union types as interfaces.
(GetFlattenedMemberTypes):
(GetNumberOfNullableMemberTypes):
(GetIDLUnionMemberTypes):
Implement WebIDL algorithms for getting the flattened member list of union, and use it
to construct the c++ IDLType.
(GetBaseIDLType):
(GetIDLType):
Add helper to convert an parsed idlType to a c++ IDLType.
(IsWrapperType):
Don't treat union types as wrappers.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
Add helper for adding #includes based on a parsed idlType. It recursively handles union types.
(GenerateParametersCheck):
Use the new convertVariadicArguments function to handle all variadic arguments, including
union types.
* bindings/scripts/IDLParser.pm:
(parseDictionaryMember):
(parseAttributeRest):
(parseOptionalOrRequiredArgument):
(parseExceptionField):
Add an idlType to domSignature and populate it.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/TestObj.idl:
Add and update tests.
* dom/ChildNode.idl:
* dom/ParentNode.idl:
Remove Custom extended attribute.
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.cpp:
* dom/Node.h:
Switch to using std::reference_wrapper instead of Ref<> for passed in parameters.
2016-10-08 Youenn Fablet <youenn@apple.com>
[Fetch API] Request constructor should provide exception messages
https://bugs.webkit.org/show_bug.cgi?id=162382
Reviewed by Darin Adler.
No change of behavior, except that exceptions now have error messages.
Added support of exception messages to ExceptionOr.
Making use of ExceptionOr for Request constructor parameter checking.
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy):
(WebCore::setMode):
(WebCore::setCredentials):
(WebCore::setCache):
(WebCore::setRedirect):
(WebCore::setMethod):
(WebCore::setReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::initializeOptions):
(WebCore::FetchRequest::initializeWith):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchRequest.idl:
* bindings/js/JSDOMBinding.cpp:
(WebCore::setDOMException):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* dom/Exception.h:
(WebCore::Exception::code):
(WebCore::Exception::message):
(WebCore::Exception::Exception):
* dom/ExceptionOr.h:
(WebCore::ExceptionOr<ReturnType>::exceptionMessage):
2016-10-08 Youenn Fablet <youenn@apple.com>
Refactor binding generated casted-this checks
https://bugs.webkit.org/show_bug.cgi?id=162677
Reviewed by Darin Adler.
No change of behavior.
Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.
The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
In the future, the second function should only take references.
Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
This allows implementing the first function using the second function as template parameter.
Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.
* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
2016-10-08 Enrique Ocaña González <eocanha@igalia.com>
Missing include in MediaDescription
https://bugs.webkit.org/show_bug.cgi?id=162873
Reviewed by Xabier Rodriguez-Calvar.
Added missing header.
* platform/MediaDescription.h:
2016-10-08 Antti Koivisto <antti@apple.com>
Move StyleResolver ownership from Document/ShadowRoot to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163148
Reviewed by Andreas Kling.
Reduce duplication between Document and ShadowRoot.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::mediaConditionMatches):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::childrenChanged):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::userAgentShadowTreeStyleResolver):
(WebCore::Document::fontsNeedUpdate):
(WebCore::Document::didClearStyleResolver):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::createStyleResolver): Deleted.
(WebCore::Document::clearStyleResolver): Deleted.
* dom/Document.h:
(WebCore::Document::styleResolverIfExists): Deleted.
(WebCore::Document::ensureStyleResolver): Deleted.
* dom/Element.cpp:
(WebCore::Element::styleResolver):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver): Deleted.
(WebCore::ShadowRoot::styleResolverIfExists): Deleted.
(WebCore::ShadowRoot::resetStyleResolver): Deleted.
* dom/ShadowRoot.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Page.cpp:
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostStyle):
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):
(WebCore::Style::Scope::clearResolver):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::styleResolver): Deleted.
(WebCore::Style::Scope::styleResolverIfExists): Deleted.
* style/StyleScope.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::resolve):
2016-10-07 Chris Dumez <cdumez@apple.com>
window.navigator.language incorrectly returns all lowercase string
https://bugs.webkit.org/show_bug.cgi?id=163096
Reviewed by Darin Adler.
Update navigator.language so that it no longer returns an all lowercase
string (e.g. 'en-us' -> 'en-US'). This matches the behavior of other
browsers and the specification which indicate we should return a
BCP 47 language tag:
- https://html.spec.whatwg.org/#dom-navigator-language
- https://tools.ietf.org/html/bcp47
The other call sites relying on userPreferredLanguages() use case
insensitive comparison so they will not break.
No new tests, updated existing test.
* platform/Language.h:
2016-10-07 Wenson Hsieh <wenson_hsieh@apple.com>
Support onbeforeinput event handling for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163021
<rdar://problem/28658073>
Reviewed by Darin Adler.
Adds support for parsing the onbeforeinput attribute, and for sending default-preventable
`beforeinput` InputEvents to the page. To do this, we introduce two new virtual methods:
willApplyCommand and didApplyCommand on the CompositeEditCommand that are called before and
after CompositeEditCommand::doApply, respectively. willApplyCommand indicates whether or not
the composite editor command should proceed with applying the command.
Tweaks existing layout tests and adds new tests.
Tests: fast/events/before-input-events-different-start-end-elements.html
fast/events/before-input-events-prevent-default-in-textfield.html
fast/events/before-input-events-prevent-default.html
* dom/Document.idl:
* dom/Element.idl:
* dom/EventNames.h:
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):
Currently, we fire input events in Node in response to dispatching a webkitEditableContentChangedEvent. After
some discussion, Ryosuke and I believe that it will be ok to instead directly dispatch the input event where we
would normally dispatch a webkitEditableContentChangedEvent.
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
Added calls to Editor::willUnapplyEditing and Editor::willReapplyEditing.
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::didApplyCommand):
Added new virtual functions, willApplyCommand and didApplyCommand, that surround a call to
CompositeEditCommand::doApply. By default, they call willApplyEditing and appliedEditing on the editor, but may
be overridden in special cases, such as in TypingCommand, where we invoke appliedEditing after adding a new
typing command to the last open command.
If willApplyCommand returns false, CompositeEditCommand::apply will bail and not proceed with the command.
* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::willUnapplyEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::computeAndSetTypingStyle):
(WebCore::dispatchEditableContentChangedEvents): Deleted.
* editing/Editor.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::willApplyCommand):
(WebCore::TypingCommand::didApplyCommand):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::deleteSelection):
These now invoke willAddTypingToOpenCommand before proceeding with creating the command and applying it. The
flow is now:
- willAddTypingToOpenCommand
- create and apply a new command
- typingAddedToOpenCommand
* editing/TypingCommand.h:
(WebCore::TypingCommand::preservesTypingStyle): Deleted.
(WebCore::TypingCommand::shouldRetainAutocorrectionIndicator): Deleted.
(WebCore::TypingCommand::setShouldRetainAutocorrectionIndicator): Deleted.
(WebCore::TypingCommand::shouldStopCaretBlinking): Deleted.
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
2016-10-07 Nan Wang <n_wang@apple.com>
AX: <figcaption> should be AXTitleUIElement for other content inside the <figure>
https://bugs.webkit.org/show_bug.cgi?id=108996
Reviewed by Chris Fleizach.
Exposed the figcaption element to be the AXTitleUIElement for the figure element. And used
the figcaption's content as the accessible name of the figure. Also, updated the figure element's
role description on Mac.
Accessible name and description calculation for figure elements:
https://w3c.github.io/html-aam/#figure-and-figcaption-elements
Test: accessibility/mac/figure-element.html
* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::captionForFigure):
(WebCore::AccessibilityNodeObject::alternativeText):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isFigure):
(WebCore::AccessibilityObject::isSuperscriptStyleGroup): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):
(WebCore::AccessibilityRenderObject::titleUIElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXFigureText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXFigureText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXFigureText):
2016-10-07 Alex Christensen <achristensen@webkit.org>
Non-special URL fragments should percent-encode non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=163153
Reviewed by Tim Horton.
This is needed to keep compatibility with data URLs with non-ASCII characters after a '#'
which works in Chrome, Firefox, and Safari, while maintaining compatibility with Chrome, IE, and Edge
which keep non-ASCII characters in the fragments of special URLs.
This was proposed to the spec in https://github.com/whatwg/url/issues/150
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::syntaxViolation):
Removed assertion because we now have fragments that need percent encoding but are all ASCII.
(WebCore::URLParser::fragmentSyntaxViolation):
(WebCore::URLParser::parse):
2016-10-07 Brent Fulgham <bfulgham@apple.com>
EventHandler functions that need to guarantee event handler lifetime need to use Ref<Frame>
https://bugs.webkit.org/show_bug.cgi?id=98617
<rdar://problem/12778649>
Reviewed by Daniel Bates.
Improve stability by ensuring that the Frame holding an active EventHandler is kept
alive while in the process of handling events and executing JavaScript.
No new tests since there is no change in behavior.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick): Protect the Frame with a Ref<>.
(WebCore::EventHandler::handleMousePressEvent): Ditto.
(WebCore::EventHandler::handleMouseDraggedEvent): Ditto.
(WebCore::EventHandler::eventMayStartDrag): Ditto.
(WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
(WebCore::EventHandler::hitTestResultAtPoint): Ditto.
(WebCore::EventHandler::scrollRecursively): Ditto.
(WebCore::EventHandler::logicalScrollRecursively): Ditto.
(WebCore::EventHandler::selectCursor): Ditto.
(WebCore::EventHandler::handleMouseDoubleClickEvent): Ditto.
(WebCore::EventHandler::mouseMoved): Ditto.
(WebCore::EventHandler::handleMouseMoveEvent): Ditto.
(WebCore::EventHandler::handleMouseForceEvent): Ditto.
(WebCore::EventHandler::dispatchDragEvent): Ditto.
(WebCore::EventHandler::updateDragAndDrop): Ditto.
(WebCore::EventHandler::cancelDragAndDrop): Ditto.
(WebCore::EventHandler::performDragAndDrop): Ditto.
(WebCore::EventHandler::prepareMouseEvent): Ditto.
(WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
(WebCore::EventHandler::dispatchMouseEvent): Ditto.
(WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
(WebCore::EventHandler::handleWheelEvent): Ditto.
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
(WebCore::EventHandler::sendContextMenuEvent): Ditto.
(WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
(WebCore::EventHandler::hoverTimerFired): Ditto.
(WebCore::EventHandler::keyEvent): Ditto.
(WebCore::EventHandler::defaultKeyboardEventHandler): Ditto.
(WebCore::EventHandler::handleDrag): Ditto.
(WebCore::EventHandler::handleTextInputEvent): Ditto.
(WebCore::EventHandler::defaultSpaceEventHandler): Ditto.
(WebCore::EventHandler::defaultTabEventHandler): Ditto.
(WebCore::EventHandler::sendScrollEvent): Ditto.
(WebCore::EventHandler::handleTouchEvent): Ditto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::focusDocumentView): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
2016-10-07 Chris Dumez <cdumez@apple.com>
Regression(r201970): productSub / vendor / vendorSub should not be exposed on WorkerNavigator
https://bugs.webkit.org/show_bug.cgi?id=163124
Reviewed by Ryosuke Niwa.
productSub / vendor / vendorSub should not be exposed on WorkerNavigator:
- https://html.spec.whatwg.org/#navigatorid
Test case:
- http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker
Note that the specification also restricts NavigatorID's appCodeName and
product attributes to Window. However, it seems the HTML specification is
about to get updated so that these get exposed to workers:
- https://github.com/whatwg/html/pull/1870
No new tests, updated existing test.
* bindings/scripts/generate-bindings.pl:
(shouldPropertyBeExposed):
* page/NavigatorID.idl:
2016-10-07 Alex Christensen <achristensen@webkit.org>
Disable URLParser logs by default in all builds
https://bugs.webkit.org/show_bug.cgi?id=163135
Reviewed by Brady Eidson.
In debug builds with the URLParser enabled, some tests time out because
parameters to generate log strings are being evaluated for each character of each URL
and then not being used if URLParser logs are disabled. Generating these unused parameters
is too slow even for debug builds. Let's only generate them if they are to be used.
No change in behaviour.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::allValuesEqual):
2016-10-07 Andreas Kling <akling@apple.com>
[WK2] didRemoveFrameFromHierarchy callback doesn't fire for subframes when evicting from PageCache.
<https://webkit.org/b/163098>
<rdar://problem/28663488>
Reviewed by Antti Koivisto.
Fix a bug where WK2 didRemoveFrameFromHierarchy callbacks wouldn't fire for subframes that were getting
kicked out of PageCache. The problem was happening because CachedFrame would disconnect the Frame from
its Page just before calling FrameLoader::detachViewsAndDocumentLoader() where the callbacks are fired.
Without a Page, the WebFrame on WK2 side can't find its WebPage, and so it can't fire its callbacks.
The fix is just to switch the order of those two lines.
This bug was causing frequent DOM and window object leaks in some clients *cough* Safari *cough* that
were relying on didRemoveFrameFromHierarchy to release their isolated worlds.
Test: WebKit2.DidRemoveFrameFromHiearchyInPageCache
* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):
2016-10-07 Nan Wang <n_wang@apple.com>
AX: AXRoleDescription for details and summary elements
https://bugs.webkit.org/show_bug.cgi?id=163094
Reviewed by Chris Fleizach.
details and summary elements should have AXRoleDescription that is consistent with other
elements that have custom AXSubRole.
Test: accessibility/mac/details-summary-role-description.html
* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
2016-10-07 Ryan Haddad <ryanhaddad@apple.com>
Fix the Windows build after r206917.
Unreviewed build fix.
* dom/DOMAllInOne.cpp:
2016-10-07 Antti Koivisto <antti@apple.com>
Rename AuthorStyleSheets to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163108
Reviewed by Andreas Kling.
It represents the style scope in DOM.
Also move the file under style/.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::styleSheetScope):
* css/CSSStyleSheet.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
* css/InspectorCSSOMWrappers.h:
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::styleSheets):
(WebCore::StyleSheetList::detachFromDocument):
* dom/AuthorStyleSheets.cpp: Removed.
* dom/AuthorStyleSheets.h: Removed.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setContentLanguage):
(WebCore::Document::recalcStyle):
(WebCore::Document::needsStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::createStyleResolver):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::haveStylesheetsLoaded):
* dom/Document.h:
(WebCore::Document::styleScope):
(WebCore::Document::authorStyleSheets): Deleted.
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
(WebCore::InlineStyleSheetOwner::removedFromDocument):
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleScope):
(WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver):
(WebCore::ShadowRoot::styleScope):
(WebCore::ShadowRoot::updateStyle):
(WebCore::ShadowRoot::authorStyleSheets): Deleted.
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::insertedInto):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
(WebCore::Style::Scope::Scope):
(WebCore::Style::Scope::styleResolver):
(WebCore::Style::Scope::styleResolverIfExists):
(WebCore::Style::Scope::forNode):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::addStyleSheetCandidateNode):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::collectActiveStyleSheets):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::activeStyleSheetsContains):
(WebCore::Style::Scope::flushPendingUpdate):
(WebCore::Style::Scope::clearPendingUpdate):
(WebCore::Style::Scope::scheduleActiveSetUpdate):
(WebCore::Style::Scope::didChangeCandidatesForActiveSet):
(WebCore::Style::Scope::didChangeContentsOrInterpretation):
(WebCore::Style::Scope::pendingUpdateTimerFired):
(WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::styleResolver): Deleted.
(WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
(WebCore::AuthorStyleSheets::forNode): Deleted.
(WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
(WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
(WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
(WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
(WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
(WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
(WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
* style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
* style/StyleTreeResolver.cpp:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):
2016-10-07 Zalan Bujtas <zalan@apple.com>
https://vuldb.com/?cvssv3.2012 takes long time to load.
https://bugs.webkit.org/show_bug.cgi?id=162994
<rdar://problem/28593746>
Reviewed by Darin Adler.
Stop visiting cousins when we hit the style sharing search threshold.
In addition to mistakenly ignoring the threshold at SharingResolver::findSibling(), we
continued on searching for cousin elements.
Test: fast/selectors/slow-style-sharing-with-long-cousin-list.html
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::findSibling):
(WebCore::Style::SharingResolver::locateCousinList):
2016-10-07 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement generic reader functions
https://bugs.webkit.org/show_bug.cgi?id=163003
Reviewed by Darin Adler.
Implements reader generic functions defined by spec in order to prepare BYOBReader integration.
Generic functions factorize some code that is used by both DefaultReader and BYOBReader.
No change in behaviour.
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel): Rely on readableStreamReaderGenericCancel.
(releaseLock): Rely on readableStreamReaderGenericRelease.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader): Rely on readableStreamReaderGenericInitialize.
(readableStreamReaderGenericInitialize): Added.
(readableStreamReaderGenericCancel): Added.
(readableStreamReaderGenericRelease): Added.
2016-10-07 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Misc gardening: Use typedefs consistently and remove unused code
https://bugs.webkit.org/show_bug.cgi?id=163104
Reviewed by Philippe Normand.
Miscellaneous WebRTC gardening. See file list below for details.
Testing: No change in behavior.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
* Modules/mediastream/MediaEndpointPeerConnection.h:
Move NotImplemented include to cpp-file.
* platform/mediastream/MediaEndpoint.h:
Use MediaPayloadVector typedef (instead of Vector<RefPtr<MediaPayload>>).
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::source): Deleted.
(WebCore::PeerMediaDescription::setSource): Deleted.
Sources are passed to updateSendConfiguration() via a source map and not added to each
PeerMediaDescription anymore. Remove unused code.
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
(WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
Use MediaPayloadVector typedef.
* platform/mock/MockMediaEndpoint.h:
Use MediaPayloadVector typedef.
2016-10-07 Gwang Yoon Hwang <yoon@igalia.com>
[GTK] Remove unneeded creation of TextureMapperPlatformLayerProxy
https://bugs.webkit.org/show_bug.cgi?id=163101
Reviewed by Žan Doberšek.
Covered by existing tests.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData): Modified not to create
TextureMapperPlatformLayerProxy if it is not created for the
accelerated 2d canvas.
2016-10-07 Fujii Hironori <Hironori.Fujii@sony.com>
Use 'use lib $FindBin::Bin' to append Perl module include path
https://bugs.webkit.org/show_bug.cgi?id=162256
Reviewed by Carlos Garcia Campos.
Some Perl scripts are needed to be executed with '-I' switch to
explicitly append Perl module include path. Use 'use lib' as well
as other Perl scripts do.
* CMakeLists.txt: Removed '-I' options from invocation of Perl.
* DerivedSources.make: Ditto.
* bindings/scripts/generate-bindings.pl: Use 'use lib'.
* bindings/scripts/preprocess-idls.pl: Ditto.
* css/make-css-file-arrays.pl: Ditto.
* css/makegrammar.pl: Ditto.
* css/makeprop.pl: Ditto.
* css/makevalues.pl: Ditto.
* dom/make_dom_exceptions.pl: Ditto.
* dom/make_event_factory.pl: Ditto.
* dom/make_names.pl: Ditto.
* page/make_settings.pl: Ditto.
2016-10-07 Youenn Fablet <youenn@apple.com>
Refactor CachedResourceClient::notifyFinished
https://bugs.webkit.org/show_bug.cgi?id=162060
Reviewed by Darin Adler.
No change of behavior.
Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers.
In most cases, the CachedResource parameter is only used for assertions.
Removing that parameter might be contemplated in the future.
The only real case is in RenderImage.
Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values.
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):
* dom/LoadableClassicScript.h:
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLImageLoader.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::continueAfterResponseReceived):
(WebCore::ContentFilter::continueAfterDataReceived):
(WebCore::ContentFilter::continueAfterNotifyFinished):
(WebCore::ContentFilter::deliverResourceData):
* loader/ContentFilter.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
* loader/CrossOriginPreflightChecker.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::dataReceived):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
(WebCore::DocumentThreadableLoader::dataSent):
(WebCore::DocumentThreadableLoader::responseReceived):
(WebCore::DocumentThreadableLoader::dataReceived):
(WebCore::DocumentThreadableLoader::notifyFinished):
* loader/DocumentThreadableLoader.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/ImageLoader.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::triggerEvents):
(WebCore::LinkLoader::notifyFinished):
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.cpp:
(WebCore::LinkPreloadResourceClient::triggerEvents):
* loader/LinkPreloadResourceClients.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::shouldCacheResponse):
(WebCore::MediaResource::redirectReceived):
(WebCore::MediaResource::dataSent):
(WebCore::MediaResource::dataReceived):
(WebCore::MediaResource::notifyFinished):
(WebCore::MediaResource::getOrCreateReadBuffer):
* loader/MediaResourceLoader.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::processNewCueData):
(WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
(WebCore::TextTrackLoader::notifyFinished):
* loader/TextTrackLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::notifyClientsDataWasReceived):
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::redirectReceived):
(WebCore::CachedRawResource::responseReceived):
(WebCore::CachedRawResource::shouldCacheResponse):
(WebCore::CachedRawResource::didSendData):
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::dataSent):
(WebCore::CachedRawResourceClient::responseReceived):
(WebCore::CachedRawResourceClient::shouldCacheResponse):
(WebCore::CachedRawResourceClient::dataReceived):
(WebCore::CachedRawResourceClient::redirectReceived):
(WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::notifyFinished):
(WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::updateData):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* loader/soup/CachedRawResourceSoup.cpp:
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::responseReceived):
(WebCore::WebCoreAVCFResourceLoader::dataReceived):
(WebCore::WebCoreAVCFResourceLoader::notifyFinished):
(WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):
(WebCore::WebCoreAVFResourceLoader::dataReceived):
(WebCore::WebCoreAVFResourceLoader::notifyFinished):
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):
* rendering/RenderImage.h:
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::setRenderer):
(WebCore::RenderLayer::FilterInfo::notifyFinished):
* rendering/RenderLayerFilterInfo.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFEImageElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::notifyFinished):
* svg/SVGUseElement.h:
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParser.h:
2016-10-06 Youenn Fablet <youenn@apple.com>
CachedXSLStylesheet does not need to be updated according Origin/Fetch mode
https://bugs.webkit.org/show_bug.cgi?id=162389
Reviewed by Darin Adler.
No change of behavior.
Making clear that there is no reason to update cached XSLT resources according the origin, given that CORS is never checked and loading is always same-origin.
Renaming CachedResource::isClean to CachedResource::isCORSSameOrigin to better match spec terminology.
Updating HTMLLinkElement accordingly.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isCORSSameOrigin): Ensuring that this method is not called for resource types for which CORS is not to be used.
(WebCore::CachedResource::isClean): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2016-10-06 Youenn Fablet <youenn@apple.com>
Add a place for common HTTP Header values
https://bugs.webkit.org/show_bug.cgi?id=163002
Reviewed by Alex Christensen.
No change of behavior.
Introducing HTTPHeaderValues with two Content-Type values.
* CMakeLists.txt:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* WebCore.xcodeproj/project.pbxproj:
* platform/network/HTTPHeaderValues.cpp: Added.
(WebCore::HTTPHeaderValues::TextPlainContentType):
(WebCore::HTTPHeaderValues::FormURLEncodedContentType):
* platform/network/HTTPHeaderValues.h: Added.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
2016-10-06 Youenn Fablet <youenn@apple.com>
CachedResourceRequest should not need to store defer and preload options
https://bugs.webkit.org/show_bug.cgi?id=163004
Reviewed by Alex Christensen.
No change of behavior.
Removing CachedResourceRequest defer and preload fields.
These fields are computed inside CachedResourceLoader instead.
Updated setting of priority from CachedResourceRequest to CachedResource.
Priority is set for any new resource (this covers all cases where no cached resource can be reused from the memory cache).
Priority is set for a cached resource if the request is not a preload request.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::requestPreload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::priority):
(WebCore::CachedResourceRequest::forPreload): Deleted.
(WebCore::CachedResourceRequest::setForPreload): Deleted.
(WebCore::CachedResourceRequest::defer): Deleted.
(WebCore::CachedResourceRequest::setDefer): Deleted.
2016-10-06 Myles C. Maxfield <mmaxfield@apple.com>
Variation fonts don't affect glyph advances
https://bugs.webkit.org/show_bug.cgi?id=163093
Reviewed by Darin Adler.
Work around known bug <rdar://problem/28662086>. For variation fonts,
CTFontGetAdvancesForGlyphs() gives correct answers but
CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.
Test: fast/text/variations/advances.html
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hasVariations):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformWidthForGlyph):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
2016-10-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206713.
https://bugs.webkit.org/show_bug.cgi?id=163097
triggers apparent codegen bug on ARM 32-bit (Requested by smfr
on #webkit).
Reverted changeset:
"Support transitions/animations of background-position with
right/bottom-relative values"
https://bugs.webkit.org/show_bug.cgi?id=162048
http://trac.webkit.org/changeset/206713
2016-10-06 Daniel Bates <dabates@apple.com>
Remove unused WebCore::contentDispositionType()
https://bugs.webkit.org/show_bug.cgi?id=163095
Reviewed by Alex Christensen.
The function WebCore::contentDispositionType() was only used by the Chromium and Qt ports
to parse the Content-Disposition HTTP header. Both of these ports have long since been
removed from the repository. We should remove WebCore::contentDispositionType().
* platform/network/HTTPParsers.cpp:
(WebCore::contentDispositionType): Deleted.
* platform/network/HTTPParsers.h:
2016-10-06 Ryosuke Niwa <rniwa@webkit.org>
Upgrading and constructing element should always report exception instead of rethrowing
https://bugs.webkit.org/show_bug.cgi?id=162996
Reviewed by Darin Adler.
The latest HTML specification specifies that we must report exceptions thrown during element upgrades:
https://html.spec.whatwg.org/#upgrades
In addition, F2F during 2016 TPAC had a consensus that we should do the same for document.createElement:
https://github.com/w3c/webcomponents/issues/569
Since the HTML parser already reports the exception thrown during custom element construction as it does
not have any JS stack, these changes make exceptions thrown during upgrades and constructions.
In our implementation, this only reduces the code complexity as now we can push the logic to fallback
to HTMLUnknownElement into JSCustomElementInterface's constructElement, which has been renamed
to constructElementWithFallback, and eliminate ShouldClearException enum class entirely. Moreover,
constructElementWithFallback can now return Ref instead of RefPtr.
No new tests. Existing tests have been updated.
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback): Create a HTMLUnknownElement if
an attempt to construct a custom element had failed in lieu of returning nullptr.
(WebCore::JSCustomElementInterface::tryToConstructCustomElement): Renamed from constructElement.
Always report exceptions (the same behavior as ShouldClearException::Clear).
(WebCore::JSCustomElementInterface::upgradeElement): Report exceptions instead of rethrowing.
* bindings/js/JSCustomElementInterface.h:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
2016-10-06 Chris Dumez <cdumez@apple.com>
Overwriting an attribute event listener can lead to wrong event listener firing order
https://bugs.webkit.org/show_bug.cgi?id=163083
Reviewed by Darin Adler.
Overwriting an attribute event listener could lead to wrong event listener
firing order in WebKit. This is because we were removing the old event
listener and then appending the new one instead of actually *replacing*
the old one.
No new tests, rebaselined existing tests.
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::replace):
* dom/EventListenerMap.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::setAttributeEventListener):
(WebCore::EventTarget::hasActiveEventListeners): Deleted.
(WebCore::EventTarget::dispatchEventForBindings): Deleted.
* dom/EventTarget.h:
2016-10-06 Alex Christensen <achristensen@webkit.org>
URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
https://bugs.webkit.org/show_bug.cgi?id=163089
Reviewed by Tim Horton.
This is a change similar to r206818 but with relative URLs.
This matches the spec, URL::parse, and other browsers' behavior.
Covered by new API tests for URLParser.
This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.
* platform/URL.cpp:
(WebCore::URL::URL):
Use the same encoding for the URL constructor whether or not the URLParser is enabled.
* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
(WebCore::isSpecial): Deleted.
* platform/URLParser.h:
Use UTF-8 for non-special, ws, or wss schemes.
2016-10-06 Zalan Bujtas <zalan@apple.com>
Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
https://bugs.webkit.org/show_bug.cgi?id=92954
<rdar://problem/12147973>
Reviewed by Dan Bernstein.
LayoutTests pass fine now with this assert on.
Covered by existing tests.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paint):
2016-10-06 Jiewen Tan <jiewen_tan@apple.com>
Add a dummy SubtleCrypto interface
https://bugs.webkit.org/show_bug.cgi?id=162992
<rdar://problem/28643573>
Reviewed by Brent Fulgham.
Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
Tests: crypto/subtle/gc-2.html
crypto/subtle/gc-3.html
crypto/subtle/gc.html
crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
crypto/webkitSubtle/aes-cbc-generate-key.html
crypto/webkitSubtle/aes-cbc-import-jwk.html
crypto/webkitSubtle/aes-cbc-invalid-length.html
crypto/webkitSubtle/aes-cbc-unwrap-failure.html
crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
crypto/webkitSubtle/aes-cbc-wrap-rsa.html
crypto/webkitSubtle/aes-cbc-wrong-key-class.html
crypto/webkitSubtle/aes-export-key.html
crypto/webkitSubtle/aes-kw-key-manipulation.html
crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
crypto/webkitSubtle/aes-postMessage.html
crypto/webkitSubtle/argument-conversion.html
crypto/webkitSubtle/array-buffer-view-offset.html
crypto/webkitSubtle/crypto-key-algorithm-gc.html
crypto/webkitSubtle/crypto-key-usages-gc.html
crypto/webkitSubtle/hmac-check-algorithm.html
crypto/webkitSubtle/hmac-export-key.html
crypto/webkitSubtle/hmac-generate-key.html
crypto/webkitSubtle/hmac-import-jwk.html
crypto/webkitSubtle/hmac-postMessage.html
crypto/webkitSubtle/hmac-sign-verify-empty-key.html
crypto/webkitSubtle/hmac-sign-verify.html
crypto/webkitSubtle/import-jwk.html
crypto/webkitSubtle/jwk-export-use-values.html
crypto/webkitSubtle/jwk-import-use-values.html
crypto/webkitSubtle/rsa-export-generated-keys.html
crypto/webkitSubtle/rsa-export-key.html
crypto/webkitSubtle/rsa-export-private-key.html
crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
crypto/webkitSubtle/rsa-indexeddb-private.html
crypto/webkitSubtle/rsa-indexeddb.html
crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
crypto/webkitSubtle/rsa-oaep-key-manipulation.html
crypto/webkitSubtle/rsa-oaep-plaintext-length.html
crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
crypto/webkitSubtle/rsa-postMessage.html
crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
crypto/webkitSubtle/sha-1.html
crypto/webkitSubtle/sha-224.html
crypto/webkitSubtle/sha-256.html
crypto/webkitSubtle/sha-384.html
crypto/webkitSubtle/sha-512.html
crypto/webkitSubtle/unimplemented-unwrap-crash.html
crypto/webkitSubtle/unwrapKey-check-usage.html
crypto/webkitSubtle/wrapKey-check-usage.html
crypto/workers/subtle/aes-postMessage-worker.html
crypto/workers/subtle/gc-worker.html
crypto/workers/subtle/hmac-postMessage-worker.html
crypto/workers/subtle/hrsa-postMessage-worker.html
crypto/workers/subtle/multiple-postMessage-worker.html
crypto/workers/subtle/rsa-postMessage-worker.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* crypto/SubtleCrypto.idl: Added.
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
(WebCore::Crypto::subtle):
* page/Crypto.h:
* page/Crypto.idl:
2016-10-06 Anders Carlsson <andersca@apple.com>
Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
https://bugs.webkit.org/show_bug.cgi?id=163074
rdar://problem/27824842
Reviewed by Tim Horton.
Raise a type error on a null initializer object.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeMerchantValidation):
2016-10-06 Antti Koivisto <antti@apple.com>
Mutating styleSheet in shadow tree doesn't update the style
https://bugs.webkit.org/show_bug.cgi?id=162744
<rdar://problem/28550588>
Reviewed by Ryosuke Niwa.
We weren't always invalidating the right AuthorStyleSheets (to be renamed) instance
for the scope after mutations.
Test: fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::clearOwnerNode):
(WebCore::CSSStyleSheet::rootStyleSheet):
(WebCore::CSSStyleSheet::ownerDocument):
(WebCore::CSSStyleSheet::styleSheetScope):
Invalidate the right scope after stylesheet mutations.
* css/CSSStyleSheet.h:
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::styleResolver):
(WebCore::AuthorStyleSheets::styleResolverIfExists):
Take care to update the right style resolver.
(WebCore::AuthorStyleSheets::forNode):
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
Start the update timer so clients don't need to request update separately.
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
(WebCore::AuthorStyleSheets::updateStyleResolver):
* dom/AuthorStyleSheets.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
Save the scope we were inserted into so removals can be done reliably.
(WebCore::InlineStyleSheetOwner::removedFromDocument):
Use and clear the saved scope.
Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
(WebCore::authorStyleSheetsForElement): Deleted.
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleSheetScope):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolverIfExists):
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::~HTMLStyleElement):
(WebCore::HTMLStyleElement::parseAttribute):
Fix a bug where we wouldn't create stylesheet if a style element was activated by removing a media attribute.
(WebCore::HTMLStyleElement::insertedInto):
(WebCore::HTMLStyleElement::removedFrom):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::~SVGStyleElement):
(WebCore::SVGStyleElement::insertedInto):
(WebCore::SVGStyleElement::removedFrom):
2016-10-06 Alex Christensen <achristensen@webkit.org>
Skip tabs and newlines between end of query and beginning of fragment in non-UTF-8-encoded URLs
https://bugs.webkit.org/show_bug.cgi?id=163071
Reviewed by Tim Horton.
Covered by a new API test that would have asserted before this change.
* platform/URLParser.cpp:
(WebCore::URLParser::encodeQuery):
Skip tabs and newlines before asserting that we are at the end.
2016-10-06 Alex Christensen <achristensen@webkit.org>
URLParser should parse file URLs with ports consistently
https://bugs.webkit.org/show_bug.cgi?id=163075
Reviewed by Brady Eidson.
Covered by API tests. We used to assert when parsing the newly tested URLs.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-10-06 Chris Dumez <cdumez@apple.com>
[WebIDL] Add support for having dictionaries in their own IDL file
https://bugs.webkit.org/show_bug.cgi?id=162912
Reviewed by Darin Adler.
Add support for having dictionaries in their own IDL file so that they
can be shared by multiple interfaces.
Leverage this new support to merge Element::ScrollToOptions and
DOMWindow::ScrollToOptions.
No new tests, extended bindings tests.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
(IDLFileForInterface):
(GetDictionaryByName):
(IsDictionaryType):
(HasEnumImplementationNameOverride): Deleted.
(GetEnumImplementationNameOverride): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionary):
(GetEnumerationClassName):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GetDictionaryClassName):
(GenerateDefaultValue):
(GenerateDictionaryHeaderContent):
(GenerateDictionariesHeaderContent):
(GenerateDictionaryImplementationContent):
(GenerateDictionariesImplementationContent):
(GenerateHeader):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GetNativeType):
(JSValueToNative):
(GetNestedClassName): Deleted.
(GenerateConversionRuleWithLeadingComma): Deleted.
(addIterableProperties): Deleted.
* bindings/scripts/preprocess-idls.pl:
(containsInterfaceOrExceptionFromIDL):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
(WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added.
(WebCore::convertDictionary<TestStandaloneDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneDictionary.idl: Added.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/ScrollToOptions.h: Added.
* page/ScrollToOptions.idl: Added.
2016-10-06 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix.
* platform/graphics/Image.cpp: Add missing include
for 'NotImplemented' when building under Direct2D.
2016-10-06 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925
Reviewed by Brent Fulgham.
Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
and CoreAnimation implementation, or the Direct2D files, depending
on whether the USE_DIRECT2D macro is set in the CMake build options.
By default it builds the normal CA/CG way.
Add a stub GraphicsLayer implementation for Direct2D.
No new tests because there is no change in our active ports.
* PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
Direct2D.
* config.h: Make sure CA is turned of for Direct2D builds.
* page/win/FrameWinDirect2D.cpp: Add missing include file.
* platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
* platform/graphics/win/GraphicsLayerDirect2D.h: Added.
2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com>
[WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
https://bugs.webkit.org/show_bug.cgi?id=163001
Reviewed by Keith Miller.
Replace `throw new @XXXError(...)` to @throwXXXError intrinsic.
It reduces the size of bytecode sequence and facilitate inlining.
No behavior change.
* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders):
* Modules/fetch/FetchInternals.js:
(fillFetchHeaders):
* Modules/fetch/FetchRequest.js:
(initializeFetchRequest):
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse):
(clone):
* Modules/mediastream/NavigatorUserMedia.js:
(webkitGetUserMedia):
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
(getLocalStreams):
(getStreamById):
(addStream):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
(getReader):
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue):
(error):
(close):
* Modules/streams/ReadableStreamDefaultReader.js:
(releaseLock):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader):
(privateInitializeReadableStreamDefaultController):
(doStructuredClone):
(readableStreamError):
* Modules/streams/StreamInternals.js:
(validateAndNormalizeQueuingStrategy):
(enqueueValueWithSize):
* Modules/streams/WritableStream.js:
(initializeWritableStream):
(state):
* xml/XMLHttpRequest.js:
(response):
2016-10-06 John Wilander <wilander@apple.com>
Update Resource Load Statistics
https://bugs.webkit.org/show_bug.cgi?id=162811
Reviewed by Alex Christensen.
No new tests. The counting is based on top privately owned domains
which currently is not supported by layout tests nor API tests.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
Now captures statistics for web sockets too.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/ResourceLoadObserver.cpp:
Now captures statistics for synchronous XHR too.
(WebCore::is3xxRedirect):
Convenience function.
(WebCore::ResourceLoadObserver::shouldLog):
Convenience function.
(WebCore::ResourceLoadObserver::logFrameNavigation):
Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::logWebSocketLoading):
Added.
(WebCore::ResourceLoadObserver::logUserInteraction):
Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::primaryDomain):
Now makes use of the Public Suffix list.
Removed old custom parsing of primary domain.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
Convenience function.
(WebCore::ResourceLoadStatisticsStore::processStatistics): Deleted.
* loader/ResourceLoadStatisticsStore.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
Moved logging call higher up and added a check for whether we
are loading the main resource. The reason for moving it up is
to capture the request before some data may be cleared out in
redirect handling. We also want to capture failed CORS requests
since they are sent and then cancelled on the way back.
2016-10-06 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=162961
Reviewed by Eric Carlson.
Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
updates the ICE transport state of the corresponding transceiver and determines if the
RTCPeerConnection's aggregated iceConnectionState needs to be updated.
Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
"step-ice-transport-states". When initiated, this action replays a predefined set of ICE
transport state changes on a set of transceivers which can be observed via the
iceTransportStateChanged (mentioned above).
Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::deriveAggregatedIceConnectionState):
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpointClient::~MediaEndpointClient):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
(WebCore::MockMediaEndpoint::stepIceTransportStates):
(WebCore::MockMediaEndpoint::iceTransportTimerFired):
* platform/mock/MockMediaEndpoint.h:
2016-10-06 Youenn Fablet <youenn@apple.com>
CachedResource client handling methods should take reference
https://bugs.webkit.org/show_bug.cgi?id=163014
Reviewed by Alex Christensen.
No change of behavior.
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
(WebCore::CSSCrossfadeValue::loadSubimages):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::~CSSFilterImageValue):
(WebCore::CSSFilterImageValue::loadSubimages):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource):
(WebCore::CSSFontFaceSource::~CSSFontFaceSource):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::~StyleRuleImport):
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/DataTransfer.cpp:
(WebCore::DragImageLoader::startLoading):
(WebCore::DragImageLoader::stopLoading):
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::~LoadableClassicScript):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::parseStyleSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::process):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):
(WebCore::DocumentLoader::clearMainResource):
(WebCore::DocumentLoader::becomeMainResourceClient):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::~ImageLoader):
(WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::~LinkLoader):
(WebCore::LinkLoader::notifyFinished):
(WebCore::LinkLoader::loadLink):
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::addResource):
(WebCore::LinkPreloadResourceClient::clearResource):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::MediaResource):
(WebCore::MediaResource::stop):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::~TextTrackLoader):
(WebCore::TextTrackLoader::cancelLoad):
(WebCore::TextTrackLoader::load):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::didAddClient):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::didRemoveClient):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClient):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::switchClientsToRevalidatedResource):
(WebCore::CachedResource::Callback::timerFired):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasClient):
(WebCore::CachedResource::didRemoveClient):
* loader/cache/CachedSVGDocumentReference.cpp:
(WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::load):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::stopLoading):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
(WebCore::WebCoreAVCFResourceLoader::stopLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
(WebCore::WebCoreAVFResourceLoader::stopLoading):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::shutdown):
(WebCore::RenderImageResource::setCachedImage):
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
(WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::clearResourceReferences):
(WebCore::SVGFEImageElement::requestImageResource):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
(WebCore::SVGFontFaceUriElement::loadFont):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::~SVGUseElement):
(WebCore::SVGUseElement::updateExternalDocument):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::~XSLImportRule):
(WebCore::XSLImportRule::setXSLStyleSheet):
(WebCore::XSLImportRule::loadSheet):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):
2016-10-05 Philippe Normand <pnormand@igalia.com>
[GStreamer][OWR] GL rendering support
https://bugs.webkit.org/show_bug.cgi?id=162972
Reviewed by Žan Doberšek.
When GStreamer-GL is enabled the GL context needs to be properly passed
to the GStreamer pipeline running within the OpenWebRTC video renderer.
This is now supported using a new OpenWebRTC API that allows the
renderer to request the context from the application using a callback
registered within the renderer.
The player's GL context/display set-up was refactored to a new
method, requestGLContext, which is used as callback for the
OpenWebRTC request_context handler.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
2016-10-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Icon service and the IconButton class
https://bugs.webkit.org/show_bug.cgi?id=162970
<rdar://problem/28631803>
Reviewed by Dean Jackson.
We introduce the new IconButton class to display buttons that show an icon
in modern media controls. An IconButton uses a CSS mask-image to display the icon
such that we may set the actual button color to any value by setting the element's
background-color property.
Icons are obtained through the `iconService` singleton which knows how to load the
right icon for the current layout traits and resolution. Icons loaded through the
icon service are cached. In a later patch, we will be introducing functionality,
through the MediaControlsHost, to load the icon from the WebCore bundle.
Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
media/modern-media-controls/icon-button/icon-button.html
media/modern-media-controls/icon-service/icon-service.html
* Modules/modern-media-controls/controls/button.css:
(button):
* Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
(button.icon):
(button.icon:active):
* Modules/modern-media-controls/controls/icon-button.js: Added.
(IconButton):
(IconButton.prototype.get iconName):
(IconButton.prototype.set iconName):
(IconButton.prototype.handleEvent):
(IconButton.prototype.layout):
(IconButton.prototype._imageDidLoad):
(IconButton.prototype._updateImage):
* Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
(const.iconService.new.IconService):
(const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
(const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
* Modules/modern-media-controls/images/iOS/start@2x.png: Added.
* Modules/modern-media-controls/images/iOS/start@3x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
* Modules/modern-media-controls/images/macOS/start@1x.png: Added.
* Modules/modern-media-controls/images/macOS/start@2x.png: Added.
2016-10-06 Miguel Gomez <magomez@igalia.com>
[GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
https://bugs.webkit.org/show_bug.cgi?id=163008
Reviewed by Carlos Garcia Campos.
Put functions using cairo-gl behind appropriate guards.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2016-10-06 Miguel Gomez <magomez@igalia.com>
[GTK] Copying video textures to webgl should not depend on cairo-gl
https://bugs.webkit.org/show_bug.cgi?id=162904
Reviewed by Žan Doberšek.
Perform the texture copy without using cairo-gl.
Covered by existent tests.
* platform/GStreamer.cmake:
Add the new VideoTextureCopierGStreamer class to the build.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
Use VideoTextureCopierGStreamer to perform the copy.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Add a VideoTextureCopierGStreamer as a class attribute.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
Recalculates the matrix used as the texture coordinates transformation.
(WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
Recalculates the matrices used as the vertices coordinates transformation.
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
Performs the texture copy by using a shader that applies the rotation needed to follow
the video orientation.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.
2016-10-06 Gwang Yoon Hwang <yoon@igalia.com>
[GTK] Build fix for X11 and GStreamerGL after r183731
https://bugs.webkit.org/show_bug.cgi?id=163000
Reviewed by Philippe Normand.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Include gstgldisplay_egl.h if platform uses EGL.
2016-10-06 Mario Sanchez Prada <mario@endlessm.com>
[GStreamer] Can't play any video with GSTREAMER_GL enabled
https://bugs.webkit.org/show_bug.cgi?id=162669
Reviewed by Philippe Normand.
Make sure an EGLDisplay type is passed when creating the GstGlDisplay
for the EGL code path, instead of a native X11 display type, so
that we get a valid GstGlDisplay as a result, not a dummy one.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2016-10-06 Youenn Fablet <youenn@apple.com>
[Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
https://bugs.webkit.org/show_bug.cgi?id=162785
Reviewed by Alex Christensen.
Covered by rebased and existing tests.
Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
But they are not allowed for same-origin redirected requests.
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
(WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::checkInsecureContent):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::isSameOriginDataURL):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
2016-10-06 Youenn Fablet <youenn@apple.com>
[Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
https://bugs.webkit.org/show_bug.cgi?id=162892
Reviewed by Alex Christensen.
Covered by existing tests.
Before this patch, FetchResponse was never resolving the start promise.
This way, it could enqueue data, error or close the stream whenever desired.
With this patch, FetchResponse will feed the stream when being asked to.
This allows keeping the data in WebCore until the application needs it.
This is only implemented for network data.
For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.
Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
And the stream has a reference to the controller.
In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
stored in the response, which may allow applying backpressure to the network source in the future.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
(WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
(WebCore::FetchResponse::closeStream):
(WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponseSource.cpp:
(WebCore::FetchResponseSource::doPull):
(WebCore::FetchResponseSource::close):
(WebCore::FetchResponseSource::error):
* Modules/fetch/FetchResponseSource.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
(WebCore::ReadableStreamSource::isStarting): Deleted.
2016-10-06 Adam Bergkvist <adam.bergkvist@ericsson.com>
WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=162957
Reviewed by Eric Carlson.
Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
notify about ICE events.
Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
candidates followed by a gathering done indication. Initially, only a single action,
"dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
actions to support more test cases.
Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCIceTransport.h: Added.
RTCIceCandidate will eventually be part of the JS API, but right now it's
only used to keep track of the ICE states related to a RTCRtpTranscevier.
(WebCore::RTCIceTransport::create):
(WebCore::RTCIceTransport::~RTCIceTransport):
(WebCore::RTCIceTransport::transportState):
(WebCore::RTCIceTransport::setTransportState):
(WebCore::RTCIceTransport::gatheringState):
(WebCore::RTCIceTransport::setGatheringState):
(WebCore::RTCIceTransport::RTCIceTransport):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::emulatePlatformEvent):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::iceTransport):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpoint::emulatePlatformEvent):
* platform/mediastream/PeerConnectionStates.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::updateReceiveConfiguration):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
(WebCore::MockMediaEndpoint::iceCandidateTimerFired):
* platform/mock/MockMediaEndpoint.h:
* testing/Internals.cpp:
(WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
Generic API to signal down to the WebRTC platform mock.
* testing/Internals.h:
* testing/Internals.idl:
2016-10-06 Nan Wang <n_wang@apple.com>
AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
https://bugs.webkit.org/show_bug.cgi?id=162999
Reviewed by Chris Fleizach.
In WebKit1, the top web area setting the selection to an input element inside an iframe
will make the input field not editable. The issue is that when the web area and the input element
have different documents, the setSelection function in FrameSelection will set the selection on
the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.
Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2016-10-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206845.
https://bugs.webkit.org/show_bug.cgi?id=162998
broke el capitan build (Requested by alexchristensen on
#webkit).
Reverted changeset:
"Add Display P3 ColorSpace"
https://bugs.webkit.org/show_bug.cgi?id=162880
http://trac.webkit.org/changeset/206845
2016-10-05 Youenn Fablet <youenn@apple.com>
Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
https://bugs.webkit.org/show_bug.cgi?id=162960
Reviewed by Alex Christensen.
No change of behavior.
* bindings/scripts/CodeGenerator.pm:
(UpdateFile): Adding FIXME to enable lazy writing when feasible.
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
https://bugs.webkit.org/show_bug.cgi?id=162965
Reviewed by Carlos Garcia Campos.
Use SHA-256 instead.
No new tests, covered by TestSSL.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::computeCertificateHash):
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Bump Chrome version in Chrome user agent quirk
https://bugs.webkit.org/show_bug.cgi?id=162984
Reviewed by Carlos Garcia Campos.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-10-05 Dean Jackson <dino@apple.com>
Add Display P3 ColorSpace
https://bugs.webkit.org/show_bug.cgi?id=162880
<rdar://problem/28598564>
Reviewed by Sam Weinig.
Add a new ColorSpace for Display P3.
This will be tested once the Color class can create
objects that reference other color spaces.
* platform/graphics/ColorSpace.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::cachedCGColorSpace):
2016-10-05 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce InputEvent bindings in preparation for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162954
Reviewed by Ryosuke Niwa.
Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.
Tests: fast/events/input-events-fired-when-typing.html
fast/events/ios/input-events-fired-when-typing-in-contenteditable.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Event.cpp:
(WebCore::Event::composed):
(WebCore::Event::isInputEvent):
* dom/Event.h:
* dom/EventNames.in:
* dom/InputEvent.cpp: Added.
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h: Added.
* dom/InputEvent.idl: Added.
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):
* dom/Node.h:
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore::HTMLInputElement::setValueFromRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2016-10-05 Alex Christensen <achristensen@webkit.org>
URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
https://bugs.webkit.org/show_bug.cgi?id=162991
Reviewed by Saam Barati.
The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
but the syntax is stricter than if it were just an IPv4 address. There must be 4 pieces,
and each piece must be decimal (no octal or hex allowed). These should serialize to
regular hex IPv6 addresses.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Piece):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv4PieceInsideIPv6):
(WebCore::URLParser::parseIPv4AddressInsideIPv6):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parseIPv4Number): Deleted.
* platform/URLParser.h:
2016-10-05 Myles C. Maxfield <mmaxfield@apple.com>
Put variation fonts work behind a compile-time flag
https://bugs.webkit.org/show_bug.cgi?id=162949
Reviewed by Simon Fraser.
No new tests because there is no behavior change.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontVariationValue.cpp:
* css/CSSFontVariationValue.h:
* css/CSSPropertyNames.in:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFontFeatureValue): Deleted.
(WebCore::CSSValue::isFontVariationValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
(WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFontVariationSettings): Deleted.
* css/parser/CSSParserMode.h:
* page/Settings.in:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::blendFunc): Deleted.
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::setFeatureSettings): Deleted.
(WebCore::FontDescription::setVariationSettings): Deleted.
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::operator<<): Deleted.
* platform/graphics/FontTaggedSettings.h:
(WebCore::FontVariationSettings::isEmpty):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariationSettings): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariationSettings): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::variationFontsEnabled):
(WebCore::InternalSettings::setVariationFontsEnabled):
* testing/InternalSettings.h:
2016-10-05 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r206830
* platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
when building with Direct2D.
2016-10-05 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
https://bugs.webkit.org/show_bug.cgi?id=162977
Reviewed by Alex Christensen.
Currently the Direct2D implementation does not support some of the accelerated compositing
features that require CoreAnimation. During this bring-up, we want to disable these routines
so that we can build and run in (mostly) unaccelerated drawing.
This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
specific to those implementations.
This change should have no impact on non-Direct2D ports.
No change in behavior for active ports.
* config.h: Turn of CG when building in Direct2D.
* css/CSSFontFaceSource.cpp:
* loader/cache/CachedFont.cpp:
* loader/cache/CachedSVGFont.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/win/FrameCGWin.cpp:
* page/win/FrameDirect2D.cpp: Added.
* platform/graphics/Font.cpp:
* platform/graphics/FontCache.cpp:
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCALayer.cpp:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/ca/TileGrid.cpp:
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* platform/graphics/ca/win/LayerChangesFlusher.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
* platform/graphics/cg/GradientCG.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
* platform/graphics/win/FontCGWin.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
* platform/graphics/win/GradientDirect2D.cpp:
* platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
while building without Direct2D active.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
* platform/graphics/win/SimpleFontDataWin.cpp:
* platform/win/DragImageCGWin.cpp:
* platform/win/DragImageDirect2D.cpp: Added.
* rendering/RenderMediaControls.cpp:
2016-10-05 Chris Dumez <cdumez@apple.com>
KeyboardEvent.getModifierState() should support "CapsLock" modifier
https://bugs.webkit.org/show_bug.cgi?id=162861
Reviewed by Darin Adler.
Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
getModifierState() API, as per:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
No new tests, updated existing test.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* platform/PlatformEvent.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve OS X UA quirk
https://bugs.webkit.org/show_bug.cgi?id=162613
Reviewed by Carlos Garcia Campos.
Include OS X version number in user agent, like Safari does.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-10-05 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve comment in platformVersionForUAString
https://bugs.webkit.org/show_bug.cgi?id=162612
Reviewed by Carlos Garcia Campos.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString):
2016-10-05 Zalan Bujtas <zalan@apple.com>
Missing quotation mark when <q> gets reparented.
https://bugs.webkit.org/show_bug.cgi?id=162940
Reviewed by Darin Adler.
When an opening RenderQuote gets removed due to some change in the render tree,
we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
let the other RenderQuote know about it and its content becomes stale.
This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
we inform the other, corresponding opening/closing renderer about it.
Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::didAttachRenderers):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::insertedIntoTree):
* rendering/RenderQuote.h:
2016-10-05 Alex Christensen <achristensen@webkit.org>
URLParser should correctly strip unnecessary 0's in IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162979
Reviewed by Brady Eidson.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
Strip leading 0's and any 0's before the last 0 if the value is 0.
2016-10-05 Alex Christensen <achristensen@webkit.org>
UTF-8 encode queries of nonspecial and websocket schemes
https://bugs.webkit.org/show_bug.cgi?id=162956
Reviewed by Geoffrey Garen and Brady Eidson.
The URL spec says in the query state:
'If url is not special or url's scheme is either "ws" or "wss", set encoding to UTF-8.'
This should be determined as soon as we are done parsing the scheme.
Covered by new API tests.
This also fixes tests like fast/loader/javascript-url-encoding-2.html when URLParser is enabled.
* platform/URLParser.cpp:
(WebCore::isValidSchemeCharacter):
Renamed Scheme to ValidScheme so I can use Scheme as the name of an enum class in the same namespace.
(WebCore::isSpecial):
(WebCore::scheme):
Separate functionality so we can have different behavior for different sets of
ws and wss schemes, special, and non-special schemes.
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
Set isUTF8Encoding to true when we finish parsing the scheme if the scheme is ws, wss, or non-special,
according to spec. This also matches existing behavior. This way we will already know whether to go
into UTF8Query or NonUTF8Query state when we see a '?'.
(WebCore::isSpecialScheme): Deleted.
2016-10-05 Alex Christensen <achristensen@webkit.org>
Prepare to enable URLParser
https://bugs.webkit.org/show_bug.cgi?id=162974
Reviewed by Brady Eidson.
* platform/URL.cpp:
(WebCore::URL::serialize):
When we enable the URLParser, this attempt to make serialized URLs more spec compliant
won't be needed any more.
2016-10-05 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add initial D2D Path and Gradient implementation
https://bugs.webkit.org/show_bug.cgi?id=162923
Reviewed by Alex Christensen.
This patch lands a set of new files that implements initial Path
and Gradient features on Windows using Direct2D.
No new tests until complete backend lands.
* platform/graphics/Gradient.h:
* platform/graphics/Path.cpp:
* platform/graphics/Path.h:
* platform/graphics/win/GradientDirect2D.cpp: Added.
* platform/graphics/win/PathDirect2D.cpp: Added.
2016-10-05 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Align function names with spec
https://bugs.webkit.org/show_bug.cgi?id=162967
Reviewed by Darin Adler.
Align function names with spec. Behaviour was already in line with spec, but previous function names had
sometimes been preserved to track the changes more easily. This led to some inconsistencies (for instance,
enqueueInReadableStream was still used even though it works on a controller instead of a stream) and it
also made it more difficult to compare spec and implementation.
No change in behaviour.
* Modules/fetch/FetchInternals.js:
(consumeStream): Updated with new function names.
* Modules/fetch/FetchResponse.js:
(clone): Updated with new function names.
* Modules/streams/ReadableStream.js:
(tee): Updated with new function names.
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue): Updated with new function names.
(error): Updated with new function names.
* Modules/streams/ReadableStreamDefaultReader.js:
(read): Updated with new function names.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Updated with new function names.
(readableStreamDefaultControllerError): Updated with new function names.
(readableStreamTee): Updated with new function names.
(readableStreamTeePullFunction): Updated with new function names.
(readableStreamTeeBranch2CancelFunction): Updated with new function names.
(readableStreamError): Updated with new function names.
(readableStreamCancel): Updated with new function names.
(readableStreamDefaultControllerPull): Updated with new function names.
(readableStreamDefaultControllerClose): Updated with new function names.
(readableStreamClose): Updated with new function names.
(readableStreamDefaultControllerEnqueue): Updated with new function names.
(readableStreamDefaultReaderRead): Updated with new function names.
2016-10-05 Chris Dumez <cdumez@apple.com>
[Bindings] Declare dictionary / enumeration template specializations in the header
https://bugs.webkit.org/show_bug.cgi?id=162929
Reviewed by Darin Adler.
Declare dictionary / enumeration template specializations in the header
so that:
- They can be used from custom bindings code.
- Dictionaries / enumerations can be used to their own IDL files to
share them (Bug 162912).
No new tests, rebaselined bindings tests.
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/JSDOMConvert.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateInterface):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateDictionaryHeaderContent):
(GenerateHeader):
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GenerateDefaultValue): Deleted.
(GenerateDictionaryImplementationContent): Deleted.
(GenerateParametersCheck): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
2016-10-05 Zan Dobersek <zdobersek@igalia.com>
Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
https://bugs.webkit.org/show_bug.cgi?id=162903
Reviewed by Alex Christensen.
Rename build guards for the remaining implementation of the legacy EME API
to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
No new tests -- no change in behavior.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/CDMPrivateClearKey.cpp:
* Modules/encryptedmedia/CDMPrivateClearKey.h:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.h:
* Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/MediaKeyMessageEvent.h:
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
* Modules/encryptedmedia/MediaKeyNeededEvent.h:
* Modules/encryptedmedia/MediaKeyNeededEvent.idl:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.cpp:
* Modules/encryptedmedia/MediaKeys.h:
* Modules/encryptedmedia/MediaKeys.idl:
* bindings/js/JSDictionary.cpp:
* bindings/js/JSDictionary.h:
* dom/Element.idl:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
(WebCore::HTMLMediaElement::webkitAddKey):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaError.h:
* html/MediaError.idl:
* html/MediaKeyError.h:
* html/MediaKeyError.idl:
* page/Settings.h:
* platform/graphics/CDMSession.h:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::playerKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCDM.cpp:
* testing/MockCDM.h:
2016-10-05 Daniel Bates <dabates@apple.com>
Do not follow redirects when sending violation report
https://bugs.webkit.org/show_bug.cgi?id=162520
<rdar://problem/27957639>
Reviewed by Alex Christensen.
Do not follow redirects when sending a Content Security Policy or XSS Auditor violation report
as redirects can be used to forward report details to a third-party.
This changes makes WebKit more closely conform to the reporting requirements in section Reporting
of the Content Security Level 2 standard: <https://w3c.github.io/webappsec-csp/2/#violation-reports>
(Editor's Draft, 25 April 2016).
Tests: http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php
http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html
http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html
* loader/LoaderStrategy.h: Modified createPingHandle() to take a boolean, shouldFollowRedirects,
whether to follow redirect responses for a ping request.
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage): Pass ShouldFollowRedirects::Yes to PingLoader::startPingLoad to
keep our current behavior.
(WebCore::PingLoader::sendPing): Ditto. Note our current behavior of following redirects matches
the behavior described in the section "Hyperlink auditing" of the HTML standard:
<https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (23 September 2016).
(WebCore::PingLoader::sendViolationReport): Pass ShouldFollowRedirects::No to PingLoader::startPingLoad
so that we do not follow redirects when sending a violation report.
(WebCore::PingLoader::startPingLoad): Modified to take argument shouldFollowRedirects whether to
follow redirect responses for a ping request.
* loader/PingLoader.h:
* platform/network/PingHandle.h: Add boolean m_shouldFollowRedirects. I grouped this boolean with
the existing boolean, m_shouldUseCredentialStorage, as opposed to appending to the end of the class
definition to avoid increasing object size as clang will coalesces the two bools into a single
machine word. Override ResourceHandleClient::willSendRequest() and ResourceHandleClient::willSendRequestAsync()
to follow a redirect, if applicable.
2016-10-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162910
Reviewed by Alex Christensen.
So that it will be shared with network session code. Also remove setHostAllowsAnyHTTPSCertificate() that we have
never actually used.
* platform/network/ResourceHandle.h:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::tlsErrorsChangedCallback): Use SoupNetworkSession::checkTLSErrors().
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::add):
(WebCore::HostTLSCertificateSet::contains):
(WebCore::HostTLSCertificateSet::computeCertificateHash):
(WebCore::clientCertificates):
(WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors):
(WebCore::SoupNetworkSession::checkTLSErrors):
(WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
* platform/network/soup/SoupNetworkSession.h:
2016-10-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
https://bugs.webkit.org/show_bug.cgi?id=162891
Reviewed by Michael Catanzaro.
We are currently adding the HTTP body to the message in ResourceHandleSoup, but we could do it as part of the
ResourceRequest::updateSoupMessage() method, since the HTTP body is indeed part of the request. The code can be
also simplified, especially the handling of files, by using SharedBuffer that already mmaps the file when
possible, instead of using GMappedFile API.
* platform/SharedBuffer.h: Add createSoupBuffer() method.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::createSoupMessageForHandleAndRequest):
(WebCore::milisecondsSinceRequest): Deleted.
(WebCore::ResourceHandle::didStartRequest): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::ResourceHandle::start): Deleted.
(WebCore::ResourceHandle::releaseForDownload): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::appendEncodedBlobItemToSoupMessageBody): Helper method to append the blob to the request message body.
(WebCore::ResourceRequest::updateSoupMessageBody): Add HTTPBody to the request message body.
(WebCore::ResourceRequest::updateSoupMessage): Call updateSoupMessageBody() to also update the body.
* platform/soup/SharedBufferSoup.cpp:
(WebCore::SharedBuffer::createSoupBuffer): Returns a new SoupBuffer for the SharedBuffer.
2016-10-04 Chris Dumez <cdumez@apple.com>
Implement KeyboardEvent.code from the UI Event spec
https://bugs.webkit.org/show_bug.cgi?id=149584
Reviewed by Darin Adler.
Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/
The feature is only enabled on Mac for now as the implementation is
platform-specific and Mac only.
Test: fast/events/keyboardevent-code.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::code):
(WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::codeForKeyEvent):
(WebCore::keyIdentifierForKeyEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-10-04 Said Abou-Hallawa <sabouhallawa@apple.com>
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Reviewed by Tim Horton.
Instead of creating an NSImage with all the frames for the dragImage,
create an NSImage with the current frame only.
* dom/DataTransferMac.mm:
(WebCore::DataTransfer::createDragImage): Call snapshotNSImage() to create the dragImage.
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement): Call the Image function with its new name.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::nsImage): Rename getNSImage() to nsImage().
(WebCore::Image::snapshotNSImage): Returns the NSImage of the current frame.
(WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::Image::getNSImage): Deleted.
(WebCore::Image::getTIFFRepresentation): Deleted.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
(WebCore::BitmapImage::snapshotNSImage): Returns the NSImage of the current frame.
(WebCore::BitmapImage::getTIFFRepresentation): Deleted.
(WebCore::BitmapImage::getNSImage): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor): Call snapshotNSImage() since the cursor does not animate anyway.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Use snapshotNSImage() for the dragImage.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Call the Image function with its new name.
2016-10-04 Andy Estes <aestes@apple.com>
[iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigation to a QuickLook resource
https://bugs.webkit.org/show_bug.cgi?id=162950
<rdar://problem/23759114>
Reviewed by Brady Eidson.
When we receive data from QLPreviewConverter for the first time, we call
ResourceLoader::didReceiveResponse() with the preview NSURLResponse from QuickLook. If the
client decides to cancel this navigation in decidePolicyForResponse(),
WebResourceLoaderQuickLookDelegate will end up with a null _resourceLoader after
didReceiveResponse() returns. This change adds null checks in the methods that use
_resourceLoader after calling -_sendDidReceiveResponseIfNecessary.
New API test: QuickLook.CancelNavigationAfterResponse
* platform/network/ios/QuickLook.mm:
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Changed to only
call ResourceLoader::didReceiveDataArray() if _resourceLoader is non-null.
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto for
ResourceLoader::didReceiveData().
(-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto for
ResourceLoader::didFail().
2016-10-04 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.isComposing attribute
https://bugs.webkit.org/show_bug.cgi?id=162921
Reviewed by Darin Adler.
Add support for KeyboardEvent.isComposing attribute:
- https://www.w3.org/TR/uievents/#dom-keyboardevent-iscomposing
- https://www.w3.org/TR/uievents/#ref-for-dom-keyboardevent-iscomposing-3
Manual test: https://jsfiddle.net/ay92sr08/9/
No new tests, extended existing tests.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
2016-10-03 Ryosuke Niwa <rniwa@webkit.org>
ShadowRoot interface should have elementFromPoint
https://bugs.webkit.org/show_bug.cgi?id=162882
Reviewed by Chris Dumez.
Add elementFromPoint to ShadowRoot's prototype as specified at:
https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin
with changes proposed at https://github.com/w3c/csswg-drafts/issues/556
Added TreeScope::retargetToScope which implements
This patch also factors DocumentOrShadowRoot.idl out of Document and ShadowRoot interfaces to better match
the latest DOM specification: https://dom.spec.whatwg.org/#mixin-documentorshadowroot
Test: fast/shadow-dom/Document-prototype-elementFromPoint.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::nodeFromPoint): Moved to TreeScope.
(WebCore::Document::elementFromPoint): Moved to TreeScope.
* dom/Document.h:
* dom/Document.idl: Moved elementFromPoint and activeElement to DocumentOrShadowRoot.idl.
* dom/DocumentOrShadowRoot.idl: Added.
* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::checkConsistency): Use newly added TreeScope::retargetToScope.
* dom/ShadowRoot.idl: Moved activeElement to DocumentOrShadowRoot.idl.
* dom/TreeScope.cpp:
(WebCore::TreeScope::retargetToScope): Added. Implements https://dom.spec.whatwg.org/#retarget efficiently.
Instead of checking whether A (node) is a shadow-including inclusive ancestor of B (this scope) at each
parent, find the lowest ancestor which contains both A and B, and return the self-inclusive ancestor of B
in that tree. To find the lowest common ancestor in O(n), traverse all ancestors of A and B separately and
do a top-down traversal. The last tree scope in which A's ancestor and B's ancestor match is the lowest
common ancestor.
(WebCore::TreeScope::nodeFromPoint): Moved from Document.
(WebCore::TreeScope::elementFromPoint): Moved from Document. Use retargetToScope and parentInComposedTree
instead of parentNode and ancestorInThisScope to match the semantics proposed in
https://github.com/w3c/csswg-drafts/issues/556
* dom/TreeScope.h:
2016-10-04 Myles C. Maxfield <mmaxfield@apple.com>
font-family: cursive should map to KaiTi in Chinese
https://bugs.webkit.org/show_bug.cgi?id=162889
<rdar://problem/28363547>
Reviewed by Tim Horton.
According to Bobby Tung, this is a better mapping. Previously, we were
relying on the system fallback mechanism. However, an explicit mapping
is more robust.
Test: fast/text/cursive-zh.html
* page/cocoa/SettingsCocoa.mm:
(WebCore::Settings::initializeDefaultFontFamilies):
2016-10-04 Alex Christensen <achristensen@webkit.org>
URLParser: query-only URLs relative to file URLs should just add a query
https://bugs.webkit.org/show_bug.cgi?id=162888
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Like bug 206749 but with queries instead of fragments.
2016-10-04 Alex Christensen <achristensen@webkit.org>
URLParser should match URL::parse and other browsers when parsing a URL containing only scheme://
https://bugs.webkit.org/show_bug.cgi?id=162909
Reviewed by Tim Horton.
If there's no host in this case we shouldn't fail, but rather make a valid URL with the // in the path.
This matches Chrome, Firefox, and Safari's behavior.
Covered by API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-10-04 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r206773.
Exclude Direct2D definitions when building for normal CG Windows.
* platform/graphics/GraphicsContext.h:
2016-10-04 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
https://bugs.webkit.org/show_bug.cgi?id=162916
Reviewed by Filip Pizlo.
* ForwardingHeaders/domjit/DOMJITGetterSetter.h: Added.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
2016-10-04 Chris Dumez <cdumez@apple.com>
Return null when window.open() is popup blocked
https://bugs.webkit.org/show_bug.cgi?id=162897
Reviewed by Michael Catanzaro.
The return value of window.open() when the popup is blocked should be null:
- https://github.com/whatwg/html/pull/1854
- https://github.com/whatwg/html/issues/1851
Firefox / Edge return null.
No new tests, rebaselined existing tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::open):
2016-10-04 Chris Dumez <cdumez@apple.com>
[Web IDL] Add support for dictionary inheritance
https://bugs.webkit.org/show_bug.cgi?id=162907
Reviewed by Sam Weinig.
Add support for dictionary inheritance to our Web IDL parser and
bindings generator. Leverage this new support for EventTarget's
EventListenerOptions / AddEventListenerOptions dictionaries, in
order to match the DOM specification:
- https://dom.spec.whatwg.org/#interface-eventtarget
Also update the bindings generator to convert the dictionary
members in lexicographical order, as per:
- https://heycam.github.io/webidl/#es-dictionary (Step 5.1)
No new tests, rebaselined bindings tests.
* bindings/scripts/CodeGenerator.pm:
(GetDictionaryByName):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/IDLParser.pm:
(parseDictionary):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/TestObj.idl:
* dom/EventTarget.idl:
2016-10-04 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add initial D2D GraphicsContext implementation
https://bugs.webkit.org/show_bug.cgi?id=162917
Reviewed by Dean Jackson.
This patch lands a set of new files that implement the GraphicsContext
features on Windows using Direct2D.
No new tests until complete backend lands.
* platform/graphics/Color.h: Add new casting operator.
* platform/graphics/FloatSize.h: Ditto.
* platform/graphics/GraphicsContext.cpp: Update for Direct2D
implementation.
* platform/graphics/GraphicsContext.h:
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_VECTOR_4F): Added.
* platform/graphics/win/GraphicsContextCGWin.cpp: Add compiler
guard to avoid building when using Direct2D.
* platform/graphics/win/GraphicsContextDirect2D.cpp: Added.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Added.
* platform/graphics/win/GraphicsContextWin.cpp: Update for Direct2D
includes.
* platform/graphics/win/TransformationMatrixDirect2D.cpp: Fix comment.
2016-10-04 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove SSLPolicyFlags from SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162906
Reviewed by Michael Catanzaro.
All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
the session like we do for all other construct parameters.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession):
(WebCore::SoupNetworkSession::setupLogger):
(WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
(WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
(WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
* platform/network/soup/SoupNetworkSession.h:
(WebCore::SoupNetworkSession::soupSession): Deleted.
2016-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
https://bugs.webkit.org/show_bug.cgi?id=162766
<rdar://problem/28533523>
Reviewed by Jer Noble.
When showing Now Playing controls for a media session, we should first set up the Now Playing info and
playback state before telling MediaRemote to make the session visible. This is WebKit work in ensuring that
when switching Now Playing sessions by switching tabs, we do not first display an invalid Now Playing state
before updating to the expected state.
Adds 2 new WebKit API tests in NowPlayingControlsTests: NowPlayingControlsHideAfterShowingClearsInfo and
NowPlayingControlsClearInfoAfterSessionIsNoLongerValid.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime):
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2016-10-04 Youenn Fablet <youenn@apple.com>
[Fetch API] ReadableStream should be errored with TypeError values
https://bugs.webkit.org/show_bug.cgi?id=162895
Reviewed by Alex Christensen.
Test: imported/w3c/web-platform-tests/fetch/api/basic/error-after-response.html
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail): Removing FIXME.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::error<String>): Erroring with TypeError values.
2016-10-03 Chris Dumez <cdumez@apple.com>
Bindings do not throw a TypeError if a required dictionary member is missing
https://bugs.webkit.org/show_bug.cgi?id=162734
Reviewed by Geoffrey Garen.
Bindings should throw a TypeError if a required dictionary member is missing.
For example, if there is a "required long id" member in a dictionary that is
missing, our bindings would prevously pass 0 to the implementation instead
of throwing a TypeError.
Relevant specification:
- https://heycam.github.io/webidl/#es-dictionary
I aligned our bindings generator implementation with the specification,
except for the support for dictionary inheritance that is still missing
and will be addressed in a follow-up patch.
No new tests, I rebaselined the bindings tests and this is already covered
by fast/events/touch/touch-constructor.html on iOS.
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDOMConvert.h:
(WebCore::convert): Deleted.
(WebCore::Converter<bool>::convert): Deleted.
(WebCore::Converter<String>::convert): Deleted.
(WebCore::Converter<IDLDOMString>::convert): Deleted.
(WebCore::Converter<IDLUSVString>::convert): Deleted.
(WebCore::Converter<JSC::JSValue>::convert): Deleted.
(WebCore::Converter<int8_t>::convert): Deleted.
(WebCore::Converter<uint8_t>::convert): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
2016-10-03 Zalan Bujtas <zalan@apple.com>
[ListItems] Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162832
Reviewed by Simon Fraser.
List item markers are inserted into the tree during layout, right before laying out
the list item (that's a big FIXME). At this point we already know what part of the tree
needs to be laid out. Inserting a list item marker does not expand this dirty area.
However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
In certain cases (floating renderers), it could potentially trigger some unintentional markings
and we return from FrameView::layout() with a dirty subtree.
This patch preemptively marks the list item and its marker dirty so that
when the marker is getting inserted into the tree, we stop the marking at the parent.
Not testable.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2016-10-03 Myles C. Maxfield <mmaxfield@apple.com>
Implement rendering of font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162782
Reviewed by Zalan Bujtas.
(Re-landing after fixing tests.)
Because the heavy lifting for font-variation-settings is done by CoreText,
this patch is fairly minimal. It simply hooks up the CSS property to CoreText.
There is an existing bug in CoreText where variations inside fonts do not
survive the addition of a cascade list. Therefore, FontPlatformData::ctFont()
needs to work around this (conditionally) by resupplying the variation at
the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>.
Tests: fast/text/variations/duplicate.html
fast/text/variations/exist.html
fast/text/variations/inheritance.html
fast/text/variations/order.html
fast/text/variations/outofbounds.html
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAttributesDictionary):
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
(WebCore::FontPlatformData::ctFont):
(WebCore::cascadeToLastResortFontDescriptor): Deleted.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2016-10-03 Alex Christensen <achristensen@webkit.org>
URLParser should strip tabs at all locations
https://bugs.webkit.org/show_bug.cgi?id=162836
Reviewed by Geoffrey Garen.
Covered by adding tabs to each location of each API test
except tests that test the encoding of surrogate pairs,
because inserting a tab between the pairs changes the encoding.
* platform/URLParser.cpp:
(WebCore::URLParser::takesTwoAdvancesUntilEnd):
(WebCore::URLParser::parse):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:
2016-10-03 Antti Koivisto <antti@apple.com>
Remove Document::elementSheet()
https://bugs.webkit.org/show_bug.cgi?id=162876
Reviewed by Andreas Kling.
This is a Document owned stylesheet that exists as a context for parsing element inline style.
It never contains any rules and is generally confusing.
This patch removes the requirement for a stylesheet to be present for CSSParser to operate in
the correct context. Inline style is now parsed without stylesheet and a context object is
passed instead.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::root):
* bindings/js/JSCSSStyleDeclarationCustom.h:
(WebCore::root): Deleted.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText):
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
(WebCore::PropertySetCSSStyleDeclaration::cssParserContext):
(WebCore::StyleRuleCSSStyleDeclaration::parentStyleSheet):
(WebCore::StyleRuleCSSStyleDeclaration::cssParserContext):
(WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
(WebCore::InlineCSSStyleDeclaration::cssParserContext):
* css/PropertySetCSSStyleDeclaration.h:
(WebCore::PropertySetCSSStyleDeclaration::didMutate): Deleted.
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
(WebCore::MutableStyleProperties::setCustomProperty):
(WebCore::MutableStyleProperties::parseDeclaration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseCustomPropertyValue):
(WebCore::CSSParser::parseInlineStyleDeclaration):
* css/parser/CSSParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::updateBaseURL):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::setHasElementUsingStyleBasedEditability):
(WebCore::Document::elementSheet): Deleted.
* dom/Document.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleFromString):
(WebCore::StyledElement::invalidateStyleAttribute):
The usesStyleBasedEditability bit used to be set via the elementSheet. Instead check for it after inline style mutations.
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
(WebCore::StyledElement::invalidateStyleAttribute): Deleted.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
2016-10-03 Brent Fulgham <bfulgham@apple.com>
Avoid null dereference when changing focus in design mode.
https://bugs.webkit.org/show_bug.cgi?id=162877
<rdar://problem/28061261>
Reviewed by Chris Dumez.
The bare m_frame pointer in DOMWindow can be cleared when setting focus to a new element. Check
that the m_frame pointer is non-null before using it after calling a routine that could
clear the pointer value.
Test: fast/frames/iframe-focus-crash.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus): Check that the pointer is still non-null after setting the
current focused element to nullptr.
2016-10-03 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267
Reviewed by Darin Adler.
Add support for KeyboardEvent.key attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-key
This is behind a compile time flag that is only enabled on Mac and
iOS and the implementation is still missing for other platforms.
Test: fast/events/keyboardevent-key.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::key):
* platform/cocoa/KeyEventCocoa.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyForCharCode):
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
(WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-10-03 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267
Reviewed by Darin Adler.
Add support for KeyboardEvent.key attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-key
This is behind a compile time flag that is only enabled on Mac and
iOS and the implementation is still missing for other platforms.
Test: fast/events/keyboardevent-key.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::key):
* platform/cocoa/KeyEventCocoa.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyForCharCode):
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
(WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-10-03 Alex Christensen <achristensen@webkit.org>
URLParser: fragment-only URLs relative to file URLs should just add a fragment
https://bugs.webkit.org/show_bug.cgi?id=162871
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Instead of adding ///# after copying the base URL to the query, just add an #.
2016-10-03 Antoine Quint <graouts@apple.com>
[Modern Media Controls] LayoutItem and Button classes
https://bugs.webkit.org/show_bug.cgi?id=162868
<rdar://problem/28590166>
Reviewed by Dean Jackson.
We introduce the new Button class and its parent class LayoutItem. We will subclass Button
a lot in coming patches, as it provides a way to create a button and provide a delegate to
respond to UI events via the `uiDelegate` property. A Button extends a LayoutItem, another
class that we'll subclass heavily in coming patches, which is simply a LayoutNode with a
`layoutDelegate` which allows to set the node's `layoutTraits`, a bit-mask allowing to
specify layout attributes such as the platform and playback styles.
Tests: media/modern-media-controls/button/button.html
media/modern-media-controls/layout-item/layout-item.html
* Modules/modern-media-controls/controls/button.css: Added.
(button):
* Modules/modern-media-controls/controls/button.js: Added.
(Button):
(Button.prototype.get enabled):
(Button.prototype.set enabled):
(Button.prototype.handleEvent):
(Button.prototype._handleUIEvent):
* Modules/modern-media-controls/controls/layout-item.js: Added.
(LayoutItem.prototype.get layoutTraits):
(LayoutItem):
2016-10-03 Andy Estes <aestes@apple.com>
ASSERTION FAILED: url.containsOnlyASCII() in WebCore::checkEncodedString() when parsing an invalid CSS cursor URL
https://bugs.webkit.org/show_bug.cgi?id=162763
<rdar://problem/28572758>
Reviewed by Youenn Fablet.
CSSCursorImageValue copies the URL of its underlying CSSImageValue by using the
ParsedURLString URL constructor on the String returned by CSSImageValue::url(). While
CSSImageValues were always being constructed from a URL implicitly converted to a String,
nothing ensured that the URL was valid. For invalid URLs, URL::string() returns the string
it was constructed with, which might still represent a relative URL or contain non-ASCII
characters, violating the preconditions of the ParsedURLString URL constructor and causing
an assertion to fail in Debug builds.
Fix this by having CSSImageValue store its image URL using a WebCore::URL rather than a
String. CSSCursorImageValue can then copy this URL instead of attempting to re-parse a
possibly-invalid URL string.
Test: fast/css/cursor-with-invalid-url.html
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue): Copied m_imageValue.url() into
m_originalURL instead of using the ParsedURLString URL constructor, since
CSSImageValue::url() now returns a WebCore::URL.
(WebCore::CSSCursorImageValue::loadImage): Created a URL from cursorElement->href() by
calling Document::completeURL().
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::CSSImageValue): Changed to take a URL&& instead of a const String&.
(WebCore::CSSImageValue::loadImage): Stopped calling Document::completeURL(), since m_url is
now a WebCore::URL.
* css/CSSImageValue.h: Changed url() to return a const URL&, and changed m_url to be a URL.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Removed a call to
URL::string().
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
2016-10-03 Zalan Bujtas <zalan@apple.com>
Log an error to stderr when FrameView::layout() fails to clean all the renderers.
https://bugs.webkit.org/show_bug.cgi?id=162835
Reviewed by Simon Fraser.
We've come across multiple layout/painting bugs caused by renderers left dirty
after FrameView::layout(). This patch helps catching such issues early.
Once all the blocking bugs are fixed (webkit.org/b/162835), logging should be replaced with ASSERT().
Not testable.
* page/FrameView.cpp:
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
(WebCore::FrameView::layout):
2016-10-03 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add D2D Bitmap Image handling code
https://bugs.webkit.org/show_bug.cgi?id=162761
Reviewed by Dean Jackson.
This patch lands a set of new files that implement
Image and BitmapImage features on Windows using
Direct2D.
The desired ID2D1RenderTarget handle is needed by the
image decoder so that it can load the resulting bitmap
into the GPU.
No new tests until complete backend lands.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Tell the Direct2D image decoder
which render target to use.
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageBuffer.cpp:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferData.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setRenderTarget): Added.
* platform/graphics/ImageFrameCache.h:
(WebCore::ImageFrameCache::decoder): Added.
* platform/graphics/ImageSource.cpp:
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::setRenderTarget):
* platform/graphics/win/ImageBufferDataDirect2D.cpp: Added.
* platform/graphics/win/ImageBufferDataDirect2D.h: Added.
* platform/graphics/win/ImageBufferDirect2D.cpp: Added.
* platform/graphics/win/ImageCGWin.cpp:
* platform/graphics/win/ImageDecoderDirect2D.cpp: Added.
* platform/graphics/win/ImageDecoderDirect2D.h: Added.
* platform/graphics/win/ImageDirect2D.cpp: Added.
* platform/graphics/win/NativeImageDirect2D.cpp: Added.
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove unused methods toSoupMessage from ResourceRequest/Response
https://bugs.webkit.org/show_bug.cgi?id=162867
Reviewed by Sergio Villar Senin.
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessage):
(WebCore::ResourceRequest::updateFromSoupMessage): Deleted.
* platform/network/soup/ResourceResponse.h:
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::updateFromSoupMessage): Deleted.
2016-10-03 Youenn Fablet <youenn@apple.com>
Remove FetchBody::m_isEmpty
https://bugs.webkit.org/show_bug.cgi?id=162857
Reviewed by Alex Christensen.
No change of behavior.
Moving handling of null bodies in FetchBodyOwner, by having an Optional<FetchBody> in FetchBodyOwner.
Moving storage of m_contentType in FetchBodyOwner.
Moving header storage from FetchResponse/FetchRequest to FetchBodyOwner, as it helps updating m_contentType.
* Modules/fetch/FetchBody.cpp: removing m_isEmpty and m_contentType.
(WebCore::FetchBody::extract): Computes the default content-type which is stored in FetchBodyOwner.
(WebCore::FetchBody::blob):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::loadingSucceeded):
(WebCore::FetchBody::bodyForInternalRequest):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::loadingBody):
(WebCore::FetchBody::FetchBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::FetchBodyOwner):
(WebCore::FetchBodyOwner::stop):
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::cloneBody): Needs to clone m_contentType as well.
(WebCore::FetchBodyOwner::extractBody):
(WebCore::FetchBodyOwner::updateContentType):
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
(WebCore::FetchBodyOwner::loadBlob):
(WebCore::FetchBodyOwner::blobLoadingSucceeded):
(WebCore::FetchBodyOwner::blobLoadingFailed):
(WebCore::FetchBodyOwner::finishBlobLoading):
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::body):
(WebCore::FetchBodyOwner::isBodyNull):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::internalRequest):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h:
(WebCore::FetchRequest::FetchRequest):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::initializeWith):
(WebCore::FetchResponse::FetchResponse):
(WebCore::FetchResponse::cloneForJS):
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveResponse):
(WebCore::FetchResponse::BodyLoader::start):
(WebCore::FetchResponse::createReadableStreamSource):
* Modules/fetch/FetchResponse.h:
2016-10-03 Andy Estes <aestes@apple.com>
ASSERTION FAILED: result in WebCore::CSSParser::parseURI
https://bugs.webkit.org/show_bug.cgi?id=141638
<rdar://problem/27709952>
Reviewed by Andreas Kling.
CSSParser::parseURIInternal() failed to parse unquoted URLs with Unicode escape sequences
greater than 0xFF, even when the destination character type was multi-byte. Fixed by
checking the size of DestCharacterType instead of SrcCharacterType.
Updated fast/css/url-with-multi-byte-unicode-escape.html to test for an unquoted URL.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseURIInternal): For code points greater than 0xFF, only returned
false if sizeof(DestCharacterType) == 1.
2016-10-03 Alex Christensen <achristensen@webkit.org>
URLParser: empty relative URLs should not copy fragment from the base URL
https://bugs.webkit.org/show_bug.cgi?id=162864
Reviewed by Chris Dumez.
Covered by new API tests.
* platform/URL.cpp:
(WebCore::URL::removeFragmentIdentifier):
Optimize removing fragments, now that it happens more often. We don't need to reparse,
because the result will always be equal to just a substring when removing the fragment at the end.
* platform/URLParser.cpp:
(WebCore::URLParser::copyASCIIStringUntil):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::containsOnlyC0ControlOrSpace):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
* platform/URLParser.h:
Because we are not copying the fragment, we can simplify and remove some unreachable code.
2016-10-03 Chris Dumez <cdumez@apple.com>
td.scope should only return known values
https://bugs.webkit.org/show_bug.cgi?id=162755
Reviewed by Sam Weinig.
td.scope should only return known values:
- https://html.spec.whatwg.org/#dom-th-scope
Firefox conforms to the specification.
No new tests, rebaselined existing test.
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::scope):
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Simplify AuthenticationChallenge
https://bugs.webkit.org/show_bug.cgi?id=162784
Reviewed by Alex Christensen.
We don't really need to keep references to the SoupSession and SoupMessage in AuthenticationChallenge, the
SoupNetworkSession callback already forwards the challenge to the right ResourceHandle.
* platform/network/soup/AuthenticationChallenge.h:
(WebCore::AuthenticationChallenge::authenticationClient):
(WebCore::AuthenticationChallenge::soupSession): Deleted.
(WebCore::AuthenticationChallenge::soupMessage): Deleted.
* platform/network/soup/AuthenticationChallengeSoup.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::platformCompare):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedCancellation):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::authenticateCallback):
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Cleanup persistent credential storage code
https://bugs.webkit.org/show_bug.cgi?id=162777
Reviewed by Alex Christensen.
We have this feature behind ENABLE_CREDENTIAL_STORAGE flag, which is confusing, because we use credential
storage unconditionally and this is only about persistent storage. Also the flag assumes libsecret is available,
and since it's only used by GTK sometimes we use GTK ifdefs instead of CREDENTIAL_STORAGE. So, I think we should
use USE(LIBSECRET) instead, and reduce a bit the ifdefs in common soup code. Another problem is that current
implementation is always used, while it should depend on the current network storage session and never used in
ephemeral sessions. This patch moves the code from CredentialBackingStore to NetworkStorageSessionSoup and
modernizes a bit.
* PlatformGTK.cmake: Remove CredentialBackingStore.cpp.
* platform/gtk/GRefPtrGtk.cpp: Use USE(LIBSECRET)
* platform/gtk/GRefPtrGtk.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/gtk/CredentialBackingStore.cpp: Removed.
* platform/network/gtk/CredentialBackingStore.h: Removed.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::schemeFromProtectionSpaceServerType):
(WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
(WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
(WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::gotHeadersCallback):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge): Deleted.
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): Deleted.
(WebCore::ResourceHandle::receivedCancellation): Deleted.
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build with coordinated graphics enabled after r206712.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
2016-10-02 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.getModifierState() operation
https://bugs.webkit.org/show_bug.cgi?id=162855
Reviewed by Darin Adler.
Add support for KeyboardEvent.getModifierState() operation:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
Test: fast/events/constructors/keyboard-event-getModifierState.html
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.idl:
2016-10-02 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.repeat attribute
https://bugs.webkit.org/show_bug.cgi?id=162854
Reviewed by Darin Adler.
Add support for KeyboardEvent.repeat attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-repeat
No new tests, extended existing test.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
2016-10-02 Darin Adler <darin@apple.com>
Rename ExceptionCode-based exception handling to "legacy"
https://bugs.webkit.org/show_bug.cgi?id=162859
Reviewed by Chris Dumez.
RaisesException is now MayThrowLegacyException.
A follow-up patch soon will add MayThrowException for the new style,
where we use ExceptionOr<> as the return type instead of an ExceptionCode
out argument.
* bindings/scripts/CodeGeneratorJS.pm:
Removed the quotation marks from the syntax object->{PropertyName} so the
renaming script could handle it. Tweaked various comments and logic for clarity.
Changed to use the perl "x if y" syntax for brevity in many places.
Renamed with the script and by hand. Added code to skip including the same header
in both the implementation file and the header, just to make generated bindings
slightly smaller and faster to compile. Used "using" instead of "typedef".
* bindings/scripts/IDLAttributes.txt: Updated from old names to new ones.
* Modules/applepay/ApplePaySession.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/fetch/FetchHeaders.idl:
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/mediasource/MediaSource.idl:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCIceCandidate.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCSessionDescription.idl:
* Modules/navigatorcontentutils/NavigatorContentUtils.idl:
* Modules/notifications/NotificationCenter.idl:
* Modules/webaudio/AnalyserNode.idl:
* Modules/webaudio/AudioBuffer.idl:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/AudioNode.idl:
* Modules/webaudio/ConvolverNode.idl:
* Modules/webaudio/OfflineAudioContext.idl:
* Modules/webaudio/OscillatorNode.idl:
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/SQLResultSet.idl:
* Modules/websockets/WebSocket.idl:
* bindings/scripts/test/TestImplements.idl:
* bindings/scripts/test/TestInterface.idl:
* bindings/scripts/test/TestNamedConstructor.idl:
* bindings/scripts/test/TestNondeterministic.idl:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSupplemental.idl:
* bindings/scripts/test/TestTypedefs.idl:
* css/CSSCharsetRule.idl:
* css/CSSMediaRule.idl:
* css/CSSPrimitiveValue.idl:
* css/CSSRule.idl:
* css/CSSStyleDeclaration.idl:
* css/CSSStyleSheet.idl:
* css/CSSSupportsRule.idl:
* css/CSSValue.idl:
* css/FontFace.idl:
* css/FontFaceSet.idl:
* css/MediaList.idl:
* css/WebKitCSSMatrix.idl:
* dom/CharacterData.idl:
* dom/ChildNode.idl:
* dom/CustomElementRegistry.idl:
* dom/DataTransferItemList.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/EventTarget.idl:
* dom/MessagePort.idl:
* dom/MutationObserver.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/ParentNode.idl:
* dom/Range.idl:
* dom/ShadowRoot.idl:
* dom/Text.idl:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.idl:
* html/DOMTokenList.idl:
* html/DOMURL.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLElement.idl:
* html/HTMLEmbedElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLIFrameElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLMarqueeElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLProgressElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTextAreaElement.idl:
* html/HTMLVideoElement.idl:
* html/ImageData.idl:
* html/MediaController.idl:
* html/TimeRanges.idl:
* html/URLUtils.idl:
* html/canvas/CanvasGradient.idl:
* html/canvas/CanvasPath.idl:
* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/OESVertexArrayObject.idl:
* html/canvas/WebGLRenderingContextBase.idl:
* html/track/DataCue.idl:
* html/track/TextTrack.idl:
* html/track/TextTrackCue.idl:
* html/track/VTTCue.idl:
* html/track/VTTRegion.idl:
* loader/appcache/DOMApplicationCache.idl:
* page/Crypto.idl:
* page/DOMSelection.idl:
* page/DOMWindow.idl:
* page/EventSource.idl:
* page/History.idl:
* page/Location.idl:
* page/Performance.idl:
* page/UserMessageHandler.idl:
* page/WindowOrWorkerGlobalScope.idl:
* storage/Storage.idl:
* svg/SVGAltGlyphElement.idl:
* svg/SVGAngle.idl:
* svg/SVGAnimatedBoolean.idl:
* svg/SVGAnimatedEnumeration.idl:
* svg/SVGAnimatedInteger.idl:
* svg/SVGAnimatedNumber.idl:
* svg/SVGAnimatedString.idl:
* svg/SVGAnimationElement.idl:
* svg/SVGColor.idl:
* svg/SVGGlyphRefElement.idl:
* svg/SVGGraphicsElement.idl:
* svg/SVGLength.idl:
* svg/SVGLengthList.idl:
* svg/SVGMatrix.idl:
* svg/SVGNumberList.idl:
* svg/SVGPaint.idl:
* svg/SVGPathSegList.idl:
* svg/SVGPointList.idl:
* svg/SVGPreserveAspectRatio.idl:
* svg/SVGStringList.idl:
* svg/SVGStyleElement.idl:
* svg/SVGTextContentElement.idl:
* svg/SVGTransformList.idl:
* svg/SVGViewSpec.idl:
* testing/InternalSettings.idl:
* testing/Internals.idl:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.idl:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.idl:
* xml/XPathEvaluator.idl:
* xml/XPathExpression.idl:
* xml/XPathResult.idl:
Allowed the rename script to rename the exception-related extended attributes.
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.cpp:
* bindings/scripts/test/JS/JSreadonly.h:
Regenerated.
2016-10-02 Wenson Hsieh <wenson_hsieh@apple.com>
Media controls for Soundcloud easily falls out of sync with what's actually playing
https://bugs.webkit.org/show_bug.cgi?id=162843
<rdar://problem/28176874>
Reviewed by Beth Dakin.
Currently, audio elements are subject to the same main content restrictions as video elements. This is
problematic on sites where audio elements are really the main content, such as soundcloud. We need a different
heuristic for determining whether audio elements such as these should be allowed to show playback controls.
Furthermore, we currently forbid autoplaying audio from showing controls if it has user gesture restrictions
(i.e. it started playing via script). This is, again, problematic on sites where audio elements are played one
after another (such as on soundcloud). Even though a subsequent audio element may have been triggered via
script, we might want still want to show controls for it if the user has explicitly triggered other elements on
the page to begin playing. However, if the user has not gestured on any media in the page, we still should not
show controls for audio elements that begin playing via script.
Adds two new unit tests to TestWebKitAPI simulating audio playback behavior on soundcloud.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::canShowControlsManager):
(WebCore::MediaElementSession::allowsPlaybackControlsForAutoplayingAudio):
* html/MediaElementSession.h:
* page/Page.h:
(WebCore::Page::allowsPlaybackControlsForAutoplayingAudio):
(WebCore::Page::setAllowsPlaybackControlsForAutoplayingAudio):
2016-10-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r206683.
This change caused API test WebKit2.FindMatches to fail on
Mac.
Reverted changeset:
"The dragged image should be the current frame only of the
animated image"
https://bugs.webkit.org/show_bug.cgi?id=162109
http://trac.webkit.org/changeset/206683
2016-10-02 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r206692 and r206718.
Seems to have caused >200 failures on Sierra
Reverted changesets:
"Implement rendering of font-variation-settings"
https://bugs.webkit.org/show_bug.cgi?id=162782
http://trac.webkit.org/changeset/206692
"Tried to fix the build after r206692."
http://trac.webkit.org/changeset/206718
2016-10-02 Dan Bernstein <mitz@apple.com>
Tried to fix the build after r206692.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
2016-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206716.
https://bugs.webkit.org/show_bug.cgi?id=162858
It is breaking Mac CMake Debug build (Requested by youenn on
#webkit).
Reverted changeset:
"[Fetch API] Forbid redirection to non-HTTP(s) URL in non-
navigation mode."
https://bugs.webkit.org/show_bug.cgi?id=162785
http://trac.webkit.org/changeset/206716
2016-10-02 Youenn Fablet <youenn@apple.com>
[Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
https://bugs.webkit.org/show_bug.cgi?id=162785
Reviewed by Alex Christensen.
Covered by rebased and existing tests.
Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
But they are not allowed for same-origin redirected requests.
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
(WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::checkInsecureContent):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::isSameOriginDataURL):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
2016-10-01 Simon Fraser <simon.fraser@apple.com>
Support transitions/animations of background-position with right/bottom-relative values
https://bugs.webkit.org/show_bug.cgi?id=162048
Reviewed by Dean Jackson.
Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px"
work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending.
Also improve logging of calculated lengths, and better animation logging for FillLayer properties.
Test: transitions/background-position-transitions.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID
around so logging can use it.
(WebCore::FillLayerAnimationPropertyWrapperBase::property):
(WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter):
(WebCore::FillLayerPropertyWrapperGetter::value):
(WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
(WebCore::createCalculatedLength):
(WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper):
(WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
(WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
(WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
(WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging
can show the result.
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionNumber::dump):
(WebCore::CalcExpressionBinaryOperation::dump):
(WebCore::CalcExpressionLength::dump):
(WebCore::CalcExpressionBlendLength::dump):
(WebCore::operator<<):
* platform/CalculationValue.h:
* platform/Length.cpp:
(WebCore::operator<<):
2016-10-01 Simon Fraser <simon.fraser@apple.com>
Bad cast when CSS position programmatically changed from -webkit-sticky to fixed
https://bugs.webkit.org/show_bug.cgi?id=160826
Reviewed by Zalan Bujtas.
If a scrolling state tree node changed type (e.g. from sticky to fixed), we'd fail
to recreate the node so keep a node with the wrong type.
Fix by destroying the node and making a new one with a new ID in this case. The
new ID is necessary to ensure that the scrolling tree is updated.
Test: fast/scrolling/sticky-to-fixed.html
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch):
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::stateNodeForID):
* page/scrolling/ScrollingStateTree.h:
2016-10-01 Youenn Fablet <youenn@apple.com>
removing FetchBoyd::m_type
Remove FetchBody::m_type
https://bugs.webkit.org/show_bug.cgi?id=162841
Reviewed by Sam Weinig.
No change of behavior.
Removing FetchBody::m_type and using m_data in lieu.
Introducing temporarily FetchBody::m_isEmpty to handle the case of null bodies.
Null body handling should be moved to FetchBodyOwner in a follow-up patch.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::extract):
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consumeOnceLoadingFinished):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::loadingSucceeded):
(WebCore::FetchBody::bodyForInternalRequest):
(WebCore::FetchBody::clone):
(WebCore::FetchBody::consumeText): Deleted.
(WebCore::FetchBody::consumeBlob): Deleted.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isEmpty):
(WebCore::FetchBody::isBlob):
(WebCore::FetchBody::isFormData):
(WebCore::FetchBody::isArrayBuffer):
(WebCore::FetchBody::isArrayBufferView):
(WebCore::FetchBody::isURLSearchParams):
(WebCore::FetchBody::isText):
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::setContentType): Deleted.
(WebCore::FetchBody::urlSearchParamsBody): Deleted.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::blobLoadingSucceeded):
(WebCore::FetchBodyOwner::finishBlobLoading): Deleted.
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::body): Deleted.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::consume):
(WebCore::FetchResponse::consumeBodyAsStream):
(WebCore::FetchResponse::createReadableStreamSource):
(WebCore::FetchResponse::finishConsumingStream): Deleted.
* Modules/fetch/FetchResponse.h:
2016-09-30 David Kilzer <ddkilzer@apple.com>
REGRESSION (r203424): WebCore::ImageBuffer::createCompatibleBuffer() in ImageBufferCG.cpp over-releases CGColorSpaceRef objects
<https://webkit.org/b/162823>
<rdar://problem/27723268>
Reviewed by Joseph Pecoraro.
Code is covered by existing tests, but no crashes have been
observed in practice. May require running one test multiple
times to reproduce.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer): Don't use
adoptCF() when the function doesn't return a +1 retained
CGColorSpaceRef.
2016-09-30 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix build break since r206661. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162825
No new tests, no new behaviours.
* rendering/RenderLayer.cpp:
(WebCore::ClipRects::ClipRects):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Declare that our variation fonts work is in progress
https://bugs.webkit.org/show_bug.cgi?id=162816
Reviewed by Simon Fraser.
* features.json:
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Turn variation fonts on by default
https://bugs.webkit.org/show_bug.cgi?id=162818
Reviewed by Simon Fraser.
No new tests because there is no behavior change.
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::variationFontsEnabled):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Implement rendering of font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162782
Reviewed by Zalan Bujtas.
Because the heavy lifting for font-variation-settings is done by CoreText,
this patch is fairly minimal. It simply hooks up the CSS property to CoreText.
There is an existing bug in CoreText where variations inside fonts do not
survive the addition of a cascade list. Therefore, FontPlatformData::ctFont()
needs to work around this (conditionally) by resupplying the variation at
the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>.
Tests: fast/text/variations/duplicate.html
fast/text/variations/exist.html
fast/text/variations/inheritance.html
fast/text/variations/order.html
fast/text/variations/outofbounds.html
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAttributesDictionary):
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
(WebCore::FontPlatformData::ctFont):
(WebCore::cascadeToLastResortFontDescriptor): Deleted.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2016-09-29 Sam Weinig <sam@webkit.org>
Add initial support for IDL union conversion
https://bugs.webkit.org/show_bug.cgi?id=161576
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj:
Add IDLTypes.h
* bindings/generic/IDLTypes.h: Added.
Add a basic type hierarchy for types defined by WebIDL and their corresponding
WebCore implementation types.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
Add Converters for IDLDOMString and IDLUSVString.
(WebCore::ConditionalConverter<typename ReturnType, typename T, bool enabled>)
Add a struct to allow conditional conversion of types based on a compile boolean
value. This allows the union code to work, by ensuring that code for types that don't
exist doesn't get compiled.
(WebCore::Converter<IDLUnion>::convert):
Add template meta programming based version of the WebIDL conversion algorithm. It uses
introspection of the typelist to conditionally execute the parts of the algorithm that
apply and relies on the compiler eliminate the dead code it produces. This initial cut
doesn't implement the full algorithm, just a subset needed to see if this method will work
out.
* bindings/js/JSDOMWrapper.h:
(WebCore::isJSDOMWrapperType):
Add JSDOMWrapperType to the list of well known types to allow quick checking of wrappers
by the union code.
* bindings/js/JSNodeOrString.cpp:
(WebCore::toNodeOrStringVector):
Switch to new IDLUnion based converter.
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Implement animation of font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162783
Reviewed by Simon Fraser.
Modify CSSPropertyAnimation to understand FontVariationSettings objects and how
to interpolate them.
If two FontVariationSettings objects are unlike (meaning they specify different
variation axes), for now the interpolation simply returns an empty object. This
might change in the future, but for now, this is a reasonable place to start.
Because CSSPropertyAnimation interacts with RenderStyles instead of
FontDescriptions, this patch adds a transparent accessor from the RenderStyle
to the inner FontDescription.
Tests: animations/font-variation-settings-order.html
animations/font-variation-settings-unlike.html
animations/font-variation-settings.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::PropertyWrapperFontVariationSettings::PropertyWrapperFontVariationSettings):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariationSettings):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariationSettings):
2016-09-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] layout nodes
https://bugs.webkit.org/show_bug.cgi?id=162799
<rdar://problem/28569301>
Reviewed by Dean Jackson.
Modern media controls will be using a tree of LayoutNode objects that commit to the DOM
in coordinated `requestAnimationFrame()` calls to ensure all layouts are done in an efficient
and coordinated manner. As a preamble, we introduced the `scheduler` singleton in
https://webkit.org/b/162726 which is in charge of scheduling callbacks.
A LayoutNode is created by providing an Element to its constructor, or an HTML string. Not
providing a parameter creates a simple <div>.
When we set a property on a LayoutNode, we call `markDirtyProperty(propertyName)` which keeps
track of dirty properties in the `_dirtyProperties` set. When this set is non-empty, the node
is marked as dirty and registered in the global `dirtyNodes` map, asking the shared scheduler
that a layout is needed. When the layout is performed, all nodes in the `dirtyNodes` map are
processed such that `commitProperty(propertyName)` is called to commit dirty properties for
a given node to the DOM, and `layout()` is called to allow subclasses of LayoutNode to conduct
custom layout logic that goes beyond committing a given property.
Another reason why a node may be marked as dirty is when a DOM hierarchy change is needed. A
host of DOM-like methods are exposed to allow flexible manipulations of nodes, with an extra
`children` property which allows wholesale change of a node's subtree with a single array
property assignment. Changes to the DOM hierarchy are performed in the same scheduler callback
as style properties.
Nodes can be marked for layout explicitly with by setting the `needsLayout` property.
Tests: media/modern-media-controls/layout-node/addChild.html
media/modern-media-controls/layout-node/children.html
media/modern-media-controls/layout-node/constructor.html
media/modern-media-controls/layout-node/height.html
media/modern-media-controls/layout-node/insertAfter.html
media/modern-media-controls/layout-node/insertBefore.html
media/modern-media-controls/layout-node/parent.html
media/modern-media-controls/layout-node/remove.html
media/modern-media-controls/layout-node/removeChild.html
media/modern-media-controls/layout-node/subclassing.html
media/modern-media-controls/layout-node/visible.html
media/modern-media-controls/layout-node/width.html
media/modern-media-controls/layout-node/x.html
media/modern-media-controls/layout-node/y.html
* Modules/modern-media-controls/controls/layout-node.js: Added.
(LayoutNode):
(LayoutNode.prototype.get x):
(LayoutNode.prototype.set x):
(LayoutNode.prototype.get y):
(LayoutNode.prototype.set y):
(LayoutNode.prototype.get width):
(LayoutNode.prototype.set width):
(LayoutNode.prototype.get height):
(LayoutNode.prototype.set height):
(LayoutNode.prototype.get visible):
(LayoutNode.prototype.set visible):
(LayoutNode.prototype.get needsLayout):
(LayoutNode.prototype.set needsLayout):
(LayoutNode.prototype.get parent):
(LayoutNode.prototype.get children):
(LayoutNode.prototype.set children):
(LayoutNode.prototype.addChild):
(LayoutNode.prototype.insertBefore):
(LayoutNode.prototype.insertAfter):
(LayoutNode.prototype.removeChild):
(LayoutNode.prototype.remove):
(LayoutNode.prototype.markDirtyProperty):
(LayoutNode.prototype.commitProperty):
(LayoutNode.prototype.layout):
(LayoutNode.prototype._markNodeManipulation):
(LayoutNode.prototype._updateDirtyState):
(LayoutNode.prototype._updateChildren):
(performScheduledLayout):
(elementFromString):
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Reviewed by Tim Horton.
Instead of creating an NSImage with all the frames for the dragImage,
create an NSImage with the current frame only.
* dom/DataTransferMac.mm:
(WebCore::DataTransfer::createDragImage): Call currentFrameNSImage() to create the dragImage.
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement): Call the Image function with its new name.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::nsImage): Rename getNSImage() to nsImage().
(WebCore::Image::currentFrameNSImage): Returns the NSImage of the current frame.
(WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::Image::getNSImage): Deleted.
(WebCore::Image::getTIFFRepresentation): Deleted.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
(WebCore::BitmapImage::currentFrameNSImage): Returns the NSImage of the current frame.
(WebCore::BitmapImage::getTIFFRepresentation): Deleted.
(WebCore::BitmapImage::getNSImage): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor): Call currentFrameNSImage() since the cursor does not animate anyway.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Use currentFrameNSImage() for the dragImage.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Call the Image function with its new name.
2016-09-30 Chris Dumez <cdumez@apple.com>
[iOS] Allow sequence<Touch> input in TouchEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=162806
<rdar://problem/28566429>
Reviewed by Ryosuke Niwa.
Allow sequence<Touch> input in TouchEvent constructor in addition to
TouchList objects. It is convenient for developers to pass arrays of
Touch objects.
No new tests, already covered by:
imported/w3c/web-platform-tests/touch-events/touch-touchevent-constructor.html
* bindings/js/JSDOMBinding.h:
(WebCore::toRefNativeArray):
(WebCore::toRefPtrNativeArray):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Parse font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=162781
Reviewed by Simon Fraser.
CSS Fonts level 4 [1] details the font-variation-settings property which allows variations
to be applied to fonts which accept it. The property accepts a list of key/value
pairs where the keys are four-character Ascii codes and the values are floating
point values. The implementation uses font-feature-settings as a model, but with one
big difference: font-variation-settings can be animated. The set of variation points
are animated individually.
This font variations work is being done behind a run-time switch, which is settable from
the Safari Develop menu.
Now that FontDescription is growing, I'd like to do an investigation into the possibility of
moving some of the rare pieces of it into their own class to reduce memory. However, upon
advice, this investigation will be fairly involved and should be done in its own bug.
Test: fast/text/variations/getComputedStyle.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontVariationValue.cpp: Copied from Source/WebCore/platform/graphics/FontTaggedSettings.cpp.
(WebCore::CSSFontVariationValue::CSSFontVariationValue):
(WebCore::CSSFontVariationValue::customCSSText):
(WebCore::CSSFontVariationValue::equals):
* css/CSSFontVariationValue.h: Copied from Source/WebCore/platform/graphics/FontTaggedSettings.cpp.
* css/CSSPropertyNames.in:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFontVariationValue):
(WebCore::CSSValue::isFontFeatureValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontVariationSettings):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialFontVariationSettings):
(WebCore::StyleBuilderCustom::applyInheritFontVariationSettings):
(WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFontFeatureSettings):
(WebCore::CSSParser::parseFontVariationTag):
(WebCore::CSSParser::parseFontVariationSettings):
* css/parser/CSSParser.h:
* css/parser/CSSParserMode.h:
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::variationSettings):
(WebCore::FontDescription::setVariationSettings):
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::featureSettings): Deleted.
(WebCore::FontDescription::setFeatureSettings): Deleted.
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::FontVariationSettings::hash):
(WebCore::operator<<):
* platform/graphics/FontTaggedSettings.h:
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Followup patch to r206664
https://bugs.webkit.org/show_bug.cgi?id=162774
Unreviewed.
No new tests because there is no behavior change.
* platform/graphics/FontTaggedSettings.h:
(WebCore::FourCharacterTagHashTraits::isDeletedValue): Deleted.
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Fix fast/text/trak-optimizeLegibility.html
https://bugs.webkit.org/show_bug.cgi?id=162779
Reviewed by Simon Fraser.
I accidentally created this test to allow an unnecessary delta
in the width comparison. This covered the fact that the fonts
were not being selected correctly in our testing code. Update the
font selection code to work with system fonts correctly and
update the test to not use a delta when performing width
comparisons.
Test: fast/text/trak-optimizeLegibility.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isSystemFont):
(WebCore::platformFontLookupWithFamily):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Create runtime flag for variation font work
https://bugs.webkit.org/show_bug.cgi?id=162780
Reviewed by Alex Christensen.
No new tests because there is no behavior change.
Variation font work should be behind a runtime flag.
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::variationFontsEnabled):
(WebCore::InternalSettings::setVariationFontsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Templatize internal FontFeatureSettings class for variation font support
https://bugs.webkit.org/show_bug.cgi?id=162774
Reviewed by Alex Christensen.
Font features and font variations are similar in that they are identified
by four-character tags and an associated value. However, the value is an
int for font features and is a float for font variations. In order to
simplify code, we can use the same class for both, and use a template
argument to distinguish between the two. Then, typedefs can be used to
name them.
No new tests because there is no behavior change.
* WebCore.xcodeproj/project.pbxproj: Rename FontFeatureSettings.{cpp,h}
to FontTaggedSettings.{cpp,h}
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.h:
* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::CSSFontFeatureValue):
* css/CSSFontFeatureValue.h:
* css/FontFace.cpp:
(WebCore::FontFace::featureSettings):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFeatureTag):
* loader/cache/CachedFont.h:
* platform/graphics/FontDescription.h:
* platform/graphics/FontFeatureSettings.cpp:
(WebCore::FontFeature::FontFeature): Deleted.
(WebCore::FontFeature::operator==): Deleted.
(WebCore::FontFeature::operator<): Deleted.
(WebCore::FontFeatureSettings::insert): Deleted.
(WebCore::FontFeatureSettings::hash): Deleted.
* platform/graphics/FontFeatureSettings.h: Removed.
(WebCore::fontFeatureTag): Deleted.
(WebCore::FontFeatureTagHash::hash): Deleted.
(WebCore::FontFeatureTagHash::equal): Deleted.
(WebCore::FontFeatureTagHashTraits::constructDeletedValue): Deleted.
(WebCore::FontFeatureTagHashTraits::isDeletedValue): Deleted.
(WebCore::FontFeature::operator!=): Deleted.
(WebCore::FontFeature::tag): Deleted.
(WebCore::FontFeature::value): Deleted.
(WebCore::FontFeature::enabled): Deleted.
(WebCore::FontFeatureSettings::operator==): Deleted.
(WebCore::FontFeatureSettings::operator!=): Deleted.
(WebCore::FontFeatureSettings::size): Deleted.
(WebCore::FontFeatureSettings::operator[]): Deleted.
(WebCore::FontFeatureSettings::at): Deleted.
(WebCore::FontFeatureSettings::begin): Deleted.
(WebCore::FontFeatureSettings::end): Deleted.
* platform/graphics/FontTaggedSettings.cpp: Renamed from Source/WebCore/platform/graphics/FontFeatureSettings.cpp.
(WebCore::FontFeatureSettings::hash):
* platform/graphics/FontTaggedSettings.h: Added.
(WebCore::fontFeatureTag):
(WebCore::FourCharacterTagHash::hash):
(WebCore::FourCharacterTagHash::equal):
(WebCore::FourCharacterTagHashTraits::constructDeletedValue):
(WebCore::FourCharacterTagHashTraits::isDeletedValue):
(WebCore::FontTaggedSetting::operator!=):
(WebCore::FontTaggedSetting::tag):
(WebCore::FontTaggedSetting::value):
(WebCore::FontTaggedSetting::enabled):
(WebCore::FontTaggedSetting<T>::FontTaggedSetting):
(WebCore::=):
(WebCore::FontTaggedSetting<T>::operator<):
(WebCore::FontTaggedSettings::operator==):
(WebCore::FontTaggedSettings::operator!=):
(WebCore::FontTaggedSettings::isEmpty):
(WebCore::FontTaggedSettings::size):
(WebCore::FontTaggedSettings::operator[]):
(WebCore::FontTaggedSettings::at):
(WebCore::FontTaggedSettings::begin):
(WebCore::FontTaggedSettings::end):
(WebCore::FontTaggedSettings<T>::insert):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::tagEquals):
(WebCore::appendOpenTypeFeature):
* platform/graphics/mac/FontCustomPlatformData.h:
2016-09-30 Chris Dumez <cdumez@apple.com>
Fragment serialization should always use 'xml:' prefix for attributes in XML namespace
https://bugs.webkit.org/show_bug.cgi?id=162803
Reviewed by Sam Weinig.
Fragment serialization should always use 'xml:' prefix for attributes in XML namespace:
- https://html.spec.whatwg.org/#serialising-html-fragments
"""
If the attribute is in the XML namespace
-> The attribute's serialized name is the string "xml:" followed by the attribute's local name.
"""
- https://www.w3.org/TR/DOM-Parsing/#dfn-concept-xml-serialization-algorithm
"""
If ns is the XML namespace, then let qualified name be the concatenation of the string "xml:"
and the value of node's localName.
"""
Firefox complies with the specification.
No new tests, rebaselined existing test.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendAttribute):
2016-09-30 Zalan Bujtas <zalan@apple.com>
Unreviewed, rolling out r206611.
Scroll perf did not recover.
Reverted changeset:
"Unreviewed, rolling out r206483."
https://bugs.webkit.org/show_bug.cgi?id=162750
http://trac.webkit.org/changeset/206611
2016-09-30 Zalan Bujtas <zalan@apple.com>
Remove ClipRects's custom refcounting.
https://bugs.webkit.org/show_bug.cgi?id=162798
Reviewed by Simon Fraser.
It's safer to use RefCounted<>.
No change in functionality.
* rendering/RenderLayer.cpp:
(WebCore::ClipRects::ClipRects):
(WebCore::ClipRectsCache::getClipRects):
(WebCore::ClipRectsCache::setClipRects):
(WebCore::ClipRectsCache::getIndex):
(WebCore::RenderLayer::updateClipRects):
(WebCore::ClipRects::ref): Deleted.
(WebCore::ClipRects::deref): Deleted.
2016-09-30 Chris Dumez <cdumez@apple.com>
FileSaver.js does not work in WebKit
https://bugs.webkit.org/show_bug.cgi?id=162788
Reviewed by Sam Weinig.
FileSaver.js does not work in WebKit:
- https://eligrey.com/demos/FileSaver.js/
It works in Firefox and Chrome, but in WebKit, we were getting a
"Synthetic clicks on anchors that have a download attribute are
ignored." warning. We were too strict in restricting synthetic clicks.
We now allow synthetic clicks as long as they are triggered by a user
gesture.
Test: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-09-30 Joseph Pecoraro <pecoraro@apple.com>
Breakpoints on blank lines or comments don't break
https://bugs.webkit.org/show_bug.cgi?id=9885
<rdar://problem/6134406>
Reviewed by Mark Lam.
Tests: inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
inspector/debugger/breakpoints/resolved-dump-each-line.html
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
2016-09-30 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Stepping out of a function finishes the line that called it.
https://bugs.webkit.org/show_bug.cgi?id=155325
<rdar://problem/25094578>
Reviewed by Mark Lam.
Tests: inspector/debugger/stepping/stepInto.html
inspector/debugger/stepping/stepOut.html
inspector/debugger/stepping/stepOver.html
inspector/debugger/stepping/stepping-arrow-functions.html
inspector/debugger/stepping/stepping-classes.html
inspector/debugger/stepping/stepping-control-flow.html
inspector/debugger/stepping/stepping-function-calls.html
inspector/debugger/stepping/stepping-function-default-parameters.html
inspector/debugger/stepping/stepping-literal-construction.html
inspector/debugger/stepping/stepping-loops.html
inspector/debugger/stepping/stepping-misc.html
inspector/debugger/stepping/stepping-switch.html
inspector/debugger/stepping/stepping-template-string.html
inspector/debugger/stepping/stepping-try-catch-finally.html
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::stepInto): Deleted.
Setting this state in step-into does not make sense since we do not
know when the debugger resumes and won't know when to clear it.
2016-09-30 Alex Christensen <achristensen@webkit.org>
Fix off-by-one error in URLParser::parseIPv4Host
https://bugs.webkit.org/show_bug.cgi?id=162789
Reviewed by Tim Horton.
The spec says "If any but the last item in numbers is greater than 255, return failure."
This means check up to size - 1, not size - 2.
Covered by a new API test.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Host):
2016-09-30 Alex Christensen <achristensen@webkit.org>
URLParser: parsing a URL with an empty host and a colon should fail
https://bugs.webkit.org/show_bug.cgi?id=162795
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
2016-09-30 Alex Christensen <achristensen@webkit.org>
URLParser: handle syntax violations in non-UTF-8 encoded queries
https://bugs.webkit.org/show_bug.cgi?id=162770
Reviewed by Tim Horton.
There is a fast path for queries of URLs that use UTF-8 encoding, which are quite common.
For non-UTF-8 encoded queries, which are less common, we put the code points in a Vector<UChar>
and encode them all at once. If there is a syntax violation in the query, we need to copy the
syntax-violation-free string up to the beginning of the query, then encode the query.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::percentEncodeByte):
(WebCore::URLParser::encodeQuery):
(WebCore::URLParser::parse):
* platform/URLParser.h:
2016-09-27 Anders Carlsson <andersca@apple.com>
Remove a couple of unused members from PlatformKeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=162641
Reviewed by Tim Horton.
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::nativeVirtualKeyCode): Deleted.
(WebCore::PlatformKeyboardEvent::macCharCode): Deleted.
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2016-09-30 Antti Koivisto <antti@apple.com>
Remove "rem" unit optimization for document element font size changes
https://bugs.webkit.org/show_bug.cgi?id=162778
Reviewed by Alex Christensen.
We awkwardly track from the parser level if any stylesheet in a document uses any rem units. This is only used to minimally
optimize a case where document element's (<html>) font size changes dynamically.
In practice such changes are rare. Browsing around I couldn't find a single case where this optimization got used.
Even if it was used it would be of low value as a full style resolution is likely to happen anyway (as font inherits)
and the only thing really saved is that we don't need to invalidate the matched properties cache.
* css/CSSGrammar.y.in:
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
* css/StyleSheetContents.h:
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
* dom/AuthorStyleSheets.h:
(WebCore::AuthorStyleSheets::usesRemUnits): Deleted.
(WebCore::AuthorStyleSheets::setUsesRemUnit): Deleted.
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::updateBaseURL):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
2016-09-30 Zalan Bujtas <zalan@apple.com>
RenderLayer::clipRects may return nullptr.
https://bugs.webkit.org/show_bug.cgi?id=162729
Reviewed by Chris Dumez.
This patch refactors RenderLayer::updateClipRects(), parentClipRects() and backgroundClipRect()
so that we don't have to rely on this seemingly unsafe line: clipRects = *parent()->clipRects(clipRectsContext);
Now updateClipRects() returns the computed/cached clip rects as opposed to update and refetch them.
While this patch makes the code look more readable/safer, it also eliminates cached item tripple retrievals.
No change in functionality.
* rendering/RenderLayer.cpp:
(WebCore::ClipRectsCache::getClipRects):
(WebCore::ClipRectsCache::setClipRects):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::clipRects):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
2016-09-30 Youenn Fablet <youenn@apple.com>
Add a way to go from a RefPtr<T> to Ref<const T>
https://bugs.webkit.org/show_bug.cgi?id=162683
Reviewed by Alex Christensen.
No change of behavior.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Unreviewed, fix 32-bit build.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::decodedSizeChanged):
2016-09-30 Youenn Fablet <youenn@apple.com>
FetchBody should use UTF8Encoding to encode text data
https://bugs.webkit.org/show_bug.cgi?id=162775
Reviewed by Sam Weinig.
Covered by added tests.
Removing unnecesary vector allocation when extracting UTF8 bytes from a Request/Response text/URLSearchParams body.
Making use of UTF8Encoding for consistency with the upload code path.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::consumeText):
(WebCore::extractBytesFromText): Deleted.
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Change the MemoryCache and CachedResource adjustSize functions to take a long argument
https://bugs.webkit.org/show_bug.cgi?id=162708
<rdar://problem/28555702>
Reviewed by Brent Fulgham.
Because the MemoryCache stores the size of the cached memory in unsigned,
two problems my happen when reporting a change in the size of the memory:
1. Signed integer overflow -- which can happen because MemoryCache::adjustSize()
takes a signed integer argument. If the allocated or the freed memory size is
larger than the maximum of a signed integer, an overflow will happen.
For the image caching code, this can be seen where the unsigned decodedSize
is casted to an integer before passing it to ImageObserver::decodedSizeChanged().
2. Unsigned integer overflow -- which can happen if the new allocated memory
size plus the currentSize exceeds the maximum of unsigned.
This can be seen in MemoryCache::adjustSize() where we add delta to m_liveSize
or m_deadSize without checking whether this addition will overflow or not. We
do not assert for overflow although we assert for underflow.
The fix for these two problems can be the following:
1. Make all the adjustSize functions all the way till MemoryCache::adjustSize()
take a signed long integer argument.
2. Do not create a NativeImagePtr for an ImageFrame if its frameBytes plus the
ImageFrameCache::decodedSize() will exceed the maximum of an unsigned integer.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::decodedSizeChanged): Change the argument to be long. No overflow will happen when casting the argument from unsigned to long.
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setDecodedSize): Use long integer casting when calling MemoryCache::adjustSize().
(WebCore::CachedResource::setEncodedSize): Ditto.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::MemoryCache): Add as static assert to ensure sizeof(long long) can hold any unsigned or its negation.
(WebCore::MemoryCache::revalidationSucceeded): Use long integer casting when calling MemoryCache::adjustSize().
(WebCore::MemoryCache::remove): Ditto.
(WebCore::MemoryCache::adjustSize): Change the function argument to long integer. No overflow will happen when casting the argument from unsigned to long.
* loader/cache/MemoryCache.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::destroyIncompleteDecodedData): Call a function with its new name.
(WebCore::ImageFrameCache::decodedSizeChanged): Change the function argument to long integer. No overflow will happen when casting the argument from unsigned to long.
(WebCore::ImageFrameCache::decodedSizeIncreased): Use long integer casting when calling decodedSizeChanged().
(WebCore::ImageFrameCache::decodedSizeDecreased): Ditto.
(WebCore::ImageFrameCache::decodedSizeReset): Ditto.
(WebCore::ImageFrameCache::didDecodeProperties): Ditto.
(WebCore::ImageFrameCache::frameAtIndex): Do not create the NativeImage if adding its frameByes to the MemoryCache will cause numerical overflow.
(WebCore::ImageFrameCache::decodedSizeIncremented): Deleted. This function is renamed decodedSizeIncreased().
(WebCore::ImageFrameCache::decodedSizeDecremented): Deleted. This function is renamed decodedSizeDecreased().
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageObserver.h:
* platform/graphics/IntSize.h:
(WebCore::IntSize::unclampedArea): Returns the area of an IntSize in size_t.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::decodedSizeChanged): Use long integer casting when calling ImageObserver::decodedSizeChanged().
2016-09-30 Chris Dumez <cdumez@apple.com>
Add support for ImageData.data attribute
https://bugs.webkit.org/show_bug.cgi?id=162767
Reviewed by Sam Weinig.
Add support for ImageData.data attribute:
- https://html.spec.whatwg.org/#imagedata
Firefox already supports it.
No new tests, updated existing tests.
* html/ImageData.idl:
2016-09-30 Youenn Fablet <youenn@apple.com>
DumpRenderTree crashed in com.apple.WebCore: WTF::Optional<WebCore::FetchBodyOwner::BlobLoader>::operator bool const + 12
https://bugs.webkit.org/show_bug.cgi?id=162483
Reviewed by Alex Christensen.
Test: fetch/closing-while-fetching-blob.html
No change of behavior.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::stop): Asserting m_blobLoader is null (meaning that unsetPendingActivity was done)
only in case FetchBodyOwner has no risk being destroyed.
2016-09-30 Youenn Fablet <youennf@gmail.com>
[Fetch API] Add support for URLSearchParams body
https://bugs.webkit.org/show_bug.cgi?id=162667
Reviewed by Alex Christensen.
Tests: imported/w3c/web-platform-tests/fetch/api/basic/request-upload-worker.html
imported/w3c/web-platform-tests/fetch/api/basic/request-upload.html
* Modules/fetch/FetchBody.cpp:
(WebCore::extractBytesFromText): Moving to a static function that should be moved to a String method.
(WebCore::FetchBody::FetchBody): Adding constructor for URLSearchParams.
(WebCore::FetchBody::extract): Adding URLSearchParams body initialization.
(WebCore::FetchBody::consume): Consuming URLSearchParams bodies.
(WebCore::FetchBody::consumeAsStream): Ditto.
(WebCore::FetchBody::consumeText): Updated to take a parameter to handle both text and URLSearchParams bodies.
(WebCore::FetchBody::bodyForInternalRequest): Add URLSearchParams body upload.
(WebCore::FetchBody::clone): Add URLSearchParams body cloning
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::urlSearchParamsBody):
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::toString):
* html/URLSearchParams.h:
2016-09-29 Simon Fraser <simon.fraser@apple.com>
Re-order the arguments to drawPattern() functions
https://bugs.webkit.org/show_bug.cgi?id=162772
Reviewed by Zalan Bujtas.
Re-order the arguments to have the destination rect come near the front,
leaving CompositeOperator and BlendMode hanging out at the back like
other drawing functions.
No behavior change.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cg/ImageCG.cpp: This file can probably be removed and the code moved, since the
code is almost the same as the cairo code, and not platform-specific.
(WebCore::Image::drawPattern):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawPattern::DrawPattern):
(WebCore::DisplayList::DrawPattern::apply):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawPattern::create):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawPattern):
* platform/graphics/displaylists/DisplayListRecorder.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::drawPattern):
* svg/graphics/SVGImageForContainer.h:
2016-09-29 Chris Dumez <cdumez@apple.com>
Add support for download attribute on area elements
https://bugs.webkit.org/show_bug.cgi?id=162765
Reviewed by Brent Fulgham.
Add support for download attribute on area elements:
- https://html.spec.whatwg.org/#htmlanchorelement
Because HTMLAreaElement inherits from HTMLAnchorElement on native side,
and because HTMLAnchorElement already supports the download attribute,
all that was needed was to add the download attribute to
HTMLAreaElement.idl file.
Test: http/tests/download/area-download.html
* html/HTMLAreaElement.idl:
2016-09-29 Ryosuke Niwa <rniwa@webkit.org>
Editor::findStringAndScrollToVisible is unused
https://bugs.webkit.org/show_bug.cgi?id=162762
Reviewed by Simon Fraser.
Deleted the unused function.
* editing/Editor.cpp:
(WebCore::Editor::findStringAndScrollToVisible): Deleted.
* editing/Editor.h:
2016-09-29 Jiewen Tan <jiewen_tan@apple.com>
Expose CryptoKey to web workers
https://bugs.webkit.org/show_bug.cgi?id=162640
<rdar://problem/28182204>
Reviewed by Brent Fulgham.
Tests: crypto/workers/aes-postMessage-worker.html
crypto/workers/hmac-postMessage-worker.html
crypto/workers/hrsa-postMessage-worker.html
crypto/workers/multiple-postMessage-worker.html
crypto/workers/rsa-postMessage-worker.html
* crypto/CryptoKey.idl:
* crypto/SerializedCryptoKeyWrap.h:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::deleteDefaultWebCryptoMasterKey):
Add a way to delete the default web crypto master key such that we can test
these APIs and cleanup.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::wrapCryptoKey):
(WebCore::WorkerGlobalScope::unwrapCryptoKey):
* workers/WorkerGlobalScope.h:
2016-09-29 Nan Wang <n_wang@apple.com>
AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
https://bugs.webkit.org/show_bug.cgi?id=162471
Reviewed by Simon Fraser.
If the author has defined a maximum scale, we should honor that when keyboard focus moves
to a text field, instead of using the forceAlwaysUserScalableMaximumScale.
Tests: fast/forms/ios/user-scalable-does-not-scale-for-keyboard-focus-with-author-defined-scale.html
fast/forms/ios/user-scalable-does-not-scale-for-keyboard-focus-with-user-scalable-no.html
fast/forms/ios/user-scalable-scales-for-keyboard-focus-with-no-author-defined-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::allowsUserScaling):
(WebCore::ViewportConfiguration::allowsUserScalingIgnoringAlwaysScalable):
(WebCore::ViewportConfiguration::allowsUserScalingIgnoringForceAlwaysScaling): Deleted.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::maximumScaleIgnoringAlwaysScalable):
(WebCore::ViewportConfiguration::maximumScale): Deleted.
2016-09-29 Alex Christensen <achristensen@webkit.org>
Fix syntax violation handling in IPv4 address parsing
https://bugs.webkit.org/show_bug.cgi?id=162756
Reviewed by Tim Horton.
When we are parsing the up to 4 numbers in an IPv4 address, if we find a syntax violation
(the canonicalized address would be different than the input string) then wait to report
it until we have determined that this is a valid IPv4 address that will be canonicalized.
If it is not a valid IPv4 address, then we will just treat the characters as the host, and
that could be no syntax violation.
Covered by a new API test and existing API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:
2016-09-29 Chris Dumez <cdumez@apple.com>
Fix post-landing nits after r206561.
https://bugs.webkit.org/show_bug.cgi?id=162659
Reviewed by Alex Christensen.
Uses more StringViews and constness.
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
* html/LinkRelAttribute.h:
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should correctly parse ports with leading 0's
https://bugs.webkit.org/show_bug.cgi?id=162752
* platform/URLParser.cpp:
(WebCore::URLParser::parsePort):
Followup. Remove branches based on Geoffrey's feedback.
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should correctly parse ports with leading 0's
https://bugs.webkit.org/show_bug.cgi?id=162752
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parsePort):
2016-09-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206483.
https://bugs.webkit.org/show_bug.cgi?id=162750
May have caused iOS perf regression (Requested by smfr on
#webkit).
Reverted changeset:
"REGRESSION (r204552): Yelp carousel animation is not smooth."
https://bugs.webkit.org/show_bug.cgi?id=162632
http://trac.webkit.org/changeset/206483
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser: make parsing invalid IPv4 addresses more robust and correct
https://bugs.webkit.org/show_bug.cgi?id=162746
Reviewed by Tim Horton.
If parsing an IPv4 address fails, the characters are just treated as a regular domain.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser: IPv6 addresses followed by a colon are invalid
https://bugs.webkit.org/show_bug.cgi?id=162747
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
2016-09-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] scheduler for layout nodes
https://bugs.webkit.org/show_bug.cgi?id=162726
<rdar://problem/28543043>
Reviewed by Dean Jackson.
For the work on the modern media controls we will be using a tree of LayoutNode objects that will
commit to the DOM in coordinated `requestAnimationFrame()` calls to ensure all layouts are done
in an efficient and coordinated manner. As a preamble, we introduce a `scheduler` singleton which
provides a single public method `scheduleLayout(callback)` to queue callbacks to be fired in the
next `requestAnimationFrame()` callback.
Tests: media/modern-media-controls/scheduler/not-reentrant.html
media/modern-media-controls/scheduler/single-callback-when-registered-multiple-times.html
* Modules/modern-media-controls/controls/scheduler.js: Added.
(const.scheduler.new.prototype.scheduleLayout):
(const.scheduler.new.prototype._requestFrameIfNeeded):
(const.scheduler.new.prototype._frameDidFire):
(const.scheduler.new.prototype._layout):
2016-09-28 Ryosuke Niwa <rniwa@webkit.org>
Text nodes assigned to a linked slot are not clickable
https://bugs.webkit.org/show_bug.cgi?id=162091
<rdar://problem/28383300>
Reviewed by Antti Koivisto.
The bug was caused by updateMouseEventTargetNode adjusting the target to its parent element when
the original target was a text node. Fixed the bug by using the parent element in the composed tree.
Also fixed the bug that the hit testing was not finding the anchor element and keeping the cursor
in I-beam by traversing the composed tree instead.
Test: fast/shadow-dom/click-text-inside-linked-slot.html
* dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf): Fixed the cursor problem.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode): Fixed the activation problem.
2016-09-29 Sam Weinig <sam@webkit.org>
Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
<rdar://problem/27648683>
https://bugs.webkit.org/show_bug.cgi?id=162735
Reviewed by Dan Bernstein.
* platform/spi/cf/CFNetworkSPI.h:
Forward declare _sourceApplicationSecondaryIdentifier and _CTDataConnectionServiceType
2016-09-29 Antti Koivisto <antti@apple.com>
Remove addSubresourceStyleURLs functions
https://bugs.webkit.org/show_bug.cgi?id=162731
Reviewed by Ryosuke Niwa.
Use the generic std::function taking traverseSubresources instead. This prevents bugs caused by the code paths
not being in sync.
These functions are only used by the legacy webarchive code to gather URLs to locate CachedResources from the memory cache.
This can be improved further by returning the cached resources themselves instead of the URLs.
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): Deleted.
* css/CSSFontFaceSrcValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.cpp:
(WebCore::CSSReflectValue::addSubresourceStyleURLs): Deleted.
* css/CSSReflectValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::addSubresourceStyleURLs): Deleted.
* css/CSSValue.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::addSubresourceStyleURLs): Deleted.
* css/CSSValueList.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::addSubresourceStyleURLs): Deleted.
* css/StyleProperties.h:
* css/StyleRuleImport.h:
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::traverseSubresources):
Fix a bug where this would miss @import rules in @imported stylesheets.
Include the CachedResource for the imported stylesheet itself.
Tested by the test cases under LayoutTests/webarchive
(WebCore::StyleSheetContents::addSubresourceStyleURLs): Deleted.
* css/StyleSheetContents.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::addSubresourceAttributeURLs):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::addSubresourceAttributeURLs):
2016-09-29 Brent Fulgham <bfulgham@apple.com>
[Win][Direct2D] Add D2D Font handling code
https://bugs.webkit.org/show_bug.cgi?id=162712
Reviewed by Brent Fulgham.
This patch lands a set of new files that implement
No new tests until complete backend lands.
* platform/graphics/Font.h:
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::syntheticObliqueAngle): Added helper function.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::dwFont): Added.
(WebCore::FontPlatformData::dwFontFace): Ditto.
* platform/graphics/GlyphBuffer.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs): Use helper function.
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs): Ditto.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::createFontPlatformData): Add case for Direct2D.
* platform/graphics/win/FontCascadeDirect2D.cpp: Added.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Fix whitespace.
(WebCore::FontCustomPlatformData::fontPlatformData): Add Direct2D case.
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Ditto.
* platform/graphics/win/FontPlatformDataDirect2D.cpp: Added.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp: Added.
* platform/graphics/win/SimpleFontDataDirect2D.cpp: Added.
* platform/graphics/win/TextAnalyzerHelper.cpp: Added.
* platform/graphics/win/TextAnalyzerHelper.h: Added.
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should fail to parse unclosed IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162715
Reviewed by Tim Horton.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
2016-09-29 Alex Christensen <achristensen@webkit.org>
URLParser should ignore tabs at all possible locations
https://bugs.webkit.org/show_bug.cgi?id=162711
Reviewed by Tim Horton.
The URL spec says to remove all tabs and newlines before parsing a URL.
To reduce passes on the URL and copies of data, I chose to just ignore them every time I increment the iterator.
This is fragile, but faster. It can be completely tested, though. That is what this patch does.
Covered by an addition to the API tests that tries inserting one tab at each location of each test.
* platform/URLParser.cpp:
(WebCore::URLParser::advance):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendWindowsDriveLetter):
(WebCore::URLParser::isPercentEncodedDot):
(WebCore::URLParser::isSingleDotPathSegment):
(WebCore::URLParser::isDoubleDotPathSegment):
(WebCore::URLParser::consumeSingleDotPathSegment):
(WebCore::URLParser::consumeDoubleDotPathSegment):
(WebCore::URLParser::checkLocalhostCodePoint):
(WebCore::URLParser::isAtLocalhost):
(WebCore::URLParser::isLocalhost):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::isPercentEncodedDot): Deleted.
(WebCore::isSingleDotPathSegment): Deleted.
(WebCore::isDoubleDotPathSegment): Deleted.
(WebCore::consumeSingleDotPathSegment): Deleted.
(WebCore::consumeDoubleDotPathSegment): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::advance):
2016-09-29 Simon Fraser <simon.fraser@apple.com>
Fix hit testing on display:block <svg> elements
https://bugs.webkit.org/show_bug.cgi?id=162717
rdar://problem/23261130
Reviewed by Zalan Bujtas.
RenderSVGRoot::nodeAtPoint() needs to test for both the HitTestBlockBackground and
HitTestChildBlockBackground phases, since we only get the HitTestChildBlockBackground
phase when the <svg> is a block. This is similar to code in RenderTable::nodeAtPoint(),
and matches Blink code.
This fixes the point dragging on http://anthonydugois.com/svg-path-builder/.
Test: svg/hittest/block-svg.html
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):
2016-09-29 Chris Dumez <cdumez@apple.com>
Assigning non-numeric to input.minlength should set minlength to 0
https://bugs.webkit.org/show_bug.cgi?id=162727
Reviewed by Ryosuke Niwa.
There was a typo when we were updating the m_minLength member from the 'min'
content attribute instead of the 'minlength' one.
Test: imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/minlength.html.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
2016-09-29 Chris Dumez <cdumez@apple.com>
[Web IDL] Fix overload resolution when the distinguishing argument is a Window
https://bugs.webkit.org/show_bug.cgi?id=162728
Reviewed by Ryosuke Niwa.
Fix overload resolution when the distinguishing argument is a Window.
Window is special because we could have a window or a proxy to the
Window (JSDOMWindowShell).
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
* bindings/scripts/test/TestObj.idl:
2016-09-29 Per Arne Vollan <pvollan@apple.com>
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=162262
Reviewed by Anders Carlsson.
If CoreText.h is included, we will get redefinition compile errors on some older SDK
versions.
* platform/spi/win/CoreTextSPIWin.h:
2016-09-29 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove WebCoreSynchronousLoader from ResourceHandleSoup
https://bugs.webkit.org/show_bug.cgi?id=162723
Reviewed by Sergio Villar Senin.
Since all soup based ports switched to NetworkProcess this is dead code.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
2016-09-29 Nan Wang <n_wang@apple.com>
AX: Meter: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162586
Reviewed by Chris Fleizach.
Exposed the label element's text as AXDescription for meter elements.
Also refactored the code for fetching the label element's text and taken care of
the case where aria-label and aria-labelledby attributes are used on label elements.
Test: accessibility/mac/meter-with-label-element.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isLabelable):
(WebCore::AccessibilityNodeObject::textForLabelElement):
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::usesAltTagForTextComputation): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):
2016-09-29 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Streams API] Improve ReadableStreamDefaultController.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=160293
Reviewed by Youenn Fablet.
Various small improvements in ReadableStreamDefaultController code (helper methods and asserts).
No change in behaviour.
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked): Added an assert and updated based
on new helper methods.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::close): Updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::error): Updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::enqueue): Added an assert and updated based on new helper methods.
(WebCore::ReadableStreamDefaultController::jsController): New helper method.
(WebCore::ReadableStreamDefaultController::globalObject): Return reference instead of pointer.
(WebCore::ReadableStreamDefaultController::globalExec): New helper; return reference after performing an assert.
(WebCore::ReadableStreamDefaultController::error<String>): Added an assert and updated based on new helper methods.
2016-09-29 Jon Davis <jond@apple.com>
Added Beacon API to the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=162630
Reviewed by Alex Christensen.
* features.json:
2016-09-28 Chris Dumez <cdumez@apple.com>
Drop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
https://bugs.webkit.org/show_bug.cgi?id=162709
Reviewed by Alex Christensen.
Drop first 'state' parameter to JSDOMWindow::toWrapped() / JSEventTarget::toWrapped()
as it is unused. This is the quickest way to allow DOMWindow / EventTarget members
in IDL dictionaries. This is because the generated bindings code relies on
convertWrapperType() in JSDOMConvert.h which calls toWrapped() with a single
parameter. Right now, the only type that requires an ExecState for its toWrapped()
is XPathNSResolver (which should likely be a callback interface rather than a
regular interface).
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(JSValueToNative):
2016-09-28 Chris Dumez <cdumez@apple.com>
Log console messages when the anchor download attribute is ignored
https://bugs.webkit.org/show_bug.cgi?id=162703
Reviewed by Alex Christensen.
Log console messages when the anchor download attribute is ignored so
that the developer can better understand what's happening.
No new tests, rebaselined existing tests.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-09-28 Chris Dumez <cdumez@apple.com>
Add support for DOMTokenList.supports()
https://bugs.webkit.org/show_bug.cgi?id=162659
Reviewed by Ryosuke Niwa.
Add support for DOMTokenList.supports():
- https://dom.spec.whatwg.org/#dom-domtokenlist-supports
Firefox and Chrome already recently implemented it (Chrome since
version 50 and Firefox since version 49).
Test: fast/dom/DOMTokenList-supports.html
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::enforceSandboxFlags): Deleted.
* dom/SecurityContext.h:
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::DOMTokenList):
(WebCore::DOMTokenList::supports):
(WebCore::DOMTokenList::replace): Deleted.
* html/DOMTokenList.h:
(WebCore::DOMTokenList::DOMTokenList):
* html/DOMTokenList.idl:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::relList):
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::sandbox):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
* html/HTMLTableCellElement.idl:
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::isSupported):
(WebCore::LinkRelAttribute::LinkRelAttribute): Deleted.
* html/LinkRelAttribute.h:
2016-09-28 Ryosuke Niwa <rniwa@webkit.org>
DOMTokenList’s value and stringifier should not return parsed tokens
https://bugs.webkit.org/show_bug.cgi?id=161076
Reviewed by Chris Dumez.
Updated our implementation of DOMTokenList.prototype.value and its toString function
to match the latest DOM specification: https://dom.spec.whatwg.org/#interface-domtokenlist
"value" attribute, on getting, runs its serialize steps, which simply gets the attribute value.
On setting, it sets the attribute value with the given value.
The stringification behavior returns the same serialize steps as "value" attribute on getting.
This change simplifies our implementation of DOMTokenList and removes the need for m_cachedValue,
which has been removed in this patch.
No new tests since existing tests cover this.
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::value): Just call getAttribute.
(WebCore::DOMTokenList::setValue): Just call setAttribute.
(WebCore::DOMTokenList::updateTokensFromAttributeValue):
(WebCore::DOMTokenList::associatedAttributeValueChanged):
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens): Moved the code to update the tokens
from from the attribute value. This is the "update steps".
* html/DOMTokenList.h:
2016-09-28 Jer Noble <jer.noble@apple.com>
CRASH at WebCore::CDMSessionAVStreamSession::update + 950
https://bugs.webkit.org/show_bug.cgi?id=162701
Reviewed by Beth Dakin.
If the SourceBuffer backing a <video> element is removed before CDMSessionAVStreamSession::update() gets
a chance to run, the protectedSourceBuffer will be null. Just bail early and indicate an error.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update):
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should properly handle unexpected periods and overflows in IPv4 addresses
https://bugs.webkit.org/show_bug.cgi?id=162655
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
* platform/URLParser.h:
2016-09-28 Wenson Hsieh <wenson_hsieh@apple.com>
Some media tests are crashing due to soft-linking failures
https://bugs.webkit.org/show_bug.cgi?id=162698
Reviewed by Jer Noble.
We should be handling soft-linking failures for MRMediaRemoteSetNowPlayingVisibility gracefully. Guards these
calls with canLoad_MediaRemote_MRMediaRemoteSetParentApplication and also use the
SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER macro when soft linking.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should ignore tabs in authority
https://bugs.webkit.org/show_bug.cgi?id=162694
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseAuthority):
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should ignore extra slashes after scheme:// and handle a missing slash after the port
https://bugs.webkit.org/show_bug.cgi?id=162690
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-09-28 Alex Christensen <achristensen@webkit.org>
URLParser should correctly canonicalize uppercase IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162680
Reviewed by Tim Horton.
Covered by a new API test.
* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
If there is an uppercase character in the IPv6 address part, then it is a syntax violation
because the canonicalized IPv6 address differs from the input String.
2016-09-28 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build.
* bindings/js/ios/TouchConstructors.cpp:
2016-09-28 Chris Dumez <cdumez@apple.com>
It should be possible to dispatch events on template documents
https://bugs.webkit.org/show_bug.cgi?id=162687
Reviewed by Ryosuke Niwa.
It should be possible to dispatch events on template documents. Firefox
supports this. Chrome does not but this is likely not intentional as
Chrome generally supports dispatching events on frameless documents.
Test: fast/dom/template-document-dispatchEvent.html
* dom/Document.cpp:
(WebCore::Document::ensureTemplateDocument):
2016-09-27 Dean Jackson <dino@apple.com>
Use Color references where possible
https://bugs.webkit.org/show_bug.cgi?id=162643
<rdar://problem/28506550>
Reviewed by Simon Fraser.
There were a bunch of places where we pass or use
Colors by value. As the Color class gets a bit more
complicated, it would be nice to avoid copying, so
use references where possible.
* css/CSSGradientValue.cpp:
(WebCore::interpolate):
* css/StyleColor.h:
(WebCore::StyleColor::getColor):
(WebCore::StyleColor::resolve):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::backgroundColor):
* dom/Document.h:
(WebCore::Document::textColor):
* editing/FrameSelection.cpp:
(WebCore::disappearsIntoBackground):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasRenderingContext2D.h:
* html/track/TextTrackCueGeneric.h:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::setBackgroundColor):
* page/PageOverlay.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperColor::PropertyWrapperColor):
(WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
(WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::strokeColor):
(WebCore::GraphicsContext::fillColor):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::foregroundColor):
(WebCore::GenericCueData::setForegroundColor):
(WebCore::GenericCueData::backgroundColor):
(WebCore::GenericCueData::setBackgroundColor):
(WebCore::GenericCueData::highlightColor):
(WebCore::GenericCueData::setHighlightColor):
* platform/graphics/ca/TileController.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawFocusRingPath::color):
(WebCore::DisplayList::DrawFocusRingRects::color):
(WebCore::DisplayList::FillRectWithColor::color):
(WebCore::DisplayList::FillCompositedRect::color):
(WebCore::DisplayList::FillRoundedRect::color):
(WebCore::DisplayList::FillRectWithRoundedHole::color):
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::lightingColor):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDropShadow.h:
(WebCore::FEDropShadow::shadowColor):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::floodColor):
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::lightingColor):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FilterOperation.h:
* rendering/BorderEdge.h:
(WebCore::BorderEdge::color):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
* rendering/InlineTextBox.h:
* rendering/RenderFrameSet.cpp:
(WebCore::borderStartEdgeColor):
(WebCore::borderEndEdgeColor):
(WebCore::borderFillColor):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderInline.h:
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::color):
* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::color):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::color):
(WebCore::RenderStyle::visitedLinkColor):
(WebCore::RenderStyle::setColor):
(WebCore::RenderStyle::setVisitedLinkColor):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::borderLeftColor):
(WebCore::RenderStyle::borderRightColor):
(WebCore::RenderStyle::borderTopColor):
(WebCore::RenderStyle::borderBottomColor):
(WebCore::RenderStyle::backgroundColor):
(WebCore::RenderStyle::columnRuleColor):
(WebCore::RenderStyle::outlineColor):
(WebCore::RenderStyle::textEmphasisColor):
(WebCore::RenderStyle::textFillColor):
(WebCore::RenderStyle::textStrokeColor):
(WebCore::RenderStyle::visitedLinkBackgroundColor):
(WebCore::RenderStyle::visitedLinkBorderLeftColor):
(WebCore::RenderStyle::visitedLinkBorderRightColor):
(WebCore::RenderStyle::visitedLinkBorderBottomColor):
(WebCore::RenderStyle::visitedLinkBorderTopColor):
(WebCore::RenderStyle::visitedLinkOutlineColor):
(WebCore::RenderStyle::visitedLinkColumnRuleColor):
(WebCore::RenderStyle::textDecorationColor):
(WebCore::RenderStyle::visitedLinkTextDecorationColor):
(WebCore::RenderStyle::visitedLinkTextEmphasisColor):
(WebCore::RenderStyle::visitedLinkTextFillColor):
(WebCore::RenderStyle::visitedLinkTextStrokeColor):
(WebCore::RenderStyle::stopColor):
(WebCore::RenderStyle::floodColor):
(WebCore::RenderStyle::lightingColor):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::buildStops):
2016-09-28 Ryosuke Niwa <rniwa@webkit.org>
assignedNodes should include fallback contents when flattened option is set
https://bugs.webkit.org/show_bug.cgi?id=162656
Reviewed by Antti Koivisto.
Fixed the bug by traversing through fallback contents when there are no assigned nodes.
Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
(WebCore::HTMLSlotElement::assignedNodes):
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Adopt MediaRemote SPI to achieve desired Now Playing behavior
https://bugs.webkit.org/show_bug.cgi?id=162658
<rdar://problem/28499358>
Reviewed by Jer Noble.
Restores the changes previously rolled out in r206444, and adopts new MediaRemote SPI to achieve the desired
behavior for media in background tabs without breaking other features.
Introduces 2 new unit tests in NowPlayingControlsTests.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::pageAllowsNowPlayingControls):
* page/Page.cpp:
(WebCore::Page::setViewState):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession):
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
* platform/spi/mac/MediaRemoteSPI.h:
2016-09-28 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r206481): ASSERTION FAILED: isDecoderAvailable()
https://bugs.webkit.org/show_bug.cgi?id=162665
Reviewed by Simon Fraser.
Remove a wrong assertion from ImageSource::destroyDecodedData(). Before
r206481, the original function BitmapImage::destroyDecodedData() did not
have this assertion. Destroying the decoded ImageFrames can happen after
releasing the ImageDecoder. And it can happen also if decoding the image
fails and BitmapImage::isNull() is true. See CachedImage::finishLoading().
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::destroyDecodedData):
2016-09-28 Youenn Fablet <youenn@apple.com>
WebCore::ResourceErrorBase::setType is crashing
https://bugs.webkit.org/show_bug.cgi?id=162484
<rdar://problem/28390828>
Reviewed by Alex Christensen.
Test: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html
Behavior is slightly changed as we are no longer casting Timeout preflight errors as AccessControl errors.
This is more inline with fetch spec which prescribes to send back any error received by preflight as response error for fetch.
Ideally, we should not need to change errors received during preflight loads but the error type is important for some clients:
- EventSource may try to reconnect if error is not AccessControl
- XMLHttpRequest will send abort events in case of Cancellation errors and timeout events in case of Timeout errors
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished): Setting error type to AccessControl except in case of Timeout.
(WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::preflightFailure): Removing ASSERT since Timeout errors may be returned.
* platform/network/ResourceErrorBase.h:
(WebCore::ResourceErrorBase::isGeneral): New getter.
2016-09-28 Jer Noble <jer.noble@apple.com>
PiP shows incorrect state of play button.
https://bugs.webkit.org/show_bug.cgi?id=162652
Reviewed by Eric Carlson.
After getting a new WebPlaybackSessionModel, the first thing WebVideoFullscreenInterfaceMac
should do is query for it's playbackRate() and isPlaying() properties.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Add Chrome UA quirk
https://bugs.webkit.org/show_bug.cgi?id=162617
Reviewed by Carlos Garcia Campos.
Add Chrome UA quirk and use it on typekit.net, typekit.com, youtube.com, slack.com, and
any domain that begins with "google".
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::urlRequiresChromeBrowser):
(WebCore::standardUserAgentForURL):
2016-09-28 Jer Noble <jer.noble@apple.com>
[MSE][Mac] In SourceBufferPrivateAVFObjC::abort(), support reseting parser to the last appended initialization segment.
https://bugs.webkit.org/show_bug.cgi?id=135164
Reviewed by Eric Carlson.
Test: media/media-source/media-source-abort-resets-parser.html
Use the -[AVStreamDataParser appendStreamData:withFlags:] to implement "resetting" the parser. In this case,
the parser isn't explicitly reset during resetParserState(), but rather a flag is set so that the next append
signals a data discontinuity, and the parser is reset at that point.
Because a previous append operation may be in-flight during this abort(), care must be taken to invalidate any
operations which may have already started on a background thread. So SourceBufferPrivateAVFObjC will use a
separate WeakPtrFactory for its append operations, will invalidate any outstanding WeakPtrs during an abort(),
and will block until the previous append() operation completes.
This will require the WebAVStreamDataParserListener object to occasionally have it's WeakPtr pointing back to the
SourceBufferPrivateAVFObjC to be reset after an abort(), so make that ivar an @property. Rather than passing a
RetainPtr to itself in all the callbacks it handles, the WebAVStreamDataParserListener can just pass in a copy
of its own WeakPtr (which may be invalidated during an abort()).
Break the distinct operations of "abort()" and "resetParserState()" into their own methods in SourceBufferPrivate
and all its subclasses.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::abortIfUpdating):
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
(-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
(-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(-[WebAVStreamDataParserListener initWithParser:parent:]): Deleted.
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::resetParserState):
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::resetParserState):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
* platform/spi/mac/AVFoundationSPI.h:
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] User agent should always claim to be Intel
https://bugs.webkit.org/show_bug.cgi?id=162610
Reviewed by Carlos Garcia Campos.
We should always claim to be running on Intel regardless of actual CPU type. See discussion
in bug #162548 for details. In particular, we can never advertise ARM because it causes dumb
websites to send mobile pages.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString):
(WebCore::buildUserAgentString):
(WebCore::cpuDescriptionForUAString): Deleted.
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Adjust OS X UA quirks list
https://bugs.webkit.org/show_bug.cgi?id=162616
Reviewed by Carlos Garcia Campos.
Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and
whatsapp.com.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::standardUserAgentForURL):
2016-09-28 Alejandro G. Castro <alex@igalia.com>
Add WebIDL special operation support: serializer
https://bugs.webkit.org/show_bug.cgi?id=156293
Reviewed by Youenn Fablet.
Added support for the serializer special operation for WebIDLs,
current implementation adds support for:
- just the keyword: serializer; It will return all the
attributes of in an object.
- map of entries with the attributes: serializer = {attribute1,
attribute2, ...}
It creates a toJSON method that returns the serialized value
converted into an ECMAScript value. For more information check the
definition of the operation:
http://heycam.github.io/webidl/#idl-serializers
We have created a new function in the API of the objects
that are marked as serializer.
Used the support to add new API for RTCIceCandidate and
RTCSessionDescription.
Updated the tests expectations of the bindings.
Tests: bindings/scripts/test/TestNode.idl
bindings/scripts/test/TestObj.idl
fast/mediastream/RTCIceCandidate.html
fast/mediastream/RTCSessionDescription.html
* Modules/mediastream/RTCIceCandidate.idl: Added the serializer
operation.
* Modules/mediastream/RTCSessionDescription.idl: Added the
serializer operation.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Added the calls to the serializer
code generator.
(GenerateSerializerFunction): Added, generates the toJSON function
adding all the serializable->attributes value to an object as
defined in the spec.
* bindings/scripts/IDLParser.pm: Modified the serializer parser
that was unused to support the WebIDL spec parts. Added a new
domSerializable type to store the list of attributes in the
possible map.
(parseSerializer): Modified the function to follow the
semicolon rule in the spec, now the serializer line must have a
semicolon like any other line.
(parseSerializerRest): The function now has to get the attributes
list from the pattern parsing function and add them to the
domSerializable item.
(parseSerializationPattern): Now this function returns the list of
attributes in the serializable map or list if we have one.
(parseSerializationAttributes): Added, this function replaces the
Map and List functions, the currently supported parts are similar
for both situations.
(applyMemberList): Added the serializable item to the interface
variable and populate the serializable in case there is not a
defined map.
(parseSerializationPatternMap): Replaced with
parseSerializationAttributes.
(parseSerializationPatternList): Ditto.
* bindings/scripts/test/JS/JSTestNode.cpp: Modified the expected result.
(WebCore::jsTestNodePrototypeFunctionToJSON):
* bindings/scripts/test/JS/JSTestObj.cpp: Modified the expected result.
(WebCore::jsTestObjPrototypeFunctionToJSON):
* bindings/scripts/test/TestNode.idl: Added the serializer test.
* bindings/scripts/test/TestObj.idl: Added serializer map test.
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Simplify platformForUAString
https://bugs.webkit.org/show_bug.cgi?id=162614
Reviewed by Carlos Garcia Campos.
Note in particular that the previous PLATFORM(MAC) check was wrong here, as that is never
true for GTK; this patch risks changing it to OS(MAC_OS_X), on the hope that advertising Mac
when running on Mac might not break anything. If it does, then we should remove it and just
always pretend to be on X11.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformForUAString):
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Bump fake Safari version in UA
https://bugs.webkit.org/show_bug.cgi?id=162615
Reviewed by Carlos Garcia Campos.
Pretend to be Safari 10.0 to fix sites that don't work when we pretend to be Safari 8.0.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
2016-09-28 Khaled Hosny <khaledhosny@eglug.org>
Use new woff2 API
https://bugs.webkit.org/show_bug.cgi?id=162608
Reviewed by Michael Catanzaro.
Test: fast/text/woff2-totalsfntsize.html
* platform/graphics/WOFFFileFormat.cpp:
(WebCore::WOFF2VectorOut::WOFF2VectorOut):
(WebCore::WOFF2VectorOut::Write):
(WebCore::WOFF2VectorOut::Size):
(WebCore::convertWOFFToSfnt):
2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Add warning comment in UserAgentGtk.cpp
https://bugs.webkit.org/show_bug.cgi?id=162618
Reviewed by Carlos Garcia Campos.
* platform/gtk/UserAgentGtk.cpp:
2016-09-28 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Streams API] Align cancelReadableStream() with spec
https://bugs.webkit.org/show_bug.cgi?id=162556
Reviewed by Xabier Rodriguez-Calvar.
Aligned cancelReadableStream() with Streams API. In particular, private cancel() method
was added to ReadableStreamDefaultController and function name was replaced by readableStreamCancel().
Implementation of cancel() (as well as pull()) is actually made in ReadableStreamInternals.js to
avoid creating new function for each controller.
No change in behaviour.
* Modules/streams/ReadableStream.js:
(cancel): Updated with reference to readableStreamCancel().
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel): Updated with reference to readableStreamCancel().
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Refer to external functions (cancel/pull) to avoid
creating new functions.
(teeReadableStreamBranch2CancelFunction): Updated with reference to readableStreamCancel().
(readableStreamCancel): New name for cancelReadableStream(), behaviour aligned with spec.
(readableStreamDefaultControllerCancel): Added to avoid creating new function for each controller.
(readableStreamDefaultControllerPull): Added to avoid creating new function for each controller.
(readFromReadableStreamDefaultReader): Updated call to pull method to pass controller.
* bindings/js/WebCoreBuiltinNames.h: Added "cancel".
2016-09-27 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix debug build break since r206481. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162662
No new tests, no new behaviours.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
2016-09-27 Nan Wang <n_wang@apple.com>
AX: CrashTracer: com.apple.WebKit.WebContent at WebCore::AXObjectCache::localCaretRectForCharacterOffset(WebCore::RenderObject*&, WebCore::CharacterOffset const&) + 116
https://bugs.webkit.org/show_bug.cgi?id=162654
Reviewed by Chris Fleizach.
rangeForUnorderedCharacterOffsets() can return a null Range but we failed to
do a null check in localCaretRectForCharacterOffset() before dereferencing it.
Test: accessibility/mac/bounds-for-range-crash.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::localCaretRectForCharacterOffset):
2016-09-27 Alex Christensen <achristensen@webkit.org>
Inline critical functions in URLParser
https://bugs.webkit.org/show_bug.cgi?id=162653
Reviewed by Myles C. Maxfield.
This gives me about a 15% speed improvement.
* platform/URLParser.cpp:
(WebCore::CodePointIterator::CodePointIterator):
(WebCore::CodePointIterator::operator==):
(WebCore::CodePointIterator::operator!=):
(WebCore::CodePointIterator::operator=):
(WebCore::CodePointIterator::atEnd):
(WebCore::CodePointIterator::codeUnitsSince):
(WebCore::CodePointIterator<LChar>::operator):
(WebCore::CodePointIterator<UChar>::operator):
(WebCore::appendCodePoint):
(WebCore::isC0Control):
(WebCore::isC0ControlOrSpace):
(WebCore::isTabOrNewline):
(WebCore::isInSimpleEncodeSet):
(WebCore::isInDefaultEncodeSet):
(WebCore::isInUserInfoEncodeSet):
(WebCore::isInvalidDomainCharacter):
(WebCore::isPercentOrNonASCII):
(WebCore::isSlashQuestionOrHash):
(WebCore::isValidSchemeCharacter):
(WebCore::URLParser::advance):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::percentEncodeByte):
(WebCore::URLParser::utf8PercentEncode):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::isDefaultPort):
(WebCore::isSpecialScheme):
(WebCore::isPercentEncodedDot):
(WebCore::isSingleDotPathSegment):
(WebCore::isDoubleDotPathSegment):
(WebCore::consumeSingleDotPathSegment):
(WebCore::consumeDoubleDotPathSegment):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::currentPosition):
(WebCore::zeroSequenceLength):
(WebCore::findLongestZeroSequence):
(WebCore::pow256):
(WebCore::percentDecode):
(WebCore::containsOnlyASCII):
(WebCore::domainToASCII):
(WebCore::hasInvalidDomainCharacter):
(WebCore::formURLDecode):
(WebCore::serializeURLEncodedForm):
2016-09-27 Zalan Bujtas <zalan@apple.com>
REGRESSION (r204552): Yelp carousel animation is not smooth.
https://bugs.webkit.org/show_bug.cgi?id=162632
Reviewed by Simon Fraser.
For composited state changes when the layers don't need rebuilding, the updateGeometry() traversal
is post-order (see webkit.org/162634), so we can't rely on the offsetfromRenderer() value when
computing the graphics layer position on the descendants. We need this workaround until after webkit.org/162634
gets fixed.
Tests: compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html
compositing/hidpi-negative-composited-bounds-on-device-pixel.html
* rendering/RenderLayerBacking.cpp:
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::ComputedOffsets::ComputedOffsets):
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
2016-09-27 Said Abou-Hallawa <sabouhallawa@apple.com>
Move caching the ImageFrame from BitmapImage to ImageSource
https://bugs.webkit.org/show_bug.cgi?id=155498
Reviewed by Simon Fraser.
BitmapImage has two modes of operation regarding its image decoding state.
The first mode happens when a remote image is loaded as encoded data and
which requires an ImageDecoder to generate the image metadata and the
the ImageFrames. The second mode happens when a BitmapImage is created
with a NativeImagePtr. In this case, no ImageDecoder is needed.
To remove this burden from the BitmapImage the member 'm_frames' is removed
from BitmapImage. A new member named 'm_frameCache' of type ImageFrameCache
is added to ImageSource. This class handles caching and recaching the image
metadata and the ImageFrames if the image needs decoding. When the BitmapImage
is initialized with a memory image, the ImageFrameCache initializes its
metadata and ImageFrames directly from the NativeImagePtr.
The plan for ImageFrameCache is to be extended for the asynchronous image
decoding and also to be used by the non CG image decoders which cache
other copies of the ImageFrames. This double caching should be removed.
When the BitmapImage is replying to the ImageFrame queries, it will ask the
ImageSource which will pass the query the ImageFrameCache. ImageFrameCache
will ensure the requested ImageFrame is cached and is valid for the requested
SubSamplingLevel before accessing the data members of this ImageFrame.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add and ImageFrameCache.cpp to the WebCore project.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage): Move initializing the image metadata to
ImageSource. Add initializers for the remaining members in the class declaration.
(WebCore::BitmapImage::destroyDecodedData): Move most of the logic of this
function to ImageFrameCache::destroyDecodedData(). The only part which can't
be moved is the call invalidatePlatformData().
(WebCore::BitmapImage::destroyDecodedDataIfNecessary): Move the logic of this
function to ImageFrameCache::destroyDecodedDataIfNecessary().
(WebCore::BitmapImage::dataChanged): Move the logic of this function to
ImageSource::dataChanged().
(WebCore::BitmapImage::frameImageAtIndex): Move most of the logic of this
function to ImageFrameCache::frameImageAtIndex(). The only part which can't
be moved is the call invalidatePlatformData() if the required subsampling
level is different from the subsampling level for the cached frame image.
(WebCore::BitmapImage::draw): Replace the BitmapImage cached metadata with
the corresponding ImageSource cached metadata.
(WebCore::BitmapImage::drawPattern): Ditto.
(WebCore::BitmapImage::shouldAnimate): Ditto.
(WebCore::BitmapImage::startAnimation): Ditto.
(WebCore::BitmapImage::internalAdvanceAnimation): Ditto.
(WebCore::BitmapImage::dump): Call ImageSource::dump() to dump the image
cached metadata.
(WebCore::BitmapImage::haveFrameImageAtIndex): Deleted.
(WebCore::BitmapImage::destroyMetadataAndNotify): Deleted.
(WebCore::BitmapImage::cacheFrame): Deleted.
(WebCore::BitmapImage::didDecodeProperties): Deleted.
(WebCore::BitmapImage::updateSize): Deleted.
(WebCore::BitmapImage::size): Deleted.
(WebCore::BitmapImage::sizeRespectingOrientation): Deleted.
(WebCore::BitmapImage::hotSpot): Deleted.
(WebCore::BitmapImage::frameCount): Deleted.
(WebCore::BitmapImage::isSizeAvailable): Deleted.
(WebCore::BitmapImage::ensureFrameAtIndexIsCached): Deleted.
(WebCore::BitmapImage::frameIsCompleteAtIndex): Deleted.
(WebCore::BitmapImage::frameDurationAtIndex): Deleted.
(WebCore::BitmapImage::frameHasAlphaAtIndex): Deleted.
(WebCore::BitmapImage::currentFrameKnownToBeOpaque): Deleted.
(WebCore::BitmapImage::frameOrientationAtIndex): Deleted.
(WebCore::BitmapImage::singlePixelSolidColor): Deleted.
(WebCore::BitmapImage::repetitionCount): Deleted.
* platform/graphics/BitmapImage.h:
Managing the ImageFrames caching is moved to ImageFrameCache. Caching the
image metadata is now moved to the ImageSource.
* platform/graphics/GeneratedImage.h:
* platform/graphics/Image.h:
(WebCore::Image::orientationForCurrentFrame):
(WebCore::Image::singlePixelSolidColor):
Change currentFrameKnownToBeOpaque(), orientationForCurrentFrame() and
singlePixelSolidColor() to be const.
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::defaultFrame): Returns an empty ImageFrame to get the default ImageFrame metadata.
(WebCore::ImageFrame::fillMetadata): Deleted. Moved to ImageFrameCache.
(WebCore::ImageFrame::initialize): Deleted. Ditto.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDuration): Change the type of the argument to float instead of unsigned.
(WebCore::ImageFrame::hasAlpha): Protect the unset m_hasAlpha by checking hasMetadata() first.
* platform/graphics/ImageFrameCache.cpp: Added.
(WebCore::ImageFrameCache::ImageFrameCache): Two constructors similar to what we do for ImageSource and BitmapImage.
(WebCore::ImageFrameCache::destroyDecodedData): Moved from BitmapImage.cpp.
(WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Ditto.
(WebCore::ImageFrameCache::destroyIncompleteDecodedData): Ditto.
(WebCore::ImageFrameCache::decodedSizeChanged): Ditto.
(WebCore::ImageFrameCache::decodedSizeIncremented): Ditto.
(WebCore::ImageFrameCache::decodedSizeDecremented): Ditto.
(WebCore::ImageFrameCache::decodedSizeReset): Ditto.
(WebCore::ImageFrameCache::didDecodeProperties): Ditto.
(WebCore::ImageFrameCache::growFrames): Grows the size of m_frames if necessary.
(WebCore::ImageFrameCache::setNativeImage): Initializes the ImageFrame metadata directly from the NativeImagePtr.
(WebCore::ImageFrameCache::setFrameNativeImage): Initializes the ImageFrame image and the metadata.
(WebCore::ImageFrameCache::setFrameMetadata): Initializes the ImageFrame metadata from the ImageDecoder.
(WebCore::ImageFrameCache::frameAtIndex): Returns an ImageFrame given its index. Cache or recache the requested ImageFrame if necessary.
(WebCore::ImageFrameCache::clearMetadata): Invalidates the cached image metadata.
(WebCore::ImageFrameCache::metadata): A template function which returns an image metadata property.
(WebCore::ImageFrameCache::frameMetadataAtIndex): A template function which returns an ImageFrame metadata property.
(WebCore::ImageFrameCache::isSizeAvailable): An image metadata property.
(WebCore::ImageFrameCache::frameCount): Ditto.
(WebCore::ImageFrameCache::repetitionCount): Ditto.
(WebCore::ImageFrameCache::filenameExtension): Ditto.
(WebCore::ImageFrameCache::hotSpot): Ditto.
(WebCore::ImageFrameCache::size): An image metadata property but we get it from the first ImageFrame.
(WebCore::ImageFrameCache::sizeRespectingOrientation): Ditto.
(WebCore::ImageFrameCache::singlePixelSolidColor): Ditto.
(WebCore::ImageFrameCache::frameIsCompleteAtIndex): An ImageFrame metadata property.
(WebCore::ImageFrameCache::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Ditto.
(WebCore::ImageFrameCache::frameSubsamplingLevelAtIndex): Ditto.
(WebCore::ImageFrameCache::frameSizeAtIndex): Ditto.
(WebCore::ImageFrameCache::frameBytesAtIndex): Ditto.
(WebCore::ImageFrameCache::frameDurationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameOrientationAtIndex): Ditto.
(WebCore::ImageFrameCache::frameImageAtIndex): Ditto.
* platform/graphics/ImageFrameCache.h: Added.
(WebCore::ImageFrameCache::setDecoder): Sets the current ImageDecoder which is owned by the ImageSource.
(WebCore::ImageFrameCache::decodedSize): Returns the size of the cached NativeImages.
(WebCore::ImageFrameCache::isDecoderAvailable): Returns whether an ImageDecoder is available.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource): Initializes the ImageFrameCache based on the image decoding state.
(WebCore::ImageSource::clearFrameBufferCache): Replace initialized() with isDecoderAvailable().
(WebCore::ImageSource::clear): Clears the ImageDecoder of the ImageFrameCache.
(WebCore::ImageSource::destroyDecodedData): Moved from BitmapImage.cpp.
(WebCore::ImageSource::destroyDecodedDataIfNecessary): Ditto.
(WebCore::ImageSource::ensureDecoderAvailable): Creates an ImageDecoder if necessary and sets it in ImageFrameCache.
(WebCore::ImageSource::setData):
(WebCore::ImageSource::dataChanged): Moved from BitmapImage.cpp.
(WebCore::ImageSource::isAllDataReceived):
(WebCore::ImageSource::maximumSubsamplingLevel): Rename calculateMaximumSubsamplingLevel() to maximumSubsamplingLevel().
(WebCore::ImageSource::subsamplingLevelForScale):
(WebCore::ImageSource::createFrameImageAtIndex):
(WebCore::ImageSource::dump):
(WebCore::ImageSource::calculateMaximumSubsamplingLevel): Deleted. Renamed to maximumSubsamplingLevel().
(WebCore::ImageSource::updateMetadata): Deleted. Not needed. Caching the image metadata is the responsibility of ImageFrameCache.
(WebCore::ImageSource::bytesDecodedToDetermineProperties): Deleted. Not needed.
(WebCore::ImageSource::isSizeAvailable): Deleted. Moved to ImageSource.h.
(WebCore::ImageSource::size): Deleted. Ditto.
(WebCore::ImageSource::sizeRespectingOrientation): Deleted. Ditto.
(WebCore::ImageSource::frameCount): Deleted. Ditto.
(WebCore::ImageSource::repetitionCount): Deleted. Ditto.
(WebCore::ImageSource::filenameExtension): Deleted. Ditto.
(WebCore::ImageSource::hotSpot): Deleted. Ditto.
(WebCore::ImageSource::frameIsCompleteAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameHasAlphaAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameAllowSubsamplingAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameSizeAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameBytesAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameDurationAtIndex): Deleted. Ditto.
(WebCore::ImageSource::frameOrientationAtIndex): Deleted. Ditto.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::isDecoderAvailable): initialized() was renamed to isDecoderAvailable().
(WebCore::ImageSource::decodedSize): Send the query to ImageFrameCache.
(WebCore::ImageSource::isSizeAvailable): Ditto.
(WebCore::ImageSource::frameCount): Ditto.
(WebCore::ImageSource::repetitionCount): Ditto.
(WebCore::ImageSource::filenameExtension): Ditto.
(WebCore::ImageSource::hotSpot): Ditto.
(WebCore::ImageSource::size): Ditto.
(WebCore::ImageSource::sizeRespectingOrientation): Ditto.
(WebCore::ImageSource::singlePixelSolidColor): Ditto.
(WebCore::ImageSource::frameIsCompleteAtIndex): Ditto.
(WebCore::ImageSource::frameHasAlphaAtIndex): Ditto.
(WebCore::ImageSource::frameHasImageAtIndex): Ditto.
(WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Ditto.
(WebCore::ImageSource::frameSubsamplingLevelAtIndex): Ditto.
(WebCore::ImageSource::frameSizeAtIndex): Ditto.
(WebCore::ImageSource::frameBytesAtIndex): Ditto.
(WebCore::ImageSource::frameDurationAtIndex): Ditto.
(WebCore::ImageSource::frameOrientationAtIndex): Ditto.
(WebCore::ImageSource::frameImageAtIndex): Ditto.
(WebCore::ImageSource::decoder): Deleted. Not needed.
(WebCore::ImageSource::initialized): Deleted. Was renamed to isDecoderAvailable().
(WebCore::ImageSource::setNeedsUpdateMetadata): Deleted. Not needed.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): Ditto.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::ImageDecoder): Make the constructor of ImageDecoder be the same for all ports.
(WebCore::ImageDecoder::setData): Removed unused overloaded function.
(WebCore::ImageDecoder::size): Deleted. Removed unused function.
* platform/graphics/cg/ImageDecoderCG.h:
(WebCore::ImageDecoder::create): Make the constructor of CG ImageDecoder be like the other ports.
(WebCore::ImageDecoder::isAllDataReceived): Make this property owned by ImageDecoder.
* platform/graphics/cg/PDFDocumentImage.h: Change currentFrameKnownToBeOpaque() to be const.
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::invalidatePlatformData): m_frames is owned by ImageFrameCache. ImageFrameCache::frameCount() has to
be equal to ImageFrame::m_frames.size().
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::create): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::ImageDecoder): Ditto.
(WebCore::ImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::BMPImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::GIFImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
(WebCore::GIFImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
* platform/image-decoders/gif/GIFImageReader.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::ICOImageDecoder):
(WebCore::ICOImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
(WebCore::ICOImageDecoder::decode): Move resizing the m_frameBufferCache from ICOImageDecoder::frameCount() to ICOImageDecoder::decode().
(WebCore::ICOImageDecoder::decodeAtIndex): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::JPEGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::PNGImageDecoder): AlphaOption and GammaAndColorProfileOption are moved out of ImageSource.
* platform/image-decoders/png/PNGImageDecoder.h:
(WebCore::PNGImageDecoder::frameCount): Make frameCount const so it can be passed to the template function ImageFrameCache::metadata().
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
* platform/image-decoders/webp/WEBPImageDecoder.h:
* svg/graphics/SVGImage.h: Make currentFrameKnownToBeOpaque() be const.
* svg/graphics/SVGImageForContainer.h: Ditto.
2016-09-27 Alex Christensen <achristensen@webkit.org>
Correctly parse URLs with the first tab in the fragment
https://bugs.webkit.org/show_bug.cgi?id=162650
Reviewed by Saam Barati.
Covered by a new API test.
* platform/URLParser.cpp:
(WebCore::URLParser::fragmentSyntaxViolation):
2016-09-27 Chris Dumez <cdumez@apple.com>
<a download> does not honor the same-origin requirement
https://bugs.webkit.org/show_bug.cgi?id=156100
Reviewed by Alex Christensen.
We now completely ignore the "download" attribute on anchors if the
href URL is cross-origin. We therefore navigate to the URL instead
of forcefully downloading it in this case and leave it up to the server
to give us the right headers if it should be downloaded. This is
conservative and matches Firefox.
Chrome and the HTML specification ignore only the suggested filename
if the URL is cross-origin but still download the file.
No new tests, updated existing test.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2016-09-27 Alex Christensen <achristensen@webkit.org>
URLParser: Handle windows drive letters after two slashes in relative URLs according to spec
https://bugs.webkit.org/show_bug.cgi?id=162646
Reviewed by Saam Barati.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::CodePointIterator::codeUnitsSince):
(WebCore::URLParser::appendWindowsDriveLetter):
(WebCore::URLParser::parse):
(WebCore::isWindowsDriveLetter): Deleted.
(WebCore::URLParser::checkWindowsDriveLetter): Deleted.
* platform/URLParser.h:
2016-09-27 Alex Christensen <achristensen@webkit.org>
URLs with @ in the user should only search for the last @ until the end of the authority and host
https://bugs.webkit.org/show_bug.cgi?id=162635
Reviewed by Geoffrey Garen.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
2016-09-27 Chris Dumez <cdumez@apple.com>
It should be possible to dispatch events on documents created using DOMParser
https://bugs.webkit.org/show_bug.cgi?id=26147
Reviewed by Ryosuke Niwa.
It should be possible to dispatch events on documents created using
DOMParser. It did not work because we were not setting the context
document on the newly created document in DOMParser::parseFromString().
Firefox and Chrome both already support this.
Test: fast/dom/parsed-document-dispatchEvent.html
* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser):
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
(WebCore::DOMParser::create):
* xml/DOMParser.idl:
2016-09-26 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Improve performance of complex text codepath
https://bugs.webkit.org/show_bug.cgi?id=161936
Reviewed by Simon Fraser.
CoreText exposes a bit on the CTRunStatus which represents whether
the run actually uses the glyph origins concept introduced in
r205396. If this bit is not set, we can use the (slightly faster)
call to CTRunGetAdvances() instead of
CTRunGetBaseAdvancesAndOrigins(). In addition, if none of the runs
have this bit set, we don't need to allocate storage for the vector
of origins at all, thereby using less memory.
No new tests because there is no behavior change.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::advance):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
(WebCore::ComplexTextController::glyphOrigin):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
* platform/spi/cocoa/CoreTextSPI.h:
2016-09-27 Ryosuke Niwa <rniwa@webkit.org>
Import w3c shadow DOM tests and fix one assertion
https://bugs.webkit.org/show_bug.cgi?id=162629
Reviewed by Chris Dumez.
The assertion failure was caused by RelatedNodeRetargeter's constructor mixing up the ancestor tree scopes
for the target and the related target. Fixed the bug by reversing the two.
Tests: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-with-related-target.html
* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): i and m_ancestorTreeScopes are for the related target
and j and targetTreeScopeAncestors are for the target.
2016-09-27 Chris Dumez <cdumez@apple.com>
It should be possible to dispatch events on documents that do not have a browsing context
https://bugs.webkit.org/show_bug.cgi?id=162620
Reviewed by Ryosuke Niwa.
It should be possible to dispatch events on documents that do not have a browsing
context (e.g. Documents created using DOMImplementation.createHTMLDocument()).
Gecko and Blink both allow this but WebKit did not.
The approach chosen to support this is similar to the one in Blink. When constructing
a new document (e.g. using DOMImplementation.createHTMLDocument()) we now keep track
of the context document. When requesting the scriptExecutionContext(), we now return
the context document if the document has one instead of the document itself.
Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-other-document.html
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::visitAdditionalChildren):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/Document.cpp:
(WebCore::Document::create):
(WebCore::Document::cloneDataFromDocument):
(WebCore::Document::contextDocument):
(WebCore::Document::takeDOMWindowFrom): Deleted.
* dom/Document.h:
(WebCore::Document::setContextDocument):
(WebCore::Node::scriptExecutionContext):
(WebCore::Node::isDocumentNode): Deleted.
* dom/Document.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):
2016-09-27 Alex Christensen <achristensen@webkit.org>
Implement URLParser::syntaxViolation
https://bugs.webkit.org/show_bug.cgi?id=162593
Reviewed by Geoffrey Garen.
Most of the time when parsing URLs, we just look at the URL, find offsets of the host, path, query, etc.,
and the String can be used untouched. When this happens, we do not want to allocate and copy the String.
We want to just add a reference to an existing String.
Sometimes we need to canonicalize the String because there has been a syntaxViolation,
defined as any String that is different than its canonicalized URL String. In such cases we need to
allocate a new String and fill it with the canonicalized URL String. When a syntaxViolation happens for the
first time, we know that everything in the input String up to that point is equal to what it would have been
if we had canonicalized the beginning of the URL, copy it into a buffer, and continue parsing in a mode where
instead of just looking at the input URL String, we canonicalize each code point into the buffer.
Changes to behavior involve additional spec compliance with tabs and newlines in different places in URLs,
as well as additional spec compliance when parsing empty and null URLs relative to other URLs.
Both are covered by new API tests. Existing behavior covered by existing API tests.
This is about a 15% speed improvement on my URL parsing benchmark.
* platform/URL.cpp:
(WebCore::assertProtocolIsGood):
(WebCore::URL::protocolIs):
(WebCore::protocolIs):
* platform/URL.h:
* platform/URLParser.cpp:
(WebCore::isTabOrNewline):
(WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
(WebCore::URLParser::isWindowsDriveLetter):
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::URLParser::checkWindowsDriveLetter):
(WebCore::URLParser::shouldCopyFileURL):
(WebCore::URLParser::utf8PercentEncode):
(WebCore::URLParser::utf8QueryEncode):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::syntaxViolation):
(WebCore::URLParser::fragmentSyntaxViolation):
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::currentPosition):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::URLParser::parseAuthority):
(WebCore::URLParser::parseIPv4Number):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parsePort):
(WebCore::URLParser::parseHostAndPort):
(WebCore::serializeURLEncodedForm):
(WebCore::URLParser::allValuesEqual):
(WebCore::URLParser::internalValuesConsistent):
(WebCore::URLParser::incrementIteratorSkippingTabAndNewLine): Deleted.
(WebCore::URLParser::syntaxError): Deleted.
(WebCore::parseIPv4Number): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::incrementIteratorSkippingTabsAndNewlines):
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Related videos on YouTube (and YouTube playlists) cause media controls to disappear
https://bugs.webkit.org/show_bug.cgi?id=162621
<rdar://problem/28484193>
Reviewed by Jer Noble.
Tweaks the main content media heuristic for better Now Playing behavior on YouTube by making the following
changes:
- Remove the strict requirement for audio to be actively playing for the session to be able to show
controls for the purpose of Now Playing, making it the same as our policy for the controls manager.
- Make playback requirement restrictions apply only for the controls manager. Videos that do not
autoplay will still have the correct behavior with respect to Now Playing, since we will bail in the
hasEverNotifiedAboutPlaying() check.
- Only consider the main content heuristic as preventing media controls from showing up for the purposes
of the controls manager. Now Playing should instead account for this by preferring elements large
enough for main content after collecting all of the candidate sessions.
* html/HTMLMediaElement.cpp:
(WebCore::mediaElementSessionInfoForSession):
(WebCore::preferMediaControlsForCandidateSessionOverOtherCandidateSession):
(WebCore::HTMLMediaElement::updatePlayState):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
2016-09-27 Chris Dumez <cdumez@apple.com>
Second parameter to MutationObserver.observe() should be optional
https://bugs.webkit.org/show_bug.cgi?id=162627
Reviewed by Ryosuke Niwa.
Second parameter to MutationObserver.observe() should be optional:
- https://dom.spec.whatwg.org/#interface-mutationobserver
Firefox agrees with the specification. There is no real behavior change
except that MutationObserver.prototype.observe.length is now 1 instead
of 2. Passing only one parameter will still throw a TypeError because
the Dictionary is empty. However, this parameter needs to be marked as
optional because Web IDL requires the last parameter to be optional if
it is a Dictionary.
No new tests, rebaselined existing test.
* dom/MutationObserver.idl:
2016-09-20 Anders Carlsson <andersca@apple.com>
PlatformEvent::m_modifiers should be an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=162326
Reviewed by Daniel Bates.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleAccessKey):
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::accessKeyModifiers):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::shiftKey):
(WebCore::PlatformEvent::ctrlKey):
(WebCore::PlatformEvent::altKey):
(WebCore::PlatformEvent::metaKey):
(WebCore::PlatformEvent::modifiers):
(WebCore::PlatformEvent::PlatformEvent):
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::modifiersForEvent):
(WebCore::typeForEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
* replay/WebInputs.json:
2016-09-27 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Handle Wayland & X11 correctly for GST_GL
https://bugs.webkit.org/show_bug.cgi?id=162619
Reviewed by Carlos Garcia Campos.
The checks for GST_GL consider X11 and Wayland are exclusive alternatives, but it
turns out we can enable both! We need to check them independently and also include
a runtime check.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): fix checks for X11 and
Wayland to handle the case where both are enabled. Includes a runtime check.
2016-09-27 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Restructure MediaConstraints classes
https://bugs.webkit.org/show_bug.cgi?id=162571
Reviewed by Jer Noble.
No new tests, no functional changes.
* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::initialize): Deleted, no longer used.
* Modules/mediastream/MediaConstraintsImpl.h:
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::createStringConstraint): Return Optional<> instead of RefPtr<>.
(WebCore::createBooleanConstraint): Ditto.
(WebCore::createDoubleConstraint): Ditto.
(WebCore::createIntConstraint): Ditto.
(WebCore::parseMediaTrackConstraintSetForKey): Deal with above change.
* platform/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::verifyConstraintsForMediaType): Use constraints.mandatoryConstraints.filter
instead of direct enumeration.
(CaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
(CaptureDeviceManager::isSupportedFrameRate): Ditto.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::StringConstraint::find): Lose the ConstraintType parameter.
(WebCore::StringConstraint::merge): Use downcast<>.
(WebCore::FlattenedConstraint::set): Use ConstraintHolder.
(WebCore::FlattenedConstraint::merge): Ditto.
(WebCore::MediaTrackConstraintSetMap::forEach): New.
(WebCore::MediaTrackConstraintSetMap::filter): Ditto.
(WebCore::MediaTrackConstraintSetMap::isEmpty): Ditto.
(WebCore::MediaTrackConstraintSetMap::set): Ditto.
(WebCore::MediaConstraint::copy): Deleted.
(WebCore::IntConstraint::copy): Deleted.
(WebCore::DoubleConstraint::copy): Deleted.
(WebCore::BooleanConstraint::copy): Deleted.
(WebCore::StringConstraint::copy): Deleted.
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::MediaConstraint):
(WebCore::MediaConstraint::isEmpty):
(WebCore::MediaConstraint::isMandatory):
(WebCore::MediaConstraint::merge):
(WebCore::MediaConstraint::isInt):
(WebCore::MediaConstraint::isDouble):
(WebCore::MediaConstraint::isBoolean):
(WebCore::MediaConstraint::isString):
(WebCore::MediaConstraint::dataType):
(WebCore::MediaConstraint::constraintType):
(WebCore::NumericConstraint::getMin):
(WebCore::NumericConstraint::getMax):
(WebCore::NumericConstraint::getExact):
(WebCore::NumericConstraint::getIdeal):
(WebCore::NumericConstraint::fitnessDistance):
(WebCore::NumericConstraint::validForRange):
(WebCore::NumericConstraint::find):
(WebCore::NumericConstraint::NumericConstraint):
(WebCore::NumericConstraint::innerMerge):
(WebCore::FlattenedConstraint::isEmpty):
(WebCore::FlattenedConstraint::iterator::iterator):
(WebCore::FlattenedConstraint::iterator::operator*):
(WebCore::FlattenedConstraint::iterator::operator++):
(WebCore::FlattenedConstraint::iterator::operator==):
(WebCore::FlattenedConstraint::iterator::operator!=):
(WebCore::FlattenedConstraint::begin):
(WebCore::FlattenedConstraint::end):
(WebCore::FlattenedConstraint::ConstraintHolder::create):
(WebCore::FlattenedConstraint::ConstraintHolder::~ConstraintHolder):
(WebCore::FlattenedConstraint::ConstraintHolder::constraint):
(WebCore::FlattenedConstraint::ConstraintHolder::dataType):
(WebCore::FlattenedConstraint::ConstraintHolder::constraintType):
(WebCore::FlattenedConstraint::ConstraintHolder::ConstraintHolder):
(WebCore::MediaConstraint::getMin): Deleted.
(WebCore::MediaConstraint::getMax): Deleted.
(WebCore::MediaConstraint::getExact): Deleted.
(WebCore::MediaConstraint::getIdeal): Deleted.
(WebCore::MediaConstraint::validForRange): Deleted.
(WebCore::MediaConstraint::find): Deleted.
(WebCore::MediaConstraint::fitnessDistance): Deleted.
(WebCore::MediaConstraint::type): Deleted.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance): Use downcast<>.
(WebCore::applyNumericConstraint):
(WebCore::RealtimeMediaSource::applyConstraint): Ditto.
(WebCore::RealtimeMediaSource::selectSettings): Ditto. Use constraints.mandatoryConstraints.filter
instead of direct enumeration.
(WebCore::RealtimeMediaSource::applyConstraints):
(WebCore::RealtimeMediaSource::setSampleRate): Sample rate is an int, not a double.
(WebCore::RealtimeMediaSource::setSampleSize): Sample size is also an int.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use downcast<>.
* platform/mock/MediaConstraintsMock.cpp:
(WebCore::isIntMediaConstraintSatisfiable): Use downcast<>.
(WebCore::isDoubleMediaConstraintSatisfiable): Ditto.
(WebCore::isBooleanMediaConstraintSatisfiable): Ditto.
(WebCore::isStringMediaConstraintSatisfiable):
(WebCore::isSatisfiable):
(WebCore::MediaConstraintsMock::verifyConstraints): Use constraints.mandatoryConstraints.filter
instead of direct enumeration.
* platform/mock/MediaConstraintsMock.h:
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Some Now Playing behavior is broken after r206315
https://bugs.webkit.org/show_bug.cgi?id=162625
<rdar://problem/28496755>
Reviewed by Jer Noble.
Reverts the part of our heuristic that disables Now Playing in active tabs in the main window.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::pageAllowsNowPlayingControls):
* page/Page.cpp:
(WebCore::Page::setViewState):
2016-09-27 Ryan Haddad <ryanhaddad@apple.com>
Remove an unneeded assert in InspectorOverlay.cpp
https://bugs.webkit.org/show_bug.cgi?id=162581
Reviewed by Alexey Proskuryakov.
This assertion was added to catch unknown issues, but it is firing frequently enough on certain Inspector
tests that it is causing more harm than good.
* inspector/InspectorOverlay.cpp:
(WebCore::buildQuadObjectForCSSRegionContentClip):
(WebCore::evaluateCommandInOverlay):
2016-09-27 Jer Noble <jer.noble@apple.com>
Remove deprecated ENCRYPTED_MEDIA implementation.
https://bugs.webkit.org/show_bug.cgi?id=161010
Reviewed by Eric Carlson.
Remove all references to the deprecated ENABLE_ENCRYPTED_MEDIA (leaving in place
the soon-to-be deprecated ENABLE_ENCRYPTED_MEDIA_V2).
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOMHTMLMediaElement.h:
* bindings/objc/DOMHTMLMediaElement.mm:
(-[DOMHTMLMediaElement canPlayType:]):
(-[DOMHTMLMediaElement canPlayType:keySystem:]): Deleted.
* bindings/js/JSDictionary.cpp:
* bindings/js/JSDictionary.h:
* dom/Element.idl:
* dom/EventNames.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::exceptionCodeForMediaKeyException): Deleted.
(WebCore::HTMLMediaElement::canPlayType): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyAdded): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyError): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyMessage): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaError.h:
* html/MediaError.idl:
* html/MediaKeyError.h:
* html/MediaKeyError.idl:
* html/MediaKeyEvent.cpp: Removed.
(WebCore::MediaKeyEvent::MediaKeyEvent): Deleted.
(WebCore::MediaKeyEvent::~MediaKeyEvent): Deleted.
(WebCore::MediaKeyEvent::eventInterface): Deleted.
* html/MediaKeyEvent.h: Removed.
* html/MediaKeyEvent.idl: Removed.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::nextBestMediaEngine):
(WebCore::MediaPlayer::generateKeyRequest): Deleted.
(WebCore::MediaPlayer::addKey): Deleted.
(WebCore::MediaPlayer::cancelKeyRequest): Deleted.
(WebCore::MediaPlayer::keyAdded): Deleted.
(WebCore::MediaPlayer::keyError): Deleted.
(WebCore::MediaPlayer::keyMessage): Deleted.
(WebCore::MediaPlayer::keyNeeded): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerKeyAdded): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyError): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyMessage): Deleted.
(WebCore::MediaPlayerClient::mediaPlayerKeyNeeded): Deleted.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::addKey): Deleted.
(WebCore::MediaPlayerPrivateInterface::generateKeyRequest): Deleted.
(WebCore::MediaPlayerPrivateInterface::cancelKeyRequest): Deleted.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::generateKeyRequest): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::addKey): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelKeyRequest): Deleted.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::supportsType): Deleted.
* testing/MockCDM.h:
2016-09-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Use Ref<const T> in FetchBody::m_data variant
https://bugs.webkit.org/show_bug.cgi?id=162599
Reviewed by Alex Christensen.
Covered by existing tests.
Using Ref<const T> for all variants of m_data except for FormData since FetchBody is actually creating it and may modifiy it.
Updating blob loading code path to use a const Blob& instead of a Blob&.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::extract):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadBlob):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchLoader.h:
2016-09-27 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed typo fix
* platform/gtk/UserAgentGtk.cpp:
(WebCore::standardUserAgent):
2016-09-27 Youenn Fablet <youenn@apple.com>
Clean-up CachedImage constructor
https://bugs.webkit.org/show_bug.cgi?id=162601
Reviewed by Sam Weinig.
No change of behavior.
Removing an unused constructor.
Specializing one constructor for manually cached images.
Cleaning initialization of some CachedImage fields.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
2016-09-27 Michael Catanzaro <mcatanzaro@igalia.com>
[FreeType] Add comment further justifying use of FT_LOAD_FORCE_AUTOHINT
https://bugs.webkit.org/show_bug.cgi?id=162607
Reviewed by Martin Robinson.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
2016-09-27 Mario Sanchez Prada <mario@endlessm.com>
Build fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
https://bugs.webkit.org/show_bug.cgi?id=162606
Reviewed by Gustavo Noronha Silva.
Use the right check to retrieve the right instance of GstGLDisplay
depending on whether we're using GLX or EGL, not X11 or Wayland.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2016-09-27 Youenn Fablet <youenn@apple.com>
[GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
https://bugs.webkit.org/show_bug.cgi?id=162547
Reviewed by Michael Catanzaro.
Covered by existing tests.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession): Setting the underlying soupSession.
2016-09-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Remove ReadableStreamSource firstReadCallback
https://bugs.webkit.org/show_bug.cgi?id=162339
Reviewed by Sam Weinig.
No observable change of behavior.
Removing ReadableStreamSource firstReadCallback.
This makes the enqueuing of data to happen when the stream is created.
In the future, we may want to implement doPull() to enqueue data when stream actually needs it.
* Modules/fetch/FetchResponseSource.cpp:
(WebCore::FetchResponseSource::doPull): Introduced as we introduce pull() in ReadableStreamSource.
* Modules/fetch/FetchResponseSource.h:
* Modules/streams/ReadableStreamInternals.js:
(readFromReadableStreamDefaultReader): Removing firstReadCallback use.
* Modules/streams/ReadableStreamSource.h: Renaming m_startPromise in m_promise since m_promise may store start and pull promises.
(WebCore::ReadableStreamSource::isStarting):
(WebCore::ReadableStreamSource::start):
(WebCore::ReadableStreamSource::pull): Introduced to support ReadableStreamSource pulling.
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished): Ditto.
(WebCore::ReadableStreamSource::clean):
* Modules/streams/ReadableStreamSource.idl: Ditto.
* bindings/js/JSReadableStreamSourceCustom.cpp: Refactoring to use callPromiseFunction
(WebCore::startReadableStream):
(WebCore::JSReadableStreamSource::start):
(WebCore::pullReadableStream): Introduced to support ReadableStreamSource pulling.
(WebCore::JSReadableStreamSource::pull): Ditto.
* bindings/js/WebCoreBuiltinNames.h: Removing firstReadCallback
2016-09-27 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r205883): Letterpressed text is invisible
https://bugs.webkit.org/show_bug.cgi?id=162590
<rdar://problem/28141512>
Reviewed by Simon Fraser.
r205883 removed the last place where we use CGFonts directly in WebKit. However,
our letterpress code is sensitive to the current state of the CGContext.
Tests: fast/text/letterpress-different.html
fast/text/letterpress-paint.html
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
2016-09-27 Youenn Fablet <youenn@apple.com>
[Fetch API] Refactor FetchBody to use std::experimental::variant
https://bugs.webkit.org/show_bug.cgi?id=162559
Reviewed by Alex Christensen.
Covered by exiting tests.
Using variant to represent the variant data types.
Adding nullptr as a specific type for default empty values and to allow clean-up.
Adding FetchBody::clone as the default copy constructor is deleted with this change.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::consumeArrayBuffer):
(WebCore::FetchBody::consumeArrayBufferView):
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::consumeBlob):
(WebCore::FetchBody::extractFromText):
(WebCore::FetchBody::bodyForInternalRequest):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::formDataBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
(WebCore::FetchBody::textBody):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::cloneForJS):
2016-09-26 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix debug build break since r204205. Unreviewed
https://bugs.webkit.org/show_bug.cgi?id=162596
No new tests, no new behaviours.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndex):
2016-09-26 Wenson Hsieh <wenson_hsieh@apple.com>
If you play a youtube video from now playing after it finished in Safari, controls disappear
https://bugs.webkit.org/show_bug.cgi?id=162589
<rdar://problem/28484047>
Reviewed by Jer Noble.
Tweaks the main content heuristic slightly to remove the "mostly in mainframe" requirement in the case of Now
Playing. This was added in the case of the controls manager as an additional way to identify video elements that
should not show controls, since we relax audio and video constraints for showing videos in the controls manager,
so that a video element is prevented from showing controls on grounds of lacking audio only if it has never had
audio before. In the case of Now Playing, we have stricter requirements for videos, which must have audio, which
makes the mainframe heuristic not necessary.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
2016-09-26 Antti Koivisto <antti@apple.com>
Setter on style element's textContent or cssText doesn't trigger style recalc
https://bugs.webkit.org/show_bug.cgi?id=160331
<rdar://problem/27609715>
Reviewed by Ryosuke Niwa and Daniel Bates.
We would not notify the parent when text node content changed in a shadow tree.
Test: fast/shadow-dom/shadow-style-text-mutation.html
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
Invalidate shadow root children instead of the root itself when doing full invalidation.
The invalidity bits have no meaning for non-element, non-texts.
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
(WebCore::CharacterData::notifyParentAfterChange):
Add a helper and call it also in shadow trees.
(WebCore::CharacterData::dispatchModifiedEvent):
* dom/CharacterData.h:
2016-09-26 Antti Koivisto <antti@apple.com>
Input elements don't work inside shadow tree
https://bugs.webkit.org/show_bug.cgi?id=160427
Reviewed by Darin Adler.
There is a bug in ComposedTreeIterator. If the iterator is initialized with an initial state where the root
is inside a shadow tree it won't iterate into slots.
If an input element is in a shadow tree it generates narrowly scoped style updates. When RenderTreeUpdater
applies such an update the update root will be inside the shadow tree and the bug will prevent the render tree
for slotted content from updating.
Added tests for both the iterator behavior and the specific symptom with input elements.
Tests: fast/shadow-dom/composed-tree-shadow-child-subtree.html
fast/shadow-dom/input-element-in-shadow.html
* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::ComposedTreeIterator):
Check and cache if the root is inside shadow tree.
(WebCore::ComposedTreeIterator::traverseNextInShadowTree):
* dom/ComposedTreeIterator.h:
(WebCore::ComposedTreeIterator::traverseNext):
If it is, always use the shadow traversal code path.
2016-09-26 Wenson Hsieh <wenson_hsieh@apple.com>
Seeking video doesn't update seek position
https://bugs.webkit.org/show_bug.cgi?id=162575
<rdar://problem/28457219>
Reviewed by Jer Noble.
On ToT, seeking in a video causes the playhead to stutter, and does not actually update media remote's seek
position. This is partly due to how we do not update media remote with new information when beginning to respond
to remote seek commands, so media remote continues to think that a playing video is still playing despite the
user attempting to seek through it.
To fix this, we introduce timer-based guards around remote seek commands, such that a seek "gesture" begins when
we receive the first seek command and ends when no seek command has been received in a set amount of time (this
is 0.5 seconds, which is approximately what other clients around the platform use).
Also, when responding to a remote seek, perform the seek with no tolerance. This prevents the playhead from
stuttering at the end of a seek from the final requested destination of the seek to the last actually seeked
time in the video.
When beginning to seek, we must pause the media. Through existing mechanisms, this causes the media session
manager to update its Now Playing information, which informs media remote that we are no longer playing and
prevents us from stuttering. However, when ending a seek, we must also trigger an additional update to again
refresh media remote's view of the current time. This prevents a flicker when playing media after seeking.
Unit tests to be added in a follow-up due to time constraints.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
(WebCore::HTMLMediaElement::seekToPlaybackPositionEndedTimerFired):
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
* html/HTMLMediaElement.h:
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo):
(WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing):
(WebCore::PlatformMediaSessionManager::sessions): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
(WebCore::MediaSessionManagerMac::scheduleUpdateNowPlayingInfo):
(WebCore::MediaSessionManagerMac::sessionDidEndRemoteScrubbing):
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2016-09-26 Chris Dumez <cdumez@apple.com>
[WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
https://bugs.webkit.org/show_bug.cgi?id=162568
Reviewed by Alex Christensen.
Update BlobResourceHandle to wait for continueDidReceiveResponse() to be
called after it calls the client's didReceiveResponseAsync(), before
actually reading the Blob Data.
No new tests, covered by existing tests.
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::continueDidReceiveResponse):
(WebCore::BlobResourceHandle::getSizeForNext):
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
2016-09-26 Daniel Bates <dabates@apple.com>
Mark Ping{Handle, Load} as final
https://bugs.webkit.org/show_bug.cgi?id=162576
Reviewed by Alex Christensen.
We should not support subclassing of a ping handle or overriding its ResourceHandleClient
callbacks because there are security/privacy implications with a ping request. We should
not encourage subclassing without careful consideration.
* platform/network/PingHandle.h:
2016-09-26 Daniel Bates <dabates@apple.com>
Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
https://bugs.webkit.org/show_bug.cgi?id=162365
Reviewed by Simon Fraser.
Repurpose the feature name TEXT_AUTOSIZING for the ENABLE(IOS_TEXT_AUTOSIZING)-guarded code
as this code represents WebKit's automatic text size adjustment machinery and is compiled
on both macOS and iOS.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/StyleBuilderCustom.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::updateFont):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserMode.h:
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
* dom/Document.h:
* editing/EditingStyle.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
* page/Settings.in:
* platform/graphics/FontCascade.h:
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::RenderBlockFlow):
* rendering/RenderBlockFlow.h:
* rendering/RenderElement.cpp:
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::RenderText):
* rendering/RenderText.h:
* rendering/TextAutoSizing.cpp:
* rendering/TextAutoSizing.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/RenderStyle.h:
* rendering/style/StyleInheritedData.cpp:
(WebCore::StyleInheritedData::StyleInheritedData):
(WebCore::StyleInheritedData::operator==):
* rendering/style/StyleInheritedData.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/TextSizeAdjustment.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setTextAutosizingEnabled):
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
* testing/InternalSettings.h:
2016-09-26 Nan Wang <n_wang@apple.com>
AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162573
Reviewed by Chris Fleizach.
Exposed the label element's text as the AXTitle of the progress indicator.
Test: accessibility/mac/progress-with-label-element.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):
2016-09-26 Ryan Haddad <ryanhaddad@apple.com>
Rebaseline bindings tests after r206386.
Unreviewed test gardening.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2016-09-26 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: m_origin || m_type == CachedResource::MainResource
https://bugs.webkit.org/show_bug.cgi?id=162472
<rdar://problem/28431522>
Reviewed by Chris Dumez.
Covered by existing tests.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage): Fixing the last CachedImage constructor.
Using CachedResource protected constructor.
* loader/cache/CachedResource.h: Small clean-up.
2016-09-26 Youenn Fablet <youenn@apple.com>
[GTK][EFL] imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html is failing
https://bugs.webkit.org/show_bug.cgi?id=162547
Reviewed by Carlos Garcia Campos.
Covered by LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html now passing.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession): Setting a default Accept-Language value.
2016-09-26 Mark Lam <mark.lam@apple.com>
Added RETURN_IF_EXCEPTION() macro and use it for exception checks.
https://bugs.webkit.org/show_bug.cgi?id=162521
Reviewed by Saam Barati.
No new tests because this patch is mostly refactoring. The only change in
behavior is that functions that have a JSValue return type will now return the
empty JSValue when an exception is thrown. I tested this behavior by running
the existing JSC and layout tests.
* bindings/js/ArrayValue.cpp:
(WebCore::ArrayValue::get):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createAesCbcParams):
(WebCore::createAesKeyGenParams):
(WebCore::createHmacKeyParams):
(WebCore::createRsaKeyGenParams):
(WebCore::createRsaOaepParams):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getStringFromJSON):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
(WebCore::JSCustomElementRegistry::define):
(WebCore::whenDefinedPromise):
* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToUSVString):
(WebCore::hasIteratorMethod):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt32EnforceRange):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):
* bindings/js/JSDOMBinding.h:
(WebCore::toJSSequence):
(WebCore::toJS):
(WebCore::jsFrozenArray):
* bindings/js/JSDOMPromise.cpp:
(WebCore::rejectPromiseWithExceptionIfAny):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::readAccelerationArgument):
(WebCore::readRotationRateArgument):
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::tryGetProperty):
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::tryGetPropertyAndResult):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/JSNodeOrString.cpp:
(WebCore::toNodeOrStringVector):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::convertToSpecifiedUnits):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::getOwnPropertyNames):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getExtension):
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContextBase::getParameter):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::toVector):
(WebCore::dataFunctionf):
(WebCore::dataFunctionMatrix):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::importKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::exportKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
(WebCore::JSWorkerGlobalScope::setTimeout):
(WebCore::JSWorkerGlobalScope::setInterval):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
-Wtautological-compare triggered in URLParser::internalValuesConsistent
https://bugs.webkit.org/show_bug.cgi?id=162551
Reviewed by Alex Christensen.
Fix logic error.
* platform/URLParser.cpp:
(WebCore::URLParser::internalValuesConsistent):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
Add CairoUniquePtr and use it in FontPlatformDataFreetype.cpp
https://bugs.webkit.org/show_bug.cgi?id=162557
Reviewed by Alex Christensen.
* platform/graphics/cairo/CairoUniquePtr.h: Added.
(WebCore::CairoPtrDeleter<cairo_font_options_t>::operator()):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::getDefaultCairoFontOptions): Return a smart pointer.
(WebCore::FontPlatformData::buildScaledFont): Use smart pointer.
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
Silence unused parameter warnings from Geoclue2Interface.c
https://bugs.webkit.org/show_bug.cgi?id=162545
Reviewed by Carlos Garcia Campos.
* PlatformGTK.cmake:
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
std::unique_ptr deleter functions should not check if pointer is null
https://bugs.webkit.org/show_bug.cgi?id=162558
Reviewed by Alex Christensen.
std::unique_ptr already does this before calling the deleter.
* platform/graphics/x11/XUniquePtr.h:
(WebCore::XPtrDeleter::operator()):
(WebCore::XPtrDeleter<XImage>::operator()):
(WebCore::XPtrDeleter<_XGC>::operator()):
(WebCore::XPtrDeleter<__GLXcontextRec>::operator()):
2016-09-26 Per Arne Vollan <pvollan@apple.com>
[Win][Debug] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=162550
Reviewed by Alex Christensen.
Windows headers need the FragmentForwardIterator '==' operator in debug mode.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator==):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Unnecessary extern functions in FontPlatformDataFreeType.cpp
https://bugs.webkit.org/show_bug.cgi?id=162555
Reviewed by Carlos Garcia Campos.
These functions should be file-static.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::convertFontConfigSubpixelOrder):
(WebCore::convertFontConfigHintStyle):
(WebCore::setCairoFontOptionsFromFontConfigPattern):
== Rolled over to ChangeLog-2016-09-26 ==