blob: 667f578fb4d7c36c8d293fafc868fd4c505e32da [file] [log] [blame]
2018-11-29 Youenn Fablet <youenn@apple.com>
A sender created through addTransceiver and populated using addTrack should have its source set
https://bugs.webkit.org/show_bug.cgi?id=192136
Reviewed by Eric Carlson.
In case libwebrtc backend is already created, we need to make sure to
set the track source to the libwebrtc sender backend that is actually
tied to the sender.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2018-11-29 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Not currenlty testable
DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-29 Sihui Liu <sihui_liu@apple.com>
IndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store
https://bugs.webkit.org/show_bug.cgi?id=185869
<rdar://problem/40453623>
Reviewed by Geoffrey Garen.
lexicalGlobalObject is casted to JSDOMGlobalObject in CloneSerializer::dumpArrayBufferView,
so we should use JSDOMGlobalObject instead of JSGlobalObject in IDB database thread.
Covered by modified test: storage/indexeddb/objectstore-autoincrement.html
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::create):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWrapper.cpp:
(WebCore::JSDOMObject::JSDOMObject):
2018-11-29 Sihui Liu <sihui_liu@apple.com>
Unexpected constructor / instanceof behavior when retrieving indexedDB data in an iframe
https://bugs.webkit.org/show_bug.cgi?id=185906
<rdar://problem/40583100>
Reviewed by Geoffrey Garen.
ScriptExecutionContext::execState() returned state of main frame, so deserialization of
IDBValue in iframe used constructors of main frame, which is wrong.
Test: storage/indexeddb/instanceof-iframe.html
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::execState):
2018-11-29 Don Olmstead <don.olmstead@sony.com>
Make generic ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=192128
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used
by other implementations. Fixed some compilation issues around using
this as a default implementation.
Removing ScrollAnimatorSmooth since it is dead code and doesn't even
compile at this time.
Fixing a compilation issue within LowPowerModeNotifierGLib
implementation that appeared due to unified sources changes.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/LowPowerModeNotifier.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::swipeVelocity const):
* platform/ScrollAnimatorSmooth.cpp: Removed.
* platform/ScrollAnimatorSmooth.h: Removed.
* platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp.
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric):
(WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation):
(WebCore::ScrollAnimatorGeneric::scroll):
(WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorGeneric::computeVelocity):
(WebCore::ScrollAnimatorGeneric::handleWheelEvent):
(WebCore::ScrollAnimatorGeneric::willEndLiveResize):
(WebCore::ScrollAnimatorGeneric::updatePosition):
(WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity):
(WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGeneric::showOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea):
(WebCore::ScrollAnimatorGeneric::mouseExitedContentArea):
(WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea):
(WebCore::ScrollAnimatorGeneric::contentAreaDidShow):
(WebCore::ScrollAnimatorGeneric::contentAreaDidHide):
(WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden):
* platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h.
* platform/glib/LowPowerModeNotifierGLib.cpp:
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::swipeVelocity const): Deleted.
2018-11-28 Dean Jackson <dino@apple.com>
[ES Modules] Allow .mjs content when loaded from file://
https://bugs.webkit.org/show_bug.cgi?id=192100
<rdar://problem/46320065>
Reviewed by Sam Weinig.
Node JS requires ES Module files to be identified by the file
extension of ".mjs" (no relation to Maciej Stachowiak). This new
extension causes issues because it isn't recognised as a JavaScript
file. When using the script tag, the author is able to force the type
of the referenced file using an attribute, but this isn't possible
for the import() function or import statement.
Add a new entry into our table that maps file extensions to MIME types
so that when a .mjs file is loaded from a file:// reference it is
identified as JavaScript.
Test: js/dom/modules/import-mjs-module.html
* platform/network/mac/WebCoreURLResponse.mm: Add .mjs to the existing dictionary.
(WebCore::createExtensionToMIMETypeMap):
* platform/network/ios/WebCoreURLResponseIOS.mm: Add code just for .mjs.
(WebCore::createExtensionToMIMETypeMap):
2018-11-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][Quirk] Width does not need stretching quirk.
https://bugs.webkit.org/show_bug.cgi?id=192135
Reviewed by Antti Koivisto.
In BFC the block box's width (auto) always streches to the content width of the containing block.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::needsStretching):
(WebCore::Layout::BlockFormattingContext::Quirks::isStretchedToInitialContainingBlock): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedWidth): Deleted.
2018-11-29 Zalan Bujtas <zalan@apple.com>
[LFC][Quirk] Move quirk functions to dedicated classes.
https://bugs.webkit.org/show_bug.cgi?id=192133
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::initialContainingBlock): Deleted.
(WebCore::Layout::isStretchedToInitialContainingBlock): Deleted.
(WebCore::Layout::stretchHeightToInitialContainingBlockQuirk): Deleted.
(WebCore::Layout::stretchWidthToInitialContainingBlock): Deleted.
* layout/blockformatting/BlockFormattingState.cpp:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
(WebCore::Layout::isQuirkContainer): Deleted.
(WebCore::Layout::hasMarginTopQuirkValue): Deleted.
(WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): Deleted.
(WebCore::Layout::isMarginTopCollapsedWithParent): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
* layout/inlineformatting/text/TextUtil.h:
2018-11-29 Rob Buis <rbuis@igalia.com>
Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=192076
Reviewed by Frédéric Wang.
Since we do an early return if the protocol is not http or ws, the if check
for ws protocol and else statement are not needed, so use an ASSERT instead.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
2018-11-29 Frederic Wang <fwang@igalia.com>
Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
https://bugs.webkit.org/show_bug.cgi?id=172914
Reviewed by Simon Fraser.
This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and
the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is
unchanged. In the future, this rect will be used for hit testing of subframes during
asynchronous macOS scrolling (but 172917).
No new tests, behavior unchanged.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):
2018-11-28 Wenson Hsieh <wenson_hsieh@apple.com>
[iOSMac] Dropping text selections from web content into editable elements crashes the web process
https://bugs.webkit.org/show_bug.cgi?id=192113
<rdar://problem/46323701>
Reviewed by Ryosuke Niwa.
In iOSMac, registering invalid UTIs on NSItemProvider when starting a drag or handling a drop does not work.
Since iOS writes and reads only "Apple Web Archive pasteboard type" (a.k.a. `WebArchivePboardType`) during drag
and drop as well as copy and paste, we fail to read or write any web archive data, and subsequently fall back to
reading RTF or flat RTFD, both of which are not supported in iOSMac, since UIFoundation links against the
system's macOS WebKit stack.
To fix this, we add support for reading and writing com.apple.webarchive (`kUTTypeWebArchive`) on iOS, so that
WebKit-based iOSMac applications can understand web archive data from the host running macOS, and the host can
also understand web archive data written by the iOSMac app. Additionally, don't allow reading RTF and flat RTFD
as web content in iOSMac. (Note that writing RTF and flat RTFD is still safe, since it does not depend on
UIFoundation.framework but rather `WebCore::HTMLConverter`).
Test: DragAndDropTests.ModernWebArchiveType
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment):
Additionally make sure that we never call into UIFoundation's NSAttributedString to markup conversion codepath
by making `createFragment` an empty stub on iOSMac.
* platform/ios/PasteboardIOS.mm:
(WebCore::supportedImageTypes):
(WebCore::isTypeAllowedByReadingPolicy):
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::Pasteboard::supportedWebContentPasteboardTypes):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
2018-11-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r238653 and r238656.
https://bugs.webkit.org/show_bug.cgi?id=192130
Breaks iOS build (Requested by smfr on #webkit).
Reverted changesets:
"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238653
"Attempt to fix the iOS build by only including RevealSPI.h
when it's needed."
https://trac.webkit.org/changeset/238656
2018-11-28 Simon Fraser <simon.fraser@apple.com>
Attempt to fix the iOS build by only including RevealSPI.h when it's needed.
* editing/cocoa/DictionaryLookup.mm:
2018-11-28 Alex Christensen <achristensen@webkit.org>
Modernize BlobRegistry::writeBlobsToTemporaryFiles
https://bugs.webkit.org/show_bug.cgi?id=192117
Reviewed by Dean Jackson.
No change in behavior. Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging
and manual completion handler management.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
* platform/network/BlobRegistryImpl.h:
2018-11-15 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Not currenlty testable
DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-28 Christopher Reid <chris.reid@sony.com>
SQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint: database table is locked" errors
https://bugs.webkit.org/show_bug.cgi?id=192111
Reviewed by Alex Christensen.
Ensure the journal_mode=WAL statement is finalized before wal_checkpoint is executed.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
2018-11-28 Said Abou-Hallawa <sabouhallawa@apple.com>
Updating href on linearGradient and radialGradient doesn't update its rendering
https://bugs.webkit.org/show_bug.cgi?id=191934
Reviewed by Ryosuke Niwa.
Mark the gradient renderer for repaint when the value of the 'href'
attribute changes.
Tests: fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html
fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html
svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html
svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged):
2018-11-28 Youenn Fablet <youenn@apple.com>
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html is flaky on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=192037
Reviewed by Eric Carlson.
The stats report JS map should be created when resolving the stats promise with WebCore RTCStatsReport.
But resolving the promise might fail in case of a page being suspended.
In that case, no JSRTCStatsReport is created and there is no backing map.
Update the code to reflect that.
Covered by existing test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h:
2018-11-28 Keith Rollin <krollin@apple.com>
Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192031
<rdar://problem/46286816>
Reviewed by Alex Christensen.
The Generate Derived Sources and Generate Unified Sources build phases
in Xcode need to have their inputs and outputs specified. This
specification will come in the form of .xcfilelist files that will be
attached to these build phases. There is one .xcfilelist file that
lists the input file and one that lists the output files. As part of
this work, the various generate-{derived,unified}-sources scripts that
are executed in these Generate build phases are modified to help in
the creation of these .xcfilelist files. In particular, they can now
be invoked with command-line parameters. These parameters are then
used to alter the normal execution of these scripts, causing them to
produce the .xcfilelist files as opposed to actually generating the
files that are listed in those files.
No new tests -- no changed functionality.
* Scripts/generate-derived-sources.sh:
* Scripts/generate-unified-sources.sh:
2018-11-28 Keith Rollin <krollin@apple.com>
Revert print_all_generated_files work in r238008; tighten up target specifications
https://bugs.webkit.org/show_bug.cgi?id=192025
<rdar://problem/46284301>
Reviewed by Alex Christensen.
In r238008, I added a facility for DerivedSources.make makefiles to
print out the list of files that they generate. This output was used
in the generation of .xcfilelist files used to specify the output of
the associated Generate Derived Sources build phases in Xcode. This
approach worked, but it meant that people would need to follow a
specific convention to keep this mechanism working.
Instead of continuing this approach, I'm going to implement a new
facility based on the output of `make` when passed the -d flag (which
prints dependency information). This new mechanism is completely
automatic and doesn't need maintainers to follow a convention. To that
end, remove most of the work performed in r238008 that supports the
print_all_generated_files target.
At the same time, it's important for the sets of targets and their
dependencies to be complete and correct. Therefore, also include
changes to bring those up-to-date. As part of that, you'll see
prevalent use of a particular technique. Here's an example:
BYTECODE_FILES = \
Bytecodes.h \
BytecodeIndices.h \
BytecodeStructs.h \
InitBytecodes.asm \
#
BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
all : $(BYTECODE_FILES)
$(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
...
These lines indicate a set of generated files (those specified in
BYTECODE_FILES). These files are generated by the BytecodeList.rb
tool. But, as opposed to the normal rule where a single foo.output is
generated by foo.input plus some additional dependencies, this rule
produces multiple output files from a tool whose connection to the
output files is not immediately clear. A special approach is needed
where a single rule produces multiple output files. The normal way to
implement this is to use an .INTERMEDIATE target. However, we used
this approach in the past and ran into a problem with it, addressing
it with an alternate approach in r210507. The above example shows this
approach. The .'s in the list of target files are replaced with %'s,
and the result is used as the left side of the dependency rule.
No new tests -- no changed functionality.
* DerivedSources.make:
2018-11-28 Alex Christensen <achristensen@webkit.org>
Remove dead code from an earlier attempt at implementing safe browsing
https://bugs.webkit.org/show_bug.cgi?id=192067
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): Deleted.
(WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadArchive):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:
* loader/ShouldSkipSafeBrowsingCheck.h: Removed.
2018-11-28 Alex Christensen <achristensen@webkit.org>
Add SessionIDs wherever BlobURLs are used in SerializedScriptValue
https://bugs.webkit.org/show_bug.cgi?id=192062
Reviewed by Dean Jackson.
Just adding infrastructure for fixing "the blob bug"
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
(WebCore::IDBDatabaseIdentifier::sessionID const):
(WebCore::IDBDatabaseIdentifier::encode const):
(WebCore::IDBDatabaseIdentifier::decode):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::setAsIsolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::sessionID const):
(WebCore::IDBValue::encode const):
(WebCore::IDBValue::decode):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::currentData):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::sessionID const):
2018-11-28 Justin Fan <justin_fan@apple.com>
[WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
https://bugs.webkit.org/show_bug.cgi?id=191990
Reviewed by Dean Jackson.
Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder.
Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing
a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass().
Test: webgpu/render-passes.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
(WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success.
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder.
* Modules/webgpu/WebGPURenderPassDescriptor.h:
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now.
* Modules/webgpu/WebGPURenderPassEncoder.cpp: Added.
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::passEncoder const):
* Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder.
* Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer.
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::WebGPUTextureView):
* Modules/webgpu/WebGPUTextureView.h:
(WebCore::WebGPUTextureView::texture):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::platformCommandBuffer const):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Added.
* platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder.
* platform/graphics/gpu/GPUTexture.h:
(WebCore::GPUTexture::platformTexture const):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added.
(WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails.
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception.
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
2018-11-28 Rob Buis <rbuis@igalia.com>
[XHR] Document.lastModified doesn't work for non-rendered documents
https://bugs.webkit.org/show_bug.cgi?id=179375
Reviewed by Alexey Proskuryakov.
Add setOverrideLastModified to override last modified date for
standalone Documents.
Behavior matches Firefox and Chrome.
Test: web-platform-tests/xhr/responsexml-document-properties.htm
* dom/Document.cpp:
(WebCore::Document::overrideLastModified):
(WebCore::Document::lastModified const): no need to test m_frame since that's already done in loader().
(WebCore::Document::lastModified): Deleted.
* dom/Document.h:
* xml/XMLHttpRequest.cpp:
2018-11-28 Yongjun Zhang <yongjun_zhang@apple.com>
Allow WebKit clients to specify a minimum effective width for layout.
https://bugs.webkit.org/show_bug.cgi?id=191499
<rdar://problem/45362678>
Reviewed by Wenson Hsieh.
If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
width. For clients that wish to lay out the content with a different width value, we would need to add a way
to specify the effective width for layout.
Tests: fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html
fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize): Add a new argument effectiveWidth.
(WebCore::ViewportConfiguration::nativeWebpageParameters): Make sure minimumScale for nativeWebpageParameters
is small enough so that it won't clamp out the initial scale. If content is wider than the viewport, this
ensures we can still zoom out the page.
(WebCore::ViewportConfiguration::updateConfiguration): update _minimumEffectiveDeviceWidth and apply that to
the layout size scale computation.
(WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor): A helper method to return the effective
layout scale factor which is also effected by _minimumEffectiveDeviceWidth.
(WebCore::ViewportConfiguration::updateMinimumLayoutSize): Update m_minimumLayoutSize based on effectiveLayoutSizeScaleFactor().
(WebCore::ViewportConfiguration::description const): Also dump m_minimumEffectiveDeviceWidth.
* page/ViewportConfiguration.h: Add a member variable m_minimumEffectiveDeviceWidth.
2018-11-28 Stephan Szabo <stephan.szabo@sony.com>
Make generic EventHandler methods
https://bugs.webkit.org/show_bug.cgi?id=192032
Reviewed by Michael Catanzaro.
No new tests. No new behavior.
Move mostly generic for non-Apple platform implementations
of methods from EventHandlerGlib into EventHandler. Two
of these also had different Windows implementations, so
to limit behavior change from this, those are currently
overridden for Windows as well as Mac and IOS.
* page/EventHandler.cpp:
(WebCore::EventHandler::passMousePressEventToSubframe):
(WebCore::EventHandler::passMouseReleaseEventToSubframe):
(WebCore::EventHandler::widgetDidHandleWheelEvent):
(WebCore::EventHandler::tabsToAllFormControls const):
(WebCore::EventHandler::passWidgetMouseDownEventToWidget):
(WebCore::EventHandler::passMouseDownEventToWidget):
(WebCore::EventHandler::focusDocumentView):
(WebCore::EventHandler::eventActivatedView const):
(WebCore::EventHandler::passMouseMoveEventToSubframe):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::passMouseMoveEventToSubframe):
(WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
(WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
(WebCore::EventHandler::tabsToAllFormControls const): Deleted.
(WebCore::EventHandler::focusDocumentView): Deleted.
(WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::accessKeyModifiers): Deleted.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Deleted.
(WebCore::EventHandler::focusDocumentView): Deleted.
(WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::passMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::eventActivatedView const): Deleted.
(WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
(WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseMoveEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
(WebCore::EventHandler::accessKeyModifiers): Deleted.
2018-11-28 Zalan Bujtas <zalan@apple.com>
[LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB.
https://bugs.webkit.org/show_bug.cgi?id=192078
Reviewed by Antti Koivisto.
This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining).
However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead.
* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::stretchHeightToInitialContainingBlock):
2018-11-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add support for quirk container's collapsing top margin in quirks mode.
https://bugs.webkit.org/show_bug.cgi?id=192070
Reviewed by Antti Koivisto.
In quirk mode when the top margin collapsing is computed for a quirk container (body, table cell) and the canditate margin value is
also a quirk value, we just ignore it.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isQuirkContainer):
(WebCore::Layout::hasMarginTopQuirkValue):
(WebCore::Layout::shouldIgnoreMarginTopInQuirkContext):
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isTableCell const):
2018-11-28 Ali Juma <ajuma@chromium.org>
Intersection Observer: rootMargin: '' gives weird results
https://bugs.webkit.org/show_bug.cgi?id=191975
Reviewed by Simon Fraser.
When converting the rootMargin string into a LengthBox, explicitly construct a Length
of size 0px for each dimension, instead of using Length's default constructor. The
default constructor creates a Length with value Auto, which causes us to incorrectly
apply a non-zero rootMargin.
Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html
* page/IntersectionObserver.cpp:
(WebCore::parseRootMargin):
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[WebRTC][GStreamer] Make sure to have the default microphone on the top of the list
https://bugs.webkit.org/show_bug.cgi?id=192026
Reviewed by Philippe Normand.
Otherwise we might end up picking a useless one in some applications
(not sure what those application do though).
GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::sortDevices):
(WebCore::GStreamerCaptureDeviceManager::addDevice):
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode
https://bugs.webkit.org/show_bug.cgi?id=192028
Reviewed by Philippe Normand.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::capabilities):
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAudioSource
https://bugs.webkit.org/show_bug.cgi?id=192027
Reviewed by Xabier Rodriguez-Calvar.
Cleaning up a bit the code.
It is a minor refactoring, no new test required.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Do not run device monitor for device type we do not handle
https://bugs.webkit.org/show_bug.cgi?id=191904
This is useless work and it throws warning about use GstDeviceMonitor without filters.
Reviewed by Philippe Normand.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
2018-11-27 Rob Buis <rbuis@igalia.com>
Block more ports (427, 548, 6697)
https://bugs.webkit.org/show_bug.cgi?id=186092
Reviewed by Frédéric Wang.
Block port 427, ports 548 and 6697 are aleady blocked and
are tested by the updated request-bad-port.html wpt test.
Behavior matches Firefox and Chrome.
Test: web-platform-tests/fetch/api/request/request-bad-port.html
* platform/URL.cpp:
(WebCore::portAllowed):
2018-11-27 Youenn Fablet <youenn@apple.com>
Log WebRTC stats in inspector console only when setting is verbose
https://bugs.webkit.org/show_bug.cgi?id=192014
Reviewed by Eric Carlson.
Add a WebRTCStats channel that is used by default to output WebRTC stats in console.
When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel,
so that they appear as debug information in Web Inspector.
No change of JS behavior.
Covered by manually testing what is logged in inspector and console.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* platform/Logging.h:
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Fix the mis-spelled "m_clienstWaitingForAsyncDecoding"
https://bugs.webkit.org/show_bug.cgi?id=192060
Reviewed by Wenson Hsieh.
Fix the mis-spelling of "m_clienstWaitingForAsyncDecoding".
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::createImage):
(WebCore::CachedImage::imageFrameAvailable):
* loader/cache/CachedImage.h:
2018-11-27 Mark Lam <mark.lam@apple.com>
ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
https://bugs.webkit.org/show_bug.cgi?id=192055
<rdar://problem/46288783>
Reviewed by Saam Barati.
No new tests needed. Removing an invalid configuration that is not used in WebCore.
* Configurations/FeatureDefines.xcconfig:
2018-11-27 Jiewen Tan <jiewen_tan@apple.com>
Remove kCCNotVerified
https://bugs.webkit.org/show_bug.cgi?id=192034
<rdar://problem/46235863>
Reviewed by Alexey Proskuryakov.
No change of behaviours.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::verifyRSASSA_PKCS1_v1_5):
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Avoid triggering compositing updates when only the root layer is composited
https://bugs.webkit.org/show_bug.cgi?id=191813
Reviewed by Zalan Bujtas.
If we know that the only composited layer is the root, we can avoid triggering deep
compositing updates sometimes, for example when layout changes size or position,
or when z-order lists change.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
flag to cut off descendants traversal when possible.
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-27 Eric Carlson <eric.carlson@apple.com>
Refactor duplicate code for calling into media controls
https://bugs.webkit.org/show_bug.cgi?id=192040
<rdar://problem/46278931>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setupAndCallJS):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::configureTextTrackDisplay):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::setControllerJSProperty):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLMediaElement.h:
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Momentum scrolling ends at the wrong place when a scrolling overflow element has a non-zero border
https://bugs.webkit.org/show_bug.cgi?id=191322
Reviewed by Dean Jackson.
The scrolling momentum logic in ScrollController::handleWheelEvent() which computes whether the scroll is pinned
to the end makes use of ScrollableArea::visibleContentRect(). RenderLayer's implementation of this was incorrect when
the layer's element had borders, causing the momentum scroll to stop early.
Fix by using the correct size (visible size, not layer size).
Test: fast/scrolling/momentum-scroll-with-borders.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::visibleContentRectInternal const):
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Composited and tiled layers fail to update on scrolling in WebView
https://bugs.webkit.org/show_bug.cgi?id=191821
rdar://problem/46009272
Reviewed by Zalan Bujtas.
We relied on AppKit calling -[NSView viewWillDraw] on scrolling to trigger compositing
layer flushes which are necessary to update backing store attachment, and tile coverage
for tiled layers. However, we no longer get these reliably in WebView, so explicitly trigger
flushes if necessary from FrameView::scrollOffsetChangedViaPlatformWidgetImpl().
didChangeVisibleRect() is the same code path used by iOS UIWebView for the same purpose.
Tests: compositing/backing/backing-store-attachment-scroll.html
compositing/tiling/tile-coverage-on-scroll.html
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateCoverage):
2018-11-27 Timothy Hatcher <timothy@apple.com>
Web Inspector: Add support for forcing color scheme appearance in DOM tree.
https://bugs.webkit.org/show_bug.cgi?id=191820
rdar://problem/46153172
Reviewed by Devin Rousso.
Test: inspector/css/force-page-appearance.html
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::defaultAppearanceDidChangeImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::defaultAppearanceDidChange):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::enable): Fire defaultAppearanceDidChange() on macOS Majave.
(WebCore::InspectorPageAgent::disable): Call setForcedAppearance() with empty string.
(WebCore::InspectorPageAgent::defaultAppearanceDidChange): Added.
(WebCore::InspectorPageAgent::setForcedAppearance): Added.
* inspector/agents/InspectorPageAgent.h:
* page/Page.cpp:
(WebCore::Page::setUseDarkAppearance): Call InspectorInstrumentation::defaultAppearanceDidChange().
(WebCore::Page::useDarkAppearance const): Return override value if not nullopt.
(WebCore::Page::setUseDarkAppearanceOverride): Added.
* page/Page.h:
(WebCore::Page::defaultUseDarkAppearance const): Added.
2018-11-27 Tim Horton <timothy_horton@apple.com>
Serialize and deserialize editable image strokes
https://bugs.webkit.org/show_bug.cgi?id=192002
<rdar://problem/30900149>
Reviewed by Dean Jackson.
Test: editing/images/paste-editable-image.html
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::didFinishInsertingNode):
(WebCore::HTMLImageElement::removedFromAncestor):
(WebCore::HTMLImageElement::hasEditableImageAttribute const):
(WebCore::HTMLImageElement::updateEditableImage):
Call updateEditableImage() from didFinishInsertingNode instead of insertedIntoAncestor.
This is helpful because it means we get the final, deduplicated attachment identifier
instead of the original one when cloning or pasting.
This also means that isConnected() is now always accurate when updateEditableImage()
is called, so we can remove the argument that allowed us to lie from inside insertedIntoAncestor.
* html/HTMLImageElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isEditableImage const):
Make use of hasEditableImage instead of separately checking for the attribute.
2018-11-16 Jiewen Tan <jiewen_tan@apple.com>
Disallow loading webarchives as iframes
https://bugs.webkit.org/show_bug.cgi?id=191728
<rdar://problem/45524528>
Reviewed by Youenn Fablet.
Disallow loading webarchives as iframes. We don't allow loading remote webarchives.
Now, this policy is hardened to disallow loading webarchives as iframes for local
documents as well.
To allow old tests still be able to run, a flag is added to always allow loading local
webarchives in document. The flag can be set via window.internals.
Tests: webarchive/loading/test-loading-archive-subresource.html
webarchive/loading/test-loading-top-archive.html
* dom/Document.h:
(WebCore::Document::setAlwaysAllowLocalWebarchive):
(WebCore::Document::alwaysAllowLocalWebarchive):
* loader/DocumentLoader.cpp:
(WebCore::disallowWebArchive):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::isRemoteWebArchive): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::setAlwaysAllowLocalWebarchive const):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-27 Jer Noble <jer.noble@apple.com>
Unregister CDMSessionMediaSourceAVFObjC for error notifications during destruction.
https://bugs.webkit.org/show_bug.cgi?id=191985
<rdar://problem/45972018>
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC):
2018-11-27 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Use LibWebRTC provided vp8 decoders and encoders
https://bugs.webkit.org/show_bug.cgi?id=191861
The GStreamer implementations are less feature full and less tested, now that Apple
also use the LibWebRTC provided implementations it makes a lot of sense for us to
do the same.
Basically everything related to temporal scalability is not implemented in GStreamer.
We should make sure to use GStreamer elements on low powered platforms and for
accelerated encoders and decoders.
Reviewed by Philippe Normand.
This is mostly refactoring, no new test required.
* platform/graphics/gstreamer/GStreamerCommon.h: Added GstMappedFrame similar to GstMappedBuffer but for video frames.
(WebCore::GstMappedFrame::GstMappedFrame):
(WebCore::GstMappedFrame::get):
(WebCore::GstMappedFrame::ComponentData):
(WebCore::GstMappedFrame::ComponentStride):
(WebCore::GstMappedFrame::info):
(WebCore::GstMappedFrame::width):
(WebCore::GstMappedFrame::height):
(WebCore::GstMappedFrame::format):
(WebCore::GstMappedFrame::~GstMappedFrame):
(WebCore::GstMappedFrame::operator bool const):
* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::GStreamerVideoFrameLibWebRTC::ToI420): Implemented support for converting frame formats with the GstVideoConverter API
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GstDecoderFactory):
(WebCore::GStreamerVideoDecoder::HasGstDecoder):
(WebCore::VP8Decoder::Create): Creates a `webrtc::LibvpxVp8Decoder()` if GStreamer decoder would be the LibVPX based one.
(WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_class_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Stop using vp8enc and use LibWebRTC based implementation
(WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Renamed H264Encoder to GStreamerH264Encoder to be more coherent with what is done in LibVPX
(WebCore::GStreamerVP8Encoder::GStreamerVP8Encoder): Renamed VP8Encoder to GStreamerVP8Encoder to be more coherent with what is done in LibVPX
(WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
(WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
2018-11-27 Javier Fernandez <jfernandez@igalia.com>
[css-grid] align-self center and position sticky don't work together
https://bugs.webkit.org/show_bug.cgi?id=191963
Reviewed by Manuel Rego Casasnovas.
This is a fix for a regression introduced in r515391, where we landed
the implementation of alignment for positioned objects in a Grid Layout
container.
We assumed that items with non-static positions shouldn't honor the
CSS Box Alignment properties. This is only true for out-of-flow items,
absolute or fixed positioned elements. However, sticky positioned
elements are treated as relative positioned items, but they indeed use
non-static position to define their behavior.
No new tests, this change is covered by current tests and make several cases to pass now.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForChild const):
(WebCore::RenderGrid::rowAxisPositionForChild const):
2018-11-26 Daniel Bates <dabates@apple.com>
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>
Reviewed by Dean Jackson.
Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.
Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html
fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.
2018-11-26 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238357.
One of the layout tests added with this change is failing on Mojave.
Reverted changeset:
"REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown"
https://bugs.webkit.org/show_bug.cgi?id=191969
https://trac.webkit.org/changeset/238513
2018-11-26 Tim Horton <timothy_horton@apple.com>
Insert <attachment> elements under editable images to make their backing data accessible
https://bugs.webkit.org/show_bug.cgi?id=191844
<rdar://problem/30900149>
Reviewed by Simon Fraser.
Test: editing/images/editable-image-creates-attachment.html
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::removedFromAncestor):
When the x-apple-editable-image attribute changes, or the element is
moved into or out of a document, call updateEditableImage.
(WebCore::HTMLImageElement::editableImageViewID const):
Adopt EditableImageReference.
(WebCore::HTMLImageElement::updateEditableImage):
When the image element moves into a document, the setting is on, and
the appropriate attribute is applied, add an <attachment> into the
shadow DOM, and inform the UI process both of the editable image's
creation and that it should be associated with the new attachment.
Use an EditableImageReference to extend the lifetime of the
corresponding editable image in the UI process, and to communicate
the attachment association.
If the element was cloned from another editable image element, use the
EditableImageReference and attachmentID from the original; the embedded
view will be re-parented under this element's layer, and the attachment
will be cloned (with a new ID) by editing code if the element is parented.
(WebCore::HTMLImageElement::attachmentIdentifier const):
(WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement):
Store the aforementioned bits of information when cloned so that we can
reconstitute the appropriate attachment data and embedded view.
* html/HTMLImageElement.h:
* page/ChromeClient.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/EditableImageReference.cpp: Added.
(WebCore::EditableImageReference::EditableImageReference):
(WebCore::EditableImageReference::~EditableImageReference):
(WebCore::EditableImageReference::associateWithAttachment):
* page/EditableImageReference.h: Added.
(WebCore::EditableImageReference::create):
(WebCore::EditableImageReference::embeddedViewID const):
Add EditableImageReference, which manages the lifetime of the UI-side
EditableImage and helps clients communicate about it. It is refcounted
so that cloned <img> elements can potentially borrow the UI-side state
(in the case where they end up getting parented).
* page/NavigatorBase.cpp:
Fix an unrelated unified build failure that I exposed.
2018-11-26 Jer Noble <jer.noble@apple.com>
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>
Reviewed by Alex Christensen.
Request the correct route policy and context from the VideoFullscreenModel.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
(VideoFullscreenInterfaceAVKit::doSetup):
2018-11-24 Ryosuke Niwa <rniwa@webkit.org>
SVG use element inside a shadow tree cannot reference an element in the same tree
https://bugs.webkit.org/show_bug.cgi?id=174977
<rdar://problem/33665636>
Reviewed by Zalan Bujtas.
Make fragment URL references used by SVGelements within a shadow tree to refer to other elements
in the same shadow tree. To do this, this patch makes targetElementFromIRIString take a TreeScope
instead of a Document, and updates its call sites.
This patch updates the most uses of targetElementFromIRIString except CSS cursor image, altGraph,
and glyphRef since the cursor image isn't really a SVG feature, and there aren't really real world
use cases in which altGraph and glyphRef are used within shadow trees.
Tests: fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html
fast/shadow-dom/svg-animate-href-in-shadow-tree.html
fast/shadow-dom/svg-feimage-href-in-shadow-tree.html
fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html
fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html
fast/shadow-dom/svg-mpath-href-in-shadow-tree.html
fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html
fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html
fast/shadow-dom/svg-text-path-href-in-shadow-tree.html
fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html
fast/shadow-dom/svg-thref-href-in-shadow-tree.html
fast/shadow-dom/svg-use-href-change-in-shadow-tree.html
fast/shadow-dom/svg-use-href-in-shadow-tree.html
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::targetForUseElement const):
* css/CSSCursorImageValue.cpp:
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::build):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::targetElementFromIRIString):
* svg/SVGURIReference.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree):
(WebCore::SVGUseElement::findTarget const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::insertedIntoAncestor):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
(WebCore::FEImage::createWithIRIReference):
(WebCore::FEImage::referencedRenderer const):
* svg/graphics/filters/SVGFEImage.h:
2018-11-26 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238357.
Casued three css tests to fail and crash on ios sim
Reverted changeset:
"Avoid triggering compositing updates when only the root layer
is composited"
https://bugs.webkit.org/show_bug.cgi?id=191813
https://trac.webkit.org/changeset/238357
2018-11-26 Daniel Bates <dabates@apple.com>
Caret disappears at end of password field when caps lock indicator is shown; password field
not scrolled when caps lock indicator is shown
https://bugs.webkit.org/show_bug.cgi?id=191164
<rdar://problem/45738179>
Reviewed by Dean Jackson.
Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on
Mac and iOS, respectively.
If there has not been a previous selection in a focused password field, including a caret
selection made by pressing the arrow keys, then we never scroll the password field to reveal
the current selection when the caps lock indicator is made visible. When the caps lock indicator
is made visible or hidden the size of the inner text renderer changes as it shrinks or expands
to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator,
respectively. We should detect such size changes and schedule an update and reveal of the current
selection after layout.
Test: fast/forms/password-scrolled-after-caps-lock-toggled.html
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current
selection reveal mode for the next update.
* editing/FrameSelection.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that
reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure
that the scheduled selection update scrolls to the reveal the current selection regardless of selection
reveal mode. This is necessary because typing into a password field does not change the current
selection reveal mode.
2018-11-26 Daniel Bates <dabates@apple.com>
Placeholder text is not repainted after caps lock indicator is hidden
https://bugs.webkit.org/show_bug.cgi?id=191968
<rdar://problem/46247234>
Reviewed by Zalan Bujtas.
Fixes an issue where the placeholder text in a password field is not repainted when the
caps lock indicator is hidden.
The placeholder renderer is special. It is an excluded child renderer and does not take
part in normal flow layout. It is also created and destroyed as needed. The caps lock
indicator is also special in that it is implemented as a RenderImage and we do not know
its dimensions before it is loaded and the load happens asynchronously. As a result we
detect when the inner text size changes and mark the placeholder as dirty as a way to
keep the dimensions of the placeholder in sync with the dimensions of the inner text.
Test: fast/repaint/placeholder-after-caps-lock-hidden.html
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Mark the placeholder as needing layout
the size of the inner text changes.
2018-11-26 Jeremy Jones <jeremyj@apple.com>
Picture-in-picture window size changes unnecesarily when URL changes.
https://bugs.webkit.org/show_bug.cgi?id=191787
Reviewed by Jer Noble.
When loading a new URL, the video dimensions are temporarily 0,0. Instead of
defaulting back to 4:3 sized pip window temporarily, keep the old dimensions until
there is a new valid size.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::videoDimensionsChanged):
2018-11-26 Andy Estes <aestes@apple.com>
[Cocoa] Make it easier to encode NSObjects
https://bugs.webkit.org/show_bug.cgi?id=191948
Reviewed by Dean Jackson.
* Modules/applepay/Payment.h: Changed the PKPayment * constructor to take a
RetainPtr<PKPayment>&& instead.
* Modules/applepay/PaymentContact.h: Ditto for PKContact.
* Modules/applepay/PaymentMerchantSession.h: Ditto for PKPaymentMerchantSession.
* Modules/applepay/PaymentMethod.h: Ditto for PKPaymentMethod.
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::Payment::Payment): Moved definition out-of-line.
(WebCore::Payment::pkPayment const): Ditto.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::PaymentContact::PaymentContact): Ditto.
(WebCore::PaymentContact::pkContact const): Ditto.
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::PaymentMethod::PaymentMethod): Ditto.
(WebCore::PaymentMethod::pkPaymentMethod const): Ditto.
2018-11-26 Daniel Bates <dabates@apple.com>
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>
Reviewed by Dean Jackson.
Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.
Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html
fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.
2018-11-26 Sam Weinig <sam@webkit.org>
Streamline ListHashSet use in floating object code
https://bugs.webkit.org/show_bug.cgi?id=191957
Reviewed by Alex Christensen.
Simplify use of ListHashSet by using new raw pointer overloads and
making use of reversed order of template arguments in the find() and
contains() overloads that take hash translators.
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObjects::remove):
Use raw pointer overloads of contains and remove. Remove seperate call
to find / check agains end() which is unnecessary as remove() already
does that.
* rendering/FloatingObjects.h:
(WebCore::FloatingObjectHashFunctions::hash):
(WebCore::FloatingObjectHashFunctions::equal):
(WebCore::FloatingObjectHashTranslator::hash):
(WebCore::FloatingObjectHashTranslator::equal):
Add hash()/equal() overloads for the raw pointer cases. As the FIXME
notes, this could be simplified by changing PtrHashBase to use designated
bottleneck functions for hash() and equal().
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::containsFloat const):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::removeFloatingObject):
(WebCore::RenderBlockFlow::hasOverhangingFloat):
(WebCore::RenderBlockFlow::addIntrudingFloats):
Use simplified calls.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
Use simplified calls.
2018-11-26 Jeremy Jones <jeremyj@apple.com>
Use Full Screen consistently in localizable strings.
https://bugs.webkit.org/show_bug.cgi?id=190363
rdar://problem/43882333
Reviewed by Jon Lee.
No new tests because only change is to localizable strings.
Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagEnterVideoFullscreen):
(WebCore::contextMenuItemTagExitVideoFullscreen):
(WebCore::localizedMediaControlElementHelpText):
2018-11-26 Brent Fulgham <bfulgham@apple.com>
[Win] Reduce the use of WKSI library calls: CoreAnimation
https://bugs.webkit.org/show_bug.cgi?id=191777
<rdar://problem/46140542>
Reviewed by Zalan Bujtas.
Update the Windows build of WebKit to refer to the SPI headers, rather than WebKitSystemInterface.
Move a small amount of glue code from WKSI to WebCore, and remove any includes or link
directives for WebKitSystemInterface.lib.
No new tests. No change in behavior.
* platform/graphics/BitmapImage.cpp:
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(layerTreeHostForLayer):
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/PathCG.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/win/WKCAImageQueue.cpp:
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Use float box's margin box to adjust the line constraints.
https://bugs.webkit.org/show_bug.cgi?id=191961
Reviewed by Antti Koivisto.
Test: fast/inline/inline-content-with-float-and-margin.html
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2018-11-26 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)
https://bugs.webkit.org/show_bug.cgi?id=150303
Reviewed by Michael Catanzaro.
Ensure gtk has been initialized before trying to get the default display.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
2018-11-26 Javier Fernandez <jfernandez@igalia.com>
[css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks
https://bugs.webkit.org/show_bug.cgi?id=191938
Reviewed by Manuel Rego Casasnovas.
The guttersSize function has a complex logic to compute the gaps in a
specific GridSpan, considering different scenarios of collapsed tracks
for such span.
The first case is avoiding the duplicated gap because of trailing
collapsed tracks.
The second case considered is looking for non-empty tracks before the
GridSpan end, if it points to an empty track, so we must add this gap.
The last case is to consider the gap of non-empty tracks after the
GridSpan end line, if it points to an empty track.
There are several cases that are not considered or incorrectly computed.
This patch addresses those cases; basically, we should only consider gaps
when there are non-empty tracks before and after the collapsed tracks.
Additionally, we should avoid duplicating the gaps size adding both,
before and after non-empty track's gap.
No new tests, this change is covered by current tests and make several cases to pass now.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::guttersSize const):
2018-11-26 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Fix grid container sizing under min-content height
https://bugs.webkit.org/show_bug.cgi?id=191889
Reviewed by Javier Fernandez.
The spec is quite clear
(https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
"min-content
If specified for the inline axis, use the min-content inline size;
otherwise behaves as the property’s initial value."
So if a grid container has "height: min-content" it should behave
the same than with "height: auto".
The patch removes computeIntrinsicLogicalContentHeightUsing() in
RenderGrid as we don't need a custom one anymore.
We can also get rid of m_minContentHeight and m_maxContentHeight
attributes that were only used for this logic.
Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
* rendering/RenderGrid.h:
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC] Remove PointInContainingBlock and PositionInContainingBlock
https://bugs.webkit.org/show_bug.cgi?id=191954
Reviewed by Antti Koivisto.
Use Point and Position instead. Points and positions are by default in the containing block's coordinate system.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/LayoutUnits.h:
(WebCore::Layout::Position::operator LayoutUnit const):
(WebCore::Layout::operator<):
(WebCore::Layout::operator==):
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::horizontalPositionCandidate):
(WebCore::Layout::FloatBox::verticalPositionCandidate):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::horizontalConstraints const):
(WebCore::Layout::FloatingPair::bottom const):
* layout/floats/FloatingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::bottom const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC] Rename Layout::Position to Layout::Point
https://bugs.webkit.org/show_bug.cgi?id=191950
Reviewed by Antti Koivisto.
It actually represents a point.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
(WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
* layout/FormattingContext.h:
* layout/LayoutUnits.h:
(WebCore::Layout::Point::Point):
(WebCore::Layout::Point::moveBy):
(WebCore::Layout::Position::operator LayoutPoint const): Deleted.
(WebCore::Layout::Position::Position): Deleted.
(WebCore::Layout::Position::moveBy): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC] Floating code should use typed positions (PositionInContextRoot).
https://bugs.webkit.org/show_bug.cgi?id=191949
Reviewed by Antti Koivisto.
Use PositionInContextRoot instead of LayoutUnit.
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):
2018-11-25 Zalan Bujtas <zalan@apple.com>
Fix build after r238472.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::textWidth const):
2018-11-25 Tim Horton <timothy_horton@apple.com>
Make it possible to insert editable images with a gesture
https://bugs.webkit.org/show_bug.cgi?id=191937
Reviewed by Wenson Hsieh.
Tests:
editing/images/redo-insert-editable-image-maintains-strokes.html,
editing/images/undo-insert-editable-image.html,
editing/images/basic-editable-image-from-execCommand.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/editing/EditorCommand.cpp:
* Source/WebCore/en.lproj/Localizable.strings:
* editing/EditAction.h:
* editing/Editor.cpp:
(WebCore::Editor::insertEditableImage):
* editing/Editor.h:
* editing/InsertEditableImageCommand.cpp: Added.
(WebCore::InsertEditableImageCommand::InsertEditableImageCommand):
(WebCore::InsertEditableImageCommand::doApply):
* editing/InsertEditableImageCommand.h: Added.
(WebCore::InsertEditableImageCommand::create):
* editing/VisibleSelection.cpp:
Add an editor command that inserts an editable image.
It will likely get a bit more complicated, but for now it just inserts
a 100% by 300px editable image.
2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
https://bugs.webkit.org/show_bug.cgi?id=191945
Reviewed by Anders Carlsson.
Run `update-webkit-localizable-strings`.
* en.lproj/Localizable.strings:
2018-11-24 Sam Weinig <sam@webkit.org>
Remove now unnecessary specialized ListHashSet from InlineItem.h
https://bugs.webkit.org/show_bug.cgi?id=191946
Reviewed by Zalan Bujtas.
Now that ListHashSet supports raw pointer overloads for smart pointers,
we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet
and ListHashSet::find calls.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItemHashFunctions::hash): Deleted.
(WebCore::Layout::InlineItemHashFunctions::equal): Deleted.
(WebCore::Layout::InlineItemHashTranslator::hash): Deleted.
(WebCore::Layout::InlineItemHashTranslator::equal): Deleted.
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::textWidth const):
2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Add WKWebView SPI to trigger and remove data detection
https://bugs.webkit.org/show_bug.cgi?id=191918
<rdar://problem/36185051>
Reviewed by Tim Horton.
Add a helper method on DataDetection to remove all data detected links in the given document. See WebKit changes
for more detail.
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::removeDataDetectedLinksInDocument):
2018-11-24 Andy Estes <aestes@apple.com>
[Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
https://bugs.webkit.org/show_bug.cgi?id=191899
Reviewed by Dean Jackson.
* editing/cocoa/DataDetection.mm:
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/graphics/cocoa/ColorCocoa.mm:
* platform/ios/PlatformScreenIOS.mm:
2018-11-23 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Enable Web Authentication as an experimental feature for macOS
https://bugs.webkit.org/show_bug.cgi?id=191932
rdar://problem/46225210
Reviewed by Brent Fulgham.
Add myself to the contact of Web Authentication.
* features.json:
2018-11-23 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSerialization
https://bugs.webkit.org/show_bug.cgi?id=191921
Reviewed by Dean Jackson.
The bug was caused by traverseNodesForSerialization not being able to traverse past the end of shadow root
when skipping children of a node for which enterNode returns false because it was using NodeTraversal's
nextSkippingChildren instead of a member function which supports traversing the composed tree.
Fixed the crash by using variant of nextSkippingChildren which knows how to traverse past the last node
in a shadow tree. Also added more assertions to help debug issues like this in the future.
Test: editing/pasteboard/copy-paste-across-shadow-boundaries-5.html
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2018-11-22 Ryosuke Niwa <rniwa@webkit.org>
Updating href on textPath doesn't update its rendering
https://bugs.webkit.org/show_bug.cgi?id=191920
Reviewed by Dean Jackson.
Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged
in addition to updating the pending resources.
Test: svg/text/textpath-reference-update.html
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged):
2018-11-23 Ross Kirsling <ross.kirsling@sony.com>
Introduce user-defined literal for LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=191915
Reviewed by Dean Jackson.
* platform/LayoutUnit.h:
Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function.
* layout/FormattingContextGeometry.cpp:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
* layout/inlineformatting/InlineLineBreaker.cpp:
* page/FrameView.cpp:
* page/FrameViewLayoutContext.h:
* page/Page.cpp:
* page/SpatialNavigation.h:
* platform/ScrollableArea.cpp:
* rendering/EllipsisBox.cpp:
* rendering/FlexibleBoxAlgorithm.cpp:
* rendering/FloatingObjects.cpp:
* rendering/GridLayoutFunctions.cpp:
* rendering/GridTrackSizingAlgorithm.cpp:
* rendering/InlineFlowBox.cpp:
* rendering/InlineTextBox.cpp:
* rendering/LayoutState.h:
* rendering/LogicalSelectionOffsetCaches.h:
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderElement.cpp:
* rendering/RenderFlexibleBox.cpp:
* rendering/RenderFlexibleBox.h:
* rendering/RenderFragmentContainer.cpp:
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderGrid.cpp:
* rendering/RenderGrid.h:
* rendering/RenderImage.cpp:
* rendering/RenderLayer.cpp:
* rendering/RenderListMarker.cpp:
* rendering/RenderMultiColumnFlow.cpp:
* rendering/RenderMultiColumnSet.cpp:
* rendering/RenderReplaced.cpp:
* rendering/RenderReplaced.h:
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
* rendering/RenderTable.h:
* rendering/RenderTableSection.cpp:
* rendering/RenderTheme.cpp:
* rendering/RenderTreeAsText.cpp:
* rendering/RenderView.cpp:
* rendering/RootInlineBox.h:
* rendering/SimpleLineLayout.cpp:
* rendering/SimpleLineLayoutPagination.cpp:
* rendering/TableLayout.h:
* rendering/line/BreakingContext.h:
* rendering/line/LineLayoutState.h:
* rendering/line/LineWidth.h:
* rendering/mathml/MathOperator.cpp:
* rendering/mathml/MathOperator.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFraction.cpp:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLMath.cpp:
* rendering/mathml/RenderMathMLMath.h:
* rendering/mathml/RenderMathMLMenclose.h:
* rendering/mathml/RenderMathMLOperator.cpp:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRoot.cpp:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.cpp:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/style/CollapsedBorderValue.h:
Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other
literal conversions that will be needed when making non-int LayoutUnit constructors explicit.
For good measure, also mark all default values for LayoutUnit parameters.
2018-11-23 Jim Mason <jmason@ibinx.com>
[GTK] Scrollbars not following gtk-primary-button-warps-slider setting
https://bugs.webkit.org/show_bug.cgi?id=191067
Updated code per the style guide, removed unreachable break (non-semantic change)
Reviewed by Michael Catanzaro.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com>
Enable drag and drop support for iOSMac
https://bugs.webkit.org/show_bug.cgi?id=191818
<rdar://problem/43907454>
Reviewed by Dean Jackson.
Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This
enables support for dragging links, text selections, and images, though many advanced features (e.g. custom
pasteboard data) will require additional support from the platform.
* Configurations/FeatureDefines.xcconfig:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
(-[WebItemProviderPasteboard numberOfFiles]):
Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider`
in iOSMac, since these are currently unimplemented.
2018-11-23 Zalan Butjas <zalan@apple.com>
[LFC][IFC] Add support for variable height runs.
https://bugs.webkit.org/show_bug.cgi?id=191925
Reviewed by Antti Koivisto.
https://www.w3.org/TR/CSS22/visudet.html#inline-box-height
10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements,
and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'.
The line box height is the distance between the uppermost box top and the lowermost box bottom.
The minimum height consists of a minimum height above the baseline and a minimum depth below it,
exactly as if each line box starts with a zero-width inline box with the element's font and line height properties.
We call that imaginary box a "strut." (The name is inspired by TeX.).
Test: fast/inline/inline-content-with-image-simple.html
* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingNonTextRuns):
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::logicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::logicalWidth const):
(WebCore::Layout::InlineRun::logicalHeight const):
(WebCore::Layout::InlineRun::setLogicalWidth):
(WebCore::Layout::InlineRun::width const): Deleted.
(WebCore::Layout::InlineRun::height const): Deleted.
(WebCore::Layout::InlineRun::setWidth): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
2018-11-23 Antti Koivisto <antti@apple.com>
UI side compositing doesn't paint on Mac
https://bugs.webkit.org/show_bug.cgi?id=191908
Reviewed by Tim Horton.
For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
(WebCore::IOSurface::format const):
(WebCore::operator<<):
2018-11-23 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Implement Baseline Alignment for grid items
https://bugs.webkit.org/show_bug.cgi?id=145566
Reviewed by Manuel Rego Casasnovas.
This patch impements the Baseline Self-Alignment feature for grid items according to
the CSS Box Alignment specification [1].
This new layout logic is handled by the Self-Alignment (justify-self and align-self)
and Default-Alignment (justify-items and align-items) CSS properties.
This feature allows users to align the grid items sharing a Baseline Alignment Context,
either row or column contexts, based on their respective baselines.
[1] https://drafts.csswg.org/css-align-3/#baseline-align-self
Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html
* Sources.txt:
* rendering/GridBaselineAlignment.cpp: Added.
(WebCore::GridBaselineAlignment::marginOverForChild const):
(WebCore::GridBaselineAlignment::marginUnderForChild const):
(WebCore::GridBaselineAlignment::logicalAscentForChild const):
(WebCore::GridBaselineAlignment::ascentForChild const):
(WebCore::GridBaselineAlignment::descentForChild const):
(WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
(WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
(WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
(WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
(WebCore::GridBaselineAlignment::baselineGroupForChild const):
(WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
(WebCore::GridBaselineAlignment::baselineOffsetForChild const):
(WebCore::GridBaselineAlignment::clear):
(WebCore::BaselineGroup::BaselineGroup):
(WebCore::BaselineGroup::update):
(WebCore::BaselineGroup::isOppositeBlockFlow const):
(WebCore::BaselineGroup::isOrthogonalBlockFlow const):
(WebCore::BaselineGroup::isCompatible const):
(WebCore::BaselineContext::BaselineContext):
(WebCore::BaselineContext::sharedGroup const):
(WebCore::BaselineContext::updateSharedGroup):
(WebCore::BaselineContext::findCompatibleSharedGroup):
* rendering/GridBaselineAlignment.h: Added.
(WebCore::BaselineGroup::maxAscent const):
(WebCore::BaselineGroup::maxDescent const):
(WebCore::BaselineGroup::size const):
(WebCore::isBaselinePosition):
(WebCore::GridBaselineAlignment::setBlockFlow):
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::gridAxisForDirection):
(WebCore::gridDirectionForAxis):
(WebCore::GridTrackSizingAlgorithm::availableSpace const):
(WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
(WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
(WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::synthesizedBaselineFromMarginBox):
(WebCore::RenderGrid::isBaselineAlignmentForChild const):
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::firstLineBaseline const):
(WebCore::RenderGrid::inlineBlockBaseline const):
(WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::columnAxisOffsetForChild const):
(WebCore::RenderGrid::rowAxisOffsetForChild const):
* rendering/RenderGrid.h:
2018-11-22 Wenson Hsieh <wenson_hsieh@apple.com>
Address post-review feedback after r238438
https://bugs.webkit.org/show_bug.cgi?id=191913
Reviewed by Ryosuke Niwa.
Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
`Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:
FrameSelection::ShouldCloseTyping { No, Yes }
Editor::SelectReplacement { No, Yes }
Editor::SmartReplace { No, Yes }
Editor::MatchStyle { No, Yes }
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):
* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::replaceSelectionWithText):
(WebCore::Editor::setComposition):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::insertAttachment):
At various call sites, replace boolean arguments with named enums.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity):
(WebCore::executeDeleteToMark):
(WebCore::executeSelectToMark):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectedRange):
* editing/FrameSelection.h:
* page/Page.cpp:
(WebCore::replaceRanges):
Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.
(WebCore::Page::replaceRangesWithText):
(WebCore::Page::replaceSelectionWithText):
* page/Page.h:
2018-11-21 Ryosuke Niwa <rniwa@webkit.org>
Modernize SVGURIReference::targetElementFromIRIString
https://bugs.webkit.org/show_bug.cgi?id=191898
Reviewed by Daniel Bates.
Made targetElementFromIRIString return an element and the fragment identifier,
and merged urlFromIRIStringWithFragmentIdentifier into it.
Also replaced the code computing the full URL using the base URL after removing
the fragment identifier and rejoining it later with a single call to completeURL.
No new tests since there should be no observable behavior change.
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::targetForUseElement const):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateCursorElement):
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget):
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::targetElementFromIRIString):
(WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted.
* svg/SVGURIReference.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::findTarget const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::referencedRenderer const):
2018-11-22 Dean Jackson <dino@apple.com>
Implement WebGPUQueue and device.getQueue()
https://bugs.webkit.org/show_bug.cgi?id=191911
<rdar://problem/46214871>
Reviewed by Antoine Quint.
Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue
instance if necessary. Also link WebGPUQueue to the existing
GPUQueue object, and expose the label IDL property.
This patch is based on some work from Justin Fan.
Test: webgpu/queue-creation.html
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
New files.
* Modules/webgpu/WebGPUCommandBuffer.h:
(WebCore::WebGPUCommandBuffer::commandBuffer const):
Expose a GPUCommandBuffer getter, used when submitting (even though
the actual GPU submission isn't implemented yet).
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::getQueue):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
Implement getQueue().
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
(WebCore::WebGPUQueue::WebGPUQueue):
(WebCore::WebGPUQueue::submit):
* Modules/webgpu/WebGPUQueue.h:
(WebCore::WebGPUQueue::label const):
(WebCore::WebGPUQueue::setLabel):
* Modules/webgpu/WebGPUQueue.idl:
New class. Mostly sends stuff onto GPUQueue.
* bindings/js/WebCoreBuiltinNames.h:
Add WebGPUQueue.
* platform/graphics/gpu/GPUQueue.h:
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::submit):
(WebCore::GPUQueue::label const):
(WebCore::GPUQueue::setLabel const):
"label" getter/setter that uses
the underlying MTLCommandQueue label property, but prefixes
it with a WebKit identifier, so it can be correctly
identified in system crash logs as coming from WebGPU.
2018-11-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls.
https://bugs.webkit.org/show_bug.cgi?id=191903
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Offset formatting context root runs with horizontal margins.
https://bugs.webkit.org/show_bug.cgi?id=191900
Reviewed by Antti Koivisto.
Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins.
(The test case has padding and border as well, but they are _inside_ the formatting context.)
Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-22 Simon Fraser <simon.fraser@apple.com>
Extremely small monospace text size when SVG is included as an img
https://bugs.webkit.org/show_bug.cgi?id=191834
Reviewed by Myles C. Maxfield.
Give defaultFixedFontSize a reasonable default value in Settings, so that clients
who omit to set it (like SVGImages) don't get broken rendering.
Test: svg/text/monospace-text-size-in-img.html
* page/Settings.yaml:
2018-11-22 Javier Fernandez <jfernandez@igalia.com>
Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
https://bugs.webkit.org/show_bug.cgi?id=191881
Reviewed by Manuel Rego Casasnovas.
We should use the font's descent value when wriring-mode flips line flow (vertical-lr).
This change also fixes bug 170175, since Flexbox use the same code to determine the first
line baseline of a flex item.
Test: fast/writing-mode/vertical-align-table-baseline-latin.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
2018-11-21 Ryosuke Niwa <rniwa@webkit.org>
Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener
https://bugs.webkit.org/show_bug.cgi?id=179990
Reviewed by Tim Horton.
The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange
to set and restore the selection putting the focus on the newly mouse-down'ed input element
and restoring the focus back to the input element which originally had the focus immediately.
Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here.
Also made TemporarySelectionOption an enum class.
Unfortunately, no new tests since force click testing is broken :( See <rdar://problem/31301721>.
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding
FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set.
* editing/Editor.h:
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus.
2018-11-21 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WebKit2] Add support for replacing find-in-page text matches
https://bugs.webkit.org/show_bug.cgi?id=191786
<rdar://problem/45813871>
Reviewed by Ryosuke Niwa.
Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a
new API test.
Tests: editing/find/find-and-replace-adjacent-words.html
editing/find/find-and-replace-at-editing-boundary.html
editing/find/find-and-replace-basic.html
editing/find/find-and-replace-in-subframes.html
editing/find/find-and-replace-no-matches.html
editing/find/find-and-replace-noneditable-matches.html
editing/find/find-and-replace-replacement-text-input-events.html
API test: WebKit.FindAndReplace
* page/Page.cpp:
(WebCore::replaceRanges):
(WebCore::Page::replaceRangesWithText):
Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map
each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable
root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the
map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain
that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from
clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement
ranges when performing each replacement.
Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same
frame, we compare their position in the document, and for nodes in different frames, we instead compare their
frames in frame tree traversal order.
We map Ranges to editing offsets and back when performing text replacement because each text replacement may
split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier
attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for
each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing
the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for
replacement.
(WebCore::Page::replaceSelectionWithText):
Add a helper method on Page to replace the current selection with some text. This simply calls out to
`Editor::replaceSelectionWithText`.
* page/Page.h:
2018-11-21 Andy Estes <aestes@apple.com>
[Cocoa] Create a soft-linking file for PassKit
https://bugs.webkit.org/show_bug.cgi?id=191875
<rdar://problem/46203215>
Reviewed by Myles Maxfield.
* Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
* Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto.
* SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm.
* WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target.
* rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC] LayoutState should always be initialized with the initial containing block.
https://bugs.webkit.org/show_bug.cgi?id=191896
Reviewed by Antti Koivisto.
There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB).
The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts
first need to be laid out (partially at least e.g margin) in their parent formatting context.
Having a non-null parent formatting context as root could lead to undefined behaviour.
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::initializeRoot): Deleted.
* layout/LayoutFormattingState.h:
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Horizontal margins should be considered as non-breakable space
https://bugs.webkit.org/show_bug.cgi?id=191894
Reviewed by Antti Koivisto.
Like padding and border, horizontal margins also force run breaks and offset them.
Test: fast/inline/inline-content-with-margin-left-right.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-20 Ryosuke Niwa <rniwa@webkit.org>
Mutation observers doesn't get notified of character data mutation made by the parser
https://bugs.webkit.org/show_bug.cgi?id=191874
Reviewed by Antti Koivisto.
Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver.
Test: fast/dom/MutationObserver/observe-parser-character-data-change.html
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
2018-11-21 Claudio Saavedra <csaavedra@igalia.com>
[SOUP] Follow-up robustness improvements to the certificate decoder
https://bugs.webkit.org/show_bug.cgi?id=191892
Reviewed by Michael Catanzaro.
If at any point the certificate fails to be constructed from
the DER data, bail out. Likewise, if the certificate returned
is NULL, return false from the decoder to notify the failure
to decode it.
* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::certificateFromCertificatesDataList):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Border should be considered as non-breakable space
https://bugs.webkit.org/show_bug.cgi?id=191891
Reviewed by Antti Koivisto.
Like padding, border also forces run breaks and offsets them.
Test: fast/inline/inline-content-with-border-left-right.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
https://bugs.webkit.org/show_bug.cgi?id=191890
Rearrange the comment numbers to match the logic below.
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2018-11-20 Dean Jackson <dino@apple.com>
Move WebGPU platform code to platform/graphics/gpu
https://bugs.webkit.org/show_bug.cgi?id=191867
<rdar://problem/46190993>
Reviewed by Antoine Quint.
The underlying implementation of WebGPU doesn't need to live in
Modules, since it technically could be used by other parts of the system. It
makes more sense for it to be in platform/graphics/gpu.
Move...
- Modules/webgpu/GPU* -> platform/graphics/gpu
- Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa
- platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/
- platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h.
* platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp.
(WebCore::GPUDevice::createShaderModule const):
(WebCore::GPUDevice::createRenderPipeline const):
(WebCore::GPUDevice::createCommandBuffer):
(WebCore::GPUDevice::getQueue):
* platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h.
(WebCore::GPUDevice::platformDevice const):
* platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h.
* platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h.
* platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h.
(WebCore::GPUQueue::platformQueue const):
* platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h.
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h.
* platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h.
(WebCore::GPUShaderModule::platformShaderModule const):
* platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h.
* platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h.
(WebCore::GPUSwapChain::platformLayer const):
* platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h.
* platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h.
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm.
(WebCore::GPUCommandBuffer::create):
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm.
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::GPUDevice):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm.
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::GPUQueue):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm.
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm.
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm.
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::setDevice):
(WebCore::platformTextureFormatForGPUTextureFormat):
(WebCore::GPUSwapChain::setFormat):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::getNextTexture):
(WebCore::GPUSwapChain::present):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm.
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::createDefaultTextureView):
* platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp.
(WebCore::GPULegacyBuffer::~GPULegacyBuffer):
(WebCore::GPULegacyBuffer::length const):
* platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h.
(WebCore::GPULegacyBuffer::contents const):
(WebCore::GPULegacyBuffer::metal const):
* platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp.
(WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer):
* platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h.
(WebCore::GPULegacyCommandBuffer::metal const):
* platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp.
(WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue):
* platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h.
(WebCore::GPULegacyCommandQueue::metal const):
* platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp.
(WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder):
* platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h.
* platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp.
(WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState):
* platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h.
(WebCore::GPULegacyComputePipelineState::metal const):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp.
(WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h.
(WebCore::GPULegacyDepthStencilDescriptor::metal const):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp.
(WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h.
(WebCore::GPULegacyDepthStencilState::metal const):
* platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp.
(WebCore::GPULegacyDevice::~GPULegacyDevice):
* platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h.
(WebCore::GPULegacyDevice::layer const):
(WebCore::GPULegacyDevice::metal const):
(WebCore::GPULegacyDevice::markLayerComposited const):
* platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp.
(WebCore::GPULegacyDrawable::~GPULegacyDrawable):
* platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h.
* platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h.
* platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp.
(WebCore::GPULegacyFunction::~GPULegacyFunction):
* platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h.
(WebCore::GPULegacyFunction::metal const):
* platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp.
(WebCore::GPULegacyLibrary::~GPULegacyLibrary):
* platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h.
(WebCore::GPULegacyLibrary::metal const):
* platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp.
(WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder):
* platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp.
(WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp.
(WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp.
(WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState):
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h.
* platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h.
* platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp.
(WebCore::GPULegacyTexture::~GPULegacyTexture):
* platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h.
* platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp.
(WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor):
* platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h.
* platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm.
(WebCore::GPULegacyBuffer::GPULegacyBuffer):
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm.
(WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
(WebCore::GPULegacyCommandBuffer::presentDrawable const):
(WebCore::GPULegacyCommandBuffer::commit const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm.
(WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue):
(WebCore::GPULegacyCommandQueue::label const):
(WebCore::GPULegacyCommandQueue::setLabel const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm.
(WebCore::MTLSizeMake):
(WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder):
(WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const):
(WebCore::GPULegacyComputeCommandEncoder::setBuffer const):
(WebCore::GPULegacyComputeCommandEncoder::dispatch const):
(WebCore::GPULegacyComputeCommandEncoder::endEncoding const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm.
(WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm.
(WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor):
(WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const):
(WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const):
(WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const):
(WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm.
(WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState):
(WebCore::GPULegacyDepthStencilState::label const):
(WebCore::GPULegacyDepthStencilState::setLabel const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm.
(WebCore::GPULegacyDevice::GPULegacyDevice):
(WebCore::GPULegacyDevice::disconnect):
(WebCore::GPULegacyDevice::reshape const):
(WebCore::GPULegacyDevice::platformLayer const):
(WebCore::GPULegacyDevice::operator! const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm.
(WebCore::GPULegacyDrawable::GPULegacyDrawable):
(WebCore::GPULegacyDrawable::release):
(WebCore::GPULegacyDrawable::metal const):
(WebCore::GPULegacyDrawable::texture const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm.
(WebCore::GPULegacyFunction::GPULegacyFunction):
(WebCore::GPULegacyFunction::name const):
(WebCore::GPULegacyFunction::operator! const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm.
(WebCore::GPULegacyLibrary::GPULegacyLibrary):
(WebCore::GPULegacyLibrary::label const):
(WebCore::GPULegacyLibrary::setLabel const):
(WebCore::GPULegacyLibrary::functionNames const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm.
(WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder):
(WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const):
(WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const):
(WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const):
(WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const):
(WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const):
(WebCore::GPULegacyRenderCommandEncoder::endEncoding const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor):
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const):
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const):
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor):
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const):
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const):
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor):
(WebCore::GPULegacyRenderPassDescriptor::colorAttachments const):
(WebCore::GPULegacyRenderPassDescriptor::depthAttachment const):
(WebCore::GPULegacyRenderPassDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor):
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const):
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const):
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm.
(WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor):
(WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const):
(WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const):
(WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const):
(WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const):
(WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const):
(WebCore::GPULegacyRenderPipelineDescriptor::reset const):
(WebCore::GPULegacyRenderPipelineDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm.
(WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState):
(WebCore::GPULegacyRenderPipelineState::label const):
(WebCore::GPULegacyRenderPipelineState::setLabel const):
(WebCore::GPULegacyRenderPipelineState::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm.
(WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor):
(WebCore::GPULegacyTextureDescriptor::width const):
(WebCore::GPULegacyTextureDescriptor::setWidth const):
(WebCore::GPULegacyTextureDescriptor::height const):
(WebCore::GPULegacyTextureDescriptor::setHeight const):
(WebCore::GPULegacyTextureDescriptor::sampleCount const):
(WebCore::GPULegacyTextureDescriptor::setSampleCount const):
(WebCore::GPULegacyTextureDescriptor::textureType const):
(WebCore::GPULegacyTextureDescriptor::setTextureType const):
(WebCore::GPULegacyTextureDescriptor::storageMode const):
(WebCore::GPULegacyTextureDescriptor::setStorageMode const):
(WebCore::GPULegacyTextureDescriptor::usage const):
(WebCore::GPULegacyTextureDescriptor::setUsage const):
(WebCore::GPULegacyTextureDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm.
(WebCore::GPULegacyTexture::GPULegacyTexture):
(WebCore::GPULegacyTexture::width const):
(WebCore::GPULegacyTexture::height const):
(WebCore::GPULegacyTexture::metal const):
2018-11-21 Adrian Perez de Castro <aperez@igalia.com>
[SOUP] Certificate decoder always returns GByteArray with zero size
https://bugs.webkit.org/show_bug.cgi?id=191888
Reviewed by Žan Doberšek.
No new tests needed.
* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
call to g_byte_array_set_size() to make sure byteArray->len has the
correct value.
2018-11-21 Zalan Butjas <zalan@apple.com>
[LFC][IFC] Take nonBreakableStart/End into use.
https://bugs.webkit.org/show_bug.cgi?id=191873
Reviewed by Antti Koivisto.
Offset the final inline runs with the nonBreakableStart/End values.
(This patch also fixes relative positioned run verification.)
Test: fast/inline/inline-content-with-padding-left-right.html
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2018-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r237845): [cairo] Hyperlink underscore layout issue
https://bugs.webkit.org/show_bug.cgi?id=191630
Reviewed by Michael Catanzaro.
Only flip Y in GlyphToPathTranslator for ports using CG.
* platform/graphics/FontCascade.cpp:
(WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
2018-11-21 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Refactor AppendPipeline deinitialization
https://bugs.webkit.org/show_bug.cgi?id=191759
Reviewed by Xabier Rodriguez-Calvar.
AppendPipeline currently has a method, clearPlayerPrivate(), that the
client code uses to deinitialize most of the AppendPipeline... just
before actually destructing it in the next line of code.
Since at that point there should not be alive RefPtr's pointing to the
AppendPipeline there is no need for this kind of pre-deinitialization
in this usage pattern. Instead, we can just rely on C++ destructors,
cleaning the code a bit and removing the potential for the question
"what if `clearPlayerPrivate() has been called before?`": it has not.
Assertions have been added to ensure that there is only one alive
RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate
destruction.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::deinitialize):
(WebCore::AppendPipeline::clearPlayerPrivate): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
2018-11-20 Dean Jackson <dino@apple.com>
Removing using namespace WebCore from WebLayer
https://bugs.webkit.org/show_bug.cgi?id=191870
<rdar://problem/46192206>
Rubber-stamped by Sam Weinig.
Remove "using namespace WebCore" from WebLayer.mm
because it will cause type clashes in unified source
builds.
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]):
(-[WebSimpleLayer setNeedsDisplay]):
(-[WebSimpleLayer setNeedsDisplayInRect:]):
(-[WebSimpleLayer display]):
(-[WebSimpleLayer drawInContext:]):
2018-11-20 Ryosuke Niwa <rniwa@webkit.org>
Input element gains focus when a selectstart event listener on document prevents the default action
https://bugs.webkit.org/show_bug.cgi?id=191714
<rdar://problem/46174389>
Reviewed by Antti Koivisto.
The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started
when preventDefault had been called in the previous firings of selectstart event. Because input element
has its own editable element and fires selectstart on the input element itself, which won't be prevented
by selectstart on docuemnt, this allowed the selection to be set inside the input element even though
the mouse cursor was simply passing over the input element after the drag had already started.
Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing
of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome
and Firefox.
Test: fast/events/selectstart-prevent-default-should-not-focus-input.html
* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
(WebCore::EventHandler::updateSelectionForMouseDrag):
2018-11-20 Christopher Reid <chris.reid@sony.com>
Remove the need for LocalizedStringsWPE.cpp
https://bugs.webkit.org/show_bug.cgi?id=191854
Reviewed by Michael Catanzaro.
No change in behavior.
Consolidate "Search the Web" as the default search context menu text on non-COCOA ports.
GTK, WPE, and non-CF WIN all had the same default localizedString function
of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation
for all ports not using CF.
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
* platform/gtk/LocalizedStringsGtk.cpp:
* platform/win/LocalizedStringsWin.cpp:
* platform/wpe/LocalizedStringsWPE.cpp: Removed.
2018-11-20 Zan Dobersek <zdobersek@igalia.com>
Segfaults on https://terminalizer.com/
https://bugs.webkit.org/show_bug.cgi?id=191805
Reviewed by Michael Catanzaro.
In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode
codepoints and their corresponding glyph indices should allow zero
values as valid keys since zero is a valid Unicode codepoint.
This change enables properly caching zero codepoints, avoiding
repetitive additions to the HashMap cache that end up in a crash.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated
GlyphCache type alias to the public section of HarfBuzzFace class
declaration, making it reusable in the helper HarfBuzzFontData struct.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2018-11-20 Antti Koivisto <antti@apple.com>
Update hover state in composed tree
https://bugs.webkit.org/show_bug.cgi?id=191860
Reviewed by Zalan Bujtas.
The code was already mostly switched over from render tree to composed tree.
This patch replaces the remaining common ancestor search code with a DOM based equivalent.
* dom/Document.cpp:
(WebCore::findNearestCommonComposedAncestor):
(WebCore::Document::updateHoverActiveState):
(WebCore::nearestCommonHoverAncestor): Deleted.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::hoverAncestor const): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::hoverAncestor const): Deleted.
No longer needed.
* rendering/RenderElement.h:
2018-11-20 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Measure run with non-breakable start/end.
https://bugs.webkit.org/show_bug.cgi?id=191850
Reviewed by Antti Koivisto.
Line breaking needs to know the complete width of the run including padding etc.
* layout/Verification.cpp:
(WebCore::Layout::collectFlowBoxSubtree):
(WebCore::Layout::collectInlineBoxes):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::runWidth const):
(WebCore::Layout::InlineLineBreaker::textWidth const):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hyphenPositionBefore):
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::fixedPitchWidth):
(WebCore::Layout::TextUtil::TextUtil): Deleted.
(WebCore::Layout::TextUtil::width const): Deleted.
(WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
(WebCore::Layout::TextUtil::textWidth const): Deleted.
(WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
* layout/inlineformatting/text/TextUtil.h:
2018-11-20 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
https://bugs.webkit.org/show_bug.cgi?id=191845
Reviewed by Antti Koivisto.
Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
(In the most common cases, this is only one extra vector::append() call.)
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::runs):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
(WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.
2018-11-20 Zalan Butjas <zalan@apple.com>
[LFC][IFC] Introduce InlineItem::nonBreakableStart/End
https://bugs.webkit.org/show_bug.cgi?id=191839
Reviewed by Antti Koivisto.
Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)
<span style="padding: 5px"><span>nested content with padding parent</span</span>
<nested content with padding parent> <- inline run has 5px non-breakable start/end.
<span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span> 3</span>
<1> <- inline run has 5px non-breakable start and 11px non-breakable end.
<2> <- inline run has 0px non-breakable start and 5px non-breakable end.
<3> <- no non-breakable values.
This is what the runs look like (input to line breaking)
< 1 2 >
< > (whitespace)
<3>
The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
With the given runs the first position where we can break the line is at the whitespace.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::nonBreakableStart const):
(WebCore::Layout::InlineItem::nonBreakableEnd const):
(WebCore::Layout::InlineItem::addNonBreakableStart):
(WebCore::Layout::InlineItem::addNonBreakableEnd):
2018-11-20 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
https://bugs.webkit.org/show_bug.cgi?id=191838
Reviewed by Antti Koivisto.
This is in preparation for adding more context to InlineItem. In addition to
detaching rules it will also hold non-breakable start/end information.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
(WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::addDetachingRule):
(WebCore::Layout::InlineItem::detachingRules const):
2018-11-20 Zalan Bujjtas <zalan@apple.com>
[LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
https://bugs.webkit.org/show_bug.cgi?id=191837
Reviewed by Antti Koivisto.
This allows us to remove the InlineFormattingState dependency as well.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::InlineRunProvider):
(WebCore::Layout::InlineRunProvider::append):
* layout/inlineformatting/InlineRunProvider.h:
2018-11-20 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
https://bugs.webkit.org/show_bug.cgi?id=191586
Reviewed by Xabier Rodriguez-Calvar.
This is minor changes that do not require tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::commitLoad):
(WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2018-11-20 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Consider scrollbars in populateGridPositionsForDirection()
https://bugs.webkit.org/show_bug.cgi?id=191656
Reviewed by Javier Fernandez.
We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
The patch modifies the method so it takes into account scrollbar size
in order to compute the position of the columns/rows depending on the direction and the writing mode.
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):
2018-11-19 Ryosuke Niwa <rniwa@webkit.org>
Click on node assigned to slot in button's shadow cause loss of button focus
https://bugs.webkit.org/show_bug.cgi?id=191694
<rdar://problem/46107920>
Reviewed by Wenson Hsieh.
Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.
Test: fast/shadow-dom/focus-slot-parent.html
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.
2018-11-19 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
https://bugs.webkit.org/show_bug.cgi?id=191849
Unreviewed build fix for clang-cl builds.
No new tests because there's no behaviour change.
* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2018-11-19 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API for CertificateInfo.
https://bugs.webkit.org/show_bug.cgi?id=191647
Reviewed by Alex Christensen.
Minor changes for WebKit API.
Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CertificateInfoCurl.cpp:
(WebCore::CertificateInfo::CertificateInfo):
(WebCore::CertificateInfo::makeCertificate):
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::BIOHolder::asCertificate):
2018-11-19 Justin Fan <justin_fan@apple.com>
[WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
https://bugs.webkit.org/show_bug.cgi?id=191794
Reviewed by Dean Jackson.
Test: webgpu/textures-textureviews.html
Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to
configure the context with a chosen texture format.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
* Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
* Modules/webgpu/GPUTextureFormatEnum.h: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
(WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
* Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/WebGPUTexture.cpp: Added.
(WebCore::WebGPUTexture::create):
(WebCore::WebGPUTexture::WebGPUTexture):
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTexture.h: Added.
* Modules/webgpu/WebGPUTexture.idl: Added.
* Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
* Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
* Modules/webgpu/WebGPUTextureView.cpp: Added.
(WebCore::WebGPUTextureView::create):
(WebCore::WebGPUTextureView::WebGPUTextureView):
* Modules/webgpu/WebGPUTextureView.h: Added.
* Modules/webgpu/WebGPUTextureView.idl: Added.
* Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
(WebCore::GPUSwapChain::getNextTexture):
* Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
(WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
* Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-11-19 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: "Reload Web Inspector" button no longer partially works
https://bugs.webkit.org/show_bug.cgi?id=191773
<rdar://problem/46139932>
Reviewed by Devin Rousso.
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::reopen):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Provide a host call to reopen an inspector window to reload it.
* testing/Internals.cpp:
Stub implementation, this is not used in tests.
2018-11-19 Rob Buis <rbuis@igalia.com>
Setting document.title should have no effect for non SVG/HTML documents
https://bugs.webkit.org/show_bug.cgi?id=191643
Reviewed by Chris Dumez.
Setting document.title should have no effect for non SVG/HTML documents,
see https://html.spec.whatwg.org/multipage/dom.html#document.title.
Behavior matches Firefox and Chrome.
Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
* dom/Document.cpp:
(WebCore::Document::setTitle):
2018-11-19 Wenson Hsieh <wenson_hsieh@apple.com>
Dragging image with a border-image larger than the image element crashes
https://bugs.webkit.org/show_bug.cgi?id=191817
<rdar://problem/46159222>
Reviewed by Ryosuke Niwa.
When dragging an image element, if the image element has:
(1) box-sizing: border-box;
(2) a border-image
(3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
at least as large as the width of the element
...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
icon representation for the drag image.
Test: fast/events/drag-image-with-border-image.html
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
2018-11-18 Zan Dobersek <zdobersek@igalia.com>
HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
https://bugs.webkit.org/show_bug.cgi?id=191825
Reviewed by Michael Catanzaro.
The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
objects is used to map given Unicode codepoints to corresponding
glyph indices (which occurs in the harfBuzzGetGlyph() function that's
invoked by HarfBuzz).
The 16-bit unsigned integer as the map's value type is not enough here
when the glyph index mapping is done through Freetype -- its API returns
32-bit glyph indices, and Cairo assigns this value to the 64-bit
unsigned index variable in the cairo_glyph_t struct. The value type is
thus bumped to 32 bits to match the unsigned type size of the index's
origin.
* platform/graphics/harfbuzz/HarfBuzzFace.h:
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2018-11-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
https://bugs.webkit.org/show_bug.cgi?id=191819
Reviewed by Dan Bernstein.
Replace UIItemProvider (and related classes) with NSItemProvider.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderDataRegistrar registerItemProvider:]):
(-[WebItemProviderWritableObjectRegistrar initWithObject:]):
(-[WebItemProviderWritableObjectRegistrar representingObject]):
(-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
(-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
(-[WebItemProviderRegistrationInfoList itemProvider]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(allLoadableClasses):
(classForTypeIdentifier):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard numberOfFiles]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
(-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsURL const):
2018-11-17 Ross Kirsling <ross.kirsling@sony.com>
Remove superfluous LayoutUnit initializations
https://bugs.webkit.org/show_bug.cgi?id=191791
Reviewed by Simon Fraser.
First step toward making LayoutUnit constructors explicit:
eliminate `= 0` when constructing LayoutUnit lvalues.
* editing/Editor.cpp:
(WebCore::Editor::firstRectForRange const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):
* page/SpatialNavigation.cpp:
(WebCore::scrollInDirection):
(WebCore::distanceDataForNode):
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::layout):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::selectionGapRectsForRepaint):
(WebCore::RenderBlock::paintSelection):
(WebCore::RenderBlock::textIndentOffset const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::marginValuesForChild const):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::clearFloats):
(WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
(WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::getClearDelta):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::determineStartPosition):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::fillAvailableMeasure const):
(WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
(WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
(WebCore::RenderBox::computePercentageLogicalHeight const):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computedCSSPadding const):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::marginWidthForChild):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
(WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paint):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::offsetWidthForColumn const):
(WebCore::RenderTable::offsetHeightForColumn const):
(WebCore::RenderTable::outerBorderBefore const):
(WebCore::RenderTable::outerBorderAfter const):
(WebCore::RenderTable::outerBorderStart const):
(WebCore::RenderTable::outerBorderEnd const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::logicalWidthFromColumns const):
(WebCore::RenderTableCell::computeIntrinsicPadding):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
(WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::calcOuterBorderBefore const):
(WebCore::RenderTableSection::calcOuterBorderAfter const):
(WebCore::RenderTableSection::calcOuterBorderStart const):
(WebCore::RenderTableSection::calcOuterBorderEnd const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
(WebCore::RootInlineBox::lineSnapAdjustment const):
(WebCore::RootInlineBox::verticalPositionForBox):
* rendering/line/BreakingContext.h:
(WebCore::inlineLogicalWidth):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutItems):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layoutBlock):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
(WebCore::RenderMathMLUnderOver::layoutBlock):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getShadowInsetExtent const):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Avoid triggering compositing updates when only the root layer is composited
https://bugs.webkit.org/show_bug.cgi?id=191813
Reviewed by Zalan Bujtas.
If we know that the only composited layer is the root, we can avoid triggering deep
compositing updates sometimes, for example when layout changes size or position,
or when z-order lists change.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
flag to cut off descendants traversal when possible.
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Fix an error in 238354 - !=, not ==.
Fixes test failures.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
https://bugs.webkit.org/show_bug.cgi?id=191810
Reviewed by Zalan Bujtas.
Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
than the RenderView's layer.
hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
because no content layer is composited, and overlays don't require compositing, so
rename it.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
(WebCore::RenderLayerCompositor::layerBecameComposited):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::layerTreeAsText):
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
* rendering/RenderLayerCompositor.h:
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
https://bugs.webkit.org/show_bug.cgi?id=191808
Reviewed by Zalan Bujtas.
Other code uses "usesCompositing" so standardize on that (future changes will make
"compositing mode" more ambiguous). Also remove a FrameView function that only
had one caller.
* page/FrameView.cpp:
(WebCore::FrameView::clearBackingStores):
(WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
(WebCore::FrameView::delegatesScrollingDidChange):
(WebCore::FrameView::hasCompositedContent const): Deleted.
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingPolicy):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::needsToBeComposited const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewAndCompositedLayers):
(WebCore::RenderView::usesCompositing const):
2018-11-17 Devin Rousso <drousso@apple.com>
Web Inspector: Network: add button to show system certificate dialog
https://bugs.webkit.org/show_bug.cgi?id=191458
<rdar://problem/45977019>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/network/getSerializedCertificate.html
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
(WebCore::InspectorFrontendHost::showCertificate): Added.
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient::showCertificate): Added.
* testing/Internals.cpp:
(InspectorStubFrontend::showCertificate): Added.
* platform/network/cf/CertificateInfo.h:
(WTF::Persistence::encodeCFData): Added.
(WTF::Persistence::decodeCFData): Added.
(WTF::Persistence::encodeSecTrustRef): Added.
(WTF::Persistence::decodeSecTrustRef): Added.
(WTF::Persistence::encodeCertificateChain): Added.
(WTF::Persistence::decodeCertificateChain): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
* platform/network/cf/CertificateInfoCFNet.cpp:
* platform/network/cocoa/CertificateInfoCocoa.mm:
* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
(WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
(WTF::Persistence::certificateFromCertificatesDataList): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
2018-11-17 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
https://bugs.webkit.org/show_bug.cgi?id=191801
Reviewed by Antti Koivisto.
before<span style="position: relative">positioned</span>after
In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::addDetachingRule):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
2018-11-17 Jonathan Hammer <jonathan@e3software.com>
Caret stops blinking after context menu shown
https://bugs.webkit.org/show_bug.cgi?id=191715
Reviewed by Ryosuke Niwa.
Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
the caret continues to blink even after the context menu is dismissed. The normal
way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
not apply in the case of context menus because handleMouseReleaseEvent is not
called once the context menu is up.
Test: fast/events/contextmenu-dismiss-blink-caret.html
* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEvent):
* testing/Internals.cpp:
(WebCore::Internals::isCaretBlinkingSuspended):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-16 Antoine Quint <graouts@apple.com>
[Pointer Events] event.isPrimary doesn't always represent the oldest active touch
https://bugs.webkit.org/show_bug.cgi?id=191752
<rdar://problem/46129270>
Reviewed by Dean Jackson.
Provide isPrimary to the constructor so its value can be determined at the call site.
Test: pointerevents/ios/pointer-events-is-primary.html
* dom/PointerEvent.h:
* dom/ios/PointerEventIOS.cpp:
(WebCore::PointerEvent::create):
(WebCore::PointerEvent::PointerEvent):
(WebCore::m_isPrimary):
2018-11-16 Alex Christensen <achristensen@webkit.org>
Tweak _showSafeBrowsingWarningWithTitle SPI
https://bugs.webkit.org/show_bug.cgi?id=191799
Reviewed by Wenson Hsieh.
It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
Covered by updated API tests.
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlCancelButtonTitle):
Make "Cancel"'s description a little more generic.
2018-11-16 Simon Fraser <simon.fraser@apple.com>
Optimize composited iframe layer hookup
https://bugs.webkit.org/show_bug.cgi?id=191778
Reviewed by Zalan Bujtas.
The change made in r238229 can be more targeted; we only need to hook up iframe content
layers when the layer is already composited (otherwise the updateBacking() above would have triggered
the work), and when it's a RenderWidget layer.
Tested by existing tests.
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-16 Ross Kirsling <ross.kirsling@sony.com>
Provide default implementation of Widget
https://bugs.webkit.org/show_bug.cgi?id=191784
Reviewed by Michael Catanzaro.
* SourcesWPE.txt:
* platform/Widget.cpp:
(WebCore::Widget::Widget):
(WebCore::Widget::frameRect const):
(WebCore::Widget::~Widget):
(WebCore::Widget::setFrameRect):
(WebCore::Widget::paint):
(WebCore::Widget::setFocus):
(WebCore::Widget::setCursor):
(WebCore::Widget::show):
(WebCore::Widget::hide):
(WebCore::Widget::setIsSelected):
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::Widget): Deleted.
(WebCore::Widget::frameRect const): Deleted.
* platform/win/WidgetWin.cpp:
(WebCore::Widget::Widget): Deleted.
(WebCore::Widget::frameRect const): Deleted.
* platform/wpe/WidgetWPE.cpp: Removed.
2018-11-16 Chris Dumez <cdumez@apple.com>
[macOS] Label "prewarmed" WebContent processes in Activity Monitor
https://bugs.webkit.org/show_bug.cgi?id=191765
<rdar://problem/45953463>
Reviewed by Geoffrey Garen.
* en.lproj/Localizable.strings:
2018-11-16 Jeremy Jones <jeremyj@apple.com>
Enable external playback for video in element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=190359
rdar://problem/42560085
Reviewed by Jer Noble.
No new tests because we don't have a good way to test external playback.
Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
allow PiP, but disable external playback while PiP is active.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVideoFullscreenStandby):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setVideoFullscreenStandby):
(WebCore::MediaPlayer::videoFullscreenStandby const):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
2018-11-16 Jer Noble <jer.noble@apple.com>
Regression(r233865): Causes synchronous IPC in the middle of layout
https://bugs.webkit.org/show_bug.cgi?id=188307
<rdar://problem/42807306>
Reviewed by Eric Carlson.
Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
steps of the requestFullscreen() method on the next run loop, allowing messages from the
UIProcess about page visibilty to be delivered first.
* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* html/HTMLMediaElement.h:
* page/ChromeClient.h:
2018-11-16 Ross Kirsling <ross.kirsling@sony.com>
Provide default implementation of Cursor
https://bugs.webkit.org/show_bug.cgi?id=191772
Reviewed by Michael Catanzaro.
* SourcesWPE.txt:
* platform/Cursor.cpp:
(WebCore::Cursor::ensurePlatformCursor const):
* platform/wpe/CursorWPE.cpp: Removed.
2018-11-16 Don Olmstead <don.olmstead@sony.com>
EditorWPE should be EditorLibWPE
https://bugs.webkit.org/show_bug.cgi?id=191774
Reviewed by Michael Catanzaro.
The platform specific implementations of Editor are all around the
platform's Pasteboard. Since the Pasteboard implementation is now based
around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
* SourcesWPE.txt:
* editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
2018-11-16 Jeremy Jones <jeremyj@apple.com>
Include AirPlay destination name in AirPlay placard.
https://bugs.webkit.org/show_bug.cgi?id=191574
rdar://problem/45536144
Reviewed by Eric Carlson.
Updated existing tests.
Include the name of the AirPlay destination in the video element's AirPlay placard.
* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/placard.js:
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport.prototype._updateAirPlayPlacard):
(PlacardSupport):
* en.lproj/modern-media-controls-localized-strings.js:
2018-11-16 Zalan Bujtas <zalan@apple.com>
Add DidFirstMeaningfulPaint milestone.
https://bugs.webkit.org/show_bug.cgi?id=191754
Reviewed by Simon Fraser.
This milestone fires sone after the paint triggered by the first visually non-empty layout.
* page/FrameView.cpp:
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
* page/LayoutMilestone.h:
2018-11-16 Don Olmstead <don.olmstead@sony.com>
Provide default implementations of Image and Icon
https://bugs.webkit.org/show_bug.cgi?id=191764
Reviewed by Michael Catanzaro.
Makes IconWPE and ImageWPE implementations the default.
* Sources.txt:
* SourcesWPE.txt:
* platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
* platform/graphics/Image.cpp:
(WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
(WebCore::Image::loadPlatformResource):
* platform/graphics/wpe/ImageWPE.cpp: Removed.
2018-11-16 Brent Fulgham <bfulgham@apple.com>
[Win] Reduce the use of WKSI library calls: CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=191718
<rdar://problem/46108732>
Reviewed by Alex Christensen.
Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
make the same calls on Windows, like we did for iOS and macOS back in 2017.
Stop including WebKitSystemInterface.h for files that used to rely on it
for font-related features.
Tested by existing Windows regression tests. There should be no change in behavior.
* platform/graphics/win/FontCacheWin.cpp:
* platform/graphics/win/FontCustomPlatformData.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/network/cf/CookieStorageCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createPrivateStorageSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::ensureSession):
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
(WebCore::getSSLPeerCertificateData):
(WebCore::setSSLPeerCertificateData):
(WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
(WebCore::ResourceError::platformLazyInit):
(WebCore::ResourceError::cfError const):
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::setClientCertificateInSSLProperties):
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceRequestCFNet.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2018-11-16 Timothy Hatcher <timothy@apple.com>
Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
https://bugs.webkit.org/show_bug.cgi?id=191760
Reviewed by Antti Koivisto.
* css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
a PLATFORM(MAC) copy of the string.
2018-11-16 Jer Noble <jer.noble@apple.com>
An early return from updateSchedulingInfo can leave some variables uninitialized.
https://bugs.webkit.org/show_bug.cgi?id=191755
<rdar://problem/39910089>
Reviewed by Brent Fulgham.
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process):
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::process):
2018-11-16 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
https://bugs.webkit.org/show_bug.cgi?id=191578
Reviewed by Xabier Rodriguez-Calvar.
Changing the demuxer to READY state (which is done only in the main
thread) triggers the unlinking of its srcpads, which in turns emits a
caps change notification in the previously linked element since they
become unnegotiated again.
We are not interested in caps notifications in these cases, so let's
just ignore caps notifications emitted from the main thread.
This fixes an assertion failure in the debug builds.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
2018-11-16 Sihui Liu <sihui_liu@apple.com>
Storing blobs in IDB on iOS: "Error preparing blob/file"
https://bugs.webkit.org/show_bug.cgi?id=188438
<rdar://problem/43097279>
Reviewed by Alex Christensen.
Grant sandbox extension of temp folder to network process, because we suggested network process had access to
the folder on iOS device but it didn't.
This makes some existing tests about IDB blob pass on iOS device.
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2018-11-16 Don Olmstead <don.olmstead@sony.com>
Add USE(LIBWPE) to WebCore
https://bugs.webkit.org/show_bug.cgi?id=191401
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
USE(LIBWPE) instead.
Renames classes and files to use the suffix LibWPE.
* PlatformWPE.cmake:
* SourcesWPE.txt:
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformPasteboard.h:
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
* platform/graphics/PlatformDisplay.h:
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
* platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
(WebCore::PlatformDisplayLibWPE::create):
(WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
(WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
(WebCore::PlatformDisplayLibWPE::initialize):
* platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
* platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
* platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
* platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
2018-11-16 Zalan Bujtas <zalan@apple.com>
[iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
https://bugs.webkit.org/show_bug.cgi?id=191712
<rdar://problem/45612900>
Reviewed by Simon Fraser.
In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
and no need to dispatch a click event.
The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
only for tooltip-like reasons and it's ok to proceed with the click event.
Test: fast/events/touch/ios/click-instead-of-hover-simple.html
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2018-11-16 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for out-of-flow positioned boxes
https://bugs.webkit.org/show_bug.cgi?id=191726
Reviewed by Antti Koivisto.
While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
that their out-of-flow descendants get laid out as well.
Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
(WebCore::Layout::TreeBuilder::createSubTree):
2018-11-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add API to enable/disable device mocks
https://bugs.webkit.org/show_bug.cgi?id=191699
This basically us to test MediaStream/WebRTC support without
requiring cameras or microphones and is quite useful.
Also fix the GStreamerAudioMock by:
- Stop setting `leaky-upstream` on the GStreamerCapturer queue,
this was usefull when we were trying to bring the MediaStream
sources inside the main pipeline, it is not the case anymore
(and not doable with latest version of LibWebRTC).
- Use a 'ticks' wave on the gstreamer audiotestsrc so the test
stream is similar to what Apple port does.
Reviewed by Xabier Rodriguez-Calvar.
The mocks are already tested and the API is really simple.
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::createSource):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::addSink):
* platform/mediastream/gstreamer/GStreamerCapturer.h:
2018-11-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][MediaStream] Handle track addition and removal
https://bugs.webkit.org/show_bug.cgi?id=191599
Reviewed by Xabier Rodriguez-Calvar.
Test: fast/mediastream/MediaStream-video-element-remove-track.html
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
(WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
(WebCore::webkitMediaStreamSrcFinalize):
(WebCore::webkitMediaStreamSrcChangeState):
(WebCore::webkit_media_stream_src_init):
(WebCore::webkitMediaStreamSrcSetupSrc):
(WebCore::webkitMediaStreamSrcAddTrack):
(WebCore::webkitMediaStreamSrcRemoveTrackByType):
(WebCore::webkitMediaStreamSrcSetStream):
2018-11-16 Zan Dobersek <zdobersek@igalia.com>
ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
https://bugs.webkit.org/show_bug.cgi?id=191354
Reviewed by Michael Catanzaro.
ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
index validity and, if the index is valid, check for completeness of the
corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
also only retrieve duration for already-complete frames.
Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
as that method goes on and decodes image data to determine specific
information. The ImageSource class that's querying this information
doesn't anticipate this, and doesn't handle the increased memory
consumption of the decoded data, leaving MemoryCache in the blind about
the image resource's actual amount of consumed memory. ImageSource can
instead gracefully handle any incomplete frame by marking the decoding
status for this frame as only partial.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2018-11-16 Antoine Quint <graouts@apple.com>
PointerEvents should not require touch event listeners to be registered
https://bugs.webkit.org/show_bug.cgi?id=191333
<rdar://problem/45857523>
Reviewed by Dean Jackson.
Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
pointerevents/ios/pointer-events-prevent-default.html
* dom/EventNames.h:
(WebCore::EventNames::isTouchEventType const):
(WebCore::EventNames::touchAndPointerEventNames const):
(WebCore::EventNames::touchEventNames const): Deleted.
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
2018-11-15 Zalan Bujtas <zalan@apple.com>
[iOS] Do not get stuck in indeterminate content observation state.
https://bugs.webkit.org/show_bug.cgi?id=191719
Reviewed by Simon Fraser.
Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
the "can't decide yet if it's a hover or click" state.
This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
Test: fast/events/touch/ios/stuck-with-hover-state.html
* platform/ios/wak/WKContentObservation.cpp:
(WebThreadRemoveObservedContentModifier):
2018-11-15 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090) Composited iframes that resize from zero don't show
https://bugs.webkit.org/show_bug.cgi?id=191733
rdar://problem/46107764
Reviewed by Zalan Bujtas.
A zero-sized iframe whose contents are composited should not trigger compositing in the
parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
was resized without a style change (e.g. because it's width: 100%, height: 100% and the
parent resizes), there was no code that triggered a compositing update.
Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
for a RenderWidget whose contents are composited.
Test: compositing/iframes/resize-from-zero-size.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
2018-11-15 Simon Fraser <simon.fraser@apple.com>
Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342
rdar://problem/26652811
Reviewed by Zalan Bujtas.
Patch partly by Frédéric Wang.
This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
assertion in debug mode and prevents the user from scrolling the overflow node in release
mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
the remaining issues by forcing a configuration update after layout in order to ensure that
RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
composited, trigger a post-layout update that is necessary to check if we need to make it
composited when it gains scrollable overflow.
Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
fast/scrolling/ios/change-scrollability-on-content-resize.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
RenderLayerBacking::m_scrollingLayer.
2018-11-15 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
https://bugs.webkit.org/show_bug.cgi?id=191582
Reviewed by Alex Christensen.
No new tests because there's no behaviour change.
* platform/network/curl/CurlDownload.h: Marked CurlDownload final.
2018-11-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238244.
Caused High Sierra test runs to fail early with 50 crashes and
casued 25 API failures.
Reverted changeset:
"[css-logical] Implement flow-relative margin, padding and
border shorthands"
https://bugs.webkit.org/show_bug.cgi?id=188697
https://trac.webkit.org/changeset/238244
2018-11-15 Jer Noble <jer.noble@apple.com>
AVKit will set videoGravity to a nil string when building against iosmac
https://bugs.webkit.org/show_bug.cgi?id=191573
Reviewed by Dean Jackson.
Workaround AVKit behavior by treating nil videoGravity as the default,
which is AVLayerVideoGravityResizeAspect.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
2018-11-15 Brent Fulgham <bfulgham@apple.com>
[Win] Reduce the use of WKSI library calls: Font Handling
https://bugs.webkit.org/show_bug.cgi?id=191701
<rdar://problem/46104809>
Reviewed by Myles C. Maxfield.
Move the old Windows font handling code out of WKSI to our regular
repository. We now handle SPI differently, and don't need to keep
these implementations in a separate library. This should also help
avoid the somewhat frequent build failures caused when WKSI is not
updated in sync with WebKit.
Tested by existing Windows test cases.
* platform/graphics/FontCascade.h:
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::setFontSmoothingLevel):
(WebCore::setCGFontSmoothingStyle):
(WebCore::FontCascade::setFontSmoothingStyle):
(WebCore::FontCascade::setFontSmoothingContrast):
(WebCore::clearTypeContrast):
(WebCore::FontCascade::systemFontSmoothingChanged):
(WebCore::FontCascade::setCGContextFontRenderingStyle):
(WebCore::renderingStyleForFont):
(WebCore::FontCascade::getGlyphAdvances):
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::Font::platformWidthForGlyph const):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Use a real nonce for CTAPHID_INIT
https://bugs.webkit.org/show_bug.cgi?id=191533
<rdar://problem/46103502>
Reviewed by Brent Fulgham.
New tests are added into existing test files.
* Modules/webauthn/fido/FidoConstants.h:
2018-11-15 Justin Fan <justin_fan@apple.com>
[WebGPU] WebGPUCommandBuffer prototype
https://bugs.webkit.org/show_bug.cgi?id=191663
Reviewed by Dean Jackson.
Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
Test: webgpu/command-buffers.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
* Modules/webgpu/GPUDevice.cpp:
(WebCore::GPUDevice::createCommandBuffer): Added.
(WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
* Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
(WebCore::GPUDevice::platformDevice const):
* Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
(WebCore::GPUQueue::platformQueue const):
* Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* Modules/webgpu/GPUShaderModule.h:
(WebCore::GPUShaderModule::platformShaderModule const):
* Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
(WebCore::GPUSwapChain::platformLayer const):
* Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
* Modules/webgpu/WebGPUCommandBuffer.h: Added.
* Modules/webgpu/WebGPUCommandBuffer.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createCommandBuffer const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
(WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
* Modules/webgpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::GPUDevice):
* Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::GPUQueue):
* Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::GPURenderPipeline):
* Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-11-15 Oriol Brufau <obrufau@igalia.com>
[css-logical] Implement flow-relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697
Reviewed by Simon Fraser and Antti Koivisto.
Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
webexposed/css-properties-as-js-properties.html
webexposed/css-properties-behind-flags.html
webexposed/css-property-listing.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
Allow the new properties to serialize their computed value.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
* css/CSSComputedStyleDeclaration.h:
Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
shorthands.
* css/CSSProperties.json:
Add the new properties behind the CSSLogicalEnabled runtime flag.
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
Prevent CSS properties disabled behind a runtime flag from being exposed in
style declarations.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
Allow the new properties to serialize their specified value.
(WebCore::StyleProperties::get2Values const):
Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
(WebCore::StyleProperties::borderPropertyValue const):
Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
corresponding to width, style and color.
(WebCore::MutableStyleProperties::setProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.
(WebCore::StyleProperties::asText const):
Allow the new properties to be serialized in cssText.
Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
and serialize the longhands instead. Note that there could be another shorthand
available which is enabled, but a proper solution would require bug 190496.
* css/StyleProperties.h:
Update declarations of borderPropertyValue and get2Values.
* css/makeprop.pl:
(addProperty):
Add isEnabledCSSProperty function for checking that a CSS property is not
disabled behind a runtime flag.
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
Prevent CSS properties disabled behind a runtime flag from being exposed in
computed styles.
(WebCore::CSSPropertyParser::addProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.
(WebCore::CSSPropertyParser::consumeBorder):
Change consumeBorder to provide the caller with the parsed values instead of
setting properties. Then the caller can decide to which properties the values
should be set, and whether border-image should be reset or not.
(WebCore::CSSPropertyParser::consume2ValueShorthand):
(WebCore::CSSPropertyParser::consume4ValueShorthand):
Rename consume4Values to consume4ValueShorthand, and add analogous
consume2ValueShorthand for parsing shorthands with two longhands.
(WebCore::CSSPropertyParser::parseShorthand):
Allow the new properties to be parsed.
* css/parser/CSSPropertyParser.h:
Update declarations of consumeBorder, consume2ValueShorthand and
consume4ValueShorthand.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Prevent CSS properties disabled behind a runtime flag from being exposed in
the CSS inspector tool.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
(WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
Add the CSSLogicalEnabled runtime flag.
2018-11-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238220.
Introduced failing tests to iOS and is slowing down EWS
Reverted changeset:
"[css-grid] Consider scrollbars in
populateGridPositionsForDirection()"
https://bugs.webkit.org/show_bug.cgi?id=191656
https://trac.webkit.org/changeset/238220
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
https://bugs.webkit.org/show_bug.cgi?id=191522
Reviewed by Brent Fulgham.
Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
Covered by existing tests.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
2018-11-15 Ross Kirsling <ross.kirsling@sony.com>
DragImage should have a complete default implementation
https://bugs.webkit.org/show_bug.cgi?id=191666
Reviewed by Dean Jackson.
Move WPE's stub implementation down into the base implementation file.
* SourcesWPE.txt:
* platform/DragImage.cpp:
(WebCore::dragImageSize):
(WebCore::deleteDragImage):
(WebCore::scaleDragImage):
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
(WebCore::createDragImageIconForCachedImageFilename):
(WebCore::createDragImageForLink):
* platform/wpe/DragImageWPE.cpp: Removed.
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] UserHandle can be null
https://bugs.webkit.org/show_bug.cgi?id=191521
Reviewed by Alex Christensen.
According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
UserHandle can now be null.
Covered by existing tests.
* Modules/webauthn/AuthenticatorAssertionResponse.h:
(WebCore::AuthenticatorAssertionResponse::create):
(WebCore::AuthenticatorAssertionResponse::userHandle const):
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
* Modules/webauthn/AuthenticatorAssertionResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::tryCreate):
* Modules/webauthn/PublicKeyCredentialData.h:
(WebCore::PublicKeyCredentialData::encode const):
(WebCore::PublicKeyCredentialData::decode):
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPGetAssertionResponse):
2018-11-15 Youenn Fablet <youenn@apple.com>
Modernize RTCPeerConnection handling of pendingActivity
https://bugs.webkit.org/show_bug.cgi?id=191661
Reviewed by Eric Carlson.
makePendingActivity is the modern way to handle set/unset of pending activity.
No change of behavior.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::doStop):
* Modules/mediastream/RTCPeerConnection.h:
2018-11-15 Keith Rollin <krollin@apple.com>
Delete old .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=191669
<rdar://problem/46081994>
Reviewed by Chris Dumez.
.xcfilelist files were created and added to the Xcode project files in
https://trac.webkit.org/changeset/238008/webkit. However, they caused
build issues and they were removed from the Xcode projects in
https://trac.webkit.org/changeset/238055/webkit. This check-in removes
the files from the repository altogether. They'll ultimately be
replaced with new files with names that indicate whether the
associated files are inputs to the Run Script phase or are files
created by the Run Script phase.
No new tests -- no changed functionality.
* DerivedSources.xcfilelist: Removed.
* UnifiedSources.xcfilelist: Removed.
2018-11-15 Youenn Fablet <youenn@apple.com>
Update RTCPeerConnection JS built-ins to be closer to specWe
https://bugs.webkit.org/show_bug.cgi?id=191665
Reviewed by Eric Carlson.
Simplify JS built-ins since we no longer need to support callback versions of the API.
Make sure to have the right number of parameters in the JS built-in functions.
Make some simplification to the code.
Covered by existing tests and rebased test.
* Modules/mediastream/RTCPeerConnection.js:
(createOffer):
(createAnswer):
(setLocalDescription):
(setRemoteDescription):
(addIceCandidate):
* Modules/mediastream/RTCPeerConnectionInternals.js:
(enqueueOperation):
(callbacksAndDictionaryOverload): Deleted.
2018-11-15 Simon Fraser <simon.fraser@apple.com>
REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
https://bugs.webkit.org/show_bug.cgi?id=191673
rdar://problem/46083440
Reviewed by Antti Koivisto.
Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
tree for every Frame. They get re-attached on tab show, and for subframes this involves
the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
layer configuration update that gets iframe layers parented.
This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
patch will optimize this, and add a layout test.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-15 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
https://bugs.webkit.org/show_bug.cgi?id=191690
Reviewed by Antti Koivisto.
Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2018-11-15 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext base class should not declare computeStaticPosition.
https://bugs.webkit.org/show_bug.cgi?id=191683
Reviewed by Antti Koivisto.
Apparently only BlockFormattingContext uses it.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-11-14 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for in-flow positioned inline boxes.
https://bugs.webkit.org/show_bug.cgi?id=191672
Reviewed by Antti Koivisto.
We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
Test: fast/inline/simple-inline-inflow-positioned.html
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::moveVertically):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
2018-11-15 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
https://bugs.webkit.org/show_bug.cgi?id=191631
Reviewed by Xabier Rodriguez-Calvar.
This will be tested once webkit.org/b/186933 is implemented.
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
2018-11-15 Antti Koivisto <antti@apple.com>
REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
https://bugs.webkit.org/show_bug.cgi?id=191642
Reviewed by Zalan Bujtas.
Invalidate access key map even when thorttling style recalcs.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
2018-11-15 Antti Koivisto <antti@apple.com>
Remove fonts from CSSFontFaceSet safely
https://bugs.webkit.org/show_bug.cgi?id=191676
Reviewed by Zalan Bujtas.
Test: fast/text/font-face-set-remove-safely.html
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::remove):
2018-11-15 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Consider scrollbars in populateGridPositionsForDirection()
https://bugs.webkit.org/show_bug.cgi?id=191656
Reviewed by Javier Fernandez.
We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
The patch modifies the method so it takes into account scrollbar size
in order to compute the position of the columns/rows depending on the direction and the writing mode.
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):
2018-11-14 Keith Rollin <krollin@apple.com>
Move scripts for Derived and Unified Sources to external files
https://bugs.webkit.org/show_bug.cgi?id=191670
<rdar://problem/46082278>
Reviewed by Keith Miller.
Move the scripts in the Generate Derived Sources and Generate Unified
Sources Run Script phases from the Xcode projects to external shell
script files. Then invoke those scripts from the Run Script phases.
This refactoring is being performed to support later work that will
invoke these scripts in other contexts.
The scripts were maintained as-is when making the move. I did a little
reformatting and added 'set -e' to the top of each file, but that's
it.
No new tests -- no changed functionality.
* Scripts/generate-derived-sources.sh: Added.
* Scripts/generate-unified-sources.sh: Added.
* WebCore.xcodeproj/project.pbxproj:
2018-11-14 Keith Rollin <krollin@apple.com>
Fix #end vs. #endif typo.
https://bugs.webkit.org/show_bug.cgi?id=191668
<rdar://problem/46081704>
Reviewed by Alexey Proskuryakov.
Source/WebCore/SourcesCocoa.txt had a #end that should have been a
#endif. Fix this, an add a check to generate-unified-source-bundles.rb
to detect similar typos.
No new tests -- no changed functionality.
* SourcesCocoa.txt:
2018-11-14 Keith Rollin <krollin@apple.com>
Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
https://bugs.webkit.org/show_bug.cgi?id=191667
<rdar://problem/46081286>
Reviewed by Eric Carlson.
VideoFullscreenLayerManager.mm no longer exists.
No new tests -- No changed functionality.
* SourcesCocoa.txt:
2018-11-14 Timothy Hatcher <timothy@apple.com>
Enabled dark mode CSS support by default.
https://bugs.webkit.org/show_bug.cgi?id=191609
rdar://problem/46046861
Reviewed by Megan Gardner.
* page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
2018-11-14 Timothy Hatcher <timothy@apple.com>
Default the view background color and text color to different values when in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=191607
rdar://problem/46045854
Reviewed by Dean Jackson.
Test: css-dark-mode/default-colors.html
* css/html.css:
(html): Set color: text on macOS.
* dom/Document.cpp:
(WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
* editing/EditingStyle.cpp:
(WebCore::caretColorFromStyle): Added.
(WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
caret-color directly since removeEquivalentProperties fails with semantic colors.
(WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
directly since removeEquivalentProperties fails with semantic colors.
* page/Frame.cpp:
(WebCore::Frame::createView): Drop backgroundColor.
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::recalculateBaseBackgroundColor): Added.
(WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
Calculate the backgroundColor based on the transparent argument only.
* page/FrameView.h:
* platform/graphics/Color.h:
(WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
since it ignores the semantic color flag.
* testing/Internals.cpp:
(WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
(WebCore::Internals::viewBaseBackgroundColor): Added.
* testing/Internals.h:
* testing/Internals.idl: Added viewBaseBackgroundColor.
2018-11-14 Justin Fan <justin_fan@apple.com>
[WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
https://bugs.webkit.org/show_bug.cgi?id=191383
Reviewed by Dean Jackson.
Covered by existing WebGPU tests introduced in original patch.
* Modules/webgpu/GPUDevice.h:
* Modules/webgpu/GPUPipelineStageDescriptor.h:
* Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
(): Refactored into enum class.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
(WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
* Modules/webgpu/GPUShaderModule.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
* Modules/webgpu/cocoa/GPURenderPipeline.h:
* Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
* Modules/webgpu/cocoa/GPUSwapChain.h:
* WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
https://bugs.webkit.org/show_bug.cgi?id=191612
Reviewed by Matt Baker.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::show):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
* page/PageDebuggable.h:
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::InspectorStubFrontend):
(WebCore::InspectorStubFrontend::closeWindow):
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::connect):
(WebCore::ServiceWorkerDebuggable::disconnect):
* workers/service/context/ServiceWorkerDebuggable.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
(WebCore::ServiceWorkerInspectorProxy::connectToWorker):
(WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
* workers/service/context/ServiceWorkerInspectorProxy.h:
2018-11-14 Timothy Hatcher <timothy@apple.com>
Update prefers-color-scheme media query matching based on GitHub issue #3278.
https://bugs.webkit.org/show_bug.cgi?id=191654
rdar://problem/46074307
Reviewed by Simon Fraser.
Test: css-dark-mode/prefers-color-scheme.html
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
for `no-preference` since there is no macOS option for no user preference.
* css/MediaQueryExpression.cpp:
(WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
2018-11-14 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
https://bugs.webkit.org/show_bug.cgi?id=191628
Reviewed by Dean Jackson.
Updated existing test: inspector/model/recording.html
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::buildAction):
Drive-by: prevent de-duplicated objects from being destroyed while recording.
2018-11-14 Stephan Szabo <stephan.szabo@sony.com>
[Win] Compile Service Worker support
https://bugs.webkit.org/show_bug.cgi?id=191409
Reviewed by Youenn Fablet.
Fix compilation errors when ENABLE(SERVICE_WORKER)
on Windows with clang-cl. Clang on dllexport
platforms does not support specifying the
dllexport on both a class and members of the class
and unistd.h isn't provided but also appeared to
not be used.
No new tests, should be covered by existing tests.
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/SWContextManager.cpp:
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
https://bugs.webkit.org/show_bug.cgi?id=191494
<rdar://problem/45469854>
Reviewed by Devin Rousso.
* inspector/InspectorClient.h:
(WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
Provide a hook so that a client may wish to allow direct remote inspection of the Page.
This is used by WebKitLegacy only.
* page/Page.cpp:
(Page::Page):
Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
This is used by WebKitLegacy only.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
* inspector/InspectorController.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
* page/PageDebuggable.h:
When a frontend connects, always enable the developer extras for the Page.
This is pretty much only for the remote path, which allows inspection if developer
extras were not already enabled (iOS). This simplifies the logic, and toggling
developer extras after it was already enabled is not really important.
2018-11-14 Per Arne Vollan <pvollan@apple.com>
REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
https://bugs.webkit.org/show_bug.cgi?id=190884
Reviewed by Dean Jackson.
Only notify display refresh monitors with matching display ID.
Test: fast/animation/request-animation-frame-in-two-pages.html
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/DisplayRefreshMonitorManager.h:
2018-11-14 Youenn Fablet <youenn@apple.com>
Convert libwebrtc error types to DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=191590
Reviewed by Alex Christensen.
Make use of overloaded callback method that provides an error type.
This type is then used to create a DOM exception with the correct type.
Covered by existing tests.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
(WebCore::toExceptionCode):
2018-11-14 Youenn Fablet <youenn@apple.com>
Allow to remove MediaStreamPrivate observers when iterating over observers
https://bugs.webkit.org/show_bug.cgi?id=187256
Reviewed by Eric Carlson.
Migrate the observer list from a Vector to a HashSet.
This is more robust to multiple observing and keeping of order of observers is not required.
Copy the set of observers to a vector before iterating over it.
This allows to remove an observer while iterating, which is now used in UserMediaRequest.
Covered by existing tests.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::mediaStreamIsReady):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addObserver):
(WebCore::MediaStreamPrivate::removeObserver):
(WebCore::MediaStreamPrivate::forEachObserver const):
(WebCore::MediaStreamPrivate::updateActiveState):
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
(WebCore::MediaStreamPrivate::characteristicsChanged):
* platform/mediastream/MediaStreamPrivate.h:
2018-11-14 Youenn Fablet <youenn@apple.com>
Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
https://bugs.webkit.org/show_bug.cgi?id=191603
Reviewed by Chris Dumez.
Make sure to check that the sender peer connection backend is matching.
Covered by rebased WPT test.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::removeTrack):
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::isCreatedBy const):
* Modules/mediastream/RTCRtpSender.h:
2018-11-14 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
https://bugs.webkit.org/show_bug.cgi?id=191620
Reviewed by Alex Christensen.
Remove a abstract class CookieJarCurl which is not needed anymore.
And, rename CookieJarCurlDatabase to CookieJarCurl.
No new tests because there's no behaviour change in WebCore.
* platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
* platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
* platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
* platform/network/curl/CookieJarCurlDatabase.h: Removed.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
2018-11-14 Christopher Reid <chris.reid@sony.com>
[WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
https://bugs.webkit.org/show_bug.cgi?id=191606
Reviewed by Michael Catanzaro.
No behavior change.
Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
* platform/wpe/PlatformKeyboardEventWPE.cpp:
(WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
(WebCore::PlatformKeyboardEvent::singleCharacterString):
2018-11-13 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
https://bugs.webkit.org/show_bug.cgi?id=191623
Reviewed by Antti Koivisto.
This patch expands the breaking behaviour to support separate start/end breaks.
<span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
input to line breaking -> <parent start middle end parent>
output of line breaking (considering infinite constraint) -> <parent start middle end parent>
due to padding, final runs -> <parent><start middle end><parent>
"parent" -> n/a
"start" -> BreakAtStart
" middle " -> n/a
"end" -> BreakAtEnd
"parent" -> n/a
Another example:
<span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
line breaking -> <parent start middle end parent>
due to padding-right, final runs -> <parent start middle end><parent>
"parent" -> n/a
"start" -> n/a
" middle " -> n/a
"end" -> BreakAtEnd
"parent" -> n/a
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
(WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::detachingRules const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::lastInlineItem const):
(WebCore::Layout::InlineFormattingState::addDetachingRule):
2018-11-14 Youenn Fablet <youenn@apple.com>
Add support for RTCRtpCodecParameters.sdpFmtpLine
https://bugs.webkit.org/show_bug.cgi?id=191591
Reviewed by Eric Carlson.
Covered by rebased test.
* Modules/mediastream/RTCRtpCodecParameters.h:
* Modules/mediastream/RTCRtpCodecParameters.idl:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCCodecParameters):
2018-11-14 Youenn Fablet <youenn@apple.com>
Add support for transport and peerConnection stats
https://bugs.webkit.org/show_bug.cgi?id=191592
Reviewed by Alex Christensen.
Covered by rebased tests.
* Modules/mediastream/RTCStatsReport.h:
(WebCore::RTCStatsReport::TransportStats::TransportStats):
(WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillRTCTransportStats):
(WebCore::fillRTCPeerConnectionStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2018-11-14 Ali Juma <ajuma@chromium.org>
Transform of composited layer not updated when layer also needs repaint
https://bugs.webkit.org/show_bug.cgi?id=191598
Reviewed by Simon Fraser.
Trigger a compositing geometry update whenever a RenderLayer's transform changes,
even when other parts of its style have changed in a way that produces a
StyleDifference greater than RecompositeLayer.
Test: compositing/geometry/transform-and-repaint-updates-geometry.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-13 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Support CTAP HID authenticators on macOS
https://bugs.webkit.org/show_bug.cgi?id=188623
<rdar://problem/43353777>
Reviewed by Brent Fulgham and Chris Dumez.
This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
Tests: http/wpt/webauthn/ctap-hid-failure.https.html
http/wpt/webauthn/ctap-hid-success.https.html
http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
http/wpt/webauthn/public-key-credential-create-success-hid.https.html
http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
http/wpt/webauthn/public-key-credential-get-success-hid.https.html
* Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
(WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
* Modules/webauthn/AuthenticatorCoordinatorClient.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPGetAssertionResponse):
* Modules/webauthn/fido/FidoConstants.h:
2018-11-13 Ross Kirsling <ross.kirsling@sony.com>
[WebRTC] Provide default implementation of LibWebRTCProvider
https://bugs.webkit.org/show_bug.cgi?id=191611
Reviewed by Michael Catanzaro.
Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
* PlatformWin.cmake:
* platform/GStreamer.cmake:
* platform/SourcesGLib.txt:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
* platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
2018-11-13 Timothy Hatcher <timothy@apple.com>
Use a light scrollbar for transparent web views in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=191559
rdar://problem/46000489
Reviewed by Dean Jackson.
Test: css-dark-mode/supported-color-schemes-scrollbar.html
* css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
* editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
(WebCore::createFragment):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
transparent web views in dark mode.
(WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
Return the body for document element renderer.
(WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
(WebCore::FrameView::styleColorOptions const): Added. Ditto.
* page/FrameView.h:
* rendering/style/RenderStyle.cpp:
(WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
(WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
(WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
* testing/Internals.cpp:
(WebCore::Internals::setViewIsTransparent): Added.
(WebCore::Internals::scrollbarOverlayStyle const): Added.
* testing/Internals.h:
* testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
2018-11-13 Ross Kirsling <ross.kirsling@sony.com>
[AppleWin] Unreviewed build fix after r238108.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printLayer):
(PlatformCALayerWin::embeddedViewID const):
* platform/graphics/ca/win/PlatformCALayerWin.h:
2018-11-13 Youenn Fablet <youenn@apple.com>
RTCPeerConnection.getTransceivers is not always exposing all transceivers
https://bugs.webkit.org/show_bug.cgi?id=191589
Reviewed by Eric Carlson.
Implement the collect transceiver algorithm using libwebrtc backend.
Call this algorithm everytime transceivers are retrieved from JS.
For Plan B, make this a no-op as this is not supported.
Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
Covered by existing and rebased tests.
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::collectTransceivers):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getSenders const):
(WebCore::RTCPeerConnection::getReceivers const):
(WebCore::RTCPeerConnection::getTransceivers const):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
(WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
(WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2018-11-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Do not show selection UI for editable elements with opacity near zero
https://bugs.webkit.org/show_bug.cgi?id=191442
<rdar://problem/45958625>
Reviewed by Simon Fraser.
Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
editing/selection/ios/hide-selection-after-hiding-contenteditable.html
editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
editing/selection/ios/hide-selection-in-hidden-contenteditable.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isTransparentRespectingParentFrames const):
Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
Opacity on ancestor elements is applied multiplicatively.
* rendering/RenderObject.h:
2018-11-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Observer AVCaptureDevice "suspended" property
https://bugs.webkit.org/show_bug.cgi?id=191587
<rdar://problem/46030598>
Reviewed by Youenn Fablet.
No new tests, AVCapture can only be tested manually.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
the first time the device list is scanned.
(WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
change device availability.
(WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all
devices and add them to the cached list.
(WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
(WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
devices.
(WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
(WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
(-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
(-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
(-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
(WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
(WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
(WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
(-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
(-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
and "suspended".
(WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
(WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2018-11-13 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
https://bugs.webkit.org/show_bug.cgi?id=191597
Reviewed by Joseph Pecoraro.
When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
meaning that we may try to fetch in situations previously unexpected.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
2018-11-13 Timothy Hatcher <timothy@apple.com>
Treat supported-color-schemes as the second highest priority property.
https://bugs.webkit.org/show_bug.cgi?id=191556
rdar://problem/46000076
Reviewed by Dean Jackson.
Test: css-dark-mode/supported-color-schemes-priority.html
* css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
after -webkit-ruby-position, before other properties, so it can affect resolved colors.
2018-11-13 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
https://bugs.webkit.org/show_bug.cgi?id=191316
Reviewed by Xabier Rodriguez-Calvar.
Another preparation in patch getting ready to move the decryption
logic behind the CDMInstance and out of the GStreamer decryptors
themselves. The first step taken here is to arrange for the
instances to always be available in the decryptors when they need
to decrypt content.
In doing so, there were a number of hairy bits of code that could
use some abstraction, so the opportunity was taken to do that as
well.
Covered by tests in media/encrypted-media and
imported/w3c/web-platform-tests/encrypted-media.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
drm-key-needed since it was not being used anywhere.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
Factor out the parsing of decryption system information from
GStreamer, since it was not clear what that code was doing unless
you squinted pretty hard. Also remove the duplicated
initialization-data-encountered posting.
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
Refactored to make it a more general method and usable in more
situations. It now has an optional to stop it from eliding init
datas for a different key system. This is required the first time
we post them, since if a CDM instance has already been set, and if
the stream init datas are for different systems, we ended up never
posting an encrypted event.
(WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
Actually send a CDMInstance now when in regular playback mode.
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
Remove m_needToSendCredentials, it was not being used.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
Refactored to use the new initializationDataEncountered.
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
Log the waiting state, since it was currently not clear what that
logging message was even telling you!
(WebCore::extractEventsAndSystemsFromMessage): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::InitData::InitData): New class that encapsulates both
single instantiation and streaming instantiation.
(WebCore::InitData::append): Used for the streaming mode, when you
are concatenating init datas together.
(WebCore::InitData::payload const):
(WebCore::InitData::systemId const):
(WebCore::InitData::payloadContainerType const):
(WebCore::InitData::isFromDifferentContainer):
(WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
(WebCore::ProtectionSystemEvents::events const):
(WebCore::ProtectionSystemEvents::availableSystems const):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
waiting-for-key after requesting a CDM instance, it will flap back
to not waiting for a key almost immediately, didn't make sense
positing after requesting an instance. Also post key-received when
we receive the key.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
been arranged that a CDMInstance will always be present in an OOB
message, so parse it out here.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
As above, make sure when posting the OOB that a CDMInstance is present.
2018-11-13 Charlie Turner <cturner@igalia.com>
Various compiler warnings/errors fixes.
https://bugs.webkit.org/show_bug.cgi?id=191583
Reviewed by Frédéric Wang.
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
ASSERT is only compiled in DEBUG mode, so guarding with
!LOG_DISABLED is wrong.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
mode, so guarding with !LOG_DISABLED was wrong.
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
Ditto, this time with member .depth.
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::styleChanged): Add another unused
parameter.
2018-11-12 Antoine Quint <graouts@apple.com>
[Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
https://bugs.webkit.org/show_bug.cgi?id=191542
<rdar://problem/45356027>
Reviewed by Simon Fraser.
Test: animations/no-style-recalc-during-accelerated-animation.html
In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
for that time when we'll schedule animation resolution.
By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
we also update animations in-flight to dispatch "animationiteration" events.
* animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
(WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
(WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
(WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
cache the current time in suspendAnimations() without also automatically clearing the current time.
(WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
by virtue of using cacheCurrentTime(). This fixes some flakiness.
(WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime().
(WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
(WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
(WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
and call scheduleNextTick().
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
(WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
function to get that information directly through the WebAnimation object without bothering about its effect.
(WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
(WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
* animation/WebAnimation.h:
2018-11-13 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
https://bugs.webkit.org/show_bug.cgi?id=191545
Reviewed by Žan Doberšek.
Keep track of layer size changes even if they happen when the layer is not in the visible
area, so we can update edge tiles when the layer gets visible.
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::createTiles):
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
2018-11-12 Rob Buis <rbuis@igalia.com>
Content-Type parameter values should allow empty quoted strings
https://bugs.webkit.org/show_bug.cgi?id=191388
Reviewed by Dean Jackson.
According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
quoted strings are acceptable for Content-Type parameter values. They
are accepted by Firefox and Chrome implementations as well.
Test: web-platform-tests/xhr/overridemimetype-blob.html
* platform/network/ParsedContentType.cpp:
(WebCore::parseToken):
(WebCore::parseQuotedString):
(WebCore::parseContentType):
* platform/network/ParsedContentType.h:
2018-11-12 Christopher Reid <chris.reid@sony.com>
[Curl] Reject entire cookie if the domain fails a tailmatch.
https://bugs.webkit.org/show_bug.cgi?id=191406
Reviewed by Youenn Fablet.
Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
Also cleanup Cookie database implementation to make them testable better.
Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::canAcceptCookie): Added.
(WebCore::CookieJarDB::setCookie):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieAttributes):
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CookieUtil.h:
2018-11-12 Devin Rousso <drousso@apple.com>
Web Inspector: Network: show secure certificate details per-request
https://bugs.webkit.org/show_bug.cgi?id=191447
<rdar://problem/30019476>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/network/resource-response-security.html
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
Always save certificate information when WebInspector is open.
* platform/network/CertificateInfoBase.h: Added.
(WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
(WebCore::CertificateInfoBase::summaryInfo const):
(WebCore::CertificateInfoBase::isEmpty const):
* platform/network/cf/CertificateInfo.h:
(WebCore::CertificateInfo::summaryInfo const): Added.
* platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
(WebCore::CertificateInfo::summaryInfo const): Added.
* platform/network/curl/CertificateInfo.h:
(WebCore::CertificateInfo::summaryInfo const): Added.
(WebCore::CertificateInfo::isEmpty const): Added.
* platform/network/soup/CertificateInfo.h:
(WebCore::CertificateInfo::summaryInfo const): Added.
(WebCore::CertificateInfo::isEmpty const): Added.
Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
platform-specific code in its implementation.
* platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
* platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
* platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
* inspector/NetworkResourcesData.h:
(WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
(WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::responseReceived):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/Curl.cmake:
* platform/SourcesSoup.txt:
2018-11-12 Zalan Bujtas <zalan@apple.com>
Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
https://bugs.webkit.org/show_bug.cgi?id=191554
<rdar://problem/45825265>
Reviewed by Antti Koivisto.
While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
Moving a renderer is a 2 step process:
1. Detach the renderer from its current parent
2. Attach it to its new parent.
During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling
is not needed anymore (except we use it as the new parent).
Test: fast/inline/marker-list-item-move-should-not-crash.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::detach):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::detach):
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
2018-11-12 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
https://bugs.webkit.org/show_bug.cgi?id=191358
Reviewed by Manuel Rego Casasnovas.
These changes are just a refactoring to ease the integration of the new Baseline Alignment
logic in a follow up patch.
We need to properly estimate the grid area size of orthogonal items so that we can perform
an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
if they participate in any baseline alignment context.
No new tests, since no behavior change has been introduced in this patch.
* rendering/Grid.cpp:
(WebCore::Grid::setNeedsItemsPlacement):
* rendering/Grid.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
(WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
(WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
(WebCore::GridTrackSizingAlgorithm::run):
(WebCore::GridTrackSizingAlgorithm::reset):
* rendering/GridTrackSizingAlgorithm.h:
(WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::overrideSizeChanged):
(WebCore::hasRelativeBlockAxisSize):
(WebCore::RenderGrid::updateGridAreaLogicalSize const):
(WebCore::RenderGrid::layoutGridItems):
* rendering/RenderGrid.h:
2018-11-12 Sihui Liu <sihui_liu@apple.com>
imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
https://bugs.webkit.org/show_bug.cgi?id=191500
Reviewed by Dean Jackson.
When double value is bigger than maximum unsigned int, converting double to unsigned int has
different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
maximum unsigned int.
Covered by existing test.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2018-11-12 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API Test for Curl cookie backend.
https://bugs.webkit.org/show_bug.cgi?id=191493
Reviewed by Youenn Fablet.
Refactoring for cookie backend interface.
Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
* platform/FileSystem.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::cookiesForSession):
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
(WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
(WebCore::CookieJarCurlDatabase::getRawCookies const):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::checkSQLiteReturnCode):
(WebCore::CookieJarDB::isEnabled const):
(WebCore::CookieJarDB::searchCookies):
(WebCore::CookieJarDB::setCookie):
(WebCore::CookieJarDB::deleteCookie):
(WebCore::CookieJarDB::deleteCookieInternal):
(WebCore::CookieJarDB::deleteCookies):
(WebCore::CookieJarDB::deleteAllCookies):
(WebCore::CookieJarDB::executeSimpleSql):
(WebCore::CookieJarDB::isEnabled): Deleted.
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CookieUtil.h:
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::generateTemporaryPath):
(WebCore::FileSystem::openTemporaryFile):
(WebCore::FileSystem::createTemporaryDirectory):
(WebCore::FileSystem::deleteNonEmptyDirectory):
2018-11-12 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
<rdar://problem/30107985>
Reviewed by Dean Jackson.
Tests: editing/images/basic-editable-image.html
editing/images/reparent-editable-image-maintains-strokes.html
Add the beginnings of a mechanism to replace images with a special attribute
with a native drawing view in the UI process.
* page/Settings.yaml:
Add a setting to control whether images become natively editable when they
have the x-apple-editable-image attribute.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::editableImageViewID const):
Lazily generate an EmbeddedViewID and persist it on the <img> element.
* html/HTMLImageElement.h:
Rearrange the service controls methods to sit before the members.
Add m_editableImageViewID and editableImageViewID().
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::nextEmbeddedViewID):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setContentsToEmbeddedView):
Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
on Cocoa platforms and when using RemoteLayerTree.
Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
and an EmbeddedViewID to uniquely identify and communicate about the
embedded view (which may move between layers, since it is tied to an element).
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
(WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
When setting GraphicsLayer's contents to an embedded view, we use
a special PlatformCALayer factory that takes the EmbeddedViewID and type.
GraphicsLayerCARemote will override this and make a correctly-initialized
PlatformCALayerRemote that keeps track of the EmbeddedViewID.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
(WebCore::PlatformCALayerCocoa::embeddedViewID const):
Add stubs and logging for EmbeddedViewID on PlatformCALayer.
These will be overridden by PlatformCALayerRemote to do more interesting things.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isEditableImage const):
Add a getter that return true if the setting is enabled and
x-apple-editable-image is empty or true.
(WebCore::RenderImage::requiresLayer const):
RenderImage requires a layer either if RenderReplaced does, or we are an
editable image.
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
* rendering/RenderLayerCompositor.h:
Make editable images require compositing implicitly.
2018-11-12 Don Olmstead <don.olmstead@sony.com>
Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
https://bugs.webkit.org/show_bug.cgi?id=189230
<rdar://problem/44050379>
Reviewed by Joseph Pecoraro.
Runs all png images through zopflipng. This results in a smaller file
size and takes care of this issue as a byproduct.
* Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
* Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
* Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
* Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
* Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
* Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
* Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
* Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
* Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
* Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
* Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
* Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
* Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
* Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
* Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
* Resources/AttachmentPlaceholder.png:
* Resources/AttachmentPlaceholder@2x.png:
* Resources/ListButtonArrow.png:
* Resources/ListButtonArrow@2x.png:
* Resources/missingImage.png:
* Resources/missingImage@2x.png:
* Resources/missingImage@3x.png:
* Resources/moveCursor.png:
* Resources/northEastSouthWestResizeCursor.png:
* Resources/northSouthResizeCursor.png:
* Resources/northWestSouthEastResizeCursor.png:
* Resources/nullPlugin.png:
* Resources/nullPlugin@2x.png:
* Resources/panIcon.png:
* Resources/textAreaResizeCorner.png:
* Resources/textAreaResizeCorner@2x.png:
* Resources/urlIcon.png:
2018-11-12 Youenn Fablet <youenn@apple.com>
RealtimeOutgoing A/V sources should observe their sources only if having a sink
https://bugs.webkit.org/show_bug.cgi?id=191490
Reviewed by Eric Carlson.
Observe the source that generates media based on the sinks:
- Do not observe at creation time
- For first sink, start observing
- When no more sink, stop observing
Apply this principle for both outgoing audio and video sources.
Add locks for the sinks to ensure thread-safety.
Make sinks HashSet which is more robust.
Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
Covered by existing tests and updated webrtc/remove-track.html.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::stop):
(WebCore::RealtimeOutgoingAudioSource::AddSink):
(WebCore::RealtimeOutgoingAudioSource::RemoveSink):
(WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::observeSource):
(WebCore::RealtimeOutgoingVideoSource::setSource):
(WebCore::RealtimeOutgoingVideoSource::stop):
(WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
(WebCore::RealtimeOutgoingVideoSource::RemoveSink):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
(WebCore::RealtimeOutgoingVideoSource::isSilenced const):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
(WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2018-11-12 Youenn Fablet <youenn@apple.com>
Support setting stream ids when adding a transceiver
https://bugs.webkit.org/show_bug.cgi?id=191307
Reviewed by Eric Carlson.
Add support for streams in RTCTransceiverInit.
Add plumbing down to libwebrtc.
Covered by rebased tests.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRtpTransceiverInit):
2018-11-12 Antti Koivisto <antti@apple.com>
Support dynamic pseudo-classes on elements with display: contents
https://bugs.webkit.org/show_bug.cgi?id=181640
<rdar://problem/36605415>
Reviewed by Dean Jackson.
The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
text properties).
Test: fast/css/display-contents-hover-active.html
* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
but also includes display:content elements. This also allows removing the special display:none case.
* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setHovered):
Also look into display:contents style for invalidation checks.
(WebCore::Element::renderOrDisplayContentsStyle const):
Make this helper an Element member.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::parentElementInComposedTree const):
Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
* rendering/updating/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::nextSiblingRenderer const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::shouldResolveElement):
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::renderOrDisplayContentsStyle): Deleted.
Use the Element::renderOrDisplayContentsStyle() instead.
2018-11-12 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations experimental
https://bugs.webkit.org/show_bug.cgi?id=191543
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2018-11-12 Simon Fraser <simon.fraser@apple.com>
feFlood with alpha color doesn't work correctly
https://bugs.webkit.org/show_bug.cgi?id=163666
Reviewed by Zalan Bujtas.
FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
rather than multiplying the flood color with the flood opacity as other browsers do.
Test: svg/filters/feFlood-with-alpha-color.html
* platform/graphics/Color.cpp:
(WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
and it triggered a behavior change, so add a comment.
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):
2018-11-12 Eric Carlson <eric.carlson@apple.com>
Require <iframe allow="display"> for an iframe to use getDisplayMedia
https://bugs.webkit.org/show_bug.cgi?id=191505
<rdar://problem/45968811>
Reviewed by Jer Noble.
Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start):
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isAllowedToUse):
(WebCore::UserMediaController::canCallGetUserMedia):
(WebCore::UserMediaController::logGetUserMediaDenial):
* Modules/mediastream/UserMediaController.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
2018-11-12 Simon Fraser <simon.fraser@apple.com>
Make compositing updates incremental
https://bugs.webkit.org/show_bug.cgi?id=90342
Reviewed by Antti Koivisto.
Previously, updating compositing layers required two full RenderLayer tree traversals,
and all the work was done for every RenderLayer on each composting update. This could be expensive
on pages with lots of RenderLayers.
These changes make compositing updates more incremental. Compositing updates still require
two tree traversals. The first determines which RenderLayers need to be composited (of those which
weren't already made composited at style-change time), because of reasons that can only be determined
post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
it hard to fold these two traversals together.
In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
"compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
to be visited.
Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
be skipped if no change has triggered the need for that traversal.
These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
excluding composited filters from the composited bounds (but still taking them into account for overlap).
Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
Code to set the dirty bits is added in various places that change properties that compositing depends on.
These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
traversal, which is always a pre-order traversal.
Tests: compositing/geometry/stacking-context-change-layer-reparent.html
compositing/layer-creation/change-to-overlap.html
compositing/updates/no-updates-in-non-composited-iframe.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
* page/FrameView.cpp:
(WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::shouldBeStackingContext const):
(WebCore::RenderLayer::stackingContext const):
(WebCore::RenderLayer::dirtyZOrderLists):
(WebCore::RenderLayer::dirtyNormalFlowList):
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
(WebCore::RenderLayer::contentChanged):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateTransform):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::enclosingCompositingLayer const):
(WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
(WebCore::RenderLayer::clippingRootForPainting const):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTest):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::compositingContainer): Deleted.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::clearZOrderLists):
(WebCore::RenderLayer::paintOrderParent const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::paintsContent const):
(WebCore::RenderLayerBacking::contentChanged):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::animationFinished):
(WebCore::RenderLayerBacking::startTransition):
(WebCore::RenderLayerBacking::transitionFinished):
(WebCore::RenderLayerBacking::setCompositedBounds):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::CompositingState::CompositingState):
(WebCore::RenderLayerCompositor::enableCompositingMode):
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
(WebCore::RenderLayerCompositor::willRecalcStyle):
(WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::clippingChanged):
(WebCore::styleAffectsLayerGeometry):
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::updateLayerCompositingState):
(WebCore::RenderLayerCompositor::layerWasAdded):
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
(WebCore::RenderLayerCompositor::computeExtent const):
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::needsToBeComposited const):
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::clippedByAncestor const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
(WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
(WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
(WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
(WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
(WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
(WebCore::operator<<):
(WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
(WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
(WebCore::isScrollableOverflow): Deleted.
(WebCore::styleHasTouchScrolling): Deleted.
(WebCore::styleChangeRequiresLayerRebuild): Deleted.
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
(WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
* rendering/RenderLayerCompositor.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
2018-11-12 Rob Buis <rbuis@igalia.com>
CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=190839
Reviewed by Frédéric Wang.
The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
wastes memory since it will always have size 2 but claims the
default Vector size. So make sure to reserve an initial capacity of 2.
* css/CSSCalculationValue.cpp:
2018-11-12 Yusuke Suzuki <yusukesuzuki@slowstart.org>
WTFMove(xxx) is used in arguments while other arguments touch xxx
https://bugs.webkit.org/show_bug.cgi?id=191544
Reviewed by Alex Christensen.
The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
xxx should not be touched in the other arguments. This patch fixes such uses in
IDB code.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::deleteIndex):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::scheduleOperation):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::registerIndex):
2018-11-12 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Construct dedicated runs when the inline element requires it.
https://bugs.webkit.org/show_bug.cgi?id=191509
Reviewed by Antti Koivisto.
In certain cases, a run can overlap multiple inline elements like this:
<span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::contentRequiresSeparateRun):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::processInlineTextItem):
* layout/inlineformatting/InlineRunProvider.h:
(WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
(WebCore::Layout::InlineRunProvider::Run::textContext):
(WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
(WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
2018-11-12 Jer Noble <jer.noble@apple.com>
[MSE] Frame re-ordering can cause iframes to never be enqueued
https://bugs.webkit.org/show_bug.cgi?id=191485
Reviewed by Eric Carlson.
Test: media/media-source/media-source-dropped-iframe.html
Some frame re-ordering techniques result in files where the first frame has a
decode timestamp < 0, but a presentation timestamp >= 0. When appending these
samples to existing content, we can fail to enqueue the first frame because its
DTS overlaps an existing sample, but the presentation timestamp does not.
Rather than try to only enqueue samples whose decode timestamps are > than the
greatest decode end timestamp (minus some fudge factor), allow all frames to be
added to the decode queue if they are strictly ordered greater than the last
enqueued frame.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::reenqueueMediaForTime):
2018-11-12 Yusuke Suzuki <yusukesuzuki@slowstart.org>
IDBTransaction does not use "RefPtr<IDBTransaction> self"
https://bugs.webkit.org/show_bug.cgi?id=190436
Reviewed by Alex Christensen.
It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
Use `protectedThis = makeRef(*this)` instead.
No behavior change.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
2018-11-12 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Introduce AbortableTaskQueue
https://bugs.webkit.org/show_bug.cgi?id=190902
Reviewed by Xabier Rodriguez-Calvar.
A new synchronization primitive is introduced: AbortableTaskQueue,
which allows to send work to the main thread from a background thread
with the option to perform two-phase cancellation (startAborting() and
finishAborting()).
This new primitive has been used to overhaul GstBus messaging in
AppendPipeline. A lot of code made redundant has been deleted in the
process and lots of internal functions were now able to be made
private. As part of the refactor all glib signals in AppendPipeline
now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
have been replaced by isMainThread() for consistency with the rest of
WebKit.
Two-phase cancellation is still not used in AppendPipeline as of this
patch, but it will be used in a future patch that makes use of
GStreamer flushes to implement correct MSE abort semantics. There are
unit tests to ensure it works correctly, even if it's still not used.
* WebCore.xcodeproj/project.pbxproj:
* platform/AbortableTaskQueue.h: Added.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::dumpAppendState):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
(WebCore::AppendPipeline::sourceBufferPrivate):
(WebCore::AppendPipeline::appsinkCaps):
(WebCore::AppendPipeline::track):
(WebCore::AppendPipeline::demuxerSrcPadCaps):
(WebCore::AppendPipeline::playerPrivate):
2018-11-12 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] waitingforkey event should consider decryptors' waiting status
https://bugs.webkit.org/show_bug.cgi?id=191459
Reviewed by Carlos Garcia Campos.
The new cross platform architecture to report waitingforkey and
recover from it requires a more accurate knowledge of what is
going on with the decryptors because events are reported only once
(per key exchange run) and crossplatform only continues if we are
actually ready to continue, meaning that no decryptors are
waiting.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
GstIterator deleter.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
out if we are requested to not wait anymore but there are still
waiting decryptors.
(WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
Query the pipeline, just a query after pipeline is built and
manual inspection during build. The query is optimal but sometimes
we can get this request when the pipeline is under construction so
queries do not arrive at the decryptors and we have to deliver it
by ourselves.
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
Deleted because it is now inlined.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkit_media_common_encryption_decrypt_class_init): Override
query method.
(webkitMediaCommonEncryptionDecryptTransformInPlace): When the
decryptor is going to block to wait, report before. When the
decryptor receives the key, report it got it.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
handle waitingforkey here.
(webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
decryptor is waiting.
2018-11-12 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Silence ATK_XY_PARENT warnings
https://bugs.webkit.org/show_bug.cgi?id=191504
Reviewed by Carlos Garcia Campos.
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(atkToContents):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(textExtents):
* accessibility/atk/WebKitAccessibleUtil.cpp:
(contentsRelativeToAtkCoordinateType):
2018-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
Implement a new edit command to change the enclosing list type
https://bugs.webkit.org/show_bug.cgi?id=191487
<rdar://problem/45955922>
Reviewed by Ryosuke Niwa.
Add support for a new edit command that changes the type of the enclosing list element around the selection from
unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
SPI on WKWebView (`-_changeListType:`).
This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
implemented entirely by Mail). See below for more details.
Test: editing/execCommand/change-list-type.html
WKWebViewEditActions.ChangeListType
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/ChangeListTypeCommand.cpp: Added.
(WebCore::listConversionTypeForSelection):
(WebCore::ChangeListTypeCommand::listConversionType):
Helper that returns a potential list conversion command that may be executed at the given document's selection,
if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
DOM from the lowest common ancestor container of the current selection until we hit the first list element.
(WebCore::ChangeListTypeCommand::createNewList):
Helper method to create a new list element to replace the given list, and then clone element data from the given
list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
which contains inline style properties drops the inline styles, because existing logic in Mail that implements
this editing command only copies the `class` attribute of the old list to the new list.
(WebCore::ChangeListTypeCommand::doApply):
Apply the edit command by running the following steps:
- Find the enclosing list element, if any (see above).
- Create a new list element of the opposite type as the enclosing list, and clone over element data from the
list element being replaced.
- Insert the new list next to the original list.
- Move all children of the original list to the new list.
- Remove the original list.
- Set the selection to the end of the new list.
* editing/ChangeListTypeCommand.h: Added.
* editing/EditAction.h:
Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
* editing/Editor.cpp:
(WebCore::Editor::changeSelectionListType):
Implement this by creating and applying a new ChangeListTypeCommand.
(WebCore::Editor::canChangeSelectionListType): Deleted.
Remove this for now, since there's no need for it until full support for edit command validation is implemented.
* editing/Editor.h:
* testing/Internals.cpp:
(WebCore::Internals::changeSelectionListType):
* testing/Internals.h:
* testing/Internals.idl:
Add internal hooks to change list type from layout tests.
2018-11-11 Daniel Bates <dabates@apple.com>
[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>
Reviewed by Dean Jackson.
Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
fields on iOS more closely match the behavior of password fields on Mac.
The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
web views listen for keyboard availability changes so as to update the the caps lock state when
a hardware keyboard is detached or attached.
* WebCore.xcodeproj/project.pbxproj:
* page/EventHandler.cpp:
(WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
(WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
* page/EventHandler.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]): Added.
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
shared by both Mac and iOS.
2018-11-11 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] In-flow positioned logic is really formatting context dependent.
https://bugs.webkit.org/show_bug.cgi?id=191512
Reviewed by Simon Fraser.
Move block formatting context specific code from FormattingContext to BlockFormattingContext.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-11-11 Myles C. Maxfield <mmaxfield@apple.com>
Address post-review comments after r237955
https://bugs.webkit.org/show_bug.cgi?id=191496
Reviewed by Darin Adler.
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
* style/InlineTextBoxStyle.h:
2018-11-11 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
Rename file.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* page/mac/EventHandlerMac.mm:
* platform/mac/URLMac.mm:
* platform/mac/WebCoreNSURLExtras.mm:
* platform/mac/WebCoreObjCExtras.mm:
* rendering/RenderThemeMac.mm:
2018-11-10 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* page/mac/EventHandlerMac.mm:
* platform/mac/URLMac.mm:
* platform/mac/WebCoreNSURLExtras.mm:
* platform/mac/WebCoreObjCExtras.mm:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
2018-11-10 Megan Gardner <megan_gardner@apple.com>
Fix build for 32bit Mac
https://bugs.webkit.org/show_bug.cgi?id=191511
Unreviewed Build Fix.
Build fix, not tests needed.
Make the apporiate delecrations for 32-bit mac support.
* editing/mac/DictionaryLookup.mm:
2018-11-10 Simon Fraser <simon.fraser@apple.com>
Remove support for -webkit-svg-shadow
https://bugs.webkit.org/show_bug.cgi?id=187429
<rdar://problem/41920735>
Reviewed by Dean Jackson.
-webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
so remove it. No other browser supports it, and chromestatus say it's used on less than
0.000001% of pages.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
(WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
(WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::didAttachChild):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::layout):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::RenderSVGModelObject):
* rendering/svg/RenderSVGModelObject.h:
(WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
(WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
(WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::RenderSVGRoot):
(WebCore::RenderSVGRoot::updateCachedBoundaries):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::updateRepaintBoundingBox):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
(WebCore::SVGRenderSupport::layoutChildren):
(WebCore::SVGRenderSupport::styleChanged):
(WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
(WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
(WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
(WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
(WebCore::SVGRenderSupport::childAdded): Deleted.
* rendering/svg/SVGRenderSupport.h:
2018-11-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238065.
Breaks internal builds.
Reverted changeset:
"Make it possible to edit images inline"
https://bugs.webkit.org/show_bug.cgi?id=191352
https://trac.webkit.org/changeset/238065
2018-11-10 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
<rdar://problem/30107985>
Reviewed by Dean Jackson.
Tests: editing/images/basic-editable-image.html
editing/images/reparent-editable-image-maintains-strokes.html
Add the beginnings of a mechanism to replace images with a special attribute
with a native drawing view in the UI process.
* page/Settings.yaml:
Add a setting to control whether images become natively editable when they
have the x-apple-editable-image attribute.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::editableImageViewID const):
Lazily generate an EmbeddedViewID and persist it on the <img> element.
* html/HTMLImageElement.h:
Rearrange the service controls methods to sit before the members.
Add m_editableImageViewID and editableImageViewID().
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::nextEmbeddedViewID):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setContentsToEmbeddedView):
Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
on Cocoa platforms and when using RemoteLayerTree.
Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
and an EmbeddedViewID to uniquely identify and communicate about the
embedded view (which may move between layers, since it is tied to an element).
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
(WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
When setting GraphicsLayer's contents to an embedded view, we use
a special PlatformCALayer factory that takes the EmbeddedViewID and type.
GraphicsLayerCARemote will override this and make a correctly-initialized
PlatformCALayerRemote that keeps track of the EmbeddedViewID.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
(WebCore::PlatformCALayerCocoa::embeddedViewID const):
Add stubs and logging for EmbeddedViewID on PlatformCALayer.
These will be overridden by PlatformCALayerRemote to do more interesting things.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isEditableImage const):
Add a getter that return true if the setting is enabled and
x-apple-editable-image is empty or true.
(WebCore::RenderImage::requiresLayer const):
RenderImage requires a layer either if RenderReplaced does, or we are an
editable image.
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
* rendering/RenderLayerCompositor.h:
Make editable images require compositing implicitly.
2018-11-09 Zalan Bujtas <zalan@apple.com>
[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
https://bugs.webkit.org/show_bug.cgi?id=191078
<rdar://problem/45736178>
Reviewed by Antti Koivisto.
1. Improve visuallyNonEmpty milestone confidence level.
Ignore whitespace and non visible text content.
Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
Check if the html/body is actually visible.
2. Issue initial paint soon after the milestone fires.
Use a 0ms timer to flush the initial paint.
Throttle additional flushes for 500ms and 1.5s (original behaviour).
3. Suspend optional style recalcs and layouts while painting is being throttled.
When parsing yields we initiate a 0ms style recalc/layout timer.
These optional layouts produce content that we have no intention to paint.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::shouldScheduleLayout):
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
(WebCore::FrameView::updateIsVisuallyNonEmpty):
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
* platform/graphics/FontCascade.h:
* rendering/RenderText.cpp: Check whether the text is actually visible at this point.
(WebCore::RenderText::RenderText):
2018-11-09 John Wilander <wilander@apple.com>
Add ability to configure document.cookie lifetime cap through user defaults
https://bugs.webkit.org/show_bug.cgi?id=191480
<rdar://problem/45240871>
Reviewed by Chris Dumez.
No new tests. Existing test makes sure we don't regress.
This change makes the capped lifetime in seconds configurable through
user defaults.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
(WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
Renamed setAgeCapForClientSideCookies().
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
2018-11-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238047.
Introduced layout test failures on iOS simulator.
Reverted changeset:
"[iOS] Draw caps lock indicator in password fields"
https://bugs.webkit.org/show_bug.cgi?id=190565
https://trac.webkit.org/changeset/238047
2018-11-09 Tim Horton <timothy_horton@apple.com>
Normal-flow-only flex items don't correctly respect z-index
https://bugs.webkit.org/show_bug.cgi?id=191486
Reviewed by Simon Fraser.
Test: css3/flexbox/z-index-with-normal-flow-only.html
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
r125693 did not ensure that flex items which would otherwise be
normal-flow-only would be put into the z-order tree when necessary.
Fix by respecting the same trigger we use to make layers for flex items;
namely, not having auto z-index.
2018-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Implement SPI on WKWebView to increase and decrease list levels
https://bugs.webkit.org/show_bug.cgi?id=191471
<rdar://problem/45952472>
Reviewed by Tim Horton.
Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
* editing/Editor.cpp:
(WebCore::Editor::canChangeSelectionListType):
(WebCore::Editor::changeSelectionListType):
* editing/Editor.h:
2018-11-09 Keith Rollin <krollin@apple.com>
Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
Remove the use of .xcfilelists until their side-effects are better
understood.
* WebCore.xcodeproj/project.pbxproj:
2018-11-09 Jer Noble <jer.noble@apple.com>
SourceBuffer throws an error when appending a second init segment after changeType().
https://bugs.webkit.org/show_bug.cgi?id=191474
Reviewed by Eric Carlson.
Test: media/media-source/media-source-changetype-second-init.html
When encountering an initialization segment after changeType(), add the parsed codec types
to the list of allowed codecs.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::validateInitializationSegment):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::supportsType):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::canSwitchToType):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
2018-11-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
https://bugs.webkit.org/show_bug.cgi?id=191479
<rdar://problem/45952201>
Reviewed by Jer Noble.
No new tests, tested manually.
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
video frame sizes, correct a typo.
(WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
rescaled sized when we already have an exact or aspect ratio match because it won't be used.
* platform/mediastream/mac/AVVideoCaptureSource.h:
(WebCore::AVVideoCaptureSource::width const): Deleted.
(WebCore::AVVideoCaptureSource::height const): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
(WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
(WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
the frame may be resized before deliver.
2018-11-09 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed MSVC build fix after r238039 (and r238046).
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.h:
2018-11-09 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl][WebKit] Implement Proxy configuration API.
https://bugs.webkit.org/show_bug.cgi?id=189053
Reviewed by Youenn Fablet.
Added API to set proxy from the app.
No new tests because there's no behaviour change in WebCore.
* platform/network/NetworkStorageSession.h:
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::setProxySettings):
* platform/network/curl/CurlProxySettings.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::setProxySettings const):
2018-11-09 Antti Koivisto <antti@apple.com>
Use OptionSet for layout milestones
https://bugs.webkit.org/show_bug.cgi?id=191470
Reviewed by Dean Jackson.
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didReachLayoutMilestone):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::addPaintPendingMilestones):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
* page/FrameView.h:
* page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
Renamed to appease WK2 IPC code generation.
* page/LayoutMilestones.h: Removed.
* page/Page.cpp:
(WebCore::Page::addLayoutMilestones):
(WebCore::Page::removeLayoutMilestones):
(WebCore::Page::isCountingRelevantRepaintedObjects const):
* page/Page.h:
(WebCore::Page::requestedLayoutMilestones const):
2018-11-09 Daniel Bates <dabates@apple.com>
[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>
Reviewed by Dean Jackson.
Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
web views listen for keyboard availability changes so as to update the the caps lock state when
a hardware keyboard is detached or attached.
* WebCore.xcodeproj/project.pbxproj:
* page/EventHandler.cpp:
(WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
(WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
* page/EventHandler.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]): Added.
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
shared by both Mac and iOS.
2018-11-09 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix WinCairo build after r238039.
* bindings/js/JSWorkerGlobalScopeBase.h:
2018-11-09 Fujii Hironori <Hironori.Fujii@sony.com>
Extensions3DOpenGLES.h: warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
https://bugs.webkit.org/show_bug.cgi?id=191451
Reviewed by Dean Jackson.
No new tests because there is no behavior change.
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
* platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
2018-11-09 Andy Estes <aestes@apple.com>
[Payment Request] canMakePayment() should not consider serialized payment method data
https://bugs.webkit.org/show_bug.cgi?id=191432
Reviewed by Dean Jackson.
In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
canMakePayment() to not consider serialized payment method data when deciding if a payment
method is supported. For Apple Pay, this means we resolve to true for
"https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
fields.
Added test cases to
http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
http/tests/paymentrequest/payment-request-show-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::canMakePayment):
2018-11-09 Andy Estes <aestes@apple.com>
[Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
https://bugs.webkit.org/show_bug.cgi?id=191440
Reviewed by Dean Jackson.
PaymentResponse.details was being initialized in the PaymentResponse constructor and never
updated when the user accepts a retried payment. We need to update it.
Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::accept):
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::setDetailsFunction):
* Modules/paymentrequest/PaymentResponse.h:
2018-11-09 Fujii Hironori <Hironori.Fujii@sony.com>
MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
https://bugs.webkit.org/show_bug.cgi?id=191453
Reviewed by Per Arne Vollan.
No new tests because there is no behavior change.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
2018-11-09 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix internal build on macOS.
'Export' is defined in several headers.
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMGlobalObject.h:
* bridge/jsc/BridgeJSC.cpp:
* bridge/jsc/BridgeJSC.h:
2018-11-09 Chris Dumez <cdumez@apple.com>
HTML form validation bubble disappears
https://bugs.webkit.org/show_bug.cgi?id=191418
Reviewed by Simon Fraser.
If we validate a form and find an invalid form control, we'll scroll it into view and show
the validation bubble. However, scrolling the element into view may be an asynchronous
operation, in which case it would discard the validation bubble prematurely because scrolling
hides the validation bubble. To address the issue, we now show the validation message
asynchronously after focusing the element (and potentially scrolling it into view).
Test: fast/forms/scroll-into-view-and-show-validation-message.html
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
2018-11-09 Brent Fulgham <bfulgham@apple.com>
[Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations.
https://bugs.webkit.org/show_bug.cgi?id=191452
<rdar://problem/45933964>
Reviewed by Zalan Bujtas.
Do a better job of balancing the BeginFigure/EndFigure calls in
the PathDirect2D implementation. Failure to do so puts the Geometry sink
into an error state that prevents it from producing drawing output.
* platform/graphics/Path.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawPath): Flush is needed here.
(WebCore::GraphicsContext::fillPath): Ditto.
(WebCore::GraphicsContext::strokePath): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::drawDidComplete):
(WebCore::Path::closeAnyOpenGeometries):
(WebCore::Path::transform):
(WebCore::Path::openFigureAtCurrentPointIfNecessary):
(WebCore::Path::moveTo):
(WebCore::Path::closeSubpath):
2018-11-09 Jer Noble <jer.noble@apple.com>
[Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
https://bugs.webkit.org/show_bug.cgi?id=191396
Reviewed by Eric Carlson.
When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
from "same codec" requirements.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::validateInitializationSegment):
2018-11-09 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r236365): [GTK] Many form-related tests are failing
https://bugs.webkit.org/show_bug.cgi?id=189993
Reviewed by Michael Catanzaro.
Only the first form data element is added to the message body due to a return added by mistake in r236365.
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
2018-11-09 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
https://bugs.webkit.org/show_bug.cgi?id=191445
Reviewed by Antti Koivisto.
The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
(The line class would eventually turn into a collection of random things).
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::adjustedLineLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
2018-11-09 Philippe Normand <pnormand@igalia.com>
Unreviewed, GStreamer build warning fix
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
returns a uint32_t, fix format string accordingly.
2018-11-08 Said Abou-Hallawa <sabouhallawa@apple.com>
Add an SPI to allow WebView clients to add additional supported image formats
https://bugs.webkit.org/show_bug.cgi?id=190454
Reviewed by Simon Fraser.
Add an SPI to allow additional supported image formats in WebView. These
additional formats can be set in the WKWebViewConfiguration as an NSArray
of NStrings. Each string represents an image source type aka UTI.
The ImageSourceType in the functions' names will be replaced by ImageType.
ImageType in this context is the image UTI (Uniform Type Identifier).
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):
(WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
(WebCore::supportedImageMIMETypesForEncoding):
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
* platform/MIMETypeRegistry.h:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::filenameExtension const):
(WebCore::ImageDecoderCG::encodedDataStatus const):
* platform/graphics/cg/ImageSourceCG.h:
* platform/graphics/cg/ImageSourceCGMac.mm:
(WebCore::MIMETypeForImageType):
(WebCore::preferredExtensionForImageType):
(WebCore::MIMETypeForImageSourceType): Deleted.
(WebCore::preferredExtensionForImageSourceType): Deleted.
* platform/graphics/cg/ImageSourceCGWin.cpp:
(WebCore::MIMETypeForImageType):
(WebCore::preferredExtensionForImageType):
(WebCore::MIMETypeForImageSourceType): Deleted.
(WebCore::preferredExtensionForImageSourceType): Deleted.
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):
(WebCore::additionalSupportedImageTypes):
(WebCore::setAdditionalSupportedImageTypes):
(WebCore::isSupportedImageType):
(WebCore::supportedDefaultImageSourceTypes): Deleted.
(WebCore::isSupportImageSourceType): Deleted.
* platform/graphics/cg/UTIRegistry.h:
2018-11-08 Megan Gardner <megan_gardner@apple.com>
Adopt Reveal Framework to replace Lookup
https://bugs.webkit.org/show_bug.cgi?id=191097
Reviewed by Tim Horton.
Reveal is not currently testable.
The Reveal framework does the same job as Lookup and DataDectors.
In this patch we switch from using Lookup to determine what text
to select and define to using Reveal and RVItems. Since this
code needs to work on older systems, and Reveal is newer, we also need
to keep around the old code for old systems so that they can also
continue to work. Eventually we will remove this code and also likly switch
to passing RVItems across from the web process rather than making them
on each side.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
Create a delegate to respond to Reveal and help draw the string or highlight.
(-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]):
(-[WebRevealHighlight setClearTextIndicator:]):
(-[WebRevealHighlight revealContext:rectsForItem:]):
(-[WebRevealHighlight revealContext:drawRectsForItem:]):
(-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]):
(-[WebRevealHighlight revealContext:stopHighlightingItem:]):
(WebCore::showPopupOrCreateAnimationController):
Unify the code paths and utalize the Reveal framework to create and/or display the popovers.
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
Pipe the new callback through.
(WebCore::tokenRange): Deleted.
Only used with Lookup
(WebCore::selectionContainsPosition): Deleted.
Only used with Lookup.
* editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm.
Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older
system.
(WebCore::tokenRange):
(WebCore::selectionContainsPosition):
(WebCore::expandSelectionByCharacters):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-08 Keith Rollin <krollin@apple.com>
Create .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=191324
<rdar://problem/45852819>
Reviewed by Alex Christensen.
As part of preparing for enabling XCBuild, create and use .xcfilelist
files. These files are using during Run Script build phases in an
Xcode project. If a Run Script build phase produces new files that are
used later as inputs to subsequent build phases, XCBuild needs to know
about these files. These files can be either specified in an "output
files" section of the Run Script phase editor, or in .xcfilelist files
that are associated with the Run Script build phase.
This patch takes the second approach. It consists of three sets of changes:
- Modify the DerivedSources.make files to have a
'print_all_generated_files" target that produces a list of the files
they create.
- Create a shell script that produces .xcfilelist files from the
output of the previous step, as well as for the files created in the
Generate Unified Sources build steps.
- Add the new .xcfilelist files to the associated projects.
Note that, with these changes, the Xcode workspace and projects can no
longer be fully loaded into Xcode 9. Xcode will attempt to load the
projects that have .xcfilelist files associated with them, but will
fail and display a placeholder for those projects instead. It's
expected that all developers are using Xcode 10 by now and that not
being able to load into Xcode 9 is not a practical issue. Keep in mind
that this is strictly an IDE issue, and that the projects can still be
built with `xcodebuild`.
Also note that the shell script that creates the .xcfilelist files can
also be used to verify that the set of files that's currently checked
in is up-to-date. This checking can be used as part of a check-in hook
or part of check-webkit-style to sooner catch cases where the
.xcfilelist files need to be regenerated.
No new tests -- no changed functionality.
* DerivedSources.make:
* DerivedSources.xcfilelist: Added.
* UnifiedSources.xcfilelist: Added.
* WebCore.xcodeproj/project.pbxproj:
2018-11-08 Don Olmstead <don.olmstead@sony.com>
Provide generic implementation of SSLKeyGenerator functions
https://bugs.webkit.org/show_bug.cgi?id=191428
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub
implementations. Since <keygen> is deprecated it looks unlikely that
an implementation is actually needed, however an implementation is
needed until support is reomved.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/SSLKeyGenerator.cpp: Added.
(WebCore::getSupportedKeySizes):
(WebCore::signedPublicKeyAndChallengeString):
* platform/SourcesGLib.txt:
* platform/glib/SSLKeyGeneratorGLib.cpp: Removed.
* platform/ios/SSLKeyGeneratorIOS.cpp: Removed.
2018-11-07 Myles C. Maxfield <mmaxfield@apple.com>
Unprefix text-decoration CSS3 properties
https://bugs.webkit.org/show_bug.cgi?id=127193
Reviewed by Dean Jackson.
The properties are stable, and there is interop.
Test: fast/css3-text/css3-text-decoration/unprefix.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleResolver.cpp:
(WebCore::shouldApplyPropertyInParseOrder):
(WebCore::isValidVisitedLinkProperty):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isColorPropertyID):
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback const):
(WebCore::RenderStyle::visitedDependentColor const):
2018-11-08 Timothy Hatcher <timothy@apple.com>
Add experimental support for a `supported-color-schemes` CSS property.
https://bugs.webkit.org/show_bug.cgi?id=191319
rdar://problem/45852261
Reviewed by Dean Jackson.
Tests: css-dark-mode/parse-supported-color-schemes.html
css-dark-mode/supported-color-schemes-css.html
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::updateSupportedColorSchemes):
(WebCore::StyleBuilderConverter::convertSupportedColorSchemes):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSupportedColorSchemes):
(WebCore::CSSPropertyParser::parseSingleValue):
* dom/Document.cpp:
(WebCore::Document::resetLinkColor):
(WebCore::Document::resetVisitedLinkColor):
(WebCore::Document::resetActiveLinkColor):
(WebCore::Document::processSupportedColorSchemes):
(WebCore::Document::useDarkAppearance const):
(WebCore::Document::styleColorOptions const):
* dom/Document.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
* page/FrameView.cpp:
(WebCore::FrameView::useDarkAppearance const):
(WebCore::FrameView::paintScrollCorner):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
(WebCore::RenderBox::paintBackground):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::useDarkAppearance const):
(WebCore::RenderObject::styleColorOptions const):
* rendering/RenderObject.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::usingDarkAppearance const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::adjustMenuListStyle const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::usingDarkAppearance const): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::supportedColorSchemes const):
(WebCore::RenderStyle::setSupportedColorSchemes):
(WebCore::RenderStyle::initialSupportedColorSchemes):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleSupportedColorSchemes.h: Added.
(WebCore::StyleSupportedColorSchemes::StyleSupportedColorSchemes):
(WebCore::StyleSupportedColorSchemes::operator== const):
(WebCore::StyleSupportedColorSchemes::operator!= const):
(WebCore::StyleSupportedColorSchemes::isAuto const):
(WebCore::StyleSupportedColorSchemes::isOnly const):
(WebCore::StyleSupportedColorSchemes::colorSchemes const):
(WebCore::StyleSupportedColorSchemes::add):
(WebCore::StyleSupportedColorSchemes::contains const):
(WebCore::StyleSupportedColorSchemes::setAllowsTransformations):
(WebCore::StyleSupportedColorSchemes::allowsTransformations const):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):
2018-11-08 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Restrict domains at the target level instead of only at the window level
https://bugs.webkit.org/show_bug.cgi?id=191344
Reviewed by Devin Rousso.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Remove Inspector domain from workers. It was unused anyways.
2018-11-08 Dean Jackson <dino@apple.com>
Add a String literal that returns a String
https://bugs.webkit.org/show_bug.cgi?id=191425
<rdar://problem/45914556>
Reviewed by Sam Weinig.
Use _str where possible.
API Test in WPT.
* Modules/fetch/FetchRequest.cpp:
(WebCore::computeReferrer):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::loggingString):
* Modules/webdatabase/OriginLock.cpp:
(WebCore::OriginLock::lockFileNameForPath):
* css/CSSBasicShapes.cpp:
(WebCore::updateCornerRadiusWidthAndHeight):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* loader/LinkHeader.cpp:
(WebCore::parseParameterValue):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::platform):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toString const):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::suffix const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::setText):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::userInterfaceDirectionPolicy):
(WebCore::InternalSettings::systemLayoutDirection):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType const):
(WebCore::Internals::getCurrentCursorInfo):
2018-11-08 Jonathan Hammer <jonathan@e3software.com>
Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
https://bugs.webkit.org/show_bug.cgi?id=191228
<rdar://problem/45786830>
Reviewed by Wenson Hsieh.
DragController::beginDrag should not call cleanupAfterSystemDrag because
the drag is still in progress even after the call to m_client.beginDrag()
returns. This is in contrast to DragController::doSystemDrag, where the
call to cleanupAfterSystemDrag is appropriate because the drag has
concluded by the time m_client.startDrag() returns.
Test: fast/events/drag-and-drop-move-not-copy.html
* page/DragController.cpp:
(WebCore::DragController::beginDrag):
2018-11-08 Zalan Bujtas <zalan@apple.com>
[BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments.
https://bugs.webkit.org/show_bug.cgi?id=191414
Reviewed by Antti Koivisto.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-11-08 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import CTAP device request/response converters from Chromium
https://bugs.webkit.org/show_bug.cgi?id=190784
<rdar://problem/45460333>
Reviewed by Brent Fulgham.
This patch imports Chromium's CTAP device request/response converters:
https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding
1. It directly imports the following files and suit them to WebKit's coding style:
https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2. It gathers the following methods into DeviceRequestConverter:
CtapGetAssertionRequest::EncodeAsCBOR()
CtapMakeCredentialRequest::EncodeAsCBOR()
PublicKeyCredentialDescriptor::ConvertToCBOR()
PublicKeyCredentialParams::ConvertToCBOR()
PublicKeyCredentialRpEntity::ConvertToCBOR()
PublicKeyCredentialUserEntity::ConvertToCBOR()
3. It also apply a patch from Chromium to CBORValue:
https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/
Besides importing things from Chromium, it also implements UserVerificationRequirement for both
PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options
can specify more dimensions of a desired authenticator.
Covered by API tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const):
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
* Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
* Modules/webauthn/cbor/CBORValue.cpp:
(cbor::CBORValue::CBORValue):
(cbor::CBORValue::getBool const):
* Modules/webauthn/cbor/CBORValue.h:
* Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added.
(fido::toArrayValue):
(fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse):
(fido::AuthenticatorGetInfoResponse::setMaxMsgSize):
(fido::AuthenticatorGetInfoResponse::setPinProtocols):
(fido::AuthenticatorGetInfoResponse::setExtensions):
(fido::AuthenticatorGetInfoResponse::setOptions):
(fido::encodeAsCBOR):
* Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added.
* Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added.
(fido::AuthenticatorSupportedOptions::setSupportsResidentKey):
(fido::AuthenticatorSupportedOptions::setUserVerificationAvailability):
(fido::AuthenticatorSupportedOptions::setUserPresenceRequired):
(fido::AuthenticatorSupportedOptions::setClientPinAvailability):
(fido::AuthenticatorSupportedOptions::setIsPlatformDevice):
(fido::convertToCBOR):
* Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added.
* Modules/webauthn/fido/DeviceRequestConverter.cpp: Added.
(fido::convertRpEntityToCBOR):
(fido::convertUserEntityToCBOR):
(fido::convertParametersToCBOR):
(fido::convertDescriptorToCBOR):
(fido::encodeMakeCredenitalRequestAsCBOR):
(fido::encodeGetAssertionRequestAsCBOR):
(fido::encodeEmptyAuthenticatorRequest):
* Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h.
* Modules/webauthn/fido/DeviceResponseConverter.cpp: Added.
(fido::convertStringToProtocolVersion):
(fido::getResponseCode):
(fido::getCredentialId):
(fido::readCTAPMakeCredentialResponse):
(fido::readCTAPGetAssertionResponse):
(fido::readCTAPGetInfoResponse):
* Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp.
* Modules/webauthn/fido/FidoConstants.cpp:
(fido::isCtapDeviceResponseCode):
(fido::publicKeyCredentialTypeToString):
* Modules/webauthn/fido/FidoConstants.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-11-07 Justin Michaud <justin_michaud@apple.com>
CSS Painting API should pass size, arguments and input properties to paint callback
https://bugs.webkit.org/show_bug.cgi?id=191309
Reviewed by Chris Dumez.
Call paint() callback with input properties and arguments. This patch adds a stub for
the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without
any syntax checking to the paint callback.
Test: fast/css-custom-paint/properties.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/CSSPaintImageValue.h:
* css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::CSSPaintSize::create):
(WebCore::CSSPaintSize::width const):
(WebCore::CSSPaintSize::height const):
(WebCore::CSSPaintSize::CSSPaintSize):
* css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
* css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::CSSStyleValue::isUnitValue):
(WebCore::CSSStyleValue::isUnparsedValue):
* css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::StylePropertyMapReadOnly::create):
(WebCore::StylePropertyMapReadOnly::get):
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
* css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
2018-11-07 Brent Fulgham <bfulgham@apple.com>
Provide better Font fallbacks for DirectX backend
https://bugs.webkit.org/show_bug.cgi?id=191412
<rdar://problem/45899207>
Reviewed by Zalan Bujtas.
Registration of custom fonts through GDI are not always visible
through the DirectWrite/GDI bridging layer. If a font is not located,
locate the closest matching avialable font rather than failing.
* platform/graphics/FontPlatformData.h:
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData): Use new font
fallback logic.
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::platformDataInit):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::createFallbackFont): Added.
2018-11-07 Zalan Bujtas <zalan@apple.com>
Click and touch event listeners on the body don't work
https://bugs.webkit.org/show_bug.cgi?id=191392
<rdar://problem/5844416>
Reviewed by Simon Fraser.
Remove the old quirk of ignoring onclick handlers on the body and beyond.
Test: fast/events/click-handler-on-body-simple.html
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToClickEvents):
2018-11-07 Brent Fulgham <bfulgham@apple.com>
[Windows][DirectX] Update canvas code to pass more tests
https://bugs.webkit.org/show_bug.cgi?id=191337
<rdar://problem/45878801>
Reviewed by Dean Jackson.
Update the Direct2D code paths to comply with our canvas tests, improving the
the test results scores to 579/770.
PathDirect2D was updated with an implementation of 'addArcTo' based on work by
Dirk Schulze <vbs85@gmx.de> (see https://hg.mozilla.org/mozilla-central/rev/b116b49459f8).
Tests: canvas/philip/tests
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer): Direct2D needs access to the graphics
context to create the buffer.
* platform/graphics/ImageBuffer.h:
* platform/graphics/Path.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawPattern): Flush needed.
(WebCore::GraphicsContext::drawRect): Ditto.
(WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Correct for Direct2D definition of miter limit.
(WebCore::GraphicsContextPlatformPrivate::strokeStyleProperties const): Added helper function.
(WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Update for new helper.
(WebCore::GraphicsContext::drawLine): Ditto.
(WebCore::drawWithShadowHelper): Ditto.
(WebCore::GraphicsContext::fillRect): Add flush.
(WebCore::GraphicsContext::platformFillRoundedRect): Update for helper.
(WebCore::GraphicsContext::clipPath): Add flush.
(WebCore::GraphicsContext::strokeRect): Ditto.
(WebCore::GraphicsContext::drawLineForText): Update for upstream changes.
(WebCore::GraphicsContext::drawLinesForText): Ditto.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::createCroppedImageIfNecessary): Add missing implementations.
(WebCore::createBitmapImageAfterScalingIfNeeded): Ditto.
(WebCore::ImageBuffer::copyImage const): Ditto.
(WebCore::ImageBuffer::sinkIntoImage): Ditto.
(WebCore::ImageBuffer::fastCopyImageMode): Ditto.
(WebCore::ImageBuffer::sinkIntoNativeImage): Ditto.
(WebCore::ImageBuffer::copyNativeImage const): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::operator=):
(WebCore::Path::drawDidComplete): This should never have been const.
It manipulates the path!
(WebCore::Path::transform): Properly transform existing geometries.
(WebCore::Path::openFigureAtCurrentPointIfNecessary): Added.
(WebCore::Path::moveTo):
(WebCore::Path::addLineTo): Make sure figure starts at a valid point.
(WebCore::Path::addQuadCurveTo): Ditto.
(WebCore::Path::addBezierCurveTo): Ditto.
(WebCore::Path::addArcTo): Add implementation.
(WebCore::Path::closeSubpath):
(WebCore::drawArcSection):
(WebCore::Path::addArc): Update to build large arcs out of small arc segments. If the
arc is effectively a complete circle, use the ellipse drawing routines.
(WebCore::Path::addRect): Make sure we start at a valid starting point.
(WebCore::Path::addEllipse): Correct for definition of D2D ellipse.
(WebCore::Path::drawDidComplete const): Deleted.
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
(WebCore::Font::platformWidthForGlyph const):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::createImageBuffer):
* rendering/svg/SVGRenderingContext.h:
2018-11-07 Wenson Hsieh <wenson_hsieh@apple.com>
Add an editing command for creating and inserting child lists
https://bugs.webkit.org/show_bug.cgi?id=191335
<rdar://problem/45814050>
Reviewed by Ryosuke Niwa.
Currently, insertOrderedList and insertUnorderedList only toggle or change list state (i.e. if the selection is
in an ordered or unordered list, reinserting the same list type removes the current list, and inserting a
different list type changes the enclosing list).
However, for certain internal clients (e.g. Mail), if the start of the selection is enclosed by a list item, we
instead create a new list item and insert it after the enclosing list item, and then create a new list within
that list item. Currently, this logic is implemented in Mail for legacy-WebKit-based Mail compose. This patch
brings this logic into WebKit in the form of a new editing command.
Tests: editing/execCommand/insert-nested-lists-in-table.html
editing/execCommand/insert-nested-lists-with-pre.html
editing/execCommand/insert-nested-lists.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::insertOrderedList):
(WebCore::Editor::insertUnorderedList):
* editing/EditorCommand.cpp:
(WebCore::executeInsertOrderedList):
(WebCore::executeInsertUnorderedList):
(WebCore::executeInsertNestedUnorderedList):
(WebCore::executeInsertNestedOrderedList):
(WebCore::createCommandMap):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
(WebCore::InsertListCommand::editingAction const):
* editing/InsertListCommand.h:
Change a couple of `enum`s into `enum class`es.
* editing/InsertNestedListCommand.cpp: Added.
(WebCore::InsertNestedListCommand::insertUnorderedList):
(WebCore::InsertNestedListCommand::insertOrderedList):
(WebCore::InsertNestedListCommand::doApply):
* editing/InsertNestedListCommand.h: Added.
Add a new edit command to insert a new list (as a child of any containing list). If the start of the selection
is in a list item, we create a new list item, move the selection into the list item, and increment its list
level; otherwise, simply fall back to inserting a list.
* editing/ModifySelectionListLevel.cpp:
(WebCore::IncreaseSelectionListLevelCommand::doApply):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
* editing/ModifySelectionListLevel.h:
Expose this constructor, allowing other edit commands to change selection list level as a composite edit
command. Also, change an `enum` into an `enum class`.
(WebCore::IncreaseSelectionListLevelCommand::create):
2018-11-07 Chris Dumez <cdumez@apple.com>
ASSERT(renderer()) under HTMLTextAreaElement::updateValue()
https://bugs.webkit.org/show_bug.cgi?id=191391
<rdar://problem/34219633>
Reviewed by Geoffrey Garen.
Update HTMLTextFormControlElement::didEditInnerTextValue() to not call subtreeHasChanged()
if the element has no renderer, similarly to what is already done in
HTMLTextFormControlElement::setRangeText() and HTMLInputElement::setEditingValue().
Test: editing/inserting/inset-html-textarea-without-renderer.html
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
2018-11-07 Youenn Fablet <youenn@apple.com>
Allow setting RTCRtpTransceiver.direction
https://bugs.webkit.org/show_bug.cgi?id=191346
Reviewed by Eric Carlson.
Remove readonly from the direction attribute.
Keep setDirection for now as it is in use, with an intent to remove it.
Driven-by fix as in some cases, the rtc source track might be changed
and current implementation is not expecting that.
In such a case, stop observing the old track (which should no longer call us)
before observing the new one.
Covered by rebased tests.
* Modules/mediastream/RTCRtpTransceiver.idl:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::setSourceTrack):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::setSourceTrack):
2018-11-07 Sihui Liu <sihui_liu@apple.com>
RELEASE_ASSERT(!m_hardClosedForUserDelete) fails in WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer
https://bugs.webkit.org/show_bug.cgi?id=191326
<rdar://problem/45769269>
Reviewed by Geoffrey Garen.
UniqueIDBDatabase should ignore incoming requests or operations when it is already marked as
hardClosedForUserDelete.
Test: IndexedDB.IndexedDBUserDelete.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
2018-11-07 Myles C. Maxfield <mmaxfield@apple.com>
Positioned text underline can look like a strike-through
https://bugs.webkit.org/show_bug.cgi?id=191341
Reviewed by Simon Fraser.
We should just clamp the value so it can't go above the baseline.
We shouldn't do this at parse time because it's totally reasonable for text-underline-position: under to want
a negative text-underline-offset. Instead, we just do it at used value time.
Test: fast/css3-text/css3-text-decoration/text-underline-negative.html
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
2018-11-07 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
2018-11-07 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
2018-11-07 Myles C. Maxfield <mmaxfield@apple.com>
Dotted underlines that skip descenders are invisible
https://bugs.webkit.org/show_bug.cgi?id=191403
Reviewed by Simon Fraser.
Turns out our underline bounding boxes had negative width. When drawing the full
underline that was fine because it was handled by the 2D graphics engine, but when
we try to split up the box into dots, our "for" loop was taking 0 iterations (because
the end was before the start).
Test: fast/css3-text/css3-text-decoration/text-underline-style.html
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLineForText):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawLineForText):
2018-11-07 Andy Estes <aestes@apple.com>
Crash in WebCore::PaymentRequest::canMakePayment when Apple Pay payment method data is missing
https://bugs.webkit.org/show_bug.cgi?id=191331
Reviewed by Alexey Proskuryakov.
Apple Pay requires merchants specify an ApplePayRequest (which contains several required
fields) as payment method data when constructing a new PaymentRequest. If the
ApplePayRequest is missing required fields, or is missing entirely, canMakePayment() should
resolve to false.
We would properly resolve to false when an ApplePayRequest was specified with missing
required fields, but we would crash when the ApplePayRequest was missing entirely.
This patch fixes the crash by checking for an empty JSValue before trying to convert it to
an ApplePayRequest struct. Because we stringify ApplePayRequests in the PaymentRequest
constructor then parse them again in canMakePayments, an undefined or null payment method
data stringifies to a null String, which then parses to an empty JSValue.
Added test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::convertData):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::canMakePayment):
2018-11-07 Simon Fraser <simon.fraser@apple.com>
Revert 237849: it breaks MotionMark
https://bugs.webkit.org/show_bug.cgi?id=191398
Reviewed by Simon Fraser.
This change broke painting while the test is running.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2018-11-07 Don Olmstead <don.olmstead@sony.com>
Simplify macros in platform
https://bugs.webkit.org/show_bug.cgi?id=191378
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Modifies a few cases where a platform macro could be simplified.
* page/EventHandler.cpp:
* platform/network/DNS.h:
* platform/network/NetworkStateNotifier.h:
2018-11-07 Simon Fraser <simon.fraser@apple.com>
Some WK1 repaint tests are flakey
https://bugs.webkit.org/show_bug.cgi?id=190627
Reviewed by Zalan Bujtas.
Repaint tracking in GraphicsLayerCA was sensitive to whether there were already dirty
rects on the layer, since tracking happened after checks against existing dirty rects.
This caused some WK1 repaint tests to be flakey, since there's no guarantee that
no repaints happen between the last layer flush and a test calling startTrackingRepaints().
Fix by moving the repaint tracking to before the checks against existing dirty rects.
This is more similar to how repaint tracking on FrameView works.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
2018-11-07 Dean Jackson <dino@apple.com>
[iOS] WebGL leaks exact GPU type
https://bugs.webkit.org/show_bug.cgi?id=191393
Reviewed by Tim Horton.
The fully exposed renderer info shouldn't be necessary
on iOS, where the GPUs and drivers are consistent
enough that people shouldn't need to write code specifically
for them. Reduce the ability to fingerprint by simply
returning "Apple GPU".
The other option would have been to disable the extension,
but I think it might still be useful to know you're on
an iOS device.
Test: fast/canvas/webgl/hide-some-renderer-info.html
* html/canvas/WebGL2RenderingContext.cpp: Return "Apple GPU"
on iOS.
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore::WebGLRenderingContext::getParameter):
2018-11-07 Daniel Bates <dabates@apple.com>
Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=190141
Reviewed by Darin Adler.
Remove the runtime application check for WebKitTestRunner as we no longer need this
now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode].
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isWebKitTestRunner): Deleted.
2018-11-07 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
https://bugs.webkit.org/show_bug.cgi?id=191340
Reviewed by Devin Rousso.
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::collectSample):
Use new enum name.
2018-11-07 Dan Bernstein <mitz@apple.com>
Add a pseudoclass that matches img elements that are backed by an attachment
https://bugs.webkit.org/show_bug.cgi?id=191286
<rdar://problem/45823554>
Reviewed by Dean Jackson.
Test: fast/css/has-attachment.html
Added a :has-attachment pseudoclass, enabled only when the attachment element is enabled at
runtime, that matches elements (currently only img elements qualify) that have an attachment
element in their shadow DOM.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const): Handle the new PseudoClassHasAttachment value.
* css/CSSSelector.h: Added a new value to the PseudoClassType enum.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const): Check the new PseudoClassHasAttachment value
using the new hasAttachment test function.
* css/SelectorCheckerTestFunctions.h:
(WebCore::hasAttachment): Added. Tests if the element is an img element that has an
attachment.
* css/SelectorPseudoClassAndCompatibilityElementMap.in: Added has-attachment.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext): Initialize new attachmentEnabled member based
on RuntimeEnabledFeatures.
(WebCore::operator==): Compare new attachmentEnabled member.
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash): Include new attachmentEnabled member.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo): Reject :has-attachment if the attachment
element is not enabled.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType): Handle PseudoClassHasAttachment.
2018-11-07 Don Olmstead <don.olmstead@sony.com>
Make generic MainThreadSharedTimer implementation
https://bugs.webkit.org/show_bug.cgi?id=191327
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Moves generic implementation for MainThreadSharedTimerGlib.cpp into
MainThreadSharedTimer.cpp.
* platform/MainThreadSharedTimer.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
(WebCore::MainThreadSharedTimer::setFireInterval):
(WebCore::MainThreadSharedTimer::stop):
(WebCore::MainThreadSharedTimer::invalidate):
* platform/MainThreadSharedTimer.h:
* platform/SourcesGLib.txt:
* platform/glib/MainThreadSharedTimerGLib.cpp: Removed.
2018-11-07 Ali Juma <ajuma@chromium.org>
IntersectionObserverEntry doesn't keep JS wrappers of rects alive
https://bugs.webkit.org/show_bug.cgi?id=191330
Reviewed by Chris Dumez.
Retain wrappers of each rect in an IntersectionObserverEntry as long as the entry's wrapper
is alive, by adding these wrappers as opaque roots.
Test: intersection-observer/intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html
* bindings/js/JSIntersectionObserverEntryCustom.cpp:
(WebCore::JSIntersectionObserverEntry::visitAdditionalChildren):
* dom/DOMRectReadOnly.idl:
* page/IntersectionObserverEntry.h:
(WebCore::IntersectionObserverEntry::rootBounds const): Make this return a raw pointer instead of a RefPtr so that it
can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which can be called from non-main threads.
(WebCore::IntersectionObserverEntry::boundingClientRect const): Ditto.
(WebCore::IntersectionObserverEntry::intersectionRect const): Ditto.
2018-11-07 Simon Fraser <simon.fraser@apple.com>
TileController::tileSize() should not have side effects
https://bugs.webkit.org/show_bug.cgi?id=191349
Reviewed by Zalan Bujtas.
Calling TileController::tileSize() would recompute a new tile size and set m_tileSizeLocked,
which caused test failures if logging was enabled when running tests.
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileSize const):
(WebCore::TileController::computeTileSize):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
2018-11-07 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] Ensure key id buffers are present and simplify lifetime management of ClearKey class.
https://bugs.webkit.org/show_bug.cgi?id=191157
Reviewed by Xabier Rodriguez-Calvar.
This is in preparation for moving the clearkey decryptor behind a
new decrypt API in CDMInstance, which will be sent into the
pipeline to handle key management and decryption. This is for a
later patch.
Covered by existing clear key tests in media/encrypted-media.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::data const): Add a const data accessor,
since we are now providing operator=='s on const objects of this
class that need const access to the data pointer.
(WebCore::GstMappedBuffer::operator==): Add a swap of the new
equality operator so you don't have to remember to have the
GstBuffer on the RHS of the equality all the time.
(WebCore::operator==): Define an equality operator between Gst
buffers and WebCore's mapped buffers. Gst creates a ref and a
separate read view under the covers in the memcmp call, so we do
not need to map the buffer ourselves.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webkit_media_clear_key_decrypt_class_init): Remove setup/release
bindings.
(webkit_media_clear_key_decrypt_init): Initialize gcrypt cipher
here once instead of for every buffer to be decrypted.
(webKitMediaClearKeyDecryptorFinalize): And destroy the cipher
context when the decryptor is destroyed.
(webKitMediaClearKeyDecryptorFindAndSetKey): Factor out the key
retrieval and context setting in this method, call it for each
sample.
(webKitMediaClearKeyDecryptorDecrypt): Base key id buffer into
this function, and remove cipher creation / destroy methods.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkit_media_common_encryption_decrypt_class_init): Remove
setup/release bindings.
(webkitMediaCommonEncryptionDecryptTransformInPlace): Ensure a key
id is present and pass it to the decrypt class method.
(webKitMediaCommonEncryptionDecryptDefaultSetupCipher): Deleted.
(webKitMediaCommonEncryptionDecryptDefaultReleaseCipher): Deleted.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
2018-11-07 Frederic Wang <fwang@igalia.com>
[Cairo] Move state change operations from GraphicsContextCairo to CairoOperations
https://bugs.webkit.org/show_bug.cgi?id=179610
Unreviewed build fix.
* platform/graphics/cairo/GraphicsContextCairo.cpp: Add missing include.
2018-11-06 Joseph Pecoraro <pecoraro@apple.com>
ServiceWorker Inspector: Uncaught Exception: null is not an object (evaluating 'resource.target.addResource')
https://bugs.webkit.org/show_bug.cgi?id=191339
Reviewed by Matt Baker.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):
Use the Service Worker's identifier, not this static but otherwise unknown identifier.
2018-11-06 Youenn Fablet <youenn@apple.com>
sender.replaceTrack() fails with InvalidStateError if the transceiver.direction is "inactive"
https://bugs.webkit.org/show_bug.cgi?id=191202
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::removeTrack):
Update as per spec, in particular make sure to not stop the sender when removing the track.
2018-11-06 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
https://bugs.webkit.org/show_bug.cgi?id=191291
Reviewed by Myles Maxfield.
Test: webgpu/render-pipelines.html
Also update test webgpu/webgpu-basics.html to create a WebGPURenderPipeline.
Begin implementation of WebGPURenderPipeline and WebGPUSwapChain. A WebGPURenderPipeline is backed by a
GPURenderPipeline, created lazily using the properties of the passed-in WebGPURenderPipelineDescriptor.
On Metal-supported systems, GPURenderPipeline is an interface to a MTLRenderPipelineState.
The MTLRenderPipelineState is created with the WebGPUDevice currently configured on the WebGPURenderingContext.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Modules/webgpu/GPUDevice.cpp:
(WebCore::GPUDevice::createRenderPipeline const):
* Modules/webgpu/GPUDevice.h:
* Modules/webgpu/GPUPipelineDescriptorBase.h:
* Modules/webgpu/GPUPipelineStageDescriptor.h:
* Modules/webgpu/GPURenderPipelineDescriptor.h:
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
(WebCore::GPURenderPipelineDescriptor::primitiveTopology):
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::adapter const):
(WebCore::WebGPUDevice::device const):
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUPipelineDescriptorBase.h:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineStageDescriptor.h:
* Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h:
* Modules/webgpu/WebGPURenderPipeline.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create):
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* Modules/webgpu/WebGPURenderingContext.h:
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUShaderStage.h:
* Modules/webgpu/WebGPUShaderStage.idl:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure):
(WebCore::WebGPUSwapChain::reshape):
(WebCore::WebGPUSwapChain::markLayerComposited):
* Modules/webgpu/WebGPUSwapChain.h:
(WebCore::WebGPUSwapChain::WebGPUSwapChain):
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/cocoa/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: Added.
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline):
* Modules/webgpu/cocoa/GPUSwapChain.h:
(WebCore::GPUSwapChain::platformLayer const):
* Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::setDevice):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::present):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-11-06 Youenn Fablet <youenn@apple.com>
Add support for sender/receiver getCapabilities
https://bugs.webkit.org/show_bug.cgi?id=191192
Reviewed by Eric Carlson.
Expose sender/receiver RTCRtpCapabilities to JS.
Add corresponding IDL and plumbing down to libwebrtc peer connection factory.
Covered by rebased tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::receiverCapabilities):
(WebCore::PeerConnectionBackend::senderCapabilities):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCRtpCapabilities.idl: Added.
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::getCapabilities):
* Modules/mediastream/RTCRtpReceiver.h:
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::getCapabilities):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::receiverCapabilities):
(WebCore::PeerConnectionBackend::senderCapabilities):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RTCPMuxPolicy.h:
* platform/mediastream/RTCRtpCapabilities.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::typeFromKind):
(WebCore::fromStdString):
(WebCore::toChannels):
(WebCore::toRTCRtpCapabilities):
(WebCore::LibWebRTCProvider::receiverCapabilities):
(WebCore::LibWebRTCProvider::senderCapabilities):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2018-11-06 Youenn Fablet <youenn@apple.com>
Calling sender.replaceTrack() twice produces a new transceiver and its corresponding m= section
https://bugs.webkit.org/show_bug.cgi?id=191261
Reviewed by Eric Carlson.
Handle the case of replacing a track in a sender that has no track.
In particular, do not create a new m-section as was implied by plan B implementation.
Instead, set the track directly on the rtc sender.
Covered by webrtc/video-addTransceiver.html.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack):
(WebCore::LibWebRTCMediaEndpoint::addTransceiver):
(WebCore::LibWebRTCMediaEndpoint::setSenderSourceFromTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::setSenderSourceFromTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
2018-11-06 Chris Dumez <cdumez@apple.com>
Post too much text to iFrame could crash webkit
https://bugs.webkit.org/show_bug.cgi?id=190947
<rdar://problem/45678231>
Reviewed by Geoffrey Garen.
Optimize SuffixTree (Which is used by XSSAuditor) to stop storing each Node's
children as a static array of 128 pointers and use a dynamic array (vector)
instead. This uses way less memory. Also make SuffixTree and SuffixTree::Node
as fast allocated for performance. This part of the change is based on the
following Blink change:
- https://chromium.googlesource.com/chromium/src.git/+/6ca590e1c7edaa7c56cac9e3e3c39cf398ca8d4d
Also update the XSSAuditor to construct the SuffixTree lazily since there are
many cases (including the one in this bug) where we were spending a significant
amount of time building the SuffixTree and then never querying it.
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
(WebCore::XSSAuditor::decodedHTTPBodySuffixTree):
(WebCore::XSSAuditor::isContainedInRequest):
* html/parser/XSSAuditor.h:
* platform/text/SuffixTree.h:
(WebCore::SuffixTree::mightContain):
(WebCore::SuffixTree::Node::Node):
(WebCore::SuffixTree::Node::~Node):
(WebCore::SuffixTree::Node::find):
(WebCore::SuffixTree::Node::end):
(WebCore::SuffixTree::build):
(WebCore::SuffixTree<Codebook>::Node::childAt):
(WebCore::SuffixTree::Node::at): Deleted.
2018-11-06 Youenn Fablet <youenn@apple.com>
Support onremovetrack for RTCPeerConnection removed tracks
https://bugs.webkit.org/show_bug.cgi?id=191299
Reviewed by Eric Carlson.
When applying SDP, LibWebRTCMediaEndpoint gets notified of a removed track.
In that case, make sure to remove it from its remote stream(s) so as
to notify the application of the changes.
Work around the receiver missing the list of streams by storing in a map
the list of the remote streams for a given remote track.
Covered by rebased test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::stop):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2018-11-06 Timothy Hatcher <timothy@apple.com>
REGRESSION (r237878): css-dark-mode/supported-color-schemes.html is failing on Mojave
https://bugs.webkit.org/show_bug.cgi?id=191338
Reviewed by Dean Jackson.
* page/Page.cpp:
(WebCore::Page::appearanceDidChange): Add back call to didChangeStyleSheetEnvironment().
It was dropped by mistake when I moved code to appearanceDidChange(). This is needed to
update styles for semantic colors and from controls when the media prefers-color-scheme
media query is not used on the page.
2018-11-06 Youenn Fablet <youenn@apple.com>
Make mDNS ICE Candidate an experimental flag again
https://bugs.webkit.org/show_bug.cgi?id=191262
Reviewed by Dean Jackson.
Rename mdnsICECandidatesEnabled to webRTCICECandidatesEnabled.
This allows grouping the WebRTC runtime flags.
No change of behavior.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::newICECandidate):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCMDNSICECandidatesEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCMDNSICECandidatesEnabled):
(WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled): Deleted.
2018-11-06 Myles C. Maxfield <mmaxfield@apple.com>
Implement text-underline-offset and text-decoration-thickness
https://bugs.webkit.org/show_bug.cgi?id=190774
Reviewed by Dean Jackson.
Because of our existing infrastructure for text decorations, adding support for these
is fairly simple. This patch updates our existing functions to handle thick & placed
underlines, as well as updating our repaint code to correcly handle repainting them.
It also handles animations.
Tests: animations/text-decoration-thickness.html
animations/text-underline-offset.html
fast/css3-text/css3-text-decoration/text-decoration-offset-2.html
fast/css3-text/css3-text-decoration/text-decoration-offset-3.html
fast/css3-text/css3-text-decoration/text-decoration-offset-auto-length.html
fast/css3-text/css3-text-decoration/text-decoration-offset-baseline.html
fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-auto.html
fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-length.html
fast/css3-text/css3-text-decoration/text-decoration-offset-repaint.html
fast/css3-text/css3-text-decoration/text-decoration-offset-under-auto.html
fast/css3-text/css3-text-decoration/text-decoration-offset-under-length.html
fast/css3-text/css3-text-decoration/text-decoration-offset.html
fast/css3-text/css3-text-decoration/text-decoration-thickness-length.html
fast/css3-text/css3-text-decoration/text-decoration-thickness-repaint.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/FontMetrics.h:
(WebCore::FontMetrics::underlinePosition const):
(WebCore::FontMetrics::setUnderlinePosition):
(WebCore::FontMetrics::underlineThickness const):
(WebCore::FontMetrics::setUnderlineThickness):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
* rendering/style/TextDecorationThickness.h:
(WebCore::TextDecorationThickness::resolve const):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
(WebCore::visualOverflowForDecorations):
* style/InlineTextBoxStyle.h:
(WebCore::textDecorationStrokeThickness): Deleted.
2018-11-06 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
https://bugs.webkit.org/show_bug.cgi?id=189760
<rdar://problem/44612242>
Reviewed by Youenn Fablet and Antti Koivisto.
No new tests. Existing test fleshed out.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isRedirection const):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::isRedirection const): Deleted.
Moved to the implementation file so that I can export it without warning.
2018-11-06 Myles C. Maxfield <mmaxfield@apple.com>
Spelling dots are drawn in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=190764
Reviewed by Dean Jackson.
- Dots should not be clipped.
- Dots should be horizontally centered.
- Dots should be drawn behind the text.
- Distance from the baseline to the top of the dot should be 11.035% of font size.
- Dot diameter should be 13.247% of the font size.
- Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
- The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
Tests: editing/spelling/spelling-dots-position-2.html
editing/spelling/spelling-dots-position-3.html
editing/spelling/spelling-dots-position.html
editing/spelling/spelling-dots-repaint.html
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
(WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
because there is no guarantee the spelling dots will lie inside the layout rect of the element.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
* rendering/InlineFlowBox.h: Comments should explain why, not say what.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Draw the dots behind the text.
(WebCore::InlineTextBox::hasMarkers const): Convenience.
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
(WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
(WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
(WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
* rendering/InlineTextBox.h: Declare the helper methods.
* rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
spelling dots opt us out of SLL.
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
2018-11-06 Per Arne Vollan <pvollan@apple.com>
REGRESSION (r230523): Caps lock indicator not shown in password field
https://bugs.webkit.org/show_bug.cgi?id=190056
Reviewed by Ryosuke Niwa.
When WindowServer access is blocked, GetCurrentModifiers() always returns 0. Instead of calling
GetCurrentModifiers(), store the current modifiers from the key event argument in the method
WebKit::WebPage::keyEvent, and use the stored value to detect if Caps lock is on. Additionally,
the modifiers needs to be updated when the window becomes active.
Test: fast/events/detect-caps-lock.html
* Sources.txt:
* platform/PlatformKeyboardEvent.h:
* platform/graphics/FontTaggedSettings.cpp:
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState):
(WebCore::PlatformKeyboardEvent::getCurrentModifierState):
* testing/Internals.cpp:
(WebCore::Internals::capsLockIsOn):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-06 Javier Fernandez <jfernandez@igalia.com>
CSS grid elements with justify-content: space-around have extra whitespace, sometimes a lot
https://bugs.webkit.org/show_bug.cgi?id=191308
Reviewed by Dean Jackson.
The CSS WG resolved [1] that Content Alignment should account to the
track sizing algorithm.
The sizing algorithm has been modified so that two new steps (1.5
and 2.5) were added to compute the Content Alignment offsets after
resolving the columns' and rows' sizes respectively.
This change decouples the Content Alignment logic from the tracks
position, so that we can use it as part of the track sizing algorithm.
I also had to store the whole ContentAlignmentData structure in two
class attributes. We need both, position and distribution offsets, to
be used in different parts of the layout logic.
[1] https://github.com/w3c/csswg-drafts/issues/2557
Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-002.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-003.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-004.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-filled-shrinkwrap-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-spanned-shrinkwrap-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-filled-shrinkwrap-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-spanned-shrinkwrap-001.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::gridItemOffset const):
(WebCore::RenderGrid::trackSizesForComputedStyle const):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
(WebCore::contentDistributionOffset):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
(WebCore::RenderGrid::nonCollapsedTracks const):
* rendering/RenderGrid.h:
(WebCore::ContentAlignmentData::isValid):
(WebCore::ContentAlignmentData::defaultOffsets):
2018-11-06 Sihui Liu <sihui_liu@apple.com>
IndexedDB: WAL file keeps growing
https://bugs.webkit.org/show_bug.cgi?id=191294
<rdar://problem/41333493>
Reviewed by Chris Dumez.
When we quit apps, the database connection may not be shut down properly, and WAL file will be retained on disk.
On the next open of database connection, new logs will be appended to the original WAL file, which keeps
increasing size of the WAL file. We should do a manual checkpoint when we open a IndexedDB to make sure previous
log is written to database and truncate WAL file.
Test: IndexedDB.IndexedDBTempFileSize
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
2018-11-06 Ali Juma <ajuma@chromium.org>
IntersectionObserver doesn't keep target's JS wrapper alive
https://bugs.webkit.org/show_bug.cgi?id=190235
Reviewed by Ryosuke Niwa.
Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by
IntersectionObserver, which gets cleared after the entries have been delivered.
Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs
for targets and the vector of intersection observer entries, so that the GCReachableRefs survive
until the creation of JS wrappers for the entries.
Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has
entries to deliver.
Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html
intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html
intersection-observer/target-deleted.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSIntersectionObserverEntryCustom.cpp:
(WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the
IntersectionObserverEntry's wrapper is alive.
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that
each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry.
(WebCore::IntersectionObserver::appendQueuedEntry):
(WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records.
(WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered.
(WebCore::IntersectionObserver::stop):
* page/IntersectionObserver.h:
* page/IntersectionObserver.idl:
* page/IntersectionObserverEntry.h:
(WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it
can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node
on a non-main thread).
* page/IntersectionObserverEntry.idl:
2018-11-06 Timothy Hatcher <timothy@apple.com>
<picture> container doesn't update when prefers-color-scheme media query changes
https://bugs.webkit.org/show_bug.cgi?id=190913
rdar://problem/45608456
Reviewed by Dean Jackson.
Test: css-dark-mode/prefers-color-scheme-picture-element.html
* css/MediaQueryEvaluator.cpp:
(WebCore::isAppearanceDependent): Added.
(WebCore::MediaQueryEvaluator::evaluate const): Keep track of appearanceDependentResults.
* css/MediaQueryEvaluator.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addAppearanceDependentMediaQueryResult): Added.
(WebCore::StyleResolver::hasMediaQueriesAffectedByAppearanceChange const): Added.
* css/StyleResolver.h:
(WebCore::StyleResolver::hasAppearanceDependentMediaQueries const): Added.
* dom/Document.cpp:
(WebCore::Document::evaluateMediaQueryList): Call checkAppearanceDependentPictures.
(WebCore::Document::checkAppearanceDependentPictures): Added.
(WebCore::Document::addAppearanceDependentPicture): Added.
(WebCore::Document::removeAppearanceDependentPicture): Added.
* dom/Document.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call addAppearanceDependentPicture.
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::~HTMLPictureElement): Call removeAppearanceDependentPicture.
(WebCore::HTMLPictureElement::didMoveToNewDocument): Ditto.
(WebCore::HTMLPictureElement::appearanceChangeAffectedPicture const): Added.
* html/HTMLPictureElement.h:
* page/Page.cpp:
(WebCore::Page::appearanceDidChange): Added.
(WebCore::Page::setUseSystemAppearance): Call appearanceDidChange.
(WebCore::Page::setUseDarkAppearance): Call appearanceDidChange.
* page/Page.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange): Added.
* style/StyleScope.h:
2018-11-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237834.
Tests for this change crash on iOS Simulator
Reverted changeset:
"Spelling dots are drawn in the wrong place"
https://bugs.webkit.org/show_bug.cgi?id=190764
https://trac.webkit.org/changeset/237834
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] transitions/remove-transition-style.html crashes with GuardMalloc on
https://bugs.webkit.org/show_bug.cgi?id=191304
<rdar://problem/45819476>
Reviewed by Dean Jackson.
Ensure we remove animations from the m_allAnimations ListHashSet upon destruction.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::forgetAnimation):
(WebCore::AnimationTimeline::cancelDeclarativeAnimation):
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::~WebAnimation):
2018-11-06 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSourceCocoa should unobserve its source at destruction time
https://bugs.webkit.org/show_bug.cgi?id=191295
Reviewed by Eric Carlson.
Make RealtimeOutgoingAudioSource subclasses unobserve their source
inside their destructor instead of RealtimeOutgoingAudioSource.
This is consistent with how starting to observe works.
Covered by existing tests.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::unobserveSource):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
(WebCore::RealtimeOutgoingAudioSourceCocoa::~RealtimeOutgoingAudioSourceCocoa):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
2018-11-06 Youenn Fablet <youenn@apple.com>
Make sure RTCIceCandidateStats address is undefined for host and peer reflexive case
https://bugs.webkit.org/show_bug.cgi?id=191263
Reviewed by Eric Carlson.
Test: webrtc/datachannel/getStats-no-prflx-remote-candidate.html
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillRTCIceCandidateStats):
2018-11-06 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Handle setting max number of frame between keyframes
https://bugs.webkit.org/show_bug.cgi?id=190682
Reviewed by Philippe Normand.
That has been manually checked.
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_get_property):
(gst_webrtc_video_encoder_set_property):
(register_known_encoder):
(gst_webrtc_video_encoder_class_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2018-11-03 Alex Christensen <achristensen@webkit.org>
[Mac] Implement safe browsing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=188871
Reviewed by Tim Horton.
* en.lproj/Localizable.strings:
2018-11-06 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Account for CSS zoom when computing client rects
https://bugs.webkit.org/show_bug.cgi?id=191282
Reviewed by Simon Fraser.
When computing rects for an IntersectionObserverEntry, account for the effective zoom when
converting from absolute to client coordinates.
Test: web-platform-tests/intersection-observer/bounding-box.html
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
2018-11-06 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Implement black frame generation
https://bugs.webkit.org/show_bug.cgi?id=190684
Reviewed by Xabier Rodriguez-Calvar.
Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
we are missing the canvas bridging code.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame):
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
2018-11-06 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Do not try to handle framerate modulation in the encoder
https://bugs.webkit.org/show_bug.cgi?id=190683
Reviewed by Philippe Normand.
This has to already be handled in capturing pipeline or in libwebrtc itself.
No other encoder implementation do that, and libwebrtc is not happy with encoder that do not output the exact number of frames that have been passed in.
No regressions detected and libwebrtc is happier this way, less warning output and no more frame corruption in H264 streams found.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2018-11-06 Frederic Wang <fwang@igalia.com>
Unreviewed, follow-up of previous commit.
Actually move OptionSet in the header since it's used there too.
* page/WindowFeatures.cpp:
* page/WindowFeatures.h:
2018-11-06 Frederic Wang <fwang@igalia.com>
Unreviewed build fix.
* page/WindowFeatures.cpp: Add missing header for OptionSet.
* platform/graphics/FontTaggedSettings.cpp: Add missing header for IntegerHash.
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Don't reset pending tasks when setting a null effect
https://bugs.webkit.org/show_bug.cgi?id=191301
<rdar://problem/45838422>
Reviewed by Dean Jackson.
The issue https://github.com/w3c/csswg-drafts/issues/2077 has changed the Web Animations API such that
we no longer reset pending tasks when setting a null effect on an animation.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Update the API to allow the "auto" composite value
https://bugs.webkit.org/show_bug.cgi?id=191300
<rdar://problem/45838373>
Reviewed by Dean Jackson.
The Web Animations API has been changed such that the various "composite" properties are no longer optional and instead
allow an "auto" value in their enumeration.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CompositeOperationOrAuto.h: Copied from Source/WebCore/animation/KeyframeEffect.idl.
* animation/CompositeOperationOrAuto.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl.
* animation/KeyframeEffect.cpp:
(WebCore::processKeyframeLikeObject):
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffect::getKeyframes):
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Update the API to implement Animation.updatePlaybackRate()
https://bugs.webkit.org/show_bug.cgi?id=186510
<rdar://problem/41000641>
Reviewed by Dean Jackson.
The Web Animations API has been changed to allow for changes to an animation's playback rate both synchronously,
with the existing "playbackRate" property, and asynchronously, with the new updatePlaybackRate() method. In this
patch we update the various procedures to account for pending playback rate changes and the notion of an "effective
playback rate".
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::effectivePlaybackRate const):
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::updatePlaybackRate):
(WebCore::WebAnimation::applyPendingPlaybackRate):
(WebCore::WebAnimation::playState const):
(WebCore::WebAnimation::resetPendingTasks):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::reverse):
(WebCore::WebAnimation::runPendingPauseTask):
* animation/WebAnimation.h:
(WebCore::WebAnimation::playbackRate const):
* animation/WebAnimation.idl:
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Implement getTiming() and updateTiming()
https://bugs.webkit.org/show_bug.cgi?id=186511
<rdar://problem/41000677>
Reviewed by Dean Jackson.
The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly
interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This
does not change the features of the API but simply how they are exposed.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::transformedProgress const):
(WebCore::AnimationEffect::getTiming):
(WebCore::AnimationEffect::getComputedTiming):
(WebCore::AnimationEffect::updateTiming):
(WebCore::AnimationEffect::setIterationStart):
(WebCore::AnimationEffect::setIterations):
(WebCore::AnimationEffect::endTime const):
(WebCore::AnimationEffect::setDelay):
(WebCore::AnimationEffect::setEndDelay):
(WebCore::AnimationEffect::setFill):
(WebCore::AnimationEffect::setIterationDuration):
(WebCore::AnimationEffect::setDirection):
(WebCore::AnimationEffect::setTimingFunction):
(WebCore::AnimationEffect::activeDuration const):
* animation/AnimationEffect.h:
(WebCore::AnimationEffect::delay const):
(WebCore::AnimationEffect::endDelay const):
(WebCore::AnimationEffect::fill const):
(WebCore::AnimationEffect::iterationStart const):
(WebCore::AnimationEffect::iterations const):
(WebCore::AnimationEffect::iterationDuration const):
(WebCore::AnimationEffect::direction const):
(WebCore::AnimationEffect::timingFunction const):
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.idl: Removed.
* animation/AnimationEffectTimingReadOnly.cpp: Removed.
* animation/AnimationEffectTimingReadOnly.h: Removed.
* animation/AnimationEffectTimingReadOnly.idl: Removed.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::setTimingProperties):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DocumentTimeline.cpp:
* animation/EffectTiming.idl:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
* animation/KeyframeEffect.h:
* animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h.
* animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTimingDidChange):
(WebCore::WebAnimation::updatePlaybackRate):
* animation/WebAnimation.h:
(WebCore::WebAnimation::isRelevant const):
* bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed.
* bindings/js/WebCoreBuiltinNames.h:
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Update the Web Animations API to remove all the ReadOnly interfaces
https://bugs.webkit.org/show_bug.cgi?id=186512
<rdar://problem/41000691>
Reviewed by Dean Jackson.
The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch,
we make the following changes, not adding code but merely merging and renaming files:
- AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface
- KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface
- ComputedTimingProperties is now named ComputedEffectTiming
- AnimationEffectTimingProperties is now named EffectTiming
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp.
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::timingDidChange):
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::directedProgress const):
(WebCore::AnimationEffect::transformedProgress const):
(WebCore::AnimationEffect::iterationProgress const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h.
(WebCore::AnimationEffect::isKeyframeEffect const):
* animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl.
* animation/AnimationEffectTimingReadOnly.cpp:
* animation/AnimationEffectTimingReadOnly.h:
(WebCore::AnimationEffectTimingReadOnly::setEffect):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::cssAnimationForElementAndProperty):
* animation/CSSTransition.cpp:
* animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h.
* animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize):
(WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
(WebCore::DeclarativeAnimation::phaseWithoutEffect const):
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DeclarativeAnimation.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
(WebCore::DocumentTimeline::transitionDidComplete):
(WebCore::DocumentTimeline::computeExtentOfAnimation const):
(WebCore::DocumentTimeline::isRunningAnimationOnRenderer const):
(WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const):
(WebCore::DocumentTimeline::animatedStyleForRenderer):
(WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
(WebCore::DocumentTimeline::resolveAnimationsForElement):
* animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h.
* animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl.
* animation/KeyframeEffect.cpp:
(WebCore::invalidateElement):
(WebCore::CSSPropertyIDToIDLAttributeName):
(WebCore::IDLAttributeNameToAnimationPropertyName):
(WebCore::computeMissingKeyframeOffsets):
(WebCore::processKeyframeLikeObject):
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::processKeyframes):
(WebCore::KeyframeEffect::updateBlendingKeyframes):
(WebCore::KeyframeEffect::forceLayoutIfNeeded):
(WebCore::KeyframeEffect::setBlendingKeyframes):
(WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const):
(WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists):
(WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists):
(WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
(WebCore::KeyframeEffect::computeStackingContextImpact):
(WebCore::KeyframeEffect::setTarget):
(WebCore::KeyframeEffect::apply):
(WebCore::KeyframeEffect::invalidate):
(WebCore::KeyframeEffect::computeShouldRunAccelerated):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex):
(WebCore::KeyframeEffect::updateAcceleratedAnimationState):
(WebCore::KeyframeEffect::addPendingAcceleratedAction):
(WebCore::KeyframeEffect::animationDidSeek):
(WebCore::KeyframeEffect::animationSuspensionStateDidChange):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
(WebCore::KeyframeEffect::renderer const):
(WebCore::KeyframeEffect::currentStyle const):
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
(WebCore::containsRotation):
(WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const):
(WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const):
* animation/KeyframeEffect.h:
(WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe):
(WebCore::KeyframeEffect::target const):
(WebCore::KeyframeEffect::iterationComposite const):
(WebCore::KeyframeEffect::composite const):
(WebCore::KeyframeEffect::isRunningAccelerated const):
(WebCore::KeyframeEffect::hasPendingAcceleratedAction const):
(WebCore::KeyframeEffect::hasBlendingKeyframes const):
(WebCore::KeyframeEffect::animatedProperties const):
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectOptions.h:
* animation/KeyframeEffectOptions.idl:
* animation/KeyframeEffectReadOnly.cpp: Removed.
* animation/KeyframeEffectReadOnly.h: Removed.
* animation/KeyframeEffectReadOnly.idl: Removed.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::applyPendingAcceleratedActions):
(WebCore::WebAnimation::computeRelevance):
* animation/WebAnimation.h:
(WebCore::WebAnimation::effect const):
* animation/WebAnimation.idl:
* bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::constructJSWebAnimation):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
2018-11-06 Rob Buis <rbuis@igalia.com>
Some minor X-Content-Type-Options parsing issues
https://bugs.webkit.org/show_bug.cgi?id=191107
Reviewed by Darin Adler.
Implement new parsing rules for X-Content-Type-Options [1]:
https://github.com/whatwg/fetch/pull/818
[1] https://fetch.spec.whatwg.org/#x-content-type-options-header
Test: web-platform-tests/fetch/nosniff/parsing-nosniff.html
* platform/network/HTTPParsers.cpp:
(WebCore::isHTTPTabOrSpace):
(WebCore::parseContentTypeOptionsHeader):
2018-11-06 Frederic Wang <fwang@igalia.com>
Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342
Reviewed by Simon Fraser.
Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it
scrollable. However, the RenderLayerBacking's scrolling layer is not properly created
when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess
receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the
associated update. In debug mode this hits an ASSERT and in release mode the overflow node
remains unscrollable from the user's point of view. This patch fixes this issue by ensuring
the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus.
Test: fast/scrolling/ios/update-scroll-coordinated-status.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration()
to ensure the scrolling layer is present and indicate whether a rebuild is necessary.
2018-11-05 Zan Dobersek <zdobersek@igalia.com>
Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
https://bugs.webkit.org/show_bug.cgi?id=191267
Reviewed by Michael Catanzaro.
Move the Fontconfig-specific RefPtr specialization declarations from
RefPtrCairo.h to RefPtrFontconfig.h, with definitions moved to the new
RefPtrFontconfig.cpp implementation file. These specializations are
not tied to Cairo in any way.
* platform/FreeType.cmake:
* platform/graphics/FontPlatformData.h:
* platform/graphics/cairo/RefPtrCairo.cpp:
* platform/graphics/cairo/RefPtrCairo.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
* platform/graphics/freetype/RefPtrFontconfig.cpp: Added.
(WTF::refIfNotNull):
(WTF::derefIfNotNull):
* platform/graphics/freetype/RefPtrFontconfig.h: Copied from Source/WebCore/platform/graphics/cairo/RefPtrCairo.h.
2018-11-05 Don Olmstead <don.olmstead@sony.com>
[CMake] Fix WebCore/Modules includes
https://bugs.webkit.org/show_bug.cgi?id=191287
Reviewed by Fujii Hironori.
No new tests. No change in behavior.
Add in applicationmanifest to the list of includes and sort the
modules directory.
* CMakeLists.txt:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Cache glyph paths and share underline skipping code between all the ports
https://bugs.webkit.org/show_bug.cgi?id=191239
Reviewed by Alex Christensen.
I was hoping that caching the glyph paths was going to be a performance progression,
but it turns out that the additional overhead of WebCore::Path compensated for it.
In total, the performance is the same (my testing says that this patch is a 1%
progression, but that's within the noise).
Because the ink skipping logic is now shared among all ports, Windows now gets it for
free.
Test: PerformanceTests/Layout/underline.html
* platform/graphics/Font.cpp:
(WebCore::Font::pathForGlyph const):
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::computeUnderlineType):
(WebCore::GlyphIterationState::GlyphIterationState):
(WebCore::findIntersectionPoint):
(WebCore::updateX):
(WebCore::findPathIntersections):
(WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
(WebCore::GlyphToPathTranslator::containsMorePaths):
(WebCore::GlyphToPathTranslator::path):
(WebCore::GlyphToPathTranslator::extents):
(WebCore::GlyphToPathTranslator::underlineType):
(WebCore::GlyphToPathTranslator::advance):
(WebCore::FontCascade::dashesForIntersectionsWithRect const):
* platform/graphics/FontCascade.h:
* platform/graphics/GlyphMetricsMap.h:
(WebCore::GlyphMetricsMap::existingMetricsForGlyph):
(WebCore::GlyphMetricsMap::GlyphMetricsPage::existingMetricsForGlyph const):
(WebCore::GlyphMetricsMap<std::optional<Path>>::unknownMetrics):
* platform/graphics/TextRun.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::Font::platformPathForGlyph const):
(WebCore::GlyphIterationState::GlyphIterationState): Deleted.
(WebCore::findIntersectionPoint): Deleted.
(WebCore::updateX): Deleted.
(WebCore::findPathIntersections): Deleted.
(): Deleted.
(WebCore::CairoGlyphToPathTranslator::path): Deleted.
(WebCore::CairoGlyphToPathTranslator::extents): Deleted.
(WebCore::CairoGlyphToPathTranslator::underlineType): Deleted.
(WebCore::CairoGlyphToPathTranslator::advance): Deleted.
(WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::GlyphIterationState::GlyphIterationState): Deleted.
(WebCore::findIntersectionPoint): Deleted.
(WebCore::updateX): Deleted.
(WebCore::findPathIntersections): Deleted.
(): Deleted.
(WebCore::MacGlyphToPathTranslator::path): Deleted.
(WebCore::MacGlyphToPathTranslator::extents): Deleted.
(WebCore::MacGlyphToPathTranslator::underlineType): Deleted.
(WebCore::MacGlyphToPathTranslator::advance): Deleted.
(WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformPathForGlyph const):
* rendering/TextDecorationPainter.cpp:
(WebCore::drawSkipInkUnderline):
(WebCore::TextDecorationPainter::paintTextDecoration):
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Clean up text decoration drawing code
https://bugs.webkit.org/show_bug.cgi?id=191245
Reviewed by Zalan Bujtas.
This is some general clean up of the text decorations code. There is no behavior change.
This patch modifies GraphicsContext::drawLineForText() & friends to accept a FloatRect instead of a FloatPoint + float width.
This is helpful because it allows for easier bounding box calculations.
This patch also removes some redundant computations that the skip:ink codepath was performing.
This patch also refactors the wavy decoration parameters to not use out params.
No new tests because there is no behavior change.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::computeUnderlineBoundsForText):
(WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::drawLinesForText):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawLinesForText::apply const):
(WebCore::DisplayList::DrawLinesForText::localBounds const):
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawLinesForText::create):
(WebCore::DisplayList::DrawLinesForText::thickness const):
(WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawLinesForText):
* platform/graphics/displaylists/DisplayListRecorder.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextDecorationPainter.cpp:
(WebCore::strokeWavyTextDecoration):
(WebCore::translateIntersectionPointsToSkipInkBoundaries):
(WebCore::TextDecorationPainter::TextDecorationPainter):
(WebCore::TextDecorationPainter::paintTextDecoration):
(WebCore::drawSkipInkUnderline): Deleted.
* rendering/TextDecorationPainter.h:
(WebCore::TextDecorationPainter::setInlineTextBox):
(WebCore::TextDecorationPainter::setWidth):
(WebCore::TextDecorationPainter::setFont): Deleted.
(WebCore::TextDecorationPainter::setBaseline): Deleted.
* style/InlineTextBoxStyle.cpp:
(WebCore::getWavyStrokeParameters):
(WebCore::visualOverflowForDecorations):
* style/InlineTextBoxStyle.h:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Fix the Windows build after r237835
https://bugs.webkit.org/show_bug.cgi?id=191242
Reviewed by Simon Fraser.
* rendering/style/TextDecorationThickness.h:
(WebCore::TextDecorationThickness::operator== const):
2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Swatch appears squished and off-center in inputs of type color
https://bugs.webkit.org/show_bug.cgi?id=191279
<rdar://problem/45816319>
Reviewed by Tim Horton.
This patch makes some small adjustments to color inputs on iOS to bring them closer to the intended design.
See comments below for more details.
Tests: fast/forms/color/color-input-uses-color-well-appearance.html
fast/forms/color/input-appearance-color.html
* css/html.css:
Adjust the UA stylesheet for color inputs on iOS.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintDecorations):
When painting decorations for `ColorWellPart`, treat it as a standard button instead of the square button
appearance.
(WebCore::RenderTheme::colorInputStyleSheet const):
Add `-webkit-appearance: color-well;` to the stylesheet for color inputs. Previously, this was special-cased on
iOS, where color input elements had appearances of `textfield`; however, this patch makes some adjustments to
RenderThemeIOS, allowing us to use `color-well` on iOS.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformUsesColorWellAppearance const): Deleted.
Remove this from RenderTheme. This is no longer necessary, since all platforms now use
`-webkit-appearance: color-well;`.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustButtonStyle const):
When painting buttons for color inputs, don't add rounded corners that are present by default for regular
buttons.
2018-11-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] An audio track should be muted when capture is interrupted by the OS.
https://bugs.webkit.org/show_bug.cgi?id= 191283
<rdar://problem/45773103>
Reviewed by Jon Lee.
Test: fast/mediastream/media-stream-track-interrupted.html
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setInterruptedForTesting):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::beginInterruption):
(WebCore::CoreAudioCaptureSource::endInterruption):
* testing/Internals.cpp:
(WebCore::Internals::setMediaStreamSourceInterrupted):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Parsing support for text-underline-offset and text-decoration-thickness
https://bugs.webkit.org/show_bug.cgi?id=191242
Reviewed by Simon Fraser.
Before we can implement the properties properly, we have to parse them.
https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-432297480 describes the grammar:
text-underline-position: auto | [ [ under | from-font] || [ left | right ] ]
text-underline-offset: auto | <length>
text-decoration-thickness: auto | from-font | <length>
This patch also takes the opportunity to update the grammar of text-underline-position to match the spec,
and to add an alias to the unprefixed version.
We still don't support the left and right values on text-underline-position. We should add those eventually.
Tests: fast/css3-text/css3-text-decoration/text-decoration-thickness-parse.html
fast/css3-text/css3-text-decoration/text-underline-offset-parse.html
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::textUnderlineOffsetToCSSValue):
(WebCore::textDecorationThicknessToCSSValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
(WebCore::CSSPrimitiveValue::operator OptionSet<TextUnderlinePosition> const): Deleted.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::convertTextUnderlineOffset):
(WebCore::StyleBuilderConverter::convertTextDecorationThickness):
* css/StyleResolver.cpp:
(WebCore::shouldApplyPropertyInParseOrder):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTextUnderlineOffset):
(WebCore::consumeTextDecorationThickness):
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::textUnderlinePosition const):
(WebCore::RenderStyle::textUnderlineOffset const):
(WebCore::RenderStyle::textDecorationThickness const):
(WebCore::RenderStyle::setTextUnderlinePosition):
(WebCore::RenderStyle::setTextUnderlineOffset):
(WebCore::RenderStyle::setTextDecorationThickness):
(WebCore::RenderStyle::initialTextUnderlinePosition):
(WebCore::RenderStyle::initialTextUnderlineOffset):
(WebCore::RenderStyle::initialTextDecorationThickness):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/TextDecorationThickness.h: Added.
(WebCore::TextDecorationThickness::createWithAuto):
(WebCore::TextDecorationThickness::createFromFont):
(WebCore::TextDecorationThickness::createWithLength):
(WebCore::TextDecorationThickness::isAuto const):
(WebCore::TextDecorationThickness::isFromFont const):
(WebCore::TextDecorationThickness::isLength const):
(WebCore::TextDecorationThickness::setLengthValue):
(WebCore::TextDecorationThickness::lengthValue const):
(WebCore::TextDecorationThickness::operator== const):
(WebCore::TextDecorationThickness::operator!= const):
(WebCore::TextDecorationThickness::TextDecorationThickness):
(WebCore::operator<<):
* rendering/style/TextUnderlineOffset.h: Added.
(WebCore::TextUnderlineOffset::createWithAuto):
(WebCore::TextUnderlineOffset::createWithLength):
(WebCore::TextUnderlineOffset::isAuto const):
(WebCore::TextUnderlineOffset::isLength const):
(WebCore::TextUnderlineOffset::setLengthValue):
(WebCore::TextUnderlineOffset::lengthValue const):
(WebCore::TextUnderlineOffset::lengthOr const):
(WebCore::TextUnderlineOffset::operator== const):
(WebCore::TextUnderlineOffset::operator!= const):
(WebCore::TextUnderlineOffset::TextUnderlineOffset):
(WebCore::operator<<):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
* style/InlineTextBoxStyle.h:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Spelling dots are drawn in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=190764
Reviewed by Dean Jackson.
- Dots should not be clipped.
- Dots should be horizontally centered.
- Dots should be drawn behind the text.
- Distance from the baseline to the top of the dot should be 11.035% of font size.
- Dot diameter should be 13.247% of the font size.
- Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
- The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
Tests: editing/spelling/spelling-dots-position-2.html
editing/spelling/spelling-dots-position-3.html
editing/spelling/spelling-dots-position.html
editing/spelling/spelling-dots-repaint.html
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
(WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
because there is no guarantee the spelling dots will lie inside the layout rect of the element.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
* rendering/InlineFlowBox.h: Comments should explain why, not say what.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Draw the dots behind the text.
(WebCore::InlineTextBox::hasMarkers const): Convenience.
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
(WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
(WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
(WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
* rendering/InlineTextBox.h: Declare the helper methods.
* rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
spelling dots opt us out of SLL.
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
2018-11-05 Dean Jackson <dino@apple.com>
Attempted build fix.
* dom/messageports/MessagePortChannelRegistry.cpp:
2018-11-05 Chris Dumez <cdumez@apple.com>
Crash under DOMWindow::postMessageTimerFired()
https://bugs.webkit.org/show_bug.cgi?id=191217
<rdar://problem/40888466>
Reviewed by Geoffrey Garen.
Protect the frame in DOMWindow::postMessageTimerFired() before calling dispatchEvent() as dispatching the
event may cause JS to run and this JS may cause the frame to be destroyed, in which case we will crash
when trying to use the frame on the next line.
Test: fast/dom/Window/remove-frame-in-message-event-handler.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessageTimerFired):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix EncodedImage timestamps to match what libWebRTC expects
https://bugs.webkit.org/show_bug.cgi?id=190035
Reviewed by Philippe Normand.
We can't rely on GStreamer timestamps to pass to EncodedImages after encoding
because libWebRTC doesn't use the timestamp we fed it but does
some computation on the input timestamp in the images we pass in before it passes
them back to the encoder. Then internally LibWebRTC relies on those exact timestamps
passed into the encoder to do checks and compute RTP timestamps so we need to carefully
pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in
all the GStreamer processing pipelines as the WebRTC object basically wraps the "same"
`GstSample` all around, but we are not synced on the clock anyway).
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::LibWebRTCVideoFrameFromGStreamerSample):
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::newSampleCallback):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Changing view scale sometimes does not zoom the page to the new initial scale when the page is zoomed in when ignoring meta viewport
https://bugs.webkit.org/show_bug.cgi?id=191226
<rdar://problem/45781765>
Reviewed by Tim Horton.
When `_setViewScale:` SPI is used to adjust the layout scale factor of the page, we multiply minimum, initial
and maximum scales by the given layout scale factor to adjust for a larger or smaller minimum layout size.
However, in the case where the layout size scale factor is greater than 1 and we're also forcing the viewport to
be scalable, we override the default minimum scale with 1 (i.e. `forceAlwaysUserScalableMinimumScale`). This
means that the might be off by a small margin due to rounding error when computing the content width and view
width (see: r237743).
This means that in the case where (1) the viewport is forced to be user-scalable, and (2) we're ignoring meta
viewport parameters, and (3) `_viewScale` exceeds 1, we may end up computing a slightly different minimum scale
than the default minimum scale multiplied by the layout size scale factor; subsequently, the page scale factor
will be slightly different from initial scale, such that we'll no longer zoom to the new initial scale when
changing view scale.
This patch adjusts `forceAlwaysUserScalableMinimumScale` and `forceAlwaysUserScalableMaximumScale` to take the
current layout scale factor into account when computing min and max scales when the viewport is forced to be
always scalable.
Test: fast/viewport/ios/minimum-scale-after-changing-view-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::minimumScale const):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::maximumScale const):
(WebCore::ViewportConfiguration::forceAlwaysUserScalableMaximumScale const):
(WebCore::ViewportConfiguration::forceAlwaysUserScalableMinimumScale const):
Turn these from constant values to const functions on ViewportConfiguration, which factor in the current
viewport layout size scale factor.
2018-11-05 Dean Jackson <dino@apple.com>
Expose a constructor for PointerEvent from PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=191238
<rdar://problem/45795682>
Reviewed by Antoine Quint.
Implement a constructor that takes a PlatformTouchEvent to
create a PointerEvent. At the moment the code to call this
constructor will live in WebKitAdditions, so no new tests
yet.
* SourcesCocoa.txt: Add PointerEventIOS.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* dom/EventNames.h: Add macros for pointerdown, pointermove,
pointerup, pointercancel.
* dom/PointerEvent.cpp: Remove JSC namespace.
* dom/PointerEvent.h: Add create and constructor that takes
a PlatformTouchEvent.
* dom/ios/PointerEventIOS.cpp: Added.
2018-11-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237785.
Introduced layout test and API test failures on macOS and iOS.
Reverted changeset:
"[iOS] Issue initial paint soon after the visuallyNonEmpty
milestone is fired."
https://bugs.webkit.org/show_bug.cgi?id=191078
https://trac.webkit.org/changeset/237785
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Error out when simulcast is activated
https://bugs.webkit.org/show_bug.cgi?id=190678
Reviewed by Philippe Normand.
Implementing it is not for now yet.
Tests for simulcast have been disabled as they now fail (instead of crashing).
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2018-11-05 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
https://bugs.webkit.org/show_bug.cgi?id=191241
Reviewed by Eric Carlson.
Moving the logic to observe the audio source to the point where the
RealtimeOutgoingAudioSource subclass is fully initialized.
Covered by existing tests.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::observeSource):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
https://bugs.webkit.org/show_bug.cgi?id=190674
Reviewed by Philippe Normand.
webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
it can use to implement encoding for different formats exposing a trimmed down unified API.
It also adds proper handling of H264 profiles.
The added files follow GStreamer coding style as we aim at upstreaming the element
in the future.
This is a refactoring so current tests already cover it.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
(gst_webrtc_video_encoder_get_property):
(gst_webrtc_video_encoder_set_bitrate):
(gst_webrtc_video_encoder_set_format):
(gst_webrtc_video_encoder_set_property):
(register_known_encoder):
(setup_x264enc):
(setup_vp8enc):
(setup_openh264enc):
(set_bitrate_kbit_per_sec):
(set_bitrate_bit_per_sec):
(gst_webrtc_video_encoder_class_init):
(gst_webrtc_video_encoder_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::createEncoder):
(WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
(WebCore::GStreamerVideoEncoder::ImplementationName const):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] properly mark H.264 stream type in the "decoder"
https://bugs.webkit.org/show_bug.cgi?id=190676
Reviewed by Philippe Normand.
Avoiding to have h264parse make assumption (which might be wrong at some
point).
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GetCapsForFrame):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Do not sync libwerbtc stream on the clock
https://bugs.webkit.org/show_bug.cgi?id=190677
The approach here is basically to let libwebrtc do all the
synchronisation for us, and the same way as it is done in apple ports,
we basically try to display what libwebrtc outputs as fast as possible.
Reviewed by Philippe Normand.
Manually tested
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::setSyncOnSink):
(WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2018-11-05 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
https://bugs.webkit.org/show_bug.cgi?id=191210
Reviewed by Simon Fraser.
isIntersecting should be false if the intersection ratio is smaller than the
smallest threshold value. Update the computation of isIntersecting to depend on
the current thresholdIndex.
Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
2018-11-05 Rob Buis <rbuis@igalia.com>
Remove some virtual methods in CachedRawResource
https://bugs.webkit.org/show_bug.cgi?id=191251
Reviewed by Frédéric Wang.
Since CachedRawResource is final no need to introduce new virtual
methods in CachedRawResource. This patch also removes an outdated
comment and forward declaration.
No new tests since no change in functionality.
* loader/cache/CachedRawResource.h:
2018-11-05 Philippe Normand <pnormand@igalia.com>
[GStreamer] Move elements registration to GStreamerCommon
https://bugs.webkit.org/show_bug.cgi?id=191189
Reviewed by Xabier Rodriguez-Calvar.
It was a bit odd to have this in the base player class and to have
sub-classes calling a static function of the super-class.
Covered by existing tests.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitElements):
* platform/graphics/gstreamer/GStreamerCommon.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::isAvailable):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2018-11-04 Rob Buis <rbuis@igalia.com>
Remove ENABLE_OPENCL fully
https://bugs.webkit.org/show_bug.cgi?id=191172
Reviewed by Yusuke Suzuki.
Forgot to simplify this, no need for applyAll anymore
since it just calls apply.
No new tests since no change in functionality.
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::applyAll): Deleted.
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
2018-11-04 Zalan Bujtas <zalan@apple.com>
[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
https://bugs.webkit.org/show_bug.cgi?id=191078
<rdar://problem/45736178>
Reviewed by Antti Koivisto.
1. Improve visuallyNonEmpty milestone confidence level.
Ignore whitespace and non visible text content.
Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
Check if the html/body is actually visible.
2. Issue initial paint soon after the milestone fires.
Use a 0ms timer to flush the initial paint.
Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
3. Suspend optional style recalcs and layouts while painting is being throttled.
When parsing yields we initiate a 0ms style recalc/layout timer.
These optional layouts produce content that we have no intention to paint.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::shouldScheduleLayout):
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
(WebCore::FrameView::updateIsVisuallyNonEmpty):
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
* platform/graphics/FontCascade.h:
* rendering/RenderText.cpp: Check whether the text is actually visible at this point.
(WebCore::RenderText::RenderText):
2018-11-04 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Add support for percentage height in quirks mode.
https://bugs.webkit.org/show_bug.cgi?id=191232
Reviewed by Antti Koivisto.
In quirks mode, we go and travers the containing block chain to find a block level
box with fixed height value to resolve the percentage value.
Test: fast/block/basic/quirk-mode-percent-height.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2018-11-04 Zalan Bujtas <zalan@apple.com>
[LFC][BCF] Add support for block level non-replaced inflow height percentage
https://bugs.webkit.org/show_bug.cgi?id=191229
Reviewed by Antti Koivisto.
Test: fast/block/basic/child-block-level-box-with-height-percent.html
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
(WebCore::Layout::computedHeightValue): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-11-04 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSource should use DestructionThread::Main
https://bugs.webkit.org/show_bug.cgi?id=191230
Reviewed by Eric Carlson.
Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
that should no longer crash in debug.
* platform/mediastream/RealtimeOutgoingAudioSource.h:
2018-11-04 Youenn Fablet <youenn@apple.com>
IDB should allow storing RTCCertificate
https://bugs.webkit.org/show_bug.cgi?id=191077
Reviewed by Chris Dumez.
Add support for serialization/deserialization of RTCCertificate.
Store the origin in RTCCertificate and make sure that a certificate
with a different origin cannot be used to create a RTCPeerConnection.
Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::generateCertificate):
* Modules/mediastream/RTCCertificate.cpp:
(WebCore::RTCCertificate::create):
(WebCore::RTCCertificate::RTCCertificate):
* Modules/mediastream/RTCCertificate.h:
(WebCore::RTCCertificate::origin const):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::certificatesFromConfiguration):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
(WebCore::LibWebRTCCertificateGenerator::generateCertificate):
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::CachedString::takeString):
(WebCore::CloneDeserializer::readRTCCertificate):
(WebCore::CloneDeserializer::readTerminal):
2018-11-04 Youenn Fablet <youenn@apple.com>
Add support for RTCMuxPolicy
https://bugs.webkit.org/show_bug.cgi?id=191188
Reviewed by Eric Carlson.
Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
Make sure setConfiguration throws if trying to change this policy.
Pipe this parameter up to libwebrtc.
Covered by rebased test.
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::rtcpMuxPolicyfromConfiguration):
(WebCore::configurationFromMediaEndpointConfiguration):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/mediastream/RTCPMuxPolicy.h: Added.
2018-11-03 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
https://bugs.webkit.org/show_bug.cgi?id=190854
Reviewed by Matt Baker.
Updated existing tests: inspector/canvas/recording-2d.html
inspector/canvas/recording-bitmaprenderer.html
inspector/canvas/recording-webgl.html
* html/HTMLCanvasElement.idl:
Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
that they are recorded through the same path as `CanvasRenderingContext`.
* html/CanvasBase.h:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::callTracingActive const): Added.
* bindings/js/CallTracer.h:
* bindings/js/CallTracer.cpp:
(WebCore::CallTracer::recordCanvasAction):
2018-11-03 Andy Estes <aestes@apple.com>
[Payment Request] PaymentResponse.retry()'s errorFields should be optional
https://bugs.webkit.org/show_bug.cgi?id=191212
Reviewed by Youenn Fablet.
Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
<https://github.com/w3c/payment-request/issues/804> for details.
Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
* Modules/paymentrequest/PaymentResponse.idl:
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Resolve percentage height values.
https://bugs.webkit.org/show_bug.cgi?id=191224
Reviewed by Antti Koivisto.
10.5 Content height: the 'height' property
The percentage is calculated with respect to the height of the generated box's containing block.
If the height of the containing block is not specified explicitly (i.e., it depends on content height),
and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
https://www.w3.org/TR/CSS22/visudet.html#propdef-height
Test: fast/block/basic/height-percentage-simple.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::isHeightAuto):
(WebCore::Layout::computedHeightValue):
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2018-11-03 Eric Carlson <eric.carlson@apple.com>
[MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=191177
<rdar://problem/45747873>
Reviewed by Jer Noble.
Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isSecure): Moved from UserMediaRequest.cpp.
(WebCore::isAllowedToUse): Ditto.
(WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
(WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
* Modules/mediastream/UserMediaController.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
(WebCore::isSecure): Deleted.
(WebCore::isAllowedToUse): Deleted.
(WebCore::canCallGetUserMedia): Deleted.
2018-11-02 Justin Michaud <justin_michaud@apple.com>
Add new global object and preliminary Worklets support for CSS painting api
https://bugs.webkit.org/show_bug.cgi?id=190979
Reviewed by Chris Dumez.
Test: fast/css-custom-paint/worklet.html
Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
left as ASSERT_NOT_REACHED().
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::scriptExecutionContext const):
* bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
(WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
(WebCore::JSPaintWorkletGlobalScope::registerPaint):
* bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
(WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
(WebCore::JSWorkletGlobalScopeBase::finishCreation):
(WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
(WebCore::JSWorkletGlobalScopeBase::visitChildren):
(WebCore::JSWorkletGlobalScopeBase::destroy):
(WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
(WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
(WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
(WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
(WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
(WebCore::toJS):
(WebCore::toJSWorkletGlobalScope):
* bindings/js/JSWorkletGlobalScopeBase.h: Added.
(WebCore::JSWorkletGlobalScopeBase::wrapped const):
(WebCore::JSWorkletGlobalScopeBase::proxy const):
(WebCore::JSWorkletGlobalScopeBase::createStructure):
(WebCore::toJS):
* bindings/js/ScriptState.cpp:
(WebCore::execStateFromWorkerGlobalScope):
(WebCore::execStateFromWorkletGlobalScope):
* bindings/js/ScriptState.h:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/scripts/CodeGeneratorJS.pm:
(IsDOMGlobalObject):
(ShouldUseGlobalObjectPrototype):
(GenerateHeader):
(GenerateRuntimeEnableConditionalStringForExposed):
(GenerateImplementation):
* bindings/scripts/preprocess-idls.pl:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/DOMCSSPaintWorklet.cpp:
(WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
(WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
* css/DOMCSSPaintWorklet.h:
* css/DOMCSSPaintWorklet.idl:
* dom/Document.cpp:
(WebCore::Document::ensureCSSPaintWorklet):
(WebCore::Document::setCSSPaintWorkletGlobalScope):
(WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
* dom/Document.h:
(WebCore::Document::getCSSPaintWorkletGlobalScope):
* dom/EventTargetFactory.in:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::vm):
(WebCore::ScriptExecutionContext::execState):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
* inspector/agents/worker/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/agents/worker/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
* worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
(WebCore::PaintWorkletGlobalScope::create):
(WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
(WebCore::PaintWorkletGlobalScope::devicePixelRatio):
(WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
* worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
* worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
* worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
(WebCore::Worklet::create):
(WebCore::Worklet::Worklet):
(WebCore::Worklet::addModule):
* worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
* worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
* worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
(WebCore::WorkletConsoleClient::WorkletConsoleClient):
(WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
(WebCore::WorkletConsoleClient::count):
(WebCore::WorkletConsoleClient::time):
(WebCore::WorkletConsoleClient::timeEnd):
(WebCore::WorkletConsoleClient::profile):
(WebCore::WorkletConsoleClient::profileEnd):
(WebCore::WorkletConsoleClient::takeHeapSnapshot):
(WebCore::WorkletConsoleClient::timeStamp):
(WebCore::WorkletConsoleClient::record):
(WebCore::WorkletConsoleClient::recordEnd):
* worklets/WorkletConsoleClient.h: Added.
* worklets/WorkletGlobalScope.cpp: Added.
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
(WebCore::WorkletGlobalScope::~WorkletGlobalScope):
(WebCore::WorkletGlobalScope::evaluate):
(WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
(WebCore::WorkletGlobalScope::disableEval):
(WebCore::WorkletGlobalScope::disableWebAssembly):
(WebCore::WorkletGlobalScope::completeURL const):
(WebCore::WorkletGlobalScope::logExceptionToConsole):
(WebCore::WorkletGlobalScope::addConsoleMessage):
(WebCore::WorkletGlobalScope::addMessage):
* worklets/WorkletGlobalScope.h: Added.
(WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
(WebCore::WorkletGlobalScope::identifier const):
(WebCore::WorkletGlobalScope::script):
(WebCore::WorkletGlobalScope::jsRuntimeFlags const):
(isType):
* worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
* worklets/WorkletScriptController.cpp: Added.
(WebCore::WorkletScriptController::WorkletScriptController):
(WebCore::WorkletScriptController::~WorkletScriptController):
(WebCore::WorkletScriptController::forbidExecution):
(WebCore::WorkletScriptController::isExecutionForbidden const):
(WebCore::WorkletScriptController::disableEval):
(WebCore::WorkletScriptController::disableWebAssembly):
(WebCore::WorkletScriptController::initScriptWithSubclass):
(WebCore::WorkletScriptController::initScript):
(WebCore::WorkletScriptController::evaluate):
(WebCore::WorkletScriptController::setException):
* worklets/WorkletScriptController.h: Added.
(WebCore::WorkletScriptController::workletGlobalScopeWrapper):
(WebCore::WorkletScriptController::vm):
(WebCore::WorkletScriptController::initScriptIfNeeded):
2018-11-02 Myles C. Maxfield <mmaxfield@apple.com>
Clean up drawLineForDocumentMarker()
https://bugs.webkit.org/show_bug.cgi?id=191215
Reviewed by Zalan Bujtas.
In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
This patch has no behavior change; it just does the following:
1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
2. Moves our implementation back into GraphicsContext, because it's simpler and GraphicsContext is already platform-
specific.
3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
No new tests because there is no behavior change.
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawDotsForDocumentMarker):
(WebCore::Cairo::drawLineForDocumentMarker): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
(WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::colorForMarkerLineStyle):
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::Item::sizeInBytes):
(WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
(WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
(WebCore::DisplayList::operator<<):
(WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawDotsForDocumentMarker::create):
(WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
(WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
(WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
(WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
* rendering/RenderTheme.h:
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
2018-11-02 Ali Juma <ajuma@chromium.org>
requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
https://bugs.webkit.org/show_bug.cgi?id=176243
Reviewed by Simon Fraser.
When a new layer tree is committed to the UIProcess, the positions of layers for fixed
or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
leads to a recursive traversal of the ScrollingTree to update each such layer. However,
since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
this traversal never descended into scrolling nodes within an iframe, so the layers for
these nodes were left with stale positions.
Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
fixed and sticky layers within an iframe do get their positions updated when a new layer
tree is committed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
2018-11-02 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
https://bugs.webkit.org/show_bug.cgi?id=191180
<rdar://problem/45744786>
Reviewed by Simon Fraser.
When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
width or height.
Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so
slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
in `ViewportConfiguration::minimumScale` returning 0.94158.
With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
`_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
should, since the page scale factor and the initial scale are different enough such that
`areEssentiallyEqualAsFloat` returns false.
This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::minimumScale const):
2018-11-02 Philippe Normand <pnormand@igalia.com>
[GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::addEventListenersToNode):
2018-11-02 Daniel Bates <dabates@apple.com>
[iOS] Normalize character string based on key code
https://bugs.webkit.org/show_bug.cgi?id=191120
Reviewed by Tim Horton.
Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
for a special key (e.g. page up) and can simplify the character string normalization code.
No functionality changed. So, no new tests.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
in terms of it.
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
2018-11-02 Daniel Bates <dabates@apple.com>
[iOS] WebKit should dispatch DOM events when a modifier key is pressed
https://bugs.webkit.org/show_bug.cgi?id=190487
Reviewed by Tim Horton.
Add support for modifier flags change events.
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
participate in key repeat.
(WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
the modifier key is unidentified. This matches the behavior on Mac.
(WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
key is unidentified. This matches the behavior on Mac.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Modifier keys do not have an associated character and do not participate in key repeat.
(-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
that represents a modifier flags change.
(-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
invariant as it is a programming error. On Mac, the same operation would result in a
NSInternalInconsistencyException exception being raised.
(-[WebEvent charactersIgnoringModifiers]): Ditto.
2018-11-02 Ali Juma <ajuma@chromium.org>
Allow cross-document intersection observing
https://bugs.webkit.org/show_bug.cgi?id=165746
Reviewed by Simon Fraser.
Add logic to compute the intersection between the viewport and an element in a
subframe.
Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
of the methods it calls.
Test: http/tests/intersection-observer/intermediate-frame-changes.html
Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
* dom/Document.cpp:
(WebCore::computeClippedRectInRootContentsSpace):
(WebCore::computeIntersectionState):
(WebCore::Document::updateIntersectionObservations):
* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged):
(WebCore::FrameView::convertFromContainingViewToRenderer const):
(WebCore::FrameView::convertFromContainingView const):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::viewToContents const):
(WebCore::ScrollView::contentsToView const):
(WebCore::ScrollView::rootViewToContents const):
* platform/ScrollView.h:
* platform/Widget.cpp:
(WebCore::Widget::convertFromRootView const):
(WebCore::Widget::convertFromContainingView const):
* platform/Widget.h:
2018-11-02 Rob Buis <rbuis@igalia.com>
Remove ENABLE_OPENCL fully
https://bugs.webkit.org/show_bug.cgi?id=191172
Reviewed by Yusuke Suzuki.
No new tests since no change in functionality.
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::hasResult const):
(WebCore::FilterEffect::applyAll):
(WebCore::FilterEffect::openCLImage): Deleted.
(WebCore::FilterEffect::setOpenCLImage): Deleted.
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for intrinsic width calculation
https://bugs.webkit.org/show_bug.cgi?id=191144
Reviewed by Antti Koivisto.
This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
Test: fast/inline/simple-shrink-to-fit-inline-block.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
https://bugs.webkit.org/show_bug.cgi?id=191181
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC] Align shrink-to-fit width computation with the layout implementation.
https://bugs.webkit.org/show_bug.cgi?id=191179
Reviewed by Antti Koivisto.
There are many similarities between layout and shrink-to-fit.
They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
the algoritm depends on what type of formatting context the element establishes.
This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2018-11-01 Antoine Quint <graouts@apple.com>
[Web Animations] Make document.getAnimations() return declarative animations in the correct order
https://bugs.webkit.org/show_bug.cgi?id=191153
Reviewed by Dean Jackson.
The Web Animations spec has the notion of "composite order" which determines the order in which animations should
be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
determine the composite order of their respective animation classes, as well as the notion of "owning element",
the element that was the animation target when specified through style, prior to any manipulation via the Web
Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
declarative animations.
It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
declarative animation has been modified.
In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
may be canceled if overridden with a new animation, correctly removing their "owning element".
Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
in order as the final criterion for sorting.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
created for this timeline in the order in which they were created, which is needed to sort animations correctly when
document.getAnimations() is called.
(WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
to determine which map we should add an animation to based on its class and instead have code that accounts for not just
the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
a CSS Transition or CSS Animation, regardless of the animation's original class.
(WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
that animationWasRemovedFromElement() can call this with all of the various animation maps.
(WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
(WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
well as completed CSS Transitions was factored out. This allowed us to also call this function from
DeclarativeAnimation::disassociateFromOwningElement().
(WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
(WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
transitions for a given element as it can be cleared by a prior cancelation.
(WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it
were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
declarative animation with an owning element.
(WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
animations and send events" procedure.
(WebCore::AnimationTimeline::animations const): Deleted.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
DeclarativeAnimation constructor.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
DeclarativeAnimation constructor.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::DeclarativeAnimation):
(WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
"update animations and send events" procedure is run.
(WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
Web Animations created via the Web Animations API.
(WebCore::DeclarativeAnimation::initialize):
(WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
cancels the animation but also disassociates it from its owning element.
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
(WebCore::DeclarativeAnimation::enqueueDOMEvent):
* animation/DeclarativeAnimation.h:
(WebCore::DeclarativeAnimation::owningElement const):
(WebCore::DeclarativeAnimation::target const): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
(WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
(WebCore::DocumentTimeline::transitionDidComplete):
* animation/DocumentTimeline.h:
2018-11-02 Zan Dobersek <zdobersek@igalia.com>
PNGImageDecoder: report no repetition for non-animated images
https://bugs.webkit.org/show_bug.cgi?id=191068
Reviewed by Michael Catanzaro.
When building with APNG support enabled, the
PNGImageDecoder::repetitionCount() method until now reported infinite
repetition count for all PNG images, even the ones that were not
animated. This is now changed so that no repetition is reported for
non-animated images.
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::repetitionCount const):
2018-11-02 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for MSL shaders
https://bugs.webkit.org/show_bug.cgi?id=191084
Reviewed by Dean Jackson.
Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
Test: webgpu/webgpu-basics.html
Test: webgpu/shader-modules.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUDevice.cpp:
(WebCore::GPUDevice::createShaderModule const):
* Modules/webgpu/GPUDevice.h:
(WebCore::GPUDevice::platformDevice const):
* Modules/webgpu/GPUShaderModule.h:
(WebCore::GPUShaderModule::platformShaderModule const):
* Modules/webgpu/GPUShaderModuleDescriptor.h:
* Modules/webgpu/WebGPU.cpp:
(WebCore::WebGPU::requestAdapter const):
* Modules/webgpu/WebGPUAdapter.cpp:
(WebCore::WebGPUAdapter::create):
(WebCore::WebGPUAdapter::createDevice):
* Modules/webgpu/WebGPUAdapter.h:
* Modules/webgpu/WebGPUAdapter.idl:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
(WebCore::WebGPUShaderModule::WebGPUShaderModule):
* Modules/webgpu/WebGPUShaderModule.h:
* Modules/webgpu/WebGPUShaderModule.idl:
* Modules/webgpu/WebGPUShaderModuleDescriptor.h:
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure):
* Modules/webgpu/WebGPUSwapChain.h:
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::GPUDevice):
* Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/Logging.h:
2018-11-01 Jiewen Tan <jiewen_tan@apple.com>
Replace CommonRandom SPI with API
https://bugs.webkit.org/show_bug.cgi?id=191178
<rdar://problem/45722391>
Reviewed by Brent Fulgham.
The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
all SPI usages with API.
No change of behaviors.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoKeyMac.cpp:
(WebCore::CryptoKey::randomData):
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey):
(WebCore::wrapSerializedCryptoKey):
* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues):
2018-11-01 Chris Dumez <cdumez@apple.com>
[WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
https://bugs.webkit.org/show_bug.cgi?id=191162
Reviewed by Alex Christensen.
Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
in modern WebKit. The implementation is actually passed an ExecState nowadays.
* Modules/applepay/ApplePaySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/fetch/FetchBody.idl:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* animation/Animatable.idl:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectReadOnly.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
(GenerateConstructorDefinition):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjWithExecStateAttributeGetter):
(WebCore::jsTestObjWithExecStateAttribute):
(WebCore::setJSTestObjWithExecStateAttributeSetter):
(WebCore::setJSTestObjWithExecStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
(WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptStateAttribute): Deleted.
(WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestPromiseRejectionEvent.idl:
* crypto/SubtleCrypto.idl:
* dom/Element.idl:
* dom/ErrorEvent.idl:
* dom/MessagePort.idl:
* dom/MouseEvent.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLFrameElement.idl:
* html/OffscreenCanvas.idl:
* html/track/DataCue.idl:
* inspector/CommandLineAPIHost.idl:
* page/DOMWindow.idl:
* page/RemoteDOMWindow.idl:
* page/WindowOrWorkerGlobalScope.idl:
* testing/Internals.idl:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.idl:
2018-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
https://bugs.webkit.org/show_bug.cgi?id=189693
Reviewed by Yusuke Suzuki.
No new tests because there's no behaviro changes.
* platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
* xml/XSLTProcessorLibxslt.cpp: Ditto.
* xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
2018-11-01 John Wilander <wilander@apple.com>
In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
https://bugs.webkit.org/show_bug.cgi?id=191119
<rdar://problem/44176965>
Reviewed by Chris Dumez.
New API test added.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2018-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Network: remove unnecessary media event tracking
https://bugs.webkit.org/show_bug.cgi?id=191174
Reviewed by Joseph Pecoraro.
No new tests, as this simply removes some event listeners for the WebInspector frontend.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::addEventListenersToNode):
2018-11-01 Chris Dumez <cdumez@apple.com>
Location object sans browsing context
https://bugs.webkit.org/show_bug.cgi?id=191060
Reviewed by Geoffrey Garen.
As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
it does not have a browsing context (Frame), not "".
No new tests, rebaselined existing tests.
* page/Location.cpp:
(WebCore::Location::url const):
(WebCore::Location::href const):
(WebCore::Location::protocol const):
(WebCore::Location::host const):
(WebCore::Location::hostname const):
(WebCore::Location::port const):
(WebCore::Location::pathname const):
(WebCore::Location::search const):
(WebCore::Location::origin const):
(WebCore::Location::hash const):
2018-11-01 Sihui Liu <sihui_liu@apple.com>
Add a storage limit for IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=190598
<rdar://problem/44654715>
Reviewed by Chris Dumez.
Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin.
IndexedDB will return a QuotaExceededError if limit is reached.
If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is
half the free disk space.
Test: storage/indexeddb/storage-limit.html
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::setPerOriginQuota):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::perOriginQuota const):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::setQuota):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2018-11-01 Justin Michaud <justin_michaud@apple.com>
CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
https://bugs.webkit.org/show_bug.cgi?id=191042
Reviewed by Antti Koivisto.
Refactor code so that:
- All properties applied in StyleResolver::applyMatchedProperties are only applied once.
- Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
every time they were referenced, and again in RenderStyle.
- The font-size property is applied after its variable references, but before custom properties that depend on it.
- Cycles are detected at the same time as resolution.
- MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
This behaviour matches chrome, but is not documented in the spec.
- Custom property values have more explicit resolved/unresolved state.
- RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
Tests: css-custom-properties-api/crash.html
css-custom-properties-api/cycles.html
css-custom-properties-api/inline.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp:
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
* css/CSSRegisteredCustomProperty.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
(WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
(WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
(WebCore::CSSVariableData::resolveVariableReference const): Deleted.
(WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
(WebCore::CSSVariableData::resolveTokenRange const): Deleted.
* css/CSSVariableData.h:
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved): Deleted.
(WebCore::CSSVariableData::needsVariableResolution const): Deleted.
(WebCore::CSSVariableData::CSSVariableData): Deleted.
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableFallback):
(WebCore::resolveVariableReference):
(WebCore::resolveTokenRange):
(WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
* css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::equals const):
(WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setCustomProperty):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::applyPropertyToCurrentStyle):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
(WebCore::StyleResolver::applyCascadedCustomProperty):
(WebCore::StyleResolver::applyCascadedProperties):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::setValueForProperty):
(WebCore::variableDataForPositivePixelLength):
(WebCore::variableDataForPositiveDuration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator== const):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
(): Deleted.
2018-11-01 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155
Reviewed by Simon Fraser.
Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):
2018-11-01 Youenn Fablet <youenn@apple.com>
RTCTrackEvent.streams should be SameObject
https://bugs.webkit.org/show_bug.cgi?id=191130
Reviewed by Eric Carlson.
Mimick SameObject using CachedAttribute.
Covered by rebased test.
* Modules/mediastream/RTCTrackEvent.idl:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for inline-block elements.
https://bugs.webkit.org/show_bug.cgi?id=191143
Reviewed by Antti Koivisto.
This patch add support for laying out non-shrink-to-width inline-block elements.
Test: fast/inline/simple-inline-block.html
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
* layout/layouttree/LayoutInlineContainer.cpp:
(WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
* layout/layouttree/LayoutInlineContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-11-01 Claudio Saavedra <csaavedra@igalia.com>
Fix build with VIDEO and WEB_AUDIO disabled
https://bugs.webkit.org/show_bug.cgi?id=191147
Reviewed by Philippe Normand.
Supported or not, there were a few build fixes needed
to be able to build WebKit with media disabled. Mostly
low-hanging fruits.
* Modules/mediasource/VideoPlaybackQuality.cpp:
* Modules/mediasource/VideoPlaybackQuality.h:
* Modules/mediasource/VideoPlaybackQuality.idl:
* dom/Document.cpp:
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
* inspector/agents/InspectorDOMAgent.h:
* rendering/RenderThemeGtk.cpp:
2018-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: create a setting for auto-recording newly created contexts
https://bugs.webkit.org/show_bug.cgi?id=190856
Reviewed by Brian Burg.
Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
* inspector/agents/InspectorCanvasAgent.h:
(WebCore::InspectorCanvasAgent::RecordingOptions): Added.
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
(WebCore::InspectorCanvasAgent::startRecording): Added.
Unify the different functions that are able to start a recording to use a single path.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::setFrameCount): Added.
(WebCore::InspectorCanvas::overFrameCount const): Added.
2018-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
https://bugs.webkit.org/show_bug.cgi?id=190641
<rdar://problem/45319049>
Reviewed by Joseph Pecoraro.
No new tests, as low power mode is indeterminate. Should not affect functionality.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::addEventListenersToNode):
(WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
2018-10-31 Alicia Boya García <aboya@igalia.com>
[MSE] Use tolerance when growing the coded frame group
https://bugs.webkit.org/show_bug.cgi?id=190085
Reviewed by Jer Noble.
Test: media/media-source/media-source-append-acb-tolerance.html
This patch introduces a millisecond tolerance in the range of
potential frames that should be erased frame from the track buffer
when the coded frame group is growing.
This is necessary because some files have imprecise overlapping
timestamps (especially WebM files).
This fixes a stall when seeking back and forth in YouTube with WebM
video.
A test case simulating the problem with video/mock using timestamps
similar to those of a typical 30 fps WebM video is also added.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-10-31 Jer Noble <jer.noble@apple.com>
MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
https://bugs.webkit.org/show_bug.cgi?id=191129
Reviewed by Eric Carlson.
Test: media/media-source/media-source-istypesupported-case-sensitive.html
According to RFC 2045: "All media type values, subtype values, and parameter names as
defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
specified for the specific parameter." So rather than fold the entire ContentType into lower-
case, leave the original string intact and require clients to enforce case-insensitivity.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::isTypeSupported):
2018-10-31 Jer Noble <jer.noble@apple.com>
Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
access of m_cdmInstance.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2018-10-31 YUHAN WU <yuhan_wu@apple.com>
MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
https://bugs.webkit.org/show_bug.cgi?id=190778
<rdar://problem/45703574>
Reviewed by Youenn Fablet.
Add a include to fix the unified build error.
No tests since no new functionality.
* Modules/webgpu/WebGPUDevice.cpp:
2018-10-26 Jer Noble <jer.noble@apple.com>
[EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
https://bugs.webkit.org/show_bug.cgi?id=190946
Reviewed by Eric Carlson.
Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
CDMInstance).
- Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
requiring MediaKeySession to send a callback first.
- Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
CDMInstanceSessionFairPlayStreamingAVFObjC.
- Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
- Support key renewal through a "renew" message.
- Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
- Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::sendMessage):
* Modules/encryptedmedia/MediaKeySession.h:
* platform/encryptedmedia/CDMInstanceSession.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::keyIDsForRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
(WebCore::requestStatusToCDMStatus):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
(WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
(WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
(WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::destroyParser):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
(WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2018-10-31 Zach Li <zacharyli323@gmail.com>
Add credit card autofill button
https://bugs.webkit.org/show_bug.cgi?id=191051
<rdar://problem/45657011>
Reviewed by Wenson Hsieh.
Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* css/html.css:
(input::-webkit-credit-card-auto-fill-button):
Add credit card autofill button.
(input::-webkit-credit-card-auto-fill-button:hover):
(input::-webkit-credit-card-auto-fill-button:active):
* html/HTMLTextFormControlElement.h:
* html/TextFieldInputType.cpp:
(WebCore::autoFillButtonTypeToAccessibilityLabel):
(WebCore::autoFillButtonTypeToAutoFillButtonText):
(WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
(WebCore::isAutoFillButtonTypeChanged):
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillCreditCardLabel):
* platform/LocalizedStrings.h:
* testing/Internals.cpp:
(WebCore::toAutoFillButtonType):
(WebCore::toInternalsAutoFillButtonType):
* testing/Internals.h:
* testing/Internals.idl:
2018-10-31 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Don't reveal device IDs until the user has granted permission to capture
https://bugs.webkit.org/show_bug.cgi?id=191112
<rdar://problem/45699932>
Reviewed by Youenn Fablet.
No new tests, existing tests updated.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user
has granted permssion to capture.
2018-10-31 YUHAN WU <yuhan_wu@apple.com>
MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
https://bugs.webkit.org/show_bug.cgi?id=190778
Reviewed by Youenn Fablet.
Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
Implement a mock string as the output buffer of MediaRecorder.
Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate.
Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
* CMakeLists.txt:
* Modules/mediarecorder/BlobEvent.cpp: Added.
(WebCore::BlobEvent::create):
(WebCore::BlobEvent::BlobEvent):
(WebCore::BlobEvent::eventInterface const):
* Modules/mediarecorder/BlobEvent.h:
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::stop):
(WebCore::MediaRecorder::startRecording):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::stopRecordingInternal):
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::trackEnded):
(WebCore::MediaRecorder::sampleBufferUpdated):
(WebCore::MediaRecorder::audioSamplesAvailable):
(WebCore::MediaRecorder::scheduleDeferredTask):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
* platform/mediarecorder/MediaRecorderPrivate.h: Added.
* platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
(WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateMock::generateMockString):
(WebCore::MediaRecorderPrivateMock::fetchData):
* platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
2018-10-31 Claudio Saavedra <csaavedra@igalia.com>
[GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
https://bugs.webkit.org/show_bug.cgi?id=191110
Reviewed by Michael Catanzaro.
Covered by existing tests.
Turns out that this method is expected to reject domains that
are not registrable. Also sync with the Mac implementation in
that given domains that are not all ASCII should be returned
back as is. This fixes the remaining Public Suffix API tests.
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::topPrivatelyControlledDomain):
2018-10-31 Antti Koivisto <antti@apple.com>
Remove LayerFlushScheduler
https://bugs.webkit.org/show_bug.cgi?id=191103
Reviewed by Anders Carlsson.
It is only used in WK1.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
* platform/graphics/ca/LayerFlushScheduler.h: Removed.
* platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
2018-10-31 Zalan Bujtas <zalan@apple.com>
Missing from r237634
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::formattingContext):
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] Do not pass LayoutState& to compute* and layout* functions
https://bugs.webkit.org/show_bug.cgi?id=191100
Reviewed by Antti Koivisto.
Reduce noise by removing LayoutState& parameter where possible.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext class should take FormattingState&
https://bugs.webkit.org/show_bug.cgi?id=191099
Reviewed by Antti Koivisto.
This is in preparation for not passing LayoutState& into every layout functions.
FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
LayoutState <- FormattingState <- FormattingContext
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::formattingState const):
(WebCore::Layout::FormattingContext::layoutState const):
* layout/FormattingContext.h:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::layoutState const):
* layout/LayoutFormattingState.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
(WebCore::Layout::BlockFormattingState::formattingContext):
(WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
(WebCore::Layout::InlineFormattingState::formattingContext):
(WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] The *FormattingState class should provide the *FormattingContext.
https://bugs.webkit.org/show_bug.cgi?id=191089
Reviewed by Antti Koivisto.
BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingState.h:
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::formattingContext const): Deleted.
* layout/LayoutFormattingState.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::formattingContext const):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::formattingContext const):
* layout/inlineformatting/InlineFormattingState.h:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] Rename LayoutContext to LayoutState
https://bugs.webkit.org/show_bug.cgi?id=191080
Reviewed by Antti Koivisto.
LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
(LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
Now the current state is as follows:
LayoutState has
1. Layout tree
2. State content for each formatting subtrees
3. Display tree
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::mapBoxToAncestor):
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
(WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
(WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
* layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::initializeRoot):
(WebCore::Layout::LayoutState::updateLayout):
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
(WebCore::Layout::LayoutState::styleChanged):
(WebCore::Layout::LayoutState::markNeedsUpdate):
(WebCore::Layout::LayoutState::formattingStateForBox const):
(WebCore::Layout::LayoutState::establishedFormattingState const):
(WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
(WebCore::Layout::LayoutState::formattingContext const):
* layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
(WebCore::Layout::LayoutState::setInQuirksMode):
(WebCore::Layout::LayoutState::hasDisplayBox const):
(WebCore::Layout::LayoutState::inQuirksMode const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
(WebCore::Layout::verifyAndOutputSubtree):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginTop):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::isStretchedToInitialContainingBlock):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/blockformatting/BlockInvalidation.cpp:
(WebCore::Layout::computeUpdateType):
(WebCore::Layout::computeUpdateTypeForAncestor):
(WebCore::Layout::BlockInvalidation::invalidate):
* layout/blockformatting/BlockInvalidation.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::isMarginBottomCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
* layout/displaytree/DisplayBox.h:
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
* layout/floats/FloatAvoider.h:
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::FloatBox):
* layout/floats/FloatBox.h:
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingContext.h:
(WebCore::Layout::FloatingContext::layoutState const):
(WebCore::Layout::FloatingContext::layoutContext const): Deleted.
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatItem::FloatItem):
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::constraints const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::create):
(WebCore::Layout::FloatingState::layoutState const):
(WebCore::Layout::FloatingState::layoutContext const): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/inlineformatting/InlineInvalidation.cpp:
(WebCore::Layout::InlineInvalidation::invalidate):
* layout/inlineformatting/InlineInvalidation.h:
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::runWidth const):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::showLayoutTree):
* layout/layouttree/LayoutTreeBuilder.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2018-10-30 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Attachment dropped from one web view to another is missing its file wrapper
https://bugs.webkit.org/show_bug.cgi?id=190530
<rdar://problem/45232149>
Reviewed by Tim Horton.
Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
and creating NSFileWrappers upon reading web content.
Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::registerAttachments):
* editing/Editor.h:
Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
about just a single attachment.
* editing/SerializedAttachmentData.h:
Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
data upon paste.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments):
Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::archiveResourceURL):
* html/HTMLAttachmentElement.h:
Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
use in a web archive resource.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::addSubresourcesForAttachmentElementsIfNecessary):
Add a helper function to create and append ArchiveResources representing attachment element data when writing
attachments to the pasteboard via web archive data.
(WebCore::LegacyWebArchive::create):
* page/EditorClient.h:
(WebCore::EditorClient::registerAttachments):
(WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
2018-10-30 David Kilzer <ddkilzer@apple.com>
XSLTProcessor should limit max transform depth
<https://webkit.org/b/191075>
<rdar://problem/45531453>
Reviewed by Alex Christensen.
Test: fast/xsl/xslt-max-depth.html
* xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
* xml/SoftLinkLibxslt.h: Ditto.
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
to 1000. Default in libxslt.dylib is 3000.
2018-10-30 Jim Mason <jmason@ibinx.com>
[GTK] Scrollbars not following gtk-primary-button-warps-slider setting
https://bugs.webkit.org/show_bug.cgi?id=191067
Reviewed by Michael Catanzaro.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete MAX_ALLOWED macros
https://bugs.webkit.org/show_bug.cgi?id=190916
Reviewed by Tim Horton.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2018-10-30 Ali Juma <ajuma@chromium.org>
Calling window.open("", "_self") allows working around restrictions on window.close()
https://bugs.webkit.org/show_bug.cgi?id=191073
Reviewed by Chris Dumez.
Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
Test: fast/dom/Window/window-open-self-disallow-close.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
2018-10-30 Andy Estes <aestes@apple.com>
[Payment Request] Implement PaymentResponse.retry()
https://bugs.webkit.org/show_bug.cgi?id=190985
Reviewed by Daniel Bates.
Implemented the retry() method on PaymentResponse as specified in the Payment Request API
W3C Editor's Draft of 24 October 2018.
See https://w3c.github.io/payment-request/#retry-method for details.
Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
http/tests/paymentrequest/payment-response-retry-method.https.html
* Modules/applepay/PaymentCoordinator.h:
(WebCore::PaymentCoordinator::client): Added. Returns m_client.
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
a PaymentCoordinatorClient to a MockPaymentCoordinator.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
(WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
(WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
(WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
(WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
(WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
final result.
(WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
and called PaymentCoordinator::completePaymentSession.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show): Changed to call settleShowPromise.
(WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
promise, if present, instead of PaymentResponse's show promise.
(WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
std::nullopt.
(WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
handler then sets it to std::nullopt.
(WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
will settle its own promise in its implementation of stop.
(WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
pending retry promise and to call abortWithException instead of stop.
(WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
instead of stop.
(WebCore::PaymentRequest::settleDetailsPromise): Ditto.
(WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
rather than the show promise.
(WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
active payment handler.
(WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
active payment handler, and to call PaymentHandler::retry if there is.
(WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
to |this|, so they cannot be created in constructors without relaxing adoption requirements.
Added this function so that the pending activity can be created after the PaymentResponse is
created and adopted.
(WebCore::PaymentResponse::~PaymentResponse):
(WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
when necessary.
(WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
m_retryPromise.
(WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
|exception|, clears the pending activity, and sets m_state to Completed.
(WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
to std::nullopt.
(WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
there is no pending activity.
(WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
the pending activity, and sets m_state to Stopped.
* Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
* testing/Internals.cpp:
(WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
(WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
downcasting the page's payment coordinator client.
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
hideCount for final results.
* testing/MockPaymentCoordinator.h:
(isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
2018-10-30 Zalan Bujtas <zalan@apple.com>
[iOS] Use the mainframe view size to compute window.outerWidth/height.
https://bugs.webkit.org/show_bug.cgi?id=191070
<rdar://problem/42368377>
Reviewed by Tim Horton.
Use a more reasonable value for window.outerWidth and height.
(WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
* page/DOMWindow.cpp:
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):
2018-10-30 Andy Estes <aestes@apple.com>
[Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
https://bugs.webkit.org/show_bug.cgi?id=191039
Reviewed by Megan Gardner.
During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
whenever the user agent supports one or more of the specified payment methods, even if those
payment methods do not have active instruments.
Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::canMakePayment):
(WebCore::shouldDiscloseApplePayCapability): Deleted.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::canMakePayments):
(WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2018-10-30 Sihui Liu <sihui_liu@apple.com>
Add a deprecation warning to console for Web SQL
https://bugs.webkit.org/show_bug.cgi?id=190936
Reviewed by Ryosuke Niwa.
No new tests. Just adding a console message.
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
2018-10-30 Sihui Liu <sihui_liu@apple.com>
IndexedDB: iteration of cursors skip records if updated or deleted
https://bugs.webkit.org/show_bug.cgi?id=190917
<rdar://problem/35250410>
Reviewed by Chris Dumez.
When object store has changes, we cleared cached records and reset the SQLite statement,
updating the boundary to the next key in cursor's direction. Therefore, the cursor could
jump to the next key after update or deletion.
We should cache those records before changing the statement.
Test: storage/indexeddb/cursor-update-while-iterating.html
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
(WebCore::IDBServer::SQLiteIDBCursor::fetch):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Introduce InlineFormattingContextGeometry class
https://bugs.webkit.org/show_bug.cgi?id=191054
Reviewed by Antti Koivisto.
This is in preparation for inline-block support.
Move float and inline-block elements layout to layoutFormattingContextRoot().
computeWidthAndHeightForInlineBox takes care of replaced elements.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2018-10-28 Antoine Quint <graouts@apple.com>
[Web Animations] Implement the update animations and send events procedure
https://bugs.webkit.org/show_bug.cgi?id=191013
<rdar://problem/45620495>
Reviewed by Dean Jackson.
While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
"relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
Implementing this procedure allowed us to make several enhancements:
1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS.
Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
to dispatch as they could otherwise be destroyed before they can fully dispatch them.
2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which
we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for
them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it.
3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant"
animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's
timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0.
To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS
Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display
refresh monitor udpates when only accelerated animations are running.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
added to the m_animations list unless its timeline is no longer this timeline.
(WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
animation lists if this animation has an effect with a target.
(WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
(WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
code now cause regressions in the Web Platform Tests.
(WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
(WebCore::AnimationTimeline::elementWasRemoved):
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
(WebCore::AnimationTimeline::addAnimation): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
(WebCore::AnimationTimeline:: const): Deleted.
(WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
(WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
(WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::canBeListed const): Deleted.
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
(WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
(WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
(WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
(WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
(WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
* animation/DeclarativeAnimation.h:
* animation/DocumentAnimationScheduler.cpp:
(WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
document's animation timeline. This is called when m_animations becomes empty.
* animation/DocumentAnimationScheduler.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
(WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
(WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
in the next run loop (provided all pending JS execution has also completed).
(WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
(WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
(WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
(WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
(WebCore::DocumentTimeline::animationResolutionTimerFired):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no
longer relevant following the call to tick().
(WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
(WebCore::DocumentTimeline::timingModelDidChange): Deleted.
(WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
(WebCore::DocumentTimeline::performInvalidationTask): Deleted.
(WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
(WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
(WebCore::DocumentTimeline::updateAnimations): Deleted.
(WebCore::compareAnimationPlaybackEvents): Deleted.
(WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model
is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance
variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the
start time and can stop requiring a custom IDL binding for the "startTime" property.
(WebCore::WebAnimation::effectTimingPropertiesDidChange):
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::startTime const):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::resetPendingTasks):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
(WebCore::WebAnimation::invalidateEffect):
(WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::runPendingPauseTask):
(WebCore::WebAnimation::needsTick const):
(WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run
the pending play and pause tasks.
(WebCore::WebAnimation::resolve):
(WebCore::WebAnimation::updateRelevance):
(WebCore::WebAnimation::computeRelevance):
(WebCore::WebAnimation::timingModelDidChange): Deleted.
(WebCore::WebAnimation::setHoldTime): Deleted.
(WebCore::WebAnimation::bindingsStartTime const): Deleted.
(WebCore::WebAnimation::setBindingsStartTime): Deleted.
(WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
(WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
(WebCore::WebAnimation::updatePendingTasks): Deleted.
(WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
(WebCore::WebAnimation::runPendingTasks): Deleted.
(WebCore::WebAnimation::canBeListed const): Deleted.
* animation/WebAnimation.h:
(WebCore::WebAnimation::isRelevant const):
(WebCore::WebAnimation::hasPendingPlayTask const):
(WebCore::WebAnimation::isEffectInvalidationSuspended):
* animation/WebAnimation.idl:
* dom/Element.cpp:
(WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
2018-10-30 Youenn Fablet <youenn@apple.com>
LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
https://bugs.webkit.org/show_bug.cgi?id=191026
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
2018-10-30 Claudio Saavedra <csaavedra@igalia.com>
[GTK][WPE] Fixes to the PublicSuffix implementation
https://bugs.webkit.org/show_bug.cgi?id=191031
Reviewed by Michael Catanzaro.
Covered by existing tests.
Downcase hostnames before passing it on to the underlying
libsoup API. Special case localhost and fix a mixed-up
libsoup GError checks. This fixes most of the failures.
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomain):
2018-10-29 Zalan Bujtas <zalan@apple.com>
Missing from r237549
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginTop):
2018-10-29 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed speculative build fix for AppleWin after r237559.
* PlatformAppleWin.cmake:
2018-10-29 Justin Michaud <justin_michaud@apple.com>
Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
https://bugs.webkit.org/show_bug.cgi?id=190919
Reviewed by Michael Saboff.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
(WebCore::CSSCustomPropertyValue::equals const): Deleted.
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp:
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
* css/CSSRegisteredCustomProperty.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::consumeAndUpdateTokens):
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::checkVariablesForCycles const):
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
(WebCore::CSSVariableData::resolveVariableFallback const):
(WebCore::CSSVariableData::resolveVariableReference const):
(WebCore::CSSVariableData::resolveVariableReferences const):
(WebCore::CSSVariableData::resolveTokenRange const):
* css/CSSVariableData.h:
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved):
(WebCore::CSSVariableData::needsVariableResolution const):
(WebCore::CSSVariableData::CSSVariableData):
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
(WebCore::resolveVariableFallback): Deleted.
(WebCore::resolveVariableReference): Deleted.
(WebCore::resolveTokenRange): Deleted.
(WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
* css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::variableDataValue const):
(WebCore::CSSVariableReferenceValue::equals const):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setCustomProperty):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::applyPropertyToCurrentStyle):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
(WebCore::StyleResolver::applyCascadedProperties):
(WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
* css/parser/CSSPropertyParser.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::setValueForProperty):
(WebCore::variableDataForPositivePixelLength):
(WebCore::variableDataForPositiveDuration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator== const):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2018-10-29 Youenn Fablet <youenn@apple.com>
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681
Reviewed by Eric Carlson.
Remove the previous MDNS resolution mechanism.
Instead, add support for the AsyncResolver mechanism added to libwebrtc.
Covered by current mdns webrtc test that is unflaked.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:
2018-10-29 Devin Rousso <drousso@apple.com>
Web Inspector: increase size limits for NetworkResourceData
https://bugs.webkit.org/show_bug.cgi?id=191034
<rdar://problem/45529852>
Reviewed by Joseph Pecoraro.
No tests since no new functionality.
* inspector/NetworkResourcesData.cpp:
All resources: 100MB => 200MB
Each resource: 10MB => 50MB
2018-10-29 Tim Horton <timothy_horton@apple.com>
Modernize WebKit nibs and lprojs for localization's sake
https://bugs.webkit.org/show_bug.cgi?id=190911
<rdar://problem/45349466>
Reviewed by Dan Bernstein.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
* en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
* en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
* en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
English->en
2018-10-29 Tim Horton <timothy_horton@apple.com>
Make FindOptionsShowOverlay work on iOS
https://bugs.webkit.org/show_bug.cgi?id=190551
Reviewed by Andy Estes.
* platform/graphics/GraphicsContext.h:
Export some more GraphicsContext methods.
2018-10-29 Youenn Fablet <youenn@apple.com>
Invalid ssrc value in the stats of type 'inbound-rtp'
https://bugs.webkit.org/show_bug.cgi?id=190826
<rdar://problem/45487435>
Reviewed by Eric Carlson.
Value was not initialized in WebCore if missing from libwebrtc.
Change value to an optional so that it will not appear if libwebrtc does not expose it.
Move integer/boolean values from being initialized to be optional so
that we do not expose them to JS if not exposed by libwebrtc.
Covered by updated tests.
* Modules/mediastream/RTCStatsReport.h:
2018-10-29 Jer Noble <jer.noble@apple.com>
CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
https://bugs.webkit.org/show_bug.cgi?id=190954
Reviewed by Simon Fraser.
Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
which attempts to fetch the last byte in the image buffer in order to verify that the entire
buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
CGDataProvider created by WebKit is responsible (if any), we will add our own version of
ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
generate a crash within the responsible stack frame.
(This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
that the buffer itself is reclaimed between creation time and access.)
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::toCFData const):
(WebCore::cfData):
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
* platform/graphics/cg/ImageUtilitiesCG.h: Added.
(WebCore::verifyImageBufferIsBigEnough):
2018-10-29 David Kilzer <ddkilzer@apple.com>
Fix clang static analyzer warning in StyleBuilderConverter.h
<https://webkit.org/b/190907>
Reviewed by Antti Koivisto.
Fix the following clang static warning in StyleBuilderConverter.h:
Value stored to 'autoFlow' during its initialization is never read
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
assignment of RenderStyle::initialGridAutoFlow() to `default`
case. Make `CSSValueDense` consistent with other cases by
assigning value to `autoFlow` instead of returning early.
2018-10-29 Youenn Fablet <youenn@apple.com>
Guard H264 simulcast with a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=191025
Reviewed by Eric Carlson.
Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
Covered by existing test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
https://bugs.webkit.org/show_bug.cgi?id=191018
Reviewed by Antti Koivisto.
<div><img style="float: left"></div>
This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
need to precompute the ancestor's margin top (stop at the block formatting root boundary).
Test: fast/inline/simple-intruding-floats3.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
https://bugs.webkit.org/show_bug.cgi?id=191011
Reviewed by Antti Koivisto.
// 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
// Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
This is temporary until after inline runs transition to the display tree.
Test: fast/inline/simple-intruding-floats2.html
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::logicalLeft const):
(WebCore::Layout::InlineRun::logicalRight const):
(WebCore::Layout::InlineRun::logicalTop const):
(WebCore::Layout::InlineRun::logicalBottom const):
(WebCore::Layout::InlineRun::width const):
(WebCore::Layout::InlineRun::height const):
(WebCore::Layout::InlineRun::setWidth):
(WebCore::Layout::InlineRun::setLogicalLeft):
(WebCore::Layout::InlineRun::setLogicalRight):
(WebCore::Layout::InlineRun::moveHorizontally):
(WebCore::Layout::InlineRun::InlineRun):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for simple intruding floats.
https://bugs.webkit.org/show_bug.cgi?id=190998
Reviewed by Antti Koivisto.
In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position.
This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
it is the parent block formatting root's coordinate system (that's where the float lives.)
Test: fast/inline/simple-intruding-float1.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Inline layout produces separate runs when float is present.
https://bugs.webkit.org/show_bug.cgi?id=190980
Reviewed by Antti Koivisto.
<div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
while it is really just one continuous run (foobar) -> LFC
Adjust verification code to check for such runs.
* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingNonTextRuns):
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::textContext const):
2018-10-29 Youenn Fablet <youenn@apple.com>
[WebRTC] Enable VP8 by default
https://bugs.webkit.org/show_bug.cgi?id=190672
<rdar://problem/43663785>
Reviewed by Eric Carlson.
No change of behavior.
* page/RuntimeEnabledFeatures.h: Set default value to true.
2018-10-28 Andy Estes <aestes@apple.com>
[Payment Request] Implement MerchantValidationEvent.methodName
https://bugs.webkit.org/show_bug.cgi?id=190058
Reviewed by Darin Adler.
Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
methodName property as specified in the Payment Request API W3C Editor's Draft of
27 September 2018.
Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
(as a string) to MerchantValidationEvent::create()
* Modules/paymentrequest/MerchantValidationEvent.cpp:
(WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
event, throwing a RangeError on failure.
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
* Modules/paymentrequest/MerchantValidationEvent.h:
* Modules/paymentrequest/MerchantValidationEvent.idl:
2018-10-27 Antoine Quint <graouts@apple.com>
[Web Animations] Remove WebAnimation::description()
https://bugs.webkit.org/show_bug.cgi?id=190995
Reviewed by Dean Jackson.
This method is never used.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::description): Deleted.
* animation/WebAnimation.h:
2018-10-27 Antoine Quint <graouts@apple.com>
[Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
https://bugs.webkit.org/show_bug.cgi?id=190994
Reviewed by Dean Jackson.
It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::getAnimations):
2018-10-27 Antoine Quint <graouts@apple.com>
[Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
https://bugs.webkit.org/show_bug.cgi?id=190996
Reviewed by Dean Jackson.
Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):
(WebCore::CSSAnimation::bindingsStartTime const): Deleted.
(WebCore::CSSAnimation::setBindingsStartTime): Deleted.
(WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
(WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
(WebCore::CSSAnimation::bindingsPlayState const): Deleted.
(WebCore::CSSAnimation::bindingsPending const): Deleted.
(WebCore::CSSAnimation::bindingsReady): Deleted.
(WebCore::CSSAnimation::bindingsFinished): Deleted.
(WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
* animation/CSSAnimation.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::bindingsStartTime const):
(WebCore::DeclarativeAnimation::setBindingsStartTime):
(WebCore::DeclarativeAnimation::bindingsCurrentTime const):
(WebCore::DeclarativeAnimation::setBindingsCurrentTime):
(WebCore::DeclarativeAnimation::bindingsPlayState const):
(WebCore::DeclarativeAnimation::bindingsPending const):
(WebCore::DeclarativeAnimation::bindingsReady):
(WebCore::DeclarativeAnimation::bindingsFinished):
(WebCore::DeclarativeAnimation::bindingsPlay):
(WebCore::DeclarativeAnimation::bindingsPause):
(WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
* animation/DeclarativeAnimation.h:
2018-10-27 Charlie Turner <cturner@igalia.com>
[EME] Add a logging macro
https://bugs.webkit.org/show_bug.cgi?id=190984
Reviewed by Xabier Rodriguez-Calvar.
No tests since no new functionality.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::sessionClosed):
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
* platform/Logging.h:
2018-10-27 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] Post key received to bus should be done before waking up other threads
https://bugs.webkit.org/show_bug.cgi?id=190822
Reviewed by Philippe Normand.
Notify after posting message to bus.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
2018-10-27 Charlie Turner <cturner@igalia.com>
Fix release build with -DLOG_DISABLED=0
https://bugs.webkit.org/show_bug.cgi?id=190866
Reviewed by Xabier Rodriguez-Calvar.
No new tests since no functionality changed.
* platform/graphics/Font.cpp:
* platform/graphics/Font.h:
* platform/graphics/FontPlatformData.h:
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
* platform/graphics/win/FontPlatformDataWin.cpp:
2018-10-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237458.
https://bugs.webkit.org/show_bug.cgi?id=190973
broke internal iOS builds (Requested by zalan on #webkit).
Reverted changeset:
"Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
https://bugs.webkit.org/show_bug.cgi?id=190951
https://trac.webkit.org/changeset/237458
2018-10-26 Antoine Quint <graouts@apple.com>
[Web Animations] Remove useless internals methods
https://bugs.webkit.org/show_bug.cgi?id=190968
Reviewed by Dean Jackson.
We had a few internals methods added early on in the Web Animations implementation that are no longer
relevant now that the full API is implemented. We can safely remove them now.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::setCurrentTime): Deleted.
(WebCore::AnimationTimeline::description): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime):
(WebCore::AnimationTimeline::pause): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::pause): Deleted.
* animation/DocumentTimeline.h:
* testing/Internals.cpp:
(WebCore::Internals::timelineDescription): Deleted.
(WebCore::Internals::pauseTimeline): Deleted.
(WebCore::Internals::setTimelineCurrentTime): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-10-26 Antoine Quint <graouts@apple.com>
Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
https://bugs.webkit.org/show_bug.cgi?id=190955
Reviewed by Dean Jackson.
We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
and the CSSAnimationController.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-10-26 Timothy Hatcher <timothy@apple.com>
Use dark appearance scrollbar when page background is dark or document supports dark mode.
https://bugs.webkit.org/show_bug.cgi?id=190937
rdar://problem/41225839
Reviewed by Beth Dakin.
* page/FrameView.cpp:
(WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
(WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
on the scrollbar overlay style too.
* page/FrameView.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
Ask the ScrollableArea if a dark appearance is desired.
2018-10-26 Antti Koivisto <antti@apple.com>
Use random() instead of begin() to limit cache sizes
https://bugs.webkit.org/show_bug.cgi?id=190957
Reviewed by Chris Dumez.
We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
keys get permanently stuck in the table.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createColorValue):
(WebCore::CSSValuePool::createFontFamilyValue):
(WebCore::CSSValuePool::createFontFaceValue):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/SelectorQuery.cpp:
* platform/graphics/FontCascade.cpp:
(WebCore::retrieveOrAddCachedFonts):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::shouldAutoActivateFontIfNeeded):
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain):
2018-10-26 Jer Noble <jer.noble@apple.com>
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>
Reviewed by Alex Christensen.
Request the correct route policy and context from the VideoFullscreenModel.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
(VideoFullscreenInterfaceAVKit::doSetup):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add more inline information to outputLayoutTree
https://bugs.webkit.org/show_bug.cgi?id=190945
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutBox):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Layout floats as part of the inline content
https://bugs.webkit.org/show_bug.cgi?id=190942
Reviewed by Antti Koivisto.
Add float handling to InlineFormattingContext::layoutInlineContent.
Note that floats don't actually generate inline runs.
Test: fast/block/basic/inline-content-with-floating-image.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::isTrimmableContent):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::trimLeadingRun): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::isClosed const):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Adjust current line with float constraints.
https://bugs.webkit.org/show_bug.cgi?id=190940
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::moveHorizontally):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Compute float box size and position
https://bugs.webkit.org/show_bug.cgi?id=190938
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add line logical top and bottom
https://bugs.webkit.org/show_bug.cgi?id=190934
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
(WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
(WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Find floating constraints for a given vertical position
https://bugs.webkit.org/show_bug.cgi?id=190928
Reviewed by Antti Koivisto.
https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
"In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block.
However, floating boxes may come between the containing block edge and the line box edge.
Thus, although line boxes in the same inline formatting context generally have the same width
(that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
This patch adds support for retrieving left/right constraints for a given line (vertical position).
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
* layout/floats/FloatingState.h:
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC] Inline formatting context has higher priority than block
https://bugs.webkit.org/show_bug.cgi?id=190924
Reviewed by Antti Koivisto.
When an element establishes both inline and block formatting contexts, we need to pick one to
create (and we choose the content driven formatting type (inline)). See example below:
<div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::formattingContext const):
2018-10-26 Ali Juma <ajuma@chromium.org>
REGRESSION (r237255): Text selection is broken in form fields
https://bugs.webkit.org/show_bug.cgi?id=190899
Reviewed by Ryosuke Niwa.
Fix missing negation when checking for a fully-clipped-out rect. This was causing
RenderObject::computeVisibleRectInContainer to incorrectly early-out.
Test: fast/repaint/text-selection-overflow-hidden.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeVisibleRectInContainer const):
2018-10-25 Chris Dumez <cdumez@apple.com>
[PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
https://bugs.webkit.org/show_bug.cgi?id=190915
<rdar://problem/45059069>
Reviewed by Geoffrey Garen.
* history/PageCache.cpp:
(WebCore::canCacheFrame):
Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
process has a HistoryItem and is initially showing the initial empty document before continuing
the load from the previous process. Note that saving the initial empty document in PageCache would
lead to crashes later on previous the initial empty document's Window is taken and reused for the
next load.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
lockBackForwardList that is actually Yes when we're doing a client-side redirect.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and
use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would
not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No.
2018-10-25 Devin Rousso <drousso@apple.com>
Fix build after r237431 for platforms that don't support FULLSCREEN_API
Reviewed by Joseph Pecoraro.
No new tests. No change in behavior.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::addEventListenersToNode):
2018-10-25 Devin Rousso <drousso@apple.com>
Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
https://bugs.webkit.org/show_bug.cgi?id=189874
<rdar://problem/44700000>
Reviewed by Joseph Pecoraro.
Updated existing test: http/tests/inspector/dom/didFireEvent.html
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::EventFiredCallback::handleEvent):
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::addEventListenersToNode):
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added.
Prevent the same event from being sent to the frontend more than once.
* dom/Event.cpp:
(WebCore::Event::resetAfterDispatch):
* dom/Document.cpp:
(WebCore::Document::Document):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added.
2018-10-25 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence a -Wreturn-type warning
When every return is supposed to be covered by a switch statement, a release assert or CRASH
is required by GCC.
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
(WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
2018-10-25 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations CSS Integration off by default
https://bugs.webkit.org/show_bug.cgi?id=190901
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2018-10-25 Jon Davis <jond@apple.com>
Changed "Under Development" status to use "In Development" instead
https://bugs.webkit.org/show_bug.cgi?id=187615
Reviewed by Joseph Pecoraro.
* features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1.
2018-10-25 Chris Dumez <cdumez@apple.com>
REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image
https://bugs.webkit.org/show_bug.cgi?id=190891
<rdar://problem/45296796>
Reviewed by Antti Koivisto.
When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state
of the radio element has changed.
Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html
* html/RadioInputType.cpp:
(WebCore::RadioInputType::didDispatchClick):
2018-10-25 Joseph Pecoraro <pecoraro@apple.com>
InspectorCanvas is not getting cleared properly for OffscreenCanvas
https://bugs.webkit.org/show_bug.cgi?id=190894
<rdar://problem/45498435>
Reviewed by Simon Fraser.
Covered by existing tests not crashing with guard malloc.
InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to
remove its reference when the containing CanvasBase goes away. It does
this by registering as a notification observer, but if it can't map
from the CanvasBase back to the rendering context we were failing to
remove our reference. Enforce CanvasBase classes to notify observers
of destruction while they still have their CanvasRenderingContext.
* html/CanvasBase.cpp:
(WebCore::CanvasBase::~CanvasBase):
(WebCore::CanvasBase::notifyObserversCanvasDestroyed):
* html/CanvasBase.h:
Assert that subclasses notify observers of the canvas being destroyed,
since they will need to do this before m_context is cleared.
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::~CustomPaintCanvas):
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::~OffscreenCanvas):
Follow the new expected pattern of notifying observers before clearing
the context. HTMLCanvasElement already followed this pattern.
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::canvasDestroyed):
Add an assertion that would catch this earlier.
2018-10-24 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete macOS version guards
https://bugs.webkit.org/show_bug.cgi?id=190887
Reviewed by Dan Bernstein.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
2018-10-24 Tim Horton <timothy_horton@apple.com>
Attachment filenames with RTL characters should format similar to Finder
https://bugs.webkit.org/show_bug.cgi?id=190736
<rdar://problem/44735946>
Reviewed by Dan Bernstein.
Test: fast/attachment/attachment-title-with-rtl.html
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
* html/HTMLAttachmentElement.h:
Add attachmentTitleForDisplay(), which wraps the non-extension part of
attachmentTitle in BiDi isolates, matching Finder's behavior.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderAttachmentInfo::buildWrappedLines):
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
* rendering/RenderThemeMac.mm:
(WebCore::AttachmentLayout::layOutTitle):
Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of
the original string for the last line, instead of splitting the string
ourselves. This ensures that BiDi control characters are respected
even in the last line of the string.
2018-10-24 Megan Gardner <megan_gardner@apple.com>
Turn on Conic Gradients
https://bugs.webkit.org/show_bug.cgi?id=190810
Reviewed by Tim Horton.
Added tests previously, only switching feature from experimental to always avaiable.
* Configurations/FeatureDefines.xcconfig:
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):
* page/Settings.yaml:
2018-10-11 Jiewen Tan <jiewen_tan@apple.com>
Only report resource timing to parent frame for the first iframe load
https://bugs.webkit.org/show_bug.cgi?id=190498
<rdar://problem/44347398>
Reviewed by Youenn Fablet.
Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/FrameLoader.h:
(WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
(WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
2018-10-24 Brent Fulgham <bfulgham@apple.com>
Cure Windows Direct2D Backend of a nasty case of bitrot
https://bugs.webkit.org/show_bug.cgi?id=190875
<rdar://problem/45523268>
Reviewed by Zalan Bujtas.
The Direct2D backend has drifted out of date with the rest of WebKit.
This patch updates things so we can get a runnable build.
* platform/graphics/FontPlatformData.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageDecoder.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setTargetContext):
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual
Studio happy.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):
* platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation.
(WebCore::GraphicsContextPlatformPrivate::setAlpha):
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
(WebCore::GraphicsContext::setMiterLimit):
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::setLineCap):
(WebCore::GraphicsContext::setLineDash):
(WebCore::GraphicsContext::setLineJoin):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::concatCTM):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::setURLForRect):
(WebCore::GraphicsContext::setIsCALayerContext):
(WebCore::GraphicsContext::isCALayerContext const):
(WebCore::GraphicsContext::setIsAcceleratedContext):
(WebCore::GraphicsContext::isAcceleratedContext const):
(WebCore::GraphicsContext::setPlatformShouldAntialias):
(WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
(WebCore::GraphicsContext::setPlatformCompositeOperation):
(WebCore::GraphicsContext::platformFillEllipse):
(WebCore::GraphicsContext::platformStrokeEllipse):
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(): Deleted.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const):
(WebCore::ImageDecoderDirect2D::encodedDataStatus const):
(WebCore::ImageDecoderDirect2D::repetitionCount const):
(WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
(WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
(WebCore::ImageDecoderDirect2D::setData):
(WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted.
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted.
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/graphics/win/ImageDirect2D.cpp:
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern const):
2018-10-24 Said Abou-Hallawa <sabouhallawa@apple.com>
Cleanup: MIMETypeRegistry functions
https://bugs.webkit.org/show_bug.cgi?id=190838
Reviewed by Simon Fraser.
Modernize the initialization of the lists in MIMETypeRegistry. Make the
functions that return these list be self-contained. Use NeverDestroy<> to
allocate the local static variable. Use std::initializer_list() and
makeNeverDestroyed() to initialize NeverDestroy<> variables only once.
supportedImageResourceMIMETypes will be deleted and all the calls to it
will be replaced by supportedImageMIMETypes because they are identical.
* loader/archive/ArchiveFactory.cpp:
(WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function
is called while initializing the supportedNonImageMIMETypes(). So it
should not have a direct call to it. Instead, supportedNonImageMIMETypes
is passed to it.
* loader/archive/ArchiveFactory.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):
(WebCore::supportedImageMIMETypesForEncoding):
(WebCore::supportedJavaScriptMIMETypes):
(WebCore::MIMETypeRegistry::supportedNonImageMIMETypes):
(WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
(WebCore::pdfMIMETypes):
(WebCore::MIMETypeRegistry::unsupportedTextMIMETypes):
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
(WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
(WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
(WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
(WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
(WebCore::MIMETypeRegistry::isPDFMIMEType):
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
(WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
(WebCore::initializeSupportedImageMIMETypes): Deleted.
(WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted.
(WebCore::initializeSupportedJavaScriptMIMETypes): Deleted.
(WebCore::initializePDFMIMETypes): Deleted.
(WebCore::initializeSupportedNonImageMimeTypes): Deleted.
(WebCore::initializeSupportedMediaMIMETypes): Deleted.
(WebCore::initializeUnsupportedTextMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted.
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted.
* platform/MIMETypeRegistry.h:
* platform/graphics/Image.cpp:
(WebCore::Image::supportsType):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::encodedDataStatus const):
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::supportedDefaultImageSourceTypes):
(WebCore::isSupportImageSourceType):
(WebCore::allowedImageUTIs): Deleted.
(WebCore::isAllowedImageUTI): Deleted.
* platform/graphics/cg/UTIRegistry.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):
2018-10-24 Chris Dumez <cdumez@apple.com>
[PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list
https://bugs.webkit.org/show_bug.cgi?id=190846
<rdar://problem/45058938>
Reviewed by Antti Koivisto.
When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation
policy handler, by overriding the request URL. This normally works fine because we usually process-swap
on standard navigation. However, when we would process-swap on a back/forward navigation, we would end
up using the back/forward navigation load type to do the about:blank load. This would have repercussions
because history navigations update the current history item with the new URL (in this case 'about:blank').
To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load
'about:blank' as a result.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2018-10-24 Andy Estes <aestes@apple.com>
[macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=190650
<rdar://problem/45341914>
Reviewed by Alex Christensen.
In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
weren't clearing exceptions generated from calling convert(), so they would end up being
logged as unhandled promise rejections.
Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
decoding paymentMethodErrors.
Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
rejections from calling PaymentRequest.abort().
Covered by existing test.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeErrors const):
2018-10-22 Antti Koivisto <antti@apple.com>
topPrivatelyControlledDomain is slow
https://bugs.webkit.org/show_bug.cgi?id=190792
Reviewed by Alex Christensen and Chris Dumez.
It calls into some slowish CFNetwork code and ends up showing up in profiles.
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain):
Add a cache that avoids calls into frameworks.
2018-10-22 Jer Noble <jer.noble@apple.com>
Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=190790
Reviewed by Alex Christensen.
Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make
GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making
incrementing the pending task count atomic.
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::sharedLock):
(WebCore::TaskDispatcher<Timer>::sharedTimerFired):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
(WebCore::TaskDispatcher<Timer>::pendingDispatchers):
* platform/GenericTaskQueue.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(-[WebCoreAVFMovieObserver initWithPlayer:]):
(-[WebCoreAVFMovieObserver disconnect]):
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFLoaderDelegate initWithPlayer:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
(-[WebCoreAVFPullDelegate initWithPlayer:]):
(-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
(-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
(-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2018-10-23 Jer Noble <jer.noble@apple.com>
TextTrack cues should be updated more often than every 250ms.
https://bugs.webkit.org/show_bug.cgi?id=190827
Reviewed by Eric Carlson.
Test: media/track/track-cue-timing.html
TextTracks cues are recalculated on the playback timer, which fires at least every 250ms.
In addition to this timer, add a method to MediaPlayer to provide a task which will be
performed at a particular media time, and use this new method to request cues be updated
at the next interesting media time. The next interesting time would be either when the
soonest current cue will end, or when the next non-current cue will start, whichever is
earlier.
(Determining the "next non-current cue" requires new API on PODIntervalTree, as that class
does not have iterators per-se.)
* html/HTMLMediaElement.cpp:
(WebCore::compareCueIntervalEndTime):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
* platform/PODIntervalTree.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::performTaskAtMediaTime):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2018-10-23 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=190748
Reviewed by Myles C. Maxfield.
FontCache::lastResortFallbackFont had local static AtomicString
variables which are not capsuled by NeverDestroyed. Hence, those
variables are destructed on IPC thread when WebProcess exits.
Changed those AtomicString to NeverDestroyed<AtomicString> not to
be destructed on exit.
This change can't be tested automatically because WebKitTestRunner
doesn't support Windows port yet.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont): Changed
fallbackFonts's type from AtomicString array to
NeverDestroyed<AtomicString> array.
2018-10-23 Justin Fan <justin_fan@apple.com>
[WebGPU] Rename old GPU* implementation files to GPULegacy* for WebMetal
https://bugs.webkit.org/show_bug.cgi?id=190817
Reviewed by Dean Jackson.
No new tests. No change in behavior.
* [Large list of refactored classes and renamed files]: GPU* is now GPULegacy*
2018-10-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237261.
The layout test for this change crashes under GuardMalloc.
Reverted changeset:
"Handle MDNS resolution of candidates through libwebrtc
directly"
https://bugs.webkit.org/show_bug.cgi?id=190681
https://trac.webkit.org/changeset/237261
2018-10-23 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237357.
API test is now failing on all platforms.
Reverted changeset:
"topPrivatelyControlledDomain is slow"
https://bugs.webkit.org/show_bug.cgi?id=190792
https://trac.webkit.org/changeset/237357
2018-10-23 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237350.
Caused several Crashes cross multiple tests and platforms.
Reverted changeset:
"Use WeakPtr and GenericTaskQueue within ObjC classes used by
MediaPlayerPrivateAVFoundationObjC"
https://bugs.webkit.org/show_bug.cgi?id=190790
https://trac.webkit.org/changeset/237350
2018-10-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237280.
Causes fast/box-shadow/box-shadow-with-zero-radius.html to
fail on iOS Simulator.
Reverted changeset:
"[CG] Adopt CG SPI for non-even cornered rounded rects"
https://bugs.webkit.org/show_bug.cgi?id=190155
https://trac.webkit.org/changeset/237280
2018-10-23 Antti Koivisto <antti@apple.com>
topPrivatelyControlledDomain is slow
https://bugs.webkit.org/show_bug.cgi?id=190792
Reviewed by Alex Christensen.
It calls into some slowish CFNetwork code and ends up showing up in profiles.
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain):
Add a cache that avoids calls into frameworks.
2018-10-23 Chris Dumez <cdumez@apple.com>
[PSON] Add support for cross-site client-side redirects
https://bugs.webkit.org/show_bug.cgi?id=190806
<rdar://problem/45047344>
Reviewed by Geoffrey Garen.
Add support for cross-site client-side redirects so that it swaps process and so that the back
forward list looks as expected. To support this, the following changes had to be done:
- The NavigationAction now provides additional information so that the WebProcess can communicate
things about the client-side redirect to the UIProcess: lockHistory / lockBackForwardList and
clientRedirectSourceForHistory.
- If the UIProcess decides to process-swap on a client-side redirect, we pass the client-side
redirect information to the new WebContent process via LoadRequest struct. WebCore then takes
care of setting things up using this information so that it recognizes that it is continuing
a load that is a client side redirect.
- We also need to pass the current BackForwardListItem / HistoryItem to the new WebContent
process so that the new process can truly lock history and keep updating the *current*
HistoryItem, instead of creating a new HistoryItem.
- After a process swap, when we re-construct the WebFrameProxy for the main frame in the new
process, we now set the frame's URL in the UIProcess to the URL it had before we swapped.
Clients such as Safari, rely on the main frame's URL being the expected value (the last
committed load URL) until the next load is committed when receiving didPerformRedirect
calls. Because we are destroying the main frame on process-swapping, we were losing the
last committed URL and Safari would hit assertions.
With this model, the willPerformClientRedirect IPC is still sent from the previous WebProcess
and the didPerformClientRedirect IPC is now sent by the new WebProcess. No change should be
observable from the client's point of view.
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setLockHistory):
(WebCore::FrameLoadRequest::setlockBackForwardList):
(WebCore::FrameLoadRequest::clientRedirectSourceForHistory const):
(WebCore::FrameLoadRequest::setClientRedirectSourceForHistory):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
* loader/HistoryController.h:
* loader/NavigationAction.h:
(WebCore::NavigationAction::lockHistory const):
(WebCore::NavigationAction::setLockHistory):
(WebCore::NavigationAction::lockBackForwardList const):
(WebCore::NavigationAction::setLockBackForwardList):
2018-10-23 Jer Noble <jer.noble@apple.com>
Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=190790
Reviewed by Alex Christensen.
Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make
GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making
incrementing the pending task count atomic.
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::sharedLock):
(WebCore::TaskDispatcher<Timer>::sharedTimerFired):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
(WebCore::TaskDispatcher<Timer>::pendingDispatchers):
* platform/GenericTaskQueue.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(-[WebCoreAVFMovieObserver initWithPlayer:]):
(-[WebCoreAVFMovieObserver disconnect]):
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFLoaderDelegate initWithPlayer:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
(-[WebCoreAVFPullDelegate initWithPlayer:]):
(-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
(-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
(-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2018-10-22 Justin Michaud <justin_michaud@apple.com>
Registered custom properties should support syntax parameter for <length> and *
https://bugs.webkit.org/show_bug.cgi?id=190039
Reviewed by Antti Koivisto.
Refactor code so that:
- All properties applied in StyleResolver::applyMatchedProperties are only applied once.
- Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
every time they were referenced, and again in RenderStyle.
- The font-size property is applied after its variable references, but before custom properties that depend on it.
- Cycles are detected at the same time as resolution.
- MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
This behaviour matches chrome, but is not documented in the spec.
- Custom property values have more explicit resolved/unresolved state.
- RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
Tests: css-custom-properties-api/crash.html
css-custom-properties-api/cycles.html
css-custom-properties-api/inline.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp:
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
* css/CSSRegisteredCustomProperty.h:
* css/CSSStyleSheet.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
(WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
(WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
(WebCore::CSSVariableData::resolveVariableReference const): Deleted.
(WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
(WebCore::CSSVariableData::resolveTokenRange const): Deleted.
* css/CSSVariableData.h:
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved): Deleted.
(WebCore::CSSVariableData::needsVariableResolution const): Deleted.
(WebCore::CSSVariableData::CSSVariableData): Deleted.
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableFallback):
(WebCore::resolveVariableReference):
(WebCore::resolveTokenRange):
(WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
* css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::equals const):
(WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setCustomProperty):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::applyPropertyToCurrentStyle):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
(WebCore::StyleResolver::applyCascadedCustomProperty):
(WebCore::StyleResolver::applyCascadedProperties):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::setValueForProperty):
(WebCore::variableDataForPositivePixelLength):
(WebCore::variableDataForPositiveDuration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator== const):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
(): Deleted.
2018-10-22 Justin Michaud <justin_michaud@apple.com>
CSS Paint API should give a 2d rendering context
https://bugs.webkit.org/show_bug.cgi?id=190762
Reviewed by Dean Jackson.
Add a new type of canvas and 2d rendering context to support the CSS Painting API.
Make many of the methods from HTMLCanvasElement virtual functions on CanvasBase, and
remove many of the downcasts in CanvasRenderingContext2DBase as a result.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPaintRenderingContext2DCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::root):
(WebCore::JSPaintRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSPaintRenderingContext2D::visitAdditionalChildren):
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::~CanvasBase):
* html/CanvasBase.h:
(WebCore::CanvasBase::isCustomPaintCanvas const):
* html/CustomPaintCanvas.cpp: Added.
(WebCore::CustomPaintCanvas::create):
(WebCore::CustomPaintCanvas::CustomPaintCanvas):
(WebCore::CustomPaintCanvas::~CustomPaintCanvas):
(WebCore::CustomPaintCanvas::width const):
(WebCore::CustomPaintCanvas::setWidth):
(WebCore::CustomPaintCanvas::height const):
(WebCore::CustomPaintCanvas::setHeight):
(WebCore::CustomPaintCanvas::size const):
(WebCore::CustomPaintCanvas::setSize):
(WebCore::CustomPaintCanvas::getContext):
(WebCore::CustomPaintCanvas::copiedImage const):
(WebCore::CustomPaintCanvas::drawingContext const):
(WebCore::CustomPaintCanvas::existingDrawingContext const):
(WebCore::CustomPaintCanvas::makeRenderingResultsAvailable):
* html/CustomPaintCanvas.h: Copied from Source/WebCore/html/OffscreenCanvas.h.
* html/HTMLCanvasElement.h:
* html/OffscreenCanvas.h:
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isPaint const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
(WebCore::CanvasRenderingContext2DBase::unwindStateStack):
(WebCore::CanvasRenderingContext2DBase::isAccelerated const):
(WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
(WebCore::CanvasRenderingContext2DBase::setFillStyle):
(WebCore::CanvasRenderingContext2DBase::resetTransform):
(WebCore::CanvasRenderingContext2DBase::clearCanvas):
(WebCore::CanvasRenderingContext2DBase::transformAreaToDevice const):
(WebCore::CanvasRenderingContext2DBase::rectContainsCanvas const):
(WebCore::CanvasRenderingContext2DBase::calculateCompositingBufferRect):
(WebCore::CanvasRenderingContext2DBase::compositeBuffer):
(WebCore::CanvasRenderingContext2DBase::createPattern):
(WebCore::CanvasRenderingContext2DBase::didDrawEntireCanvas):
(WebCore::CanvasRenderingContext2DBase::didDraw):
(WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas):
(WebCore::CanvasRenderingContext2DBase::drawingContext const):
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/PaintRenderingContext2D.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::PaintRenderingContext2D::create):
(WebCore::PaintRenderingContext2D::PaintRenderingContext2D):
* html/canvas/PaintRenderingContext2D.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* html/canvas/PaintRenderingContext2D.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.h:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):
2018-10-22 Keith Rollin <krollin@apple.com>
Use Location = "Relative to Build Products" rather than "Relative to Group"
https://bugs.webkit.org/show_bug.cgi?id=190781
Reviewed by Alexey Proskuryakov.
Almost all Derived Files are included in Xcode projects with the
Location attribute set to "Relative to Group". While this currently
works, the Derived Files can no longer be found when enabling XCBuild
(which has stricter requirements). Fix this by setting the Location
attribute to "Relative to Build Products".
No new tests -- no changed functionality.
* WebCore.xcodeproj/project.pbxproj:
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add justify text-align support.
https://bugs.webkit.org/show_bug.cgi?id=190779
Reviewed by Antti Koivisto.
Collect expansion opportunities and adjust runs accordingly.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::expansionOpportunity):
(WebCore::Layout::InlineRun::TextContext::setStart):
(WebCore::Layout::InlineRun::TextContext::setLength):
(WebCore::Layout::InlineRun::setTextContext):
(WebCore::Layout::InlineRun::createRun): Deleted.
(WebCore::Layout::InlineRun::createTextRun): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::isNonCollapsedText): Deleted.
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add (right, center)text-align support.
https://bugs.webkit.org/show_bug.cgi?id=190745
Reviewed by Antti Koivisto.
Adjust the logical left of each run while closing the line.
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::trimLeadingRun):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun):
(WebCore::Layout::InlineLineBreaker::splitRun):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::setLogicalLeft):
(WebCore::Layout::InlineRun::TextContext::start const):
(WebCore::Layout::InlineRun::createRun):
(WebCore::Layout::InlineRun::createTextRun):
(WebCore::Layout::InlineRun::InlineRun):
(WebCore::Layout::InlineRun::TextContext::TextContext):
(WebCore::Layout::InlineRun::TextContext::position const): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::adjustedLineLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::setConstraints): Deleted.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Implement Replaced helper class.
https://bugs.webkit.org/show_bug.cgi?id=190719
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::replaced const):
* layout/layouttree/LayoutReplaced.cpp:
(WebCore::Layout::Replaced::Replaced):
(WebCore::Layout::Replaced::hasIntrinsicWidth const):
(WebCore::Layout::Replaced::hasIntrinsicHeight const):
(WebCore::Layout::Replaced::hasIntrinsicRatio const):
(WebCore::Layout::Replaced::intrinsicWidth const):
(WebCore::Layout::Replaced::intrinsicHeight const):
(WebCore::Layout::Replaced::intrinsicRatio const):
* layout/layouttree/LayoutReplaced.h:
(WebCore::Layout::Replaced::hasIntrinsicWidth const): Deleted.
(WebCore::Layout::Replaced::hasIntrinsicHeight const): Deleted.
(WebCore::Layout::Replaced::hasIntrinsicRatio const): Deleted.
(WebCore::Layout::Replaced::intrinsicWidth const): Deleted.
(WebCore::Layout::Replaced::intrinsicHeight const): Deleted.
(WebCore::Layout::Replaced::intrinsicRatio const): Deleted.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Block formatting context roots avoid floats.
https://bugs.webkit.org/show_bug.cgi?id=190723
Reviewed by Antti Koivisto.
Inline formatting context roots don't avoid floats (unless they also establish block formatting context).
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2018-10-20 YUHAN WU <yuhan_wu@apple.com>
MediaRecorder should fire a stop event when all tracks are ended
https://bugs.webkit.org/show_bug.cgi?id=190642
Reviewed by Youenn Fablet.
This patch only implements to fire the stop event when all tracks are ended.
We will need to fire a dataavailable event when all tracks are ended.
Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::trackEnded):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
2018-10-19 Stephan Szabo <stephan.szabo@sony.com>
[WinCairo] Search terms are not saved for <input type="search">
https://bugs.webkit.org/show_bug.cgi?id=188174
Reviewed by Fujii Hironori.
No new tests, should be covered by existing tests of search
inputs.
Add support for saving the search terms for <input
type="search"> to a SQLite database, replacing the
CF-based implementation for Windows and adding support
for non-legacy WebKit.
* PlatformWin.cmake:
* platform/win/SearchPopupMenuDB.cpp: Added.
(WebCore::SearchPopupMenuDB::singleton):
(WebCore::SearchPopupMenuDB::SearchPopupMenuDB):
(WebCore::SearchPopupMenuDB::~SearchPopupMenuDB):
(WebCore::SearchPopupMenuDB::saveRecentSearches):
(WebCore::SearchPopupMenuDB::loadRecentSearches):
(WebCore::SearchPopupMenuDB::checkDatabaseValidity): Use
quick_check pragma to test database status.
(WebCore::SearchPopupMenuDB::deleteAllDatabaseFiles):
(WebCore::SearchPopupMenuDB::openDatabase):
(WebCore::SearchPopupMenuDB::closeDatabase):
(WebCore::SearchPopupMenuDB::verifySchemaVersion): Check
schema version and update for schema changes.
(WebCore::SearchPopupMenuDB::checkSQLiteReturnCode): Check
for error codes that indicate database errors and remove and
recreate the database.
(WebCore::SearchPopupMenuDB::executeSimpleSql):
(WebCore::SearchPopupMenuDB::createPreparedStatement):
* platform/win/SearchPopupMenuDB.h: Added.
* platform/win/SearchPopupMenuWin.cpp:
(WebCore::SearchPopupMenuWin::enabled): Always enable support
for search term popup
(WebCore::SearchPopupMenuWin::saveRecentSearches): Switch from
CF implementation to SQLite database implementation
(WebCore::SearchPopupMenuWin::loadRecentSearches): Switch from
CF implementation to SQLite database implementation
(WebCore::autosaveKey): Deleted.
2018-10-19 Justin Fan <justin_fan@apple.com>
[WebGPU] Add stubs for WebGPUSwapChain and WebGPURenderingContext
https://bugs.webkit.org/show_bug.cgi?id=190742
Reviewed by Dean Jackson.
Test: updated webgpu-enabled.html to check for WebGPURenderingContext.
Implement support for creating a "webgpu" context from an HTML canvas.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPURenderingContext.cpp: Added.
(WebCore::WebGPURenderingContext::create):
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* Modules/webgpu/WebGPURenderingContext.h: Added.
* Modules/webgpu/WebGPURenderingContext.idl: Added.
* Modules/webgpu/WebGPUSwapChain.cpp: Added.
(WebCore::WebGPUSwapChain::configure):
(WebCore::WebGPUSwapChain::present):
(WebCore::WebGPUSwapChain::reshape):
(WebCore::WebGPUSwapChain::markLayerComposited):
* Modules/webgpu/WebGPUSwapChain.h: Added.
(WebCore::WebGPUSwapChain::WebGPUSwapChain):
* Modules/webgpu/WebGPUSwapChain.idl: Added.
* Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
* Modules/webgpu/WebGPUSwapChainDescriptor.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebGPUType):
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::getContextWebGPU):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGPU const):
2018-10-19 John Wilander <wilander@apple.com>
Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
https://bugs.webkit.org/show_bug.cgi?id=190687
<rdar://problem/45349024>
Reviewed by Alex Christensen.
Test: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html
NetworkStorageSession::setCookiesFromDOM() now consults the new
m_shouldCapLifetimeForClientSideCookies member variable before
capping the lifetime of cookies.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
Removal of the isMarkedForCookieBlocking member.
* loader/ResourceLoadStatistics.h:
Removal of the isMarkedForCookieBlocking member.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies):
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
No longer takes the boolean clearFirst parameter and now always clears first.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] RenderReplaced renderer should create InlineBox
https://bugs.webkit.org/show_bug.cgi?id=190720
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Inline replaced width should default to 300px only if width is auto.
https://bugs.webkit.org/show_bug.cgi?id=190722
Reviewed by Antti Koivisto.
See #5
// 5. Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add inline runs to showLayoutTree
https://bugs.webkit.org/show_bug.cgi?id=190718
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Remove the previous version of inline content handling.
https://bugs.webkit.org/show_bug.cgi?id=190716
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineContent):
(WebCore::Layout::InlineFormattingState::addLayoutRuns): Deleted.
(WebCore::Layout::InlineFormattingState::layoutRuns const): Deleted.
* layout/inlineformatting/text/TextUtil.cpp: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.cpp.
(WebCore::Layout::TextUtil::TextUtil):
(WebCore::Layout::TextUtil::width const):
(WebCore::Layout::TextUtil::hyphenPositionBefore const):
(WebCore::Layout::TextUtil::textWidth const):
(WebCore::Layout::TextUtil::fixedPitchWidth const):
* layout/inlineformatting/text/TextUtil.h: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.h.
* layout/inlineformatting/textlayout/Runs.h: Removed.
* layout/inlineformatting/textlayout/TextContentProvider.cpp: Removed.
* layout/inlineformatting/textlayout/TextContentProvider.h: Removed.
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Removed.
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Removed.
* layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.cpp: Removed.
* layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.h: Removed.
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add generic inline content handling.
https://bugs.webkit.org/show_bug.cgi?id=190713
Reviewed by Antti Koivisto.
layoutInlineContent turns InlineLineBreaker::Run objects into final inline runs by
resolving heading/trailing whitespace, aligment, expansion opportunities etc.
These inline runs are input to the display tree construction.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/displaytree/DisplayBox.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::trimLeadingRun):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::Line::availableWidth const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineRuns):
(WebCore::Layout::InlineFormattingState::appendInlineRun):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun):
(WebCore::Layout::InlineLineBreaker::nextLayoutRun): Deleted.
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineRun.h: Added.
(WebCore::Layout::InlineRun::logicalLeft const):
(WebCore::Layout::InlineRun::logicalRight const):
(WebCore::Layout::InlineRun::width const):
(WebCore::Layout::InlineRun::setWidth):
(WebCore::Layout::InlineRun::setLogicalRight):
(WebCore::Layout::InlineRun::TextContext::position const):
(WebCore::Layout::InlineRun::TextContext::length const):
(WebCore::Layout::InlineRun::TextContext::setLength):
(WebCore::Layout::InlineRun::textContext):
(WebCore::Layout::InlineRun::inlineItem const):
(WebCore::Layout::InlineRun::InlineRun):
(WebCore::Layout::InlineRun::TextContext::TextContext):
* layout/inlineformatting/Line.cpp: Added.
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::setConstraints):
(WebCore::Layout::isNonCollapsedText):
(WebCore::Layout::isTrimmableContent):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add generic inline line breaker
https://bugs.webkit.org/show_bug.cgi?id=190698
Reviewed by Antti Koivisto.
InlineLineBreaker takes the inline runs and applies the appropriate line breaking rules on them.
InlineRunProvider::Run objects ->
<foobar><image box><hello>< ><world>
InlineLineBreaker::Run ->
<foobar><image box><hello world>
InlineLineBreaker::Run also contains information whether the run is at the beginning or at the end of the line.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::hasDisplayBox const):
* layout/inlineformatting/InlineLineBreaker.cpp: Added.
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::nextLayoutRun):
(WebCore::Layout::InlineLineBreaker::isAtContentEnd const):
(WebCore::Layout::InlineLineBreaker::lineBreakingBehavior):
(WebCore::Layout::InlineLineBreaker::runWidth const):
(WebCore::Layout::InlineLineBreaker::splitRun):
(WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const):
* layout/inlineformatting/InlineLineBreaker.h: Added.
* layout/inlineformatting/textlayout/TextUtil.cpp: Added.
(WebCore::Layout::TextUtil::TextUtil):
(WebCore::Layout::TextUtil::width const):
(WebCore::Layout::TextUtil::hyphenPositionBefore const):
(WebCore::Layout::TextUtil::textWidth const):
(WebCore::Layout::TextUtil::fixedPitchWidth const):
* layout/inlineformatting/textlayout/TextUtil.h: Added.
* layout/layouttree/LayoutBox.cpp:
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add generic inline run generator.
https://bugs.webkit.org/show_bug.cgi?id=190696
Reviewed by Antti Koivisto.
InlineRunProvider turns the following inline content ->
<span>foo<span>bar</span></span>
<img src="broken.jpg"><span>hello world</span>
into a set of runs ->
<foobar><image box><hello>< ><world>
Note that a text run can overlap multiple inline elements. InlineRunProvider::Run only stores a reference to
the first inline element (continuous content can be accessed by iterating through the InlineContent ListHashSet).
These runs are the input to the line breaking algoritm.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineContent):
* layout/inlineformatting/InlineItem.h: Added.
(WebCore::Layout::InlineItem::layoutBox const):
(WebCore::Layout::InlineItem::style const):
(WebCore::Layout::InlineItemHashFunctions::hash):
(WebCore::Layout::InlineItemHashFunctions::equal):
(WebCore::Layout::InlineItemHashTranslator::hash):
(WebCore::Layout::InlineItemHashTranslator::equal):
(WebCore::Layout::InlineItem::InlineItem):
(WebCore::Layout::InlineItem::type const):
(WebCore::Layout::InlineItem::textContent const):
* layout/inlineformatting/InlineRunProvider.cpp: Added.
(WebCore::Layout::InlineRunProvider::InlineRunProvider):
(WebCore::Layout::InlineRunProvider::append):
(WebCore::Layout::InlineRunProvider::insertBefore):
(WebCore::Layout::InlineRunProvider::remove):
(WebCore::Layout::isWhitespace):
(WebCore::Layout::isSoftLineBreak):
(WebCore::Layout::InlineRunProvider::isContinousContent):
(WebCore::Layout::InlineRunProvider::processInlineTextItem):
(WebCore::Layout::InlineRunProvider::moveToNextNonWhitespacePosition):
(WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
* layout/inlineformatting/InlineRunProvider.h: Added.
(WebCore::Layout::InlineRunProvider::Run::type const):
(WebCore::Layout::InlineRunProvider::Run::isText const):
(WebCore::Layout::InlineRunProvider::Run::isWhitespace const):
(WebCore::Layout::InlineRunProvider::Run::isNonWhitespace const):
(WebCore::Layout::InlineRunProvider::Run::isLineBreak const):
(WebCore::Layout::InlineRunProvider::Run::isBox const):
(WebCore::Layout::InlineRunProvider::Run::isFloat const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::start const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::length const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::isCollapsed const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::setStart):
(WebCore::Layout::InlineRunProvider::Run::TextContext::setLength):
(WebCore::Layout::InlineRunProvider::Run::textContext const):
(WebCore::Layout::InlineRunProvider::Run::style const):
(WebCore::Layout::InlineRunProvider::Run::inlineItem const):
(WebCore::Layout::InlineRunProvider::runs const):
(WebCore::Layout::InlineRunProvider::Run::createBoxRun):
(WebCore::Layout::InlineRunProvider::Run::createFloatRun):
(WebCore::Layout::InlineRunProvider::Run::createSoftLineBreakRun):
(WebCore::Layout::InlineRunProvider::Run::createHardLineBreakRun):
(WebCore::Layout::InlineRunProvider::Run::createWhitespaceRun):
(WebCore::Layout::InlineRunProvider::Run::createNonWhitespaceRun):
(WebCore::Layout::InlineRunProvider::Run::Run):
(WebCore::Layout::InlineRunProvider::Run::TextContext::TextContext):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isLineBreakBox const):
* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
(WebCore::Layout::InlineBox::hasTextContent const):
(WebCore::Layout::InlineBox::textContent const):
* layout/layouttree/LayoutLineBreakBox.cpp: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp.
(WebCore::Layout::LineBreakBox::LineBreakBox):
* layout/layouttree/LayoutLineBreakBox.h: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp.
2018-10-19 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Handle zero-area intersections
https://bugs.webkit.org/show_bug.cgi?id=189624
Reviewed by Simon Fraser.
Use edge-inclusive intersection when applying clips and intersecting with the
root, so that two rects that touch each other are considered intersecting even
if the area of their intersection is 0.
Covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
* dom/Document.cpp:
(WebCore::computeIntersectionState):
(WebCore::Document::updateIntersectionObservations):
(WebCore::computeIntersectionRects): Deleted.
2018-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Allow ports to optionally do screen capture in the UI process
https://bugs.webkit.org/show_bug.cgi?id=190728
<rdar://problem/45376824>
Reviewed by Jer Noble and Tim Horton.
No new tests, covered by existing tests.
* Sources.txt: Add RemoteVideoSample.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/MediaSample.h:
(WebCore::MediaSample::videoPixelFormat const):
* platform/graphics/RemoteVideoSample.cpp: Added.
(WebCore::RemoteVideoSample::~RemoteVideoSample):
(WebCore::RemoteVideoSample::create):
(WebCore::RemoteVideoSample::RemoteVideoSample):
(WebCore::RemoteVideoSample::surface):
* platform/graphics/RemoteVideoSample.h: Added.
(WebCore::RemoteVideoSample::time const):
(WebCore::RemoteVideoSample::videoFormat const):
(WebCore::RemoteVideoSample::size const):
(WebCore::RemoteVideoSample::encode const):
(WebCore::RemoteVideoSample::decode):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without
resizing, resize local samples if necessary.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize
samples, it will be done in the base class if necessary.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI
process, it will be done in the web process.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include.
2018-10-18 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155
Reviewed by Simon Fraser.
Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):
2018-10-18 Justin Michaud <justin_michaud@apple.com>
Add new image type for CSS painting API
https://bugs.webkit.org/show_bug.cgi?id=190697
Reviewed by Dean Jackson.
Add a new image type for the CSS painting API, and hook it up so it can be drawn.
For now, it uses a WebGL rendering context from OfflineCanvas because that was
easy to hook up. The spec actually calls for a RenderingContext2D, which can be
handled in another patch.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize const):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending const):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/CSSPaintImageValue.h:
* platform/graphics/CustomPaintImage.cpp: Added.
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
(WebCore::CustomPaintImage::draw):
(WebCore::CustomPaintImage::drawPattern):
* platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* platform/graphics/Image.h:
(WebCore::Image::isCustomPaintImage const):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/CairoOperations.cpp:
2018-10-18 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237272.
Broke on device iOS builds and Windows builds
Reverted changeset:
"[MediaStream] Allow ports to optionally do screen capture in
the UI process"
https://bugs.webkit.org/show_bug.cgi?id=190728
https://trac.webkit.org/changeset/237272
2018-10-18 Jer Noble <jer.noble@apple.com>
[MSE] timestampOffset can introduce floating-point rounding errors to incoming samples
https://bugs.webkit.org/show_bug.cgi?id=190590
<rdar://problem/45275626>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-timestampoffset-rounding-error.html
SourceBuffer.timestampOffset is a double property, which, when added to a MediaTime will
result in a double-backed MediaTime as PTS & DTS. This can introduce rounding errors when
these samples are appended as overlapping existing samples. Rather than converting a MediaTime
to double-backed when adding the timestampOffset, convert the offset to a multiple of the
sample's timeBase.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::setTimestampOffset):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Allow ports to optionally do screen capture in the UI process
https://bugs.webkit.org/show_bug.cgi?id=190728
<rdar://problem/45376824>
Reviewed by Jer Noble and Tim Horton.
No new tests, covered by existing tests.
* Sources.txt: Add RemoteVideoSample.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/MediaSample.h:
(WebCore::MediaSample::videoPixelFormat const):
* platform/graphics/RemoteVideoSample.cpp: Added.
(WebCore::RemoteVideoSample::~RemoteVideoSample):
(WebCore::RemoteVideoSample::create):
(WebCore::RemoteVideoSample::RemoteVideoSample):
(WebCore::RemoteVideoSample::surface):
* platform/graphics/RemoteVideoSample.h: Added.
(WebCore::RemoteVideoSample::time const):
(WebCore::RemoteVideoSample::videoFormat const):
(WebCore::RemoteVideoSample::size const):
(WebCore::RemoteVideoSample::encode const):
(WebCore::RemoteVideoSample::decode):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without
resizing, resize local samples if necessary.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize
samples, it will be done in the base class if necessary.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI
process, it will be done in the web process.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include.
2018-10-18 Jer Noble <jer.noble@apple.com>
Safari is not able to adapt between H264 streams with EditList and without EditList
https://bugs.webkit.org/show_bug.cgi?id=190638
<rdar://problem/45342208>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-append-overlapping-dts.html
The MSE frame replacement algorithm does not take decode timestamps into account; this can
lead to situations where the replacement algorithm may leave in place frames where the
presentationTimestamp is less than the replacement frame, but whose decodeTimestamp is
after the replacement frame. When re-enqueuing these frames, they may cause a decode error
if they break the group-of-pictures sequence of the replaced range.
* Modules/mediasource/SampleMap.cpp:
(WebCore::DecodeOrderSampleMap::findSamplesBetweenDecodeKeys):
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-10-18 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Region parameter and value should be separated by ':'
https://bugs.webkit.org/show_bug.cgi?id=190735
Reviewed by Eric Carlson.
This is specified in https://w3c.github.io/webvtt/#region-settings.
No new tests. Modified existing tests.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setRegionSettings):
2018-10-18 Jer Noble <jer.noble@apple.com>
Add support for MediaKeyEncryptionScheme
https://bugs.webkit.org/show_bug.cgi?id=190173
Reviewed by Eric Carlson.
Added sub-tests to: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html
Add support for the MediaKeyEncryptionScheme extension to EME, as detailed here:
<https://github.com/WICG/encrypted-media-encryption-scheme/blob/master/explainer.md>
As the strings "cenc" and "cbcs" are explicitly lower-case, add support to the bindings generator to keep
those strings as lower-case when converting from IDL.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/encryptedmedia/MediaKeyEncryptionScheme.h:
* Modules/encryptedmedia/MediaKeyEncryptionScheme.idl:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(WK_ucfirst):
* platform/encryptedmedia/CDMEncryptionScheme.h: Copied from Source/WebCore/testing/MockCDMFactory.idl.
* platform/encryptedmedia/CDMMediaCapability.h:
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
* testing/MockCDMFactory.cpp:
(WebCore::m_supportedEncryptionSchemes):
(WebCore::MockCDM::supportsConfiguration const):
* testing/MockCDMFactory.h:
(WebCore::MockCDMFactory::supportedEncryptionSchemes const):
(WebCore::MockCDMFactory::setSupportedEncryptionSchemes):
* testing/MockCDMFactory.idl:
2018-10-18 Alexey Proskuryakov <ap@apple.com>
Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=190729
Reviewed by Tim Horton.
* DerivedSources.make:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
* Modules/geolocation/Geolocation.cpp:
(WebCore::isRequestFromIBooks):
* Modules/geolocation/GeolocationPosition.h:
* Modules/geolocation/NavigatorGeolocation.cpp:
* Modules/geolocation/NavigatorGeolocation.h:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
* Modules/mediasession/WebMediaSessionManager.cpp:
* Modules/mediasession/WebMediaSessionManager.h:
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::filterDeviceList):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::JSQuickTimePluginReplacement::timedMetaData const):
(WebCore::JSQuickTimePluginReplacement::accessLog const):
(WebCore::JSQuickTimePluginReplacement::errorLog const):
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::SpeechSynthesis):
(WebCore::SpeechSynthesis::speak):
* Modules/speech/SpeechSynthesis.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManagerClient.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabaseFile):
* Modules/webdatabase/DatabaseTracker.h:
* WebCorePrefix.h:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityMediaObject.cpp:
* accessibility/AccessibilityMediaObject.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::press):
(WebCore::AccessibilityMenuList::isCollapsed const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::actionVerb const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::actionVerb const):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
* accessibility/ios/AXObjectCacheIOS.mm:
* accessibility/ios/AccessibilityObjectIOS.mm:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
* bindings/js/JSCallbackData.h:
(WebCore::JSCallbackData::~JSCallbackData):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initializeThreading):
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::fieldNamed const):
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::masterKeyAccountNameForCurrentApplication):
(WebCore::createAndStoreMasterKey):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSStyleDeclaration.cpp:
* css/CSSValueKeywords.in:
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
* css/StyleBuilderConverter.h:
* css/html.css:
(video):
(input, textarea, keygen, select, button):
(#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
(#if defined(ENABLE_INPUT_TYPE_DATE) && ENABLE_INPUT_TYPE_DATE):
(#endif):
(#if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT):
(textarea):
(input:matches([type="radio"], [type="checkbox"])):
(input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
(input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-media-slider-thumb):
(#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)):
(input[type="checkbox"]):
(#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR):
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted.
(#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)): Deleted.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
* css/svg.css:
(#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted.
* dom/DeviceMotionController.cpp:
* dom/DeviceMotionController.h:
* dom/DeviceOrientationController.cpp:
(WebCore::DeviceOrientationController::DeviceOrientationController):
* dom/DeviceOrientationController.h:
* dom/DeviceOrientationData.cpp:
* dom/DeviceOrientationData.h:
* dom/DeviceOrientationEvent.cpp:
* dom/DeviceOrientationEvent.h:
* dom/DeviceOrientationEvent.idl:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::suspendDeviceMotionAndOrientationUpdates):
(WebCore::Document::resumeDeviceMotionAndOrientationUpdates):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* dom/Document.h:
* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):
* dom/DocumentMarkerController.cpp:
(WebCore::shouldInsertAsSeparateMarker):
(WebCore::DocumentMarkerController::shiftMarkers):
* dom/DocumentMarkerController.h:
* dom/Element.cpp:
(WebCore::Element::focus):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::willBeDeletedFrom):
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
(WebCore::Node::willRespondToMouseMoveEvents):
(WebCore::Node::willRespondToMouseClickEvents):
* dom/Range.cpp:
* dom/Range.h:
* dom/TreeScope.cpp:
(WebCore::absolutePointIfNotClipped):
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::Editor):
(WebCore::Editor::clear):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::setComposition):
(WebCore::Editor::showSpellingGuessPanel):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markMisspellingsOrBadGrammar):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::revealSelectionAfterEditingOperation):
(WebCore::Editor::setIgnoreSelectionChanges):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::Editor::shouldChangeSelection const):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::editorUIUpdateTimerFired):
(WebCore::Editor::resolveTextCheckingTypeMask):
* editing/Editor.h:
* editing/FontAttributes.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::updateDataDetectorsForSelection):
(WebCore::FrameSelection::setSelectedRange):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::shouldDeleteSelection const):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection::setSelectionFromNone):
(WebCore::FrameSelection::shouldChangeSelection const):
* editing/FrameSelection.h:
* editing/InsertIntoTextNodeCommand.cpp:
* editing/InsertIntoTextNodeCommand.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/TypingCommand.h:
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
(WebCore::FontShadow::createShadow const):
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(_fontForNameAndSize):
(_shadowForShadowStyle):
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_addAttachmentForElement):
(HTMLConverter::_processMetaElementWithName):
(HTMLConverter::_processElement):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attributesForAttributedStringConversion):
(WebCore::WebContentReader::readURL):
* editing/ios/DictationCommandIOS.cpp:
* editing/ios/DictationCommandIOS.h:
* editing/ios/EditorIOS.mm:
* editing/mac/FrameSelectionMac.mm:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
* fileapi/FileCocoa.mm:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
* history/PageCache.cpp:
(WebCore::canCachePage):
* html/BaseDateAndTimeInputType.cpp:
* html/BaseDateAndTimeInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::isKeyboardFocusable const):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):
* html/HTMLAttachmentElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::collectStyleForPresentationAttribute):
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishInitialization):
(WebCore::HTMLMediaElement::registerWithDocument):
(WebCore::HTMLMediaElement::unregisterWithDocument):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::nextScanRate):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::userCancelledLoad):
(WebCore::HTMLMediaElement::mediaSessionTitle const):
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
* html/HTMLMediaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* html/HTMLObjectElement.cpp:
* html/HTMLPlugInElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::usesMenuList const):
(WebCore::HTMLSelectElement::createElementRenderer):
(WebCore::HTMLSelectElement::childShouldCreateRenderer const):
(WebCore::HTMLSelectElement::willRespondToMouseClickEvents):
(WebCore::HTMLSelectElement::updateListBoxSelection):
(WebCore::HTMLSelectElement::scrollToSelection):
(WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::defaultEventHandler):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/HTMLTextFormControlElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
(WebCore::HTMLVideoElement::supportsFullscreen const):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::imageUpdated):
* html/ImageDocument.h:
* html/InputType.cpp:
* html/InputType.h:
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::clientDataBufferingTimerFired):
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget const):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
* html/MediaElementSession.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleTouchEvent):
* html/RangeInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::addSearchResult):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isKeyboardFocusable const):
(WebCore::TextFieldInputType::handleFocusEvent):
(WebCore::TextFieldInputType::handleBlurEvent):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
(WebCore::TextFieldInputType::listAttributeTargetChanged):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processCharacterBufferForInBody):
* html/parser/HTMLTreeBuilder.h:
* html/shadow/MediaControlElements.cpp:
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControls.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::dragFrom):
* html/shadow/SliderThumbElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
* html/shadow/TextControlInnerElements.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::setIndicating):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::platform):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::currentRunLoop):
* loader/DocumentLoader.cpp:
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument):
* loader/EmptyClients.cpp:
* loader/EmptyClients.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkCompleted):
(WebCore::FrameLoader::willLoadMediaElementURL):
(WebCore::FrameLoader::stopForUserCancel):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::didFirstLayout):
(WebCore::createWindow):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
(WebCore::HistoryController::restoreScrollPositionAndViewState):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/ResourceLoader.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
(WebCore::SubresourceLoader::willCancel):
(WebCore::SubresourceLoader::notifyDone):
(WebCore::SubresourceLoader::releaseResources):
* loader/SubresourceLoader.h:
* loader/cache/CachedImage.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::userCaptionPreferencesChangedNotificationCallback):
* page/Chrome.cpp:
(WebCore::Chrome::createColorChooser):
(WebCore::Chrome::dispatchViewportPropertiesDidChange const):
(WebCore::Chrome::didReceiveDocType):
* page/Chrome.h:
* page/ChromeClient.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):
(WebCore::DOMWindow::clearTimeout):
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::resetAllGeolocationPermission):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.h:
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::globalConstRedeclarationShouldThrow):
* page/DeprecatedGlobalSettings.h:
* page/DragController.cpp:
* page/EditorClient.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::startPanScrolling):
(WebCore::EventHandler::handleMouseMoveEvent):
* page/EventHandler.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::willDetachPage):
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::clear):
(WebCore::FrameView::effectiveFrameFlattening const):
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::scrollPositionRespectingCustomFixedPosition const):
(WebCore::FrameView::viewportConstrainedVisibleContentRect const):
(WebCore::FrameView::updateContentsSize):
(WebCore::FrameView::computeScrollability const):
(WebCore::FrameView::adjustTiledBackingCoverage):
(WebCore::FrameView::calculateExtendedBackgroundMode const):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::sizeForResizeEvent const):
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/Navigator.cpp:
* page/Navigator.h:
* page/NavigatorBase.cpp:
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::showPlaybackTargetPicker):
* page/Page.h:
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::initialize):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay const):
* page/SettingsBase.cpp:
* page/SettingsBase.h:
* page/SettingsDefaultValues.h:
(WebCore::editingBehaviorTypeForPlatform):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
(WebCore::initializeIndicator):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::textDocumentParameters):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::showText):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize):
* page/cocoa/SettingsBaseCocoa.mm:
* page/ios/EventHandlerIOS.mm:
* page/ios/FrameIOS.mm:
* page/mac/ChromeMac.mm:
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* page/mac/WebCoreFrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
* page/scrolling/ios/ScrollingTreeIOS.cpp:
* page/scrolling/ios/ScrollingTreeIOS.h:
* platform/ContentFilterUnblockHandler.h:
* platform/Cursor.cpp:
* platform/Cursor.h:
* platform/DragImage.cpp:
* platform/DragImage.h:
* platform/FileChooser.cpp:
* platform/FileChooser.h:
* platform/HostWindow.h:
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/LowPowerModeNotifier.cpp:
* platform/LowPowerModeNotifier.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
(WebCore::initializeSupportedNonImageMimeTypes):
(WebCore::initializeUnsupportedTextMIMETypes):
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformPasteboard.h:
* platform/PlatformScreen.h:
* platform/RemoteCommandListener.cpp:
* platform/RuntimeApplicationChecks.h:
* platform/ScrollAnimator.cpp:
* platform/ScrollView.cpp:
(WebCore::ScrollView::contentsScrollPosition const):
(WebCore::ScrollView::setContentsScrollPosition):
(WebCore::ScrollView::visibleContentRectInternal const):
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
* platform/ScrollableArea.h:
* platform/Scrollbar.cpp:
* platform/Scrollbar.h:
* platform/ThreadTimers.cpp:
* platform/Timer.cpp:
(WebCore::shouldSuppressThreadSafetyCheck):
* platform/Timer.h:
(WebCore::TimerBase::isActive const):
* platform/ValidationBubble.h:
* platform/Widget.h:
* platform/audio/AudioHardwareListener.cpp:
(WebCore::AudioHardwareListener::AudioHardwareListener):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/audio/ios/AudioDestinationIOS.h:
* platform/audio/ios/AudioFileReaderIOS.cpp:
* platform/audio/ios/AudioFileReaderIOS.h:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routingContextUID const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
* platform/cf/MainThreadSharedTimerCF.cpp:
(WebCore::setupPowerObserver):
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/cf/URLCF.cpp:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
(WebCore::ContentFilterUnblockHandler::needsUIProcess const):
(WebCore::ContentFilterUnblockHandler::encode const):
(WebCore::ContentFilterUnblockHandler::decode):
(WebCore::ContentFilterUnblockHandler::canHandleRequest const):
(WebCore::dispatchToMainThread):
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync const):
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/cocoa/KeyEventCocoa.mm:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::localizedNSString):
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::unblockHandler const):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
* platform/cocoa/PlatformView.h:
* platform/cocoa/PlaybackSessionInterface.h:
* platform/cocoa/PlaybackSessionModel.h:
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
* platform/cocoa/VideoFullscreenChangeObserver.h:
* platform/cocoa/VideoFullscreenModel.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
* platform/gamepad/cocoa/GameControllerGamepad.h:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/gamepad/cocoa/GameControllerGamepadProvider.h:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
* platform/graphics/BitmapImage.h:
* platform/graphics/Color.h:
* platform/graphics/ComplexTextController.cpp:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
* platform/graphics/FloatSize.h:
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::createAndFillGlyphPage):
* platform/graphics/Font.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForPlatformData):
(WebCore::FontCache::purgeInactiveFontData):
(WebCore::FontCache::inactiveFontCount):
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::FontCascade):
* platform/graphics/FontCascadeFonts.h:
* platform/graphics/FontDescription.h:
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isEmoji const):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/Icon.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
(WebCore::Image::computeIntrinsicDimensions):
* platform/graphics/Image.h:
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::isAvailable):
(WebCore::MediaPlayer::volumeChanged):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
* platform/graphics/StringTruncator.cpp:
(WebCore::centerTruncateToBuffer):
(WebCore::rightTruncateToBuffer):
(WebCore::rightClipToWordBuffer):
* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
* platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
* platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
* platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h:
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsPictureInPicture const):
* platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::~TileController):
(WebCore::TileController::adjustTileCoverageRect const):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::startedNewCohort):
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
(WebCore::currentRunLoop):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(-[WebAnimationDelegate animationDidStart:]):
(-[WebAnimationDelegate animationDidStop:finished:]):
(WebCore::PlatformCALayerCocoa::setContentsScale):
(WebCore::layerContentsFormat):
(WebCore::PlatformCALayer::drawLayerContents):
(WebCore::PlatformCALayerCocoa::backingStoreBytesPerPixel const):
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::drawPatternCallback):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawLine):
(WebCore::applyShadowOffsetWorkaroundIfNeeded):
(WebCore::GraphicsContext::setURLForRect):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::jpegUTI):
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::createFrameImageAtIndex):
* platform/graphics/cg/ImageSourceCGMac.mm:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cocoa/ColorCocoa.h:
* platform/graphics/cocoa/ColorCocoa.mm:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::similarFont):
(WebCore::computeNecessarySynthesis):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::lookupFallbackFont):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
(WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
(WebCore::Font::determinePitch):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::texImageIOSurface2D):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::optionsForBiplanarSurface):
(WebCore::optionsFor32BitSurface):
(WebCore::IOSurface::maximumSize):
(WebCore::IOSurface::surfaceID const):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::cascadeList):
* platform/graphics/cocoa/TextTrackRepresentationCocoa.h:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/cocoa/WebMetalLayer.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::cvPixelFormatOpenGLKey):
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
* platform/graphics/cv/VideoTextureCopierCV.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/ios/FontAntialiasingStateSaver.h:
(WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
(WebCore::FontAntialiasingStateSaver::setup):
(WebCore::FontAntialiasingStateSaver::restore):
* platform/graphics/ios/FontCacheIOS.mm:
* platform/graphics/ios/IconIOS.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FloatPointMac.mm:
* platform/graphics/mac/FloatRectMac.mm:
* platform/graphics/mac/FloatSizeMac.mm:
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/ImageMac.mm:
* platform/graphics/mac/IntPointMac.mm:
* platform/graphics/mac/IntRectMac.mm:
* platform/graphics/mac/IntSizeMac.mm:
* platform/graphics/mac/WebKitNSImageExtras.h:
* platform/graphics/mac/WebKitNSImageExtras.mm:
* platform/graphics/mac/WebLayer.mm:
(-[WebSimpleLayer display]):
(-[WebSimpleLayer drawInContext:]):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::multiply):
* platform/graphics/transforms/TransformationMatrix.h:
* platform/ios/CursorIOS.cpp:
* platform/ios/Device.cpp:
* platform/ios/Device.h:
* platform/ios/DeviceMotionClientIOS.h:
* platform/ios/DeviceMotionClientIOS.mm:
(WebCore::DeviceMotionClientIOS::motionChanged):
* platform/ios/DeviceOrientationClientIOS.h:
* platform/ios/DeviceOrientationClientIOS.mm:
(WebCore::DeviceOrientationClientIOS::orientationChanged):
* platform/ios/DragImageIOS.mm:
* platform/ios/EventLoopIOS.mm:
* platform/ios/KeyEventIOS.mm:
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileGrid.h:
* platform/ios/LegacyTileGrid.mm:
* platform/ios/LegacyTileGridTile.h:
* platform/ios/LegacyTileGridTile.mm:
* platform/ios/LegacyTileLayer.h:
* platform/ios/LegacyTileLayer.mm:
* platform/ios/LegacyTileLayerPool.h:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/LowPowerModeNotifierIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
* platform/ios/PlatformPasteboardIOS.mm:
* platform/ios/PlatformScreenIOS.mm:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
* platform/ios/SSLKeyGeneratorIOS.cpp:
* platform/ios/ScrollAnimatorIOS.h:
* platform/ios/ScrollAnimatorIOS.mm:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::platformSetContentsSize):
* platform/ios/ScrollbarThemeIOS.h:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/SystemMemoryIOS.cpp:
(WebCore::systemMemoryLevel):
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
* platform/ios/TileControllerMemoryHandlerIOS.cpp:
* platform/ios/TileControllerMemoryHandlerIOS.h:
* platform/ios/UserAgentIOS.mm:
(WebCore::deviceNameForUserAgent):
* platform/ios/ValidationBubbleIOS.mm:
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(WebCore::supportsPictureInPicture):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
* platform/ios/WebBackgroundTaskController.h:
* platform/ios/WebBackgroundTaskController.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebCoreMotionManager.mm:
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
* platform/ios/WebSQLiteDatabaseTrackerClient.h:
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
* platform/ios/WidgetIOS.mm:
* platform/ios/wak/FloatingPointEnvironment.cpp:
* platform/ios/wak/FloatingPointEnvironment.h:
* platform/ios/wak/WAKAppKitStubs.m:
* platform/ios/wak/WAKClipView.m:
* platform/ios/wak/WAKResponder.m:
* platform/ios/wak/WAKScrollView.mm:
* platform/ios/wak/WAKView.mm:
* platform/ios/wak/WAKWindow.mm:
* platform/ios/wak/WKContentObservation.cpp:
* platform/ios/wak/WKGraphics.mm:
* platform/ios/wak/WKUtilities.c:
* platform/ios/wak/WKView.mm:
* platform/ios/wak/WebCoreThread.mm:
* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/ios/wak/WebCoreThreadSystemInterface.cpp:
* platform/mac/DragDataMac.mm:
(WebCore::rtfPasteboardType):
(WebCore::rtfdPasteboardType):
(WebCore::stringPasteboardType):
(WebCore::urlPasteboardType):
(WebCore::htmlPasteboardType):
(WebCore::colorPasteboardType):
(WebCore::pdfPasteboardType):
(WebCore::tiffPasteboardType):
(WebCore::DragData::containsURL const):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
* platform/mac/SuddenTermination.mm:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
* platform/mac/WebCoreFullScreenWarningView.h:
* platform/mac/WebCoreFullScreenWarningView.mm:
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreFullScreenWindow.mm:
* platform/mac/WebNSAttributedStringExtras.mm:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::~RealtimeVideoSource):
(WebCore::RealtimeVideoSource::prepareToProduceData):
* platform/mediastream/ios/AVAudioSessionCaptureDevice.h:
* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/libwebrtc/LibWebRTCMacros.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::deviceIsAvailable):
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::stopProducingData):
(-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::stopProducingData):
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::sensorOrientation):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::monitorOrientation):
(-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mock/MediaPlaybackTargetMock.cpp:
* platform/mock/MediaPlaybackTargetMock.h:
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
* platform/mock/MediaPlaybackTargetPickerMock.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
* platform/network/CredentialStorage.cpp:
* platform/network/NetworkStateNotifier.h:
* platform/network/ResourceHandle.cpp:
(WebCore::builtinResourceHandleConstructorMap):
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceRequestBase.cpp:
* platform/network/ResourceRequestBase.h:
* platform/network/cf/DNSResolveQueueCFNet.cpp:
* platform/network/cf/ProxyServerCFNet.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::resourcePrioritiesEnabled):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::callbacksRunLoop):
(WebCore::copyCONNECTProxyResponse):
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::cookiesForURL):
(WebCore::setHTTPCookiesForURL):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* platform/network/ios/NetworkStateNotifierIOS.mm:
* platform/network/ios/WebCoreURLResponseIOS.h:
* platform/network/ios/WebCoreURLResponseIOS.mm:
* platform/network/mac/ResourceErrorMac.mm:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
* platform/network/mac/UTIUtilities.mm:
* platform/sql/SQLiteDatabase.h:
(WebCore::SQLiteDatabase::sqlite3Handle const):
* platform/sql/SQLiteFileSystem.cpp:
* platform/sql/SQLiteFileSystem.h:
* platform/sql/SQLiteTransaction.cpp:
(WebCore::SQLiteTransaction::begin):
(WebCore::SQLiteTransaction::commit):
(WebCore::SQLiteTransaction::rollback):
(WebCore::SQLiteTransaction::stop):
* platform/text/PlatformLocale.cpp:
* platform/text/PlatformLocale.h:
* platform/text/ios/LocalizedDateCache.h:
* platform/text/ios/LocalizedDateCache.mm:
* platform/text/ios/TextEncodingRegistryIOS.mm:
* platform/text/mac/LocaleMac.h:
* platform/text/mac/LocaleMac.mm:
* plugins/PluginViewBase.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::resolveStyleForMarkedText):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
* rendering/MarkedText.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):
(WebCore::allowMinMaxPercentagesInAutoHeightBlocksQuirk):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
* rendering/RenderButton.cpp:
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing const):
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::maxFilenameWidth const):
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames):
* rendering/RenderIFrame.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::canUseAcceleratedTouchScrolling const):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::showsOverflowControls const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::shouldClipCompositedBounds const):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::paintsIntoWindow const):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
* rendering/RenderLineBreak.cpp:
* rendering/RenderLineBreak.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::RenderMenuList):
(WebCore::RenderMenuList::willBeDestroyed):
(WebCore::RenderMenuList::adjustInnerStyle):
(RenderMenuList::updateFromElement):
(RenderMenuList::setTextFromOption):
(RenderMenuList::hidePopup):
(RenderMenuList::popupDidHide):
* rendering/RenderMenuList.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint):
(WebCore::RenderObject::destroy):
* rendering/RenderObject.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::itemText const):
* rendering/RenderText.cpp:
(WebCore::RenderText::setRenderedText):
* rendering/RenderText.h:
* rendering/RenderTextControl.cpp:
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::getAverageCharWidth):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
(WebCore::RenderTextControlSingleLine::getAverageCharWidth):
(WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth const):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::lineDirectionPointFitsInBox):
(WebCore::RenderTextLineBoxes::positionForPoint const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintBorderOnly):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::arKitBundle):
* rendering/RenderView.cpp:
(WebCore::RenderView::availableLogicalHeight const):
(WebCore::RenderView::clientLogicalWidthForFixedPosition const):
(WebCore::RenderView::clientLogicalHeightForFixedPosition const):
(WebCore::RenderView::repaintViewRectangle const):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::selectionTop const):
(WebCore::RootInlineBox::selectionBottom const):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* testing/Internals.cpp:
(WebCore::Internals::getCurrentCursorInfo):
(WebCore::Internals::isSelectPopupVisible):
(WebCore::Internals::setQuickLookPassword):
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion const):
* testing/js/WebCoreTestSupportPrefix.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
2018-10-18 Per Arne Vollan <pvollan@apple.com>
[WebVTT] The TextTrackLoader parameter in TextTrackLoaderClient virtual methods should be a reference
https://bugs.webkit.org/show_bug.cgi?id=190730
Reviewed by Chris Dumez.
No new tests. No change in behavior.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable):
(WebCore::LoadableTextTrack::cueLoadingCompleted):
(WebCore::LoadableTextTrack::newRegionsAvailable):
* html/track/LoadableTextTrack.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::cueLoadTimerFired):
(WebCore::TextTrackLoader::newRegionsParsed):
* loader/TextTrackLoader.h:
2018-10-18 Alex Christensen <achristensen@webkit.org>
Clean up FrameLoader two-state enums
https://bugs.webkit.org/show_bug.cgi?id=190731
Reviewed by Chris Dumez.
This patch does three things:
1. Add an overload to EnumTraits so we do not need to list out the valid values of boolean enum classes.
The valid values are always 0 and 1. This is used when decoding from IPC.
2. Add a 2-state enum class for NewLoadInProgress instad of a bool so we can understand the code better.
3. Begin passing LockBackForwardList to the UIProcess. We will need it soon for PSON.
* history/CachedFrame.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::clientRedirectCancelledOrFinished):
(WebCore::FrameLoader::clientRedirected):
(WebCore::FrameLoader::receivedMainResourceError):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/FrameLoaderTypes.h:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledNavigation::didStopTimer):
(WebCore::NavigationScheduler::cancel):
* loader/NavigationScheduler.h:
* platform/network/StoredCredentialsPolicy.h:
2018-10-18 Wenson Hsieh <wenson_hsieh@apple.com>
[GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425
https://bugs.webkit.org/show_bug.cgi?id=190712
Reviewed by Tim Horton.
Ensure that color inputs are enabled by default on GTK, and that color inputs have a `-webkit-appearance` of
`color-well` by default. Fixes fast/css/pseudo-visited-background-color-on-input.html on GTK.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformUsesColorWellAppearance const):
(WebCore::RenderTheme::platformColorInputStyleSheet const): Deleted.
Replace this with a platform hook that determines whether we want to use `-webkit-appearance: color-well;` by
default for inputs of type color. For now, only iOS overrides this to return false; in the future, we should
support `-webkit-appearance: color-well;` on iOS, and remove this platform hook entirely.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformColorInputStyleSheet const): Deleted.
2018-10-18 Youenn Fablet <youenn@apple.com>
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681
Reviewed by Eric Carlson.
Remove the previous MDNS resolution mechanism.
Instead, add support for the AsyncResolver mechanism added to libwebrtc.
Covered by current mdns webrtc test that is unflaked.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:
2018-10-18 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Factor out rect mapping and clipping logic from computeRectForRepaint
https://bugs.webkit.org/show_bug.cgi?id=189833
Reviewed by Simon Fraser.
Factor out the rect mapping and clipping logic from computeRectForRepaint to a new
computeVisibleRectInContainer method that computeRectForRepaint now calls. Make
computeVisibleRectInContainer take a VisibleRectContext with options to use
edge-inclusive intersection and to apply all clips and scrolls rather than only
the clips and scrolls that are currently applied by the repaint logic. These
options will be used by IntersectionObserver in a future patch.
No new tests, no change in behavior.
* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::edgeInclusiveIntersect):
* platform/graphics/FloatRect.h:
* platform/graphics/LayoutRect.cpp:
(WebCore::LayoutRect::edgeInclusiveIntersect):
* platform/graphics/LayoutRect.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::computeVisibleRectUsingPaintOffset const):
(WebCore::RenderBox::computeVisibleRectInContainer const):
(WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint const): Deleted.
(WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint const): Deleted.
The iOS-specific logic in this method has moved to RenderObject::shouldApplyCompositedContainerScrollsForRepaint.
(WebCore::RenderBox::computeRectForRepaint const): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::computeRectForRepaint): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeVisibleRectUsingPaintOffset const):
(WebCore::RenderInline::computeVisibleRectInContainer const):
(WebCore::RenderInline::computeRectForRepaint const): Deleted.
* rendering/RenderInline.h:
(WebCore::RenderInline::computeRectForRepaint): Deleted.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint):
(WebCore::RenderObject::visibleRectContextForRepaint):
(WebCore::RenderObject::computeRectForRepaint const):
(WebCore::RenderObject::computeFloatRectForRepaint const):
(WebCore::RenderObject::computeVisibleRectInContainer const):
(WebCore::RenderObject::computeFloatVisibleRectInContainer const):
* rendering/RenderObject.h:
(WebCore::RenderObject::computeAbsoluteRepaintRect const):
(WebCore::RenderObject::VisibleRectContext::VisibleRectContext):
(WebCore::RenderObject::RepaintContext::RepaintContext): Deleted.
(WebCore::RenderObject::computeRectForRepaint): Deleted.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeVisibleRectInContainer const):
(WebCore::RenderTableCell::computeRectForRepaint const): Deleted.
* rendering/RenderTableCell.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::computeVisibleRectInContainer const):
(WebCore::RenderView::computeRectForRepaint const): Deleted.
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGForeignObject::computeVisibleRectInContainer const):
(WebCore::RenderSVGForeignObject::computeFloatRectForRepaint const): Deleted.
(WebCore::RenderSVGForeignObject::computeRectForRepaint const): Deleted.
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGInline::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGModelObject::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGRoot::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::computeVisibleRectInContainer const):
(WebCore::RenderSVGText::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGText::computeRectForRepaint const): Deleted.
(WebCore::RenderSVGText::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
(WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer):
(WebCore::SVGRenderSupport::computeFloatRectForRepaint): Deleted.
* rendering/svg/SVGRenderSupport.h:
2018-10-17 Wenson Hsieh <wenson_hsieh@apple.com>
Enable the datalist element by default on iOS and macOS
https://bugs.webkit.org/show_bug.cgi?id=190594
<rdar://problem/45281159>
Reviewed by Ryosuke Niwa and Tim Horton.
Rebaselined existing layout tests.
* Configurations/FeatureDefines.xcconfig:
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/CSSDefaultStyleSheets.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
* css/html.css:
Remove color input and datalist style rules from the default UA stylesheet.
(input[type="color"]::-webkit-color-swatch-wrapper): Deleted.
* html/HTMLDataListElement.idl:
Make HTMLDataListElement runtime-enabled.
* html/HTMLTagNames.in:
* html/RangeInputType.cpp:
Make a slight adjustment here so that inputs of type range respect the list attribute. Fixes a few layout tests
that add a datalist to an input of type range. See <https://bugs.webkit.org/show_bug.cgi?id=190613> for more
details.
(WebCore::RangeInputType::shouldRespectListAttribute):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldRespectListAttribute):
* page/RuntimeEnabledFeatures.h:
Add a runtime-enabled feature for the datalist element. Additionally, make the runtime-enabled feature for input
type color false by default, so that it's off in WebKitLegacy.
(WebCore::RuntimeEnabledFeatures::dataListElementEnabled const):
(WebCore::RuntimeEnabledFeatures::setDataListElementEnabled):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
Add new style-sheet hooks for datalist and input type color, so that style rules for color inputs and datalists
can be added at runtime only if the feature is enabled. This ensures that in WebKitLegacy (or other ports where
either or both elements are disabled), we don't still apply rules for datalist and input[type="color"]. Notably,
this allows fallback content inside datalist elements to still work in WebKitLegacy (which would otherwise be
hidden when using the default stylesheet since `display: none` is applied to datalist by default). This also
prevents inputs of type color from having a smaller size, no outline, and the appearance of a color well on
macOS.
(WebCore::RenderTheme::dataListStyleSheet const):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformColorInputStyleSheet const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformColorInputStyleSheet const):
2018-10-17 Justin Michaud <justin_michaud@apple.com>
Parse paint() and store paint callbacks for CSS Painting API
https://bugs.webkit.org/show_bug.cgi?id=190657
Reviewed by Dean Jackson.
Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp:
(WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren):
(WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize const):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending const):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSPaintImageValue.cpp: Added.
(WebCore::CSSPaintImageValue::customCSSText const):
* css/CSSPaintImageValue.h: Added.
* css/CSSPaintWorkletGlobalScope.h:
* css/CSSPaintWorkletGlobalScope.idl:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isPaintImageValue const):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
* platform/mediastream/mac/RealtimeVideoUtilities.h:
2018-10-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Consolidate all image conversion and resizing into one class
https://bugs.webkit.org/show_bug.cgi?id=190519
<rdar://problem/45224307>
Try to fix the iOSMac build after r237236.
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
2018-10-17 Justin Fan <justin_fan@apple.com>
[WebGPU] Implement WebGPU bindings up through WebGPUDevice creation
https://bugs.webkit.org/show_bug.cgi?id=190653
Reviewed by Dean Jackson.
Test: webgpu/webgpu-enabled.html
Add WebGPU Sketch bindings for window.webgpu, WebGPUAdapter, WebGPUAdapterDescriptor,
and WebGPUDevice creation. Based off IDL commit version b6c61ee.
https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/DOMWindowWebGPU.cpp: Added.
(WebCore::DOMWindowWebGPU::DOMWindowWebGPU):
(WebCore::DOMWindowWebGPU::supplementName):
(WebCore::DOMWindowWebGPU::from):
(WebCore::DOMWindowWebGPU::webgpu):
(WebCore::DOMWindowWebGPU::webgpu const):
* Modules/webgpu/DOMWindowWebGPU.h: Added.
* Modules/webgpu/DOMWindowWebGPU.idl: Added.
* Modules/webgpu/WebGPU.cpp: Added.
(WebCore::WebGPU::create):
(WebCore::WebGPU::requestAdapter const):
* Modules/webgpu/WebGPU.h: Added.
* Modules/webgpu/WebGPU.idl: Added.
* Modules/webgpu/WebGPUAdapter.cpp: Added.
(WebCore::WebGPUAdapter::create):
(WebCore::WebGPUAdapter::WebGPUAdapter):
(WebCore::WebGPUAdapter::createDevice):
* Modules/webgpu/WebGPUAdapter.h: Added.
* Modules/webgpu/WebGPUAdapter.idl: Added.
* Modules/webgpu/WebGPUAdapterDescriptor.h: Added.
* Modules/webgpu/WebGPUAdapterDescriptor.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp: Added.
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
* Modules/webgpu/WebGPUDevice.h: Added.
(WebCore::WebGPUDevice::adapter const):
* Modules/webgpu/WebGPUDevice.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-10-17 Andy Estes <aestes@apple.com>
[Apple Pay] Increment the API version to 5
https://bugs.webkit.org/show_bug.cgi?id=190686
<rdar://problem/45348523>
Reviewed by Simon Fraser.
Test: http/tests/ssl/applepay/ApplePaySessionV5.html
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::supportsVersion):
2018-10-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Consolidate all image conversion and resizing into one class
https://bugs.webkit.org/show_bug.cgi?id=190519
<rdar://problem/45224307>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* SourcesCocoa.txt: Add ImageTransferSessionVT.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/MediaSample.h:
(WebCore::MediaSample::videoPixelFormat const): New.
* platform/cocoa/VideoToolboxSoftLink.cpp: Add new kVTPixelTransferProperty keys.
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
(WebCore::MediaSampleAVFObjC::create): Remove unimplemented variant.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::videoPixelFormat const): New.
* platform/graphics/cv/ImageTransferSessionVT.h: Added.
(WebCore::ImageTransferSessionVT::create):
* platform/graphics/cv/ImageTransferSessionVT.mm: Added.
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
(WebCore::ImageTransferSessionVT::~ImageTransferSessionVT):
(WebCore::ImageTransferSessionVT::setSize):
(WebCore::ImageTransferSessionVT::createPixelBuffer):
(WebCore::ImageTransferSessionVT::createCMSampleBuffer):
(WebCore::roundUpToMacroblockMultiple):
(WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
(WebCore::ImageTransferSessionVT::createMediaSample):
* platform/graphics/cv/PixelBufferResizer.h: Removed.
* platform/graphics/cv/PixelBufferResizer.mm: Removed.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Remove
the resizing logic, it is handled by the base class.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::capabilities):
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
(WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize):
(WebCore::DisplayCaptureSourceCocoa::emitFrame): Remove resizing logic, just use a transfer
session to create an image from the capture source native output format.
(WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Deleted.
(WebCore::roundUpToMacroblockMultiple): Deleted.
(WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Use image transfer session.
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Deleted.
(WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const): Deleted.
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): Deleted.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return the IOSurface directly.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::generateFrame): Return the CGImage directly.
(WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::capabilities): Only the camera supports device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
2018-10-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up capture source factory management
https://bugs.webkit.org/show_bug.cgi?id=190502
<rdar://problem/45212447>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::audioFactory):
(WebCore::RealtimeMediaSourceCenter::setVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
(WebCore::RealtimeMediaSourceCenter::videoFactory):
(WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): Deleted.
(): Deleted.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory): Deleted.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::audioFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterMac::videoFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::audioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::videoFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::audioFactoryPrivate):
(WebCore::MockRealtimeMediaSourceCenter::videoFactoryPrivate):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactoryPrivate):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory): Deleted.
(WebCore::MockRealtimeMediaSourceCenter::videoFactory): Deleted.
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): Deleted.
* platform/mock/MockRealtimeMediaSourceCenter.h:
2018-10-17 Alex Christensen <achristensen@webkit.org>
BackForwardClient needs to be able to support UIProcess-only back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190675
Reviewed by Chris Dumez.
Return a RefPtr<HistoryItem> instead of a HistoryItem so that we will be able to return a
HistoryItem that has been created instead of a pointer to a HistoryItem that is owned by something else.
Also use unsigned for the back and forward list counts because they can never be negative.
* history/BackForwardClient.h:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::backItem):
(WebCore::BackForwardController::currentItem):
(WebCore::BackForwardController::forwardItem):
(WebCore::BackForwardController::canGoBackOrForward const):
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):
(WebCore::BackForwardController::count const):
(WebCore::BackForwardController::backCount const):
(WebCore::BackForwardController::forwardCount const):
(WebCore::BackForwardController::itemAtIndex):
* history/BackForwardController.h:
(WebCore::BackForwardController::backItem): Deleted.
(WebCore::BackForwardController::currentItem): Deleted.
(WebCore::BackForwardController::forwardItem): Deleted.
* loader/EmptyClients.cpp:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleHistoryNavigation):
2018-10-17 Antoine Quint <graouts@apple.com>
[Web Animations] Do not create a DocumentTimeline to suspend or resume animations
https://bugs.webkit.org/show_bug.cgi?id=190660
Reviewed by Dean Jackson.
We check that there is an existing timeline before trying to suspend or resume its animations, otherwise
we're creating a DocumentTimeline when nothing requires for it to exist. We also have to check that we
suspend animations when a DocumentTimeline is created while the page is not visible.
No new tests as there is no change in behavior here.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
2018-10-17 Antti Koivisto <antti@apple.com>
Tiling CSS gradients is slow
https://bugs.webkit.org/show_bug.cgi?id=190615
Reviewed by Tim Horton.
Painting blocks the main thread on CG rendering queue to make a copy of the backing store.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
Also use sinkIntoImage for bitmap image pattern drawing.
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
Sink the gradient into an Image after generating it. Unlike ImageBuffer, painting it doesn't involve inefficient copies.
Previous isCompatibleWithContext test is replaced with an equivalent scale factor test.
* platform/graphics/GradientImage.h:
2018-10-17 Chris Dumez <cdumez@apple.com>
Update more DOMWindow getters to return references instead of raw pointers
https://bugs.webkit.org/show_bug.cgi?id=190654
Reviewed by Youenn Fablet.
Update more DOMWindow getters to return references instead of raw pointers, since they
can no longer return null after recent refactoring.
* Modules/gamepad/GamepadManager.cpp:
(WebCore::navigatorGamepadFromDOMWindow):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::heapSnapshot):
* dom/Document.cpp:
(WebCore::Document::location const):
(WebCore::Document::dispatchPopstateEvent):
* dom/Event.cpp:
(WebCore::Event::timeStampForBindings const):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::screen):
(WebCore::DOMWindow::history):
(WebCore::DOMWindow::crypto const):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
(WebCore::DOMWindow::applicationCache):
(WebCore::DOMWindow::navigator):
(WebCore::DOMWindow::performance const):
(WebCore::DOMWindow::nowTimestamp const):
(WebCore::DOMWindow::location):
(WebCore::DOMWindow::visualViewport):
(WebCore::DOMWindow::styleMedia):
* page/DOMWindow.h:
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::createTimestamp const):
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::PerformanceObserver):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode):
2018-10-17 Chris Fleizach <cfleizach@apple.com>
AX: Certain tags should identify their context to iOS API
https://bugs.webkit.org/show_bug.cgi?id=190622
<rdar://problem/45308194>
Reviewed by Zalan Bujtas.
Convey the semantic meaning of <code> tag to the iOS API so VoiceOver can make use of it.
Tests: accessibility/ios-simulator/text-context-attributes.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityTextualContext]):
(AXAttributeStringSetStyle):
2018-10-17 Youenn Fablet <youenn@apple.com>
Remove unused code from RealtimeOutgoingVideoSourceCocoa
https://bugs.webkit.org/show_bug.cgi?id=190666
Reviewed by Eric Carlson.
No change of behavior, removed no longer used code.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(): Deleted.
2018-10-17 Ali Juma <ajuma@chromium.org>
Flaky IntersectionObserver web platform tests involving style updates
https://bugs.webkit.org/show_bug.cgi?id=189091
Reviewed by Simon Fraser.
Update intersection observations when flushing layers from the WebProcess
to the UIProcess to make the timing of these updates more predictable, and
more consistent with the IntersectionObserver spec, since the spec expects
these updates to happen as part of the "Update the rendering" step in the
HTML EventLoop.
Getting a similar approach to work with WK1 seems to add more complexity than it's
worth, since flushes don't happen for scrolls handled by platform widgets, and
flushes for other invalidations only happen when in compositing mode.
The only remaining timer-driven intersection observation update is for handling
the initial observation on a newly added target, which needs to happen even if
there are no changes triggering a flush.
Tested by the following tests no longer being flaky:
imported/w3c/web-platform-tests/intersection-observer/bounding-box.html
imported/w3c/web-platform-tests/intersection-observer/display-none.html
imported/w3c/web-platform-tests/intersection-observer/containing-block.html
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate):
(WebCore::Document::scheduleIntersectionObservationUpdate): Deleted.
* dom/Document.h:
* page/FrameView.cpp:
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::viewportContentsChanged):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::willDisplayPage):
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
(WebCore::Page::updateIntersectionObservations):
(WebCore::Page::scheduleForcedIntersectionObservationUpdate):
* page/Page.h:
2018-10-17 Charlie Turner <cturner@igalia.com>
[EME] Sanity check key ID length in the keyids init data format
https://bugs.webkit.org/show_bug.cgi?id=190629
Reviewed by Xabier Rodriguez-Calvar.
Covered by web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids): Ensure the decoded key id length
is at least 1 byte and no more than 512 bytes.
2018-10-16 Chris Dumez <cdumez@apple.com>
Regression(r236795) Check boxes are sometimes checked when they should not be
https://bugs.webkit.org/show_bug.cgi?id=190651
<rdar://problem/45319934>
Reviewed by Ryosuke Niwa.
r236795 mistakenly dropped the statement resetting m_reflectsCheckedAttribute to true
in HTMLInputElement::parseAttribute() because it looked like a no-op given that we
made sure it was true a couple of line above. However, I overlooked that calling
HTMLInputElement::setChecked() sets m_reflectsCheckedAttribute to false.
This patch thus re-introduces the statement. It also renames m_reflectsCheckedAttribute
to m_dirtyCheckednessFlag and reverses its value in order to match the specification
more closely:
- https://html.spec.whatwg.org/#concept-input-checked-dirty-flag
Test: fast/dom/HTMLInputElement/checkbox-dirty-checkedness-flag.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::finishParsingChildren):
(WebCore::HTMLInputElement::reset):
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
* html/HTMLInputElement.h:
2018-10-16 Sihui Liu <sihui_liu@apple.com>
Add a switch for Web SQL
https://bugs.webkit.org/show_bug.cgi?id=190271
Reviewed by Ryosuke Niwa.
Web SQL is still enabled by default.
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/Database.idl:
* Modules/webdatabase/SQLError.idl:
* Modules/webdatabase/SQLResultSet.idl:
* Modules/webdatabase/SQLResultSetRowList.idl:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebSQLDisabled):
(WebCore::RuntimeEnabledFeatures::webSQLEnabled const):
2018-10-16 Chris Dumez <cdumez@apple.com>
window.performance should not become null after the window loses its browsing context
https://bugs.webkit.org/show_bug.cgi?id=190636
Reviewed by Ryosuke Niwa.
window.performance should not become null after the window loses its browsing context. This
WebKit behavior does not match the HTML specification nor the behavior of other browsers.
Also note that the attribute is not nullable in the specification:
- https://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute
No new tests, updated existing test.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::performance const):
* page/Performance.cpp:
(WebCore::Performance::Performance):
* page/Performance.h:
* platform/GenericTaskQueue.h:
(WebCore::TaskDispatcher::TaskDispatcher):
(WebCore::TaskDispatcher::postTask):
(WebCore::GenericTaskQueue::GenericTaskQueue):
(WebCore::GenericTaskQueue::isClosed const):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
2018-10-16 Jer Noble <jer.noble@apple.com>
Refactoring: Convert HTMLMediaElement::scheduleDelayedAction() to individually schedulable & cancelable tasks
https://bugs.webkit.org/show_bug.cgi?id=188208
Reviewed by Eric Carlson.
Rather than have a single, monolithic, zero-duration-timer based dispatch for
a bunch of methods to be performed in a future run-loop, convert them all to
use a DeferrableTask, which in turn is a kind of GenericTaskQueue which can
enqueue only a single task at a time. Convert some other zero-duration-timer
and GenericTaskQueue dispatches to this new DeferrableTask.
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::finishParsingChildren):
(WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
(WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::seekWithTolerance):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
(WebCore::HTMLMediaElement::didAddTextTrack):
(WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::scheduleUpdatePlayState):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::setPlaying):
(WebCore::HTMLMediaElement::setPausedInternal):
(WebCore::HTMLMediaElement::cancelPendingTasks):
(WebCore::HTMLMediaElement::userCancelledLoad):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::dispatchEvent):
(WebCore::HTMLMediaElement::removeEventListener):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
(WebCore::HTMLMediaElement::didBecomeFullscreenElement):
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
(WebCore::HTMLMediaElement::scheduleUpdateMediaState):
(WebCore::HTMLMediaElement::updateMediaState):
(WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
(WebCore::setFlags): Deleted.
(WebCore::clearFlags): Deleted.
(WebCore::actionName): Deleted.
(WebCore::HTMLMediaElement::scheduleDelayedAction): Deleted.
(WebCore::HTMLMediaElement::pendingActionTimerFired): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLMediaElementEnums.h:
* platform/DeferrableTask.h: Added.
(WebCore::DeferrableTask::DeferrableTask):
(WebCore::DeferrableTask::scheduleTask):
(WebCore::DeferrableTask::close):
(WebCore::DeferrableTask::cancelTask):
(WebCore::DeferrableTask::hasPendingTask const):
2018-10-16 Timothy Hatcher <timothy@apple.com>
Add <meta name="supported-color-schemes"> to control what color schemes the page supports
https://bugs.webkit.org/show_bug.cgi?id=190526
rdar://problem/45230140
Reviewed by Dean Jackson.
Test: css-dark-mode/supported-color-schemes.html
* dom/Document.cpp:
(WebCore::isColorSchemeSeparator): Added.
(WebCore::processColorSchemes): Added.
(WebCore::Document::processSupportedColorSchemes): Added.
(WebCore::Document::useDarkAppearance const): Take system appearance and document's
suppoerted color shcemes into account.
* dom/Document.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment): Update use of LocalDefaultSystemAppearance.
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process): Added supported-color-schemes behind runtime feature check.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint): Update use of LocalDefaultSystemAppearance.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink): Update use of LocalDefaultSystemAppearance.
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
Drop the need for useSystemAppearance. This is accounted for in Document::useDarkAppearance.
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::paint): Update use of LocalDefaultSystemAppearance.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents): Update use of LocalDefaultSystemAppearance.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents): Update use of LocalDefaultSystemAppearance.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint): Use document instead of page.
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Update use of LocalDefaultSystemAppearance.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const): Update use of LocalDefaultSystemAppearance.
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const): Ditto.
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Ditto.
(WebCore::RenderThemeMac::colorCache const): Ditto.
(WebCore::RenderThemeMac::systemColor const): Ditto.
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): Ditto.
(WebCore::RenderThemeMac::paintSliderThumb): Ditto.
(WebCore::RenderThemeMac::usingDarkAppearance const): No need to limit to macOS here.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Update use of LocalDefaultSystemAppearance.
2018-10-16 Rob Buis <rbuis@igalia.com>
Remove superfluous VIDEO build guard
https://bugs.webkit.org/show_bug.cgi?id=190624
Reviewed by Michael Catanzaro.
Remove some instances where the VIDEO build guard is included within another VIDEO build guard.
No new tests. No change in behavior.
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
2018-10-16 Youenn Fablet <youenn@apple.com>
Support RTCConfiguration.certificates
https://bugs.webkit.org/show_bug.cgi?id=190603
Reviewed by Eric Carlson.
Update RTCConfiguration to have a certificates member.
Add the conversion from RTCCertificate to libwebrtc certificates.
Add check to ensure that certificates are not expired.
Add check to ensure that certificates passed to setConfiguration were
the same as the ones passed to RTCPeerConnection constructor.
Once these checks are done, we reuse the certificates created at
RCPeerConnection creation time when setting the configuration again.
Covered by rebased WPT test.
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::certificatesFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
2018-10-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237163.
Introduced layout test failures on iOS Simulator.
Reverted changeset:
"[CG] Adopt CG SPI for non-even cornered rounded rects"
https://bugs.webkit.org/show_bug.cgi?id=190155
https://trac.webkit.org/changeset/237163
2018-10-16 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: capture previously saved states and add them to the recording payload
https://bugs.webkit.org/show_bug.cgi?id=190473
Reviewed by Joseph Pecoraro.
Updated existing tests: inspector/canvas/recording-2d.html
inspector/model/recording.html
Instead of sending a single object of the current state of the context, send an array of
objects, one for each restore point.
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::stateStack): Added.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::stringIndexForKey): Added.
(WebCore::InspectorCanvas::buildInitialState):
2018-10-16 Justin Michaud <justin_michaud@apple.com>
Implement feature flag and bindings for CSS Painting API
https://bugs.webkit.org/show_bug.cgi?id=190237
Reviewed by Ryosuke Niwa.
Add feature flag and bindings for CSS Painting API. This adds a new property,
CSS.paintWorkletGlobalScope, which will be a temporary way to access the paint
worklet global scope untill CSS.paintWorklet is implemented.
There are a few small changes, mostly adding headers and "using" declarations,
that were required to get this to build. This is probably related to unified sources.
Tests: fast/css-custom-paint/basic.html
fast/css-custom-paint/registerPaintBindings.html
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: Added.
(WebCore::throwInvalidModificationError):
(WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
* bindings/js/JSEventListener.cpp:
* bindings/js/JSRemoteDOMWindowCustom.cpp:
* bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp:
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintCallback::~CSSPaintCallback):
* css/CSSPaintCallback.idl: Added.
* css/CSSPaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintWorkletGlobalScope::create):
(WebCore::CSSPaintWorkletGlobalScope::CSSPaintWorkletGlobalScope):
(WebCore::CSSPaintWorkletGlobalScope::devicePixelRatio):
(WebCore::CSSPaintWorkletGlobalScope::addRegisteredPaint):
* css/CSSPaintWorkletGlobalScope.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintWorkletGlobalScope::paintDefinitionMap):
* css/CSSPaintWorkletGlobalScope.idl: Added.
* css/DOMCSSPaintWorklet.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope):
(WebCore::DOMCSSPaintWorklet::from):
(WebCore::DOMCSSPaintWorklet::supplementName):
* css/DOMCSSPaintWorklet.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
* css/DOMCSSPaintWorklet.idl: Added.
* css/MediaQueryParserContext.cpp:
* css/StyleBuilder.h:
* dom/Document.cpp:
(WebCore::Document::ensureCSSPaintWorkletGlobalScope):
* dom/Document.h:
* features.json:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSPaintingAPIEnabled):
(WebCore::RuntimeEnabledFeatures::cssPaintingAPIEnabled const):
2018-10-16 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Support inline WebVTT styles
https://bugs.webkit.org/show_bug.cgi?id=190369
Reviewed by Eric Carlson.
Add support for inline WebVTT styles, see https://w3c.github.io/webvtt/#styling. The parsed
style strings from the VTT file are added to an optional vector of style strings in the
TextTrack class. These styles are then added as HTMLStyleElement children to the parent of
the cue span element.
Test: media/track/track-cue-css.html
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::newStyleSheetsParsed):
* html/track/InbandGenericTextTrack.h:
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newStyleSheetsParsed):
* html/track/InbandWebVTTTextTrack.h:
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newStyleSheetsAvailable):
* html/track/LoadableTextTrack.h:
* html/track/TextTrack.h:
(WebCore::TextTrack::styleSheets const):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getDisplayTree):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::getNewCues):
(WebCore::WebVTTParser::getStyleSheets):
(WebCore::WebVTTParser::parse):
(WebCore::WebVTTParser::collectWebVTTBlock):
(WebCore::WebVTTParser::collectStyleSheet):
(WebCore::WebVTTParser::checkStyleSheet):
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* html/track/WebVTTParser.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::newStyleSheetsParsed):
(WebCore::TextTrackLoader::getNewStyleSheets):
* loader/TextTrackLoader.h:
2018-10-16 Chris Dumez <cdumez@apple.com>
window.navigator should not become null after the window loses its browsing context
https://bugs.webkit.org/show_bug.cgi?id=190595
Reviewed by Ryosuke Niwa.
window.navigator should not become null after the window loses its browsing context.
This does not match the HTML specification or the behavior of other browsers.
No new tests, updated existing tests.
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::geolocation const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::navigator):
* page/Navigator.cpp:
(WebCore::Navigator::Navigator):
* page/Navigator.h:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::NavigatorBase):
* page/NavigatorBase.h:
* page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::WorkerNavigator):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
* workers/service/ServiceWorkerContainer.h:
2018-10-16 Alex Christensen <achristensen@webkit.org>
Replace HistoryItem* with HistoryItem& where possible
https://bugs.webkit.org/show_bug.cgi?id=190617
Reviewed by Chris Dumez.
* history/BackForwardClient.h:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::setCurrentItem):
* history/BackForwardController.h:
* history/HistoryItem.cpp:
(WebCore::defaultNotifyHistoryItemChanged):
(WebCore::HistoryItem::setAlternateTitle):
(WebCore::HistoryItem::setURLString):
(WebCore::HistoryItem::setOriginalURLString):
(WebCore::HistoryItem::setReferrer):
(WebCore::HistoryItem::setTitle):
(WebCore::HistoryItem::setTarget):
(WebCore::HistoryItem::setShouldRestoreScrollPosition):
(WebCore::HistoryItem::setStateObject):
(WebCore::HistoryItem::notifyChanged):
* history/HistoryItem.h:
* loader/EmptyClients.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadSameDocumentItem):
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::updateForCommit):
(WebCore::HistoryController::recursiveUpdateForCommit):
(WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
(WebCore::HistoryController::setCurrentItem):
(WebCore::HistoryController::createItem):
(WebCore::HistoryController::itemsAreClones const):
(WebCore::HistoryController::currentFramesMatchItem const):
* loader/HistoryController.h:
2018-10-16 Alex Christensen <achristensen@webkit.org>
Remove unused WebHistoryItem._transientPropertyForKey
https://bugs.webkit.org/show_bug.cgi?id=190606
Reviewed by Chris Dumez.
This is unnecessary complexity in HistoryItem.
* history/HistoryItem.h:
* history/mac/HistoryItemMac.mm:
(WebCore::HistoryItem::getTransientProperty const): Deleted.
(WebCore::HistoryItem::setTransientProperty): Deleted.
2018-10-16 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Separate SSL Class for platform dependent way of setup.
https://bugs.webkit.org/show_bug.cgi?id=190597
Reviewed by Alex Christensen.
SSL setup is very platform dependent. This patch separate the class to allow
platform-dependent setup at the SSL handle instantiation.
No new tests because there's no behaviro changes.
* PlatformWinCairo.cmake:
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::getCACertPathEnv): Moved.
* platform/network/curl/CurlSSLHandle.h:
* platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
(WebCore::CurlSSLHandle::platformInitialize):
2018-10-15 Keith Miller <keith_miller@apple.com>
Support arm64 CPUs with a 32-bit address space
https://bugs.webkit.org/show_bug.cgi?id=190273
Reviewed by Michael Saboff.
Fix missing namespace annotation.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
2018-10-15 Justin Fan <justin_fan@apple.com>
Add WebGPU 2018 feature flag and experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=190509
Reviewed by Dean Jackson.
Re-add ENABLE_WEBGPU, an experimental feature flag, and a RuntimeEnabledFeature
for the 2018 WebGPU prototype.
* Configurations/FeatureDefines.xcconfig:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
(WebCore::RuntimeEnabledFeatures::webGPUEnabled const):
2018-10-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237162.
https://bugs.webkit.org/show_bug.cgi?id=190612
Broke Windows build (Requested by dolmstead on #webkit).
Reverted changeset:
"Add stub implementation for accessibility objects"
https://bugs.webkit.org/show_bug.cgi?id=190608
https://trac.webkit.org/changeset/237162
2018-10-15 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155
Reviewed by Simon Fraser.
Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):
2018-10-15 Don Olmstead <don.olmstead@sony.com>
Add stub implementation for accessibility objects
https://bugs.webkit.org/show_bug.cgi?id=190608
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Add default implementation to associated cpp file. Removes the WPE
specific stubs.
* SourcesWPE.txt:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::detachWrapper):
(WebCore::AXObjectCache::attachWrapper):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
(WebCore::AXObjectCache::handleScrolledToAnchor):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
* accessibility/AccessibilityObject.h:
* accessibility/wpe/AXObjectCacheWPE.cpp: Removed.
* accessibility/wpe/AccessibilityObjectWPE.cpp: Removed.
2018-10-15 Alex Christensen <achristensen@webkit.org>
Modernize BackForwardClient.h
https://bugs.webkit.org/show_bug.cgi?id=190610
Reviewed by Chris Dumez.
* editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent):
* history/BackForwardClient.h:
* history/BackForwardController.h:
(WebCore::BackForwardController::client):
(WebCore::BackForwardController::client const):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
(WebCore::createEmptyFrameNetworkingContext): Deleted.
(WebCore::fillWithEmptyClients): Deleted.
(WebCore::createEmptyEditorClient): Deleted.
* loader/EmptyClients.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
2018-10-15 Timothy Hatcher <timothy@apple.com>
Add support for prefers-color-scheme media query
https://bugs.webkit.org/show_bug.cgi?id=190499
rdar://problem/45212025
Reviewed by Dean Jackson.
Test: css-dark-mode/prefers-color-scheme.html
* Configurations/FeatureDefines.xcconfig: Added ENABLE_DARK_MODE_CSS.
* css/CSSValueKeywords.in: Added light and dark.
* css/MediaFeatureNames.h: Added prefers-color-scheme.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate): Added.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Added prefers-color-scheme.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Added.
(WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Added.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState): Reset setUseDarkAppearance.
(WebCore::InternalSettings::setUseDarkAppearance): Added.
* testing/InternalSettings.h: Added setUseDarkAppearance.
* testing/InternalSettings.idl: Ditto.
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove unused WebView._globalHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=190601
Reviewed by Chris Dumez.
This was a hack to give the client a more reliable current back/forward item, but it hasn't been used for years
and it's adding unnecessary complexity to the history code.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
2018-10-15 Chris Dumez <cdumez@apple.com>
Experiment: target=_blank on anchors should imply rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=190481
Reviewed by Alex Christensen.
As an experiment, try and make it so that target=_blank on anchors implies `rel=noopener` for improved security.
WebContent can then request an opener relationship by using `rel=opener` instead.
This change was discussed at:
- https://github.com/whatwg/html/issues/4078
We want to attempt this change is STP to see if it is Web-compatible. Preliminary testing seems to indicate
that OAuth workflows still work.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::handleClick):
(WebCore::HTMLAnchorElement::effectiveTarget const):
* html/HTMLAnchorElement.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled):
(WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const):
2018-10-15 Andy Estes <aestes@apple.com>
[Apple Pay] New shipping methods are ignored when updating after the shippingaddresschange event
https://bugs.webkit.org/show_bug.cgi?id=190560
<rdar://problem/44559075>
Reviewed by Youenn Fablet.
When a PaymentDetailsUpdate with shipping options was specified to updateWith() after the
shippingaddresschange event fires, ApplePayPaymentHandler needs to convert the shipping
options to ShippingMethods and add them to the ShippingContactUpdate so that the Apple Pay
UI renders the new options.
Added test cases to http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html.
* Modules/applepay/ApplePayShippingMethod.idl:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeShippingMethods):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::convert):
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeShippingContactSelection):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2018-10-15 Youenn Fablet <youenn@apple.com>
RTCPeerConnection.generateCertificate is not a function
https://bugs.webkit.org/show_bug.cgi?id=173541
<rdar://problem/32638029>
Reviewed by Eric Carlson.
Add support for RTCCertificate generation through libwebrtc certificate generator.
Make generation in the webrtc network thread.
Support is as per spec (ECDSA and RSASSA_PKCS).
Partially covered by WPT tests.
* css/StyleBuilder.h: Fixing build.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webauthn/PublicKeyCredential.cpp: Fixing build.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::generateCertificate):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::CertificateInformation::RSASSA_PKCS1_v1_5):
(WebCore::PeerConnectionBackend::CertificateInformation::ECDSA_P256):
(WebCore::PeerConnectionBackend::CertificateInformation::CertificateInformation):
* Modules/mediastream/RTCCertificate.cpp: Added.
(WebCore::RTCCertificate::create):
(WebCore::RTCCertificate::RTCCertificate):
* Modules/mediastream/RTCCertificate.h: Added.
(WebCore::RTCCertificate::expires const):
(WebCore::RTCCertificate::getFingerprints const):
* Modules/mediastream/RTCCertificate.idl: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::certificateTypeFromAlgorithmIdentifier):
(WebCore::RTCPeerConnection::generateCertificate):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: Added.
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::~RTCCertificateGeneratorCallback):
(WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
(WebCore::LibWebRTCCertificateGenerator::generateCertificate):
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::certificateGenerator):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
Add compact logging for the paint-order RenderLayer tree
https://bugs.webkit.org/show_bug.cgi?id=190592
Reviewed by Zalan Bujtas.
Add a way to dump the RenderLayer tree in paint order, which will be extended in future
to show more dirty bit state.
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputIdent):
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::showPaintOrderTree):
* rendering/RenderLayer.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove unused parameters from FrameLoaderClient::createFrame
https://bugs.webkit.org/show_bug.cgi?id=190587
Reviewed by Chris Dumez.
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::createFrame):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):
2018-10-15 Andy Estes <aestes@apple.com>
[Apple Pay] Payment authorization results with ApplePayErrors should never be considered final
https://bugs.webkit.org/show_bug.cgi?id=190559
<rdar://problem/37250908>
Reviewed by Anders Carlsson.
When PaymentCoordinator thinks a payment authorization result is final it releases the
active ApplePaySession. The Apple Pay UI is dismissed after a receiving a final result.
However, WebCore::isFinalStateResult had the wrong idea about what was a final state,
in some cases causing PaymentCoordinator to release the active session even when the UI is
still presented. If the user authorizes payment again, the website will not receive another
paymentauthorized event, and the Apple Pay UI will eventually time out waiting for a result.
Specifically, isFinalStateResult thought that:
(1) results with STATUS_SUCCESS were always final, even if they had errors
(2) errors with code "unknown" were final
Both of these assumptions are wrong. PassKit considers any result with errors to be
non-final, even if an error has code "unknown."
Fixed WebCore::isFinalStateResult to agree with what PassKit considers to be final results.
Test: http/tests/ssl/applepay/ApplePaySessionFinalState.https.html
* Modules/applepay/ApplePaySessionPaymentRequest.cpp:
(WebCore::isFinalStateResult):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completePaymentSession):
2018-10-15 Andy Estes <aestes@apple.com>
[Payment Request] PaymentResponse should be a ContextDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=190558
Reviewed by Alex Christensen.
Make PaymentResponse a ContextDestructionObserver so it has a ScriptExecutionContext to
return for its override of EventTarget::scriptExecutionContext(). Do this instead of
downcasting m_request to an ActiveDOMObject to ask for its context.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::accept):
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::scriptExecutionContext const): Deleted.
* Modules/paymentrequest/PaymentResponse.h:
2018-10-15 Andy Estes <aestes@apple.com>
[Payment Request] Use a PendingActivity token rather than calling (un)setPendingActivity
https://bugs.webkit.org/show_bug.cgi?id=190557
Reviewed by Alex Christensen.
PaymentRequest has pending activity whenever there is an active payment handler, since
user-initiated events can occur whenever the payment UI is displayed.
Rather than manually track the pending activity with setPendingActivity() and
unsetPendingActivity(), use a PendingActivity token tied to the lifetime of the active
payment handler. Also, rewrite canSuspendForDocumentSuspension() in terms of
hasPendingActivity().
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):
(WebCore::PaymentRequest::abortWithException):
(WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
(WebCore::PaymentRequest::paymentMethodChanged):
(WebCore::PaymentRequest::completeMerchantValidation):
(WebCore::PaymentRequest::settleDetailsPromise):
(WebCore::PaymentRequest::complete):
(WebCore::PaymentRequest::cancel):
* Modules/paymentrequest/PaymentRequest.h:
2018-10-15 Wenson Hsieh <wenson_hsieh@apple.com>
Changing view scale should zoom to initial scale if the page is already at initial scale
https://bugs.webkit.org/show_bug.cgi?id=190570
<rdar://problem/45261877>
Reviewed by Tim Horton.
Add a getter for ViewportConfiguration's layout size scale factor.
See Source/WebKit/ChangeLog for more details.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::layoutSizeScaleFactor const):
2018-10-15 Charlie Turner <cturner@igalia.com>
Fix build error with !LOG_DISABLED in Release mode
https://bugs.webkit.org/show_bug.cgi?id=190465
Reviewed by Michael Catanzaro.
No tests due to no new functionality.
* workers/service/ServiceWorkerRegistrationKey.cpp:
* workers/service/ServiceWorkerRegistrationKey.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
LayerListMutationDetector should take a reference
https://bugs.webkit.org/show_bug.cgi?id=190586
Reviewed by Zalan Bujtas.
Change LayerListMutationDetector to take a RenderLayer&.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
(WebCore::LayerListMutationDetector::LayerListMutationDetector):
(WebCore::LayerListMutationDetector::~LayerListMutationDetector):
* rendering/RenderLayerBacking.cpp:
(WebCore::traverseVisibleNonCompositedDescendantLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
(WebCore::RenderLayerCompositor::layerHas3DContent const):
2018-10-15 Simon Fraser <simon.fraser@apple.com>
Share some code to dirty z-order and normal flow lists when child layers are added or removed
https://bugs.webkit.org/show_bug.cgi?id=190585
Reviewed by Zalan Bujtas.
Factor code which dirties the normal flow list and child stacking context z-order lists
when a layer is added or removed.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::dirtyPaintOrderListsOnChildChange):
* rendering/RenderLayer.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
Make a helper function to check for reflection layers
https://bugs.webkit.org/show_bug.cgi?id=190584
Reviewed by Zalan Bujtas.
Add RenderLayer::isReflectionLayer() which returns true if the passed layer
is the layer of this layer's reflection. It's used in z-order list building.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::collectLayers):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
RenderLayer::addChild() and removeChild() should take references
https://bugs.webkit.org/show_bug.cgi?id=190582
Reviewed by Zalan Bujtas.
Pass the layer to be added or removed as a reference; it's never null.
* rendering/RenderElement.cpp:
(WebCore::addLayers):
(WebCore::RenderElement::removeLayers):
(WebCore::RenderElement::moveLayers):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::insertOnlyThisLayer):
(WebCore::RenderLayer::removeOnlyThisLayer):
* rendering/RenderLayer.h:
2018-10-15 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[Cairo] Incorrect rendering for 135-deg skews
https://bugs.webkit.org/show_bug.cgi?id=190513
Compensation value to zero the the translation components
of the transformation matrix is incorrect if the matrix
has a shear factor.
Reviewed by Žan Doberšek.
Tests: fast/transforms/skew-x-135deg-with-gradient.html
fast/transforms/skew-y-135deg-with-gradient.html
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::drawPatternToCairoContext):
2018-10-15 Christopher Reid <chris.reid@sony.com>
[Curl][WinCairo] Add Public Suffix support to WinCairo
https://bugs.webkit.org/show_bug.cgi?id=183060
Reviewed by Alex Christensen.
Add Public Suffix support to WinCairo using LibPSL.
LibPSL has been added to WinCairoRequirements in v2018.10.09.
* platform/Curl.cmake:
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies): Search for cookies using the topPrivatelyControlledDomain
(WebCore::CookieJarDB::setCookie): Prevent cookies from being added under TLDs
* platform/network/curl/PublicSuffixCurl.cpp: Added.
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomainInternal):
(WebCore::topPrivatelyControlledDomain):
2018-10-15 Simon Fraser <simon.fraser@apple.com>
RenderLayer tree-related cleanup
https://bugs.webkit.org/show_bug.cgi?id=190572
Reviewed by Zalan Bujtas.
Move code around so that functions related to parent/child and z-order tree structure
are near the top of RenderLayer.cpp, since this is one of the primary functions of layers.
Attempts to use inheritance or composition to separate out tree structure resulted in
unwieldy code and/or performance regressions.
The only behavior change is to store a bit for m_isStackingContext so that we don't have
to consult the old style to know if it changed.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::insertOnlyThisLayer):
(WebCore::RenderLayer::removeOnlyThisLayer):
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::shouldBeNormalFlowOnly const):
(WebCore::RenderLayer::shouldBeStackingContext const):
(WebCore::RenderLayer::setIsNormalFlowOnly):
(WebCore::RenderLayer::setIsStackingContext):
(WebCore::RenderLayer::setParent):
(WebCore::RenderLayer::dirtyZOrderLists):
(WebCore::RenderLayer::dirtyStackingContextZOrderLists):
(WebCore::RenderLayer::dirtyNormalFlowList):
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::collectLayers):
(WebCore::RenderLayer::updateLayerListsIfNeeded):
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::willBeDestroyed):
(WebCore::RenderLayer::isDescendantOf const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::compareZIndex): Deleted.
* rendering/RenderLayer.h:
2018-10-15 Antti Koivisto <antti@apple.com>
[PSON] Prewarm system fallback fonts
https://bugs.webkit.org/show_bug.cgi?id=190517
Reviewed by Ryosuke Niwa.
This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages
after process swaps.
* page/PrewarmInformation.h:
(WebCore::PrewarmInformation::encode const):
(WebCore::PrewarmInformation::decode):
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::collectPrewarmInformation):
(WebCore::ProcessWarming::prewarmWithInformation):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::collectPrewarmInformation const):
(WebCore::FontCache::prewarm):
* platform/graphics/FontCache.h:
(WebCore::FontCache::PrewarmInformation::isolatedCopy const):
(WebCore::FontCache::PrewarmInformation::encode const):
(WebCore::FontCache::PrewarmInformation::decode):
Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontCache::systemFallbackForCharacters):
Collect the names of fonts that end up needing character specific system fallbacks.
(WebCore::FontCache::collectPrewarmInformation const):
Include them into prewarm information.
(WebCore::FontCache::prewarm):
Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully
prewarm it for fallbacks (independent of size, locale or other characteristics).
Any future calls to systemFallbackForCharacters are fast.
2018-10-15 Chris Dumez <cdumez@apple.com>
Restrict browsing context lookup by name to frames that are related to one another
https://bugs.webkit.org/show_bug.cgi?id=190475
Reviewed by Alex Christensen.
Update our frame lookup by name logic to take in the active / requesting frame and
only a return a frame that is related to it. By related to it, I mean:
- Ancestor <-> Descendant relationship
- Opener <-> Openee relationship
Being able to look up unrelated frames makes process swapping difficult so we need
to be stricter.
This change is being discussed at:
- https://github.com/whatwg/html/issues/313
Tests: http/tests/dom/new-window-can-target-opener.html
http/tests/dom/noopener-window-cannot-target-opener.html
http/tests/dom/noopener-window-not-targetable.html
http/tests/dom/noopener-window-not-targetable2.html
http/tests/dom/noreferrer-window-not-targetable.html
http/tests/dom/opened-window-not-targetable-after-disowning-opener.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::findFrameForNavigation):
* page/FrameTree.cpp:
(WebCore::isFrameFamiliarWith):
(WebCore::FrameTree::find const):
* page/FrameTree.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::targetFrame const):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Shrink more enum classes
https://bugs.webkit.org/show_bug.cgi?id=190540
Reviewed by Chris Dumez.
* Modules/notifications/NotificationDirection.h:
* dom/Document.h:
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.h:
* loader/ShouldSkipSafeBrowsingCheck.h:
* loader/ShouldTreatAsContinuingLoad.h:
* page/AutoplayEvent.h:
* page/ChromeClient.h:
* page/DiagnosticLoggingClient.h:
* page/Page.h:
* platform/CookiesStrategy.h:
* platform/audio/AudioSession.h:
* platform/network/NetworkStorageSession.h:
* platform/network/StoredCredentialsPolicy.h:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistrationData.h:
* workers/service/ServiceWorkerRegistrationOptions.h:
* workers/service/ServiceWorkerTypes.h:
* workers/service/ServiceWorkerUpdateViaCache.h:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.h:
2018-10-15 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Implement subprocess sandboxing
https://bugs.webkit.org/show_bug.cgi?id=188568
Reviewed by Michael Catanzaro.
Link against libseccomp.
* PlatformGTK.cmake:
2018-10-15 YUHAN WU <yuhan_wu@apple.com>
Implement error handler of MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190438
Reviewed by Youenn Fablet.
Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html
Implement error event handler (onerror) for MediaRecorder and basic architecture of start() function.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::stop):
(WebCore::MediaRecorder::start):
(WebCore::MediaRecorder::setNewRecordingState):
(WebCore::MediaRecorder::scheduleDeferredTask):
(WebCore::MediaRecorder::didAddOrRemoveTrack):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* Modules/mediarecorder/MediaRecorderErrorEvent.cpp: Added.
(WebCore::MediaRecorderErrorEvent::create):
(WebCore::MediaRecorderErrorEvent::MediaRecorderErrorEvent):
(WebCore::MediaRecorderErrorEvent::eventInterface const):
* Modules/mediarecorder/MediaRecorderErrorEvent.h: Added.
* Modules/mediarecorder/MediaRecorderErrorEvent.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
2018-10-15 Chris Dumez <cdumez@apple.com>
Window's properties such as 'location' should not become null when it loses its browsing context
https://bugs.webkit.org/show_bug.cgi?id=190539
Reviewed by Alex Christensen.
Window's properties such as 'location' should not become null when it loses its browsing context.
This Webkit behavior is not standard and does not match other browsers so this patch makes it so
that those properties persist.
Tests: http/tests/dom/cross-origin-detached-window-properties.html
http/tests/dom/same-origin-detached-window-properties.html
* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
(WebCore::JSDOMWindowProperties::getOwnPropertySlot):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::putCommon):
(WebCore::JSLocation::deleteProperty):
(WebCore::JSLocation::deletePropertyByIndex):
(WebCore::JSLocation::getOwnPropertyNames):
(WebCore::JSLocation::defineOwnProperty):
(WebCore::JSLocation::getPrototype):
(WebCore::JSLocation::toStringName):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttrGetter):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody):
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* dom/Document.cpp:
(WebCore::Document::~Document):
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
* page/Crypto.h:
(WebCore::Crypto::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::frameDestroyed):
(WebCore::DOMWindow::screen):
(WebCore::DOMWindow::history):
(WebCore::DOMWindow::crypto):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
(WebCore::DOMWindow::console const):
(WebCore::DOMWindow::applicationCache):
(WebCore::DOMWindow::navigator):
(WebCore::DOMWindow::performance const):
(WebCore::DOMWindow::location):
(WebCore::DOMWindow::visualViewport):
(WebCore::DOMWindow::styleMedia):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::crypto):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Include EnumTraits.h less
https://bugs.webkit.org/show_bug.cgi?id=190535
Reviewed by Chris Dumez.
* Modules/applepay/ApplePaySessionPaymentRequest.h:
* Modules/applepay/PaymentAuthorizationStatus.h:
* Modules/applicationmanifest/ApplicationManifest.h:
* Modules/fetch/FetchHeaders.h:
* Modules/webauthn/AuthenticatorTransport.h:
* Modules/webauthn/PublicKeyCredentialType.h:
* loader/ShouldSkipSafeBrowsingCheck.h:
* loader/ShouldTreatAsContinuingLoad.h:
* platform/Cookie.h:
* platform/audio/AudioSession.h:
* platform/mediastream/CaptureDevice.h:
* platform/mediastream/MediaStreamRequest.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/network/NetworkLoadInformation.h:
* workers/service/ServiceWorkerClientType.h:
* workers/service/ServiceWorkerTypes.h:
* workers/service/ServiceWorkerUpdateViaCache.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove InjectedBundle processing of back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190459
Reviewed by Chris Dumez.
The uses of these functions are dead code I removed in rdar://problem/45180545
Removing these functions is a step towards fixing the PSON history bugs.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
2018-10-14 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Remove Option::useAsyncIterator
https://bugs.webkit.org/show_bug.cgi?id=190567
Reviewed by Saam Barati.
* Configurations/FeatureDefines.xcconfig:
2018-10-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] Fix EME build for GStreamer 1.14.x
https://bugs.webkit.org/show_bug.cgi?id=190471
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformCaps): The
GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped
until the GStreamer 1.16.0 release, so its use needs to be wrapped
between a version check.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto.
2018-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view
https://bugs.webkit.org/show_bug.cgi?id=190504
<rdar://problem/45117760>
Reviewed by Tim Horton.
Add support in ViewportConfiguration for applying a layout size scale factor to the viewport. See below for
more details.
Tests: fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html
fast/viewport/ios/device-width-viewport-after-changing-view-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize):
The viewport's layout size may now be changed alongside the layout size scale factor. If either of these two
variables change, we recompute our minimum layout size and viewport configuration parameters.
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
(WebCore::ViewportConfiguration::nativeWebpageParameters):
(WebCore::ViewportConfiguration::testingParameters):
(WebCore::ViewportConfiguration::updateConfiguration):
Multiply the minimum scale, initial scale, and maximum scale by the layout size scale factor. This allows us to
keep the document well-proportioned within the viewport, while still laying out at a different layout size.
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):
Compute the minimum layout size by scaling the default layout size derived from our view's size.
(WebCore::ViewportConfiguration::layoutWidth const):
(WebCore::ViewportConfiguration::layoutHeight const):
* page/ViewportConfiguration.h:
Maintain the original initial scale, unaffected by the layout size scale factor. This is used when computing
layout width and height to prevent scaling by the layout size scale factor twice when computing layout sizes.
(WebCore::ViewportConfiguration::description const):
Include the layout size scale factor in ViewportConfiguration's description string.
(WebCore::ViewportConfiguration::Parameters::operator== const):
(WebCore::operator<<):
2018-10-12 Youenn Fablet <youenn@apple.com>
Use downcast for use of RealtimeMediaSource in LibWebRTCMediaEndpoint
https://bugs.webkit.org/show_bug.cgi?id=190533
Reviewed by Chris Dumez.
Clean-up work.
No change of behavior.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::setExistingReceiverSourceTrack):
* platform/mediastream/RealtimeIncomingAudioSource.h:
(isType):
* platform/mediastream/RealtimeIncomingVideoSource.h:
(isType):
* platform/mediastream/RealtimeMediaSource.h:
2018-10-12 Jer Noble <jer.noble@apple.com>
WebAVSampleBufferErrorListener's parent should be a WeakPtr.
https://bugs.webkit.org/show_bug.cgi?id=190524
<rdar://problem/44359307>
Reviewed by Eric Carlson.
Once WebAVSampleBufferErrorListener's parent is a WeakPtr, we no longer need to pass
protectedSelf into the callOnMainThread lambdas; we can pass in the parent itself.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener initWithParent:]):
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(-[WebAVSampleBufferErrorListener layerFailedToDecode:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::destroyRenderers):
2018-10-12 Ryosuke Niwa <rniwa@webkit.org>
Address the review comment which was meant to be addressed in r237025.
* editing/MarkupAccumulator.cpp:
(WebCore::elementCannotHaveEndTag):
2018-10-12 Youenn Fablet <youenn@apple.com> and Alejandro G. Castro <alex@igalia.com>
Refresh libwebrtc up to 343f4144be
https://bugs.webkit.org/show_bug.cgi?id=190361
Reviewed by Chris Dumez.
This refresh should not change behavior but will allow us to implement better
mdns candidate support and simulcast activation surfacing through addTransceiver.
Covered by existing tests.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockRtpSender::GetParameters): Deleted.
(WebCore::MockRtpSender::SetParameters): Deleted.
(WebCore::MockRtpSender::GetDtmfSender const): Deleted.
2018-10-12 Alex Christensen <achristensen@webkit.org>
Allow encoding of small enum classes
https://bugs.webkit.org/show_bug.cgi?id=190531
Reviewed by Tim Horton.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* dom/Document.h:
* editing/FontAttributeChanges.h:
* history/CachedFrame.h:
* loader/FrameLoaderTypes.h:
* platform/CookiesStrategy.h:
* platform/PasteboardItemInfo.h:
* platform/ReferrerPolicy.h:
2018-10-12 Rob Buis <rbuis@igalia.com>
Solve the confusion around blankURL() and isBlankURL() in URL
https://bugs.webkit.org/show_bug.cgi?id=158988
Reviewed by Alex Christensen.
The name isBlankURL is not accurate as the function tests the
protocol, not the full URL. Choose protocolIsAbout to align with
exisiting protocolIsData, protocolIsBlob etc.
No tests as no change in functionality.
* WebCore.order:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadApplicationManifest):
(WebCore::DocumentLoader::startIconLoading):
* loader/NavigationAction.cpp:
(WebCore::shouldTreatAsSameOriginNavigation):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendCustomAttributes):
(WebCore::PageSerializer::serializeFrame):
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame const):
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource const):
* platform/URL.cpp:
(WebCore::URL::protocolIsAbout const):
(WebCore::URL::isBlankURL const): Deleted.
* platform/URL.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
2018-10-12 Youenn Fablet <youenn@apple.com>
DOMCache should dereference itself as soon as stopped
https://bugs.webkit.org/show_bug.cgi?id=190441
Reviewed by Chris Dumez.
Dereference the DOMCache as soon as its context is stopped instead of waiting for garbage collection.
This allows freeing resources sooner in the network process.
No observable change of behavior since the DOMCache becomes no-op when its context is stopped.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::~DOMCache):
(WebCore::DOMCache::stop):
2018-10-12 Jer Noble <jer.noble@apple.com>
CRASH in WebCore::MediaPlayerPrivateAVFoundation::setPreload
https://bugs.webkit.org/show_bug.cgi?id=190485
<rdar://problem/34613350>
Reviewed by Eric Carlson.
Crash analytics show that a pure-virtual function is called by MediaPlayerPrivateAVFoundation::setPreload(), and
the likely cause of that pure-virtual function call is that the MediaPlayerPrivateAVFoundation object itself has
been destroyed, likely as a side effect of calling MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL().
The usual suspect for this kind of crash is due to calling into JS (e.g., from a callback passed up to
HTMLMediaElement). Code inspection hasn't yielded any good hints about why this might be occurring, so we will
add a ScriptDisallowedScope assertion inside HTMLMediaElement::prepareToPlay(), to generate a good crashlog
showing exactly what callback is resulting in a JS call. But just in case the deallocation is not due to JS,
also add an explicit strong-ref inside MediaPlayer::prepareToPlay.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareToPlay):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::prepareToPlay):
2018-10-12 Jer Noble <jer.noble@apple.com>
Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged
https://bugs.webkit.org/show_bug.cgi?id=190490
<rdar://problem/42213807>
Reviewed by Eric Carlson.
Crash analytics show a null dereference occurring, likely because m_mediaSource is null.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2018-10-11 Don Olmstead <don.olmstead@sony.com>
Add Houdini specs to features.json
https://bugs.webkit.org/show_bug.cgi?id=190494
<rdar://problem/45211879>
Unreviewed fix.
Specifications should not reference other specifications. Also
move Worklet into the specifications section.
* features.json:
2018-10-11 Youenn Fablet <youenn@apple.com>
IOS 12 - Service worker cache not shared when added to homescreen
https://bugs.webkit.org/show_bug.cgi?id=190269
<rdar://problem/45009961>
Reviewed by Alex Christensen.
Expose Cache Storage API when Service Worker API is exposed.
This is used for API tests.
* dom/ScriptExecutionContext.h: Make hasServiceWorkerScheme
available outside SERVICE_WORKER compilation flag since used by DOMWindowCaches.
* dom/ScriptExecutionContext.cpp: Ditto.
* Modules/cache/DOMWindowCaches.idl:
2018-10-10 Simon Fraser <simon.fraser@apple.com>
Hide RenderLayer z-order and normal flow lists behind iterators
https://bugs.webkit.org/show_bug.cgi?id=190457
Reviewed by Zalan Bujtas.
Expose the positive z-order, negative z-order and normal flow lists
from RenderLayer as iterators rather than vectors of raw pointers.
This hides the fact that the vectors can be null, and allows for easier casting in future.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::update3DTransformedDescendantStatus):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestList):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::traverseVisibleNonCompositedDescendantLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
(WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
(WebCore::RenderLayerCompositor::layerHas3DContent const):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
2018-10-11 Don Olmstead <don.olmstead@sony.com>
Add Houdini specs to features.json
https://bugs.webkit.org/show_bug.cgi?id=190494
Reviewed by Simon Fraser.
Add CSS Typed OM Level 1, CSS Layout API Level 1, CSS Animation
Worklet, and group them under a Houdini feature set.
* features.json:
2018-10-11 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Semaphore.h conflicts with POSIX header
https://bugs.webkit.org/show_bug.cgi?id=190486
Reviewed by Yusuke Suzuki.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2018-10-11 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Support arbitrary video resolution in getUserMedia API
https://bugs.webkit.org/show_bug.cgi?id=189734
Reviewed by Xabier Rodriguez-Calvar.
Implement arbitrary video resolution for the getUserMedia API in GStreamer.
Fix the MockRealtimeMediaSource device list to make devices properties match
test expectations.
Reactivate tests that were failling because of that.
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::standardVideoSizes):
(WebCore::standardVideoSizes): Deleted.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/VideoPreset.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoPreset::create):
(WebCore::GStreamerVideoPreset::GStreamerVideoPreset):
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
(WebCore::GStreamerVideoCaptureSource::capabilities):
(WebCore::GStreamerVideoCaptureSource::generatePresets):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices):
2018-10-11 Keith Rollin <krollin@apple.com>
CURRENT_ARCH should not be used in Run Script phase.
https://bugs.webkit.org/show_bug.cgi?id=190407
<rdar://problem/45133556>
Reviewed by Alexey Proskuryakov.
CURRENT_ARCH is used in a number of Xcode Run Script phases. However,
CURRENT_ARCH is not well-defined during this phase (and may even have
the value "undefined") since this phase is run just once per build
rather than once per supported architecture. Migrate away from
CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and
performing an operation for each value, or by picking the first entry
in ARCHS and using that as a representative value.
No new tests -- no functional changes.
* DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the
first entry in ARCHS rather than use CURRENT_ARCH.
2018-10-11 Daniel Bates <dabates@apple.com>
Support building WebKit for macOS Mojave using a newer SDK
https://bugs.webkit.org/show_bug.cgi?id=190431
Reviewed by Andy Estes.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::coreSameSitePolicy):
(WebCore::nsSameSitePolicy):
2018-10-11 Daniel Bates <dabates@apple.com>
[iOS] Add typedef for WebEvent keyboard flags
https://bugs.webkit.org/show_bug.cgi?id=190435
Reviewed by Wenson Hsieh.
Currently WebEvent and UIKit SPI are intertwined when it comes to keyboard flags. It seems sufficient
to have WebEvent defined its own keyboard flags so that callers do not need to be aware of UIKit SPI.
No functionality changed. So, no new tests.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent keyboardFlags]):
2018-10-11 Antti Koivisto <antti@apple.com>
Use finer grained locking in FontDatabase
https://bugs.webkit.org/show_bug.cgi?id=190467
Reviewed by Alex Christensen.
* platform/graphics/FontCache.h:
Also use ListHashSet for prewarming info so we can prewarm in the same order the fonts were
seen last time.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
Only hold the lock when accessing the hashmap. There is no need to hold it during font construction
which can take a long time.
(WebCore::FontDatabase::fontForPostScriptName):
This is currently not prewarmed from a thread so no need for locking.
(WebCore::FontDatabase::clear):
2018-10-11 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix race condition in GStreamerVideoDecoder
https://bugs.webkit.org/show_bug.cgi?id=190470
The GStreamerVideoDecoder.m_dtsPtsMap filed is accessed from
the main thread and some GStreamer streaming thread, make sure
to protect its access.
And use WTF::StdMap instead of std::map.
Reviewed by Philippe Normand.
Manually tested and a random crash is gone.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::newSampleCallback):
2018-10-11 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Fix height calculation for streams with source aspect ratio
https://bugs.webkit.org/show_bug.cgi?id=190464
Reviewed by Xabier Rodriguez-Calvar.
This patch is authored by Nikola Veljkovic <Nikola.Veljkovic@zenterio.com>
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::getVideoResolutionFromCaps): Reverse the SAR adjustment to "undo" it
instead of applying it twice.
2018-10-11 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Add mediaDevices.enumerateDevices support
https://bugs.webkit.org/show_bug.cgi?id=185761
Reviewed by Youenn Fablet.
We are adopting the same policy COCOA is using when returning the
list of media devices if the user does not have persistent
access. Namely, we just return the first media device for audio
and video capture.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::filterDeviceList): Add support for
other platforms when filtering devices if there is no persistent
access to the origin.
2018-10-10 Chris Dumez <cdumez@apple.com>
Rename a couple of DOMWindowProperty virtual functions
https://bugs.webkit.org/show_bug.cgi?id=190458
Reviewed by Geoffrey Garen.
Rename a couple of DOMWindowProperty virtual functions as the current naming no longer makes
sense after recent refactoring.
disconnectFrameForDocumentSuspension() was renamed to suspendForPageCache(), and
reconnectFrameFromDocumentSuspension(Frame*) was renamed to resumeFromPageCache().
DOMWindowProperty objects no longer need to disconnect / reconnect from their
frame since they now get their frame from their associated Window. However, some
DOMWindowProperty subclasses do have some page cache suspension / resuming logic
implemented of overrides of these functions.
Also drop the disconnectDOMWindowProperties() / reconnectDOMWindowProperties()
methods in DOMWindow. The naming made little sense as it does not really
disconnect those properties in any way. Instead, inline them in
DOMWindow's suspendForPageCache() / resumeFromPageCache() since these are
the only callers.
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::suspendForPageCache):
(WebCore::DOMWindowIndexedDatabase::resumeFromPageCache):
(WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension): Deleted.
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::open):
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::suspendForPageCache):
(WebCore::DOMApplicationCache::resumeFromPageCache):
(WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension): Deleted.
* loader/appcache/DOMApplicationCache.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::suspendForPageCache):
(WebCore::DOMWindow::resumeFromPageCache):
(WebCore::DOMWindow::suspendForDocumentSuspension): Deleted.
(WebCore::DOMWindow::resumeFromDocumentSuspension): Deleted.
(WebCore::DOMWindow::disconnectDOMWindowProperties): Deleted.
(WebCore::DOMWindow::reconnectDOMWindowProperties): Deleted.
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::suspendForPageCache):
(WebCore::DOMWindowExtension::resumeFromPageCache):
(WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension): Deleted.
* page/DOMWindowExtension.h:
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::suspendForPageCache):
(WebCore::DOMWindowProperty::resumeFromPageCache):
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension): Deleted.
* page/DOMWindowProperty.h:
2018-10-10 Devin Rousso <drousso@apple.com>
Web Inspector: create special Network waterfall for media events
https://bugs.webkit.org/show_bug.cgi?id=189773
<rdar://problem/44626605>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/dom/didFireEvent.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::addEventListenersToNode): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::addEventListenersToNodeImpl): Added.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::EventFiredCallback): Added.
(WebCore::EventFiredCallback::create): Added.
(WebCore::EventFiredCallback::operator==): Added.
(WebCore::EventFiredCallback::handleEvent): Added.
(WebCore::EventFiredCallback::EventFiredCallback): Added.
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::addEventListenersToNode): Added.
2018-10-10 Daniel Bates <dabates@apple.com>
[iOS] Cleanup -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:]
https://bugs.webkit.org/show_bug.cgi?id=190402
Reviewed by Anders Carlsson.
Unindent case statements. Remove use of default case statements with body ASSERT_NOT_REACHED()
to catch the cases of a missing enumerator. By omitting the default case statement we turn
such a scenario into a compile-time error instead of handling it as a runtime error.
* platform/ios/wak/WAKView.mm:
(-[WAKView _selfHandleEvent:]):
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow sendEventSynchronously:]):
2018-10-05 Ryosuke Niwa <rniwa@webkit.org>
Rename MarkupAccumulator::appendStartTag, appendElement, etc... for clarity
https://bugs.webkit.org/show_bug.cgi?id=190308
Reviewed by Darin Adler.
Renamed appendStartTag and appendEndTag to startAppendingNode and endAppendingNode since serialize any node,
not just elements which produce start and end tags.
Renamed appendElement and appendEndElement to appendStartTag and appendEndTag since that's what they do.
* editing/MarkupAccumulator.cpp:
(WebCore::elementCannotHaveEndTag): Made this a static local function.
(WebCore::shouldSelfClose): Ditto.
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::startAppendingNode): Renamed from appendStartTag.
(WebCore::MarkupAccumulator::endAppendingNode): Renamed from appendEndElement and merged appendEndMarkup here.
(WebCore::MarkupAccumulator::appendTextSubstring): Deleted. This was only used by StyledMarkupAccumulator.
(WebCore::MarkupAccumulator::appendStringView): Added.
(WebCore::MarkupAccumulator::appendStartTag): Renamed from appendElement.
(WebCore::MarkupAccumulator::appendCloseTag):
(WebCore::MarkupAccumulator::appendNonElementNode): Renamed from appendStartMarkup. No longer serializes
an element. StyledMarkupAccumulator had a check before calling this function already so this clarifies
the purpose of this function.
(WebCore::MarkupAccumulator::appendElement): Deleted.
(WebCore::MarkupAccumulator::appendEndMarkup): Deleted. Merged into appendEndTag.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::appendNodeEnd): Renamed from appendEndTag.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::wrapWithNode):
(WebCore::StyledMarkupAccumulator::appendStartTag): Renamed from appendElement.
(WebCore::StyledMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Use String::substring directly instead of
going through appendTextSubstring which has been deleted.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Renamed from appendElement.
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
2018-10-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix the build with current SDKs.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents):
2018-10-10 Brent Fulgham <bfulgham@apple.com>
Only report the supported WebGL version
https://bugs.webkit.org/show_bug.cgi?id=190434
<rdar://problem/45024677>
Reviewed by Dean Jackson.
Tested by fast/canvas/webgl/gl-getstring.html
Revise getParameter(gl.VERSION) to only return the WebGL version without the hardware and
driver-specific details available through the low-level OpenGL driver interface. These details
are not needed for WebGL use and expose information about the user's system that we do not
need to share.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Unreviewed, add missing headers for inline functions
https://bugs.webkit.org/show_bug.cgi?id=190429
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2018-10-10 Tim Horton <timothy_horton@apple.com>
Share more WKShareSheet code between macOS and iOS, and fix a few bugs
https://bugs.webkit.org/show_bug.cgi?id=190420
Reviewed by Simon Fraser.
Test: fast/web-share/share-with-no-url.html
* page/Navigator.cpp:
(WebCore::Navigator::share):
* page/ShareData.h:
Make 'url' an optional field on ShareDataWithParsedURL, and don't
reject the share() promise if the URL is totally empty (as opposed to invalid).
2018-10-10 Devin Rousso <drousso@apple.com>
Web Inspector: notify the frontend when a canvas has started recording via console.record
https://bugs.webkit.org/show_bug.cgi?id=190306
Reviewed by Brian Burg.
Updated existing tests: LayoutTests/inspector/canvas/recording-2d.html
LayoutTests/inspector/canvas/recording-bitmaprenderer.html
LayoutTests/inspector/canvas/recording-webgl-snapshots.html
LayoutTests/inspector/canvas/recording-webgl.html
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
* inspector/InspectorCanvas.h:
Default `singleFrame` to false to better match the default behaviour of other `console`
functions (`profile` doesn't stop until `profileEnd` is called, so the same should be true
of `record` and `recordEnd`).
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
https://bugs.webkit.org/show_bug.cgi?id=190429
Reviewed by Saam Barati.
Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::cachedKeyForKeyID const):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext):
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::AudioBuffer):
(WebCore::AudioBuffer::getChannelData):
* Modules/webvr/VREyeParameters.cpp:
(WebCore::VREyeParameters::offset const):
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
* Modules/webvr/VRPose.cpp:
(WebCore::optionalFloat3ToJSCArray):
(WebCore::VRPose::position const):
(WebCore::VRPose::orientation const):
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::sittingToStandingTransform const):
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferView):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::algorithm const):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::algorithm const):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::toFloat32Array const):
(WebCore::DOMMatrixReadOnly::toFloat64Array const):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* dom/TextEncoder.cpp:
(WebCore::TextEncoder::encode const):
* html/ImageData.cpp:
(WebCore::ImageData::ImageData):
* html/ImageData.h:
(WebCore::ImageData::data const):
(): Deleted.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
(WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
(WebCore::CDMSessionAVContentKeySession::releaseKeys):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::generateKeyRequest):
(WebCore::CDMSessionAVStreamSession::releaseKeys):
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData const):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::unmultipliedResult):
(WebCore::FilterEffect::premultipliedResult):
(WebCore::FilterEffect::copyUnmultipliedResult):
(WebCore::FilterEffect::copyPremultipliedResult):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData const):
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext):
* platform/mock/mediasource/MockBox.cpp:
(WebCore::MockBox::peekType):
(WebCore::MockBox::peekLength):
(WebCore::MockTrackBox::MockTrackBox):
(WebCore::MockInitializationBox::MockInitializationBox):
(WebCore::MockSampleBox::MockSampleBox):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* testing/LegacyMockCDM.cpp:
(WebCore::initDataPrefix):
(WebCore::keyPrefix):
(WebCore::keyRequest):
2018-10-10 Daniel Bates <dabates@apple.com>
[iOS] Compare input string to UIKeyInput constants using string comparison instead of pointer comparison
https://bugs.webkit.org/show_bug.cgi?id=190432
Reviewed by Tim Horton.
Pointer comparision is brittle. We should be more forgiving and perform string comparision
of an input string to a UIKeyInput constant.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping):
2018-10-10 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236802.
Working on getting the HTML spec updated instead
(https://github.com/whatwg/html/pull/4079)
Reverted changeset:
"Passing noopener=NOOPENER to window.open() should cause the
new window to not have an opener"
https://bugs.webkit.org/show_bug.cgi?id=190251
https://trac.webkit.org/changeset/236802
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
XMLHttpRequest should use reportExtraMemoryAllocated/reportExtraMemoryVisited instead of deprecatedReportExtraMemory
https://bugs.webkit.org/show_bug.cgi?id=190279
Reviewed by Ryosuke Niwa.
This patch switches deprecatedReportExtraMemory to reportExtraMemoryAllocated/reportExtraMemoryVisited
in XMLHttpRequest. We report extra memory allocation when the readyState becomes DONE. And memoryCost
function returns the memory cost which is based on the readyState and m_responseBuilder.
We annotate XMLHttpRequest with ReportExtraMemoryCost to use reportExtraMemoryVisited automatically with
memoryCost() function.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::changeState):
(WebCore::XMLHttpRequest::abort):
(WebCore::XMLHttpRequest::internalAbort):
(WebCore::XMLHttpRequest::networkErrorTimerFired):
(WebCore::XMLHttpRequest::memoryCost const):
(WebCore::XMLHttpRequest::didFinishLoading):
(WebCore::XMLHttpRequest::didReachTimeout):
(WebCore::XMLHttpRequest::dropProtection): Deleted.
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:
2018-10-09 Antoine Quint <graouts@apple.com>
Remove the frames() timing function
https://bugs.webkit.org/show_bug.cgi?id=190034
<rdar://problem/44827544>
Reviewed by Dean Jackson.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSFramesTimingFunctionValue::customCSSText const): Deleted.
(WebCore::CSSFramesTimingFunctionValue::equals const): Deleted.
* css/CSSTimingFunctionValue.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isStepsTimingFunctionValue const):
(WebCore::CSSValue::isFramesTimingFunctionValue const): Deleted.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeFrames): Deleted.
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
(WebCore::TimingFunction::createFromCSSValue):
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::isStepsTimingFunction const):
(WebCore::TimingFunction::isFramesTimingFunction const): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
(WebCore::animationHasFramesTimingFunction): Deleted.
2018-10-09 Devin Rousso <drousso@apple.com>
Web Inspector: show redirect requests in Network and Timelines tabs
https://bugs.webkit.org/show_bug.cgi?id=150005
<rdar://problem/5378164>
Reviewed by Joseph Pecoraro.
Updated existing test http/tests/inspector/network/resource-timing.html.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::didFinishLoading):
Add missing fields for `Network.types.ResourceTiming`.
2018-10-09 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
https://bugs.webkit.org/show_bug.cgi?id=190411
Reviewed by Simon Fraser.
Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html
When changing the attributes of the SVGLangSpace, we should invalidate
the renderer of the SVGGeometryElement descendant only. Renderer of other
elements, like SVGStopElement, should not be invalidated because they do
not have geometry and they can be used as resources for drawing another
SVGGeometryElement.
* svg/SVGElement.h:
(WebCore::SVGElement::isSVGGeometryElement const):
* svg/SVGGeometryElement.h:
(isType):
* svg/SVGLangSpace.cpp:
(WebCore::SVGLangSpace::svgAttributeChanged):
2018-10-09 Chris Dumez <cdumez@apple.com>
Anchor target should be ignored on activation when the download attribute is set
https://bugs.webkit.org/show_bug.cgi?id=190408
Reviewed by Geoffrey Garen.
Anchor target should be ignored on activation when the download attribute is set:
- https://html.spec.whatwg.org/#the-a-element:downloading-hyperlinks-2
When the download attribute is set, we should use the "download the hyperlink" algorithm [1]
instead of the "follow the hyperlink" [2] algorithm.
Note that the "download the hyperlink" triggers a download and ignores the target attribute
entirely.
This is important as an anchor element with target=_blank and the download attribute set may
fail because of Safari's popup blocker if we do not disregard the anchor target.
[1] https://html.spec.whatwg.org/#downloading-hyperlinks
[2] https://html.spec.whatwg.org/#following-hyperlinks-2
Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-base-target-popup-not-allowed.html
fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-popup-not-allowed.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
2018-10-09 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Complex text crashes with harfbuzz 1.8.8
https://bugs.webkit.org/show_bug.cgi?id=190409
Reviewed by Žan Doberšek.
We discovered that harfbuzz 1.8.8 breaks WebKit by changing the ownership semantics of
hb_icu_get_unicode_funcs() from (transfer full) to (transfer none). Our code was actually
expecting (transfer none), so it's not immediately clear to me why it's crashing now, but
doesn't matter as Behdad recommends removing this line of code because it hasn't been
been needed for many years.
This should be covered by all our complex text tests if the bots were upgraded to the newer
harfbuzz.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-10-09 Daniel Bates <dabates@apple.com>
[iOS] Cleanup EventHandler::passSubframeEventToSubframe()
https://bugs.webkit.org/show_bug.cgi?id=190390
Reviewed by Wenson Hsieh.
Unindent case statements in switch block and use more auto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::passSubframeEventToSubframe):
2018-10-09 Daniel Bates <dabates@apple.com>
Cleanup WebEvent.mm
https://bugs.webkit.org/show_bug.cgi?id=190391
Reviewed by Wenson Hsieh.
Unindent case statements in switch blocks.
* platform/ios/WebEvent.mm:
(-[WebEvent _typeDescription]):
(-[WebEvent _modiferFlagsDescription]):
(-[WebEvent _touchPhaseDescription:]):
(-[WebEvent _eventDescription]):
2018-10-09 Oriol Brufau <obrufau@igalia.com>
Resolve inset properties to computed style when there is overconstraintment
https://bugs.webkit.org/show_bug.cgi?id=188711
Reviewed by Manuel Rego Casasnovas.
This patch makes WebKit behave closer to Blink. Specifically,
- In overconstrained relative or absolute positioning, inset properties resolve
to the computed value (absolutizing percentages) instead of to the used value.
- In fixed positioning, the resolved value of non-'auto' values is no longer
increased by the border of the containg block.
This patch can slighlty alter the resolved value if it's a long decimal number.
Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-absolute.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-fixed.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-nobox.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-relative.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-static.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::positionOffsetValue):
* rendering/RenderBox.h:
2018-10-09 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import CTAP HID message and packet structure from Chromium
https://bugs.webkit.org/show_bug.cgi?id=189289
<rdar://problem/44120310>
Reviewed by Brent Fulgham.
This patch imports CTAP HID message and packet structure:
https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-and-packet-structure
from Chromium. With this library, WebKit can now turn binaries into messages that CTAP devices could understand.
This patch contains the following Chromium files and modifies them to fit into WebKit:
https://cs.chromium.org/chromium/src/device/fido/fido_constants.cc?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/fido_constants.h?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.cc?l=1&rcl=387f3725de2842e0e6b7175a9b2ed472b0cf781a
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message_unittest.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
Covered by API tests.
* Modules/webauthn/fido/FidoConstants.cpp: Added.
(fido::isFidoHidDeviceCommand):
* Modules/webauthn/fido/FidoConstants.h: Added.
* Modules/webauthn/fido/FidoHidMessage.cpp: Added.
(fido::FidoHidMessage::create):
(fido::FidoHidMessage::createFromSerializedData):
(fido::FidoHidMessage::messageComplete const):
(fido::FidoHidMessage::getMessagePayload const):
(fido::FidoHidMessage::popNextPacket):
(fido::FidoHidMessage::addContinuationPacket):
(fido::FidoHidMessage::numPackets const):
(fido::FidoHidMessage::FidoHidMessage):
* Modules/webauthn/fido/FidoHidMessage.h: Added.
* Modules/webauthn/fido/FidoHidPacket.cpp: Added.
(fido::FidoHidPacket::FidoHidPacket):
(fido::FidoHidInitPacket::createFromSerializedData):
(fido::FidoHidInitPacket::FidoHidInitPacket):
(fido::FidoHidInitPacket::getSerializedData const):
(fido::FidoHidContinuationPacket::createFromSerializedData):
(fido::FidoHidContinuationPacket::FidoHidContinuationPacket):
(fido::FidoHidContinuationPacket::getSerializedData const):
* Modules/webauthn/fido/FidoHidPacket.h: Added.
* Modules/webauthn/fido/FidoParsingUtils.cpp: Added.
(fido::getInitPacketData):
(fido::getContinuationPacketData):
* Modules/webauthn/fido/FidoParsingUtils.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-10-09 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[CoordGraphics] Remove the 'previous backing store' logic
https://bugs.webkit.org/show_bug.cgi?id=188838
Reviewed by Žan Doberšek.
Remove previousBackingStore from LayerState, since it's not needed anymore.
When there is scale adjustment, we now simply discard mainBackingStore and
recreate a new one.
No new tests required.
* platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
2018-10-09 Antti Koivisto <antti@apple.com>
[PSON] Prewarm system UI font
https://bugs.webkit.org/show_bug.cgi?id=190397
Reviewed by Geoffrey Garen.
Cache system UI font fallbacks. Almost every web process needs these.
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::prewarmGlobally):
2018-10-09 Chris Dumez <cdumez@apple.com>
REGRESSION (Safari 12): Download of Blob URL fails
https://bugs.webkit.org/show_bug.cgi?id=190351
<rdar://problem/45091181>
Reviewed by Geoffrey Garen.
When using both the download attribute and target="_blank" on an anchor element, we would
mistakenly drop the download attribute after the "new window" policy decision has been made.
As a result, we would try to load the blob instead of downloading it.
Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2018-10-09 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] r236735 has some dead ASSERTs that need to be moved
https://bugs.webkit.org/show_bug.cgi?id=190394
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::createOptionalParserForFormat):
2018-10-09 Chris Dumez <cdumez@apple.com>
Have DOMWindow get its frame from its document
https://bugs.webkit.org/show_bug.cgi?id=190389
Reviewed by Geoff Garen.
Have DOMWindow get its frame from its document instead of having its own m_frame which can potentially
be out-of-sync.
* dom/Document.cpp:
(WebCore::Document::frameDestroyed):
(WebCore::Document::willDetachPage):
(WebCore::Document::attachToCachedFrame):
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
(WebCore::ContextDestructionObserver):
(WebCore::DOMWindow::didSecureTransitionTo):
(WebCore::DOMWindow::frameDestroyed):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::reconnectDOMWindowProperties):
(WebCore::DOMWindow::isCurrentlyDisplayedInFrame const):
(WebCore::DOMWindow::collectMatchingElementsInFlatTree):
(WebCore::DOMWindow::matchingElementInFlatTree):
(WebCore::DOMWindow::orientation const):
(WebCore::DOMWindow::console const):
(WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
(WebCore::DOMWindow::webkitNamespace):
(WebCore::DOMWindow::postMessage):
(WebCore::DOMWindow::postMessageTimerFired):
(WebCore::DOMWindow::frameElement const):
(WebCore::DOMWindow::focus):
(WebCore::DOMWindow::blur):
(WebCore::DOMWindow::close):
(WebCore::DOMWindow::print):
(WebCore::DOMWindow::stop):
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirm):
(WebCore::DOMWindow::prompt):
(WebCore::DOMWindow::find const):
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):
(WebCore::DOMWindow::innerHeight const):
(WebCore::DOMWindow::innerWidth const):
(WebCore::DOMWindow::screenX const):
(WebCore::DOMWindow::screenY const):
(WebCore::DOMWindow::scrollX const):
(WebCore::DOMWindow::scrollY const):
(WebCore::DOMWindow::closed const):
(WebCore::DOMWindow::length const):
(WebCore::DOMWindow::name const):
(WebCore::DOMWindow::setName):
(WebCore::DOMWindow::setStatus):
(WebCore::DOMWindow::setDefaultStatus):
(WebCore::DOMWindow::self const):
(WebCore::DOMWindow::opener const):
(WebCore::DOMWindow::disownOpener):
(WebCore::DOMWindow::parent const):
(WebCore::DOMWindow::top const):
(WebCore::DOMWindow::getMatchedCSSRules const):
(WebCore::DOMWindow::devicePixelRatio const):
(WebCore::DOMWindow::scrollBy const):
(WebCore::DOMWindow::scrollTo const):
(WebCore::DOMWindow::allowedToChangeWindowGeometry const):
(WebCore::DOMWindow::moveBy const):
(WebCore::DOMWindow::moveTo const):
(WebCore::DOMWindow::resizeBy const):
(WebCore::DOMWindow::resizeTo const):
(WebCore::DOMWindow::clearTimeout):
(WebCore::DOMWindow::isSameSecurityOriginAsMainFrame const):
(WebCore::DOMWindow::finishedLoading):
(WebCore::DOMWindow::setLocation):
(WebCore::DOMWindow::open):
(WebCore::DOMWindow::showModalDialog):
(WebCore::DOMWindow::frame const):
(WebCore::FrameDestructionObserver): Deleted.
(WebCore::DOMWindow::willDetachPage): Deleted.
(WebCore::DOMWindow::detachFromFrame): Deleted.
(WebCore::DOMWindow::attachToFrame): Deleted.
* page/DOMWindow.h:
2018-10-09 Jer Noble <jer.noble@apple.com>
ISOTrackEncryptionBox returns incorrect defaultKeyID
https://bugs.webkit.org/show_bug.cgi?id=190368
Reviewed by Eric Carlson.
Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/iso/ISOBox.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
(WebCore::ISOTrackEncryptionBox::parse):
* platform/graphics/iso/ISOTrackEncryptionBox.h:
2018-10-09 Youenn Fablet <youenn@apple.com>
Add support for IceCandidate stats
https://bugs.webkit.org/show_bug.cgi?id=190329
Reviewed by Eric Carlson.
Convert IceCandidate stats gathered by libwebrtc.
Since networkType might be sensitive information, we currently do not expose it.
We do not expose address either if it is a host or prflx candidate.
Test: webrtc/candidate-stats.html
* Modules/mediastream/RTCStatsReport.h:
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::iceCandidateState):
(WebCore::fillRTCIceCandidateStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2018-10-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Stealing cross-origin video pixel with HLS
https://bugs.webkit.org/show_bug.cgi?id=190003
Reviewed by Xabier Rodriguez-Calvar.
Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH,
SmoothStreaming) fragments as tainted if their origin differs from
the manifest SecurityOrigin. SecurityOrigins are stored in the
CachedResourceStreamingClient implemented in the internal
GStreamer HTTP(S) source element.
The implementation is not ideal yet because the fragments download
is performed by the WebProcess, until bug 189967 is fixed. When
this bug is fixed, the m_hasTaintedOrigin member variable should
be removed and all checks be done unconditionally to the
webkithttpsrc element which will manage the download of the
manifests and fragments.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the
fragment URL from the adaptivedemux stats message and check if its
origin is tainted.
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
Initial implementation by checking the m_hasTaintedOrigin member
variable value.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::responseReceived): Store the
resource origin internally so it can be checked later on by
webKitSrtcWouldTaintOrigin().
(webKitSrcWouldTaintOrigin): Check given origin against cached
origins. This implementation is similar to Cocoa's
WebCoreNSURLSession implementation.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2018-10-09 Antti Koivisto <antti@apple.com>
Prewarm FontDatabase on process swap
https://bugs.webkit.org/show_bug.cgi?id=190312
Reviewed by Chris Dumez.
Implement basic prewarming of FontDatabase. When the domain of the first page load on
a new process is known we pass the list of font families previous used by that domain to the
process. This is used to prewarm CoreText font database. Initialization (which involves lots of
blocking IPC) happens outside the main thread so the fonts are ready to use when needed.
* WebCore.xcodeproj/project.pbxproj:
* page/PrewarmInformation.h: Added.
(WebCore::PrewarmInformation::encode const):
(WebCore::PrewarmInformation::decode):
Add data structure for prewarm information with encode/decode support.
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::collectPrewarmInformation):
(WebCore::ProcessWarming::prewarmWithInformation):
Prewarming interface to be used from WebKit.
* page/ProcessWarming.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::collectPrewarmInformation const):
(WebCore::FontCache::prewarm):
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::FontDatabase::clear):
Add mutex for thread safe access.
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::collectPrewarmInformation const):
Collect font families seen by this process.
(WebCore::FontCache::prewarm):
Prewarm FontDatabase in a dispatch queue.
2018-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WK2] Add support for text alignment and text lists in font attributes
https://bugs.webkit.org/show_bug.cgi?id=190342
<rdar://problem/44767118>
Reviewed by Tim Horton.
Adds support for computing and encoding information about text alignment and enclosing list elements in the font
attributes dictionary, exposed to the UI delegate on Cocoa platforms. This is exposed through NSParagraphStyle,
which contains properties for both `NSTextAlignment` and an array of enclosing `NSTextList` objects.
Test: FontAttributes.NestedTextListsWithHorizontalAlignment
FontAttributes.FontAttributesAfterChangingSelection
* editing/Editor.cpp:
(WebCore::editableTextListsAtPositionInDescendingOrder):
Add a helper function to ascend the DOM, starting at the given position, in search of enclosing list elements.
For each enclosing list element we find within the scope of the editable root, we create a `TextList`
representing the list element.
(WebCore::Editor::fontAttributesAtSelectionStart const):
Compute and set enclosing text lists and text alignment. For text alignment, we convert the initial text-align
value, `start`, to NSTextAlignmentNatural (the default text alignment type on Cocoa platforms); other values
then map to Left, Right, Center, and Justified as expected (taking direction into account).
* editing/FontAttributes.h:
(WebCore::TextList::encode const):
(WebCore::TextList::decode):
Introduce TextList, a platform-agnostic representation of an unordered or ordered list. On Cocoa, this can be
used to construct a corresponding NSTextList.
* editing/cocoa/FontAttributesCocoa.mm:
(WebCore::cocoaTextListMarkerName):
Attempt to map a WebCore list style type to a `NSTextListMarker*` constant. While most of the Cocoa marker
formats have a corresponding web-exposed list style type, many web-exposed types have no Cocoa equivalent; as
such, fall back to default marker formats: "{disc}" for unordered lists and "{decimal}" for ordered lists.
(WebCore::TextList::createTextList const):
(WebCore::FontAttributes::createDictionary const):
Include an NSParagraphStyle in the dictionary of font attributes that includes information about text alignment
and enclosing text lists (per Cocoa convention, in order from outermost list to innermost list).
2018-10-08 Justin Fan <justin_fan@apple.com>
WebGPU: Rename old WebGPU prototype to WebMetal
https://bugs.webkit.org/show_bug.cgi?id=190325
<rdar://problem/44990443>
Reviewed by Dean Jackson.
Existing WebGPU tests also renamed to reflect WebGPU -> WebMetal change.
Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSWebMetalRenderingContextCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderingContextCustom.cpp.
(WebCore::JSWebMetalRenderingContext::visitAdditionalChildren):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebMetalType):
(WebCore::HTMLCanvasElement::createContextWebMetal):
(WebCore::HTMLCanvasElement::getContextWebMetal):
(WebCore::HTMLCanvasElement::isWebGPUType): Deleted.
(WebCore::HTMLCanvasElement::createContextWebGPU): Deleted.
(WebCore::HTMLCanvasElement::getContextWebGPU): Deleted.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebMetal const):
(WebCore::CanvasRenderingContext::isWebGPU const): Deleted.
* html/canvas/WebGPURenderingContext.cpp: Removed.
* html/canvas/WebMetalBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.cpp.
(WebCore::WebMetalBuffer::create):
(WebCore::WebMetalBuffer::WebMetalBuffer):
* html/canvas/WebMetalBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.h.
* html/canvas/WebMetalBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.idl.
* html/canvas/WebMetalCommandBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp.
(WebCore::WebMetalCommandBuffer::create):
(WebCore::WebMetalCommandBuffer::WebMetalCommandBuffer):
(WebCore::WebMetalCommandBuffer::~WebMetalCommandBuffer):
(WebCore::WebMetalCommandBuffer::commit):
(WebCore::WebMetalCommandBuffer::presentDrawable):
(WebCore::WebMetalCommandBuffer::createRenderCommandEncoderWithDescriptor):
(WebCore::WebMetalCommandBuffer::createComputeCommandEncoder):
(WebCore::WebMetalCommandBuffer::completed):
* html/canvas/WebMetalCommandBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
* html/canvas/WebMetalCommandBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebMetalCommandQueue.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.cpp.
(WebCore::WebMetalCommandQueue::create):
(WebCore::WebMetalCommandQueue::WebMetalCommandQueue):
(WebCore::WebMetalCommandQueue::createCommandBuffer):
* html/canvas/WebMetalCommandQueue.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.h.
* html/canvas/WebMetalCommandQueue.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.idl.
* html/canvas/WebMetalComputeCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.cpp.
(WebCore::GPUSizeMake):
(WebCore::WebMetalComputeCommandEncoder::create):
(WebCore::WebMetalComputeCommandEncoder::WebMetalComputeCommandEncoder):
(WebCore::WebMetalComputeCommandEncoder::setComputePipelineState):
(WebCore::WebMetalComputeCommandEncoder::setBuffer):
(WebCore::WebMetalComputeCommandEncoder::dispatch):
(WebCore::WebMetalComputeCommandEncoder::endEncoding):
* html/canvas/WebMetalComputeCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.h.
* html/canvas/WebMetalComputeCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.idl.
* html/canvas/WebMetalComputePipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.cpp.
(WebCore::WebMetalComputePipelineState::create):
(WebCore::WebMetalComputePipelineState::WebMetalComputePipelineState):
* html/canvas/WebMetalComputePipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.h.
* html/canvas/WebMetalComputePipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.idl.
* html/canvas/WebMetalDepthStencilDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.cpp.
(WebCore::WebMetalDepthStencilDescriptor::create):
(WebCore::WebMetalDepthStencilDescriptor::depthWriteEnabled const):
(WebCore::WebMetalDepthStencilDescriptor::setDepthWriteEnabled):
(WebCore::WebMetalDepthStencilDescriptor::depthCompareFunction const):
(WebCore::WebMetalDepthStencilDescriptor::setDepthCompareFunction):
* html/canvas/WebMetalDepthStencilDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.h.
* html/canvas/WebMetalDepthStencilDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.idl.
* html/canvas/WebMetalDepthStencilState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.cpp.
(WebCore::WebMetalDepthStencilState::create):
(WebCore::WebMetalDepthStencilState::WebMetalDepthStencilState):
(WebCore::WebMetalDepthStencilState::label const):
(WebCore::WebMetalDepthStencilState::setLabel):
* html/canvas/WebMetalDepthStencilState.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.h.
* html/canvas/WebMetalDepthStencilState.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.idl.
* html/canvas/WebMetalDrawable.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.cpp.
(WebCore::WebMetalDrawable::create):
(WebCore::WebMetalDrawable::WebMetalDrawable):
* html/canvas/WebMetalDrawable.h: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.h.
(WebCore::WebMetalDrawable::texture):
* html/canvas/WebMetalDrawable.idl: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.idl.
* html/canvas/WebMetalEnums.cpp: Renamed from Source/WebCore/html/canvas/WebGPUEnums.cpp.
(WebCore::toWebMetalCompareFunction):
(WebCore::web3DCompareFunctionName):
(WebCore::toGPUCompareFunction):
* html/canvas/WebMetalEnums.h: Renamed from Source/WebCore/html/canvas/WebGPUEnums.h.
* html/canvas/WebMetalEnums.idl: Renamed from Source/WebCore/html/canvas/WebGPUEnums.idl.
* html/canvas/WebMetalFunction.cpp: Renamed from Source/WebCore/html/canvas/WebGPUFunction.cpp.
(WebCore::WebMetalFunction::create):
(WebCore::WebMetalFunction::WebMetalFunction):
* html/canvas/WebMetalFunction.h: Renamed from Source/WebCore/html/canvas/WebGPUFunction.h.
* html/canvas/WebMetalFunction.idl: Renamed from Source/WebCore/html/canvas/WebGPUFunction.idl.
* html/canvas/WebMetalLibrary.cpp: Renamed from Source/WebCore/html/canvas/WebGPULibrary.cpp.
(WebCore::WebMetalLibrary::create):
(WebCore::WebMetalLibrary::WebMetalLibrary):
(WebCore::WebMetalLibrary::functionNames const):
(WebCore::WebMetalLibrary::functionWithName const):
* html/canvas/WebMetalLibrary.h: Renamed from Source/WebCore/html/canvas/WebGPULibrary.h.
* html/canvas/WebMetalLibrary.idl: Renamed from Source/WebCore/html/canvas/WebGPULibrary.idl.
* html/canvas/WebMetalRenderCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.cpp.
(WebCore::WebMetalRenderCommandEncoder::create):
(WebCore::WebMetalRenderCommandEncoder::WebMetalRenderCommandEncoder):
(WebCore::WebMetalRenderCommandEncoder::setRenderPipelineState):
(WebCore::WebMetalRenderCommandEncoder::setDepthStencilState):
(WebCore::WebMetalRenderCommandEncoder::setVertexBuffer):
(WebCore::WebMetalRenderCommandEncoder::setFragmentBuffer):
(WebCore::WebMetalRenderCommandEncoder::drawPrimitives):
(WebCore::WebMetalRenderCommandEncoder::endEncoding):
* html/canvas/WebMetalRenderCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.h.
* html/canvas/WebMetalRenderCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.idl.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPassAttachmentDescriptor::WebMetalRenderPassAttachmentDescriptor):
(WebCore::WebMetalRenderPassAttachmentDescriptor::loadAction const):
(WebCore::WebMetalRenderPassAttachmentDescriptor::setLoadAction):
(WebCore::WebMetalRenderPassAttachmentDescriptor::storeAction const):
(WebCore::WebMetalRenderPassAttachmentDescriptor::setStoreAction):
(WebCore::WebMetalRenderPassAttachmentDescriptor::texture const):
(WebCore::WebMetalRenderPassAttachmentDescriptor::setTexture):
* html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::create):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::WebMetalRenderPassColorAttachmentDescriptor):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::descriptor const):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::clearColor const):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::setClearColor):
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::create):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::WebMetalRenderPassDepthAttachmentDescriptor):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::clearDepth const):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::setClearDepth):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::descriptor const):
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPassDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.cpp.
(WebCore::WebMetalRenderPassDescriptor::create):
(WebCore::WebMetalRenderPassDescriptor::depthAttachment):
(WebCore::WebMetalRenderPassDescriptor::colorAttachments):
* html/canvas/WebMetalRenderPassDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.h.
* html/canvas/WebMetalRenderPassDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.idl.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::create):
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::WebMetalRenderPipelineColorAttachmentDescriptor):
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::pixelFormat const):
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::setPixelFormat):
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.cpp.
(WebCore::WebMetalRenderPipelineDescriptor::create):
(WebCore::WebMetalRenderPipelineDescriptor::vertexFunction const):
(WebCore::WebMetalRenderPipelineDescriptor::setVertexFunction):
(WebCore::WebMetalRenderPipelineDescriptor::fragmentFunction const):
(WebCore::WebMetalRenderPipelineDescriptor::setFragmentFunction):
(WebCore::WebMetalRenderPipelineDescriptor::colorAttachments):
(WebCore::WebMetalRenderPipelineDescriptor::depthAttachmentPixelFormat const):
(WebCore::WebMetalRenderPipelineDescriptor::setDepthAttachmentPixelFormat):
(WebCore::WebMetalRenderPipelineDescriptor::reset):
* html/canvas/WebMetalRenderPipelineDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.h.
* html/canvas/WebMetalRenderPipelineDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.idl.
* html/canvas/WebMetalRenderPipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.cpp.
(WebCore::WebMetalRenderPipelineState::create):
(WebCore::WebMetalRenderPipelineState::WebMetalRenderPipelineState):
(WebCore::WebMetalRenderPipelineState::label const):
(WebCore::WebMetalRenderPipelineState::setLabel):
* html/canvas/WebMetalRenderPipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.h.
* html/canvas/WebMetalRenderPipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.idl.
* html/canvas/WebMetalRenderingContext.cpp: Added.
(WebCore::WebMetalRenderingContext::create):
(WebCore::WebMetalRenderingContext::WebMetalRenderingContext):
(WebCore::WebMetalRenderingContext::canvas const):
(WebCore::WebMetalRenderingContext::initializeNewContext):
(WebCore::WebMetalRenderingContext::clampedCanvasSize const):
(WebCore::WebMetalRenderingContext::hasPendingActivity const):
(WebCore::WebMetalRenderingContext::stop):
(WebCore::WebMetalRenderingContext::activeDOMObjectName const):
(WebCore::WebMetalRenderingContext::canSuspendForDocumentSuspension const):
(WebCore::WebMetalRenderingContext::platformLayer const):
(WebCore::WebMetalRenderingContext::markLayerComposited):
(WebCore::WebMetalRenderingContext::reshape):
(WebCore::WebMetalRenderingContext::createLibrary):
(WebCore::WebMetalRenderingContext::createRenderPipelineState):
(WebCore::WebMetalRenderingContext::createDepthStencilState):
(WebCore::WebMetalRenderingContext::createComputePipelineState):
(WebCore::WebMetalRenderingContext::createCommandQueue):
(WebCore::WebMetalRenderingContext::nextDrawable):
(WebCore::WebMetalRenderingContext::createBuffer):
(WebCore::WebMetalRenderingContext::createTexture):
* html/canvas/WebMetalRenderingContext.h: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.h.
* html/canvas/WebMetalRenderingContext.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.idl.
* html/canvas/WebMetalSize.h: Renamed from Source/WebCore/html/canvas/WebGPUSize.h.
* html/canvas/WebMetalSize.idl: Renamed from Source/WebCore/html/canvas/WebGPUSize.idl.
* html/canvas/WebMetalTexture.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTexture.cpp.
(WebCore::WebMetalTexture::create):
(WebCore::WebMetalTexture::WebMetalTexture):
* html/canvas/WebMetalTexture.h: Renamed from Source/WebCore/html/canvas/WebGPUTexture.h.
* html/canvas/WebMetalTexture.idl: Renamed from Source/WebCore/html/canvas/WebGPUTexture.idl.
* html/canvas/WebMetalTextureDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.cpp.
(WebCore::WebMetalTextureDescriptor::create):
(WebCore::WebMetalTextureDescriptor::WebMetalTextureDescriptor):
(WebCore::WebMetalTextureDescriptor::width const):
(WebCore::WebMetalTextureDescriptor::setWidth):
(WebCore::WebMetalTextureDescriptor::height const):
(WebCore::WebMetalTextureDescriptor::setHeight):
(WebCore::WebMetalTextureDescriptor::sampleCount const):
(WebCore::WebMetalTextureDescriptor::setSampleCount):
(WebCore::WebMetalTextureDescriptor::textureType const):
(WebCore::WebMetalTextureDescriptor::setTextureType):
(WebCore::WebMetalTextureDescriptor::storageMode const):
(WebCore::WebMetalTextureDescriptor::setStorageMode):
(WebCore::WebMetalTextureDescriptor::usage const):
(WebCore::WebMetalTextureDescriptor::setUsage):
* html/canvas/WebMetalTextureDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.h.
* html/canvas/WebMetalTextureDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.idl.
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::contextAsScriptValue):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebMetalEnabled):
(WebCore::RuntimeEnabledFeatures::webMetalEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted.
* platform/Logging.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
* platform/graphics/cocoa/WebMetalLayer.h: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.h.
* platform/graphics/cocoa/WebMetalLayer.mm: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm.
(-[WebMetalLayer initWithGPUDevice:]):
* platform/graphics/gpu/GPUBuffer.cpp:
(WebCore::GPUBuffer::~GPUBuffer):
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUCommandBuffer.cpp:
(WebCore::GPUCommandBuffer::~GPUCommandBuffer):
* platform/graphics/gpu/GPUCommandBuffer.h:
* platform/graphics/gpu/GPUCommandQueue.cpp:
(WebCore::GPUCommandQueue::~GPUCommandQueue):
* platform/graphics/gpu/GPUCommandQueue.h:
* platform/graphics/gpu/GPUComputeCommandEncoder.cpp:
(WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
* platform/graphics/gpu/GPUComputeCommandEncoder.h:
* platform/graphics/gpu/GPUComputePipelineState.cpp:
(WebCore::GPUComputePipelineState::~GPUComputePipelineState):
* platform/graphics/gpu/GPUComputePipelineState.h:
* platform/graphics/gpu/GPUDepthStencilDescriptor.cpp:
(WebCore::GPUDepthStencilDescriptor::~GPUDepthStencilDescriptor):
* platform/graphics/gpu/GPUDepthStencilDescriptor.h:
* platform/graphics/gpu/GPUDepthStencilState.cpp:
(WebCore::GPUDepthStencilState::~GPUDepthStencilState):
* platform/graphics/gpu/GPUDepthStencilState.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::~GPUDevice):
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::layer const):
* platform/graphics/gpu/GPUDrawable.cpp:
(WebCore::GPUDrawable::~GPUDrawable):
* platform/graphics/gpu/GPUDrawable.h:
* platform/graphics/gpu/GPUEnums.h:
* platform/graphics/gpu/GPUFunction.cpp:
(WebCore::GPUFunction::~GPUFunction):
* platform/graphics/gpu/GPUFunction.h:
* platform/graphics/gpu/GPULibrary.cpp:
(WebCore::GPULibrary::~GPULibrary):
* platform/graphics/gpu/GPULibrary.h:
* platform/graphics/gpu/GPURenderCommandEncoder.cpp:
(WebCore::GPURenderCommandEncoder::~GPURenderCommandEncoder):
* platform/graphics/gpu/GPURenderCommandEncoder.h:
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp:
(WebCore::GPURenderPassAttachmentDescriptor::~GPURenderPassAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp:
(WebCore::GPURenderPassColorAttachmentDescriptor::~GPURenderPassColorAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp:
(WebCore::GPURenderPassDepthAttachmentDescriptor::~GPURenderPassDepthAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPassDescriptor.cpp:
(WebCore::GPURenderPassDescriptor::~GPURenderPassDescriptor):
* platform/graphics/gpu/GPURenderPassDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp:
(WebCore::GPURenderPipelineColorAttachmentDescriptor::~GPURenderPipelineColorAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineDescriptor.cpp:
(WebCore::GPURenderPipelineDescriptor::~GPURenderPipelineDescriptor):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineState.cpp:
(WebCore::GPURenderPipelineState::~GPURenderPipelineState):
* platform/graphics/gpu/GPURenderPipelineState.h:
* platform/graphics/gpu/GPUSize.h:
* platform/graphics/gpu/GPUTexture.cpp:
(WebCore::GPUTexture::~GPUTexture):
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.cpp:
(WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/metal/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
* platform/graphics/metal/GPUCommandBufferMetal.mm:
* platform/graphics/metal/GPUCommandQueueMetal.mm:
* platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
* platform/graphics/metal/GPUComputePipelineStateMetal.mm:
(WebCore::GPUComputePipelineState::GPUComputePipelineState):
* platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
* platform/graphics/metal/GPUDepthStencilStateMetal.mm:
(WebCore::GPUDepthStencilState::setLabel const):
* platform/graphics/metal/GPUDeviceMetal.mm:
(WebCore::GPUDevice::reshape const):
* platform/graphics/metal/GPUDrawableMetal.mm:
(WebCore::GPUDrawable::release):
* platform/graphics/metal/GPUFunctionMetal.mm:
* platform/graphics/metal/GPULibraryMetal.mm:
(WebCore::GPULibrary::GPULibrary):
* platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
(WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder):
* platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPipelineStateMetal.mm:
(WebCore::GPURenderPipelineState::setLabel const):
* platform/graphics/metal/GPUTextureDescriptorMetal.mm:
* platform/graphics/metal/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebMetalEnabled):
(WebCore::InternalSettings::setWebGPUEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2018-10-08 Dean Jackson <dino@apple.com>
CrashTracer: backboardd at Recursion :: QuartzCore: CA::Render::Updater::prepare_sublayer0
https://bugs.webkit.org/show_bug.cgi?id=190376
<rdar://problem/44986520>
Reviewed by Tim Horton.
Very deep CoreAnimation layer trees can cause problems. Reduce our maximum
depth from 256 to 128.
Modified existing test: compositing/layer-creation/deep-tree.html
* platform/graphics/ca/GraphicsLayerCA.cpp: Cap the depth at 128.
2018-10-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236941.
https://bugs.webkit.org/show_bug.cgi?id=190374
Causing API test failures in new test (Requested by jernoble
on #webkit).
Reverted changeset:
"ISOTrackEncryptionBox returns incorrect defaultKeyID"
https://bugs.webkit.org/show_bug.cgi?id=190368
https://trac.webkit.org/changeset/236941
2018-10-08 Aditya Keerthi <akeerthi@apple.com>
Make <input type=color> a runtime enabled (on-by-default) feature
https://bugs.webkit.org/show_bug.cgi?id=189162
Reviewed by Wenson Hsieh and Tim Horton.
Enable the build-time flag INPUT_TYPE_COLOR by default and introduce a runtime-enabled feature for input type
color, also on by default.
Covered by rebaselining existing layout tests.
* Configurations/FeatureDefines.xcconfig:
* html/InputType.cpp:
(WebCore::createInputTypeFactoryMap):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const):
(WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled):
2018-10-08 Jer Noble <jer.noble@apple.com>
ISOTrackEncryptionBox returns incorrect defaultKeyID
https://bugs.webkit.org/show_bug.cgi?id=190368
Reviewed by Eric Carlson.
Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/iso/ISOBox.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
(WebCore::ISOTrackEncryptionBox::parse):
* platform/graphics/iso/ISOTrackEncryptionBox.h:
2018-10-08 Antti Koivisto <antti@apple.com>
Move SystemFontDatabase to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=190347
Reviewed by Chris Dumez.
Also rename it to SystemFontDatabaseCoreText as it is CoreText specific.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
Release SystemFontDatabaseCoreText directly from platform specific cleanup code.
(WebCore::platformReleaseMemory):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::invalidateCaches):
(WebCore::systemFontCascadeList):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue const): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal): Deleted.
(): Deleted.
(WebCore::SystemFontDatabase::singleton): Deleted.
(WebCore::SystemFontDatabase::systemFontCascadeList): Deleted.
(WebCore::SystemFontDatabase::clear): Deleted.
(WebCore::SystemFontDatabase::SystemFontDatabase): Deleted.
(WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): Deleted.
(WebCore::SystemFontDatabase::removeCascadeList): Deleted.
(WebCore::SystemFontDatabase::computeCascadeList): Deleted.
(WebCore::systemFontParameters): Deleted.
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Added.
(WebCore::SystemFontDatabaseCoreText::singleton):
(WebCore::SystemFontDatabaseCoreText::SystemFontDatabaseCoreText):
(WebCore::SystemFontDatabaseCoreText::systemFontCascadeList):
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
(WebCore::SystemFontDatabaseCoreText::removeCascadeList):
(WebCore::SystemFontDatabaseCoreText::computeCascadeList):
(WebCore::SystemFontDatabaseCoreText::systemFontParameters):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Added.
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParameters):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::isHashTableDeletedValue const):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::hash):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::equal):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Remove dead code: VideoFullscreenModel::isVisible()
https://bugs.webkit.org/show_bug.cgi?id=190356
Reviewed by Jon Lee.
No new tests because there is no behavior change.
Remove isVisible() since it is no longer used.
* platform/cocoa/VideoFullscreenModel.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::isVisible const): Deleted.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::isVisible const): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Remove dead code: resetMediaState.
https://bugs.webkit.org/show_bug.cgi?id=190355
Reviewed by Jon Lee.
No new tests because no behavior change.
Remove resetMediaState since it is no longer used.
* platform/cocoa/PlaybackSessionInterface.h:
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::resetMediaState): Deleted.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController resetMediaState]): Deleted.
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::resetMediaState): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel.
https://bugs.webkit.org/show_bug.cgi?id=190357
Reviewed by Jon Lee.
No new tests because no behavior change.
Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel.
* platform/cocoa/VideoFullscreenModel.h:
(): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::setVideoLayerGravity):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2018-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: group media network entries by the node that triggered the request
https://bugs.webkit.org/show_bug.cgi?id=189606
<rdar://problem/44438527>
Reviewed by Brian Burg.
Test: http/tests/inspector/network/resource-initiatorNode.html
Add extra arguments to functions that create `ResourceRequest` objects for media resources so
that `initiatorNodeIdentifier` can be set for WebInspector frontend to use for grouping.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::setDisplayMode):
* loader/FrameLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willLoadMediaElementURL):
Handles initial (e.g. DNT) resource requests.
* loader/ImageLoader.cpp:
(ImageLoader::updateFromElement):
Handles "poster" requests.
* loader/MediaResourceLoader.cpp:
(MediaResourceLoader::requestResource):
Handles byte-range requests.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::loadTimerFired):
* loader/TextTrackLoader.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* html/HTMLTrackElement.h:
Handles <track> (e.g. subtitle) requests.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::identifierForNode):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::identifierForNode):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::identifierForNodeImpl):
Allows callers to get a `DOM.nodeId` for the given `Node`, which is (in this patch) attached
to the `ResourceRequest` and later used by `InspectorNetworkAgent`.
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
(WebCore::InspectorNetworkAgent::buildInitiatorObject):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::initiatorNodeIdentifier const):
(WebCore::ResourceRequestBase::setInitiatorNodeIdentifier):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
Don't try to push the canvas' node to the frontend, as this will create a dangling node in
`InspectorDOMAgent` if the canvas' node is detached from the DOM.
2018-10-08 Andy Estes <aestes@apple.com>
[Payment Request] Requests should be aborted after details settle when the user cancels
https://bugs.webkit.org/show_bug.cgi?id=190333
Reviewed by Alex Christensen.
In Payment Request's "update a PaymentRequest's details" algorithm, user agents are expected
to disable the payment UI when PaymentRequest details are being updated by the merchant.
This is to prevent the user from accepting a payment before updated details are displayed.
Further, Payment Request's "user aborts the payment request" algorithm says that the
algorithm should be terminated prior to throwing an AbortError if the request is currently
being updated, and also that user agents SHOULD ensure this never occurs. This is based on
the assumption that payment UIs are disabled during details updates.
For Apple Pay, while it is true that a payment cannot be accepted by the user while details
are being updated by the merchant, the payment UI is not completely disabled. In particular,
the user is allowed to abort the payment while details are being updated. We need to honor
the user's request to abort without doing so in the middle of a details update.
This patch defers a user-initiated abort until after details are settled, at which point the
promise returned by show() is rejected with an AbortError. This behaves as if the details
update promise were rejected by the merchant.
Added a test case to http/tests/paymentrequest/payment-request-show-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::settleDetailsPromise):
(WebCore::PaymentRequest::whenDetailsSettled):
(WebCore::PaymentRequest::cancel):
* Modules/paymentrequest/PaymentRequest.h:
2018-10-08 Chris Dumez <cdumez@apple.com>
Have DOMWindowProperty get is frame from its associated DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=190341
Reviewed by Alex Christensen.
Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own
m_frame that can potentially get out-of-sync.
* Modules/cache/DOMWindowCaches.cpp:
(WebCore::DOMWindowCaches::DOMWindowCaches):
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::NavigatorGeolocation):
(WebCore::NavigatorGeolocation::from):
* Modules/geolocation/NavigatorGeolocation.h:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
* Modules/mediastream/NavigatorMediaDevices.cpp:
(WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
(WebCore::NavigatorMediaDevices::from):
* Modules/mediastream/NavigatorMediaDevices.h:
* Modules/quota/DOMWindowQuota.cpp:
(WebCore::DOMWindowQuota::DOMWindowQuota):
* Modules/quota/NavigatorStorageQuota.cpp:
(WebCore::NavigatorStorageQuota::NavigatorStorageQuota):
* Modules/quota/NavigatorStorageQuota.h:
* Modules/speech/DOMWindowSpeechSynthesis.cpp:
(WebCore::DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::StyleMedia):
(WebCore::StyleMedia::type const):
(WebCore::StyleMedia::matchMedium const):
* css/StyleMedia.h:
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::DOMApplicationCache):
(WebCore::DOMApplicationCache::applicationCacheHost const):
(WebCore::DOMApplicationCache::scriptExecutionContext const):
* loader/appcache/DOMApplicationCache.h:
* page/BarProp.cpp:
(WebCore::BarProp::BarProp):
(WebCore::BarProp::visible const):
* page/BarProp.h:
(WebCore::BarProp::create):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::DOMSelection):
(WebCore::DOMSelection::visibleSelection const):
(WebCore::DOMSelection::anchorNode const):
(WebCore::DOMSelection::anchorOffset const):
(WebCore::DOMSelection::focusNode const):
(WebCore::DOMSelection::focusOffset const):
(WebCore::DOMSelection::baseNode const):
(WebCore::DOMSelection::baseOffset const):
(WebCore::DOMSelection::extentNode const):
(WebCore::DOMSelection::extentOffset const):
(WebCore::DOMSelection::isCollapsed const):
(WebCore::DOMSelection::type const):
(WebCore::DOMSelection::rangeCount const):
(WebCore::DOMSelection::collapse):
(WebCore::DOMSelection::collapseToEnd):
(WebCore::DOMSelection::collapseToStart):
(WebCore::DOMSelection::empty):
(WebCore::DOMSelection::setBaseAndExtent):
(WebCore::DOMSelection::setPosition):
(WebCore::DOMSelection::modify):
(WebCore::DOMSelection::extend):
(WebCore::DOMSelection::getRangeAt):
(WebCore::DOMSelection::removeAllRanges):
(WebCore::DOMSelection::addRange):
(WebCore::DOMSelection::deleteFromDocument):
(WebCore::DOMSelection::containsNode const):
(WebCore::DOMSelection::toString):
(WebCore::DOMSelection::shadowAdjustedNode const):
(WebCore::DOMSelection::shadowAdjustedOffset const):
(WebCore::DOMSelection::isValidForPosition const):
* page/DOMSelection.h:
(WebCore::DOMSelection::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::screen):
(WebCore::DOMWindow::history):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
(WebCore::DOMWindow::applicationCache):
(WebCore::DOMWindow::navigator):
(WebCore::DOMWindow::location):
(WebCore::DOMWindow::visualViewport):
(WebCore::DOMWindow::webkitNamespace):
(WebCore::DOMWindow::getSelection):
(WebCore::DOMWindow::styleMedia):
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::DOMWindowExtension):
* page/DOMWindowExtension.h:
(WebCore::DOMWindowExtension::create):
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::DOMWindowProperty):
(WebCore::DOMWindowProperty::~DOMWindowProperty):
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
(WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame):
(WebCore::DOMWindowProperty::frame const):
* page/DOMWindowProperty.h:
(WebCore::DOMWindowProperty::window const):
* page/History.cpp:
(WebCore::History::History):
(WebCore::History::length const):
(WebCore::History::scrollRestoration const):
(WebCore::History::setScrollRestoration):
(WebCore::History::stateInternal const):
(WebCore::History::go):
(WebCore::History::urlForState):
(WebCore::History::stateObjectAdded):
* page/History.h:
* page/Location.cpp:
(WebCore::Location::Location):
(WebCore::Location::url const):
(WebCore::Location::href const):
(WebCore::Location::protocol const):
(WebCore::Location::host const):
(WebCore::Location::hostname const):
(WebCore::Location::port const):
(WebCore::Location::pathname const):
(WebCore::Location::search const):
(WebCore::Location::origin const):
(WebCore::Location::ancestorOrigins const):
(WebCore::Location::hash const):
(WebCore::Location::setHref):
(WebCore::Location::setProtocol):
(WebCore::Location::setHost):
(WebCore::Location::setHostname):
(WebCore::Location::setPort):
(WebCore::Location::setPathname):
(WebCore::Location::setSearch):
(WebCore::Location::setHash):
(WebCore::Location::assign):
(WebCore::Location::replace):
(WebCore::Location::reload):
(WebCore::Location::setLocation):
* page/Location.h:
(WebCore::Location::create):
* page/Navigator.cpp:
(WebCore::Navigator::Navigator):
(WebCore::Navigator::appVersion const):
(WebCore::Navigator::userAgent const):
(WebCore::Navigator::share):
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
(WebCore::Navigator::cookieEnabled const):
(WebCore::Navigator::javaEnabled const):
(WebCore::Navigator::standalone const):
* page/Navigator.h:
* page/Performance.cpp:
(WebCore::Performance::navigation):
(WebCore::Performance::timing):
* page/PerformanceNavigation.cpp:
(WebCore::PerformanceNavigation::PerformanceNavigation):
(WebCore::PerformanceNavigation::type const):
(WebCore::PerformanceNavigation::redirectCount const):
* page/PerformanceNavigation.h:
(WebCore::PerformanceNavigation::create):
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::PerformanceTiming):
(WebCore::PerformanceTiming::documentLoader const):
(WebCore::PerformanceTiming::documentTiming const):
* page/PerformanceTiming.h:
(WebCore::PerformanceTiming::create):
* page/Screen.cpp:
(WebCore::Screen::Screen):
(WebCore::Screen::height const):
(WebCore::Screen::width const):
(WebCore::Screen::colorDepth const):
(WebCore::Screen::pixelDepth const):
(WebCore::Screen::availLeft const):
(WebCore::Screen::availTop const):
(WebCore::Screen::availHeight const):
(WebCore::Screen::availWidth const):
* page/Screen.h:
* page/VisualViewport.cpp:
(WebCore::VisualViewport::VisualViewport):
(WebCore::VisualViewport::scriptExecutionContext const):
(WebCore::VisualViewport::addEventListener):
(WebCore::VisualViewport::updateFrameLayout const):
(WebCore::VisualViewport::offsetLeft const):
(WebCore::VisualViewport::offsetTop const):
(WebCore::VisualViewport::pageLeft const):
(WebCore::VisualViewport::pageTop const):
(WebCore::VisualViewport::width const):
(WebCore::VisualViewport::height const):
(WebCore::VisualViewport::scale const):
(WebCore::VisualViewport::update):
(WebCore::VisualViewport::enqueueResizeEvent):
(WebCore::VisualViewport::enqueueScrollEvent):
* page/VisualViewport.h:
* page/WebKitNamespace.cpp:
(WebCore::WebKitNamespace::WebKitNamespace):
* page/WebKitNamespace.h:
(WebCore::WebKitNamespace::create):
* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
(WebCore::DOMMimeTypeArray::item):
(WebCore::DOMMimeTypeArray::namedItem):
(WebCore::DOMMimeTypeArray::getPluginData const):
* plugins/DOMMimeTypeArray.h:
(WebCore::DOMMimeTypeArray::create):
* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::DOMPluginArray):
(WebCore::DOMPluginArray::item):
(WebCore::DOMPluginArray::namedItem):
(WebCore::DOMPluginArray::refresh):
(WebCore::DOMPluginArray::pluginData const):
* plugins/DOMPluginArray.h:
(WebCore::DOMPluginArray::create):
* storage/Storage.cpp:
(WebCore::Storage::create):
(WebCore::Storage::Storage):
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
* storage/Storage.h:
2018-10-08 Antti Koivisto <antti@apple.com>
Move FontCascadeDescription to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=190348
Reviewed by Chris Dumez.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontCascade.h:
* platform/graphics/FontCascadeDescription.cpp: Copied from Source/WebCore/platform/graphics/FontDescription.cpp.
(WebCore::FontDescription::FontDescription): Deleted.
(WebCore::m_shouldAllowUserInstalledFonts): Deleted.
(WebCore::FontDescription::setLocale): Deleted.
(WebCore::FontDescription::invalidateCaches): Deleted.
* platform/graphics/FontCascadeDescription.h: Copied from Source/WebCore/platform/graphics/FontDescription.h.
(WebCore::FontDescription::operator!= const): Deleted.
(WebCore::FontDescription::computedSize const): Deleted.
(WebCore::FontDescription::computedPixelSize const): Deleted.
(WebCore::FontDescription::italic const): Deleted.
(WebCore::FontDescription::stretch const): Deleted.
(WebCore::FontDescription::weight const): Deleted.
(WebCore::FontDescription::fontSelectionRequest const): Deleted.
(WebCore::FontDescription::renderingMode const): Deleted.
(WebCore::FontDescription::textRenderingMode const): Deleted.
(WebCore::FontDescription::script const): Deleted.
(WebCore::FontDescription::locale const): Deleted.
(WebCore::FontDescription::orientation const): Deleted.
(WebCore::FontDescription::nonCJKGlyphOrientation const): Deleted.
(WebCore::FontDescription::widthVariant const): Deleted.
(WebCore::FontDescription::featureSettings const): Deleted.
(WebCore::FontDescription::variationSettings const): Deleted.
(WebCore::FontDescription::fontSynthesis const): Deleted.
(WebCore::FontDescription::variantCommonLigatures const): Deleted.
(WebCore::FontDescription::variantDiscretionaryLigatures const): Deleted.
(WebCore::FontDescription::variantHistoricalLigatures const): Deleted.
(WebCore::FontDescription::variantContextualAlternates const): Deleted.
(WebCore::FontDescription::variantPosition const): Deleted.
(WebCore::FontDescription::variantCaps const): Deleted.
(WebCore::FontDescription::variantNumericFigure const): Deleted.
(WebCore::FontDescription::variantNumericSpacing const): Deleted.
(WebCore::FontDescription::variantNumericFraction const): Deleted.
(WebCore::FontDescription::variantNumericOrdinal const): Deleted.
(WebCore::FontDescription::variantNumericSlashedZero const): Deleted.
(WebCore::FontDescription::variantAlternates const): Deleted.
(WebCore::FontDescription::variantEastAsianVariant const): Deleted.
(WebCore::FontDescription::variantEastAsianWidth const): Deleted.
(WebCore::FontDescription::variantEastAsianRuby const): Deleted.
(WebCore::FontDescription::variantSettings const): Deleted.
(WebCore::FontDescription::opticalSizing const): Deleted.
(WebCore::FontDescription::fontStyleAxis const): Deleted.
(WebCore::FontDescription::shouldAllowUserInstalledFonts const): Deleted.
(WebCore::FontDescription::setComputedSize): Deleted.
(WebCore::FontDescription::setItalic): Deleted.
(WebCore::FontDescription::setStretch): Deleted.
(WebCore::FontDescription::setIsItalic): Deleted.
(WebCore::FontDescription::setWeight): Deleted.
(WebCore::FontDescription::setRenderingMode): Deleted.
(WebCore::FontDescription::setTextRenderingMode): Deleted.
(WebCore::FontDescription::setOrientation): Deleted.
(WebCore::FontDescription::setNonCJKGlyphOrientation): Deleted.
(WebCore::FontDescription::setWidthVariant): Deleted.
(WebCore::FontDescription::setFeatureSettings): Deleted.
(WebCore::FontDescription::setVariationSettings): Deleted.
(WebCore::FontDescription::setFontSynthesis): Deleted.
(WebCore::FontDescription::setVariantCommonLigatures): Deleted.
(WebCore::FontDescription::setVariantDiscretionaryLigatures): Deleted.
(WebCore::FontDescription::setVariantHistoricalLigatures): Deleted.
(WebCore::FontDescription::setVariantContextualAlternates): Deleted.
(WebCore::FontDescription::setVariantPosition): Deleted.
(WebCore::FontDescription::setVariantCaps): Deleted.
(WebCore::FontDescription::setVariantNumericFigure): Deleted.
(WebCore::FontDescription::setVariantNumericSpacing): Deleted.
(WebCore::FontDescription::setVariantNumericFraction): Deleted.
(WebCore::FontDescription::setVariantNumericOrdinal): Deleted.
(WebCore::FontDescription::setVariantNumericSlashedZero): Deleted.
(WebCore::FontDescription::setVariantAlternates): Deleted.
(WebCore::FontDescription::setVariantEastAsianVariant): Deleted.
(WebCore::FontDescription::setVariantEastAsianWidth): Deleted.
(WebCore::FontDescription::setVariantEastAsianRuby): Deleted.
(WebCore::FontDescription::setOpticalSizing): Deleted.
(WebCore::FontDescription::setFontStyleAxis): Deleted.
(WebCore::FontDescription::setShouldAllowUserInstalledFonts): Deleted.
(WebCore::FontDescription::operator== const): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
(WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted.
(WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted.
(WebCore::FontCascadeDescription::lighterWeight): Deleted.
(WebCore::FontCascadeDescription::bolderWeight): Deleted.
(WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing const): Deleted.
(WebCore::FontCascadeDescription::familyNamesAreEqual): Deleted.
(WebCore::FontCascadeDescription::familyNameHash): Deleted.
(WebCore::FontCascadeDescription::foldedFamilyName): Deleted.
* platform/graphics/FontDescription.h:
(WebCore::FontCascadeDescription::operator!= const): Deleted.
(WebCore::FontCascadeDescription::familyCount const): Deleted.
(WebCore::FontCascadeDescription::firstFamily const): Deleted.
(WebCore::FontCascadeDescription::familyAt const): Deleted.
(WebCore::FontCascadeDescription::families const): Deleted.
(WebCore::FontCascadeDescription::specifiedSize const): Deleted.
(WebCore::FontCascadeDescription::isAbsoluteSize const): Deleted.
(WebCore::FontCascadeDescription::lighterWeight const): Deleted.
(WebCore::FontCascadeDescription::bolderWeight const): Deleted.
(WebCore::FontCascadeDescription::useFixedDefaultSize const): Deleted.
(WebCore::FontCascadeDescription::kerning const): Deleted.
(WebCore::FontCascadeDescription::keywordSize const): Deleted.
(WebCore::FontCascadeDescription::keywordSizeAsIdentifier const): Deleted.
(WebCore::FontCascadeDescription::fontSmoothing const): Deleted.
(WebCore::FontCascadeDescription::isSpecifiedFont const): Deleted.
(WebCore::FontCascadeDescription::setOneFamily): Deleted.
(WebCore::FontCascadeDescription::setFamilies): Deleted.
(WebCore::FontCascadeDescription::setSpecifiedSize): Deleted.
(WebCore::FontCascadeDescription::setIsAbsoluteSize): Deleted.
(WebCore::FontCascadeDescription::setKerning): Deleted.
(WebCore::FontCascadeDescription::setKeywordSize): Deleted.
(WebCore::FontCascadeDescription::setKeywordSizeFromIdentifier): Deleted.
(WebCore::FontCascadeDescription::setFontSmoothing): Deleted.
(WebCore::FontCascadeDescription::setIsSpecifiedFont): Deleted.
(WebCore::FontCascadeDescription::equalForTextAutoSizing const): Deleted.
(WebCore::FontCascadeDescription::initialItalic): Deleted.
(WebCore::FontCascadeDescription::initialFontStyleAxis): Deleted.
(WebCore::FontCascadeDescription::initialWeight): Deleted.
(WebCore::FontCascadeDescription::initialStretch): Deleted.
(WebCore::FontCascadeDescription::initialSmallCaps): Deleted.
(WebCore::FontCascadeDescription::initialKerning): Deleted.
(WebCore::FontCascadeDescription::initialFontSmoothing): Deleted.
(WebCore::FontCascadeDescription::initialTextRenderingMode): Deleted.
(WebCore::FontCascadeDescription::initialFontSynthesis): Deleted.
(WebCore::FontCascadeDescription::initialVariantPosition): Deleted.
(WebCore::FontCascadeDescription::initialVariantCaps): Deleted.
(WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.
(WebCore::FontCascadeDescription::initialOpticalSizing): Deleted.
(WebCore::FontCascadeDescription::initialLocale): Deleted.
(WebCore::FontCascadeDescription::operator== const): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* rendering/style/RenderStyle.h:
2018-10-08 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc"
https://bugs.webkit.org/show_bug.cgi?id=189239
Reviewed by Xabier Rodriguez-Calvar.
Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon.
The DRM system id field in the encrypted event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID
in case of WebM, for details, see https://bugzilla.gnome.org/attachment.cgi?id=365211.
Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html
media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::capsMediaType):
(WebCore::areEncryptedCaps):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformCaps):
2018-10-07 Dan Bernstein <mitz@apple.com>
Fixed building with the latest macOS SDK
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext): Suppressed deprecation warnings around use of
CGIOSurfaceContextSetDisplayMask.
2018-10-06 Justin Michaud <justin_michaud@apple.com>
Properly determine if css custom property values are computationally independent
https://bugs.webkit.org/show_bug.cgi?id=190303
Reviewed by Antti Koivisto.
Add getDirectComputationalDependencies method to determine if a value is computationally
dependent. Use this method in CSS.registerProperty to replace existing substring checks.
No new tests are needed because the existing tests cover this behaviour.
* css/CSSCalculationValue.cpp:
(WebCore::determineCategory):
* css/CSSCalculationValue.h:
(WebCore::CSSCalcValue::getDirectComputationalDependencies const):
(WebCore::CSSCalcValue::getDirectRootComputationalDependencies const):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
* css/CSSCustomPropertyValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const):
(WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const):
* css/CSSPrimitiveValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::getDirectComputationalDependencies const):
(WebCore::CSSValue::getDirectRootComputationalDependencies const):
* css/CSSValue.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::resolveVariableReference const):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2018-10-05 Chris Dumez <cdumez@apple.com>
Regression(r236862): Crash under DOMWindowExtension::willDetachGlobalObjectFromFrame()
https://bugs.webkit.org/show_bug.cgi?id=190320
<rdar://problem/45044814>
Reviewed by Geoffrey Garen.
r236862 caused DOMWindowProperty::willDetachGlobalObjectFromFrame() to get called several
times. There was no effect for most DOMWindowProperty objects. However, it would cause
crashes for DOMWindowExtension objects, which subclass DOMWindowProperty and override
DOMWindowProperty::willDetachGlobalObjectFromFrame() because they dereference the frame
without null checking it.
To address the issue, we now make sure DOMWindowProperty::willDetachGlobalObjectFromFrame()
is not called several times.
* dom/Document.cpp:
(WebCore::Document::detachFromFrame):
Stop calling DOMWindow::willDetachDocumentFromFrame() here as most call sites already
take care of calling DOMWindow::willDetachDocumentFromFrame() beforehand (e.g.
Document::prepareForDestruction()).
Also, return early if the Document is already detached from its frame.
(WebCore::Document::frameWasDisconnectedFromOwner):
Add new utility function called when a Frame is disconnected from its owner which
calls both Document::detachFromFrame() and DOMWindow::willDetachDocumentFromFrame().
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachDocumentFromFrame):
Return early if the Window is already detached from its frame.
* page/Frame.cpp:
(WebCore::Frame::disconnectOwnerElement):
2018-10-05 Jer Noble <jer.noble@apple.com>
Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
2018-10-05 Jer Noble <jer.noble@apple.com>
Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
2018-10-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>
Reviewed by Youenn Fablet.
No new tests, covered by existing tests.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
to base class.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
as passed salt.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
(WebCore::MediaStreamTrack::getCapabilities const): Ditto.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
to base class.
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
* platform/mediastream/MediaConstraints.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
(WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
(WebCore::RealtimeMediaSource::hashedId const): New.
(WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
a source.
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Ditto.
(WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create): Ditto.
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
(WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
(WebCore::AVVideoCaptureSource::capabilities): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create): Update parameters.
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Update parameters.
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
* platform/mock/MockRealtimeVideoSource.h:
2018-10-03 Jer Noble <jer.noble@apple.com>
Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
https://bugs.webkit.org/show_bug.cgi?id=190266
Reviewed by Eric Carlson.
Test: TestWebKitAPI.VideoQualityDisplayCompositing
Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
constructor (rather than individual fields). Add a new setting to control visibility
of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create):
(WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
* Modules/mediasource/VideoPlaybackQuality.h:
(WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
* Modules/mediasource/VideoPlaybackQuality.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* page/Settings.yaml:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
2018-10-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236866.
Breaks internal builds.
Reverted changeset:
"Add support for reporting "display composited video frames"
through the VideoPlaybackQuality object."
https://bugs.webkit.org/show_bug.cgi?id=190266
https://trac.webkit.org/changeset/236866
2018-10-05 Antoine Quint <graouts@apple.com>
[Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
https://bugs.webkit.org/show_bug.cgi?id=190307
<rdar://problem/45009901>
Reviewed by Dean Jackson.
We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
will already have performed this task safely if needed.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement):
2018-10-04 Jer Noble <jer.noble@apple.com>
Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
https://bugs.webkit.org/show_bug.cgi?id=190266
Reviewed by Eric Carlson.
Test: TestWebKitAPI.VideoQualityDisplayCompositing
Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
constructor (rather than individual fields). Add a new setting to control visibility
of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create):
(WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
* Modules/mediasource/VideoPlaybackQuality.h:
(WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
* Modules/mediasource/VideoPlaybackQuality.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* page/Settings.yaml:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
2018-10-04 Chris Dumez <cdumez@apple.com>
A Document / Window should lose its browsing context as soon as its iframe is removed from the document
https://bugs.webkit.org/show_bug.cgi?id=190282
Reviewed by Ryosuke Niwa.
A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
destroyed, which happens later usually after a GC happens.
Specification:
- https://html.spec.whatwg.org/#the-iframe-element
"""
When an iframe element is removed from a document, the user agent must discard the element's nested browsing
context, if it is not null, and then set the element's nested browsing context to null.
"""
This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
patch is aligning our behavior.
In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
get its frame from the Document. This should make the code simpler.
No new tests, rebaselined existing tests.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia const):
* Modules/mediastream/MediaDevices.h:
Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
document has been detached, instead of throwing an InvalidStateError. This behavior is as per
specification:
- https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
I needed to make this change to keep one of our layout tests passing.
* dom/Document.cpp:
(WebCore::Document::attachToCachedFrame):
(WebCore::Document::detachFromFrame):
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::didSecureTransitionTo):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::setStatus):
(WebCore::DOMWindow::detachFromFrame):
(WebCore::DOMWindow::attachToFrame):
* page/DOMWindow.h:
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
* page/Frame.cpp:
(WebCore::Frame::disconnectOwnerElement):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
our layout tests so I made sure we only call drawText when the String is not null.
2018-10-04 Jeremy Jones <jeremyj@apple.com>
Unify implementation in VideoFullscreenInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=190091
rdar://problem/44734523
Reviewed by Jer Noble.
No new tests because no behavior change.
Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
any changes that had been made in the old path.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
2018-10-04 Justin Michaud <justin_michaud@apple.com>
Bindings generator should support static attributes that are interfaces with CallWith
https://bugs.webkit.org/show_bug.cgi?id=190292
Reviewed by Chris Dumez.
Add support for static attributes that support callWith to the bindings generator. This
is needed for CSS.paintWorklet.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
(WebCore::jsTestObjConstructorTestStaticReadonlyObj):
* bindings/scripts/test/TestObj.idl:
2018-10-04 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r236730.
This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
Reverted changeset:
"[MediaStream] RealtimeMediaSource should be able to vend
hashed IDs"
https://bugs.webkit.org/show_bug.cgi?id=190142
https://trac.webkit.org/changeset/236730
2018-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=190289
<rdar://problem/45020806>
Reviewed by Ryosuke Niwa.
Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
Tests: FontManagerTests.AddFontShadowUsingFontOptions
FontManagerTests.AddAndRemoveColorsUsingFontOptions
* editing/FontAttributeChanges.cpp:
(WebCore::cssValueListForShadow):
* editing/cocoa/FontAttributesCocoa.mm:
Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
have negative dimensions, so a check for `isZero()` should be used instead.
(WebCore::FontAttributes::createDictionary const):
* platform/mac/WebCoreNSFontManagerExtras.mm:
Fall back to a transparent background color; this allows senders to remove the current background color by just
removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
background color).
(WebCore::computedFontAttributeChanges):
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
https://bugs.webkit.org/show_bug.cgi?id=190277
Reviewed by Antti Koivisto.
The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
the root nodes of the target, addedNodes, and removedNodes in each mutation record.
Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMutationRecordCustom.cpp: Added.
(WebCore::JSMutationRecord::visitAdditionalChildren): Added.
* bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
(WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
* dom/MutationRecord.cpp:
(WebCore::ChildListRecord::visitNodesConcurrently): Added.
(WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
(WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
* dom/MutationRecord.h:
* dom/MutationRecord.idl:
2018-10-04 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Move time out control from WebProcess to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=189642
<rdar://problem/44476765>
Reviewed by Chris Dumez.
Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
the time out timer should move to UI Process as well.
Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::create const):
(WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
(WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
(WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
2018-10-04 Chris Dumez <cdumez@apple.com>
Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
https://bugs.webkit.org/show_bug.cgi?id=190252
Reviewed by Alex Christensen.
Add a null check for element() after firing the 'input' event and before firing the 'change' event
in case the input event listener changes the input type.
Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
2018-10-04 Yuhan Wu <yuhan_wu@apple.com>
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018
Reviewed by Youenn Fablet and Chris Dumez.
Covered by tests:
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediarecorder/BlobEvent.h:
(WebCore::BlobEvent::create):
(WebCore::BlobEvent:::Event):
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::activeDOMObjectName const):
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
* Modules/mediarecorder/MediaRecorder.h: Added.
(WebCore::MediaRecorder::state const):
(WebCore::MediaRecorder::~MediaRecorder):
* Modules/mediarecorder/MediaRecorder.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
(WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
2018-10-04 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236803.
Caused crashes on some bots
Reverted changeset:
"Regression(r236779): Crash when changing the input element
type from inside an 'input' event listener"
https://bugs.webkit.org/show_bug.cgi?id=190252
https://trac.webkit.org/changeset/236803
2018-10-04 Dan Bernstein <mitz@apple.com>
Tried to fix the Mojave build after r236832.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
2018-10-04 Michael Catanzaro <mcatanzaro@igalia.com>
ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired
https://bugs.webkit.org/show_bug.cgi?id=190145
Reviewed by Javier Fernandez.
Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::baselinePosition const):
* rendering/style/GridArea.h:
(WebCore::GridSpan::GridSpan):
2018-10-04 Dan Bernstein <mitz@apple.com>
WebCore part of [Xcode] Update some build settings as recommended by Xcode 10
https://bugs.webkit.org/show_bug.cgi?id=190250
Reviewed by Andy Estes.
* Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS.
* WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a
duplicate reference in a Compile Sources build phase.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations
around implementations of deprecated accessibility methods.
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method.
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto.
2018-10-02 Darin Adler <darin@apple.com>
AudioNode.connect should use [ReturnValue]
https://bugs.webkit.org/show_bug.cgi?id=190231
Reviewed by Eric Carlson.
This is a slightly more efficient way to return a value that is always
identical to one of the arguments, so use it here.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
* Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect): Ditto.
* Modules/webaudio/AudioNode.h: Ditto.
* Modules/webaudio/AudioNode.idl: Use [ReturnValue].
2018-10-03 Justin Michaud <justin_michaud@apple.com>
Registered custom properties should allow inheritance to be controlled
https://bugs.webkit.org/show_bug.cgi?id=190038
Reviewed by Antti Koivisto.
Tests: css-custom-properties-api/inherits.html
css-custom-properties-api/length.html
css-custom-properties-api/length2.html
Add support for inherits property on registered css custom properties, as well
as a starting point for evaluating registered custom properties with types. Registered
custom properties are evaluated as length values before being substituted. Currently,
relative unit cycles are not detected.
A proper solution is still needed to resolve relative unit cycles, and to apply properties like font
and line-height before they are needed by custom properties. In this patch, the font-size property is
applied twice, once before and once after resolving custom property values.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::CSSComputedStyleDeclaration::length const):
(WebCore::CSSComputedStyleDeclaration::item const):
Allow JS to get custom properties that have been resolved to a length. Also add properties from
m_rareNonInheritedData.
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h.
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
(WebCore::CSSRegisteredCustomProperty::initialValueCopy const):
* css/CSSRegisteredCustomProperty.h:
(WebCore::CSSRegisteredCustomProperty::initialValue const):
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::checkVariablesForCycles const):
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
(WebCore::CSSVariableData::resolveVariableFallback const):
(WebCore::CSSVariableData::resolveVariableReference const):
(WebCore::CSSVariableData::resolveVariableReferences const):
(WebCore::CSSVariableData::resolveTokenRange const):
* css/CSSVariableData.h:
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
* css/CSSVariableReferenceValue.h:
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
Use RenderStyle over passing in a customProperties map.
* css/StyleBuilder.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLength):
(WebCore::StyleBuilderConverter::convertLengthOrAuto):
(WebCore::StyleBuilderConverter::convertLengthSizing):
(WebCore::StyleBuilderConverter::convertLengthMaxSizing):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyInheritCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::useSVGZoomRules const):
(WebCore::StyleResolver::useSVGZoomRulesForLength const):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::applyCascadedProperties):
(WebCore::StyleResolver::useSVGZoomRules): Deleted.
(WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted.
(WebCore::StyleResolver::resolvedVariableValue): Deleted.
* css/StyleResolver.h:
* css/makeprop.pl:
Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with
inheritance, unset and revert values.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserContext.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
Allow parsing custom property values as lengths.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::inheritedCustomProperties const):
(WebCore::RenderStyle::nonInheritedCustomProperties const):
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
(WebCore::RenderStyle::getCustomProperty const):
(WebCore::RenderStyle::customProperties const): Deleted.
(WebCore::RenderStyle::setCustomPropertyValue): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find
cycles between them.
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
Clear m_pendingTargets in MutationObserver::takeRecords
https://bugs.webkit.org/show_bug.cgi?id=190240
Reviewed by Geoffrey Garen.
In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between
mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records.
This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make
MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of
mutation records so that the hash set survives through the creation of JS wrappers for mutation records.
To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in
which the result is stored.
No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody):
(WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
* bindings/scripts/test/TestImplements.idl: Added a test case.
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::takeRecords):
(WebCore::MutationObserver::deliver):
* dom/MutationObserver.h:
* dom/MutationObserver.idl:
2018-10-03 Youenn Fablet <youenn@apple.com>
Add VP8 support to WebRTC
https://bugs.webkit.org/show_bug.cgi?id=189976
Reviewed by Eric Carlson.
Add a runtime flag to control activation of VP8 codec.
Bind this runtime flag to the video codec factories.
Test: webrtc/video-mute-vp8.html
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Enable VP8 codec for tests.
2018-09-28 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] ECDSA could not deal with invalid signature inputs
https://bugs.webkit.org/show_bug.cgi?id=189879
<rdar://problem/44701276>
Reviewed by Brent Fulgham.
Add some guards over detections of the start positions of r/s.
Covered by improved existing tests.
* crypto/mac/CryptoAlgorithmECDSAMac.cpp:
(WebCore::verifyECDSA):
2018-10-03 Jer Noble <jer.noble@apple.com>
Add a quirk to disable Modern EME for sites which are broken with it enabled
https://bugs.webkit.org/show_bug.cgi?id=190051
Reviewed by Daniel Bates.
Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings
generator to support a DisabledByQuirk attribute, and set this attribute for all
the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in
addition to the existing Setting.
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(WK_ucfirst):
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::quirks const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
* html/HTMLMediaElement.idl:
* page/Quirks.cpp: Added.
(Quirks::Quirks):
(Quirks::disableEncryptedMediaAPIQuirk const):
* page/Quirks.h: Added.
2018-10-03 Antoine Quint <graouts@apple.com>
[Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style
https://bugs.webkit.org/show_bug.cgi?id=190257
<rdar://problem/41341473>
Reviewed by Dean Jackson.
Test: animations/animation-fill-forwards-removal.html
While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps
on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation
was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document
timeline as its timeline, but the document timeline will no longer see this animation as targeting this element.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
* animation/DeclarativeAnimation.h:
(WebCore::DeclarativeAnimation::target const):
2018-10-03 Jer Noble <jer.noble@apple.com>
CRASH in CVPixelBufferGetBytePointerCallback()
https://bugs.webkit.org/show_bug.cgi?id=190092
Reviewed by Eric Carlson.
Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt
to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access
error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer
calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and
release logging to try to pinpoint if mismatch lock counts are occurring in this code path.
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):
(WebCore::CVPixelBufferReleaseBytePointerCallback):
(WebCore::CVPixelBufferReleaseInfoCallback):
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2018-10-03 Chris Dumez <cdumez@apple.com>
Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
https://bugs.webkit.org/show_bug.cgi?id=190252
Reviewed by Alex Christensen.
Add a null check for element() after firing the 'input' event and before firing the 'change' event
in case the input event listener changes the input type.
Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
2018-10-03 Chris Dumez <cdumez@apple.com>
Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener
https://bugs.webkit.org/show_bug.cgi?id=190251
Reviewed by Alex Christensen.
Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener,
similarly to noopener=1:
- https://html.spec.whatwg.org/#window-open-steps (step 5)
It does not matter what the value is, if there is a key named "noopener", then the new window
should not have an opener.
No new tests, rebaselined existing test.
* page/WindowFeatures.cpp:
(WebCore::setWindowFeature):
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
https://bugs.webkit.org/show_bug.cgi?id=190115
Reviewed by Geoffrey Garen.
Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
target is kept alive and MutationObserverRegistration where each node which had been removed
from an observed tree is kept alive for a subtree observation.
No new test since the test which can reproduce this problem is too slow.
* dom/GCReachableRef.h:
(WebCore::GCReachableRef): Made it work with hash table.
(WebCore::GCReachableRef::operator T& const):
(WebCore::GCReachableRef::GCReachableRef):
(WebCore::GCReachableRef::isHashTableDeletedValue const):
(WebCore::GCReachableRef::isHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
(WebCore::GCReachableRef::assignToHashTableEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
to be collected before elements in mutation records are accessed. We delay until the end of the current
microtask at which point deliver() function is called.
(WebCore::MutationObserver::disconnect):
(WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
This is needed for a newly inserted node, a node with attribute change, etc...
(WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
records are delivered to each observer. These are nodes which had been removed from a tree and whose
subtree had still been obsreved up until this point.
* dom/MutationObserver.h:
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
(WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
function had been called.
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
* dom/MutationObserverRegistration.h:
2018-10-03 Dean Jackson <dino@apple.com>
Make the Pointer Events feature description valid
https://bugs.webkit.org/show_bug.cgi?id=190254
Reviewed by Simon Fraser.
* features.json:
2018-10-03 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r236781.
The test added with this commit is timing out consistently.
Reverted changeset:
"GC can collect JS wrappers of nodes in the mutation records
waiting to be delivered"
https://bugs.webkit.org/show_bug.cgi?id=190115
https://trac.webkit.org/changeset/236781
2018-10-03 Dean Jackson <dino@apple.com>
[macOS] Switching to discrete GPU should be done in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189361
<rdar://problem/43949622>
Try to fix the IOSMAC build.
* platform/graphics/GraphicsContext3D.h:
2018-10-03 Chris Dumez <cdumez@apple.com>
input.checked is incorrect while we're parsing its children
https://bugs.webkit.org/show_bug.cgi?id=190227
Reviewed by Ryosuke Niwa.
input.checked was incorrect while we're parsing its children because we were delaying updating the
checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction
with form state restoration.
In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know
that no form state to restore.
fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still
passing.
No new tests, rebaselined existing test.
* html/FormController.cpp:
(WebCore::FormController::hasFormStateToRestore const):
* html/FormController.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
2018-10-03 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed
https://bugs.webkit.org/show_bug.cgi?id=190249
Reviewed by Žan Doberšek.
Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose
the value calculated during the layer flush. Use an OR instead to keep the old value.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2018-10-03 Youenn Fablet <youenn@apple.com>
Enable H264 simulcast
https://bugs.webkit.org/show_bug.cgi?id=190167
Reviewed by Eric Carlson.
Activate H264 simulcast trial field.
Make track.getSettings() expose width and height for incoming tracks.
Test: webrtc/simulcast-h264.html
* Configurations/WebCore.xcconfig:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2018-10-03 Michael Catanzaro <mcatanzaro@igalia.com>
-Wunused-variable in RenderLayer::updateScrollableAreaSet
https://bugs.webkit.org/show_bug.cgi?id=190200
Reviewed by Yusuke Suzuki.
Pass it through UNUSED_VARIABLE().
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
2018-10-03 Zan Dobersek <zdobersek@igalia.com>
Ref<FetchResponse> use-after-move in DOMCache::put()
https://bugs.webkit.org/show_bug.cgi?id=190239
Reviewed by Youenn Fablet.
Retrieve reference from the Ref<FetchResponse> object before it's
move-captured in the lambda that's passed to the
FetchResponse::consumeBodyReceivedByChunk() method that is invoked on
that very same object. This is a classic use-after-move bug that pops
up on compilers with different C++ calling convention.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=190238
Reviewed by Antti Koivisto.
Enable the feature by default.
* page/Settings.yaml:
2018-10-02 Ryosuke Niwa <rniwa@webkit.org>
Copying content with shadow DOM doesn't copy any contents
https://bugs.webkit.org/show_bug.cgi?id=157443
Reviewed by Wenson Hsieh.
This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text,
which is enabled whenever selection across shadow boundaries is enabled.
To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in
StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator.
When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when
the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree.
Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html
editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html
editing/pasteboard/copy-paste-with-shadow-content.html
* dom/ComposedTreeIterator.h:
(WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp.
(WebCore::shadowRootIgnoringUserAgentShadow): Ditto.
(WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto.
(WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto.
* dom/Position.h:
(WebCore::Position::treeScope const): Added.
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::addDisplayContents): Added.
* editing/EditingStyle.h:
* editing/Editor.cpp:
(WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set.
(WebCore::Editor::selectedTextForDataTransfer const): Ditto.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::appendEndTag):
* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator): Added a new variant which takes two positions.
(WebCore::TextIterator::init):
(WebCore::firstChild):
(WebCore::nextSibling):
(WebCore::plainText): Ditto.
* editing/TextIterator.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Ditto.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::parentNode): Added.
(WebCore::StyledMarkupAccumulator::firstChild): Added.
(WebCore::StyledMarkupAccumulator::nextSibling): Added.
(WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added.
(WebCore::StyledMarkupAccumulator::hasChildNodes): Added.
(WebCore::StyledMarkupAccumulator::isDescendantOf): Added.
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents.
(WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto.
(WebCore::StyledMarkupAccumulator::serializeNodes):
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to
traverse the composed tree when m_useComposedTree is set.
(WebCore::commonShadowIncludingAncestor): Added.
(WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use
StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc...
(WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection.
(WebCore::sanitizedMarkupForFragmentInDocument):
* editing/markup.h:
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement):
* testing/Internals.cpp:
(WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across
shadow boundaries for testing purposes.
* testing/Internals.h:
* testing/Internals.idl:
2018-10-02 Chris Dumez <cdumez@apple.com>
MessageEvent.ports should return the same object
https://bugs.webkit.org/show_bug.cgi?id=190151
Reviewed by Darin Adler.
MessageEvent.ports should return the same object it was initialized to instead of
constructing a new JSValue every time.
No new tests, rebaselined existing test.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::ports const):
(WebCore::JSMessageEvent::visitAdditionalChildren):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
2018-10-01 Ryosuke Niwa <rniwa@webkit.org>
GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
https://bugs.webkit.org/show_bug.cgi?id=190115
Reviewed by Geoffrey Garen.
Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
target is kept alive and MutationObserverRegistration where each node which had been removed
from an observed tree is kept alive for a subtree observation.
Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html
* dom/GCReachableRef.h:
(WebCore::GCReachableRef): Made it work with hash table.
(WebCore::GCReachableRef::operator T& const):
(WebCore::GCReachableRef::GCReachableRef):
(WebCore::GCReachableRef::isHashTableDeletedValue const):
(WebCore::GCReachableRef::isHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
(WebCore::GCReachableRef::assignToHashTableEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
to be collected before elements in mutation records are accessed. We delay until the end of the current
microtask at which point deliver() function is called.
(WebCore::MutationObserver::disconnect):
(WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
This is needed for a newly inserted node, a node with attribute change, etc...
(WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
records are delivered to each observer. These are nodes which had been removed from a tree and whose
subtree had still been obsreved up until this point.
* dom/MutationObserver.h:
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
(WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
function had been called.
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
* dom/MutationObserverRegistration.h:
2018-10-02 Chris Dumez <cdumez@apple.com>
radio / checkbox inputs should fire "click, input, change" events in order when clicked
https://bugs.webkit.org/show_bug.cgi?id=190223
Reviewed by Ryosuke Niwa.
radio / checkbox inputs should fire "click, input, change" events in order when clicked:
- https://html.spec.whatwg.org/#radio-button-state-(type=radio)
- https://html.spec.whatwg.org/#checkbox-state-(type=checkbox)
- https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11)
Gecko and Blink already behave this way. However, WebKit has the following issues:
- the input event is not fired
- the click event is fired after the change event
No new tests, updated / rebaselined existing tests.
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
* html/BaseCheckableInputType.h:
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::willDispatchClick):
(WebCore::CheckboxInputType::didDispatchClick):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):
* html/HTMLInputElement.h:
* html/RadioInputType.cpp:
(WebCore::RadioInputType::willDispatchClick):
(WebCore::RadioInputType::didDispatchClick):
2018-10-02 Chris Dumez <cdumez@apple.com>
fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection
https://bugs.webkit.org/show_bug.cgi?id=190218
Reviewed by Alex Christensen.
fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection:
- https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb
Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016:
- https://bugs.chromium.org/p/chromium/issues/detail?id=665291
This simplifies our HTMLFieldSetElement code a lot.
Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html
* html/CollectionType.h:
* html/GenericCachedHTMLCollection.cpp:
(WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::rootTypeFromCollectionType):
(WebCore::invalidationTypeExcludingIdAndNameAttributes):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::elements):
* html/HTMLFieldSetElement.h:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
(WebCore::HTMLFormControlsCollection::ownerNode const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
2018-10-02 Devin Rousso <drousso@apple.com>
Web Inspector: prevent layer events from firing until the layer information is re-requested
https://bugs.webkit.org/show_bug.cgi?id=190159
Reviewed by Joseph Pecoraro.
Test: inspector/layers/layerTreeDidChange.html
* inspector/agents/InspectorLayerTreeAgent.h:
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reset):
(WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
(WebCore::InspectorLayerTreeAgent::layersForNode):
2018-10-02 Brian Burg <bburg@apple.com>
Web Automation: tab default key handler should always cycle focus when page is controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=190221
<rdar://problem/44914534>
Reviewed by Joseph Pecoraro.
This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24].
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):
Always cycle focus if the page is controlled by automation. If the chrome takes
focus, then the first responder will be something other than the WebView, which
causes subsequent WebDriver commands to hang.
2018-10-01 Dean Jackson <dino@apple.com>
[macOS] Switching to discrete GPU should be done in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189361
<rdar://problem/43949622>
Reviewed by Simon Fraser.
Based on an earlier patch by Per Arne Vollan.
Due to the fact we can't talk to the Window Server, the Web Process can
no longer muxing to the discrete GPU directly. Instead we have to get the
UI Process to process the change. Do this by adding a new Chrome client
called GPUClient, that will have implementations provided by both WebKit
and legacy WebKit.
Unfortunately this can't be tested by a regular WKTR since:
- it requires specific hardware
- swapping to/from the discrete GPU takes about 20 seconds
- running concurrent tests could confuse the tests into thinking
the wrong GPU is active
Instead we'll write a specific test for this functionality and
run it on a separate bot.
* WebCore.xcodeproj/project.pbxproj: Add GPUClient files.
* page/Chrome.cpp: Drive by clean-up.
(WebCore::Chrome::windowScreenDidChange):
* platform/graphics/GraphicsContext3D.h: We need to keep track of
whether we've muxed for this context, in order to not respond to
the screen change notifications (they are misleading in the case
of muxing).
* platform/graphics/GraphicsContext3DManager.cpp: Rather than try
to mux directly, call into GPUClient.
(WebCore::GraphicsContext3DManager::displayWasReconfigured):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
(WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
* platform/graphics/GraphicsContext3DManager.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure
the virtual display if it didn't happen from muxing.
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::updateCGLContext):
(WebCore::GraphicsContext3D::screenDidChange):
* platform/graphics/mac/SwitchingGPUClient.cpp: Added.
(WebCore::SwitchingGPUClient::singleton):
(WebCore::SwitchingGPUClient::setSingleton):
* platform/graphics/mac/SwitchingGPUClient.h: Added.
* testing/Internals.cpp: Testing helper.
(WebCore::Internals::hasMuxableGPU):
* testing/Internals.h:
* testing/Internals.idl:
2018-10-02 Chris Dumez <cdumez@apple.com>
Image.__proto__ should be Function.prototype, not HTMLElement.prototype
https://bugs.webkit.org/show_bug.cgi?id=190216
Reviewed by Alex Christensen.
Properties created for named constructors should always use Function.prototype as prototype, as per:
- https://heycam.github.io/webidl/#named-constructors
Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's
prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype
instead of Function.prototype.
No new tests, rebaselined existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
2018-10-02 Alex Christensen <achristensen@webkit.org>
Prepare WebCoreNSURLExtras for ARC
https://bugs.webkit.org/show_bug.cgi?id=190219
Reviewed by Tim Horton.
ARC doesn't like the explicit sending of -release.
Use RetainPtr instead.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::collectRangesThatNeedMapping):
(WebCore::collectRangesThatNeedEncoding):
(WebCore::collectRangesThatNeedDecoding):
(WebCore::applyHostNameFunctionToMailToURLString):
(WebCore::applyHostNameFunctionToURLString):
(WebCore::mapHostNames):
(WebCore::stringByTrimmingWhitespace):
(WebCore::URLWithUserTypedString):
(WebCore::userVisibleString):
(WebCore::rangeOfURLScheme):
(WebCore::looksLikeAbsoluteURL):
(WebCore::retain): Deleted.
2018-10-02 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix missing values of resource timing API.
https://bugs.webkit.org/show_bug.cgi?id=190193
Reviewed by Alex Christensen.
The property nextHopProtocol was not returned correctly. It was
returned only when remote inspector is opened.
Tests: http/wpt/resource-timing/rt-nextHopProtocol.html
http/wpt/resource-timing/rt-nextHopProtocol.worker.html
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
2018-10-02 Alex Christensen <achristensen@webkit.org>
Remove unused linked-on-or-before-iOS5 check
https://bugs.webkit.org/show_bug.cgi?id=190164
Reviewed by Michael Saboff.
If an app hasn't been updated since iOS5, it can't run supported iOS.
This value is also only checked in an uninstantiated template function.
* platform/URL.cpp:
(WebCore::enableURLSchemeCanonicalization): Deleted.
(WebCore::equal): Deleted.
* platform/URL.h:
2018-10-02 Alex Christensen <achristensen@webkit.org>
Remove ParsedURLString
https://bugs.webkit.org/show_bug.cgi?id=190154
Reviewed by Chris Dumez.
Before the introduction of URLParser, it would indicate that we should assume the String
is from a valid URL so we can skip canonicalization and just find the offsets inside the String
to quickly create a URL. It was a performance optimization that caused security issues when
misused. Since the introduction of URLParser, we have a fast path for all URL parsing, so
right now it actually doesn't change any behavior. It's just a relic of the past that complicates
the URL class, making it harder to express which constructor to use and making it harder to move
the class.
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::NavigatorContentUtils::registerProtocolHandler):
(WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
(WebCore::NavigatorContentUtils::unregisterProtocolHandler):
* dom/Document.cpp:
(WebCore::Document::updateBaseURL):
(WebCore::Document::initSecurityContext):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* editing/markup.cpp:
(WebCore::completeURLs):
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createBlobURL):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::url const):
(WebCore::HistoryItem::originalURL const):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::location const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::stop):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::resourceStyleSheetText const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
(WebCore::InspectorPageAgent::getResourceContent):
(WebCore::InspectorPageAgent::searchInResource):
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresources const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::initForSynthesizedDocument):
* loader/HistoryController.cpp:
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
(WebCore::ApplicationCache::resourceForURL):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::startLoadingEntry):
(WebCore::ApplicationCacheGroup::addEntry):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::loadCache):
(WebCore::ApplicationCacheStorage::manifestURLs):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::urlForBlankFrame):
* platform/URL.cpp:
(WebCore::blankURL):
* platform/URL.h:
(): Deleted.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::decodeBase):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
* platform/network/cf/DNSResolveQueueCFNet.cpp:
(WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies):
(WebCore::CookieJarDB::setCookie):
(WebCore::CookieJarDB::deleteCookie):
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
2018-10-02 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Cue with line setting is not rendered correctly
https://bugs.webkit.org/show_bug.cgi?id=190168
Reviewed by Eric Carlson.
When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
settings.
Test: media/track/track-cue-line-position.html
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
(WebCore::VTTCue::getPositionCoordinates const):
(WebCore::VTTCue::setCueSettings):
2018-10-02 Antti Koivisto <antti@apple.com>
User installed fonts are not always disabled when they should be
https://bugs.webkit.org/show_bug.cgi?id=190195
Reviewed by Geoffrey Garen.
SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
is also a performance issue as various font caches include this setting in the key.
* platform/graphics/FontDescription.cpp:
(WebCore::m_shouldAllowUserInstalledFonts):
Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
Add assertion. This verified the change with the existing tests.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
Always disallow user fonts in SVG used as images.
2018-10-01 Dean Jackson <dino@apple.com>
Remove CSS Animation Triggers
https://bugs.webkit.org/show_bug.cgi?id=190175
<rdar://problem/44925626>
Reviewed by Simon Fraser.
Remove the never-properly specified CSS Animation Triggers.
* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAnimationTriggerScrollValue.cpp: Removed.
* css/CSSAnimationTriggerScrollValue.h: Removed.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
(WebCore::createAnimationTriggerValue): Deleted.
(WebCore::animationTriggerValue): Deleted.
* css/CSSProperties.json:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
* css/CSSToStyleMap.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeWebkitAnimationTrigger): Deleted.
* page/FrameView.cpp:
(WebCore::FrameView::sendScrollEvent):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine):
(WebCore::AnimationBase::fireAnimationEventsIfNeeded):
(WebCore::AnimationBase::timeToNextService):
(WebCore::AnimationBase::getElapsedTime const):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
(WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
(WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
(WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
(WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
(WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateKeyframeAnimations):
* page/animation/CompositeAnimation.h:
(WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
* platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
(WebCore::Animation::operator=):
(WebCore::Animation::animationsMatch const):
* platform/animation/Animation.h:
(WebCore::Animation::isTimingFunctionSet const):
(WebCore::Animation::isEmpty const):
(WebCore::Animation::clearTimingFunction):
(WebCore::Animation::clearAll):
(WebCore::Animation::animationMode const):
(WebCore::Animation::setAnimationMode):
(WebCore::Animation::initialTimingFunction):
(WebCore::Animation::isTriggerSet const): Deleted.
(WebCore::Animation::clearTrigger): Deleted.
(WebCore::Animation::trigger const): Deleted.
(WebCore::Animation::setTrigger): Deleted.
(WebCore::Animation::initialTrigger): Deleted.
* platform/animation/AnimationTrigger.h: Removed.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2018-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236624 and r236671.
https://bugs.webkit.org/show_bug.cgi?id=190207
The change in r236624 introduced crashes on the bots
(Requested by ryanhaddad on #webkit).
Reverted changesets:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236624
"Unify implementation in VideoFullscreenInterfaceAVKit"
https://bugs.webkit.org/show_bug.cgi?id=190091
https://trac.webkit.org/changeset/236671
2018-10-02 Sihui Liu <sihui_liu@apple.com>
Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
https://bugs.webkit.org/show_bug.cgi?id=190178
Reviewed by Chris Dumez.
This would help debug rdar://problem/44902833.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
2018-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236719.
https://bugs.webkit.org/show_bug.cgi?id=190197
this revision caused 39 layout test failures that tested for
scrolling, a bug was also not present in the commit or change
log. (Requested by Truitt on #webkit).
Reverted changeset:
"Unreviewed, fix unused variable in
RenderLayer::updateScrollableAreaSet"
https://trac.webkit.org/changeset/236719
2018-10-02 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Add h264parse to accept MP4 without stss
https://bugs.webkit.org/show_bug.cgi?id=190143
Reviewed by Xabier Rodriguez-Calvar.
The MP4 file used in this URL does not contain a stss (Sync Sample
Box). In consequence, in acordance with the ISO BMFF spec, all samples
are assumed to be sync frames... But in this case that is not true,
it's just that the file is wrong (e.g. created with a buggy muxer).
http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
The way it works in other browsers is because instead of trusting the
MP4 stss table, they rely on parsing the h264 frames. We can do that
too.
This patch also changes RELEASE_ASSERT() when creating the parsers
to GLib criticals.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::createOptionalParserForFormat):
2018-10-02 Eric Carlson <eric.carlson@apple.com>
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>
Reviewed by Youenn Fablet.
No new tests, covered by existing tests.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
to base class.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
as passed salt.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
(WebCore::MediaStreamTrack::getCapabilities const): Ditto.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
to base class.
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
* platform/mediastream/MediaConstraints.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
(WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
(WebCore::RealtimeMediaSource::hashedId const): New.
(WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
a source.
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Ditto.
(WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create): Ditto.
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
(WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
(WebCore::AVVideoCaptureSource::capabilities): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create): Update parameters.
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Update parameters.
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
* platform/mock/MockRealtimeVideoSource.h:
2018-10-02 Philippe Normand <pnormand@igalia.com>
[GStreamer][playbin3] Stream tag lists leaks
https://bugs.webkit.org/show_bug.cgi?id=190192
Reviewed by Xabier Rodriguez-Calvar.
The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
Also check the tags list pointer which might be NULL in some cases.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2018-10-01 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
have any changes in this function....
2018-10-02 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Make same thread assert non-release
https://bugs.webkit.org/show_bug.cgi?id=189924
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::handleNewAppsinkSample):
2018-10-01 Ryosuke Niwa <rniwa@webkit.org>
Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
https://bugs.webkit.org/show_bug.cgi?id=190108
Reviewed by Wenson Hsieh.
Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating
a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug
demonstrated in editing/pasteboard/paste-table-003.html.
Test: editing/pasteboard/paste-table-003.html
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat): Adopt the new variant.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Ditto.
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearance): Added.
* editing/markup.h:
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Ditto.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection): Ditto.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeSelection): Ditto.
2018-10-01 Alex Christensen <achristensen@webkit.org>
Don't read from WebCore's bundle for IDNScriptWhiteList
https://bugs.webkit.org/show_bug.cgi?id=190157
Reviewed by Dan Bernstein.
No change in behavior. This increases performance by not reading from the WebCore bundle,
and it makes it so that URL-related functionality can be moved to a place without
a bundle for resources.
* Resources/IDNScriptWhiteList.txt: Removed.
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::whiteListIDNScripts):
(WebCore::allCharactersInIDNScriptWhiteList):
(WebCore::readIDNScriptWhiteListFile): Deleted.
2018-10-01 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r236551.
Fails URL validating too aggressively
Reverted changeset:
"URLWithUserTypedString should return nil for URLs deemed to
be invalid by WebCore::URL"
https://bugs.webkit.org/show_bug.cgi?id=189979
https://trac.webkit.org/changeset/236551
2018-10-01 Keith Miller <keith_miller@apple.com>
Create a RELEASE_AND_RETURN macro for ExceptionScopes
https://bugs.webkit.org/show_bug.cgi?id=190163
Reviewed by Mark Lam.
The new RELEASE_AND_RETURN does all the work for cases
where you want to return the result of some expression
without explicitly checking for an exception. This is
much like the existing RETURN_IF_EXCEPTION macro.
No new tests since this is a refactor.
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::put):
2018-10-01 Daniel Bates <dabates@apple.com>
Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678>
(https://bugs.webkit.org/show_bug.cgi?id=189974)
Explicitly cast index to unsigned to make the operator[] call unambiguous.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
2018-10-01 Ryosuke Niwa <rniwa@webkit.org>
ASAN failure in ~GCReachableRef()
https://bugs.webkit.org/show_bug.cgi?id=190113
Reviewed by Darin Adler.
The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN
in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's
the simplest solution here although we could unpoison Ref temporarily as done in ~Ref.
* dom/GCReachableRef.h:
(WebCore::GCReachableRef::GCReachableRef):
(WebCore::GCReachableRef::~GCReachableRef):
(WebCore::GCReachableRef::operator-> const):
(WebCore::GCReachableRef::get const):
(WebCore::GCReachableRef::operator T& const):
(WebCore::GCReachableRef::operator! const):
(WebCore::GCReachableRef::isNull const): Deleted.
2018-10-01 Sihui Liu <sihui_liu@apple.com>
Remove StorageProcess
https://bugs.webkit.org/show_bug.cgi?id=189975
Reviewed by Geoffrey Garen.
Clean up code. No behavior change.
* English.lproj/Localizable.strings:
2018-10-01 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Set a minimum sample duration
https://bugs.webkit.org/show_bug.cgi?id=190125
Reviewed by Xabier Rodriguez-Calvar.
The last sample of the audio track in the asset used in this test
player has a tiny duration (100 ns):
http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
So small, we were truncating it to zero. We're not supposed to have
frames with zero duration. Instead, lets set a minimum frame duration
for those fringe cases.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
2018-10-01 Daniel Bates <dabates@apple.com>
[iOS] Special keys are misidentified in DOM keyboard events
https://bugs.webkit.org/show_bug.cgi?id=189974
Reviewed by Wenson Hsieh.
This patch fixes two issues:
1. Special keyboard keys would be misidentified in dispatched DOM keyboard events.
2. DOM keypress events may not be dispatched for some special keys.
UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow,
Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other
special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need
to explicitly handle these special keyboard keys in order to be able to identify the key that
was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM
keypress event for the key.
Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF700–0xF8FF to
represent special keyboard keys. This makes it straightforward to disambiguate such keys using
the input string of the keyboard event alone. To simplify the implementation for iOS
we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode()
below for more details on why this is done.
Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html
fast/events/ios/keypress-keys-in-non-editable-element.html
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
Do not use unified source build strategy when building WebEvent.mm as it makes
use of SoftLinking macros that are incompatible with this strategy.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes.
These special char codes are generated by WebKit. WebKit uses the same special char codes
as AppKit as a convenience instead of defining our own constants for the same purpose.
Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us
to use integer arithmetic and switch blocks to map characters to Windows virtual key
codes as opposed to special cased branches to perform pointer or string comparisions.
The latter would be necessary in Modern WebKit in order for key down events to be properly
disambiguated to dispatch a DOM keypress event because pointers are not perserved, though
what they point to is, when sending the WebEvent from UIProcess to the WebProcess and
vice versa.
(WebCore::isFunctionKey): Convenience function that determines whether the specified char
code corresponds to a function key on the keyboard. The term "function key" is taken from
AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24,
and cursor keys among other special keyboard keys.
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey().
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as
we now map such special input strings to char codes and hence can use the default code path.
(WebCore::keyForKeyEvent): Ditto.
(WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding
to a UIKit special key command now that we map such special input strings to char codes and
subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code
for the event.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up
WebEvent.keyCode to account for UIKit special input strings now that we map such special key
commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code.
(WebCore::convertSpecialKeyToCharCode): Deleted.
(WebCore::keyCodeForEvent): Deleted.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string
to the corresponding AppKit-compatible one (if not already compatible). See the explaination
for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done.
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Normalize the character strings to be AppKit compatible.
2018-10-01 Simon Fraser <simon.fraser@apple.com>
Optimize RenderStyle::diff() and clean up the code
https://bugs.webkit.org/show_bug.cgi?id=190104
Reviewed by Dan Bernstein.
RenderStyle::changeRequiresLayout() and related should only check values on
m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality.
To reduce the chances of future changes regressing this, move code comparing values
on StyleRare[Non]InheritedData into dedication functions.
In addition, the transform comparison double-compared the transformOperations,
because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform
is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform.
Change the first to be a pointer comparison.
* rendering/style/RenderStyle.cpp:
(WebCore::rareNonInheritedDataChangeRequiresLayout):
(WebCore::rareInheritedDataChangeRequiresLayout):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
(WebCore::rareNonInheritedDataChangeRequiresRepaint):
(WebCore::rareInheritedDataChangeRequiresRepaint):
(WebCore::RenderStyle::changeRequiresRepaint const):
2018-10-01 Alex Christensen <achristensen@webkit.org>
URL should not use TextEncoding internally
https://bugs.webkit.org/show_bug.cgi?id=190111
Reviewed by Andy Estes.
That dependency makes it impossible to move or use elsewhere.
Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL.
No change in behavior as verified by new API tests.
* page/SecurityOrigin.cpp:
* page/csp/ContentSecurityPolicySourceList.cpp:
* platform/URL.cpp:
(WebCore::decodeEscapeSequencesFromParsedURL):
(WebCore::URL::user const):
(WebCore::URL::pass const):
(WebCore::URL::fileSystemPath const):
(WebCore::decodeURLEscapeSequences): Deleted.
* platform/URL.h:
* platform/network/DataURLDecoder.cpp:
* platform/text/TextEncoding.cpp:
(WebCore::decodeURLEscapeSequences):
* platform/text/TextEncoding.h:
2018-10-01 Simon Pieters <zcorpan@gmail.com>
<form> in quirks mode should have margin-block-end: 1em
https://bugs.webkit.org/show_bug.cgi?id=157788
Reviewed by Simon Fraser.
Change the default style for forms to take writing-mode into account
in quirks mode. Matches the behavior of Gecko and Edge and the HTML
standard.
Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html
* css/quirks.css:
(form):
2018-10-01 Jeremy Jones <jeremyj@apple.com>
Unify implementation in VideoFullscreenInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=190091
rdar://problem/44734523
Reviewed by Jer Noble.
No new tests because no behavior change.
Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
any changes that had been made in the old path.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
2018-10-01 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure renderers with accelerated animations have layers
https://bugs.webkit.org/show_bug.cgi?id=189990
Reviewed by Simon Fraser.
In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has
accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with
exclusively accelerated animations running.
No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument):
(WebCore::DocumentTimeline::animationWasAddedToElement):
(WebCore::DocumentTimeline::animationWasRemovedFromElement):
(WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine
whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or
add this element.
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements
running accelerated animations.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
* rendering/RenderBoxModelObject.h:
2018-10-01 Alicia Boya García <aboya@igalia.com>
[GStreamer] Fix abort in gst_sample_get_info()
https://bugs.webkit.org/show_bug.cgi?id=190135
Reviewed by Philippe Normand.
A flush can occur before any frame has finished decoding -- especially
in tests, where actions on the player often occur in quick succession.
Therefore, the code must not assume by the time a flush occurs any
frame has reached the sink. This patch fixes a case when such wrong
assumption was causing gst_sample_get_info() to abort (crashing
WebKit).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2018-10-01 Olivier Blin <olivier.blin@softathome.com>
[WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=190139
Reviewed by Michael Catanzaro.
Like done upstream for EFL in r210213
https://bugs.webkit.org/show_bug.cgi?id=166622
This has been detected by a charactersAreAllASCII() assert failure.
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.
* platform/wpe/RenderThemeWPE.cpp:
(WebCore::RenderThemeWPE::mediaControlsStyleSheet):
Explicitely pass the size to the String constructor.
2018-10-01 Rob Buis <rbuis@igalia.com>
Align XMLHttpRequest's overrideMimeType() with the standard
https://bugs.webkit.org/show_bug.cgi?id=169276
Reviewed by Chris Dumez.
Implement the overrideMimeType() as specified in that standard, i.e.
add a check that the passed mime type is valid and if not fallback
to application/octet-stream.
In order for this patch to have any effect, I went ahead and
made an improvement to the ContentType parsing, parseContentType now
will reject mime types that do not match the type / subtype format, I
believe this is required by both RFC2045 and mimesniff specs.
This behavior matches Chrome and Firefox.
Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
* platform/network/ParsedContentType.cpp:
(WebCore::parseContentType):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::overrideMimeType):
2018-10-01 Chris Dumez <cdumez@apple.com>
Make crossOriginObject.then undefined for promises
https://bugs.webkit.org/show_bug.cgi?id=190094
Reviewed by Darin Adler.
Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
and Location objects.
Specification:
- https://github.com/whatwg/html/pull/3242
- https://github.com/whatwg/dom/issues/536
This aligns our behavior with Blink and Gecko.
No new tests, rebaselined existing test.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::addCrossOriginWindowOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::addCrossOriginLocationOwnPropertyNames):
2018-10-01 Xan Lopez <xan@igalia.com>
[SOUP] Fix the build for libsoup > 2.61.90
https://bugs.webkit.org/show_bug.cgi?id=190126
Reviewed by Michael Catanzaro.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
2018-10-01 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Reset running time in PlaybackPipeline::flush()
https://bugs.webkit.org/show_bug.cgi?id=190076
Reviewed by Philippe Normand.
Test: media/media-source/media-source-seek-redundant-append.html
PlaybackPipeline::flush() is called when already enqueued frames are
appended again. This may be caused by a quality change or just a
redundant append. Either way, the pipeline has to be flushed and
playback begin again, but without changing the player position by
much.
There are two kinds of time to consider here: stream time (i.e. the
time of a frame as written in the file, e.g. a frame may have stream
time 0:01:00), and running time (i.e. how much time since playback
started should pass before the frame should be played, e.g. if we
started playing at 0:00:59 that same frame would have a running time
of just 1 second).
Notice how running time depends on where and when playback starts.
Running time can also be optionally resetted after a flush. (This is
indeed done currently by most demuxers after a seek.)
Instead of resetting running time, PlaybackPipeline used to modify the
first GstSegment emitted after the flush. A GstSegment declares the
mapping between stream time and running time for the following frames.
There, PlaybackPipeline used to set `base` (the running time at which
the segment starts) to the position reported by a position query
(which is stream time).
This, of course, only worked when playback (or the last seek) started
at stream time 0:00:00, since that's the only case where running time
equals stream time. In other cases delays as long as the difference
between these timelines would appear. This is demonstrated in the
attached test, where seeks and appends are made in such an order that
the difference is more than 5 minutes, making the playback stall for
>5 minutes before playing 1 second of audio.
This patch fixes the problem by resetting running time with the flush
and not modifying GstSegment.base anymore (it will be left as zero,
which is now correct since the running time has been reset).
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::flush):
(WebCore::segmentFixerProbe): Deleted.
2018-09-30 Ryosuke Niwa <rniwa@webkit.org>
Use Position instead of Range in createMarkupInternal
https://bugs.webkit.org/show_bug.cgi?id=190107
Reviewed by Darin Adler.
Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator
in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of
Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator.
Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612.
* dom/Position.cpp:
(WebCore::Position::firstNode const): Added.
* dom/Position.h:
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range.
(WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator): Made this class non-copyable.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions.
(WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled
instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets.
(WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect
boundary offsets defined by m_start and m_end Positions instead of m_range Range.
(WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto.
(WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end
Positions. Note that the end position is always the next node in the tree order for a character node
and computeNodeAfterPosition returns nullptr for a character data.
(WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range.
(WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete
comments which were added for DOMRange in WebKitLegacy.
(WebCore::serializePreservingVisualAppearance):
(WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to
serializePreservingVisualAppearanceInternal.
(WebCore::serializeFragment):
* editing/markup.h:
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier.
2018-09-30 Walker Henderson <wjahenderson@gmail.com>
AudioNode.connect should return passed destination node
https://bugs.webkit.org/show_bug.cgi?id=188834
Reviewed by Eric Carlson.
No new tests, rebaselined existing test.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect): Deleted.
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioNode.cpp:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNode.idl:
2018-09-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up RealtimeMediaSource settings change handling
https://bugs.webkit.org/show_bug.cgi?id=189998
<rdar://problem/44797884>
Reviewed by Youenn Fablet.
No new tests, updated webrtc/video-disabled-black.html.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::settings):
(WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::settings):
(WebCore::RealtimeIncomingVideoSource::settingsDidChange):
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::settingsDidChange):
(WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
(WebCore::RealtimeMediaSource::setSize):
(WebCore::RealtimeMediaSource::setFrameRate):
(WebCore::RealtimeMediaSource::setAspectRatio):
(WebCore::RealtimeMediaSource::setFacingMode):
(WebCore::RealtimeMediaSource::setVolume):
(WebCore::RealtimeMediaSource::setSampleRate):
(WebCore::RealtimeMediaSource::setSampleSize):
(WebCore::RealtimeMediaSource::setEchoCancellation):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::settingsDidChange):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::settingsDidChange):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settingsDidChange):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::settingsDidChange):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settingsDidChange):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::settingsDidChange):
2018-09-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Use display-specific capture factories
https://bugs.webkit.org/show_bug.cgi?id=190043
<rdar://problem/44834412>
Reviewed by Youenn Fablet.
No new tests, no change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
(WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
(WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
* platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
(WebCore::SingleSourceFactory::setActiveSource):
(WebCore::SingleSourceFactory::unsetActiveSource):
* platform/mediastream/RealtimeMediaSourceFactory.h: Added.
(WebCore::SingleSourceFactory::activeSource):
(WebCore::VideoCaptureFactory::setVideoCapturePageState):
(WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::libWebRTCVideoCaptureSourceFactory):
(WebCore::libWebRTCDisplayCaptureSourceFactory):
(WebCore::GStreamerVideoCaptureSource::factory):
(WebCore::GStreamerVideoCaptureSource::displayFactory):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::factory):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::audioFactory):
(WebCore::RealtimeMediaSourceCenterMac::videoFactory):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
(): Deleted.
(WebCore::mockAudioCaptureSourceFactory): Deleted.
(WebCore::MockRealtimeAudioSource::factory): Deleted.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoFactory):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(): Deleted.
(WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
(WebCore::mockVideoCaptureSourceFactory): Deleted.
(WebCore::MockRealtimeVideoSource::factory): Deleted.
* platform/mock/MockRealtimeVideoSource.h:
2018-09-29 Oriol Brufau <obrufau@igalia.com>
[css-grid] Properly align items next to collapsed tracks with gutters
https://bugs.webkit.org/show_bug.cgi?id=190089
Reviewed by Manuel Rego Casasnovas.
gridAreaPositionForInFlowChild could return a wrong end position for
grid items adjacent to a collapsed track, because it didn't take into
account that gutters collapse in that case. Therefore, "center" or
"end" alignments displayed the item at the wrong position.
Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
2018-09-29 Alicia Boya García <aboya@igalia.com>
[GStreamer][MSE] Use GObject for GST_TRACE_OBJECT
https://bugs.webkit.org/show_bug.cgi?id=190045
Reviewed by Philippe Normand.
Passing a non-GObject object to GST_TRACE_OBJECT() can be
theoretically misunderstood by the GStreamer logging function, so this
patch avoids that.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleEndOfAppend):
(WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
(WebCore::AppendPipeline::pushNewBuffer):
2018-09-28 Zamiul Haque <zhaque@apple.com>
Angled gradient backgrounds in body render vertically when body height is 0
https://bugs.webkit.org/show_bug.cgi?id=177232
<rdar://problem/34548230>.
Reviewed by Tim Horton.
Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered
as if they are vertical when the body tag containing the gradient
has a height of 0. Other browsers do not render under these circumstances,
so WebKit was modified to follow in suit. The problem was due to layout sizes for
fill tiles being calculated with a minimum height of 1px. A simple change of the
minimum height and width to 0px was enough to bring about the desired behavior.
Tests: angled-background-repeating-gradient-rendering-vertical.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize const):
2018-09-28 Wenson Hsieh <wenson_hsieh@apple.com>
No DOM API to instantiate an attachment for an img element
https://bugs.webkit.org/show_bug.cgi?id=189934
<rdar://problem/44743222>
Reviewed by Ryosuke Niwa.
Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use
to ensure that an image element is backed by a unique _WKAttachment. See below for more details.
Tests: WKAttachmentTests.AddAttachmentToConnectedImageElement
WKAttachmentTests.ChangeFileWrapperForPastedImage
WKAttachmentTests.ConnectImageWithAttachmentToDocument
* dom/Document.cpp:
(WebCore::Document::registerAttachmentIdentifier):
Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating
a new empty attachment to back an image element.
* dom/Document.h:
* editing/Editor.cpp:
(WebCore::Editor::registerAttachmentIdentifier):
(WebCore::Editor::notifyClientOfAttachmentUpdates):
* editing/Editor.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
Creates an attachment element to back the image element, if an attachment does not already exist, and returns
the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose
file wrapper determines the contents of the image.
(WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
(WebCore::HTMLAttachmentElement::hasEnclosingImage const):
(WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
Add a helper that updates the source of the enclosing image element given a content type and image data, by
creating a new blob and blob URL.
* html/HTMLAttachmentElement.h:
* html/HTMLAttachmentElement.idl:
* html/HTMLImageElement.idl:
Rename webkitAttachmentIdentifier to just attachmentIdentifier.
* page/EditorClient.h:
(WebCore::EditorClient::registerAttachmentIdentifier):
(WebCore::EditorClient::didInsertAttachmentWithIdentifier):
2018-09-28 Chris Dumez <cdumez@apple.com>
The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
https://bugs.webkit.org/show_bug.cgi?id=190090
Reviewed by Ryosuke Niwa.
The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
- https://html.spec.whatwg.org/#onbeforeunloadeventhandler
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5)
In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT
cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is
because the return value cannot be false at:
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
No new tests, rebaselined existing test.
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
2018-09-28 Simon Fraser <simon.fraser@apple.com>
RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
https://bugs.webkit.org/show_bug.cgi?id=190093
Reviewed by Dean Jackson and Zalan Bujtas.
It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
because this is called at style update time, and layout will be stale.
It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
changes and triggers layout accordingly, which will result in a full post-layout
updateLayerPositions().
This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
we need it to trigger layout (for now) because it affects z-order.
Covered by existing tests.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::removeOnlyThisLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout const):
2018-09-28 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Polish WebAuthN auto-test environment
https://bugs.webkit.org/show_bug.cgi?id=189283
<rdar://problem/44117828>
Reviewed by Chris Dumez.
This patch removes the old mocking mechanism.
Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockAuthenticatorCoordinator.cpp: Removed.
* testing/MockAuthenticatorCoordinator.h: Removed.
* testing/MockAuthenticatorCoordinator.idl: Removed.
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
Two sources of raw pointers in the Fullscreen code:
- Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
they are passed around as raw references.
- Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
be ref-able.
Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
derefModel methods, overridden by implementing subclasses. Make every concrete observer
inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
the client interface.
Since every Interface class now holds a strong reference to its Model classes, and each
Model class holds a weak reference to all its clients, no explicit invalidate() method
is necessary.
Notes:
- Since the weak pointer methods need to be able to downcast to the abstract base class,
observers need to inherit publically (rather than privately) from those base classes.
- Media element Models should compose EventListener rather than inheriting from it, since
EventListener has its own RefCount.
- WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
their underlying object is destroyed), so clients should be stored in a Vector instead.
- Interfaces should be given all required Refs at creation time, so that they can store
those parameters as Refs instead of RefPtrs.
* platform/cocoa/PlaybackSessionInterface.h:
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModel::ref):
(WebCore::PlaybackSessionModel::deref):
(WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::addClient):
(WebCore::PlaybackSessionModelMediaElement::removeClient):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
(WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
* platform/cocoa/VideoFullscreenChangeObserver.h:
(WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::ref):
(WebCore::VideoFullscreenModel::deref):
(WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):
(VideoFullscreenModelVideoElement::addClient):
(VideoFullscreenModelVideoElement::removeClient):
(VideoFullscreenModelVideoElement::setHasVideo):
(VideoFullscreenModelVideoElement::setVideoDimensions):
(VideoFullscreenModelVideoElement::willEnterPictureInPicture):
(VideoFullscreenModelVideoElement::didEnterPictureInPicture):
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
(VideoFullscreenModelVideoElement::willExitPictureInPicture):
(VideoFullscreenModelVideoElement::didExitPictureInPicture):
(VideoFullscreenModelVideoElement::handleEvent): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.h:
(WebCore::PlaybackSessionInterfaceAVKit::create):
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
(): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(VideoFullscreenInterfaceAVKit::create):
(VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(VideoFullscreenInterfaceAVKit::setMode):
(VideoFullscreenInterfaceAVKit::clearMode):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
(VideoFullscreenInterfaceAVKit::invalidate): Deleted.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController delegate]):
(-[WebAVPlayerController playbackSessionInterface]):
(-[WebAVPlayerController setPlaybackSessionInterface:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::didCleanupFullscreen):
(VideoFullscreenControllerContext::addClient):
(VideoFullscreenControllerContext::removeClient):
(VideoFullscreenControllerContext::willEnterPictureInPicture):
(VideoFullscreenControllerContext::didEnterPictureInPicture):
(VideoFullscreenControllerContext::failedToEnterPictureInPicture):
(VideoFullscreenControllerContext::willExitPictureInPicture):
(VideoFullscreenControllerContext::didExitPictureInPicture):
(VideoFullscreenControllerContext::setUpFullscreen):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::create):
(WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
(WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
(WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::PlaybackSessionInterfaceMac::endScrubbing):
(WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
(WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
(WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
(WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::create):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
(WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
(WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
(WebCore::VideoFullscreenInterfaceMac::setMode):
(WebCore::VideoFullscreenInterfaceMac::clearMode):
(WebCore::VideoFullscreenInterfaceMac::invalidate):
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager togglePlayback]):
(-[WebPlaybackControlsManager setPlaying:]):
(-[WebPlaybackControlsManager isPlaying]):
(-[WebPlaybackControlsManager togglePictureInPicture]):
2018-09-28 Chris Dumez <cdumez@apple.com>
Drop support for cross-origin-window-policy header
https://bugs.webkit.org/show_bug.cgi?id=190081
Reviewed by Ryosuke Niwa.
Drop support for cross-origin-window-policy header as this was never enabled and its design has
some issues we have not resolved. An alternative is being worked on but will be substantially
different so there is not much value in keeping this code around.
* bindings/js/JSDOMBindingSecurity.cpp:
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::addCrossOriginWindowPropertyNames):
(WebCore::addScopedChildrenIndexes):
(WebCore::addCrossOriginWindowOwnPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSDOMWindowCustom.h:
* bindings/js/JSRemoteDOMWindowCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* dom/Document.cpp:
(WebCore::Document::canNavigate):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* page/AbstractDOMWindow.cpp:
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
* page/AbstractDOMWindow.h:
* page/DOMWindow.idl:
* page/Settings.yaml:
* platform/network/HTTPParsers.cpp:
* platform/network/HTTPParsers.h:
2018-09-28 Daniel Bates <dabates@apple.com>
[iOS] Allow programmatic focus when hardware keyboard is attached
https://bugs.webkit.org/show_bug.cgi?id=190017
<rdar://problem/42270463>
Reviewed by Wenson Hsieh.
Add support for checking if the embedding client is WebKitTestRunner and export isDumpRenderTree()
so that we can make use of it from WebKit. We will make use of these functions to keep the current
behavior of disallowing programmatic focus when running tests in these apps. This is needed to
keep testing deterministic. Otherwise, test results would be dependent on whether a hardware
keyboard is attached. When running tests in Simulator.app the hardware keyboard may also not be
connected (i.e. Hardware > Keyboard > Connect Hardware Keyboard is disabled).
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isWebKitTestRunner): Added.
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r236609): API tests for mso list preservation are failing
https://bugs.webkit.org/show_bug.cgi?id=190095
Reviewed by Wenson Hsieh.
The regression was caused by appendNodeToPreserveMSOList called after an early return for not having renderer.
Clearly, comment & style elements coming from a MS word document wouldn't have a renderer.
Fixed the bug by changing the order.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Build fix after r236612.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeSelection):
2018-09-28 Andy Estes <aestes@apple.com>
[Apple Pay] Remove the "in-store" button type
https://bugs.webkit.org/show_bug.cgi?id=190079
Reviewed by Tim Horton.
According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
this button is meant only for certain kinds of native apps. It shouldn't be available on the web.
Updated http/tests/ssl/applepay/ApplePayButton.html.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:
2018-09-28 Chris Dumez <cdumez@apple.com>
document.open() should throw errors for cross-origin calls
https://bugs.webkit.org/show_bug.cgi?id=189371
<rdar://problem/44282700>
Reviewed by Youenn Fablet.
document.open() / document.write() should throw errors for cross-origin calls as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 4)
No new tests, rebaselined existing tests.
* dom/Document.cpp:
(WebCore::Document::open):
(WebCore::Document::write):
(WebCore::Document::writeln):
* dom/Document.h:
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Rename createMarkup to serializePreservingVisualAppearance
https://bugs.webkit.org/show_bug.cgi?id=190086
Reviewed by Wenson Hsieh.
Renamed the function to clarify what it does. Also removed the unused Range::toHTML.
* dom/Range.cpp:
(WebCore::Range::toHTML const): Deleted.
* dom/Range.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearance):
(WebCore::createMarkup): Deleted.
* editing/markup.h:
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeRangeToDataObject):
2018-09-28 Simon Fraser <simon.fraser@apple.com>
Remove some unused RenderLayer code
https://bugs.webkit.org/show_bug.cgi?id=190078
Reviewed by Zalan Bujtas.
The 'outOfFlowDescendantContainingBlocks' code was related to the accelerated overflow scrolling code that
I removed recently.
updateDescendantsLayerListsIfNeeded() is never called.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateDescendantDependentFlags):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
2018-09-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236605.
https://bugs.webkit.org/show_bug.cgi?id=190087
caused three API test timeouts (Requested by jernoble on
#webkit).
Reverted changeset:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236605
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Simplify StyledMarkupAccumulator::traverseNodesForSerialization
https://bugs.webkit.org/show_bug.cgi?id=190073
Reviewed by Antti Koivisto.
Simplified the range traversal algorithm in traverseNodesForSerialization as it was too complicated
to support shadow DOM for copy and paste.
Instead of using NodeTraversal::next to traverse past ancestors and then figuring out which ancestor
must be closed or to wrap the existing markup with, new code collects the list of ancestors as we
traverse out of them.
Also extracted lambdas for generating markup and deciding whether to skip a node as well as keeping
track of the depth of the current markup. This further reduces the code complexity of the actual
node traversal algorithm. Keeping track of the depth allows us to now generate ancestor elements'
closing tags without keeping a stack of ancestor nodes we opened at all times.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2018-09-27 Ryosuke Niwa <rniwa@webkit.org>
Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
https://bugs.webkit.org/show_bug.cgi?id=190069
Reviewed by Zalan Bujtas.
Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode()
because their implementations are identical.
Note that offsetInCharacters() sounds like a function which returns some kind of an offset
but it doesn't. It returns true when called on a CharacterData and false elsewhere.
* accessibility/AXObjectCache.cpp:
(WebCore::characterOffsetsInOrder):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
* dom/CharacterData.cpp:
(WebCore::CharacterData::offsetInCharacters const): Deleted.
* dom/CharacterData.h:
* dom/Node.cpp:
(WebCore::Node::offsetInCharacters const): Deleted.
* dom/Node.h:
* dom/Position.cpp:
(WebCore::Position::parentAnchoredEquivalent const):
* dom/Position.h:
(WebCore::lastOffsetInNode):
(WebCore::minOffsetForNode):
(WebCore::offsetIsBeforeLastNodeOffset):
* dom/Range.cpp:
(WebCore::Range::firstNode const):
(WebCore::Range::pastLastNode const):
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setOffset):
(WebCore::RangeBoundaryPoint::setToEndOfNode):
* editing/Editing.cpp:
(WebCore::lastOffsetForEditing):
* editing/TextIterator.cpp:
(WebCore::nextInPreOrderCrossingShadowBoundaries):
(WebCore::TextIterator::node const):
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::extend):
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
Two sources of raw pointers in the Fullscreen code:
- Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
they are passed around as raw references.
- Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
be ref-able.
Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
derefModel methods, overridden by implementing subclasses. Make every concrete observer
inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
the client interface.
Since every Interface class now holds a strong reference to its Model classes, and each
Model class holds a weak reference to all its clients, no explicit invalidate() method
is necessary.
Notes:
- Since the weak pointer methods need to be able to downcast to the abstract base class,
observers need to inherit publically (rather than privately) from those base classes.
- Media element Models should compose EventListener rather than inheriting from it, since
EventListener has its own RefCount.
- WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
their underlying object is destroyed), so clients should be stored in a Vector instead.
- Interfaces should be given all required Refs at creation time, so that they can store
those parameters as Refs instead of RefPtrs.
* platform/cocoa/PlaybackSessionInterface.h:
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModel::ref):
(WebCore::PlaybackSessionModel::deref):
(WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::addClient):
(WebCore::PlaybackSessionModelMediaElement::removeClient):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
(WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
* platform/cocoa/VideoFullscreenChangeObserver.h:
(WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::ref):
(WebCore::VideoFullscreenModel::deref):
(WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):
(VideoFullscreenModelVideoElement::addClient):
(VideoFullscreenModelVideoElement::removeClient):
(VideoFullscreenModelVideoElement::setHasVideo):
(VideoFullscreenModelVideoElement::setVideoDimensions):
(VideoFullscreenModelVideoElement::willEnterPictureInPicture):
(VideoFullscreenModelVideoElement::didEnterPictureInPicture):
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
(VideoFullscreenModelVideoElement::willExitPictureInPicture):
(VideoFullscreenModelVideoElement::didExitPictureInPicture):
(VideoFullscreenModelVideoElement::handleEvent): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.h:
(WebCore::PlaybackSessionInterfaceAVKit::create):
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
(): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(VideoFullscreenInterfaceAVKit::create):
(VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(VideoFullscreenInterfaceAVKit::setMode):
(VideoFullscreenInterfaceAVKit::clearMode):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
(VideoFullscreenInterfaceAVKit::invalidate): Deleted.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController delegate]):
(-[WebAVPlayerController playbackSessionInterface]):
(-[WebAVPlayerController setPlaybackSessionInterface:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::didCleanupFullscreen):
(VideoFullscreenControllerContext::addClient):
(VideoFullscreenControllerContext::removeClient):
(VideoFullscreenControllerContext::willEnterPictureInPicture):
(VideoFullscreenControllerContext::didEnterPictureInPicture):
(VideoFullscreenControllerContext::failedToEnterPictureInPicture):
(VideoFullscreenControllerContext::willExitPictureInPicture):
(VideoFullscreenControllerContext::didExitPictureInPicture):
(VideoFullscreenControllerContext::setUpFullscreen):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::create):
(WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
(WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
(WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::PlaybackSessionInterfaceMac::endScrubbing):
(WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
(WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
(WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
(WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::create):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
(WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
(WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
(WebCore::VideoFullscreenInterfaceMac::setMode):
(WebCore::VideoFullscreenInterfaceMac::clearMode):
(WebCore::VideoFullscreenInterfaceMac::invalidate):
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager togglePlayback]):
(-[WebPlaybackControlsManager setPlaying:]):
(-[WebPlaybackControlsManager isPlaying]):
(-[WebPlaybackControlsManager togglePictureInPicture]):
2018-09-28 Chris Dumez <cdumez@apple.com>
Drop iOS specific quirk in SettingsBase::scriptEnabledChanged()
https://bugs.webkit.org/show_bug.cgi?id=190077
<rdar://problem/44812613>
Reviewed by Zalan Bujtas.
Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() that would dirty style after the
"JavaScriptEnabled" setting's state is toggled. I do not see a good reason to do this given that
scripts would not get executed until a reload.
If we find out after dropping this that this is actually useful for some reason, then we can
always bring it back and consider making this non-iOS specific, as well as documenting why this
it is needed.
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::scriptEnabledChanged): Deleted.
* page/SettingsBase.h:
2018-09-27 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix priority issue with multiple cookies with different level of path.
https://bugs.webkit.org/show_bug.cgi?id=189920
Reviewed by Fujii Hironori.
When multiple cookies are stored in the database for same site, the priority of
multiple cookies which matches path criteria was not defined. The backend
implementation `sqlite` then returns the first matching result, which is the one
stored earlier.
Test: http/tests/cookies/cookie-with-multiple-level-path.html
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies):
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Use enum class in createMarkup arguments
https://bugs.webkit.org/show_bug.cgi?id=190028
Reviewed by Wenson Hsieh.
Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes,
EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax.
Also replaced the boolean convertBlocksToInlines with an enum class of the same name.
Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer
to serializeFragment.
* dom/Element.cpp:
(WebCore::Element::innerHTML const):
(WebCore::Element::outerHTML const):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::innerHTML const):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/HTMLInterchange.h:
(WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::MarkupAccumulator):
(WebCore::MarkupAccumulator::serializeNodes):
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::resolveURLIfNeeded const):
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::inXMLFragmentSerialization const):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::willApplyCommand):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentMarkupReader::readRTFD):
(WebCore::WebContentMarkupReader::readRTF):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeImageToPasteboard):
(WebCore::Editor::writeSelectionToPasteboard):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::serializeNodes):
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::highestAncestorToWrapMarkup):
(WebCore::createMarkupInternal):
(WebCore::createMarkup):
(WebCore::sanitizedMarkupForFragmentInDocument):
(WebCore::serializeFragment): Renamed from createMarkup. This is used for innerHTML and XMLSerializer,
which faithfully serializes the fragment without any computed style as inline styles.
(WebCore::documentTypeString):
(WebCore::createFullMarkup): Deleted two varinats used in WebKitLegacy.
* editing/markup.h:
(WebCore::ResolveURLs): Renamed from EAbsoluteURLs.
(WebCore::ConvertBlocksToInlines): Added.
(WebCore::SerializedNodes): Renamed from EChildrenOnly.
(WebCore::SerializationSyntax): Renamed from EFragmentSerialization.
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* inspector/DOMEditor.cpp:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getOuterHTML):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
(WebCore::PageSerializer::serializeFrame):
* page/win/DragControllerWin.cpp:
(WebCore::DragController::declareAndWriteDragImage):
* Source/WebCore/platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeRangeToDataObject):
(WebCore::Pasteboard::writeSelection):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLSerializer.cpp:
(WebCore::XMLSerializer::serializeToString):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::xsltStylesheetPointer):
(WebCore::xmlDocPtrFromNode):
2018-09-27 John Wilander <wilander@apple.com>
Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
https://bugs.webkit.org/show_bug.cgi?id=190055
<rdar://problem/44843460>
Reviewed by Chris Dumez.
Test: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
Corrects legacy statistics for frames and triggers a re-classification.
2018-09-27 Jer Noble <jer.noble@apple.com>
Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't
HAVE(AVCONTENTKEYSESSION).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2018-09-27 Justin Michaud <justin_michaud@apple.com>
Remove duplicate CSS Properties and Values feature on status page
https://bugs.webkit.org/show_bug.cgi?id=189909
Reviewed by Simon Fraser.
Update CSS properties and values api feature in features.json
* features.json:
2018-09-27 Jer Noble <jer.noble@apple.com>
MediaPlayer should have mediaPlayerWaitingForKeyChanged() / bool waitingForKey() accessor
https://bugs.webkit.org/show_bug.cgi?id=189951
Reviewed by Eric Carlson.
In order to implement the "Resume Playback" section of EME, part 4, we need to be able
to query whether the MediaPlayer is still waiting for a key after attemptToDecrypt()
has been called. Currently this involves no behavioral changes, as all modern EME ports
will still just notify the media element that they no longer need keys after one has
been added, but future ports may be able to wait for multiple keys before reporting
that it is no longer waiting for keys.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKeyChanged):
(WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKey): Deleted.
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::waitingForKeyChanged):
(WebCore::MediaPlayer::waitingForKey const):
(WebCore::MediaPlayer::waitingForKey): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKeyChanged):
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKey): Deleted.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::waitingForKey const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
(WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey):
(WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
2018-09-27 Alicia Boya García <aboya@igalia.com>
[MSE] Fix unwanted sample erase from the decode queue
https://bugs.webkit.org/show_bug.cgi?id=180643
Reviewed by Jer Noble.
Test: media/media-source/media-source-append-acb-no-frame-lost.html
This bug reproduced when unordered appends were made. For instance, if
the application appended [0, 10) and then [20, 30), the frame at 20
would be wrongly discarded from the decode queue.
Later the application could append [10, 20) and the gap at [20, 21)
would persist in the decode queue, even if the frame remained in the
track buffer table.
Thanks to Daniel Zhang for reporting the issue.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
2018-09-27 Alex Christensen <achristensen@webkit.org>
URLParser should use TextEncoding through an abstract class
https://bugs.webkit.org/show_bug.cgi?id=190027
Reviewed by Andy Estes.
URLParser uses TextEncoding for one call to encode, which is only used for encoding the query of URLs in documents with non-UTF encodings.
There are 3 call sites that specify the TextEncoding to use from the Document, and even those call sites use a UTF encoding most of the time.
All other URL parsing is done using a well-optimized path which assumes UTF-8 encoding and uses macros from ICU headers, not a TextEncoding.
Moving the logic in this way breaks URL and URLParser's dependency on TextEncoding, which makes it possible to use in a lower-level project
without also moving TextEncoding, TextCodec, TextCodecICU, ThreadGlobalData, and the rest of WebCore and JavaScriptCore.
There is no observable change in behavior. There is now one virtual function call in a code path in URLParser that is not performance-sensitive,
and TextEncodings now have a vtable, which uses a few more bytes of memory total for WebKit.
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContext::completeURL const):
* css/parser/CSSParserIdioms.cpp:
(WebCore::completeURL):
* dom/Document.cpp:
(WebCore::Document::completeURL const):
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::href const):
Move the call to encodingForFormSubmission from the URL constructor to the 3 call sites that specify the encoding from the Document.
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::encodingForURLParsing):
* loader/TextResourceDecoder.h:
* platform/URL.cpp:
(WebCore::URL::URL):
* platform/URL.h:
(WebCore::URLTextEncoding::~URLTextEncoding):
* platform/URLParser.cpp:
(WebCore::URLParser::encodeNonUTF8Query):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::URLParser::encodeQuery): Deleted.
A pointer replaces the boolean isUTF8Encoding and the TextEncoding& which had a default value of UTF8Encoding.
Now the pointer being null means that we use UTF8, and the pointer being non-null means we use that encoding.
* platform/URLParser.h:
(WebCore::URLParser::URLParser):
* platform/text/TextEncoding.cpp:
(WebCore::UTF7Encoding):
(WebCore::TextEncoding::encodingForFormSubmissionOrURLParsing const):
(WebCore::ASCIIEncoding):
(WebCore::Latin1Encoding):
(WebCore::UTF16BigEndianEncoding):
(WebCore::UTF16LittleEndianEncoding):
(WebCore::UTF8Encoding):
(WebCore::WindowsLatin1Encoding):
(WebCore::TextEncoding::encodingForFormSubmission const): Deleted.
Use NeverDestroyed because TextEncoding now has a virtual destructor.
* platform/text/TextEncoding.h:
Rename encodingForFormSubmission to encodingForFormSubmissionOrURLParsing to make it more clear that we are intentionally using it for both.
2018-09-27 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove temporary compatibility fix for auto-dismiss popups
https://bugs.webkit.org/show_bug.cgi?id=189980
<rdar://problem/44780645>
Reviewed by Alex Christensen.
Test: http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss.html
The change in https://bugs.webkit.org/show_bug.cgi?id=183620 was a temporary
compatibility fix as explained in:
https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/. We should
remove it.
Most of these changes remove the parameter isTriggeredByUserGesture since it's no longer needed.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
(WebCore::ResourceLoadObserver::logWindowCreation): Deleted.
* loader/ResourceLoadObserver.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
Now no longer logs anything to ResourceLoadObserver.
2018-09-27 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236557.
Really roll out r236557 this time because it breaks internal
builds.
Reverted changeset:
"Add VP8 support to WebRTC"
https://bugs.webkit.org/show_bug.cgi?id=189976
https://trac.webkit.org/changeset/236557
2018-09-27 Chris Dumez <cdumez@apple.com>
Fragment should be stripped from document URL during document.open() URL propagation
https://bugs.webkit.org/show_bug.cgi?id=189374
<rdar://problem/44282736>
Reviewed by Alex Christensen.
Strip the Document URL fragment during document.open() URL propagation if the entry document
is not the current document, as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 11.2.)
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::open):
2018-09-27 Youenn Fablet <youenn@apple.com>
Add VP8 support to WebRTC
https://bugs.webkit.org/show_bug.cgi?id=189976
Reviewed by Eric Carlson.
Add a runtime flag to control activation of VP8 codec.
Bind this runtime flag to the video codec factories.
Test: webrtc/video-mute-vp8.html
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Enable VP8 codec for tests.
2018-09-27 Chris Dumez <cdumez@apple.com>
Crash under WebCore::deleteCookiesForHostnames()
https://bugs.webkit.org/show_bug.cgi?id=190040
<rdar://problem/38020368>
Reviewed by Alex Christensen.
Update NetworkStorageSession::deleteCookiesForHostnames() to properly deal with the fact
that NSHTTPCookie.domain can return nil.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2018-09-27 Youenn Fablet <youenn@apple.com>
Use kCVPixelFormatType_420YpCbCr8Planar for capturing frames
https://bugs.webkit.org/show_bug.cgi?id=190014
Reviewed by Eric Carlson.
On Mac, rely on the monoplanar format which can be displayed without any issue.
Once rendering is fixed, we should change it back to biplanar as it is closer to what libwebrtc consumes.
Covered by manual testing.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::avVideoCapturePixelBufferFormat):
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2018-09-27 Andy Estes <aestes@apple.com>
[Apple Pay] Support granular errors in PaymentDetailsUpdate
https://bugs.webkit.org/show_bug.cgi?id=189938
Reviewed by Youenn Fablet.
Implemented the shippingAddressErrors, payerErrors, and paymentMethodErrors properties on
PaymentDetailsUpdate, as specified in the Payment Request API W3C Editor's Draft of
26 September 2018.
When these errors are specified in a PaymentDetailsUpdate, map them to PaymentErrors. For
shippingAddressErrors and payerErrors, we use the "shippingContactInvalid" code and a
contact field that matches the shippingAddressError or payerError property specified.
For paymentMethodErrors, we interpret this as a sequence of ApplePayErrors, which are
converted to PaymentErrors as in Apple Pay JS.
Tests: http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html
http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html
* DerivedSources.make: Removed some tabs and added new .idl files.
* Modules/applepay/ApplePayError.idl: Moved ApplePayErrorCode and ApplePayErrorContactField
into their own .idl files so they can be used in MockPaymentError.
* Modules/applepay/ApplePayErrorCode.h: Added.
* Modules/applepay/ApplePayErrorCode.idl: Added.
* Modules/applepay/ApplePayErrorContactField.h: Added.
* Modules/applepay/ApplePayErrorContactField.idl: Added.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::appendShippingContactInvalidError): Appended a "shippingContactInvalid"
PaymentError to errors if the message is non-null.
(WebCore::ApplePayPaymentHandler::computeErrors const):
(WebCore::ApplePayPaymentHandler::detailsUpdated):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Computed a vector of PaymentErrors
based on shippingAddressErrors, payerErrors, and paymentMethodErrors.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentDetailsUpdate.h:
* Modules/paymentrequest/PaymentDetailsUpdate.idl: Defined shippingAddressErrors,
payerErrors, and paymentMethodErrors.
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::paymentMethodChanged):
(WebCore::PaymentRequest::settleDetailsPromise): Passed shippingAddressErrors, payerErrors,
and paymentMethodErrors to the payment handler.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completeShippingContactSelection): Stored errors in m_errors.
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl: Added an errors attribute.
* testing/MockPaymentError.h: Added.
* testing/MockPaymentError.idl: Added.
2018-09-27 Alex Christensen <achristensen@webkit.org>
URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL
https://bugs.webkit.org/show_bug.cgi?id=189979
Reviewed by Youenn Fablet.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithUserTypedString):
(WebCore::dataForURLComponentType):
(WebCore::URLByRemovingComponentAndSubsequentCharacter):
(WebCore::URLByCanonicalizingURL):
(WebCore::originalURLData):
(WebCore::userVisibleString):
2018-09-27 Chris Dumez <cdumez@apple.com>
document.open() should not propagate URLs to non-fully active documents
https://bugs.webkit.org/show_bug.cgi?id=189375
<rdar://problem/44282755>
Reviewed by Youenn Fablet.
Update our document.open() to not propagate URLs to non-fully active documents, as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 11)
A "fully active" document is defined by at:
- https://html.spec.whatwg.org/#fully-active
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::open):
(WebCore::Document::isFullyActive const):
* dom/Document.h:
* dom/Document.idl:
2018-09-27 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Use sentinel buffer to detect end of append
https://bugs.webkit.org/show_bug.cgi?id=189924
Reviewed by Philippe Normand.
This patch introduces a new mechanism to detect when an append has
been consumed completely by the demuxer. It takes advantage of the
fact that buffer pushing is synchronous: both the appsrc and the
demuxer live in the same streaming thread. When appsrc pushes a
buffer, it's actually making a qtdemux function call (it calls its
"chain" function). The demuxer will return from that call when it has
finished processing that buffer; only then the control returns to
appsrc, that can push the next buffer.
By pushing an additional buffer and capturing it in a probe we can
detect reliably when the previous buffer has been processed.
Because the pipeline only has one thread, at this point no more frames
can arrive to the appsink.
This replaces the old method of detecting end of append which relied
on the `need-data` event, which is more difficult to handle correctly
because it fires whenever the appsrc is empty (or below a given
level), which also happens when a buffer has not been pushed yet or
in response to a flush.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::EndOfAppendMeta::init):
(WebCore::EndOfAppendMeta::transform):
(WebCore::EndOfAppendMeta::free):
(WebCore::AppendPipeline::staticInitialization):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::handleEndOfAppend):
(WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived): Deleted.:
(WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft): Deleted.
(WebCore::AppendPipeline::checkEndOfAppend): Deleted.
(WebCore::AppendPipeline::setAppsrcDataLeavingProbe): Deleted.
(WebCore::AppendPipeline::removeAppsrcDataLeavingProbe): Deleted.
(WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft): Deleted.
(WebCore::AppendPipeline::reportAppsrcNeedDataReceived): Deleted.
(WebCore::appendPipelineAppsrcDataLeaving): Deleted.
(WebCore::appendPipelineAppsrcNeedData): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2018-09-27 Chris Dumez <cdumez@apple.com>
The WebContent process should not process incoming IPC while waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=184183
<rdar://problem/36800576>
Reviewed by Ryosuke Niwa.
Drop test infrastructure for the DoNotProcessIncomingMessagesWhenWaitingForSyncReply IPC::SendOption
given that this SendOption was removed from this patch.
* page/ChromeClient.h:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2018-09-27 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK Ubuntu LTS build fix attempt after r236396.
* platform/graphics/gstreamer/GStreamerCommon.h:
2018-09-27 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations with CSS integration on
https://bugs.webkit.org/show_bug.cgi?id=184819
<rdar://problem/39597337>
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2018-09-26 YUHAN WU <yuhan_wu@apple.com>
Video track clone cannot preserve original property
https://bugs.webkit.org/show_bug.cgi?id=189872
<rdar://problem/44706579>
Reviewed by Youenn Fablet.
Fix the issue that the cloned track created by canvas.captureStream().getVideoTracks() cannot keep some attributes, such as enabled.
Updated a testcase expected result:
LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
(WebCore::CanvasCaptureMediaStreamTrack::create):
(WebCore::CanvasCaptureMediaStreamTrack::clone):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.h:
2018-09-26 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r236524.
Broke API tests
Reverted changeset:
"URLWithUserTypedString should return nil for URLs deemed to
be invalid by WebCore::URL"
https://bugs.webkit.org/show_bug.cgi?id=189979
https://trac.webkit.org/changeset/236524
2018-09-26 Per Arne Vollan <pvollan@apple.com>
WebVTT cue alignment broken
https://bugs.webkit.org/show_bug.cgi?id=190004
Reviewed by Eric Carlson.
If the position of the queue is unspecified, the default value of 50 was used, which is incorrect.
This patch also updates the API according to https://w3c.github.io/webvtt/#the-vttcue-interface.
The position attribute should not be a double, but either a double or the "auto" keyword. Parts
of this patch is inspired by the associated code in the Chromium project.
Test: media/track/track-cue-left-align.html
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
(WebCore::TextTrackCueGeneric::setPosition):
* html/track/TextTrackCueGeneric.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
(WebCore::VTTCue::initialize):
(WebCore::VTTCue::position const):
(WebCore::VTTCue::setPosition):
(WebCore::VTTCue::textPositionIsAuto const):
(WebCore::VTTCue::calculateComputedTextPosition const):
(WebCore::VTTCue::calculateDisplayParameters):
(WebCore::VTTCue::toJSON const):
* html/track/VTTCue.h:
(WebCore::VTTCue::position const): Deleted.
* html/track/VTTCue.idl:
2018-09-26 James Savage <james.savage@apple.com>
Allow override of viewport configuration.
https://bugs.webkit.org/show_bug.cgi?id=188772.
<rdar://problem/43538892>.
Reviewed by Simon Fraser.
* page/Settings.yaml:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::nativeWebpageParameters): Provide a viewport configuration
similar to width=device-width, with initial scale set to 1.
* page/ViewportConfiguration.h:
2018-09-26 Alex Christensen <achristensen@webkit.org>
URLs with mismatched surrogate pairs in the host should fail to parse
https://bugs.webkit.org/show_bug.cgi?id=190005
Reviewed by Chris Dumez.
Elsewhere in the URLParser, when we encounter mismatched surrogate pairs we use the replacement character,
but that just fails later on in domainToASCII, so we may as well just fail.
This behavior matches Chrome, but is unclear in the spec. There are no valid uses of hosts containing mismatched surrogate pairs.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
2018-09-26 Alex Christensen <achristensen@webkit.org>
uidna_nameToASCII only needs a buffer capacity of 64
https://bugs.webkit.org/show_bug.cgi?id=190006
Reviewed by Chris Dumez.
This is specified in https://www.unicode.org/reports/tr46/#ToASCII
This is how Chrome and Firefox also behave with long unicode hosts.
* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
2018-09-26 Alex Christensen <achristensen@webkit.org>
URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL
https://bugs.webkit.org/show_bug.cgi?id=189979
<rdar://problem/44119696>
Reviewed by Chris Dumez.
Covered by an API test.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithData):
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Selection should work across shadow boundary when initiated by a mouse drag
https://bugs.webkit.org/show_bug.cgi?id=151380
<rdar://problem/24363872>
Revert the change that I said I would from r236519.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
2018-09-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236511.
https://bugs.webkit.org/show_bug.cgi?id=190008
It is breaking some WebRTC tests (Requested by youenn on
#webkit).
Reverted changeset:
"[MediaStream] Clean up RealtimeMediaSource settings change
handling"
https://bugs.webkit.org/show_bug.cgi?id=189998
https://trac.webkit.org/changeset/236511
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Selection should work across shadow boundary when initiated by a mouse drag
https://bugs.webkit.org/show_bug.cgi?id=151380
<rdar://problem/24363872>
Reviewed by Antti Koivisto and Wenson Hsieh.
This patch adds the basic support for selecting content across shadow DOM boundaries to VisibleSelection,
which is enough to allow users to select content across shadow DOM boundaries via a mouse drag.
This is the first step in allowing users to select, copy and paste content across shadow DOM boundaries,
which is a serious user experience regression right now. The new behavior is disabled by default under
an interal debug feature flag: selectionAcrossShadowBoundariesEnabled.
Like Chrome, we are not going to support selecting editable content across shadow DOM boundaries since
we'd have to generalize every editing commands to make that work, and there aren't any HTML editors that
use shadow DOM boundaries within an editable region yet. For simplicity, we also don't support extending
a selection out of a shadow root which resides inside an editing region.
The keyboard based navigation & manipulation of selection as well as allowing copy & paste of content
across shadow DOM boundaries will be implemented by separate patches. DOMSelection will not expose this new
behavior either. This is tracked in the spec as https://github.com/w3c/webcomponents/issues/79
Tests: editing/selection/selection-across-shadow-boundaries-mixed-editability-1.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-2.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-3.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-4.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-5.html
editing/selection/selection-across-shadow-boundaries-readonly-1.html
editing/selection/selection-across-shadow-boundaries-readonly-2.html
editing/selection/selection-across-shadow-boundaries-readonly-3.html
editing/selection/selection-across-shadow-boundaries-user-select-all-1.html
* editing/VisibleSelection.cpp:
(WebCore::isInUserAgentShadowRootOrHasEditableShadowAncestor): Added.
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): When the feature is enabled,
allow crossing shadow DOM boundaries except when either end is inside an user agent shadow root, or one of
its shadow includign ancestor is inside an editable region. The latter check is needed to disallow
an extension of a selection starting in a shadow tree inside a non-editable region inside an editable region
to outside the editable region. The rest of the editing code is not ready to deal with selection like that.
* page/Settings.yaml: Added an internal debug feature to enable this new behavior.
2018-09-26 Chris Dumez <cdumez@apple.com>
Ignore-opens-during-unload counter of a parent should apply to its children during beforeunload event
https://bugs.webkit.org/show_bug.cgi?id=189376
<rdar://problem/44282754>
Reviewed by Ryosuke Niwa.
Make sure the Ignore-opens-during-unload counter of a parent stays incremented while we are firing the
beforeunload event for its descendants, as per:
- https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document
No new tests, rebaselined existing tests.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldClose):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2018-09-26 Justin Fan <justin_fan@apple.com>
WebGL 2: Adding logging to in-progress features
https://bugs.webkit.org/show_bug.cgi?id=189978
Reviewed by Jon Lee.
Logging will allow us to better identify the most in-demand WebGL 2 features and prioritize our efforts.
No tests as no change in WebGL functionality.
* html/canvas/WebGL2RenderingContext.cpp: Added logging statement to every function not yet implemented.
(WebCore::WebGL2RenderingContext::blitFramebuffer):
(WebCore::WebGL2RenderingContext::framebufferTextureLayer):
(WebCore::WebGL2RenderingContext::invalidateFramebuffer):
(WebCore::WebGL2RenderingContext::invalidateSubFramebuffer):
(WebCore::WebGL2RenderingContext::readBuffer):
(WebCore::WebGL2RenderingContext::texStorage3D):
(WebCore::WebGL2RenderingContext::texImage2D):
(WebCore::WebGL2RenderingContext::texImage3D):
(WebCore::WebGL2RenderingContext::texSubImage2D):
(WebCore::WebGL2RenderingContext::texSubImage3D):
(WebCore::WebGL2RenderingContext::copyTexSubImage3D):
(WebCore::WebGL2RenderingContext::compressedTexImage2D):
(WebCore::WebGL2RenderingContext::compressedTexImage3D):
(WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
(WebCore::WebGL2RenderingContext::getFragDataLocation):
(WebCore::WebGL2RenderingContext::uniform1ui):
(WebCore::WebGL2RenderingContext::uniform2ui):
(WebCore::WebGL2RenderingContext::uniform3ui):
(WebCore::WebGL2RenderingContext::uniform4ui):
(WebCore::WebGL2RenderingContext::uniform1uiv):
(WebCore::WebGL2RenderingContext::uniform2uiv):
(WebCore::WebGL2RenderingContext::uniform3uiv):
(WebCore::WebGL2RenderingContext::uniform4uiv):
(WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
(WebCore::WebGL2RenderingContext::vertexAttribI4i):
(WebCore::WebGL2RenderingContext::vertexAttribI4iv):
(WebCore::WebGL2RenderingContext::vertexAttribI4ui):
(WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
(WebCore::WebGL2RenderingContext::vertexAttribIPointer):
(WebCore::WebGL2RenderingContext::drawRangeElements):
(WebCore::WebGL2RenderingContext::createQuery):
(WebCore::WebGL2RenderingContext::deleteQuery):
(WebCore::WebGL2RenderingContext::isQuery):
(WebCore::WebGL2RenderingContext::beginQuery):
(WebCore::WebGL2RenderingContext::endQuery):
(WebCore::WebGL2RenderingContext::getQuery):
(WebCore::WebGL2RenderingContext::getQueryParameter):
(WebCore::WebGL2RenderingContext::createSampler):
(WebCore::WebGL2RenderingContext::deleteSampler):
(WebCore::WebGL2RenderingContext::isSampler):
(WebCore::WebGL2RenderingContext::bindSampler):
(WebCore::WebGL2RenderingContext::samplerParameteri):
(WebCore::WebGL2RenderingContext::samplerParameterf):
(WebCore::WebGL2RenderingContext::getSamplerParameter):
(WebCore::WebGL2RenderingContext::fenceSync):
(WebCore::WebGL2RenderingContext::isSync):
(WebCore::WebGL2RenderingContext::deleteSync):
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::waitSync):
(WebCore::WebGL2RenderingContext::getSyncParameter):
(WebCore::WebGL2RenderingContext::createTransformFeedback):
(WebCore::WebGL2RenderingContext::deleteTransformFeedback):
(WebCore::WebGL2RenderingContext::isTransformFeedback):
(WebCore::WebGL2RenderingContext::bindTransformFeedback):
(WebCore::WebGL2RenderingContext::beginTransformFeedback):
(WebCore::WebGL2RenderingContext::endTransformFeedback):
(WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
(WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
(WebCore::WebGL2RenderingContext::pauseTransformFeedback):
(WebCore::WebGL2RenderingContext::resumeTransformFeedback):
(WebCore::WebGL2RenderingContext::bindBufferBase):
(WebCore::WebGL2RenderingContext::bindBufferRange):
(WebCore::WebGL2RenderingContext::getUniformIndices):
(WebCore::WebGL2RenderingContext::getUniformBlockIndex):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
(WebCore::WebGL2RenderingContext::uniformBlockBinding):
2018-09-26 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up RealtimeMediaSource settings change handling
https://bugs.webkit.org/show_bug.cgi?id=189998
<rdar://problem/44797884>
Reviewed by Youenn Fablet.
No new tests, no change in functionality.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
(WebCore::RealtimeMediaSource::setSize):
(WebCore::RealtimeMediaSource::setFrameRate):
(WebCore::RealtimeMediaSource::setAspectRatio):
(WebCore::RealtimeMediaSource::setFacingMode):
(WebCore::RealtimeMediaSource::setVolume):
(WebCore::RealtimeMediaSource::setSampleRate):
(WebCore::RealtimeMediaSource::setSampleSize):
(WebCore::RealtimeMediaSource::setEchoCancellation):
(WebCore::RealtimeMediaSource::settingsDidChange): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settingsDidChange):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::settingsDidChange):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settingsDidChange):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::settingsDidChange):
2018-09-26 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure renderers with accelerated animations have layers
https://bugs.webkit.org/show_bug.cgi?id=189990
<rdar://problem/44791222>
Reviewed by Zalan Bujtas.
We have done some work already in webkit.org/b/189784 to prevent never-ending calls to DocumentTimeline::updateAnimations(). This was due to
the change made for webkit.org/b/186930 where we queued calls to updateAnimations() in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
while we were waiting for a renderer with a layer backing for a given animation target. Instead of doing this, we now ensure renderers always
have a layer when they have an accelerated animation applied.
No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): This method should have been marked const all along and it is
now required so it can be called through RenderBox::requiresLayer() and RenderInline::requiresLayer().
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Deleted.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Stop enqueuing the accelerated actions in case we're lacking a composited renderer
since this situation should no longer arise.
* rendering/RenderBox.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasRunningAcceleratedAnimations const): Query the document timeline, if it exists, to check that this renderer's element
has accelerated animations applied.
* rendering/RenderBoxModelObject.h:
* rendering/RenderInline.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations.
2018-09-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mac window capture source
https://bugs.webkit.org/show_bug.cgi?id=189958
<rdar://problem/44767616>
Reviewed by Youenn Fablet.
* SourcesCocoa.txt: Add WindowDisplayCaptureSourceMac.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::captureDevices): Include window "devices".
(WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices): New.
(WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID): New.
(WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID): Include window devices.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::settings): Use frameSize, report surface type and
logical surface.
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange): Clear m_lastSampleBuffer when size changes.
(WebCore::DisplayCaptureSourceCocoa::frameSize const): New, return size() or intrinsic size.
(WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): New.
(WebCore::DisplayCaptureSourceCocoa::emitFrame): generateFrame now returns a CVPixelBuffer
so derived classes don't have to deal with resizing/transforming.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Add fixme.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update intrinsic size when
width/height changes.
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return a CVPixelBuffer.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: Added.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: Added.
(WebCore::anyOfCGWindow):
(WebCore::windowDescription):
(WebCore::WindowDisplayCaptureSourceMac::create):
(WebCore::WindowDisplayCaptureSourceMac::WindowDisplayCaptureSourceMac):
(WebCore::WindowDisplayCaptureSourceMac::windowImage):
(WebCore::WindowDisplayCaptureSourceMac::generateFrame):
(WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage):
(WebCore::WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID):
(WebCore::WindowDisplayCaptureSourceMac::windowCaptureDevices):
2018-09-25 Justin Fan <justin_fan@apple.com>
WebGL 2 Conformance: primitive restart and draw_primitive_restart WebGL2 sample
https://bugs.webkit.org/show_bug.cgi?id=189625
<rdar://problem/42882620>
Reviewed by Dean Jackson.
Ref test: webgl/webgl2-primitive-restart.html.
Implement support for Primitive Restart Fixed Index as expected
by the WebGL 2 specifications.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::getLastIndex): Template that must be defined in header.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::primitiveRestartIndex):
2018-09-25 John Wilander <wilander@apple.com>
Change from HAVE(CFNETWORK_STORAGE_PARTITIONING) to ENABLE(RESOURCE_LOAD_STATISTICS)
https://bugs.webkit.org/show_bug.cgi?id=189959
<rdar://problem/44767642>
Reviewed by Chris Dumez.
No new tests because of no code change.
We no longer make use of CFNetwork's cookie partitioning so we should
change the compile-time flag to something that makes sense. This should
also make it easier/cleaner for other ports.
* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
(WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
* dom/Document.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::logWindowCreation):
* loader/ResourceLoadObserver.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::cookiesForURL):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
2018-09-25 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Make AuthenticatorManager
https://bugs.webkit.org/show_bug.cgi?id=189279
<rdar://problem/44116792>
Reviewed by Chris Dumez.
This patch does the following things in WebCore in order to support AuthenticatorManager:
1) It separates AuthenticatorTransport from PublicKeyCredentialDescriptor such that the enum
can be queried from WebKit directly.
2) It adds AuthenticatorAttachment to PublicKeyCredentialCreationOptions such that relying parties
could express their interests in cross platform authenticators.
3) It enhances IPC encoder/decoder of a few such that Vectors and empty objects can be correctly coded.
4) It moves the LocalAuthenticator implementation to WebKit to better integrate with AuthenticatorManager.
5) It moves linking to LocalAuthentication.framework to WebKit as well.
6) It temporarily bans old mock test mechanism in Internals so we could enable the new mock test mechanism in
WebKitTestRunner which we will have a better coverage of codes in UI Process. Those tests will be either
removed or ported to the new mechanism in Bug 189283.
7) It also removes "using namespace WebCore" from the top namespace in some .mm files as they are reordered
to where they could introduce name confusions.
Tests: http/wpt/webauthn/public-key-credential-create-failure-local.https.html
http/wpt/webauthn/public-key-credential-create-success-local.https.html
http/wpt/webauthn/public-key-credential-get-failure-local.https.html
http/wpt/webauthn/public-key-credential-get-success-local.https.html
http/wpt/webauthn/public-key-credential-is-user-verifying-platform-authenticator-available.html
* CMakeLists.txt:
* Configurations/WebCore.xcconfig:
* DerivedSources.make:
* Modules/webauthn/AuthenticatorTransport.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* Modules/webauthn/AuthenticatorTransport.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.idl.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialData.h:
(WebCore::PublicKeyCredentialData::encode const):
(WebCore::PublicKeyCredentialData::decode):
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
(WebCore::PublicKeyCredentialDescriptor::encode const):
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Modules/webauthn/cocoa/LocalAuthenticator.mm: Removed.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/ExceptionData.h:
* platform/cocoa/LocalAuthenticationSoftLink.mm: Removed.
* platform/cocoa/SharedBufferCocoa.mm:
(-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): Deleted.
(VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement): Deleted.
(VideoFullscreenModelVideoElement::setVideoElement): Deleted.
(VideoFullscreenModelVideoElement::handleEvent): Deleted.
(VideoFullscreenModelVideoElement::updateForEventName): Deleted.
(VideoFullscreenModelVideoElement::willExitFullscreen): Deleted.
(VideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
(VideoFullscreenModelVideoElement::waitForPreparedForInlineThen): Deleted.
(VideoFullscreenModelVideoElement::requestFullscreenMode): Deleted.
(VideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
(VideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
(VideoFullscreenModelVideoElement::observedEventNames): Deleted.
(VideoFullscreenModelVideoElement::eventNameAll): Deleted.
(VideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
(VideoFullscreenModelVideoElement::addClient): Deleted.
(VideoFullscreenModelVideoElement::removeClient): Deleted.
(VideoFullscreenModelVideoElement::isVisible const): Deleted.
(VideoFullscreenModelVideoElement::setHasVideo): Deleted.
(VideoFullscreenModelVideoElement::setVideoDimensions): Deleted.
(VideoFullscreenModelVideoElement::willEnterPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::didEnterPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::willExitPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::didExitPictureInPicture): Deleted.
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::hasExplicitBeginTime):
(WebCore::setHasExplicitBeginTime):
(WebCore::toCAFillModeType):
(WebCore::toCAValueFunctionType):
(WebCore::toCAMediaTimingFunction):
(WebCore::PlatformCAAnimationCocoa::setFromValue):
(WebCore::PlatformCAAnimationCocoa::setToValue):
(WebCore::PlatformCAAnimationCocoa::setValues):
(fromCAFillModeType): Deleted.
(fromCAValueFunctionType): Deleted.
(PlatformCAAnimationCocoa::create): Deleted.
(PlatformCAAnimationCocoa::PlatformCAAnimationCocoa): Deleted.
(PlatformCAAnimationCocoa::~PlatformCAAnimationCocoa): Deleted.
(PlatformCAAnimationCocoa::copy const): Deleted.
(PlatformCAAnimationCocoa::platformAnimation const): Deleted.
(PlatformCAAnimationCocoa::keyPath const): Deleted.
(PlatformCAAnimationCocoa::beginTime const): Deleted.
(PlatformCAAnimationCocoa::setBeginTime): Deleted.
(PlatformCAAnimationCocoa::duration const): Deleted.
(PlatformCAAnimationCocoa::setDuration): Deleted.
(PlatformCAAnimationCocoa::speed const): Deleted.
(PlatformCAAnimationCocoa::setSpeed): Deleted.
(PlatformCAAnimationCocoa::timeOffset const): Deleted.
(PlatformCAAnimationCocoa::setTimeOffset): Deleted.
(PlatformCAAnimationCocoa::repeatCount const): Deleted.
(PlatformCAAnimationCocoa::setRepeatCount): Deleted.
(PlatformCAAnimationCocoa::autoreverses const): Deleted.
(PlatformCAAnimationCocoa::setAutoreverses): Deleted.
(PlatformCAAnimationCocoa::fillMode const): Deleted.
(PlatformCAAnimationCocoa::setFillMode): Deleted.
(PlatformCAAnimationCocoa::setTimingFunction): Deleted.
(PlatformCAAnimationCocoa::copyTimingFunctionFrom): Deleted.
(PlatformCAAnimationCocoa::isRemovedOnCompletion const): Deleted.
(PlatformCAAnimationCocoa::setRemovedOnCompletion): Deleted.
(PlatformCAAnimationCocoa::isAdditive const): Deleted.
(PlatformCAAnimationCocoa::setAdditive): Deleted.
(PlatformCAAnimationCocoa::valueFunction const): Deleted.
(PlatformCAAnimationCocoa::setValueFunction): Deleted.
(PlatformCAAnimationCocoa::setFromValue): Deleted.
(PlatformCAAnimationCocoa::copyFromValueFrom): Deleted.
(PlatformCAAnimationCocoa::setToValue): Deleted.
(PlatformCAAnimationCocoa::copyToValueFrom): Deleted.
(PlatformCAAnimationCocoa::setValues): Deleted.
(PlatformCAAnimationCocoa::copyValuesFrom): Deleted.
(PlatformCAAnimationCocoa::setKeyTimes): Deleted.
(PlatformCAAnimationCocoa::copyKeyTimesFrom): Deleted.
(PlatformCAAnimationCocoa::setTimingFunctions): Deleted.
(PlatformCAAnimationCocoa::copyTimingFunctionsFrom): Deleted.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(PlatformCAFilters::filterValueForOperation): Deleted.
(PlatformCAFilters::colorMatrixValueForFilter): Deleted.
(PlatformCAFilters::setBlendingFiltersOnLayer): Deleted.
(PlatformCAFilters::numAnimatedFilterProperties): Deleted.
(PlatformCAFilters::animatedFilterPropertyName): Deleted.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(-[WebAnimationDelegate animationDidStart:]):
(-[WebAnimationDelegate animationDidStop:finished:]):
(-[WebAnimationDelegate setOwner:]):
(PlatformCALayerCocoa::create): Deleted.
(PlatformCALayer::platformCALayer): Deleted.
(mediaTimeToCurrentTime): Deleted.
(PlatformCALayerCocoa::setOwner): Deleted.
(toCAFilterType): Deleted.
(PlatformCALayerCocoa::layerTypeForPlatformLayer): Deleted.
(PlatformCALayerCocoa::PlatformCALayerCocoa): Deleted.
(PlatformCALayerCocoa::commonInit): Deleted.
(PlatformCALayerCocoa::clone const): Deleted.
(PlatformCALayerCocoa::~PlatformCALayerCocoa): Deleted.
(PlatformCALayerCocoa::animationStarted): Deleted.
(PlatformCALayerCocoa::animationEnded): Deleted.
(PlatformCALayerCocoa::setNeedsDisplay): Deleted.
(PlatformCALayerCocoa::setNeedsDisplayInRect): Deleted.
(PlatformCALayerCocoa::copyContentsFromLayer): Deleted.
(PlatformCALayerCocoa::superlayer const): Deleted.
(PlatformCALayerCocoa::removeFromSuperlayer): Deleted.
(PlatformCALayerCocoa::setSublayers): Deleted.
(PlatformCALayerCocoa::removeAllSublayers): Deleted.
(PlatformCALayerCocoa::appendSublayer): Deleted.
(PlatformCALayerCocoa::insertSublayer): Deleted.
(PlatformCALayerCocoa::replaceSublayer): Deleted.
(PlatformCALayerCocoa::adoptSublayers): Deleted.
(PlatformCALayerCocoa::addAnimationForKey): Deleted.
(PlatformCALayerCocoa::removeAnimationForKey): Deleted.
(PlatformCALayerCocoa::animationForKey): Deleted.
(PlatformCALayerCocoa::setMask): Deleted.
(PlatformCALayerCocoa::isOpaque const): Deleted.
(PlatformCALayerCocoa::setOpaque): Deleted.
(PlatformCALayerCocoa::bounds const): Deleted.
(PlatformCALayerCocoa::setBounds): Deleted.
(PlatformCALayerCocoa::position const): Deleted.
(PlatformCALayerCocoa::setPosition): Deleted.
(PlatformCALayerCocoa::anchorPoint const): Deleted.
(PlatformCALayerCocoa::setAnchorPoint): Deleted.
(PlatformCALayerCocoa::transform const): Deleted.
(PlatformCALayerCocoa::setTransform): Deleted.
(PlatformCALayerCocoa::sublayerTransform const): Deleted.
(PlatformCALayerCocoa::setSublayerTransform): Deleted.
(PlatformCALayerCocoa::isHidden const): Deleted.
(PlatformCALayerCocoa::setHidden): Deleted.
(PlatformCALayerCocoa::contentsHidden const): Deleted.
(PlatformCALayerCocoa::setContentsHidden): Deleted.
(PlatformCALayerCocoa::userInteractionEnabled const): Deleted.
(PlatformCALayerCocoa::setUserInteractionEnabled): Deleted.
(PlatformCALayerCocoa::setBackingStoreAttached): Deleted.
(PlatformCALayerCocoa::backingStoreAttached const): Deleted.
(PlatformCALayerCocoa::geometryFlipped const): Deleted.
(PlatformCALayerCocoa::setGeometryFlipped): Deleted.
(PlatformCALayerCocoa::isDoubleSided const): Deleted.
(PlatformCALayerCocoa::setDoubleSided): Deleted.
(PlatformCALayerCocoa::masksToBounds const): Deleted.
(PlatformCALayerCocoa::setMasksToBounds): Deleted.
(PlatformCALayerCocoa::acceleratesDrawing const): Deleted.
(PlatformCALayerCocoa::setAcceleratesDrawing): Deleted.
(PlatformCALayerCocoa::wantsDeepColorBackingStore const): Deleted.
(PlatformCALayerCocoa::setWantsDeepColorBackingStore): Deleted.
(PlatformCALayerCocoa::supportsSubpixelAntialiasedText const): Deleted.
(PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText): Deleted.
(PlatformCALayerCocoa::hasContents const): Deleted.
(PlatformCALayerCocoa::contents const): Deleted.
(PlatformCALayerCocoa::setContents): Deleted.
(PlatformCALayerCocoa::setContentsRect): Deleted.
(PlatformCALayerCocoa::setMinificationFilter): Deleted.
(PlatformCALayerCocoa::setMagnificationFilter): Deleted.
(PlatformCALayerCocoa::backgroundColor const): Deleted.
(PlatformCALayerCocoa::setBackgroundColor): Deleted.
(PlatformCALayerCocoa::setBorderWidth): Deleted.
(PlatformCALayerCocoa::setBorderColor): Deleted.
(PlatformCALayerCocoa::opacity const): Deleted.
(PlatformCALayerCocoa::setOpacity): Deleted.
(PlatformCALayerCocoa::setFilters): Deleted.
(PlatformCALayerCocoa::copyFiltersFrom): Deleted.
(PlatformCALayerCocoa::filtersCanBeComposited): Deleted.
(PlatformCALayerCocoa::setBlendMode): Deleted.
(PlatformCALayerCocoa::setName): Deleted.
(PlatformCALayerCocoa::setSpeed): Deleted.
(PlatformCALayerCocoa::setTimeOffset): Deleted.
(PlatformCALayerCocoa::contentsScale const): Deleted.
(PlatformCALayerCocoa::setContentsScale): Deleted.
(PlatformCALayerCocoa::cornerRadius const): Deleted.
(PlatformCALayerCocoa::setCornerRadius): Deleted.
(PlatformCALayerCocoa::setEdgeAntialiasingMask): Deleted.
(PlatformCALayerCocoa::shapeRoundedRect const): Deleted.
(PlatformCALayerCocoa::setShapeRoundedRect): Deleted.
(PlatformCALayerCocoa::shapeWindRule const): Deleted.
(PlatformCALayerCocoa::setShapeWindRule): Deleted.
(PlatformCALayerCocoa::shapePath const): Deleted.
(PlatformCALayerCocoa::setShapePath): Deleted.
(PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const): Deleted.
(PlatformCALayerCocoa::updateCustomAppearance): Deleted.
(layerContentsFormat): Deleted.
(PlatformCALayerCocoa::updateContentsFormat): Deleted.
(PlatformCALayerCocoa::tiledBacking): Deleted.
(PlatformCALayer::isWebLayer): Deleted.
(PlatformCALayer::setBoundsOnMainThread): Deleted.
(PlatformCALayer::setPositionOnMainThread): Deleted.
(PlatformCALayer::setAnchorPointOnMainThread): Deleted.
(PlatformCALayer::collectRectsToPaint): Deleted.
(PlatformCALayer::drawLayerContents): Deleted.
(PlatformCALayer::frameForLayer): Deleted.
(PlatformCALayerCocoa::createCompatibleLayer const): Deleted.
(PlatformCALayerCocoa::enumerateRectsBeingDrawn): Deleted.
(PlatformCALayerCocoa::backingStoreBytesPerPixel const): Deleted.
(PlatformCALayerCocoa::avPlayerLayer const): Deleted.
* platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm:
(-[WebLightSystemBackdropLayer init]):
(-[WebDarkSystemBackdropLayer init]):
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer createTileController:]):
(-[WebTiledBackingLayer setNeedsDisplayInRect:]):
(-[WebTiledBackingLayer setBorderColor:]):
* testing/Internals.cpp:
(WebCore::Internals::Internals):
2018-09-25 YUHAN WU <yuhan_wu@apple.com>
Implement MediaStreamTrack Content Hints
https://bugs.webkit.org/show_bug.cgi?id=189262
<rdar://problem/44101773>
Reviewed by Youenn Fablet.
contentHint is a new attribute which is stored in MediaStreamTrackPrivate.
https://w3c.github.io/mst-content-hint/
Covered by tests:
LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html
LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/idlharness.window.html
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::contentHint const):
(WebCore::MediaStreamTrack::setContentHint):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setContentHint):
(WebCore::MediaStreamTrackPrivate::clone):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::contentHint):
2018-09-25 Alex Christensen <achristensen@webkit.org>
Allow for suffixes to com.apple.WebKit.WebContent
https://bugs.webkit.org/show_bug.cgi?id=189972
Reviewed by Chris Dumez.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::isInWebProcess):
2018-09-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Fix the open source iOS 12 build after r236445
https://bugs.webkit.org/show_bug.cgi?id=189953
Reviewed by Alex Christensen.
Remove soft-linking macros from several sources in WebCore, and instead import UIKitSoftLink from PAL. This
allows different WebCore sources to soft-link UIKit (and its classes and symbols) without reimplementing
WebCore::UIKitLibrary.
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
(WebCore::FontShadow::createShadow const):
* platform/graphics/cocoa/ColorCocoa.mm:
(WebCore::platformColor):
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):
2018-09-25 Thibault Saunier <tsaunier@igalia.com>
[WPE][GTK][WebRTC] Fixup VP8 encoding support
https://bugs.webkit.org/show_bug.cgi?id=189921
Previous leak fixing commit introduced a regression in
the way the encoded buffer were prepared in the default
GStreamerVideoEncoder::Fragmentize implementation (when
encoding with VP8 basically).
+ Fix a build warning in the decoder.
+ Fix some wrong object members namings.
+ Properly move the caps reference when setting restriction caps.
+ Do not raise a GStreamer error when GStreamerVideoEncoder::OnEncodedImage
fails - this might be a network issue and other encoders do not consider that
fatal.
+ Use GstMappedBuffer where appropriate.
Reviewed by Philippe Normand.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
(WebCore::GStreamerVideoEncoder::Fragmentize):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2018-09-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Update constraints supported by getDisplayMedia
https://bugs.webkit.org/show_bug.cgi?id=189930
Reviewed by Youenn Fablet.
No new tests, updated http/tests/media/media-stream/get-display-media-prompt.html.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getDisplayMedia const): Ignore audio constraints.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::hasInvalidGetDisplayMediaConstraint): Check for invalid constraints.
(WebCore::UserMediaRequest::start): Check for invalid constraints.
(WebCore::UserMediaRequest::deny): Support new error.
* Modules/mediastream/UserMediaRequest.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
2018-09-25 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] Fix variable name that should have gone in r236317
https://bugs.webkit.org/show_bug.cgi?id=189944
Reviewed by Jer Noble.
m_cdmInstanceClientWeakPtrFactory becomes
m_cdmInstanceSessionClientWeakPtrFactory as its type changes to
CDMInstanceSessionClient.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
* Modules/encryptedmedia/MediaKeySession.h:
2018-09-25 Simon Fraser <simon.fraser@apple.com>
Clean up code around RenderLayer's "has accelerated scrolling" functions
https://bugs.webkit.org/show_bug.cgi?id=189932
Reviewed by Zalan Bujtas.
RenderLayer had:
bool hasAcceleratedTouchScrolling()
bool hasTouchScrollableOverflow()
bool usesAcceleratedScrolling()
bool usesCompositedScrolling()
bool usesAsyncScrolling()
which are hard to keep in your head. Removed usesAcceleratedScrolling() since it just returns hasTouchScrollableOverflow().
Renamed hasAcceleratedTouchScrolling() to canUseAcceleratedTouchScrolling() to indicate that it just looks at style,
not whether layout has given the layer scrollable overflow yet. Tidy up some #ifdefs.
usesCompositedScrolling() and usesAsyncScrolling() are ScrollableArea overrides, and
look at backing layers, so require that compositing has run already. Note this in comments.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::canUseAcceleratedTouchScrolling const):
(WebCore::RenderLayer::hasTouchScrollableOverflow const):
(WebCore::RenderLayer::handleTouchEvent):
(WebCore::RenderLayer::usesAsyncScrolling const):
(WebCore::RenderLayer::showsOverflowControls const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::hasAcceleratedTouchScrolling const): Deleted.
(WebCore::RenderLayer::usesAcceleratedScrolling const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
2018-09-24 Fujii Hironori <Hironori.Fujii@sony.com>
Rename WTF_COMPILER_GCC_OR_CLANG to WTF_COMPILER_GCC_COMPATIBLE
https://bugs.webkit.org/show_bug.cgi?id=189733
Reviewed by Michael Catanzaro.
No new tests (No behavior change).
* platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApply):
* platform/graphics/filters/FELighting.h:
2018-09-24 John Wilander <wilander@apple.com>
Cap lifetime of persistent cookies created client-side through document.cookie
https://bugs.webkit.org/show_bug.cgi?id=189933
<rdar://problem/44741888>
Reviewed by Chris Dumez.
Test: http/tests/cookies/capped-lifetime-for-cookie-set-in-js.html
As pointed out in https://github.com/mikewest/http-state-tokens:
1) Cookies are available to JavaScript by default via document.cookie, which
enables a smooth upgrade from one-time XSS to theft of persistent credentials
and also makes cookies available to Spectre-like attacks on memory.
2) Though the HttpOnly attribute was introduced well over a decade ago, only
~8.31% of Set-Cookie operations use it today (stats from Chrome). We need
developer incentives to put proper protections in place.
3) The median (uncompressed) Cookie request header is 409 bytes, while the 90th
percentile is 1,589 bytes, the 95th 2,549 bytes, the 99th 4,601 bytes, and
~0.1% of Cookie headers are over 10kB (stats from Chrome). This is bad for load
performance.
In addition to this, third-party scripts running in first-party contexts can
read user data through document.cookie and even store cross-site tracking data
in them.
Authentication cookies should be HttpOnly and thus not be affected by
restrictions to document.cookie. Cookies that persist for a long time should
be Secure, HttpOnly, and SameSite to provide good security and privacy.
By capping the lifetime of persistent cookies set through document.cookie we
embark on a journey towards better cookie management on the web.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
Now caps the life time of persistent cookies to one week (seven days).
* testing/Internals.cpp:
(WebCore::Internals::getCookies const):
New test function to get to cookie meta data such as expiry.
* testing/Internals.h:
* testing/Internals.idl:
2018-09-24 Simon Fraser <simon.fraser@apple.com>
Remove filterRes parameter from SVG filters
https://bugs.webkit.org/show_bug.cgi?id=129565
<rdar://problem/44714340>
Reviewed by Dean Jackson.
Remove support for the "filterRes" attribute on SVG filters. It's marked as
deprecated in https://drafts.fxtf.org/filter-effects/#element-attrdef-filter-filterres
and no longer supported by Chrome or Firefox.
Removed existing filterRes tests, added new test checking that it has no effect.
Tests: svg/filters/filterRes-is-noop.svg
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* svg/SVGElement.cpp:
(WebCore::SVGElement::animatableAttributeForName):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::registerAttributes):
(WebCore::SVGFilterElement::parseAttribute):
(WebCore::SVGFilterElement::filterResXIdentifier): Deleted.
(WebCore::SVGFilterElement::filterResYIdentifier): Deleted.
(WebCore::SVGFilterElement::setFilterRes): Deleted.
* svg/SVGFilterElement.h:
* svg/SVGFilterElement.idl:
* svg/svgattrs.in:
2018-09-24 Ryosuke Niwa <rniwa@webkit.org>
Don't cause a crash even when some IDL attribute is missing CEReactions
https://bugs.webkit.org/show_bug.cgi?id=189937
Reviewed by Simon Fraser.
Replaced release assertions in ElementQueue::add and ElementQueue::invokeAll by debug assertions
since a missing CEReactions resulting in a crash is a terrible user experience.
Also made the iteration in invokeAll safe when more elements were added to m_elements.
No new tests since we would still hit debug assertions, and this behavior should only come up
when some IDL attribute is erroneously missing CEReactions.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::ElementQueue::add):
(WebCore::CustomElementReactionQueue::ElementQueue::invokeAll):
2018-09-24 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor Editor::fontAttributesForSelectionStart to be platform-agnostic
https://bugs.webkit.org/show_bug.cgi?id=189918
Work towards <rdar://problem/44648705>
Reviewed by Tim Horton.
Refactors the functionality in Editor::fontAttributesForSelectionStart to not be Cocoa-only. Rename this to
fontAttributesAtSelectionStart (to be consistent with `EditingStyle::styleAtSelectionStart`) and move it from
EditorCocoa.mm to Editor.cpp; instead of creating and populating an NSDictionary with font attribute
information, create and populate a new `FontAttributes` struct that contains the same information. Cocoa clients
in WebKitLegacy may then create an `NSDictionary` as needed from the `FontAttributes`.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::platformFontAttributesAtSelectionStart const):
Add a hook to allow platforms to supply additional information in FontAttributes. On Cocoa, this adds a UIFont
or NSFont to FontAttributes; otherwise, this is a no-op.
(WebCore::Editor::fontAttributesAtSelectionStart const):
* editing/Editor.h:
* editing/FontAttributeChanges.cpp:
(WebCore::cssValueListForShadow):
* editing/FontAttributeChanges.h:
(): Deleted.
(WebCore::FontShadow::encode const): Deleted.
(WebCore::FontShadow::decode): Deleted.
* editing/FontAttributes.h: Added.
Introduce a new struct that contains font attribute information. May be converted into an NSDictionary for use
by Cocoa clients in WebKitLegacy and WebKit. In a future patch, this will become serializable over IPC for use
in WebKit2.
* editing/FontShadow.h: Added.
Move FontShadow out into a separate header file, included in `FontAttributeChanges.h` and `FontAttributes.h`.
(WebCore::FontShadow::encode const):
(WebCore::FontShadow::decode):
* editing/cocoa/EditorCocoa.mm:
Add a helper function to convert a WebCore::Color to either `UIColor` on iOS or `NSColor` when AppKit is being
used.
(WebCore::Editor::platformFontAttributesAtSelectionStart const):
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const): Deleted.
Remove a helper function that was only used to compute text decoration attributes in
fontAttributesForSelectionStart.
(WebCore::Editor::fontAttributesForSelectionStart const): Deleted.
* editing/cocoa/FontAttributesCocoa.mm: Added.
(WebCore::FontAttributes::createDictionary const):
* editing/cocoa/FontShadowCocoa.mm: Added.
(WebCore::FontShadow::createShadow const):
* editing/cocoa/HTMLConverter.mm:
(_webKitBundle):
(HTMLConverter::_colorForElement):
(_platformColor): Deleted.
Adopt platformColor().
* platform/graphics/cocoa/ColorCocoa.h: Added.
* platform/graphics/cocoa/ColorCocoa.mm: Added.
(WebCore::platformColor):
* platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
Build fix due to changes in unified sources.
* platform/mac/WebCoreNSFontManagerExtras.mm:
(WebCore::computedFontAttributeChanges):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
More build fixes due to changes in unified sources.
2018-09-24 Jer Noble <jer.noble@apple.com>
SharedBuffer should have an equality test
https://bugs.webkit.org/show_bug.cgi?id=189919
Reviewed by Alex Christensen.
Test: TestWebKitAPI SharedBuffer.isEqualTo.
* platform/SharedBuffer.cpp:
* platform/SharedBuffer.h:
(WebCore::operator==):
(WebCore::operator!=):
2018-09-24 Ryosuke Niwa <rniwa@webkit.org>
imported/w3c/web-platform-tests/shadow-dom/slotchange.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=167652
Reviewed by Saam Barati.
The bug appears to be caused by the JS wrappers of slot elements getting prematurely collected.
Deployed GCReachableRef introduced in r236376 to fix the bug.
Test: fast/shadow-dom/signal-slot-list-retains-js-wrappers.html
* dom/MutationObserver.cpp:
(WebCore::signalSlotList):
(WebCore::MutationObserver::enqueueSlotChangeEvent):
(WebCore::MutationObserver::notifyMutationObservers):
2018-09-24 Ryosuke Niwa <rniwa@webkit.org>
Release assert when using paper-textarea due to autocorrect IDL attribute missing CEReactions
https://bugs.webkit.org/show_bug.cgi?id=174629
<rdar://problem/33407620>
Reviewed by Simon Fraser.
The bug was caused by autocorrect and autocapitalize IDL attributes missing CEReactions.
Test: fast/custom-elements/autocorrect-autocapitalize-idl-attributes-crash.html
* html/HTMLElement.idl:
2018-09-24 Chris Dumez <cdumez@apple.com>
No-op document.open() calls should not have any side effects
https://bugs.webkit.org/show_bug.cgi?id=189373
<rdar://problem/44282702>
Reviewed by Geoffrey Garen.
Update document.open() implementation to match the specification [1] more closely.
In particular, URLs updates should happen much later, at step 11. They were happening
too early and would cause side effects when returning early.
[1] https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-open-steps
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::open):
2018-09-24 Daniel Bates <dabates@apple.com>
Include more headers in IOSurface.mm, PixelBufferResizer.{h, mm}
https://bugs.webkit.org/show_bug.cgi?id=189928
Reviewed by Andy Estes.
Make building IOSurface.mm and PixelBufferResizer.mm deterministic regardless of
which bundle of unified sources they are built in.
* platform/graphics/cocoa/IOSurface.mm: Include headers HostWindow.h and PlatformScreen.h
since we make use of functionality from these headers.
* platform/graphics/cv/PixelBufferResizer.h: Include header IntSize.h since
we need the size of an IntSize for m_size.
* platform/graphics/cv/PixelBufferResizer.mm: Include header Logging.h since
this file makes use of logging facilities. Also substitute #import for #include
while I am here since this file is an Objective-C++ file.
2018-09-24 Andy Estes <aestes@apple.com>
[Payment Request] Events cleanup
https://bugs.webkit.org/show_bug.cgi?id=189925
Reviewed by Simon Fraser.
1. Constructed MerchantValidationEvents (and ApplePayValidateMerchantEvents) with rvalue
references to validationURLs.
2. Instead of MerchantValidationEvent and PaymentRequestUpdateEvent having a
RefPtr<PaymentRequest>, downcasted their target to a PaymentRequest. Trusted versions of
these events are always dispatched to a PaymentRequest object.
3. Defined MerchantValidationEventInit in MerchantValidationEvent.idl instead of having a
separate .idl and .h for this dictionary.
No new tests. No change in behavior.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::validateMerchant):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePayValidateMerchantEvent.cpp:
(WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
* Modules/applepay/ApplePayValidateMerchantEvent.h:
(WebCore::ApplePayValidateMerchantEvent::create):
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::validateMerchant):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentSession.h:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::validateMerchant):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/MerchantValidationEvent.cpp:
(WebCore::MerchantValidationEvent::create):
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
(WebCore::MerchantValidationEvent::complete):
* Modules/paymentrequest/MerchantValidationEvent.h:
* Modules/paymentrequest/MerchantValidationEvent.idl:
* Modules/paymentrequest/MerchantValidationEventInit.h: Removed.
* Modules/paymentrequest/MerchantValidationEventInit.idl: Removed.
* Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
(WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
* Modules/paymentrequest/PaymentMethodChangeEvent.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::paymentMethodChanged):
* Modules/paymentrequest/PaymentRequest.h:
(isType):
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
(WebCore::PaymentRequestUpdateEvent::updateWith):
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventTarget.cpp:
(WebCore::EventTarget::isPaymentRequest const):
* dom/EventTarget.h:
2018-09-24 Daniel Bates <dabates@apple.com>
Separate Mac and iOS implementation of windowsKeyCodeForCharCode()
https://bugs.webkit.org/show_bug.cgi?id=189898
Reviewed by Tim Horton.
Extract the Mac and iOS implementations into a windowsKeyCodeForCharCode() defined in file
KeyEventMac.mm and file KeyEventIOS, respectively.
Mac and iOS have significant differences in how they represent function keys. It is not worthwhile
to share windowsKeyCodeForCharCode() between them given these differences. On Mac function keys
are represented by a char code in the range 0xF700-0xF8FF. On iOS these keys may not have a unique
char code (e.g. F1 = 0x10 = F10) and must be identified either by special string (e.g. UIKeyInputUpArrow)
or key code.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::windowsKeyCodeForCharCode): Deleted.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Added. Remove the handling of NS*FunctionKey char codes
as function keys are not represented using them as of iOS 12.
* platform/mac/KeyEventMac.mm:
(WebCore::windowsKeyCodeForCharCode): Added.
2018-09-21 Simon Fraser <simon.fraser@apple.com>
Remove the old "AcceleratedCompositingForOverflowScroll" code
https://bugs.webkit.org/show_bug.cgi?id=189870
Reviewed by Zalan Bujtas.
The "AcceleratedCompositingForOverflowScroll" code was added to allow overflow:scroll to use
composited scrolling if an overflow:scroll could be made a stacking context without affecting
z-order. We need overflow:scroll to be accelerated always, so a different approach is needed.
Remove this old code (unused by any platform?) to make working on new code easier.
* page/Settings.yaml:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::setHasVisibleContent):
(WebCore::RenderLayer::updateDescendantDependentFlags):
(WebCore::RenderLayer::dirty3DTransformedDescendantStatus):
(WebCore::RenderLayer::stackingContext const):
(WebCore::compositingContainer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::hasAcceleratedTouchScrolling const):
(WebCore::RenderLayer::usesAcceleratedScrolling const):
(WebCore::adjustedScrollDelta):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::enclosingFragmentedFlowAncestor const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled const): Deleted.
(WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder): Deleted.
(WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrderRecursive): Deleted.
(WebCore::RenderLayer::positionNewlyCreatedOverflowControls): Deleted.
(WebCore::RenderLayer::canBeStackingContainer const): Deleted.
(WebCore::RenderLayer::stackingContainer const): Deleted.
(WebCore::RenderLayer::needsCompositedScrolling const): Deleted.
(WebCore::RenderLayer::updateNeedsCompositedScrolling): Deleted.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::clearZOrderLists):
(WebCore::RenderLayer::updateZOrderLists):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::compositingOpacity const):
(WebCore::traverseVisibleNonCompositedDescendantLayers):
(WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::styleChangeRequiresLayerRebuild):
(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling const): Deleted.
* rendering/RenderLayerCompositor.h:
2018-09-24 Youenn Fablet <youenn@apple.com>
Enable conversion of libwebrtc internal frames as CVPixelBuffer
https://bugs.webkit.org/show_bug.cgi?id=189892
Reviewed by Eric Carlson.
Make sure to handle the case of libwebrtc frames that are not backed by CVPixelBuffer.
No observable change of behavior.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
Update according renamed methods.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
In case of libwebrtc frame that are not backed by CVPixelBuffer, we create
a CVPixelBuffer from a pixel buffer pool.
This CVPixelBuffer is then filled as part of webrtc::pixelBufferFromFrame.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
Make sure to use preferred pixel buffer format.
2018-09-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add mock window capture source
https://bugs.webkit.org/show_bug.cgi?id=189843
<rdar://problem/44687445>
Reviewed by Youenn Fablet.
No new tests, the API is disabled and it isn't possible to test yet.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Remove an extra blank line.
* platform/mock/MockMediaDevice.h:
(WebCore::MockDisplayProperties::encode const): Get rid of defaultFrameRate, add type.
(WebCore::MockDisplayProperties::decode): Ditto.
(WebCore::MockMediaDevice::type const):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices): Add mock window devices.
(WebCore::MockRealtimeMediaSourceCenter::audioDevices): Cleanup.
(WebCore::MockRealtimeMediaSourceCenter::videoDevices): Cleanup.
(WebCore::MockRealtimeMediaSourceCenter::displayDevices): New.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Set default size on displays.
(WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate): Call RealtimeVideoSource for
mock camera, base class for device.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Ditto.
(WebCore::MockRealtimeVideoSource::generatePresets): ASSERT if called as a camera.
(WebCore::MockRealtimeVideoSource::capabilities): updateCapabilities is only appropriate for cameras.
(WebCore::MockRealtimeVideoSource::settings): Camera and Device are different surface types.
(WebCore::MockRealtimeVideoSource::drawText): Render name, not ID.
(WebCore::MockRealtimeVideoSource::mockDisplayType const):
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockDisplay const):
(WebCore::MockRealtimeVideoSource::mockScreen const):
(WebCore::MockRealtimeVideoSource::mockWindow const):
2018-09-24 Daniel Bates <dabates@apple.com>
[iOS] Key code is 0 for many hardware keyboard keys
https://bugs.webkit.org/show_bug.cgi?id=189604
Reviewed by Wenson Hsieh.
Based off a patch by Jeremy Jones.
Add iOS-specific implementation of windowsKeyCodeForKeyCode() to map an iOS virtual key code to
the corresponding Windows virtual key code. Only hardware keyboard-generated events have a
virtual key code. For software-generated keyboard events we do what we do now and compute the
Windows virtual key code from the character string associated with the event.
When a WebEvent is instantiated with a non-zero iOS virtual key code (keyCode) we now always
convert it to its corresponding Windows virtual key code without considering the specified
charactersIgnoringModifiers character string. Currently we prefer computing the key code from
charactersIgnoringModifiers regardless of whether a non-zero iOS virtual key code was given.
However this causes special keys, including function keys (e.g. F10) to be misidentified because
keyboard layouts in iOS (at least iOS 12) map such special keys to ASCII control characters (e.g.
F10 maps to ASCII control character "data link escape" = 0x10) as opposed to special 16-bit
integral constants as we do on Mac (e.g. F10 maps to NSF10FunctionKey = 0xF70D on Mac). I will
look to fix up the computation of a Windows virtual key code from a char code on iOS in a
subsequent commit(s). For now, computing the Windows virtual key code directly from the iOS
virtual key code specified to the WebEvent constructor avoids the misidentification using
an ANSI US keyboard layout.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::windowsKeyCodeForKeyCode): Deleted; moved to KeyEventMac.mm as this mapping is specific to Mac.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForKeyCode): Added.
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Address the NOTE comment and compute the Windows virtual key code from
the iOS virtual key code when we have one. Also inline the value of an unncessary local variable.
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): Ditto.
* platform/mac/KeyEventMac.mm:
(WebCore::windowsKeyCodeForKeyCode): Moved from KeyEventCocoa.mm. Updated code to make use of WTF_ARRAY_LENGTH() instead
of hardcoding the upper bound of the lookup table.
2018-09-24 Simon Fraser <simon.fraser@apple.com>
feMorphology filter in CSS doesn't update when element moves
https://bugs.webkit.org/show_bug.cgi?id=189895
Reviewed by Dean Jackson.
SourceAlpha needs to be invalidated from clearIntermediateResults(),
so get it from the SVGFilterBuilder (which always creates one) and store in
a member variable.
Test: css3/filters/invalidate-sourceAlpha.html
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::buildReferenceFilter):
(WebCore::CSSFilter::clearIntermediateResults):
* rendering/CSSFilter.h:
* svg/graphics/filters/SVGFilterBuilder.h:
2018-09-24 Simon Fraser <simon.fraser@apple.com>
CSS reference filter with feDisplacementMap shows buffer corruption on Retina displays
https://bugs.webkit.org/show_bug.cgi?id=188486
<rdar://problem/43189750>
Reviewed by Dean Jackson.
The paintSize needs to be scaled by filterScale on Retina displays.
Test: css3/filters/hidpi-feDisplacementMap.html
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDisplacementMap.h:
2018-09-24 Simon Fraser <simon.fraser@apple.com>
ReferenceFilterOperation doesn't need to store the FilterEffect
https://bugs.webkit.org/show_bug.cgi?id=189904
Reviewed by Dean Jackson.
ReferenceFilterOperation doesn't do anything with m_filterEffect so don't store it.
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::ReferenceFilterOperation::setFilterEffect): Deleted.
* platform/graphics/filters/FilterOperation.h:
(WebCore::ReferenceFilterOperation::filterEffect const): Deleted.
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::build):
2018-09-24 Simon Fraser <simon.fraser@apple.com>
Garbled rendering of image when applied feConvolveMatrix to it, on Retina display
https://bugs.webkit.org/show_bug.cgi?id=189748
<rdar://problem/44621494>
Reviewed by Jon Lee.
feConvolveMatrix needs to scale the paintSize by the filter scale (2x on Retina displays),
otherwise parts of the output buffer are uninitialized and the result is incorrect.
Test: css3/filters/hidpi-feConvolveMatrix.html
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware):
2018-09-22 Dean Jackson <dino@apple.com>
Ensure PointerEvent is not visible when disabled
https://bugs.webkit.org/show_bug.cgi?id=189889
<rdar://problem/44708253>
Reviewed by Eric Carlson.
Test: pointerevents/disabled.html
* bindings/js/WebCoreBuiltinNames.h: Now that it is enabled at runtime, it needs
a built-in name.
* dom/PointerEvent.idl: Add EnabledAtRuntime.
2018-09-24 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Pull demuxed samples in batches
https://bugs.webkit.org/show_bug.cgi?id=189871
Reviewed by Xabier Rodriguez-Calvar.
After this patch, only the notifications of "new samples available"
(appsink-new-sample bus messages) travel from the streaming thread to
the main thread through the bus and the main thread is the responsible
of pulling as many samples as it can from appsink. Before, the samples
were pulled from appsink in the non-main thread and traveled to the
main thread through the bus one by one.
This reduces drastically the amount of context switches and waiting
time in the streaming thread, resulting in a noticeable performance
improvement.
This fixes stutter while loading YouTube videos.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::clearPlayerPrivate):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::consumeAppSinkAvailableSamples):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::handleNewAppsinkSample):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2018-09-24 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Change name of WebVTT region attribute 'height' to 'lines'.
https://bugs.webkit.org/show_bug.cgi?id=189862
Reviewed by Eric Carlson.
The WebVTT region attribute 'height' has been renamed to 'lines', see https://w3c.github.io/webvtt/#region-settings.
No new tests, covered by existing tests.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setLines):
(WebCore::VTTRegion::updateParametersFromRegion):
(WebCore::VTTRegion::scanSettingName):
(WebCore::VTTRegion::parseSettingValue):
(WebCore::VTTRegion::prepareRegionDisplayTree):
(WebCore::VTTRegion::setHeight): Deleted.
* html/track/VTTRegion.h:
* html/track/VTTRegion.idl:
2018-09-24 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Use no-more-pads event for noticing initialization segments
https://bugs.webkit.org/show_bug.cgi?id=189868
Reviewed by Xabier Rodriguez-Calvar.
Fixes the following YTTV 2018 tests:
62.VideoDimensionVP9
63.PlaybackStateVP9
This removes the hack that was making supporting multiple tracks in
the same file in MSE impossible.
For WebM, this GStreamer patch is required:
https://bugzilla.gnome.org/show_bug.cgi?id=797187
"matroskademux: Emit no-more-pads after parsing Tracks"
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::demuxerNoMorePads):
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::AppendPipeline::appendPipelineDemuxerNoMorePadsFromAnyThread):
(WebCore::appendPipelineDemuxerNoMorePads):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2018-09-24 Thibault Saunier <tsaunier@igalia.com>
[WPE][GTK][WebRTC] Fix leaks in the libwebrtc Decoder and Encoder
https://bugs.webkit.org/show_bug.cgi?id=189835
Reviewed by Philippe Normand.
- Rework memory management to avoid leaking encoded frames (basically use the same
strategy as other libwebrtc encoder implementation).
- Plug a GstCaps leak.
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
(WebCore::GStreamerVideoEncoder::Fragmentize):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2018-09-24 Philippe Normand <pnormand@igalia.com>
[GStreamer] Utilities cleanups
https://bugs.webkit.org/show_bug.cgi?id=189699
<rdar://problem/44634143>
Reviewed by Xabier Rodriguez-Calvar.
The GstMappedBuffer now has a move constructor so that it can be easily
reused in the webaudiosrc element. The now-unused corresponding
buffer-mapping utilities are removed from the code-base.
The HTTP source element used to handle a GstBuffer in its private
structure but this is no longer required since data is now pushed
in chunks, see bug #182829.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createGstBuffer): Deleted.
(WebCore::createGstBufferForData): Deleted.
(WebCore::getGstBufferDataPointer): Deleted.
(WebCore::mapGstBuffer): Deleted.
(WebCore::unmapGstBuffer): Deleted.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): New method returning a
reference to a newly created GstMappedBuffer instance.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStop): Remove reference to unused GstBuffer.
(CachedResourceStreamingClient::dataReceived): Ditto.
2018-09-24 Enrique Ocaña González <eocanha@igalia.com>
[MSE][GStreamer] Don't update duration when it was not previously NaN
https://bugs.webkit.org/show_bug.cgi?id=189869
Reviewed by Xabier Rodriguez-Calvar.
This is what the spec mandates. The spec doesn't say anything about
updating duration when it had been previously set, even if the new
init segment says that the duration is growing.
This fixes MSE YTTV 2018 69.MediaSourceDurationVP9.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
2018-09-23 Frederic Wang <fwang@igalia.com>
Add missing includes in TextCodecReplacement.cpp
https://bugs.webkit.org/show_bug.cgi?id=189894
Reviewed by Darin Adler.
No new tests, behavior unchanged.
* platform/text/TextCodecReplacement.cpp: Add missing headers.
2018-09-22 Adrian Perez de Castro <aperez@igalia.com>
[ARM] Building FELightingNEON.cpp fails due to missing lightVector member
https://bugs.webkit.org/show_bug.cgi?id=189890
Reviewed by Darin Adler.
No new tests needed.
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
(WebCore::FELighting::platformApplyNeon): Adapt to new layout of "struct PaintingData" after r225122.
2018-09-22 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Null-check cairo_pattern_t gradient objects
https://bugs.webkit.org/show_bug.cgi?id=189820
Reviewed by Alex Christensen.
Cairo-specific implementation of Gradient::createPlatformGradient() can
now return a nullptr value when a conic gradient is described by the
Gradient object. Cairo doesn't have a way to create cairo_pattern_t
objects for such gradients.
Null-checks are now done on return values of createPlatformGradient(),
in order to avoid proceeding to paint a null cairo_pattern_t object.
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::fill):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::fillRect):
2018-09-21 Ryosuke Niwa <rniwa@webkit.org>
Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element
https://bugs.webkit.org/show_bug.cgi?id=136836
Reviewed by Wenson Hsieh.
Fixed the bug by simply generalizing the existing code path existed for video / input type=color.
Tests: fast/shadow-dom/dragging-element-inside-shadow-tree.html
fast/shadow-dom/dragging-element-with-shadow-tree.html
* page/DragController.cpp:
(WebCore::DragController::startDrag):
2018-09-22 Chris Dumez <cdumez@apple.com>
FontDataCache should use Ref<Font> instead of a RefPtr<Font>
https://bugs.webkit.org/show_bug.cgi?id=189861
Reviewed by Antti Koivisto.
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForPlatformData):
(WebCore::FontCache::purgeInactiveFontData):
2018-09-21 Justin Michaud <justin_michaud@apple.com>
Implement initialValue support for CSS Custom Properties and Values API
https://bugs.webkit.org/show_bug.cgi?id=189819
Reviewed by Simon Fraser.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::resolveVariableFallback const):
(WebCore::CSSVariableData::resolveVariableReference const):
(WebCore::CSSVariableData::resolveVariableReferences const):
(WebCore::CSSVariableData::resolveTokenRange const):
* css/CSSVariableData.h:
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/DOMCSSRegisterCustomProperty.h:
* css/DOMCSSRegisterCustomProperty.idl:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::resolvedVariableValue):
(WebCore::StyleResolver::applyCascadedProperties):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* dom/Document.h:
(WebCore::Document::getCSSRegisteredCustomPropertySet const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
* rendering/style/RenderStyle.h:
2018-09-21 Dean Jackson <dino@apple.com>
Add PointerEvent, plus feature flag, plus Web Platform Tests
https://bugs.webkit.org/show_bug.cgi?id=189867
<rdar://problem/44697384>
Reviewed by Simon Fraser.
Add the PointerEvent interface.
Tests: imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html
imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
imported/w3c/web-platform-tests/pointerevents/idlharness.window.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Add the new files.
* dom/Event.h:
(WebCore::Event::isPointerEvent const): New virtual identification method.
* dom/EventNames.in: Add PointerEvent so the InterfaceType code is generated.
* dom/PointerEvent.cpp: The PointerEvent interface, as specified by W3C.
(WebCore::PointerEvent::PointerEvent):
(WebCore::PointerEvent::eventInterface const):
* dom/PointerEvent.h: Added.
* dom/PointerEvent.idl: Added.
* page/RuntimeEnabledFeatures.h: Clean up the ordering of the features, so there aren't
confusing blank lines interspersed with #if USE macros.
(WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Add a new flag for Pointer Events.
(WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const):
2018-09-21 Ryosuke Niwa <rniwa@webkit.org>
Custom elements in a reaction queue can lose its JS wrapper and become HTMLUnknownElement
https://bugs.webkit.org/show_bug.cgi?id=184307
Reviewed by Keith Miller.
The bug was caused by the custom elements reaction queue not reporting its content to GC during marking.
When there is no JS reference to the JS wrappers of those custom element, and if those custom elements
are disconnected, GC would happily collect those the wrappers. Unfortunately, the same bug exists for
any asynchronous events and other WebCore code which keeps elements alive for a later use but doesn't
report them to GC (e.g. during visitChildren).
This patch, therefore, introduces a generic mechanism to keep these elements' wrappers alive. Namely,
we introduce GCReachableRef, a new smart pointer type for Node's subclasses, which keeps element as well
as its wrappers alive. GCReachableRef works by adding its Node to a global hash counted set when it's
created and making JSNodeOwner::isReachableFromOpaqueRoots return true when the node is in the set.
Test: fast/custom-elements/custom-elements-reaction-queue-retains-js-wrapper.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Don't swap the vector of elements in
in the queue. Assuming each DOM API has an appropriate CustomElementsReactionStack, we should never
append a new element to this queue while invoking custom element reactions.
* dom/CustomElementReactionQueue.h:
* dom/GCReachableRef.cpp: Added.
* dom/GCReachableRef.h: Added.
(WebCore::GCReachableRefMap::contains): Added.
(WebCore::GCReachableRefMap::add): Added.
(WebCore::GCReachableRefMap::remove): Added.
(WebCore::GCReachableRef::GCReachableRef): Added. We need isNull() check since WTFMove may have been
called on the source GCReachableRef.
(WebCore::GCReachableRef::~GCReachableRef): Ditto.
(WebCore::GCReachableRef::operator-> const): Added.
(WebCore::GCReachableRef::get const): Added.
(WebCore::GCReachableRef::operator T& const): Added.
(WebCore::GCReachableRef::operator! const): Added.
(WebCore::GCReachableRef::isNull const): Added. Returns true if WTFMove had been called on Ref.
2018-09-21 Alex Christensen <achristensen@webkit.org>
Use a Variant for FormDataElement
https://bugs.webkit.org/show_bug.cgi?id=189777
Reviewed by Chris Dumez.
* platform/network/FormData.cpp:
(WebCore::FormData::FormData):
(WebCore::FormDataElement::lengthInBytes const):
(WebCore::FormDataElement::isolatedCopy const):
(WebCore::FormData::appendData):
(WebCore::FormData::flatten const):
(WebCore::FormData::resolveBlobReferences):
(WebCore::FormData::generateFiles):
(WebCore::FormData::hasGeneratedFiles const):
(WebCore::FormData::hasOwnedGeneratedFiles const):
(WebCore::FormData::removeGeneratedFilesIfNeeded):
(WebCore::FormData::asSharedBuffer const):
(WebCore::FormData::asBlobURL const):
(WebCore::FormData::expandDataStore): Deleted.
* platform/network/FormData.h:
(WebCore::FormDataElement::FormDataElement):
(WebCore::FormDataElement::encode const):
(WebCore::FormDataElement::decode):
(WebCore::FormDataElement::EncodedFileData::isolatedCopy const):
(WebCore::FormDataElement::EncodedFileData::operator== const):
(WebCore::FormDataElement::EncodedFileData::encode const):
(WebCore::FormDataElement::EncodedFileData::decode):
(WebCore::FormDataElement::EncodedBlobData::operator== const):
(WebCore::FormDataElement::EncodedBlobData::encode const):
(WebCore::FormDataElement::EncodedBlobData::decode):
(WebCore::FormDataElement::operator== const):
(WebCore::FormDataElement::operator!= const):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::advanceCurrentStream):
(WebCore::createHTTPBodyCFReadStream):
(WebCore::setHTTPBody):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::computeContentLength):
(WebCore::CurlFormDataStream::read):
(WebCore::CurlFormDataStream::readFromFile):
(WebCore::CurlFormDataStream::readFromData):
* platform/network/curl/CurlFormDataStream.h:
2018-09-20 Simon Fraser <simon.fraser@apple.com>
Simplify the logic around has*ScrollbarWithAutoBehavior
https://bugs.webkit.org/show_bug.cgi?id=189813
Reviewed by Zalan Bujtas.
The boolean logic in scrollsOverflowX() and hasHorizontalScrollbarWithAutoBehavior() (and the vertical
equivalents) reduces simply to hasOverflowClip() && (style().overflowX() == Overflow::Scroll || style().overflowX() == Overflow::Auto);
Similarly, RenderBox::intrinsicScrollbarLogicalWidth() just needs the part of the logic
that asks whether the theme uses overlay scrollbars which are not customized (and thus
turned into non-overlay scrollbars).
* rendering/RenderBox.cpp:
(WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
(WebCore::RenderBox::canUseOverlayScrollbars const):
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
* rendering/RenderBox.h:
(WebCore::RenderBox::scrollsOverflowX const):
(WebCore::RenderBox::scrollsOverflowY const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
2018-09-21 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r236255.
Many WebAudio crashes
Reverted changeset:
"[GStreamer] Utilities cleanups"
https://bugs.webkit.org/show_bug.cgi?id=189699
https://trac.webkit.org/changeset/236255
2018-09-21 Jer Noble <jer.noble@apple.com>
Move AVVideoPerformanceMetrics into AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=189842
Reviewed by Jon Lee.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2018-09-21 Chris Dumez <cdumez@apple.com>
WebSQL: User cannot grant quota increase if the JS provides an expected usage value that is too low
https://bugs.webkit.org/show_bug.cgi?id=189801
<rdar://problem/43592498>
Reviewed by Youenn Fablet.
User was unable to grant a quota increase for WebSQL if the JS provided an expected usage value that
is too low. This is because WebKit was passing this provided expectedUsage value to the client for
the purpose of quota increase, even when this expectedUsage value does not make any sense (i.e. it
is lower than the current database size). As a result, the client would grant a quota that is equal
to the previous quota and the JS would not be able to insert any data.
In order to address the issue, when the current quota is exceeded and Database::didExceedQuota()
is called, we now make sure that the expectedUsage value is greater than the current quota. If it
is not, we provide `current quota + 5MB` as expected usage to the client. This way, the client will
grant a quota that is actually increased (provided that the user accepts).
Test: storage/websql/transaction-database-expand-quota.html
* Modules/webdatabase/Database.cpp:
(WebCore::Database::setEstimatedSize):
(WebCore::Database::didExceedQuota):
* Modules/webdatabase/Database.h:
2018-09-21 Youenn Fablet <youenn@apple.com>
Use biplanar CVPixelBuffer for black frames sent to libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=189837
Reviewed by Eric Carlson.
Covered by webrtc/video-mute.html.
Add support to call CVPixelBufferGetBytesPerRowOfPlane.
Make createBlackPixelBuffer use a biplanar CVPixelBuffer as this is better supported in libwebrtc.
It is also what is being used in iOS for capture.
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
2018-09-21 Youenn Fablet <youenn@apple.com>
Add RTCCodecStats support
https://bugs.webkit.org/show_bug.cgi?id=189792
<rdar://problem/32370668>
Reviewed by Eric Carlson.
Covered by updated and rebased tests.
* Modules/mediastream/RTCStatsReport.h:
Removed fields that are already defined in the base class.
(WebCore::RTCStatsReport::CodecStats::CodecStats):
Add support for RTCCodecStats.
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillRTCCodecStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
Add routines to fill RTCCodecStats from libwebrtc stats.
2018-09-20 Simon Fraser <simon.fraser@apple.com>
Make "overflow: overlay" a synonym for "overflow: auto"
https://bugs.webkit.org/show_bug.cgi?id=189811
Reviewed by Zalan Bujtas.
The "overlay" value for overflow was added for an internal Safari feature, and only has
an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS.
It's little used on the web.
To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto".
It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle
as "auto".
Test: fast/css/getComputedStyle/getComputedStyle-overflow.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Overflow const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::isScrollableOverflow):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToScrollWheelEvents):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
* rendering/RenderLayer.cpp:
(WebCore::styleDefinesAutomaticScrollbar):
* rendering/RenderLayerCompositor.cpp:
(WebCore::isScrollableOverflow):
* rendering/style/RenderStyleConstants.h:
2018-09-21 Youenn Fablet <youenn@apple.com>
Centralize which CVPixelBuffer format is being used
https://bugs.webkit.org/show_bug.cgi?id=189772
Reviewed by Eric Carlson.
Get the format type from a single point.
This changes the video capture and mock realtime video sources on Mac to use a biplanar format.
No observable change of behavior.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
* platform/mediastream/mac/RealtimeVideoUtilities.h: Added.
2018-09-21 Antoine Quint <graouts@apple.com>
REGRESSION (r235962-r235963): Layout Test animations/suspend-resume-animation-events.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=189607
<rdar://problem/44652315>
Reviewed by Dean Jackson.
There is no reason we shouldn't return the document timeline's time when suspended as otherwise animations may
report an unresolved current time when suspended which would wreak havoc when invalidating what DOM events to
dispatch for CSS Animations and Transitions. We also shouldn't be invalidation DOM events when suspended.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::DocumentTimeline::performInvalidationTask):
2018-09-21 Mike Gorse <mgorse@suse.com>
Build tools should work when the /usr/bin/python is python3
https://bugs.webkit.org/show_bug.cgi?id=156674
Reviewed by Michael Catanzaro.
No new tests (no behavior change).
* platform/network/create-http-header-name-table: remove xreadlines.
2018-09-21 Jer Noble <jer.noble@apple.com>
[EME] Introduce the concept of CDMInstanceSession.
https://bugs.webkit.org/show_bug.cgi?id=189725
Reviewed by Eric Carlson.
Currently, the same CDMInstance owned by a MediaKeys object is passed to every MediaKeySession created by that
MediaKeys, and since the CDMInstance has only a single CDMInstanceClient, subsequent MediaKeySessions prevent
previous ones from getting updates.
Add a new virtual interface, CDMInstanceSession, to be passed to MediaKeySession upon creation. Refactor
CDMInstanceClearKey and CDMInstanceFairPlayStreamingAVFObjC to adopt this new interface.
Drive-by fixes: Made a number of virtual overrides in final classes final themselves.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::create):
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::updateKeyStatuses):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* WebCore.xcodeproj/project.pbxproj:
* platform/encryptedmedia/CDMInstance.h:
(WebCore::CDMInstance::setHDCPStatus):
(WebCore::CDMInstance::setClient): Deleted.
(WebCore::CDMInstance::clearClient): Deleted.
* platform/encryptedmedia/CDMInstanceSession.h: Copied from Source/WebCore/platform/encryptedmedia/CDMInstance.h.
(WebCore::CDMInstanceSession::setClient):
(WebCore::CDMInstanceSession::clearClient):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat):
(WebCore::CDMInstanceClearKey::keySystem const):
(WebCore::CDMInstanceClearKey::createSession):
(WebCore::CDMInstanceSessionClearKey::requestLicense):
(WebCore::CDMInstanceSessionClearKey::keys const):
(WebCore::CDMInstanceSessionClearKey::updateLicense):
(WebCore::CDMInstanceSessionClearKey::loadSession):
(WebCore::CDMInstanceSessionClearKey::closeSession):
(WebCore::CDMInstanceSessionClearKey::removeSessionData):
(WebCore::CDMInstanceSessionClearKey::storeRecordOfKeyUsage):
(WebCore::CDMInstanceClearKey::requestLicense): Deleted.
(WebCore::CDMInstanceClearKey::keys const): Deleted.
(WebCore::CDMInstanceClearKey::updateLicense): Deleted.
(WebCore::CDMInstanceClearKey::loadSession): Deleted.
(WebCore::CDMInstanceClearKey::closeSession): Deleted.
(WebCore::CDMInstanceClearKey::removeSessionData): Deleted.
(WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage): Deleted.
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::processContentKeyRequestForSession):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::processNextContentKeyRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::storeRecordOfKeyUsage):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setClient):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::clearClient):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvidePersistableRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::sessionIdentifierChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::isLicenseTypeSupported const):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::isLicenseTypeSupported const): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::storeRecordOfKeyUsage): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient): Deleted.
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::keySystem const):
(WebCore::MockCDMInstance::createSession):
(WebCore::MockCDMInstanceSession::MockCDMInstanceSession):
(WebCore::MockCDMInstanceSession::requestLicense):
(WebCore::MockCDMInstanceSession::updateLicense):
(WebCore::MockCDMInstanceSession::loadSession):
(WebCore::MockCDMInstanceSession::closeSession):
(WebCore::MockCDMInstanceSession::removeSessionData):
(WebCore::MockCDMInstanceSession::storeRecordOfKeyUsage):
(WebCore::MockCDMInstance::requestLicense): Deleted.
(WebCore::MockCDMInstance::updateLicense): Deleted.
(WebCore::MockCDMInstance::loadSession): Deleted.
(WebCore::MockCDMInstance::closeSession): Deleted.
(WebCore::MockCDMInstance::removeSessionData): Deleted.
(WebCore::MockCDMInstance::storeRecordOfKeyUsage): Deleted.
* testing/MockCDMFactory.h:
(WebCore::MockCDMInstance::factory const):
(WebCore::MockCDMInstance::distinctiveIdentifiersAllowed const):
(WebCore::MockCDMInstance::persistentStateAllowed const):
2018-09-21 Alicia Boya García <aboya@igalia.com>
[MSE] Fix comparsion with uninitialized greatestDecodeDuration
https://bugs.webkit.org/show_bug.cgi?id=189805
Reviewed by Michael Catanzaro.
This bug was causing greatestDecodeDuration to never be initialized,
which in turned caused unintended frame erase as distant appends where
not being recognized as distinct coded frame groups.
A test reproducing the sequence of appends that caused unintended
frame deletion has also been added (media-source-append-out-of-order.html).
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-09-21 Antoine Quint <graouts@apple.com>
[Web Animations] Accelerated animations don't get suspended
https://bugs.webkit.org/show_bug.cgi?id=189783
<rdar://problem/44652315>
Unreviewed, correct a merge error in the previous commit.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::performInvalidationTask):
2018-09-21 Antoine Quint <graouts@apple.com>
[Web Animations] Accelerated animations don't get suspended
https://bugs.webkit.org/show_bug.cgi?id=189783
<rdar://problem/43033568>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-suspension.html
We used to set the flag that marked the timeline as suspended prior to notifying animations that they need to be suspended.
However, since the timeline was marked as suspended, querying the running state of the animations would indicate that the
animations weren't running since a suspended timeline would identify its animations as not running. As such we would fail
to pause the accelerated animations because they were already not marked as running. We now set the suspended flag on the
timeline _after_ suspending its animations.
We also fix a bug in the new internals.acceleratedAnimationsForElement() test function so that we read from the actual
CA animations and not from a stale list of animations which would not indicate the correct animation speeds.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::suspendAnimations):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::acceleratedAnimationsForTesting):
2018-09-21 Zan Dobersek <zdobersek@igalia.com>
TransformationMatrix::toColumnMajorFloatArray() should return a std::array<> object
https://bugs.webkit.org/show_bug.cgi?id=189823
Reviewed by Michael Catanzaro.
Alias the TransformationMatrix::FloatMatrix4 type to
std::array<float, 16>. Instead of filling out the array object that's
passed in through a reference parameter, return the std::array<>
object from the function.
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::sittingToStandingTransform const):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::setMatrix):
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::toColumnMajorFloatArray const):
* platform/graphics/transforms/TransformationMatrix.h:
2018-09-21 Zan Dobersek <zdobersek@igalia.com>
FloatQuad point getters should return const references
https://bugs.webkit.org/show_bug.cgi?id=189821
Reviewed by Yusuke Suzuki.
Be pedantic and have the FloatQuad point getters return const references
to the FloatPoint member variables, instead of technically creating
copies of them (though much of this copying is eliminated when the
getters are inlined).
* platform/graphics/FloatQuad.h:
(WebCore::FloatQuad::p1 const):
(WebCore::FloatQuad::p2 const):
(WebCore::FloatQuad::p3 const):
(WebCore::FloatQuad::p4 const):
2018-09-20 Antoine Quint <graouts@apple.com>
[Web Animations] DocumentTimeline::updateAnimations() is called endlessly
https://bugs.webkit.org/show_bug.cgi?id=189784
<rdar://problem/41705679>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-interruption-display-none.html
We have code that keeps queueing pending accelerated actions for an animation that does not have a renderer until it has one
so that we can deal with situations where animations are ready to commited before its composited renderer is available. This
code ended up running continuously when an element with an accelerated animation had its renderer removed without the animation
being removed itself, such as setting "display: none" on an element with an acceelerated CSS Animation targeting it.
We fix this by queueing up a "Stop" accelerated action when updating the accelerated state if there is no renderer for the current
animation target. Then, we no longer re-queue pending accelerated actions if the last queued operation is "Stop". This ensures that
we no longer queue actions endlessly when there is no longer a visible animation.
To test this, we add a new internals.numberOfAnimationTimelineInvalidations() method that indicates the number of times the current
document's animation timeline was invalidated.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
(WebCore::DocumentTimeline::numberOfAnimationTimelineInvalidationsForTesting const):
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): If the animation target does not have a renderer and it's still
marked as running, enqueue a "Stop" accelerated action.
(WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): If we enqueue a "Stop" accelerated action, remove any other queued
action so that we only process the "Stop" action, which would have superseded all previously queued actions anyway.
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Only re-queue pending accelerated actions when a composited renderer
is not yet available if we don't have a "Stop" action queued.
* testing/Internals.cpp:
(WebCore::Internals::numberOfAnimationTimelineInvalidations const):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-21 Yacine Bandou <yacine.bandou@softathome.com>
[EME] Fix typo in WebM sanitization variable
https://bugs.webkit.org/show_bug.cgi?id=189789
Reviewed by Xabier Rodriguez-Calvar.
This commit corrects a typo in the name of a local variable, sanitizedBuffer
instead of sanitazedBuffer.
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsWebM):
2018-09-20 Dean Jackson <dino@apple.com>
Restrict the total combined size of backdrop filters
https://bugs.webkit.org/show_bug.cgi?id=189812
<rdar://problem/44532782>
Reviewed by Simon Fraser.
If the total area of all backdrop filters on the page gets
too large, the universe collapses in on itself and we enter
the Quantum Realm (i.e. crash horribly).
Put a hard limit on the total coverage, and ignore any backdrop
filters after the limit. This might break some content, but
such content is likely not doing things in the most optimal manner.
There isn't any reason to have a backdrop larger than the size of
the screen, because you'd be better off applying a foreground
filter to the main content and showing something above it.
Tests: css3/filters/backdrop/resource-use-add-more-layers.html
css3/filters/backdrop/resource-use-excessive.html
css3/filters/backdrop/resource-use-ok.html
css3/filters/backdrop/resource-use-remove-some-layers.html
* platform/graphics/ca/GraphicsLayerCA.cpp: Pick a fairly small maximum size. We
can consider increasing this if necessary, and as devices with less RAM are
upgraded.
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Gather the accumulated size
of backdrop filters into the commit state as we are recursing through the tree.
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Force any layer
with backdrop filters, or any that is removing backdrop filters, into an update.
(WebCore::GraphicsLayerCA::updateBackdropFilters): Update the logic to first
check if this backdrop layer causes us to exceed the total allowed size, and if
it does, forbid it from getting the GraphicsLayer that composits the backdrop.
* platform/graphics/ca/GraphicsLayerCA.h: Remove const from some parameters so
that we can use the CommitState to hold the accumulated size.
2018-09-20 Benjamin Poulain <benjamin@webkit.org>
Adopt safe-area-insets on ImageDocument
https://bugs.webkit.org/show_bug.cgi?id=189774
Reviewed by Tim Horton.
rdar://problem/44624432
By having the safe-area insets on the image, we ensure that they only
grow the document if there is not enough space. This also ensures the image
does not have parts under UI elements.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::imageUpdated):
2018-09-20 Zalan Bujtas <zalan@apple.com>
Release assert under RenderView::pageOrViewLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=189798
<rdar://problem/43659749>
Reviewed by Simon Fraser.
Only the mainframe's render view is sized to the page while printing.
Use the matching check (see RenderView::layout) when accessing m_pageLogicalSize.
Test: printing/crash-while-formatting-subframe-for-printing.html
* rendering/RenderView.cpp:
(WebCore::RenderView::pageOrViewLogicalHeight const):
2018-09-20 Sihui Liu <sihui_liu@apple.com>
REGRESSION(r196265): WKWebView fires mouseover, mouseenter, and mouseleave events even when it's in a background window
https://bugs.webkit.org/show_bug.cgi?id=187545
<rdar://problem/42401575>
Reviewed by Ryosuke Niwa.
When the window is not active, we should only update the scrollbar for mouse events. GTK
apps have different expectation on this behavior.
Test: fast/events/inactive-window-no-mouse-event.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::shouldSendMouseEventsToInactiveWindows const):
* page/EventHandler.h:
2018-09-20 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r235976.
Broke ARM
Reverted changeset:
"Use a Variant instead of a union in CSSSelector"
https://bugs.webkit.org/show_bug.cgi?id=188559
https://trac.webkit.org/changeset/235976
2018-09-20 Oriol Brufau <obrufau@igalia.com>
Fix 'border' serialization with both common and uncommon values
https://bugs.webkit.org/show_bug.cgi?id=189597
Reviewed by Simon Fraser.
Remove CommonValueMode enum and make borderPropertyValue always return null
when there are uncommon values (the previous ReturnNullOnUncommonValues mode).
Test: fast/css/getPropertyValue-border.html
Test: fast/dom/css-shorthand-common-value.html
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::borderPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/StyleProperties.h:
2018-09-20 Justin Michaud <justin_michaud@apple.com>
Implement CSS Custom Properties and Values Skeleton
https://bugs.webkit.org/show_bug.cgi?id=189694
Reviewed by Simon Fraser.
Add feature flag, CSS.registerProperty binding and registered property set in Document.h
for the css custom properties and values api.
Test: css-properties-values-api/registerProperty.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSRegisteredCustomProperty.h: Added.
* css/DOMCSSCustomPropertyDescriptor.h: Added.
* css/DOMCSSCustomPropertyDescriptor.idl: Added.
* css/DOMCSSNamespace.h:
* css/DOMCSSRegisterCustomProperty.cpp: Added.
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
(WebCore::DOMCSSRegisterCustomProperty::from):
(WebCore::DOMCSSRegisterCustomProperty::supplementName):
* css/DOMCSSRegisterCustomProperty.h: Added.
* css/DOMCSSRegisterCustomProperty.idl: Added.
* css/parser/CSSParserContext.cpp:
* dom/Document.cpp:
(WebCore::Document::registerCSSProperty):
* dom/Document.h:
* features.json:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled):
(WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const):
2018-09-20 Justin Michaud <justin_michaud@apple.com>
JS bindings generator should support EnabledAtRuntime for static methods
https://bugs.webkit.org/show_bug.cgi?id=189729
Reviewed by Chris Dumez.
Add support for EnabledAtRuntime to static methods in the JS bindings
code generator.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalStringForExposed):
(GenerateRuntimeEnableConditionalString):
(GetRuntimeEnabledStaticProperties):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectConstructor::initializeProperties):
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody):
(WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::initializeProperties):
(WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStaticGetter):
(WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStatic):
(WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter):
(WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStatic):
(WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody):
(WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic):
* bindings/scripts/test/TestGlobalObject.idl:
* bindings/scripts/test/TestObj.idl:
2018-09-20 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Update the parser according to the new region syntax.
https://bugs.webkit.org/show_bug.cgi?id=189767
Reviewed by Eric Carlson.
The majority of the code added in this patch is adopted from the Chromium project, which has added
support for the new region syntax. The complete parser specification can be found at
https://w3c.github.io/webvtt/#file-parsing. One small difference in behavior is that the new parser
will not add regions with empty id.
No new tests, covered by existing tests.
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::getNewRegions):
(WebCore::WebVTTParser::parse):
(WebCore::WebVTTParser::collectRegionSettings):
(WebCore::WebVTTParser::collectWebVTTBlock):
(WebCore::WebVTTParser::checkAndRecoverCue):
(WebCore::WebVTTParser::checkAndCreateRegion):
(WebCore::WebVTTParser::checkAndStoreRegion):
(WebCore::WebVTTParser::collectMetadataHeader): Deleted.
(WebCore::WebVTTParser::createNewRegion): Deleted.
* html/track/WebVTTParser.h:
2018-09-20 Alicia Boya García <aboya@igalia.com>
[GStreamer][MSE] Add a default sample duration
https://bugs.webkit.org/show_bug.cgi?id=189788
Some WebM files don't provide sample durations, so we need to provide
a safe default in order for them to be playable.
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
2018-09-20 Alicia Boya García <aboya@igalia.com>
[MSE] Use some tolerance when deciding whether a frame should be appended to the decode queue
https://bugs.webkit.org/show_bug.cgi?id=189782
Reviewed by Xabier Rodriguez-Calvar.
Ideally, container formats should use exact timestamps and frames
should not overlap. Unfortunately, there are lots of files out there
where this is not always the case.
This is particularly a problem in WebM, where timestamps are expressed
in a power of 10 timescale, which forces some rounding.
This patch makes SourceBuffer allow frames with a small overlaps
(<=1ms) as those usually found in WebM. 1 ms is chosen because it's
the default time scale of WebM files.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-09-20 Yacine Bandou <yacine.bandou@softathome.com>
[EME] Add WebM sanitization
https://bugs.webkit.org/show_bug.cgi?id=189740
Reviewed by Xabier Rodriguez-Calvar.
This patch adds support for sanitizing the WebM initialization data,
ensures there are no bogus values.
See https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest.
Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::sanitizeWebM): Added implementation, check if the initialization data doesn't empty and its size
should be less than 64KB, return the buffer copy if it is ok, otherwise a nullptr.
(WebCore::extractKeyIDsWebM): Added implementation.
2018-09-20 Philippe Normand <pnormand@igalia.com>
[GStreamer] Utilities cleanups
https://bugs.webkit.org/show_bug.cgi?id=189699
Reviewed by Xabier Rodriguez-Calvar.
The GstMappedBuffer now has a move constructor so that it can be easily
reused in the webaudiosrc element. The now-unused corresponding
buffer-mapping utilities are removed from the code-base.
The HTTP source element used to handle a GstBuffer in its private
structure but this is no longer required since data is now pushed
in chunks, see bug #182829.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createGstBuffer): Deleted.
(WebCore::createGstBufferForData): Deleted.
(WebCore::getGstBufferDataPointer): Deleted.
(WebCore::mapGstBuffer): Deleted.
(WebCore::unmapGstBuffer): Deleted.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): New method returning a
reference to a newly created GstMappedBuffer instance.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStop): Remove reference to unused GstBuffer.
(CachedResourceStreamingClient::dataReceived): Ditto.
2018-09-20 Simon Fraser <simon.fraser@apple.com>
Fix crash under FontCache::purgeInactiveFontData() when a memory warning fires
https://bugs.webkit.org/show_bug.cgi?id=189722
rdar://problem/44182860
Reviewed by Myles C. Maxfield.
Hashing of FontPlatformData for cachedFonts() is somewhat broken because CFEqual() on CTFont
can return false when the fonts are actually the same, and have the same CFHash(). This
can result in multiple entries in cachedFonts() with the same Font.
Then in FontCache::purgeInactiveFontData(), the loop that appends fonts to fontsToDelete
gets the value by reference, and WTFMoves it into fontsToDelete. This nulls out all
the entries sharing the same value, leaving null entries in the hash table.
We later crash at font->hasOneRef() when using one of those null entries.
Fix by making a copy of the RefPtr<Font> in the loop, so the WTFMove doesn't nuke
the hash table entries. The entries will get removed at cachedFonts().remove() lower down.
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontData):
2018-09-20 Antoine Quint <graouts@apple.com>
[Web Animations] Provide a way to query accelerated animations for internal testing
https://bugs.webkit.org/show_bug.cgi?id=189762
Reviewed by Dean Jackson.
Expose a new internals.acceleratedAnimationsForElement(element) method to allow layout tests to query the current list
of accelerated animations for a given element. Currently only the animated property and animation speed are exposed, which
will allow us to identify missing, running and paused accelerated animations.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::acceleratedAnimationsForElement const):
* animation/DocumentTimeline.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::acceleratedAnimationsForTesting const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-19 Ryosuke Niwa <rniwa@webkit.org>
Improve node statistics for rare data
https://bugs.webkit.org/show_bug.cgi?id=189775
Reviewed by Simon Fraser.
Report reasons we created NodeRareData and ElementRareData in node statistics.
Added NodeRareData::useTypes and ElementRareData::useTypes which returns OptionSet<NodeRareData::UseType>
indicating which instance member of the rare data is currently in use.
* dom/Element.cpp:
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::defaultMinimumSizeForResizing):
(WebCore::ElementRareData::useTypes const):
* dom/Node.cpp:
(WebCore::stringForRareDataUseType):
(WebCore::Node::dumpStatistics):
* dom/NodeRareData.cpp:
* dom/NodeRareData.h:
(WebCore::NodeRareData::useTypes const):
2018-09-19 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r235917): 2% regression in Dromaeo CSS selector on MacBookPro11,4
https://bugs.webkit.org/show_bug.cgi?id=189738
Reviewed by Yusuke Suzuki.
The regression was caused by the regundant walk to the parent element. Removed it to fix the regression.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
2018-09-19 John Wilander <wilander@apple.com>
Resource Load Statistics: Add optional cap on partitioned cache max age
https://bugs.webkit.org/show_bug.cgi?id=189711
<rdar://problem/39246837>
Reviewed by Antti Koivisto and Chris Dumez.
Test: http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::maxAgeCacheCap):
Checks if a max age cap is set and returns it if the request
represents a prevalent resource.
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
New functionality to receive a max age cap setting in the session.
2018-09-19 Youenn Fablet <youenn@apple.com>
Layout Test webrtc/video-mute.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=177501
Reviewed by Eric Carlson.
Covered by updated test expectation.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer): Make sure the whole buffer is properly initialized.
2018-09-19 David Kilzer <ddkilzer@apple.com>
WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
<https://webkit.org/b/189742>
<rdar://problem/44589774>
Reviewed by Joseph Pecoraro.
* platform/network/cocoa/WebCoreNSURLSession.h:
(WebCoreNSURLSession._sessionDescription): Change type from
NSString * to RetainPtr<NSString>.
* platform/network/cocoa/WebCoreNSURLSession.mm: Remove
@synthesized statement for sessionDescription so that custom
methods can be implemented to handle RetainPtr<NSString>.
(-[WebCoreNSURLSession sessionDescription]): Add.
(-[WebCoreNSURLSession setSessionDescription:]): Add.
2018-09-19 Youenn Fablet <youenn@apple.com>
Implement sender/receiver getStats
https://bugs.webkit.org/show_bug.cgi?id=189707
Reviewed by Eric Carlson.
Add support for sender and receiver getStats.
Also add support for peer connection selector parameter.
Add the plumbing of the selector to LibWebRTCMediaEndpoint.
Then make use of libwebrtc overloaded methods to retrieve the right stats.
Covered by updated/rebased tests.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::RTCRtpReceiver):
(WebCore::RTCRtpReceiver::getStats):
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::create):
(WebCore::RTCRtpReceiver::backend):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::getStats):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::backendFromRTPSender):
(WebCore::createReceiverForSource):
(WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
2018-09-19 Jer Noble <jer.noble@apple.com>
REGRESSION (r236006): New waitingForKey() requirement breaks Modern EME tests.
https://bugs.webkit.org/show_bug.cgi?id=189720
<rdar://problem/44572140>
Reviewed by Xabier Rodriguez-Calvar.
Always call waitingForKey() after calling initializationDataEncountered().
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
2018-09-19 Philippe Normand <pnormand@igalia.com>
[GStreamer] Add support for AV1 decoding
https://bugs.webkit.org/show_bug.cgi?id=189647
Tweaked by Xabier Rodriguez Calvar <calvaris@igalia.com>.
Reviewed by Žan Doberšek.
AV1 can be muxed in MP4 and WebM containers. The test is an adaptation from Chromium's unittest:
https://chromium.googlesource.com/chromium/src/+/master/content/browser/media/media_canplaytype_browsertest.cc
Test: media/media-can-play-av1.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Add AV1
support. The av01 codec has to be explicitely checked, along with
the presence of a compatible AV1 decoder.
2018-09-18 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Limit capturing extra metrics for Web Inspector when not required.
https://bugs.webkit.org/show_bug.cgi?id=189520
Reviewed by Alex Christensen.
Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process
time when they are not needed.
No new tests because there's no behavior change.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
2018-09-18 Megan Gardner <megan_gardner@apple.com>
Support Images Module Level 4's double-position gradient color stop syntax
https://bugs.webkit.org/show_bug.cgi?id=186154
<rdar://problem/44158152>
Reviewed by Simon Fraser.
The CSS spec for all gradients allows for each color stop to have two angles to be used for hints.
This makes pie chart and checkerboard conic gradients much simpler to write.
Any time you want to have a hard line in a gradient, this syntax simplifies the gradient specification.
Test: fast/gradients/conic-two-hints.html
Test: fast/gradients/linear-two-hints-angle.html
Test: fast/gradients/linear-two-hints.html
Test: fast/gradients/radial-two-hints.html
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops): Removed.
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2018-09-18 Simon Fraser <simon.fraser@apple.com>
Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
https://bugs.webkit.org/show_bug.cgi?id=189689
Reviewed by Alex Christensen.
enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use
a SetForScope<>.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted.
* rendering/RenderLayerCompositor.h:
2018-09-18 Joseph Pecoraro <pecoraro@apple.com>
[macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask
https://bugs.webkit.org/show_bug.cgi?id=189685
<rdar://problem/44541974>
Reviewed by Per Arne Vollan.
* platform/mac/PlatformScreenMac.mm:
(WebCore::gpuIDForDisplayMask):
2018-09-18 Youenn Fablet <youenn@apple.com>
Implement RTCRtpReceiver getContributingSources/getSynchronizationSources
https://bugs.webkit.org/show_bug.cgi?id=189671
Reviewed by Eric Carlson.
Introduce implementation of these two methods by calling the libwebrtc corresponding method.
Add corresponding IDL as per spec.
Covered by rebased WPT tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCRtpContributingSource.h: Added.
* Modules/mediastream/RTCRtpContributingSource.idl: Added.
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::getContributingSources const):
(WebCore::RTCRtpReceiver::getSynchronizationSources const):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpReceiverBackend.h:
(WebCore::RTCRtpReceiverBackend::getContributingSources const):
(WebCore::RTCRtpReceiverBackend::getSynchronizationSources const):
* Modules/mediastream/RTCRtpSynchronizationSource.h: Added.
* Modules/mediastream/RTCRtpSynchronizationSource.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::fillRTCRtpContributingSource):
(WebCore::toRTCRtpContributingSource):
(WebCore::toRTCRtpSynchronizationSource):
(WebCore::LibWebRTCRtpReceiverBackend::getContributingSources const):
(WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-09-18 Youenn Fablet <youenn@apple.com>
Enable Unified Plan by default
https://bugs.webkit.org/show_bug.cgi?id=189675
Reviewed by Eric Carlson.
RTCRtpTransceiver.currentDirection is now gated by the unified plan runtime flag.
This will allow easy feature detection of unified plan support.
Covered by updated test.
* Modules/mediastream/RTCRtpTransceiver.idl:
2018-09-18 Per Arne Vollan <pvollan@apple.com>
[WebVTT] change "middle" to "center" for consistency with CSS
https://bugs.webkit.org/show_bug.cgi?id=158478
Reviewed by Eric Carlson.
No new tests, covered by existing tests.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::centerKeyword):
(WebCore::VTTCue::initialize):
(WebCore::VTTCue::align const):
(WebCore::VTTCue::setAlign):
(WebCore::VTTCue::calculateDisplayParameters):
(WebCore::VTTCue::setCueSettings):
(WebCore::middleKeyword): Deleted.
* html/track/VTTCue.h:
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::buildFromString):
2018-09-18 Chris Dumez <cdumez@apple.com>
"DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page from PageCache
https://bugs.webkit.org/show_bug.cgi?id=189681
<rdar://problem/44526171>
Reviewed by Alex Christensen and Zalan Bujtas.
The "DidFirstVisuallyNonEmptyLayout" callback was not getting called when restoring a page from PageCache
because the FrameView is restored from PageCache and we would fail to restore its flags (such as
m_firstVisuallyNonEmptyLayoutCallbackPending) when entering Page Cache. We now call reset those flags that
are related to layout miletones when entering PageCache so that layout milestone events properly get sent
again when restoring from Page Cache.
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
2018-09-18 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Static position should use content-box, not padding-box
https://bugs.webkit.org/show_bug.cgi?id=189698
Reviewed by Javier Fernandez.
This is a recent change by the CSSWG:
https://github.com/w3c/csswg-drafts/issues/3020
The spec text (https://drafts.csswg.org/css-grid/#static-position):
"The static position of an absolutely-positioned child
of a grid container is determined as if it were the sole grid item
in a grid area whose edges coincide with the content edges
of the grid container."
Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::prepareChildForPositionedLayout):
Simple change to use border and padding.
2018-09-18 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=185590
Reviewed by Philippe Normand.
When decryptors are blocked waiting for the key, instruct the
player to run the Wait for key algorithm. As per spec, if we run
out of blocks pending to decrypt because we don't have the key, we
request running the algorithm again.
Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
2018-09-12 Ryosuke Niwa <rniwa@webkit.org>
Update composedPath to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=180378
<rdar://problem/42843004>
Reviewed by Darin Adler.
This patch makes the check for whether a given node in the event path be included in composedPath
pre-determined at the time of the event dispatching per https://github.com/whatwg/dom/issues/525.
This was a fix for the issue that if an event listener in a closed shadow tree removes a node in the
same tree in the event path, then composedPath called on its shadow host, for example, will include
the removed node since it's no longer in the closed shadow tree.
Naively, implementing this behavior would require remembering the original document or shadow root
of each node in the event path as well as its parent shadow root, or worse which node is disclosed
to every other node at the time of computing the event path.
This patch takes a more novel and efficient approach to implement the new behavior by adding a single
integer indicating the number of closed-mode shadow root ancestors of each node in the event path.
In computePathUnclosedToTarget, any node whose *depth* is greater than the context object is excluded.
Consider the following example:
div ------- ShadowRoot (closed)
+- span +- slot
If an event is dispatched on span, then the event path would be [span, slot, ShadowRoot, div]. Then
the values of integers assigned to each node would be: [0, 1, 1, 0] respectively. When composedPath
is called on span or div, slot and ShadowRoot are excluded because they have a greater *depth* value.
Unfortunately, this simplistic solution doesn't work when there are multiple shadow roots of the same
depth through which an event is dispatched as in:
section -- ShadowRoot (closed, SR2)
| +- slot (s2)
+div ------ ShadowRoot (closed, SR1)
+- span +- slot (s1)
If an event is dispatched on span, the event path would be [span, s1, SR1, div, s2, SR2, section].
The values of integers assigned are: [0, 1, 1, 0, 1, 1, 0] respectively. When composedPath is called
on SR1, the simplistic approach would include s2 and SR2, which would be wrong.
To account for this case, in computePathUnclosedToTarget, we traverse the event path upwards (i.e.
ancestors) and downwards (i.e. descendants) from the context object and decrease the *allowed depth*
of shadow trees when we traverse out of a shadow tree in either direction. When traversing upwards,
therefore, moving out of a shadow root to its host would would decrease the allowed depth. When
traversing dowards, moving from a slot element to its assigned node would decrease the allowed depth.
Note that the depths can be negative when a composed event is dispatched inside a closed shadow tree,
and it gets out of its shadow host.
Unfortunately, the latest DOM specification has a bug and doesn't match the behavior of Chrome. This
patch proposes a new algorithm which can be adopted in https://github.com/whatwg/dom/issues/684.
Test: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html
* dom/EventContext.cpp:
(WebCore::EventContext::EventContext):
(WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext):
(WebCore::TouchEventContext::TouchEventContext):
* dom/EventContext.h:
(WebCore::EventContext::closedShadowDepth const): Added.
* dom/EventPath.cpp:
(WebCore::WindowEventContext::WindowEventContext):
(WebCore::EventPath::buildPath): Compute the closed shadow tree's depths for each node in the path.
(WebCore::computePathUnclosedToTarget const): Implemented the aforementioned algorithm.
(WebCore::EventPath::EventPath):
2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=185339
Reviewed by Mark Lam.
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
(WebCore::NetworkExtensionContentFilter::willSendRequest):
(WebCore::NetworkExtensionContentFilter::responseReceived):
(WebCore::NetworkExtensionContentFilter::addData):
(WebCore::NetworkExtensionContentFilter::finishedAddingData):
(WebCore::NetworkExtensionContentFilter::handleDecision):
Use per-function BinarySemaphore instead of holding it in NetworkExtensionContentFilter's field.
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
(WebCore::FileMonitor::~FileMonitor):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
Use BinarySemaphore. And remove unused dispatch_semaphore_t.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
Use Box<Semaphore> and Box<BinarySemaphore>.
* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
Remove unused dispatch_semaphore_t.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::getRunLoop):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):
(-[WebCoreResourceHandleAsOperationQueueDelegate dealloc]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
Use BinarySemaphore instead.
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Many modern media control tests leak documents in testing
https://bugs.webkit.org/show_bug.cgi?id=189437
Reviewed by Darin Adler.
In order to accurately detect leaks in media controls tests which use lots of
SVGImages, we have to:
- Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
to clear references to elements.
- Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
to drop the last handle to the CachedResource for an SVGImage.
- Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
to run again after that timer has fired.
This should fix most of the spurious leak reports involving SVGImage documents.
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
2018-09-17 Jer Noble <jer.noble@apple.com>
Add support for HEVC codec types in Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=189565
Reviewed by Eric Carlson.
Test: media/hevc-codec-parameters.html
Add some utility methods for parsing HEVC codec strings, and using those parsed
values to query the platform for detailed support for HEVC decoding.
Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function
pointers in the encode/decode factory pair.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/HEVCUtilities.cpp: Added.
(WebCore::parseHEVCCodecParameters):
* platform/graphics/HEVCUtilities.h: Added.
* platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added.
(WebCore::validateHEVCParameters):
* platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added.
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added.
(WebCore::videoCodecTypeFromRFC4281Type):
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* testing/Internals.cpp:
(WebCore::Internals::parseHEVCCodecParameters):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-17 Devin Rousso <drousso@apple.com>
Web Inspector: generate CSSKeywordCompletions from backend values
https://bugs.webkit.org/show_bug.cgi?id=189041
Reviewed by Joseph Pecoraro.
Modified existing test inspector/css/getSupportedCSSProperties.html.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Send alias and longhand information for all properties, and any known keyword values for
those applicable. This makes use of `CSSParserFastPaths::isValidKeywordPropertyAndValue` to
determine if a given keyword is a valid value for each property. This only generates a list
for properties who have no non-keyword values.
* css/makeprop.pl:
* css/makevalues.pl:
Create additional helper functions/constants for retrieving strings of each CSS keyword.
* css/CSSProperty.h:
(WebCore::CSSProperty::aliasesForProperty):
* css/CSSPrimitiveValue.cpp:
(WebCore::valueName):
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createIdentifierValue):
2018-09-17 Youenn Fablet <youenn@apple.com>
track.onmute isn't called for a remote MediaStreamTrack when its counter part track is removed from the peer connection
https://bugs.webkit.org/show_bug.cgi?id=176281
<rdar://problem/44525674>
Reviewed by Eric Carlson.
Listen to libwebrtc remove track callbacks.
Implement handling as per https://w3c.github.io/webrtc-pc/#process-remote-track-removal.
This triggers a mute event on the track.
Test: webrtc/remove-track.html
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::OnRemoveTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
Drive by fix: Plan B code path does not mandate having an rtc backend for each sender.
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Add more Fullscreen logging
https://bugs.webkit.org/show_bug.cgi?id=189656
Reviewed by Jer Noble.
Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
the fullscreen element.
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):
2018-09-14 Simon Fraser <simon.fraser@apple.com>
Add support for dumping the GraphicsLayer tree via notifyutil
https://bugs.webkit.org/show_bug.cgi?id=189639
Reviewed by Zalan Bujtas.
Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree
for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints
the entire tree for each main frame).
It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should
be converted in the same way).
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* rendering/RenderLayerCompositor.cpp:
(showGraphicsLayerTreeForCompositor):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.cpp:
(WebCore::printGraphicsLayerTreeForLiveDocuments):
* rendering/RenderObject.h:
2018-09-17 Christopher Reid <chris.reid@sony.com>
[Curl] Add schema version and enable auto vacuum for cookie database.
https://bugs.webkit.org/show_bug.cgi?id=189669
Reviewed by Alex Christensen.
Turning on auto incremental vacuuming and adding versioning to the database. Right now we
reset tables if there's an unknown schema or if the none is set. There is placeholder logic
in place to upgrade databases as the schema changes in the future.
Tested by checking the database manually after launching MiniBrowser.
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::verifySchemaVersion):
(WebCore::CookieJarDB::deleteAllTables):
(WebCore::CookieJarDB::createPrepareStatement):
(WebCore::CookieJarDB::getPrepareStatement):
(WebCore::CookieJarDB::executeSimpleSql):
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultSession):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): fixed a bug.
2018-09-14 Ryosuke Niwa <rniwa@webkit.org>
Re-order Node flags based on semantics
https://bugs.webkit.org/show_bug.cgi?id=189643
Reviewed by Simon Fraser.
Re-ordered Node flags based on their category and subclasses of Node which use them.
* dom/Node.h:
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Add more ResourceLoading logging, particularly in MemoryCache code
https://bugs.webkit.org/show_bug.cgi?id=189651
Reviewed by Tim Horton.
Adding more logging to the ResourceLoading log channel, which I found useful
when trying to understand cached SVGImage lifetimes (bug 189437).
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::deleteIfPossible):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::garbageCollectDocumentResources):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResources):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::dumpLRULists const):
2018-09-17 Jer Noble <jer.noble@apple.com>
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096
Reviewed by Eric Carlson.
Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
Now Playing implementation on iOS and Mac.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
(PlatformMediaSessionManager::sharedManager):
(PlatformMediaSessionManager::sharedManagerIfExists):
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(MediaSessionManagerCocoa::nowPlayingEligibleSession):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.h:
(): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
(WebCore::MediaSessionManageriOS::removeSession): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
(WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h: Removed.
2018-09-17 Frederic Wang <fwang@igalia.com>
Build error in ImageBufferCG when compiled with IOSurfacePool
https://bugs.webkit.org/show_bug.cgi?id=189579
Reviewed by Tim Horton.
IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing
compilation errors when files in the same unified source do not agree on the definition.
This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h
to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files.
Finally some minors changes to explicitly declare/define ImageBuffer are performed in order
to prevent future issues with Unified build rotating.
No new tests, behavior unchanged.
* html/HTMLCanvasElement.cpp: Explicitly include ImageBuffer.h since it's used in this file.
* platform/graphics/cg/ImageBufferDataCG.h: Move definition into Platform.h.
* platform/graphics/cocoa/IOSurface.h: Forward-declare ImageBuffer since it's used in this
header.
2018-09-17 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Respond with requested authentication scheme for authentication challenge.
https://bugs.webkit.org/show_bug.cgi?id=189318
Reviewed by Alex Christensen.
Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
mode, the round-trip communication between the client and the server is handled by libcurl
internally. That's okay for many cases. But when initial request has a credentials
(i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
the returned response is not 401.
Passes following tests:
- http/tests/websocket/tests/hybi/httponly-cookie.pl
- http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl
- http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl
- http/tests/xmlhttprequest/basic-auth-default.html
- http/tests/xmlhttprequest/cross-origin-authorization.html
- http/tests/xmlhttprequest/logout.html
- http/tests/xmlhttprequest/null-auth.php
- http/tests/xmlhttprequest/re-login-async.html
- http/tests/xmlhttprequest/re-login.html
- http/tests/xmlhttprequest/redirect-credentials-responseURL.html
- http/tests/xmlhttprequest/remember-bad-password.html
* platform/network/ResourceHandle.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setHttpAuthUserPass):
(WebCore::CurlHandle::enableHttpAuthentication): Deleted.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setAuthenticationScheme):
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
2018-09-17 Youenn Fablet <youenn@apple.com>
Enable VCP for iOS and reenable it for MacOS
https://bugs.webkit.org/show_bug.cgi?id=189635
<rdar://problem/43621029>
Reviewed by Eric Carlson.
Covered by exsiting and modified tests.
Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient.
Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms.
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* testing/Internals.cpp:
(WebCore::Internals::supportsVCPEncoder):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-17 Chris Dumez <cdumez@apple.com>
PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
https://bugs.webkit.org/show_bug.cgi?id=189602
<rdar://problem/44430549>
Reviewed by Geoff Garen.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setTriggeringAction):
* loader/DocumentLoader.h:
* loader/FrameLoadRequest.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
Move NavigationAction's opener setting to loadWithNavigationAction() as this is a better bottleneck.
Otherwise, we'd have to set it at several call sites. Also move the NavigationAction around instead
of copying it.
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/NavigationAction.h:
(WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
2018-09-17 Darin Adler <darin@apple.com>
Use OpaqueJSString rather than JSRetainPtr inside WebKit
https://bugs.webkit.org/show_bug.cgi?id=189652
Reviewed by Saam Barati.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
(WebCore::jsValueWithAVMetadataItemInContext): Use adoptCF.
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
2018-09-08 Darin Adler <darin@apple.com>
Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
https://bugs.webkit.org/show_bug.cgi?id=189455
Reviewed by Keith Miller.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Adding a missing
JSStringRelease to fix a leak.
2018-09-15 Rob Buis <rbuis@igalia.com>
XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
https://bugs.webkit.org/show_bug.cgi?id=189627
Reviewed by Alexey Proskuryakov.
Right now we return an empty Blob without type when the response is empty, but
it should always include the type [1].
Test: web-platform-tests/xhr/overridemimetype-blob.html
[1] https://xhr.spec.whatwg.org/#blob-response
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createResponseBlob):
2018-09-14 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
https://bugs.webkit.org/show_bug.cgi?id=189530
Reviewed by Alex Christensen.
Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
Also respondEnd was not correctly recorded and fixed.
No new tests because it cannot be measured from DRT.
* platform/network/ResourceHandleInternal.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::setStartTime):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
2018-09-14 Justin Fan <justin_fan@apple.com>
WebGL 2 conformance: rgb-format-support.html
https://bugs.webkit.org/show_bug.cgi?id=189610
<rdar://problem/44403343>
Reviewed by Dean Jackson.
Implementing getInternalformatParameter (emulating on macOS) and updating
renderbufferStorage{Multisample} for WebGL 2 conformance.
Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::isRenderableInternalformat):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
(WebCore::WebGL2RenderingContext::renderbufferStorage):
(WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
(WebCore::WebGL2RenderingContext::isIntegerFormat):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getInternalformativ):
(WebCore::GraphicsContext3D::renderbufferStorageMultisample):
2018-09-14 Justin Michaud <justin_michaud@apple.com>
Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
https://bugs.webkit.org/show_bug.cgi?id=5968
Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
the result of multiplying stop-opacity with the opacity of the color.
Reviewed by Simon Fraser.
Tests: svg/gradients/spreadMethod-expected.svg
svg/gradients/spreadMethod.svg
svg/gradients/spreadMethodAlpha-expected.svg
svg/gradients/spreadMethodAlpha.svg
svg/gradients/spreadMethodClose0-expected-mismatch.svg
svg/gradients/spreadMethodClose0.svg
svg/gradients/spreadMethodClose1-expected-mismatch.svg
svg/gradients/spreadMethodClose1.svg
svg/gradients/spreadMethodClose2-expected.svg
svg/gradients/spreadMethodClose2.svg
svg/gradients/spreadMethodDiagonal-expected.svg
svg/gradients/spreadMethodDiagonal.svg
svg/gradients/spreadMethodDiagonal2-expected.svg
svg/gradients/spreadMethodDiagonal2.svg
svg/gradients/spreadMethodDuplicateStop-expected.svg
svg/gradients/spreadMethodDuplicateStop.svg
svg/gradients/spreadMethodReversed-expected.svg
svg/gradients/spreadMethodReversed.svg
svg/gradients/stopAlpha-expected.svg
svg/gradients/stopAlpha.svg
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):
2018-09-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix the iOSMac build after r236015.
* platform/graphics/cv/PixelBufferResizer.mm:
(WebCore::PixelBufferResizer::PixelBufferResizer):
2018-09-11 Simon Fraser <simon.fraser@apple.com>
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521
Reviewed by Tim Horton.
Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
All the other changes are just to adapt to the new ownership patterns.
I verified that no GraphicsLayers were leaked or abandoned after this change.
No behavior change.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
(WebCore::PageOverlayController::didChangeViewSize):
(WebCore::PageOverlayController::didChangeDocumentSize):
(WebCore::PageOverlayController::didChangeSettings):
(WebCore::PageOverlayController::paintContents):
(WebCore::PageOverlayController::didChangeOverlayFrame):
(WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::Highlight::layer const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::invalidate):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
(WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::willBeDestroyed):
(WebCore::GraphicsLayer::setChildren):
(WebCore::GraphicsLayer::addChild):
(WebCore::GraphicsLayer::addChildAtIndex):
(WebCore::GraphicsLayer::addChildBelow):
(WebCore::GraphicsLayer::addChildAbove):
(WebCore::GraphicsLayer::replaceChild):
(WebCore::GraphicsLayer::removeAllChildren):
(WebCore::GraphicsLayer::removeFromParent):
(WebCore::GraphicsLayer::setMaskLayer):
(WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
(WebCore::GraphicsLayer::distributeOpacity):
(WebCore::GraphicsLayer::traverse):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::children const):
(WebCore::GraphicsLayer::children):
(WebCore::GraphicsLayer::maskLayer const):
(WebCore::GraphicsLayer::replicaLayer const):
(WebCore::GraphicsLayer::beingDestroyed const):
(WebCore::GraphicsLayer:: const): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::setChildren):
(WebCore::GraphicsLayerCA::addChild):
(WebCore::GraphicsLayerCA::addChildAtIndex):
(WebCore::GraphicsLayerCA::addChildBelow):
(WebCore::GraphicsLayerCA::addChildAbove):
(WebCore::GraphicsLayerCA::replaceChild):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::initialize): Deleted.
(WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
2018-09-14 Eric Carlson <eric.carlson@apple.com>
Support arbitrary video resolution in getUserMedia API
https://bugs.webkit.org/show_bug.cgi?id=178109
<rdar://problem/35083128>
Reviewed by Youenn Fablet.
Support arbitrary video resolutions by configuring the camera to capture at the closest
larger size it supports and scaling/cropping frames as necessary.
No new tests, existing tests updated.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::MediaStreamAudioSource::settings): Ditto.
(WebCore::MediaStreamAudioSource::capabilities const): Deleted.
(WebCore::MediaStreamAudioSource::settings const): Deleted.
* Modules/webaudio/MediaStreamAudioSource.h:
* SourcesCocoa.txt: Add PixelBufferResizer.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/cocoa/CoreVideoSoftLink.h:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/cv/PixelBufferResizer.h: Added.
(WebCore::PixelBufferResizer::canResizeTo):
* platform/graphics/cv/PixelBufferResizer.mm: Added.
(WebCore::PixelBufferResizer::PixelBufferResizer):
(WebCore::PixelBufferResizer::resize):
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::RealtimeIncomingAudioSource::settings): Ditto.
(WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted.
(WebCore::RealtimeIncomingAudioSource::settings const): Deleted.
* platform/mediastream/RealtimeIncomingAudioSource.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::RealtimeIncomingVideoSource::settings): Ditto.
(WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted.
(WebCore::RealtimeIncomingVideoSource::settings const): Deleted.
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsConstraint):
(WebCore::RealtimeMediaSource::supportsConstraint const): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::presets):
(WebCore::RealtimeVideoSource::setSupportedPresets):
(WebCore::standardVideoSizes):
(WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful.
(WebCore::presetSupportsFrameRate):
(WebCore::RealtimeVideoSource::supportsCaptureSize):
(WebCore::RealtimeVideoSource::shouldUsePreset):
(WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
(WebCore::RealtimeVideoSource::setSizeAndFrameRate):
(WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted.
* platform/mediastream/RealtimeVideoSource.h:
(WebCore::VideoPresetData::encode const):
(WebCore::VideoPresetData::decode):
(WebCore::VideoPreset::create):
(WebCore::VideoPreset::VideoPreset):
(WebCore::RealtimeVideoSource::prefersPreset):
(WebCore::RealtimeVideoSource::canResizeVideoFrames const):
(WebCore::RealtimeVideoSource::setDefaultSize):
(WebCore::RealtimeVideoSource::observedFrameRate const):
(WebCore::VideoPreset::encode const): Deleted.
(WebCore::VideoPreset::decode): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.h:
(WebCore::AVVideoCaptureSource::videoPresets): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoPreset::create):
(WebCore::AVVideoPreset::AVVideoPreset):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::settings):
(WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::AVVideoCaptureSource::setFrameRate):
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::processNewFrame):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVVideoCaptureSource::isFrameRateSupported):
(WebCore::AVVideoCaptureSource::generatePresets):
(WebCore::updateSizeMinMax): Deleted.
(WebCore::updateAspectRatioMinMax): Deleted.
(WebCore::AVVideoCaptureSource::settings const): Deleted.
(WebCore::AVVideoCaptureSource::capabilities const): Deleted.
(WebCore::AVVideoCaptureSource::sizeForPreset): Deleted.
(WebCore::AVVideoCaptureSource::setPreset): Deleted.
(WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted.
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities const): Deleted.
(WebCore::CoreAudioCaptureSource::settings const): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful.
(WebCore::DisplayCaptureSourceCocoa::settings): Ditto.
(WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted.
(WebCore::DisplayCaptureSourceCocoa::settings const): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
* platform/mock/MockMediaDevice.h:
(WebCore::MockCameraProperties::decode):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
(WebCore::MockRealtimeAudioSource::settings const): Deleted.
(WebCore::MockRealtimeAudioSource::capabilities const): Deleted.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices): Change video device presets to trigger resize code more often.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::generatePresets):
(WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities const): Deleted.
(WebCore::MockRealtimeVideoSource::settings const): Deleted.
* platform/mock/MockRealtimeVideoSource.h:
2018-09-14 Frederic Wang <fwang@igalia.com>
Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
https://bugs.webkit.org/show_bug.cgi?id=189541
Reviewed by Alex Christensen.
FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
FontTaggedSettings::hash() template function. This instantiation may happen before
FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
we declare full specialization of the hash() functions in FontTaggedSettings.h.
No new tests, behavior unchanged.
* platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
* platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().
2018-09-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235990.
Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS
Reverted changeset:
"Enable USE_MEDIAREMOTE on iOS"
https://bugs.webkit.org/show_bug.cgi?id=189096
https://trac.webkit.org/changeset/235990
2018-09-14 Jer Noble <jer.noble@apple.com>
Turn SourceBufferChangeTypeEnabled on by default
https://bugs.webkit.org/show_bug.cgi?id=189527
Reviewed by Eric Carlson.
* page/Settings.yaml:
2018-09-14 Devin Rousso <webkit@devinrousso.com>
Web Inspector: Record actions performed on ImageBitmapRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=181341
Reviewed by Joseph Pecoraro.
Test: inspector/canvas/recording-bitmaprenderer.html
* html/canvas/ImageBitmapRenderingContext.idl:
* inspector/InspectorCanvas.cpp:
(WebCore::shouldSnapshotBitmapRendererAction):
(WebCore::InspectorCanvas::recordAction):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
* page/PageConsoleClient.cpp:
(canvasRenderingContext):
2018-09-14 David Kilzer <ddkilzer@apple.com>
REGRESSION (r235954): Fix build failure on watchOS
<https://webkit.org/b/189605>
Reviewed by Geoffrey Garen.
Remove `using WebCore::IndexedDB::KeyType;` from
Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
resulting build failures.
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::isValid const):
(WebCore::IDBKey::compare const):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createNumber):
(WebCore::IDBKey::createDate):
(WebCore::IDBKey::type const):
(WebCore::IDBKey::array const):
(WebCore::IDBKey::string const):
(WebCore::IDBKey::date const):
(WebCore::IDBKey::number const):
(WebCore::IDBKey::binary const):
(WebCore::IDBKey::compareTypes):
(WebCore::IDBKey::IDBKey):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey const):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare const):
(WebCore::IDBKeyData::loggingString const):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setBinaryValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
(WebCore::IDBKeyData::isValid const):
(WebCore::IDBKeyData::operator== const):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::minimum):
(WebCore::IDBKeyData::maximum):
(WebCore::IDBKeyData::type const):
(WebCore::IDBKeyData::hash const):
(WebCore::IDBKeyData::string const):
(WebCore::IDBKeyData::date const):
(WebCore::IDBKeyData::number const):
(WebCore::IDBKeyData::binary const):
(WebCore::IDBKeyData::array const):
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
2018-09-14 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] Add support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=189616
Reviewed by Philippe Normand.
Crossplatform support to fire the waitingforkey event from the
player to the element. The element implements the W3C specified
algorithm.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKey):
(WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::waitingForKey):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKey):
2018-09-14 Mike Gorse <mgorse@suse.com>
builtins directory causes name conflict on Python 3
https://bugs.webkit.org/show_bug.cgi?id=189552
Reviewed by Michael Catanzaro.
No new tests (No behavior change).
* CMakeLists.txt: builtins -> wkbuiltins.
* DerivedSources.make: builtins -> wkbuiltins.
2018-09-13 Ryosuke Niwa <rniwa@webkit.org>
Capturing event listeners are called during bubbling phase for shadow hosts
https://bugs.webkit.org/show_bug.cgi?id=174288
<rdar://problem/33530455>
Reviewed by Darin Adler.
Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
dispatched within its shadow tree.
To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
section#hostParent
+ div#host -- ShadowRoot
- p#parent
- span#target
Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
the following order in WebKit & Chrome right now:
1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2. #parent, capturing, eventPhase: CAPTURING_PHASE
3. #target, capturing, eventPhase: AT_TARGET
4. #target, non-capturing, eventPhase: AT_TARGET
5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
6. #host, capturing, eventPhase: AT_TARGET
7. #host, non-capturing, eventPhase: AT_TARGET
8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
started. A more natural ordering would be:
1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2. #host, capturing, eventPhase: AT_TARGET
3. #parent, capturing, eventPhase: CAPTURING_PHASE
4. #target, capturing, eventPhase: AT_TARGET
5. #target, non-capturing, eventPhase: AT_TARGET
6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
7. #host, non-capturing, eventPhase: AT_TARGET
8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
event listeners on the event's target is invoked in the registration order. After this patch, all capturing
event listeners are invoked before bubbling event listeners are invoked.
To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.
Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
media controls before author scripts recieve the event.
(MediaControllerSupport.prototype.disable): Ditto.
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents const):
(WebCore::MouseOrFocusEventContext::handleLocalEvents const):
(WebCore::TouchEventContext::handleLocalEvents const):
* dom/EventContext.h:
* dom/EventDispatcher.cpp:
(WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
the special code path for the event's target with the code in the bubbling phase.
* dom/EventPath.cpp:
(WebCore::WindowEventContext::handleLocalEvents const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
(WebCore::EventTarget::fireEventListeners):
(WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
event listeners even when eventPhase is Event::Phase::AT_TARGET.
* dom/EventTarget.h:
* dom/Node.cpp:
(WebCore::Node::handleLocalEvents):
* dom/Node.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::handleLocalEvents):
* html/HTMLFormElement.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent):
2018-09-13 Megan Gardner <megan_gardner@apple.com>
Fix color stop blending in conic gradients for stops past 1
https://bugs.webkit.org/show_bug.cgi?id=189532
<rdar://problem/44158221>
Reviewed by Simon Fraser.
Calculation was wrong, fixed it, and wrote a test that failed
without the change, and passes with it.
Test: fast/gradients/conic-repeating-last-stop.html
* css/CSSGradientValue.cpp:
(WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
2018-09-13 Chris Dumez <cdumez@apple.com>
Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
https://bugs.webkit.org/show_bug.cgi?id=189590
<rdar://problem/44422725>
Reviewed by Geoffrey Garen.
Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.
Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
(WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/Page.h:
(WebCore::Page::openedViaWindowOpenWithOpener const):
(WebCore::Page::setOpenedViaWindowOpenWithOpener):
2018-09-13 Jer Noble <jer.noble@apple.com>
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096
Reviewed by Eric Carlson.
Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
Now Playing implementation on iOS and Mac.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
(PlatformMediaSessionManager::sharedManager):
(PlatformMediaSessionManager::sharedManagerIfExists):
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(MediaSessionManagerCocoa::nowPlayingEligibleSession):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.h:
(): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
(WebCore::MediaSessionManageriOS::removeSession): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
(WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h: Removed.
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
https://bugs.webkit.org/show_bug.cgi?id=189576
Reviewed by Alex Christensen.
Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
statements, but "friend LazyNeverDestroyed<X>".
No new tests (No behavior change).
* css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
statement.
* css/CSSInitialValue.h: Ditto.
* css/CSSPrimitiveValue.h: Ditto.
* css/CSSRevertValue.h: Ditto.
* css/CSSUnsetValue.h: Ditto.
2018-09-13 Ms2ger <Ms2ger@igalia.com>
[GLib] Fix format string in KeyedEncoderGlib::beginObject().
https://bugs.webkit.org/show_bug.cgi?id=189585
Reviewed by Michael Catanzaro.
This appears to fix the following assertion locally:
GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
Covered by existing tests.
* platform/glib/KeyedEncoderGlib.cpp:
(WebCore::KeyedEncoderGlib::beginObject):
2018-09-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235953.
Caused layout test crashes under GuardMalloc.
Reverted changeset:
"Make GraphicsLayers ref-counted, so their tree can persist
when disconnected from RenderLayerBackings"
https://bugs.webkit.org/show_bug.cgi?id=189521
https://trac.webkit.org/changeset/235953
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
Remove a MSVC workaround in XPath::Step::NodeTest
https://bugs.webkit.org/show_bug.cgi?id=189578
Reviewed by Alex Christensen.
XPath::Step::NodeTest has a special code for MSVC bug workaround.
It has been introduced in 5 years ago in Bug 121082 Comment 19.
I think it is safe just to remove the workaround.
No new tests (No behavior change).
* xml/XPathStep.h: Removed the MSVC workaround.
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
Remove a MSVC workaround in InspectorStyle::styleWithProperties
https://bugs.webkit.org/show_bug.cgi?id=189577
Reviewed by Alex Christensen.
No new tests (No behavior change).
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
2018-09-13 Alex Christensen <achristensen@webkit.org>
Use a Variant instead of a union in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=188559
Reviewed by Antti Koivisto.
No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
I only have m_isForPage when assertions are enabled because it's only used for an assertion.
The rest is pretty straightforward translating union syntax to Variant syntax.
I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::createRareData):
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setArgument):
(WebCore::CSSSelector::setLangArgumentList):
(WebCore::CSSSelector::setSelectorList):
(WebCore::CSSSelector::setNth):
(WebCore::CSSSelector::matchNth const):
(WebCore::CSSSelector::nthA const):
(WebCore::CSSSelector::nthB const):
(WebCore::CSSSelector::RareData::RareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::argument const):
(WebCore::CSSSelector::langArgumentList const):
(WebCore::CSSSelector::selectorList const):
(WebCore::CSSSelector::attribute const):
(WebCore::CSSSelector::attributeCanonicalLocalName const):
(WebCore::CSSSelector::setValue):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::~CSSSelector):
(WebCore::CSSSelector::tagQName const):
(WebCore::CSSSelector::tagLowercaseLocalName const):
(WebCore::CSSSelector::value const):
(WebCore::CSSSelector::serializingValue const):
(WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
(WebCore::CSSSelector::RareData::create): Deleted.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
* css/parser/CSSParserSelector.h:
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=189575
Reviewed by Alex Christensen.
No new tests (No behavior change).
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
2018-09-13 Youenn Fablet <youenn@apple.com>
Introduce RTCRtpSendParameters
https://bugs.webkit.org/show_bug.cgi?id=189563
Reviewed by Eric Carlson.
Introduce RTCRtpSendParameters to match the WebRTC specification.
Split RTCRtpPrameters fields accordingly and update call sites.
Covered by updated test.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCRtpCodingParameters.h: Added
* Modules/mediastream/RTCRtpCodingParameters.idl: Added
* Modules/mediastream/RTCRtpDecodingParameters.h: Added
* Modules/mediastream/RTCRtpDecodingParameters.idl: Added
* Modules/mediastream/RTCRtpEncodingParameters.h:
* Modules/mediastream/RTCRtpEncodingParameters.idl:
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpSendParameters.h: Added.
(WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
* Modules/mediastream/RTCRtpSendParameters.idl: Added.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::getParameters):
(WebCore::RTCRtpSender::setParameters):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
(WebCore::LibWebRTCRtpSenderBackend::setParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCRtpParameters):
(WebCore::toRTCRtpSendParameters):
(WebCore::fromRTCRtpSendParameters):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-09-13 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
https://bugs.webkit.org/show_bug.cgi?id=189547
Reviewed by Philippe Normand.
decrypt-key-needed message renamed to drm-cdm-instance-needed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
renaming the message, removed the class prefix for
dispatchCDMInstance.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
2018-09-11 Ryosuke Niwa <rniwa@webkit.org>
imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
https://bugs.webkit.org/show_bug.cgi?id=189493
Reviewed by Alex Christensen.
The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
When a form (or any other) element has more than one ref inside removeDetachedChildren,
addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
However, when a form associated element of this form element appears later in the tree order,
FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
operations happening in this function so this should be safe.
Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
2018-09-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Complete support for Paste as Quotation
https://bugs.webkit.org/show_bug.cgi?id=189504
Reviewed by Wenson Hsieh.
Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
editing/pasteboard/4930986-2-paste-as-quotation.html
editing/pasteboard/4930986-3-paste-as-quotation.html
* editing/Editor.cpp:
Added ClipboardEventKind::PasteAsQuotation.
(WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
(WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
This means that currently event handlers can’t emulate pasting as quotation, because they
neither have the quoted content nor knowledge that quoting has been requested. We could
change this in the future if needed.
(WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
(WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
PasteOption::AsQuotation to pasteWithPasteboard.
(WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
the fragment in a blockquote element with the "type" attribute set to "cite" and the
"class" attribute set to a well-known value, which is used to trigger special behavior in
ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
so eventually, we could stop using this form of in-band signaling.
* editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
behavior.
* editing/EditorCommand.cpp:
(WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
(WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
here.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
quote the fragment if needed.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard): Ditto.
(WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
quote the fragment if needed.
(WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
pasteWithPasteboard.
(WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
quote the fragment if needed.
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::pasteWithPasteboard): Ditto.
2018-09-11 Simon Fraser <simon.fraser@apple.com>
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521
Reviewed by Tim Horton.
Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
All the other changes are just to adapt to the new ownership patterns.
I verified that no GraphicsLayers were leaked or abandoned after this change.
No behavior change.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
(WebCore::PageOverlayController::didChangeViewSize):
(WebCore::PageOverlayController::didChangeDocumentSize):
(WebCore::PageOverlayController::didChangeSettings):
(WebCore::PageOverlayController::paintContents):
(WebCore::PageOverlayController::didChangeOverlayFrame):
(WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::Highlight::layer const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::invalidate):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
(WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::willBeDestroyed):
(WebCore::GraphicsLayer::setChildren):
(WebCore::GraphicsLayer::addChild):
(WebCore::GraphicsLayer::addChildAtIndex):
(WebCore::GraphicsLayer::addChildBelow):
(WebCore::GraphicsLayer::addChildAbove):
(WebCore::GraphicsLayer::replaceChild):
(WebCore::GraphicsLayer::removeAllChildren):
(WebCore::GraphicsLayer::removeFromParent):
(WebCore::GraphicsLayer::setMaskLayer):
(WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
(WebCore::GraphicsLayer::distributeOpacity):
(WebCore::GraphicsLayer::traverse):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::children const):
(WebCore::GraphicsLayer::children):
(WebCore::GraphicsLayer::maskLayer const):
(WebCore::GraphicsLayer::replicaLayer const):
(WebCore::GraphicsLayer::beingDestroyed const):
(WebCore::GraphicsLayer:: const): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::setChildren):
(WebCore::GraphicsLayerCA::addChild):
(WebCore::GraphicsLayerCA::addChildAtIndex):
(WebCore::GraphicsLayerCA::addChildBelow):
(WebCore::GraphicsLayerCA::addChildAbove):
(WebCore::GraphicsLayerCA::replaceChild):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::initialize): Deleted.
(WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
2018-09-12 Alex Christensen <achristensen@webkit.org>
Expose fewer of URL's internal members
https://bugs.webkit.org/show_bug.cgi?id=189528
Reviewed by Chris Dumez.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::urlHostHash):
* platform/URL.cpp:
(WebCore::URL::hostStart const):
(WebCore::protocolHostAndPortAreEqual):
(WebCore::hostsAreEqual):
* platform/URL.h:
(WebCore::URL::hostStart const): Deleted.
(WebCore::URL::hostEnd const): Deleted.
2018-09-12 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Implement correct total received bytes.
https://bugs.webkit.org/show_bug.cgi?id=189555
Reviewed by Alex Christensen.
Curl port only reported total network received bytes before decoding.
No new test. InspectorTest is only available for WebKitTestRunner.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
2018-09-12 Youenn Fablet <youenn@apple.com>
Split RTCRtpParameters idl and header file
https://bugs.webkit.org/show_bug.cgi?id=189524
Reviewed by Eric Carlson.
This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
No change of behavior.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCDegradationPreference.idl: Added.
* Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCDtxStatus.idl: Added.
* Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCPriorityType.idl: Added.
* Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpCodecParameters.idl: Added.
* Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
* Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpFecParameters.idl: Added.
* Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpRtxParameters.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCEncodingParameters):
(WebCore::fromRTCEncodingParameters):
(WebCore::toRTCHeaderExtensionParameters):
(WebCore::fromRTCHeaderExtensionParameters):
(WebCore::toRTCCodecParameters):
(WebCore::toRTCRtpParameters):
(WebCore::fromRTCRtpParameters):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-09-12 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Implement rootMargin expansion
https://bugs.webkit.org/show_bug.cgi?id=189525
Reviewed by Simon Fraser.
Expand the root intersection rectangle by the observer's rootMargin when computing
intersections.
Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
* dom/Document.cpp:
(WebCore::expandRootBoundsWithRootMargin):
(WebCore::computeIntersectionRects):
* page/IntersectionObserver.h:
(WebCore::IntersectionObserver::rootMarginBox const):
* platform/graphics/FloatRect.h:
(WebCore::FloatRect::expand):
2018-09-12 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
https://bugs.webkit.org/show_bug.cgi?id=189542
Reviewed by Alex Christensen.
No new tests (No behavior change).
* platform/graphics/win/IntPointWin.cpp:
(WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
2018-09-12 Guillaume Emont <guijemont@igalia.com>
Add IGNORE_WARNING_.* macros
https://bugs.webkit.org/show_bug.cgi?id=188996
Reviewed by Michael Catanzaro.
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::overrideAttachmentParent):
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper renderWidgetChildren]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper role]):
(-[WebAccessibilityObjectWrapper roleDescription]):
* bridge/objc/WebScriptObject.mm:
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::fieldNamed const):
* crypto/CommonCryptoUtilities.cpp:
(WebCore::getCommonCryptoDigestAlgorithm):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::encryptAES_GCM):
(WebCore::decyptAES_GCM):
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* editing/TextIterator.cpp:
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::takeFindStringFromSelection):
(WebCore::Editor::replaceNodeFromPasteboard):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
* platform/LocalizedStrings.cpp:
(WebCore::formatLocalizedString):
* platform/ScreenProperties.h:
(WebCore::ScreenData::decode):
* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::stopMonitoringInput):
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharedDisplay):
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::IGNORE_CLANG_WARNING_END):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
(-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::IGNORE_CLANG_WARNING_END):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents):
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::createFrameImageAtIndex):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawLineForDocumentMarker):
* platform/graphics/cocoa/WebGLLayer.h:
(IGNORE_CLANG_WARNING):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::Icon):
* platform/graphics/mac/PDFDocumentImageMac.mm:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/mac/WebKitNSImageExtras.mm:
(-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
* platform/ios/DragImageIOS.mm:
* platform/mac/DragImageMac.mm:
(WebCore::scaleDragImage):
(WebCore::createDragImageForLink):
* platform/mac/LegacyNSPasteboardTypes.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::createForCopyAndPaste):
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::setDragImageImpl):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPoint):
* platform/mac/SSLKeyGeneratorMac.mm:
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::platformContentsToScreen const):
(WebCore::ScrollView::platformScreenToContents const):
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* platform/mediastream/RealtimeIncomingAudioSource.h:
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::reportErrorToClient):
* platform/network/create-http-header-name-table:
* platform/text/TextEncoding.cpp:
* testing/MockLibWebRTCPeerConnection.h:
* xml/XPathGrammar.cpp:
2018-09-12 Pablo Saavedra <psaavedra@igalia.com>
Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
https://bugs.webkit.org/show_bug.cgi?id=189540
Reviewed by Philippe Normand.
Related issues:
This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
No new tests, no changes in the functionality.
* platform/GStreamer.cmake:
* platform/SourcesGLib.txt:
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):
2018-09-11 Zan Dobersek <zdobersek@igalia.com>
Unreviewed WPE build fix.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
Add extra header inclusions to get this code building after the unified
sources system shifted it into a different translation unit.
2018-09-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] WebInspector doesn't display request headers added during processing.
https://bugs.webkit.org/show_bug.cgi?id=189531
Reviewed by Alex Christensen.
While processing the request, Curl port network layer adds some headers to the request
such as cookies. Those headers should be displayed in the WebInspector.
Tested on MiniBrowser.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
2018-09-11 James Savage <james.savage@apple.com>
Follow up to:
Expose -apple-system-container-border color to internal web views.
https://bugs.webkit.org/show_bug.cgi?id=189178.
Reviewed by Timothy Hatcher.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
for this change, I had to write out the condition in the first change, but
mistakenly thought I could reuse the block here. Turns out the versions were
different, and I could not.
2018-09-11 Youenn Fablet <youenn@apple.com>
Remove MediaDevices NoInterfaceObject
https://bugs.webkit.org/show_bug.cgi?id=189512
Reviewed by Alex Christensen.
Covered by rebased WPT tests.
* Modules/mediastream/MediaDevices.idl:
2018-09-11 Jer Noble <jer.noble@apple.com>
[MediaCapabilities] Implement MediaEngineConfigurationFactory registration
https://bugs.webkit.org/show_bug.cgi?id=189438
Reviewed by Eric Carlson.
Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
objects representing video and audio configurations are IDLDictionaries, the native objects
are just structs full of POD types (and Strings). Since these have no dependencies on
higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::isValidVideoConfiguration):
(WebCore::MediaCapabilities::decodingInfo):
(WebCore::MediaCapabilities::encodingInfo):
* Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
* Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
* Modules/mediacapabilities/VideoConfiguration.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
* platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
* platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
* platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
* platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
* platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
* platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
* platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
* platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* platform/mediacapabilities/MediaEngineConfigurationFactory.h:
* platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
* platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
(WebCore::canDecodeMedia):
(WebCore::canSmoothlyDecodeMedia):
(WebCore::canPowerEfficientlyDecodeMedia):
(WebCore::canEncodeMedia):
(WebCore::canSmoothlyEncodeMedia):
(WebCore::canPowerEfficientlyEncodeMedia):
(WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
* platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
* platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
* platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
* platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
* platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
2018-09-08 Ryosuke Niwa <rniwa@webkit.org>
:first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
https://bugs.webkit.org/show_bug.cgi?id=166748
<rdar://problem/29649177>
Reviewed by Yusuke Suzuki.
Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
fast/shadow-dom/nth-node-on-shadow-child.html
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
* dom/ShadowRoot.h:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
(WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
2018-09-11 Per Arne Vollan <pvollan@apple.com>
Addressing post-review feedback on r235619.
https://bugs.webkit.org/show_bug.cgi?id=187925
Unreviewed.
* testing/Internals.cpp:
(WebCore::Internals::primaryScreenDisplayID):
* testing/Internals.h:
2018-09-11 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK2] Support changing foreground colors via color panel
https://bugs.webkit.org/show_bug.cgi?id=189382
<rdar://problem/44227311>
Reviewed by Ryosuke Niwa.
Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
Tested by FontManagerTests.ChangeFontColorWithColorPanel.
* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles):
Support setting foreground text color with alpha by using a styled span element rather than a font element with
attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
`rgba()` result in a garbage value for the computed color style.
* editing/FontAttributeChanges.cpp:
(WebCore::FontAttributeChanges::editAction const):
Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
* editing/FontAttributeChanges.h:
(WebCore::FontChanges::isEmpty const):
2018-09-11 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Shrink size of ResourseResponseBase
https://bugs.webkit.org/show_bug.cgi?id=189501
Reviewed by Simon Fraser.
We reduce the size of ResourceResponseBase by the following two optimizations.
1. Use bitfields for bool flags and reorder them.
2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
No behavior change.
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
* platform/network/CacheValidation.h:
(WebCore::CacheControlDirectives::CacheControlDirectives):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::ResourceResponseBase):
(WebCore::ResourceResponseBase::contentRange const):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::decode):
2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix some -Wreturn-type warnings
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::sourceFromNewReceiver):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCRtpTransceiverDirection):
(WebCore::fromRTCRtpTransceiverDirection):
2018-09-11 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a speculative build fix for r235888.
* Modules/mediastream/MediaDevices.h:
Add class Document forward declaration.
2018-09-11 Woodrow Wang <woodrow_wang@apple.com>
Add Web API Statistics Collection
https://bugs.webkit.org/show_bug.cgi?id=187773
<rdar://problem/44155162>
Reviewed by Brent Fulgham.
Added data collection for web API statistics, specifically regarding the canvas, font loads,
screen functions, and navigator functions. The data collection code is placed under a runtime
enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written
to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
includes a struct to keep track of HTML5 canvas element read and writes.
Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
http/tests/webAPIStatistics/font-load-data-collection.html
http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::fallbackFontAt):
The following are the functions where we'd like to record a canvas read.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toDataURL):
(WebCore::HTMLCanvasElement::toBlob):
(WebCore::HTMLCanvasElement::getImageData):
(WebCore::HTMLCanvasElement::toMediaSample):
(WebCore::HTMLCanvasElement::captureStream):
The following are the functions where we'd like to record a canvas write.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::measureText):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
The following files and functions handle the CanvasActivityRecord struct and
its respective functions.
* loader/CanvasActivityRecord.cpp: Added.
(WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
(WebCore::CanvasActivityRecord::mergeWith):
* loader/CanvasActivityRecord.h: Added.
(WebCore::CanvasActivityRecord::encode const):
(WebCore::CanvasActivityRecord::decode):
* loader/DocumentThreadableLoader.cpp:
* loader/FrameLoader.cpp:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key.
Now the encodeHashSet function has been generalized to take any key to encode the entries
in the HashSet. Also added functionality to encode an OptionSet by converting it to its
raw bitmask state.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashSet):
(WebCore::encodeOriginHashSet):
(WebCore::encodeOptionSet):
(WebCore::encodeFontHashSet):
(WebCore::encodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashSet):
(WebCore::decodeOriginHashSet):
(WebCore::decodeOptionSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::navigatorAPIEnumToString):
(WebCore::screenAPIEnumToString):
(WebCore::appendNavigatorAPIOptionSet):
(WebCore::appendScreenAPIOptionSet):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
* loader/ResourceTiming.cpp:
The following are the navigator functions recorded for the web API statistics.
* page/Navigator.cpp:
(WebCore::Navigator::appVersion const):
(WebCore::Navigator::userAgent const):
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
(WebCore::Navigator::cookieEnabled const):
(WebCore::Navigator::javaEnabled const):
The following are the screen functions recorded for the web API statistics.
* page/Screen.cpp:
(WebCore::Screen::height const):
(WebCore::Screen::width const):
(WebCore::Screen::colorDepth const):
(WebCore::Screen::pixelDepth const):
(WebCore::Screen::availLeft const):
(WebCore::Screen::availTop const):
(WebCore::Screen::availHeight const):
(WebCore::Screen::availWidth const):
2018-09-11 Pablo Saavedra <psaavedra@igalia.com>
playbackControlsManagerUpdateTimerFired and
m_playbackControlsManagerUpdateTimer must be
guarded with ENABLE(VIDEO), otherwise the following
error occurs with the VIDEO feature turned off:
error: 'MediaElementSession' has not been declared
Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
https://bugs.webkit.org/show_bug.cgi?id=189500
Reviewed by Anders Carlsson.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::schedulePlaybackControlsManagerUpdate):
* page/Page.h:
2018-09-11 Frederic Wang <fwang@igalia.com>
Refactor filter list checking code
https://bugs.webkit.org/show_bug.cgi?id=185087
Reviewed by Antonio Gomes.
No new tests, behavior unchanged.
* page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
== Rolled over to ChangeLog-2018-09-11 ==