2018-09-11 Philippe Normand [GStreamer] use-after-free in MockVideoCaptureSource https://bugs.webkit.org/show_bug.cgi?id=189462 Reviewed by Xabier Rodriguez-Calvar. * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: (WebCore::WrappedMockRealtimeVideoSource::updateSampleBuffer): Copy the BGRA data before passing ownership to GStreamer. Also include a few code style cosmetic changes. 2018-09-11 Jiewen Tan [WebAuthN] Polish AuthenticatorManager and rename it to AuthenticatorCoordinator https://bugs.webkit.org/show_bug.cgi?id=189277 Reviewed by Chris Dumez. This patch aims to polish AuthenticatorManager such that: 1) It is no longer a singleton. Instead, it will live with Page. It was a singleton simply because static PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable() have to access it. However, this request can be fulfilled by adding an attribute [CallWith=Document] to the IDL defination. Therefore, there is no such need. Also, the singleton is illy implemented as it owns a single IPC proxy to UI Process which means different web pages will talk to the same web page proxy. Anyway, making it live with Page should fix everything. 2) Since we are now planning to support external authenticators, the manager of all authenticators will then have to live in UI Process which makes this AuthenticatorManager obsolete. Instead, rename it to AuthenticatorCoordinator. 3) Rename CredentialsMessenger to AuthenticatorCoordinatorClient to tight it to WebAuthN. Also, simplify the message reply model as PublicKeyCredentialCreationOptions/PublicKeyCredentialRequestOptions => ExceptionData/PublicKeyCredentialData for makeCredential/getAssertion operations. 4) Restrict one request per time, i.e. makeCredential/getAssertion for a single page. 5) Unifying makeCredentialReply/getAssertionReply/exceptionReply into requestReply for IPC. Correspondingly, unify callback and exceptionCallback into callback as well for LocalAuthenticator. 6) Enhance PublicKeyCredentialCreationOptions encoding/decoding with encoder.encodeFixedLengthData/decoder.decodeFixedLengthData. Covered by existing tests. * DerivedSources.make: * Modules/credentialmanagement/CredentialsContainer.cpp: (WebCore::CredentialsContainer::get): (WebCore::CredentialsContainer::isCreate): * Modules/credentialmanagement/CredentialsContainer.h: * Modules/credentialmanagement/CredentialsMessenger.cpp: Removed. * Modules/credentialmanagement/CredentialsMessenger.h: Removed. * Modules/webauthn/AuthenticatorAssertionResponse.cpp: Removed. * Modules/webauthn/AuthenticatorAssertionResponse.h: (WebCore::AuthenticatorAssertionResponse::create): (WebCore::AuthenticatorAssertionResponse::authenticatorData const): (WebCore::AuthenticatorAssertionResponse::signature const): (WebCore::AuthenticatorAssertionResponse::userHandle const): (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse): * Modules/webauthn/AuthenticatorAttestationResponse.cpp: Removed. * Modules/webauthn/AuthenticatorAttestationResponse.h: (WebCore::AuthenticatorAttestationResponse::create): (WebCore::AuthenticatorAttestationResponse::attestationObject const): (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse): * Modules/webauthn/AuthenticatorCoordinator.cpp: Renamed from Source/WebCore/Modules/webauthn/AuthenticatorManager.cpp. (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson): (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash): (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): (WebCore::AuthenticatorCoordinator::AuthenticatorCoordinator): (WebCore::AuthenticatorCoordinator::setClient): (WebCore::AuthenticatorCoordinator::create const): (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const): (WebCore::AuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable const): * Modules/webauthn/AuthenticatorCoordinator.h: Renamed from Source/WebCore/Modules/webauthn/AuthenticatorManager.h. * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: Added. (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): (WebCore::AuthenticatorCoordinatorClient::requestReply): (WebCore::AuthenticatorCoordinatorClient::isUserVerifyingPlatformAuthenticatorAvailableReply): (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler): (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler): * Modules/webauthn/AuthenticatorCoordinatorClient.h: Copied from Source/WebKit/UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h. * Modules/webauthn/AuthenticatorResponse.cpp: Removed. * Modules/webauthn/AuthenticatorResponse.h: (WebCore::AuthenticatorResponse::AuthenticatorResponse): (WebCore::AuthenticatorResponse::clientDataJSON const): * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::create): (WebCore::PublicKeyCredential::tryCreate): (WebCore::PublicKeyCredential::PublicKeyCredential): (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable): * Modules/webauthn/PublicKeyCredential.h: * Modules/webauthn/PublicKeyCredential.idl: * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::encode const): (WebCore::PublicKeyCredentialCreationOptions::decode): * Modules/webauthn/PublicKeyCredentialData.h: Added. (WebCore::PublicKeyCredentialData::encode const): (WebCore::PublicKeyCredentialData::decode): * Modules/webauthn/cocoa/LocalAuthenticator.h: * Modules/webauthn/cocoa/LocalAuthenticator.mm: (WebCore::LocalAuthenticator::makeCredential): (WebCore::LocalAuthenticator::getAssertion): * Modules/webvr/VRStageParameters.cpp: Add a header file to prevent linkage error. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/Page.cpp: * page/Page.h: (WebCore::Page::authenticatorCoordinator const): * page/PageConfiguration.cpp: * page/PageConfiguration.h: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::mockAuthenticatorCoordinator const): (WebCore::Internals::mockCredentialsMessenger const): Deleted. * testing/Internals.h: * testing/Internals.idl: * testing/MockAuthenticatorCoordinator.cpp: Added. (WebCore::MockAuthenticatorCoordinator::setCreationReturnBundle): (WebCore::MockAuthenticatorCoordinator::setAssertionReturnBundle): (WebCore::MockAuthenticatorCoordinator::makeCredential): (WebCore::MockAuthenticatorCoordinator::getAssertion): (WebCore::MockAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable): * testing/MockAuthenticatorCoordinator.h: Renamed from Source/WebCore/testing/MockCredentialsMessenger.h. * testing/MockAuthenticatorCoordinator.idl: Renamed from Source/WebCore/testing/MockCredentialsMessenger.idl. * testing/MockCredentialsMessenger.cpp: Removed. 2018-09-10 Fujii Hironori Remove unused needsDestruction class variables from HashTraits https://bugs.webkit.org/show_bug.cgi?id=189490 Reviewed by Daniel Bates. needsDestruction has been obsoleted in Bug 121983. No new tests (No behavior change). * css/makeprop.pl: Removed needsDestruction. * platform/graphics/FloatSizeHash.h: Ditto. * platform/graphics/IntPointHash.h: Ditto. * platform/graphics/IntRectHash.h: Ditto. * platform/graphics/IntSizeHash.h: Ditto. * platform/graphics/WidthCache.h: Ditto. 2018-09-10 Michael Saboff Test262 failure with Named Capture Groups - using a reference before the group is defined https://bugs.webkit.org/show_bug.cgi?id=189407 Reviewed by Alex Christensen. Created new delegate stubs for RegExp parsing. These are not needed for the URL filtering use cases. Also changed all the delegate methods that take a String to take const String& to eliminate copy churn. Updated TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp. * contentextensions/URLFilterParser.cpp: (WebCore::ContentExtensions::PatternParser::atomNamedBackReference): (WebCore::ContentExtensions::PatternParser::isValidNamedForwardReference): (WebCore::ContentExtensions::PatternParser::atomNamedForwardReference): (WebCore::ContentExtensions::URLFilterParser::statusString): * contentextensions/URLFilterParser.h: 2018-09-10 Megan Gardner Correctly interpret from angle for conic gradients https://bugs.webkit.org/show_bug.cgi?id=189445 Reviewed by Simon Fraser No new tests, no functionality is changing. Just renaming angle to angleRadians to make the type more clear, and hopefully avoid bugs in the future. Update patch to original bug fix. * css/CSSGradientValue.cpp: (WebCore::CSSConicGradientValue::createGradient): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): * platform/graphics/Gradient.cpp: (WebCore::Gradient::hash const): * platform/graphics/Gradient.h: * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): 2018-09-10 Youenn Fablet ontrack events should be fired even if an existing transceiver exists https://bugs.webkit.org/show_bug.cgi?id=189477 Reviewed by Eric Carlson. In case of an OnTrack callback from libwebrtc, make sure the ontrack event is called even if a transceiver already exists for that track. Covered by updated video-addTransceiver.html New test video-addLegacyTransceiver.html keeps testing the old transceiver behavior. Test: webrtc/video-addLegacyTransceiver.html * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::newTransceiver): 2018-09-10 Megan Gardner Correctly interpret from angle for conic gradients https://bugs.webkit.org/show_bug.cgi?id=189445 Reviewed by Tim Horton. Test: fast/gradients/conic-from-angle.html We were pulling the angle as degrees when we really need radians. * css/CSSGradientValue.cpp: (WebCore::CSSConicGradientValue::createGradient): 2018-09-10 James Savage Expose -apple-system-container-border color to internal web views. https://bugs.webkit.org/show_bug.cgi?id=189178. Reviewed by Timothy Hatcher. Tests: LayoutTests/fast/css/apple-system-colors.html * css/CSSValueKeywords.in: Add new semantic color name. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Use system color on supported systems, and fall back to approximation for older systems. 2018-09-07 Ryosuke Niwa mouseenter and mouseleave events don't get dispatched even when there is a capturing event listener for a slot ancestor https://bugs.webkit.org/show_bug.cgi?id=188561 Reviewed by Darin Adler. This patch makes mouseenter and mouseleave events to work with shadow trees and slots therein, and makes them uncomposed as discussed in https://github.com/w3c/uievents/issues/208. This patch also makes these events dispatched on DOM tree ancestors of the currently hovered element instead of render tree's hover ancestors to be consistent with the check in hierarchyHasCapturingEventListeners and other browsers. In particular, using hover ancestors is problematic when there is an element with display: contents such as slot elements, which do not have a render object. Tests: fast/shadow-dom/mouseenter-mouseleave-across-shadow-boundary.html fast/shadow-dom/mouseenter-mouseleave-inside-shadow-tree.html fast/shadow-dom/mouseenter-mouseleave-on-slot-parent.html * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): * page/EventHandler.cpp: (WebCore::nearestCommonHoverAncestor): Deleted. (WebCore::hierarchyHasCapturingEventListeners): Use parentInComposedTree. Else we would miss capturing event listeners on inclusive ancestors of slots. (WebCore::EventHandler::updateMouseEventTargetNode): Use the composed tree's ancestor chain to fire mouseenter and mouseleave events. This is needed to dispatch mouseenter / mouseleave events on slot elements. Also removed comments which just state what is self-evident from the code beneath them. 2018-09-08 Ryosuke Niwa Remove isOrphan check in ShadowRoot::setInnerHTML https://bugs.webkit.org/show_bug.cgi?id=189449 Reviewed by Darin Adler. Removed isOrphan() check in ShadowRoot::setInnerHTML needed for webkit.org/b/88834. The only reason this check was kept in the code was because the fix for V8 couldn't be landed due to a perf regression but V8 binding isn't even a thing in WebKit anymore. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::setInnerHTML): * dom/ShadowRoot.h: 2018-09-10 Simon Fraser Many textarea tests leak documents because Document::removeFocusNavigationNodeOfSubtree() can trigger a Document retain cycle https://bugs.webkit.org/show_bug.cgi?id=188722 Reviewed by Ryosuke Niwa. Fix a retain cycle created when Document::adjustFocusNavigationNodeOnNodeRemoval() sets m_focusNavigationStartingNode to itself. m_focusNavigationStartingNode is a Node* (not sure why it's not an Element*), making it possible to assign the Document to it, which creates a reference to the document which prevents Document::removedLastRef() ever running and doing the necessary cleanup. Fix by setting m_focusNavigationStartingNode to null if code tries to set it to the Document. This can happen when an element is focused and the page calls document.write(), which removes all children. Will be tested by future leak testing. Fixes the document leak in at least the following tests: fast/forms/append-children-during-form-submission.html fast/forms/empty-textarea-toggle-disabled.html fast/forms/textarea-paste-newline.html fast/forms/textarea-trailing-newline.html * dom/Document.cpp: (WebCore::Document::setFocusNavigationStartingNode): (WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval): 2018-09-10 Simon Fraser svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents https://bugs.webkit.org/show_bug.cgi?id=189147 Reviewed by Dean Jackson. Document::removedLastRef() needs to clean up m_fontSelector, because it can reference CSSFontFaceSources that keep SVGFontFaceElements alive, and they in turn will keep the Document alive. Also add the beginnings of a Fonts log channel. This will be tested by world leak testing (webkit.org/b/189332). * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::CSSFontSelector): (WebCore::CSSFontSelector::~CSSFontSelector): * dom/Document.cpp: (WebCore::Document::removedLastRef): * platform/Logging.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::purgeInactiveFontDataIfNeeded): (WebCore::FontCache::purgeInactiveFontData): * svg/SVGFontFaceElement.cpp: (WebCore::SVGFontFaceElement::SVGFontFaceElement): (WebCore::SVGFontFaceElement::~SVGFontFaceElement): * svg/SVGFontFaceElement.h: 2018-09-10 Don Olmstead CBOR coders should only be compiled if WebAuthN is enabled https://bugs.webkit.org/show_bug.cgi?id=189425 Reviewed by Jiewen Tan. No new tests. No change in behavior. Just places ENABLE(WEB_AUTHN) guards around all CBOR files. * Modules/webauthn/cbor/CBORBinary.h: * Modules/webauthn/cbor/CBORReader.cpp: * Modules/webauthn/cbor/CBORReader.h: * Modules/webauthn/cbor/CBORValue.cpp: * Modules/webauthn/cbor/CBORValue.h: * Modules/webauthn/cbor/CBORWriter.cpp: * Modules/webauthn/cbor/CBORWriter.h: 2018-09-10 Daniel Bates [iOS] Arrow keys do not dispatch DOM events to non-editable elements https://bugs.webkit.org/show_bug.cgi?id=189389 Reviewed by Simon Fraser. On iOS the arrow keys are identified by special multi character key strings: UIKeyInput{Up, Down, Left, Right}Arrow as opposed to special key codes as on Mac. When converting the iOS- specific WebEvent we need to take care to recognize when the key string for the event is one of these special key strings when computing key code, character code, and key identifier properties for the WebCore platform-specific event. These details will be included in the corresponding DOM keyboard events that are dispatched when the arrow keys are pressed. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Mark file PlatformEventFactoryIOS as @no-unify as it is not compatible with the unified sources build strategy given its use of wtf/cocoa/SoftLinking.h macros. * platform/ios/PlatformEventFactoryIOS.h: * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::convertSpecialKeyToCharCode): Manufacture the appropriate character code for an event that represents an arrow key. Otherwise, return std::nullopt to indicate that the event is not for an arrow key. (WebCore::keyCodeForEvent): Manufacture the appropriate Windows virtual key code for an event that represents an arrow key. Otherwise, do what we do now and return the key code associated with the WebEvent. (WebCore::keyIdentifierForKeyEvent): Modified to test if the event is for an arrow key and return the appropriate key identifier. (WebCore::keyForKeyEvent): Modified to test if the event is for an arrow key and return the appropriate character code. (WebCore::codeForKeyEvent): Modified to call keyCodeForEvent(), which knows how to account for events that represent arrow keys. (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): 2018-09-10 Dan Bernstein [macOS] Editor::readSelectionFromPasteboard’s MailBlockquoteHandling argument is effectively unused https://bugs.webkit.org/show_bug.cgi?id=189480 Reviewed by Anders Carlsson. No new tests, because this doesn’t change behavior. * editing/Editor.h: Removed the MailBlockquoteHandling argument from readSelectionFromPasteboard. * editing/mac/EditorMac.mm: (WebCore::Editor::readSelectionFromPasteboard): Don’t pass mailBlockquoteHandling to pasteWithPasteboard. It was always set to RespectBlockquote, which is the latter’s default. 2018-09-10 Andy Estes [Payment Request] Use JSValueInWrappedObject for PaymentResponse's details attribute https://bugs.webkit.org/show_bug.cgi?id=189458 Reviewed by Youenn Fablet. Test: http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::didAuthorizePayment): Created a PaymentResponse::DetailsFunction that converts the ApplePayPayment into a JSValue. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::accept): Passed detailsFunction into PaymentResponse::create(). * Modules/paymentrequest/PaymentRequest.h: * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::PaymentResponse): * Modules/paymentrequest/PaymentResponse.h: * Modules/paymentrequest/PaymentResponse.idl: Removed m_details and replaced it with a DetailsFunction and a cached JSValueInWrappedObject. JSPaymentResponseCustom.cpp uses these values to implement the details attribute getter. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPaymentResponseCustom.cpp: Added. (WebCore::JSPaymentResponse::details const): Called PaymentResponse::detailsFunction() to cache a JSValue for the details attribute. (WebCore::JSPaymentResponse::visitAdditionalChildren): Visited PaymentResponse::cachedDetails(). * bindings/js/JSServiceWorkerClientCustom.cpp: Fixed a missing include issue that cropped up due to unified source shuffling. 2018-09-10 Antoine Quint [Web Animations] Positive delays of accelerated animations are not respected https://bugs.webkit.org/show_bug.cgi?id=189411 Reviewed by Dean Jackson. Test: webanimations/accelerated-animation-with-delay-and-seek.html We were only accounting for negative delays for accelerated actions. We also were misbehaving when seeking an animation with a delay (positive or negative) since we wouldn't reset the animation begin time to be the current time when adjusting its time offset, while the begin time set when first creating the animation would be set accounting for the time offset. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): 2018-09-10 Yusuke Suzuki [WTF] Add Markable https://bugs.webkit.org/show_bug.cgi?id=189231 Reviewed by Sam Weinig. Use Markable and Markable in ResourceResponseBase. Since these fields are parsed results from http header fields, Seconds::nan() and WallTime::nan() can be used as an empty value for these fields. Thus we can use Markable because it uses these nan values as an empty values (they are configured by Seconds::MarkableTraits and WallTime::MarkableTraits). This reduces the size of ResourceResponseBase from 448 to 416. * platform/network/ResourceResponseBase.h: 2018-09-07 Matt Rajca Touch Bar displays an active PIP button for audio elements (and it doesn't do anything) https://bugs.webkit.org/show_bug.cgi?id=189433 Touch Bar displays an active PIP button for audio elements (and it doesn't do anything) Reviewed by Eric Carlson. When playing an audio element, the media Touch Bar displays an active PIP button even though only videos are PIP-able. Pressing it does not do anything. The issue is canTogglePictureInPicture is set to YES unconditionally on the WebPlaybackControlsManager. It is then only updated based on whether or not external playback is enabled. This patch extends that logic such that the picture-in-picture Touch Bar button will be disabled for audio elements. Since PlaybackSessionModelMediaElement today does not know whether we're dealing with an audio or video element, a new isPictureInPictureSupported flag has been added (as well as the plumbing necessary to get the state over from the web process). An API test has been added that checks the value of the canTogglePictureInPicture and ensures it is NO when audio elements are playing. To expose it to tests, a _canTogglePictureInPictureForTesting property has been added to the WKTesting category. * platform/cocoa/PlaybackSessionModel.h: (WebCore::PlaybackSessionModelClient::isPictureInPictureSupportedChanged): * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::setMediaElement): (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureSupported const): * platform/mac/PlaybackSessionInterfaceMac.h: * platform/mac/PlaybackSessionInterfaceMac.mm: (WebCore::PlaybackSessionInterfaceMac::isPictureInPictureSupportedChanged): (WebCore::PlaybackSessionInterfaceMac::externalPlaybackChanged): (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerCanTogglePictureInPicture): 2018-09-10 Alicia Boya García [GStreamer] Fix overflow in buffered ranges https://bugs.webkit.org/show_bug.cgi?id=189419 Reviewed by Philippe Normand. Scale operations on big numbers (like media timestamps or durations) should be made with GStreamer utility functions to avoid overflows. This fixes an assertion when a 24 hour long fragmented MP4 file is played. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::buffered const): 2018-09-07 Frederic Wang Refactor filter list checking code https://bugs.webkit.org/show_bug.cgi?id=185087 Reviewed by Yusuke Suzuki. No new tests, behavior unchanged. * animation/KeyframeEffectReadOnly.h: Add missing forward-declaration FilterOperations. 2018-09-10 Philippe Normand [GStreamer] Several media related tests timing out around the same revision https://bugs.webkit.org/show_bug.cgi?id=189349 Reviewed by Carlos Garcia Campos. The timeouts were happening because the `ended` event was no longer properly emitted. The change in playbackPosition also ensures `timeupdate` event remains emitted in a... timely manner. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Reduce the position cache threshold to 200ms, which is a value slightly lower than the 250ms defined in HTMLMediaElement. (WebCore::MediaPlayerPrivateGStreamer::didEnd): Reset the cached position value to ensure the following query will most likely return the same value as reported by the duration query. 2018-09-10 Rob Buis XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header https://bugs.webkit.org/show_bug.cgi?id=189465 Reviewed by Frédéric Wang. The xhr spec changed [1, 2] so that overrideMimeType should not update the response's "Content-Type" header anymore. Behavior matches Firefox and Chrome. [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype [2] https://github.com/whatwg/xhr/issues/157 Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveResponse): 2018-09-10 Antoine Quint [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails https://bugs.webkit.org/show_bug.cgi?id=189405 Reviewed by Simon Fraser. Test: webanimations/accelerated-transition-interrupted-on-composited-element.html If we interrupt an animation on an element that is composited also outside of the duration of the animation, the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and the accelerated animation applied to the layer would never be removed. However, having a resolved current time is not necessary to stop an animation, only for the other types of actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a simple fix to this issue. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): 2018-09-09 Fujii Hironori Add specialized template declarations of HashTraits and DefaultHash to detect misuse https://bugs.webkit.org/show_bug.cgi?id=189044 Reviewed by Yusuke Suzuki. Some classes have a separate header for specializations of WTF::HashTraits and WTF::DefaultHash to reduce the number of header files included. For example, ColorHash.h and Color.h. If someone is mistakenly using HashSet or HashMap without including the specialization header, unexpected template instantiation can cause subtle bugs. For example, MSVC linker would silently produce an broken executable (Bug 188893). By applying this change, I found three misuse cases in DebugPageOverlays.cpp, AVVideoCaptureSource.h and WebPage.h. As far as I analyzed, I concluded that these misuses don't introduce any bugs at the moment, and they are not testable (Bug 189044 Comment 9), except the MSVC issue (Bug 188893). No new tests (Covered by existing tests). * Modules/webdatabase/SQLResultSetRowList.h: Removed unused #include . * bindings/js/SerializedScriptValue.cpp: Ditto. * page/DebugPageOverlays.cpp: Added #include "ColorHash.h" to instantiate HashMap. * platform/URLHash.h: Added DefaultHash specialization definition. * platform/URL.h: Added specialized template declarations. * platform/graphics/Color.h: Ditto. * platform/graphics/FloatSize.h: Ditto. * platform/graphics/IntPoint.h: Ditto. * platform/graphics/IntSize.h: Ditto. * platform/network/ProtectionSpace.h: Ditto. * platform/network/ProtectionSpaceHash.h: Removed unnecessary DefaultHash declaration. * platform/mediastream/mac/AVVideoCaptureSource.h: Added #include "IntSizeHash.h" to instantiate HashMap. 2018-09-09 Fujii Hironori [Win][Clang] Add FloatRect(const RECT&) constructor https://bugs.webkit.org/show_bug.cgi?id=189398 Reviewed by Alex Christensen. While trying to build WebKit WinCairo port with the latest Clang (Bug 171618), the following compilation errors were reported. error: no viable conversion from returned value of type 'RECT' (aka 'tagRECT') to function return type 'WebCore::FloatRect' No new tests (No behavior change). * platform/graphics/FloatRect.h: * platform/graphics/win/FloatRectDirect2D.cpp: (WebCore::FloatRect::FloatRect): Added a new constructor taking a RECT as the argument. 2018-09-08 Andy Estes [Apple Pay] Dispatch a paymentmethodchange event when the payment method changes https://bugs.webkit.org/show_bug.cgi?id=189386 Reviewed by Darin Adler. Implemented the "payment method changed" algorithm as defined in the Payment Request API W3C Editor's Draft of 05 September 2018. Payment Request says that the user agent MAY run this algorithm when the payment method changes. In our case, we only wish to dispatch this event when a listener is registered for it. Since PassKit requires merchants to respond to this event by calling updateWith() within 30 seconds, firing the event unconditionally would break compatibility with existing clients. For merchants that do not listen for this event, they can continue to use modifiers to update details based on the selected payment method type. Also made PaymentMethodChangeEvent.methodDetails a cached attribute in a way that avoids potential reference cycles from holding a JSC::Strong in the wrapped object. Test: http/tests/ssl/applepay/ApplePayPaymentMethodChangeEvent.https.html * CMakeLists.txt: * DerivedSources.make: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::toJSDictionary): (WebCore::ApplePayPaymentHandler::didAuthorizePayment): (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod): * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent): * Modules/paymentrequest/PaymentMethodChangeEvent.h: * Modules/paymentrequest/PaymentMethodChangeEvent.idl: * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Removed. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::paymentMethodChanged): * Modules/paymentrequest/PaymentRequest.h: * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: (WebCore::PaymentRequestUpdateEvent::updateWith): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPaymentMethodChangeEventCustom.cpp: Added. (WebCore::JSPaymentMethodChangeEvent::methodDetails const): (WebCore::JSPaymentMethodChangeEvent::visitAdditionalChildren): 2018-09-08 Simon Fraser Clean up code related to Document node removal https://bugs.webkit.org/show_bug.cgi?id=189452 Reviewed by Wenson Hsieh. Replace the "amongChildrenOnly" boolean argument with an enum for clarity. Rename the remove*OfSubtree functions, because that naming is very unclear. Instead, use adjust*OnNodeRemoval which better describes what the code does. * dom/Document.cpp: (WebCore::isNodeInSubtree): (WebCore::Document::adjustFocusedNodeOnNodeRemoval): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval): (WebCore::Document::adjustFullScreenElementOnNodeRemoval): (WebCore::Document::removeFocusedNodeOfSubtree): Deleted. (WebCore::Document::removeFocusNavigationNodeOfSubtree): Deleted. (WebCore::Document::removeFullScreenElementOfSubtree): Deleted. * dom/Document.h: * dom/Element.cpp: (WebCore::Element::removeShadowRoot): * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): 2018-09-08 Yusuke Suzuki [CSSJIT] Use lshiftPtr instead of mul32 https://bugs.webkit.org/show_bug.cgi?id=189451 Reviewed by Sam Weinig. Use `value << 4` instead of `value * 16`. In 64bit environment, sizeof(Style::Relation) is 16, so that we can use `value << 4` in CSS JIT. No behavior change. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation): 2018-09-07 Fujii Hironori [Win][Clang] exceptionShouldTerminateProgram of StructuredExceptionHandlerSuppressor.cpp should take DWORD https://bugs.webkit.org/show_bug.cgi?id=189402 Reviewed by Alex Christensen. Clang reports compilation errors like following: > StructuredExceptionHandlerSuppressor.cpp(38,10): error: case value evaluates to 2147483650, which cannot be narrowed to type 'int' [-Wc++11-narrowing] > case EXCEPTION_DATATYPE_MISALIGNMENT: > ^ No new tests (no behavioral change). * platform/win/StructuredExceptionHandlerSuppressor.cpp: (exceptionShouldTerminateProgram): Changed the type of argument from int to DWORD. 2018-09-07 Basuke Suzuki [Curl] Stop sending request with credential if no authorization requested. https://bugs.webkit.org/show_bug.cgi?id=189057 Reviewed by Alex Christensen. When 401 response returns without 'www-authenticate' header, suppress another request with credential. Test: http/tests/xmlhttprequest/unauthorized-without-authenticate-header.html * platform/network/curl/CurlResourceHandleDelegate.cpp: (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse): 2018-09-07 Fujii Hironori [Win][Clang] duplicated variable name `advance` in UniscribeController::shapeAndPlaceItem https://bugs.webkit.org/show_bug.cgi?id=189399 Reviewed by Myles C. Maxfield. Clang reports the following compilation error: UniscribeController.cpp(372,56): error: invalid operands to binary expression ('float' and 'WebCore::GlyphBufferAdvance' (aka 'WebCore::FloatSize')) GlyphBufferAdvance advance(-origin.width() + advance, -origin.height()); ~~~~~~~~~~~~~~~ ^ ~~~~~~~ No new tests (No behavior change). * platform/graphics/win/UniscribeController.cpp: (WebCore::UniscribeController::shapeAndPlaceItem): Replaced the second variable named `advance` with `glyphAdvance`. 2018-09-07 Youenn Fablet RTCRtpReceiver::track should return a MediaStreamTrack reference https://bugs.webkit.org/show_bug.cgi?id=189420 Reviewed by Eric Carlson. As per spec, a receiver always has a track. Remove unneeded RTCRtpSenderReceiverBase and make RTCRtpReceiver have a Ref. RTCRtpSender keeps having a RefPtr. Update call sites accordingly. No change of behavior. * Modules/mediastream/RTCRtpReceiver.cpp: (WebCore::RTCRtpReceiver::RTCRtpReceiver): (WebCore::RTCRtpReceiver::stop): * Modules/mediastream/RTCRtpReceiver.h: (WebCore::RTCRtpReceiver::track): * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::RTCRtpSender): * Modules/mediastream/RTCRtpSender.h: (WebCore::RTCRtpSender::track): * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderReceiverBase.h: Removed. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver): (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver): * WebCore.xcodeproj/project.pbxproj: 2018-09-07 Daniel Bates Cleanup: Remove extraneous "using namespace" and scope WebCore::LogThreading https://bugs.webkit.org/show_bug.cgi?id=189381 Reviewed by Simon Fraser. * platform/ios/wak/WKGraphics.mm: * platform/ios/wak/WebCoreThread.mm: (WebThreadEnable): 2018-09-07 Wenson Hsieh Clean up FontAttributeChanges.cpp after r235748 https://bugs.webkit.org/show_bug.cgi?id=189394 Reviewed by Tim Horton. * Sources.txt: Move FontAttributeChanges.cpp into unified sources. * WebCore.xcodeproj/project.pbxproj: * editing/FontAttributeChanges.cpp: Replace `#import`s with `#include`s. 2018-09-07 Basuke Suzuki [Curl][WebKitLegacy] Stop sending credential embedded in the url via XHR. https://bugs.webkit.org/show_bug.cgi?id=189198 Reviewed by Alexey Proskuryakov. Because sync XHR of Curl port uses passed request directly, the credential information in url is not removed. Use ResourceHandleInternal's firstRequest because those are already takne out. Test: http/tests/xmlhttprequest/url-with-credentials.html * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::platformLoadResourceSynchronously): 2018-09-07 Youenn Fablet RealtimeOutgoingVideoSourceCocoa should use VTImageRotationSession to rotate CVPixelBuffers https://bugs.webkit.org/show_bug.cgi?id=189427 Reviewed by Eric Carlson. Previously, we were relying on libwebrtc utils to do the rotation. This is inefficient compared to VTImageRotateSession and also induces additional memory cost since libwebrtc is rotating using its own buffers and the encoder will convert this buffer back to a CVPixelBuffer. Instead use VTImageRotationSession when rotation must be done at sending side. Covered by webrtc/video-rotation.html. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: (WebCore::computeRotatedWidthAndHeight): (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer): 2018-09-07 Youenn Fablet Add support for unified plan transceivers https://bugs.webkit.org/show_bug.cgi?id=189390 Reviewed by Eric Carlson. Keep previous transceiver behavior when unified plan flag is off. Otherwise, use the libwebrtc transceiver API to create and use unified plan transceivers. Fuel the implementation of transceivers through a dedicated backend. Update transceiver IDL and make some smaller fixes at the same time: - Make sure remote sources have a proper name as per https://w3c.github.io/webrtc-pc/#dfn-create-an-rtcrtpreceiver. - Add support for transceiver.currentDirection. Our mock peer connections are only supporting plan B APIs at the moment. We therefore mandate plan B when using such mocks until we can upgrade mocks to support unified plan APIs. Covered by modified and rebased tests. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addTrack): * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::addTransceiver): * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::RTCRtpSender): * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::mid const): (WebCore::RTCRtpTransceiver::currentDirection const): * Modules/mediastream/RTCRtpTransceiver.h: (WebCore::RTCRtpTransceiver::backend): * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): (WebCore::LibWebRTCMediaEndpoint::newTransceiver): (WebCore::LibWebRTCMediaEndpoint::addTransceiver): (WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender): (WebCore::LibWebRTCMediaEndpoint::OnAddTrack): (WebCore::LibWebRTCMediaEndpoint::OnTrack): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createReceiverForSource): (WebCore::LibWebRTCPeerConnectionBackend::createReceiver): (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver): (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver): (WebCore::backendFromRTPTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::newTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: Added. (WebCore::LibWebRTCRtpTransceiverBackend::createReceiverBackend): (WebCore::LibWebRTCRtpTransceiverBackend::createSenderBackend): (WebCore::LibWebRTCRtpTransceiverBackend::direction const): (WebCore::LibWebRTCRtpTransceiverBackend::currentDirection const): (WebCore::LibWebRTCRtpTransceiverBackend::setDirection): (WebCore::LibWebRTCRtpTransceiverBackend::mid): (WebCore::LibWebRTCRtpTransceiverBackend::stop): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCRtpTransceiverDirection): (WebCore::fromRTCRtpTransceiverDirection): (WebCore::fromRtpTransceiverInit): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): * platform/mediastream/RealtimeMediaSource.h: * testing/Internals.cpp: (WebCore::Internals::useMockRTCPeerConnectionFactory): 2018-09-07 Rob Buis XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved https://bugs.webkit.org/show_bug.cgi?id=46008 Reviewed by Chris Dumez. Check if passed URL is valid as specified here [1]. Test: web-platform-tests/xhr/open-url-bogus.htm [1] https://xhr.spec.whatwg.org/#the-open()-method Step 7 * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): 2018-09-07 Frederic Wang [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To) https://bugs.webkit.org/show_bug.cgi?id=182230 Reviewed by Simon Fraser. This commit moves the special logic for "scrolling element" body from the HtmlBodyElement::scroll(Left/Top/Width/Height/To) functions to the Element class. The code is executed when the element is the scrolling element which includes the case of body in Quirks mode and of documentElement in standard mode. This makes the behavior closer to the CSSOM View spec (bug 5991) while not deviating too much from the current implementation. Finally, CSSOMViewScrollingAPI is now enabled for running tests and some adjustments are made to existing tests. Further improvements will be performed in dependencies of bug 5991. No new tests, already covered by existing tests. * dom/Document.cpp: Split scrollingElement into two functions so that one can be called internally without updating the layout. (WebCore::Document::scrollingElement): (WebCore::Document::scrollingElementForAPI): * dom/Document.h: Ditto. * dom/Document.idl: Use the version updating the layout for API calls. * dom/Element.cpp: Add include to call DOMWindow::ScrollTo (WebCore::Element::scrollTo): Moved some logic from HtmlBodyElement to handle the case of the scrolling element. Also skip special handling of documentElement() when CSSOMViewScrollingAPI is disabled. (WebCore::adjustContentsScrollPositionOrSizeForZoom): Moved some logic from HtmlBodyElement to handle the case of the scrolling element. Also add a FIXME for improving these kinds of helper functions. Renamed to make more explicit the semantic of the value argument. (WebCore::Element::scrollLeft): Moved some logic from HtmlBodyElement to handle the case of the scrolling element. Use the new documentFrameWithNonNullView() helper function. (WebCore::Element::scrollTop): Ditto. (WebCore::Element::setScrollLeft): Ditto (WebCore::Element::setScrollTop): Ditto. (WebCore::Element::scrollWidth): Ditto. (WebCore::Element::scrollHeight): Ditto. * dom/Element.h: (WebCore::Document::documentFrameWithNonNullView): New helper function to retrieve the frame and ensure a view is available. * html/HTMLBodyElement.cpp: Remove code that is now in Element. * html/HTMLBodyElement.h: Ditto. 2018-09-07 Don Olmstead [AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY) https://bugs.webkit.org/show_bug.cgi?id=189423 Reviewed by Yusuke Suzuki. No new tests. Compilation fix. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::AXObjectCache): 2018-09-07 Zalan Bujtas [LFC] Replace "computed" value with "used" value to match spec language https://bugs.webkit.org/show_bug.cgi?id=189414 Reviewed by Antti Koivisto. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry 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::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): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin 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::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): 2018-09-06 Ryosuke Niwa ShadowRoot should have its own node flag https://bugs.webkit.org/show_bug.cgi?id=189392 Reviewed by Antti Koivisto. Added IsShadowRootFlag and IsDocumentNodeFlag, and removed IsDocumentFragmentFlag and IsStyledElementFlag. Also re-ordered flags to group flags used by subclasses below ones directly used by Node in accordinate with the comment. No new tests since there should be no behavioral change. * dom/ContainerNode.h: (WebCore::Node::isTreeScope const): Deleted. * dom/Node.h: (WebCore::Node::isStyledElement const): Check if this is a HTML, SVG, or MathML element instead. (WebCore::Node::isDocumentNode const): Simply check IsDocumentNodeFlag. (WebCore::Node::isTreeScope const): Check if this is a document or a shadow root Instead of comparing the tree scope to this. (WebCore::Node::isDocumentFragment const): Check if this is a container node which is neither document, element, nor shadow root. (WebCore::Node::isShadowRoot const): Simply check IsShadowRootFlag. This is the change needed to fix the blockign bug 166748. (WebCore::Node::flagIsShadowRoot): Added. Will be used in the bug 166748. 2018-09-06 Zalan Bujtas [LFC] Inline replaced height calculation should use "used value" https://bugs.webkit.org/show_bug.cgi?id=189395 Reviewed by Antti Koivisto. Use the already assigned width value (aka used value) instead of the computed value when computing the inline's height. see https://www.w3.org/TR/CSS22/cascade.html#value-stages for "used" and "computed" value. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): 2018-09-06 Wenson Hsieh Refactor WebCore::EditAction to be an 8-bit enum class https://bugs.webkit.org/show_bug.cgi?id=189383 Reviewed by Dan Bernstein. Currently, EditAction.h defines an EditAction as an enum. This patch changes EditAction to instead be an 8-bit- wide enum class, and renames all EditAction values from EditAction(*) to EditAction::(*). No change in behavior. * editing/ApplyStyleCommand.h: (WebCore::ApplyStyleCommand::create): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::apply): (WebCore::deleteSelectionEditingActionForEditingAction): * editing/CompositeEditCommand.h: (WebCore::EditCommandComposition::wasCreateLinkCommand const): * editing/CreateLinkCommand.h: * editing/DeleteFromTextNodeCommand.h: (WebCore::DeleteFromTextNodeCommand::create): * editing/DeleteSelectionCommand.h: (WebCore::DeleteSelectionCommand::create): * editing/DictationCommand.cpp: (WebCore::DictationCommand::insertTextRunWithoutNewlines): (WebCore::DictationCommand::insertParagraphSeparator): * editing/EditAction.h: (): Deleted. * editing/EditCommand.cpp: (WebCore::inputTypeNameForEditingAction): * editing/EditCommand.h: * editing/Editor.cpp: (WebCore::inputEventDataForEditingStyleAndAction): (WebCore::ClearTextCommand::editingAction const): (WebCore::Editor::handleTextEvent): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::performCutOrCopy): (WebCore::Editor::setBaseWritingDirection): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::changeBackToReplacedString): (WebCore::Editor::transpose): * editing/Editor.h: * editing/EditorCommand.cpp: (WebCore::applyCommandToFrame): (WebCore::executeInsertFragment): (WebCore::executeBackColor): (WebCore::executeFontName): (WebCore::executeFontSize): (WebCore::executeFontSizeDelta): (WebCore::executeForeColor): (WebCore::executeJustifyCenter): (WebCore::executeJustifyFull): (WebCore::executeJustifyLeft): (WebCore::executeJustifyRight): (WebCore::executeMakeTextWritingDirectionLeftToRight): (WebCore::executeMakeTextWritingDirectionNatural): (WebCore::executeMakeTextWritingDirectionRightToLeft): (WebCore::executeStrikethrough): (WebCore::executeSubscript): (WebCore::executeSuperscript): (WebCore::executeToggleBold): (WebCore::executeToggleItalic): (WebCore::executeUnderline): (WebCore::executeUnscript): * editing/FormatBlockCommand.h: * editing/IndentOutdentCommand.h: * editing/InsertIntoTextNodeCommand.h: (WebCore::InsertIntoTextNodeCommand::create): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::editingAction const): * editing/InsertNodeBeforeCommand.h: (WebCore::InsertNodeBeforeCommand::create): * editing/InsertParagraphSeparatorCommand.h: (WebCore::InsertParagraphSeparatorCommand::create): * editing/InsertTextCommand.h: (WebCore::InsertTextCommand::create): (WebCore::InsertTextCommand::createWithMarkerSupplier): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): (WebCore::MoveSelectionCommand::editingAction const): * editing/RemoveFormatCommand.h: * editing/RemoveNodeCommand.h: (WebCore::RemoveNodeCommand::create): * editing/ReplaceRangeWithTextCommand.cpp: (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand): (WebCore::ReplaceRangeWithTextCommand::doApply): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): (WebCore::ReplaceSelectionCommand::performTrivialReplace): * editing/ReplaceSelectionCommand.h: (WebCore::ReplaceSelectionCommand::create): * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand): (WebCore::SpellingCorrectionCommand::doApply): * editing/TextInsertionBaseCommand.h: * editing/TypingCommand.cpp: (WebCore::editActionForTypingCommand): (WebCore::editActionIsDeleteByTyping): (WebCore::TypingCommand::isBeforeInputEventCancelable const): (WebCore::TypingCommand::inputEventData const): (WebCore::TypingCommand::inputEventDataTransfer const): (WebCore::TypingCommand::insertTextRunWithoutNewlines): (WebCore::TypingCommand::insertParagraphSeparator): * editing/UnlinkCommand.h: * editing/ios/DictationCommandIOS.cpp: (WebCore::DictationCommandIOS::DictationCommandIOS): * editing/ios/EditorIOS.mm: (WebCore::Editor::removeUnchangeableStyles): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): 2018-09-06 Simon Fraser Fix the build for non-Cocoa platforms after r235772. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::createPlatformGradient): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): (WebCore::Gradient::fill): 2018-09-06 Zalan Bujtas [LFC] Add support for min/max-height percentage values. https://bugs.webkit.org/show_bug.cgi?id=189391 Reviewed by Antti Koivisto. 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 percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height'). Test: fast/block/block-only/min-max-height-percentage.html * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto): (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight): (WebCore::Layout::FormattingContext::Geometry::computedMinHeight): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): 2018-09-06 Megan Gardner Add Support for Conic Gradients https://bugs.webkit.org/show_bug.cgi?id=189329 Reviewed by Simon Fraser. Add support for rendering CSS conic gradients. The parsing work was already done, this just hooks up the data we have with the CG functionality for conic gradients. Add the needed plumbing to allow for this additional type and fill in the creation of a conic gradient. Tests: fast/gradients/conic-repeating.html fast/gradients/conic.html * css/CSSGradientValue.cpp: (WebCore::createGradient): (WebCore::LinearGradientAdapter::gradientLength const): (WebCore::RadialGradientAdapter::gradientLength const): (WebCore::ConicGradientAdapter::ConicGradientAdapter): (WebCore::ConicGradientAdapter::gradientLength const): (WebCore::ConicGradientAdapter::maxExtent const): (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange): Compute what the color stops should be if they extend past 0-1 (WebCore::CSSGradientValue::computeStops): (WebCore::CSSConicGradientValue::createGradient): (WebCore::LinearGradientAdapter::startPoint const): Deleted. (WebCore::LinearGradientAdapter::endPoint const): Deleted. (WebCore::RadialGradientAdapter::startPoint const): Deleted. (WebCore::RadialGradientAdapter::endPoint const): Deleted. Start and End points weren't very universal. All we really need from these gradientAdapters is their length, so just ask for that instead. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): * platform/graphics/Gradient.cpp: (WebCore::Gradient::create): (WebCore::Gradient::Gradient): (WebCore::Gradient::type const): (WebCore::Gradient::adjustParametersForTiledDrawing): (WebCore::Gradient::isZeroSize const): (WebCore::Gradient::hash const): * platform/graphics/Gradient.h: * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): 2018-09-06 Wenson Hsieh [macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through) https://bugs.webkit.org/show_bug.cgi?id=189356 Reviewed by Tim Horton. Add support for encoding and decoding FontAttributeChanges, so that we can send FontAttributeChanges over IPC in WebKit2. Also change m_verticalAlign to a new VerticalAlignChange enum type, so that it's no longer tied to the CSS property values of "vertical-align", and can be encoded/decoded separately from VerticalAlign in RenderStyleConstants. Test: FontManagerTests.ChangeAttributesWithFontEffectsBox * editing/FontAttributeChanges.cpp: (WebCore::FontAttributeChanges::createEditingStyle const): * editing/FontAttributeChanges.h: (WebCore::FontAttributeChanges::setVerticalAlign): (WebCore::FontShadow::encode const): (WebCore::FontShadow::decode): (WebCore::FontAttributeChanges::encode const): (WebCore::FontAttributeChanges::decode): * platform/mac/WebCoreNSFontManagerExtras.mm: (WebCore::computedFontAttributeChanges): 2018-09-06 Zalan Bujtas [LFC][BFC] Add support for min(max)-height https://bugs.webkit.org/show_bug.cgi?id=189377 Reviewed by Antti Koivisto. See https://www.w3.org/TR/CSS22/visudet.html#min-max-heights for details. Tests: fast/block/block-only/absolute-position-min-max-height.html fast/block/block-only/float-min-max-height.html fast/block/block-only/inflow-min-max-height.html * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContext.h: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): 2018-09-06 Eric Carlson [MediaStream] Include supported frame rates in video capture presets https://bugs.webkit.org/show_bug.cgi?id=189351 Reviewed by Youenn Fablet. No new tests, no functionality changed. Include frame rates as well as width/height in video capture presets, so the mock video capture devices model real camera devices more closely. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Renamed from applySizeAndFrameRate. Use setSize instead of setWidth and setHeight. (WebCore::RealtimeMediaSource::applyConstraints): applySizeAndFrameRate -> setSizeAndFrameRate. (WebCore::RealtimeMediaSource::applySizeAndFrameRate): Deleted. (WebCore::RealtimeMediaSource::setWidth): Deleted. (WebCore::RealtimeMediaSource::setHeight): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::setSupportedPresets): New. (WebCore::updateMinMax): (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Calculate capabilities from presets. (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate): Use bestSupportedSizeAndFrameRate. (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): (WebCore::RealtimeVideoSource::setSizeAndFrameRate): (WebCore::RealtimeVideoSource::setSupportedFrameRates): Deleted. (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight): Deleted. (WebCore::RealtimeVideoSource::applySizeAndFrameRate): Deleted. (WebCore::RealtimeVideoSource::supportsFrameRate): Deleted. * platform/mediastream/RealtimeVideoSource.h: (WebCore::RealtimeVideoSource::setSupportedCaptureSizes): Deleted. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::stopProducingData): * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRate): (WebCore::AVVideoCaptureSource::applySizeAndFrameRate): Deleted. * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): * platform/mock/MockMediaDevice.h: (WebCore::MockCameraProperties::encode const): (WebCore::MockCameraProperties::decode): (WebCore::MockDisplayProperties::encode const): (WebCore::MockDisplayProperties::decode): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::capabilities const): (WebCore::MockRealtimeVideoSource::settings const): 2018-09-06 Antti Koivisto Actively prewarm processes created for prewarm pool https://bugs.webkit.org/show_bug.cgi?id=189364 Reviewed by Chris Dumez. Do some basic prewarming for newly created processes. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSDefaultStyleSheets.cpp: (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle): * css/CSSDefaultStyleSheets.h: * page/Frame.cpp: (WebCore::Frame::Frame): * page/ProcessWarming.cpp: Added. (WebCore::ProcessWarming::initializeNames): Factor name initialization into a function. (WebCore::ProcessWarming::prewarm): Prewarm - names - settings (system fonts) - user agent stylesheet - JavaScript VM - telephone number detection * page/ProcessWarming.h: Added. 2018-09-06 Youenn Fablet Move replaceTrack logic to RTCRtpSender backend https://bugs.webkit.org/show_bug.cgi?id=189359 Reviewed by Eric Carlson. Move replaceTrack handling from LibWebRTCPeerConnectionBackend to LibWebRTCRtpSenderBackend. This will allow using SetTrack when fully implementing unified plan. No change of behavior. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): Deleted. (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::updateTrackSource): (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-09-06 Andy Estes [Apple Pay] Rename the -apple-pay-button-type value "checkout" to "check-out" https://bugs.webkit.org/show_bug.cgi?id=189366 Reviewed by Sam Weinig. The button title is "Check out with Apple Pay", so we should use the verb phrase "check out" rather than the noun "checkout" for naming this value. Updated http/tests/ssl/applepay/ApplePayButtonV4.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-06 Jer Noble Don't pause playback when locking screen if video is being displayed on second screen. https://bugs.webkit.org/show_bug.cgi?id=189321 Reviewed by Eric Carlson. Expand the existing behavior when AirPlaying to an external device to playing to a local external screen. Don't pause when the screen locks, and don't stop buffering in that mode either. Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass that observed value on to the media element. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): (WebCore::HTMLMediaElement::setPlayingOnSecondScreen): (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): (WebCore::HTMLMediaElement::processingUserGestureForMedia const): (WebCore::HTMLMediaElement::mediaState const): (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const): (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted. (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted. (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): (WebCore::HTMLMediaElement::isPlayingToExternalTarget const): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted. * html/MediaElementSession.h: * platform/audio/PlatformMediaSession.h: (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget): (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const): (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted. (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted. * platform/cocoa/PlaybackSessionModel.h: * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen): * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController init]): (-[WebAVPlayerController dealloc]): (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setPlayingOnSecondScreen): 2018-09-06 Frederic Wang Group options of scrollRectToVisible into a struct https://bugs.webkit.org/show_bug.cgi?id=189352 Reviewed by Simon Fraser. RenderLayer::scrollRectToVisible and RenderObject::scrollRectToVisible have several parameters to configure the type of scrolling. This patch groups the const options into a single struct to make easier to handle them in the future. For example, an #ifdefed scroll behavior option will be added in bug 188043. This refactoring can maybe help too for other scroll extensions (e.g. bug 176454 and bug 161611). No new tests, behavior unchanged. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::scrollToMakeVisible const): Pass options via a struct. * dom/Element.cpp: (WebCore::Element::scrollIntoView): Ditto. (WebCore::Element::scrollIntoViewIfNeeded): Ditto. (WebCore::Element::scrollIntoViewIfNotVisible): Ditto. * editing/FrameSelection.cpp: Include RenderLayer.h in all WebKit ports in order to define ScrollRectToVisibleOptions. (WebCore::FrameSelection::revealSelection): Pass options via a struct. * page/FrameView.cpp: (WebCore::FrameView::scrollToFocusedElementInternal): Ditto. (WebCore::FrameView::scrollToAnchor): Ditto. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Pass options via a struct. Note that absoluteRect and insideFixed are modified in this function. (WebCore::RenderLayer::autoscroll): Pass options via a struct. * rendering/RenderLayer.h: Add ScrollRectToVisibleOptions and use it in order to pass scrollRectToVisible options. * rendering/RenderObject.cpp: (WebCore::RenderObject::scrollRectToVisible): Pass options via a struct * rendering/RenderObject.h: Forward-declare ScrollRectToVisibleOptions and use in order to pass scrollRectToVisible options. 2018-09-06 Wenson Hsieh [macOS] Cannot change font size at selection until font panel is shown https://bugs.webkit.org/show_bug.cgi?id=189295 Reviewed by Ryosuke Niwa. Currently, attempting to alter the font size of currently selected editable text in WKWebView via menu items will fail if the font panel has never been shown. This is because WebViewImpl::changeFontFromFontPanel, which is responsible for converting the current font at the selection to the new font using -[NSFontManager convertFont:] bails as a result of NSFontManager's currently selected font always being nil. WKWebView is responsible for keeping NSFontManager up-to-date with the currently selected font; in fact, this was initially the case in r180465, which introduced NSFontManager support in WebKit2 by propagating EditorState updates that contained font information for the current selection. However, this regressed performance due to selected font computation triggering extra layout passes; r180768 addressed this by introducing a mechanism for requesting the font at the current selection, and only updating NSFontManager with the new selected font when the shared font panel is visible (determined by KVO on NSFontPanel). However, this again regressed WKWebView launch performance, due to KVO registration always forcing the shared NSFontPanel to be created. r182037 addressed this by only registering for KVO on the font panel if the WKWebView has been made editable (SPI on WKWebView). This leads to two issues when attempting to alter font attributes using macOS UI: (1) in web views that have not been made editable using SPI, showing the font panel and attempting to change the font fails due to the selected font staying nil, because we've never begun registering for KVO notifications on the font panel so we don't try to keep the font manager up to date. (2) Even if the web view is made editable, if the font panel is never shown, then the font manager still won't be kept up to date with the current selection, so changing fonts using menu items still does not work. We fix both of these problems by refactoring font manager support on WebKit2 such that an up-to-date selected font in the UI process is no longer necessary in order to alter the font at the current selection. To do this, we figure out what changes the NSFontManager would've made to the currently selected font in the UI process, and then propagate this information to the web process, where we convert this information into an EditingStyle which we apply to the current selection. The code to both determine the attributes changed by NSFontManager and to convert these attributes into editing styles to be applied via Editor already exists in WebKitLegacy, in WebHTMLView.mm. This patch moves this existing logic into WebCore and teases it apart into two portions: the first portion probes NSFontManager to determine which aspects of the font changed and constructs FontChanges, which captures these differences. The second portion maps FontChanges to an EditingStyle, which can then be applied to the current selection. In WebKitLegacy, we construct FontChanges using the font manager, and then immediately use it to create and apply an EditingStyle. In WebKit, we construct FontChanges in the UI process using the font manager, and then send this over to the web process via WebPage::changeFont, which then creates and applies the EditingStyle. Note that this patch also introduces FontAttributeChanges, which is similar in concept to FontChanges, but captures a broader range of changes possible via NSFontPanel. This was done so that we can eliminate all of the font manager probing code (along with the two specimen fonts) from WebHTMLView, but is also necessary in order to allow changing font shadow, strikethrough, and underlines via the font panel to work in WebKit2. This will be fixed in a followup, by making FontAttributeChanges IPC encodable and by making WKWebView/WKView respond to the -changeAttributes: selector. Changes in behavior to WebKit2 are covered by new API tests; legacy WebKit behavior should remain unchanged. Tests: FontManagerTests.ChangeFontSizeWithMenuItems FontManagerTests.ChangeFontWithPanel * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.h: Remove applyFontStyles. * editing/FontAttributeChanges.cpp: Added. (WebCore::FontChanges::platformFontFamilyNameForCSS const): Given a font family name and a font name, returns the string to use as the "font-family" style property value. Originally from WebHTMLView.mm. (WebCore::FontChanges::createEditingStyle const): Converts font changes to an EditingStyle that can be used to apply these changes. (WebCore::FontChanges::createStyleProperties const): Introduce FontChanges, which encapsulates changes which are to be applied to the font in the current selection. (WebCore::cssValueListForShadow): (WebCore::FontAttributeChanges::createEditingStyle const): Converts font attribute changes to an EditingStyle that can be used to apply these changes. * editing/FontAttributeChanges.h: Added. Introduce FontAttributeChanges, which encapsulates changes which are to be applied to the font attributes in the current selection. This includes a set of FontChanges, as well as additional attributes such as strike-through and underlines. (WebCore::FontChanges::setFontName): (WebCore::FontChanges::setFontFamily): (WebCore::FontChanges::setFontSize): (WebCore::FontChanges::setFontSizeDelta): (WebCore::FontChanges::setBold): (WebCore::FontChanges::setItalic): (WebCore::FontAttributeChanges::setVerticalAlign): (WebCore::FontAttributeChanges::setBackgroundColor): (WebCore::FontAttributeChanges::setForegroundColor): (WebCore::FontAttributeChanges::setShadow): (WebCore::FontAttributeChanges::setStrikeThrough): (WebCore::FontAttributeChanges::setUnderline): (WebCore::FontAttributeChanges::setFontChanges): Setters for FontChanges and FontAttributeChanges. Initially, most of these values are optional, indicating that there should be no change. (WebCore::FontChanges::encode const): (WebCore::FontChanges::decode): Add encoding/decoding support to FontChanges, so that it can be sent over IPC for WebKit2. * editing/cocoa/FontAttributeChangesCocoa.mm: Added. (WebCore::FontChanges::platformFontFamilyNameForCSS const): Helper method to determine whether the font family or the font name should be used, by looking up the PostScript font name using a FontDescriptor and comparing it against the result of -[NSFont fontName]. This logic was originally in WebHTMLView.mm. * editing/mac/EditorMac.mm: (WebCore::Editor::applyFontStyles): Deleted. * platform/mac/WebCoreNSFontManagerExtras.h: Added. * platform/mac/WebCoreNSFontManagerExtras.mm: Added. Add helper functions to compute FontChanges and FontAttributeChanges from NSFontManager. (WebCore::firstFontConversionSpecimen): (WebCore::secondFontConversionSpecimen): Two "specimen fonts" used to determine what changes NSFontManager or NSFontPanel makes when performing font or font attribute conversion. Moved from WebHTMLView.mm. (WebCore::computedFontChanges): (WebCore::computedFontAttributeChanges): Moved here from WebHTMLView.mm. Instead of converting font attributes to NSStrings and setting properties on DOMCSSStyleDeclaration, we instead specify properties on MutableStyleProperties using CSSValues. 2018-09-06 Zalan Bujtas [LFC][BFC] Add support for min(max)-width https://bugs.webkit.org/show_bug.cgi?id=189358 Reviewed by Antti Koivisto. See https://www.w3.org/TR/CSS22/visudet.html#min-max-widths for details. Tests: fast/block/block-only/absolute-position-min-max-width.html fast/block/block-only/float-min-max-width.html fast/block/block-only/inflow-min-max-width.html * 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::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): * layout/blockformatting/BlockFormattingContext.h: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): 2018-09-06 Eric Carlson [MediaStream] Initialize AVVideoCapture video presets https://bugs.webkit.org/show_bug.cgi?id=189355 Reviewed by Youenn Fablet. No new tests, no functionality changed. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Don't try to load symbols if they aren't available. 2018-09-06 Ali Juma IntersectionObserver leaks documents https://bugs.webkit.org/show_bug.cgi?id=189128 Reviewed by Simon Fraser. Currently, Documents own IntersectionObservers while IntersectionObservers own callbacks that have strong references to Documents. To break this cycle, make Documents only have weak pointers to IntersectionObservers. Instead, manage the lifetime of an IntersectionObserver as an ActiveDOMObject, overriding hasPendingActivity to keep the observer alive while there are ongoing observations. However, there is a still a potential reference cycle. The callback keeps global references alive, so if there's a global reference to the observer in JavaScript, we have an observer->callback->observer cycle, keeping the callback (and hence the Document) alive. To break this cycle, make IntersectionObserver release the callback when its Document is stopped. With these changes, there are no longer any leaks reported with run-webkit-tests --world-leaks on LayoutTests/intersection-observer and LayoutTests/imported/w3c/web-platform-tests/intersection-observer. Tests: intersection-observer/no-document-leak.html intersection-observer/observer-and-callback-without-js-references.html * dom/Document.cpp: (WebCore::Document::addIntersectionObserver): (WebCore::Document::removeIntersectionObserver): * dom/Document.h: * dom/Element.cpp: (WebCore::Element::didMoveToNewDocument): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::~IntersectionObserver): (WebCore::IntersectionObserver::observe): (WebCore::IntersectionObserver::rootDestroyed): (WebCore::IntersectionObserver::createTimestamp const): (WebCore::IntersectionObserver::notify): (WebCore::IntersectionObserver::hasPendingActivity const): (WebCore::IntersectionObserver::activeDOMObjectName const): (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): (WebCore::IntersectionObserver::stop): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::trackingDocument const): (WebCore::IntersectionObserver::trackingDocument): Deleted. * page/IntersectionObserver.idl: 2018-09-05 Zalan Bujtas [LFC] Adapt to the new const WeakPtr<> https://bugs.webkit.org/show_bug.cgi?id=189334 Reviewed by Antti Koivisto. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::FormattingContext): * layout/FormattingContext.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::initializeRoot): * layout/LayoutContext.h: * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): * layout/floats/FloatAvoider.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): (WebCore::Layout::FloatingState::FloatingState): * layout/floats/FloatingState.h: * layout/layouttree/LayoutContainer.cpp: (WebCore::Layout::Container::addOutOfFlowDescendant): * layout/layouttree/LayoutContainer.h: (WebCore::Layout::Container::outOfFlowDescendants const): 2018-09-06 Xabier Rodriguez Calvar [GStreamer] Extra ASSERTs at MainThreadNotifier https://bugs.webkit.org/show_bug.cgi?id=188786 Reviewed by Carlos Garcia Campos. We add a couple of checks in debug mode: there is only one bit on per notification and ensure a notifier was invalidated before being destroyed. * platform/graphics/gstreamer/MainThreadNotifier.h: 2018-09-05 Youenn Fablet Move ownership of outgoing source to RTCRtpSender backend https://bugs.webkit.org/show_bug.cgi?id=189310 Reviewed by Alex Christensen. RTCRtpSender should own the source so that it can replace/stop it. Since this is libwebrtc specific, the source is actually owned by the backend. Simplified replaceTrack a bit based on that. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::doStop): (WebCore::updateTrackSource): (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-09-05 Brent Fulgham The width of an empty or nullptr TextRun should be zero https://bugs.webkit.org/show_bug.cgi?id=189154 Reviewed by Zalan Bujtas. If a page has an empty TextRun and attempts to paint it we can crash with a nullptr. This patch recognizes that an empty TextRun should always produce a zero width, rather than attempt to compute this value from font data. It also prevents ListBox from attempting to paint a null string. Test: fast/text/null-string-textrun.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width. (WebCore::FontCascade::width const): Ditto. * platform/graphics/TextRun.h: (WebCore::TextRun::TextRun): ASSERT that the supplied String is non-null. (WebCore::TextRun::setText): Ditto. * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemForeground): Don't attempt to paint a null string. 2018-09-05 Zalan Bujtas [LFC][BFC] ComputeFloat* methods should take a const FloatingContext& https://bugs.webkit.org/show_bug.cgi?id=189333 Reviewed by Antti Koivisto. Only layoutFormattingContextRoot() needs a non-const FloatingContext& object (to add the floating box to the floating state). * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): * layout/blockformatting/BlockFormattingContext.h: 2018-09-05 Youenn Fablet Introduce a backend for RTCRtpTransceiver https://bugs.webkit.org/show_bug.cgi?id=189322 Reviewed by Eric Carlson. Introduce RTCRtpTransceiverBackend to implement the transceiver functionality using libwebrtc. Remove provisional mids as it will be done by the webrtc backend. No observable change of behavior yet since there is no transceiver backend yet. * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::RTCRtpTransceiver): (WebCore::RTCRtpTransceiver::mid const): (WebCore::RTCRtpTransceiver::direction const): (WebCore::RTCRtpTransceiver::setDirection): (WebCore::RTCRtpTransceiver::stop): (WebCore::RTCRtpTransceiver::getNextMid): Deleted. (WebCore::RTCRtpTransceiver::directionString const): Deleted. * Modules/mediastream/RTCRtpTransceiver.h: (WebCore::RTCRtpTransceiver::create): (WebCore::RTCRtpTransceiver::provisionalMid const): Deleted. (WebCore::RTCRtpTransceiver::setMid): Deleted. * Modules/mediastream/RTCRtpTransceiverBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::createReceiver): (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver): (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * WebCore.xcodeproj/project.pbxproj: 2018-09-05 Zalan Bujtas [LFC] Pass in const LayoutContext& to geometry methods when possible https://bugs.webkit.org/show_bug.cgi?id=189331 Reviewed by Antti Koivisto. Only layout and layout-like methods (intrinsic width computation -> shrink to fit -> out-of-flow/floating boxes) should take a non-const LayoutContext&. Other geometry functions should not mutate the the context. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::computeBorderAndPadding const): (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedBorder): (WebCore::Layout::FormattingContext::Geometry::computedPadding): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): (WebCore::Layout::LayoutContext::establishedFormattingState const): (WebCore::Layout::LayoutContext::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutContext::formattingContext const): (WebCore::Layout::LayoutContext::establishedFormattingState): Deleted. (WebCore::Layout::LayoutContext::formattingContext): Deleted. * layout/LayoutContext.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeStaticPosition const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (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): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): * layout/inlineformatting/InlineFormattingContext.h: 2018-09-05 Youenn Fablet Expose RTCRtpSender.setParameters https://bugs.webkit.org/show_bug.cgi?id=189307 Reviewed by Eric Carlson. Implement RTCRtpSender.setParameters. This is an incomplete implementation as we need to refresh parameters as per the spec and testing is much easier with full transceiver support. Implementation uses sender backend to set the parameters at libwebrtc level. Fix the case of a stopped sender/transceiver in which case promise should be rejected. Covered by rebased and modified tests. * Modules/mediastream/RTCRtpParameters.h: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::setParameters): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::stop): * Modules/mediastream/RTCRtpTransceiver.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::LibWebRTCRtpReceiverBackend::getParameters): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::getParameters const): (WebCore::LibWebRTCRtpSenderBackend::setParameters): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCEncodingParameters): (WebCore::fromRTCEncodingParameters): (WebCore::toRTCHeaderExtensionParameters): (WebCore::fromRTCHeaderExtensionParameters): (WebCore::toRTCCodecParameters): (WebCore::toRTCRtpParameters): (WebCore::fromRTCRtpParameters): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: 2018-09-05 Simon Fraser Remove some logging that I committed by mistake. * rendering/RenderLayerFilters.cpp: (WebCore::RenderLayerFilters::RenderLayerFilters): (WebCore::RenderLayerFilters::~RenderLayerFilters): 2018-09-05 Zalan Bujtas [LFC] Construct the Display::Box objects on demand. https://bugs.webkit.org/show_bug.cgi?id=189320 Reviewed by Antti Koivisto. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::initializeRoot): (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const): (WebCore::Layout::LayoutContext::createDisplayBox): Deleted. * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): * layout/displaytree/DisplayBox.h: 2018-09-05 Woodrow Wang Add infrastructure to dump resource load statistics https://bugs.webkit.org/show_bug.cgi?id=189213 Reviewed by Daniel Bates. The dumping functionality is not currently used, but will be included in tests for . * loader/ResourceLoadStatistics.h: 2018-09-05 Ryan Haddad Unreviewed, fix the build with recent SDKs. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::exernalDeviceDisplayNameForPlayer): 2018-09-05 Woodrow Wang Added runtime feature flag for web API statistics https://bugs.webkit.org/show_bug.cgi?id=189211 Reviewed by Daniel Bates. Added functionality to get and set the runtime flag. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAPIStatisticsEnabled): (WebCore::RuntimeEnabledFeatures::webAPIStatisticsEnabled const): 2018-09-05 Youenn Fablet Move replaceTrack logic to LibWebRTCPeerConnectionBackend https://bugs.webkit.org/show_bug.cgi?id=189281 Reviewed by Eric Carlson. Move replaceTrack handling code from RTCPeerConnection to LibWebRTCPeerConnectionBackend. This makes the logic easier to understand. Future refactoring will further try to put more handling in RTCRtpSenderBackend. No change of behavior. * Modules/mediastream/RTCPeerConnection.cpp: * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::tryUpdatingTrackSource): (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): 2018-09-05 Zalan Bujtas [LFC] LayoutContext::displayBoxForLayoutBox() should return a Display::Box& https://bugs.webkit.org/show_bug.cgi?id=189311 Reviewed by Antti Koivisto. When the layout logic needs a Display::Box, we must have already created one for the associated Layout::Box. (It does not necessarily mean that evey Layout::Box has a Display::Box. For example in case of inline formatting context, we don't create a Display::Box for every inline box, but the formatting logic does not require such pairs.) * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::computeBorderAndPadding const): (WebCore::Layout::FormattingContext::mapBoxToAncestor): (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): (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::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedPadding): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeStaticPosition const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors 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): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::isMarginBottomCollapsedThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::append): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): 2018-09-05 Zalan Bujtas [LFC] Drop Display:Box from FormattingContext::compute* functions https://bugs.webkit.org/show_bug.cgi?id=189309 Reviewed by Antti Koivisto. They are redundant and could get out of sync. * 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): * layout/FormattingContext.h: * 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::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): * layout/blockformatting/BlockFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): * layout/inlineformatting/InlineFormattingContext.h: 2018-09-05 Jer Noble Add MediaCapabilities as an Experimental Feature https://bugs.webkit.org/show_bug.cgi?id=189209 Reviewed by Eric Carlson. Move mediaCapabilitiesEnabled out of RuntimeEnabledFeatures. It already (also) exists in Settings. * Modules/mediacapabilities/MediaCapabilities.idl: * Modules/mediacapabilities/MediaCapabilitiesInfo.idl: * Modules/mediacapabilities/NavigatorMediaCapabilities.idl: * Modules/mediacapabilities/ScreenLuminance.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setMediaCapabilitiesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaCapabilitiesEnabled const): Deleted. 2018-09-05 Woodrow Wang Add functionality to encode and decode a uint64_t in KeyedCoding https://bugs.webkit.org/show_bug.cgi?id=189216 Reviewed by Daniel Bates. I've added this functionality in order to be able to encode and decode the raw uint64_t representation of an OptionSet for my patch here . The changes in the KeyedEncoder/KeyedDecoder for Glib were made because they are derived classes of KeyedCoding which contains pure virtual functions that need to be implemented. * platform/KeyedCoding.h: * platform/cf/KeyedDecoderCF.cpp: (WebCore::KeyedDecoderCF::decodeUInt64): * platform/cf/KeyedDecoderCF.h: * platform/cf/KeyedEncoderCF.cpp: (WebCore::KeyedEncoderCF::encodeUInt64): * platform/cf/KeyedEncoderCF.h: * platform/glib/KeyedDecoderGlib.cpp: (WebCore::KeyedDecoderGlib::decodeUInt64): * platform/glib/KeyedDecoderGlib.h: * platform/glib/KeyedEncoderGlib.cpp: (WebCore::KeyedEncoderGlib::encodeUInt64): * platform/glib/KeyedEncoderGlib.h: 2018-09-05 Zan Dobersek [GTK] ASSERT(!m_nicosia.imageBacking) when starting any YouTube video https://bugs.webkit.org/show_bug.cgi?id=189215 Reviewed by Carlos Garcia Campos. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): Manually clear out any layer-side state of any image backing that is associated with this layer, much like we do for backing stores. 2018-09-05 Eric Carlson [MediaStream] Simplify logic when changing RealtimeMediaSource settings https://bugs.webkit.org/show_bug.cgi?id=189284 Reviewed by Youenn Fablet. Remove all "apply" methods from RealtimeMediaSource and derived classes, and add a bitfield to settingsDidChange so classes can do setting-specific setup and configuration by overriding settingsDidChange. No new tests, no functionality changed. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized): * Modules/mediastream/CanvasCaptureMediaStreamTrack.h: * platform/mediastream/MediaConstraints.h: (WebCore::NumericConstraint::fitnessDistance const): (WebCore::NumericConstraint::valueForDiscreteCapabilityValues const): * platform/mediastream/RealtimeIncomingVideoSource.h: (): Deleted. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::RealtimeMediaSource): (WebCore::RealtimeMediaSource::settingsDidChange): (WebCore::RealtimeMediaSource::fitnessDistance): (WebCore::applyNumericConstraint): (WebCore::RealtimeMediaSource::applyConstraint): (WebCore::RealtimeMediaSource::applyConstraints): (WebCore::RealtimeMediaSource::setSize): (WebCore::RealtimeMediaSource::setWidth): (WebCore::RealtimeMediaSource::setHeight): (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/RealtimeMediaSourceSettings.cpp: (WebCore::RealtimeMediaSourceSettings::diff const): * platform/mediastream/RealtimeMediaSourceSettings.h: (WebCore::RealtimeMediaSourceSettings::allFlags): * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::applySize): Deleted. (WebCore::RealtimeVideoSource::applyFrameRate): Deleted. * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: (WebCore::GStreamerAudioCaptureSource::settingsDidChange): (WebCore::GStreamerAudioCaptureSource::applySampleRate): Deleted. * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::settingsDidChange): (WebCore::GStreamerVideoCaptureSource::applySize): Deleted. (WebCore::GStreamerVideoCaptureSource::applyFrameRate): Deleted. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::settingsDidChange): (WebCore::AVVideoCaptureSource::setPreset): (WebCore::AVVideoCaptureSource::setFrameRate): (WebCore::AVVideoCaptureSource::applySizeAndFrameRate): (WebCore::AVVideoCaptureSource::processNewFrame): (WebCore::AVVideoCaptureSource::applySize): Deleted. (WebCore::AVVideoCaptureSource::applyFrameRate): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::settingsDidChange): (WebCore::CoreAudioCaptureSource::applySampleRate): Deleted. (WebCore::CoreAudioCaptureSource::applyEchoCancellation): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): (WebCore::DisplayCaptureSourceCocoa::startProducingData): (WebCore::DisplayCaptureSourceCocoa::applySize): Deleted. (WebCore::DisplayCaptureSourceCocoa::applyFrameRate): Deleted. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: (WebCore::MockRealtimeAudioSourceMac::settingsDidChange): (WebCore::MockRealtimeAudioSourceMac::applySampleRate): Deleted. * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::settingsDidChange): (WebCore::MockRealtimeVideoSourceMac::applySize): Deleted. * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): (WebCore::ScreenDisplayCaptureSourceMac::applySize): Deleted. (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Deleted. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::settingsDidChange): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::settingsDidChange): (WebCore::MockRealtimeVideoSource::applySize): Deleted. * platform/mock/MockRealtimeVideoSource.h: 2018-09-05 Zalan Bujtas [LFC][BFC] Move MarginCollapse class under BlockFormattingContext::Geometry https://bugs.webkit.org/show_bug.cgi?id=189296 Reviewed by Antti Koivisto. Margin collapsing is part of geometry after all. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): * layout/blockformatting/BlockMarginCollapse.cpp: (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::isMarginTopCollapsedWithParentMarginBottom): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop): Deleted. 2018-09-04 Zalan Bujtas [LFC] Make BlockFormattingContext::Geometry a subclass of FormattingContext::Geometry https://bugs.webkit.org/show_bug.cgi?id=189294 Reviewed by Antti Koivisto. This simplifies some of the call sites. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): 2018-09-04 Frederic Wang Add basic support for ScrollIntoViewOptions https://bugs.webkit.org/show_bug.cgi?id=189258 Reviewed by Simon Fraser. This patch introduces a new ScrollIntoViewOptions parameter that can be passed into Element.scrollIntoView instead of a boolean. A basic support for scroll alignments is implemented, so that it is closer to the behavior of the CSSOMView spec while still remaining compatible with the current boolean-parameter implementation. Full implementation that takes into account orientation/direction will be handled in bug 161611. This patch is also a preliminary step to support the ScrollBehavior (bug 188043) for ScrollIntoView. Tests: web-platform-tests/css/cssom-view/scrollintoview-html web-platform-tests/css/cssom-view/scrollIntoView-smooth.html * CMakeLists.txt: Add new IDL files. * DerivedSources.make: Ditto. * Sources.txt: Add new generated cpp JS bindings. * WebCore.xcodeproj/project.pbxproj: Add files to build to XCode. * dom/Element.cpp: (WebCore::toScrollAlignment): Convert ScrollLogicalPosition to scroll alignment. Orientation and direction are not implemented yet. (WebCore::Element::scrollIntoView): Implement new scrollIntoView version accepting ScrollIntoViewOptions parameter. * dom/Element.h: Declare new scrollIntoView. * dom/Element.idl: Make scrollIntoView accept a ScrollIntoViewOptions parameter. * page/ScrollIntoViewOptions.h: Added. * page/ScrollIntoViewOptions.idl: Added. * page/ScrollLogicalPosition.h: Added. * page/ScrollLogicalPosition.idl: Added. 2018-09-04 Oriol Brufau Check important flags when serializing shorthand with "initial" values https://bugs.webkit.org/show_bug.cgi?id=188984 Reviewed by Antti Koivisto. Test: imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html The test still has some failures due to https://bugs.webkit.org/show_bug.cgi?id=185953 but without this patch it would fail earlier. * css/StyleProperties.cpp: (WebCore::StyleProperties::get4Values const): 2018-09-04 Antti Koivisto Remove pointless RenderSVGResourceMode::ApplyToDefault enum value https://bugs.webkit.org/show_bug.cgi?id=189260 Reviewed by Sam Weinig. Default does not need a bit, it is better represented with an empty OptionSet. * rendering/svg/RenderSVGResource.cpp: (WebCore::requestPaintingResource): * rendering/svg/RenderSVGResource.h: * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyResource): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): (WebCore::RenderSVGResourceFilter::postApplyResource): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourceMasker.cpp: (WebCore::RenderSVGResourceMasker::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): (WebCore::RenderSVGResourcePattern::postApplyResource): * rendering/svg/RenderSVGResourceSolidColor.cpp: (WebCore::RenderSVGResourceSolidColor::applyResource): (WebCore::RenderSVGResourceSolidColor::postApplyResource): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::SVGInlineTextBox): (WebCore::SVGInlineTextBox::paintSelectionBackground): (WebCore::SVGInlineTextBox::paint): (WebCore::SVGInlineTextBox::acquirePaintingResource): (WebCore::SVGInlineTextBox::paintDecorationWithStyle): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::~SVGRenderingContext): (WebCore::SVGRenderingContext::prepareToRenderSVGContent): 2018-08-29 Emilio Cobos Álvarez Remove PseudoElementUserAgentCustom. https://bugs.webkit.org/show_bug.cgi?id=189089 Reviewed by Ryosuke Niwa. Tests at https://github.com/web-platform-tests/wpt/pull/12743. * css/CSSSelector.cpp: (WebCore::CSSSelector::pseudoId): (WebCore::CSSSelector::parsePseudoElementType): * css/CSSSelector.h: (WebCore::CSSSelector::isCustomPseudoElement const): * css/RuleSet.cpp: (WebCore::RuleSet::addRule): * css/parser/CSSParserSelector.h: (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const): 2018-09-04 Dean Jackson Post review Weinig fix-ups https://bugs.webkit.org/show_bug.cgi?id=189288 Reviewed by Sam Weinig. Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252 * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): (WebCore::initializeSystemPreviewMIMETypes): Deleted. * rendering/RenderThemeIOS.mm: (WebCore::arKitBundle): (WebCore::loadARKitPDFPage): (WebCore::systemPreviewLogo): 2018-09-04 Ryosuke Niwa slotchange event doesn't get fired when inserting, removing, or renaming slot elements https://bugs.webkit.org/show_bug.cgi?id=189144 Reviewed by Antti Koivisto. This patch implements `slotchange` event when a slot element is inserted, removed, or renamed in the DOM tree. Let us consider each scenario separately. Insertion (https://dom.spec.whatwg.org/#concept-node-insert): In this case, we must fire `slotchange` event on slot elements whose assigned nodes have changed in the tree order. When there is at most one slot element for each name, this can be done by simply checking whether each slot has assigned nodes or not. When there are more than one slot element, however, the newly inserted slot element may now become the first slot of a given name, and gain assined nodes while the previously first element loses its assigned nodes. To see if the newly inserted slot element is the first of its kind, we must travere the DOM tree to check the order of that and the previously first slot element. To do this, we resolve the slot elements before start inserting nodes in executeNodeInsertionWithScriptAssertion via SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval. Note that when the DOM tree has at most one slot element of its kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op and addSlotElementByName continues to operate in O(1). Becasue addSlotElementByName is called on each inserted slot element in the tree order, we do the tree traversal upon finding the first slot element which has more than one of its kind in the current tree. In this case, we resolve all other slot elements and enqueues slotchange event as needed to avoid doing the tree traversal more than once. Removal (https://dom.spec.whatwg.org/#concept-node-remove): In removal, we're concerned with removing the first slot element of its kind. We must fire slotchange event on the remaining slot elements which became the first of its kind after the removal as well as the ones which got removed from the tree if they had assigned nodes. Furthermore, the DOM specification mandates that we first fire slotchange events in the tree from which a node was removed and then in the removed subtree. Because we must only fire slotchange event on the first slot element of its kind which has been removed, we must resolve the first slot elements of each kind before a node removal in removeAllChildrenWithScriptAssertion and removeNodeWithScriptAssertion as we've done for insertion. Again, in the case there was at most one slot element of each kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op and removeSlotElementByName would continue to operate in O(1). When there are multiple slot elements for a given kind, we immediately enqueue slotchange event on the slot elements which newly became the first of its kind but delay the enqueuing of slotchange event on the removed slot elements until removeSlotElementByName is called on that element so that enqueuing of slotchange events on the slot elements still remaining in the in the tree would happen before those which got removed as the DOM specification mandates. Rename (https://dom.spec.whatwg.org/#shadow-tree-slots): In the case the slot element's name content attribute is changed, the renamed element might have become the first of its kind or ceased to be the first of its kind. There could be two other slot elements appearing later in the tree order which might have gained or lost assigned nodes as a result. In this case, we invoke the algorithms for removing & inserting the slot with a key difference: we enqueue slotchange event on the renamed slot immediately if it has assigned nodes. To enqueue slotchange event in the tree order, this patch adds oldElement, which is a WeakPtr to a slot element, to SlotAssignment::Slot. This WeakPtr is set to the slot element which used to have assigned nodes prior to the node insertion, removal, or rename but no longer has after the mutation. This patch also adds a slot mutation version number, m_slotMutationVersion, which is incremented whenever a node is about to be inserted or removed, and slot resolution version, m_slotResolutionVersion, which is set to the current slot mutation version number when the full slot resolution is triggered during slot mutations. They are used to avoid redundant tree traversals in resolveSlotsAfterSlotMutation. This patch also makes m_needsToResolveSlotElements compiled in release builds to avoid resolving slot elements when there is at most one slot element of each kind. For insertion, oldElement is set to the slot which used to be the first of its kind before getting set to a slot element being inserted in resolveSlotsAfterSlotMutation. We enqueue slotchange event on the newly inserted slot element at that point (1). Since the slot element which used to be the first of its kind appears after the newly inserted slot element by definition, we're guaranteed to see this oldElement later in the tree traversal upon which we enqueue slotchange event. Note that if this slot element was the first of its kind, then we're simply hitting (1), which is O(1) and does not invoke the tree traversal. For removal, oldElement is set to the slot which used to be the first of its kind. Because this slot element is getting removed, slotchange event must be enqueud after slotchange events have been enqueued on all slot elements still remaining in the tree. To do this, we enqueue slotchange event immediately on the first slot element of its kind during the tree traversal as we encounter it (2), and set oldElement to the previosuly-first-but-removed slot element. slotchange event is enqueued on this slot element when removeSlotElementByName is later invoked via HTMLSlotElement::removedFromAncestor which traverses each removed element in the tree order. Again, if this was the last slot of its kind, we'd simply expedite (2) by enqueuing slotchange event during removeSlotElementByName, which is O(1). When the DOM invokes the concept to replace all children (https://dom.spec.whatwg.org/#concept-node-replace-all), however, this algorithm isn't sufficient because the removal of each child happens one after another. We would either need to resolve slots between each removal, or treat the removal of all children as a single operation. While the DOM specification currently specifies the former behavior, this patch implements the latter behavior to avoid useless work. See the DOM spec issue: https://github.com/w3c/webcomponents/issues/764 Test: fast/shadow-dom/slotchange-for-slot-mutation.html * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Call resolveSlotsBeforeNodeInsertionOrRemoval before start removing children. (WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto. (WebCore::executeNodeInsertionWithScriptAssertion): Ditto before inserting children. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::~ShadowRoot): Set m_hasBegunDeletingDetachedChildren to true. This flag is used to supress slotchange events during the shadow tree destruction. (WebCore::ShadowRoot::renameSlotElement): Added. (WebCore::ShadowRoot::removeSlotElementByName): Added oldParentOfRemovedTree as an argument. * dom/ShadowRoot.h: (WebCore::ShadowRoot::shouldFireSlotchangeEvent): Added. * dom/SlotAssignment.cpp: (WebCore::findSlotElement): Added. (WebCore::nextSlotElementSkippingSubtree): Added. (WebCore::SlotAssignment::hasAssignedNodes): Added. Returns true if the slot of a given name has assigned nodes. (WebCore::SlotAssignment::renameSlotElement): Added. (WebCore::SlotAssignment::addSlotElementByName): Call resolveSlotsAfterSlotMutation when slotchange event needs to be dispatched for the current slot and there are more than one slot elements. (WebCore::SlotAssignment::removeSlotElementByName): Ditto. When the slot's oldElement is set to the current slot element, meaning that this slot element used to have assigned nodes, then enqueue slotchange event. It also has a special case for oldParentOfRemovedTree is null when renaming a slot element. In this case, we want to enqueue slot change event immediately on the renamed slot element and any affected elements as in a node insertion since removeSlotElementByName would never be called on a slot element which newly become the first of its kind after a slot rename. (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): Added. This is the slot resolution algorithm invoked when there are more than one slot elements for a given name. It has two modes dealing with insertion & removal. The insertion mode is also used for renaming a slot element. The firs (WebCore::SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Resolves all slot elements prior to inserting or removing nodes. In many cases, this should be a no-op since m_needsToResolveSlotElements is set to true only when there are more than one slot element of its kind. (WebCore::SlotAssignment::willRemoveAllChildren): Ditto. Also sets m_willBeRemovingAllChildren to true. (WebCore::SlotAssignment::didChangeSlot): (WebCore::SlotAssignment::resolveAllSlotElements): Use seenFirstElement instead of element to indicate whether we have seen a slot element of given name for consistency with resolveSlotsAfterSlotMutation. * dom/SlotAssignment.h: (WebCore::SlotAssignment::Slot): Added oldElement and seenFirstElement. (WebCore::SlotAssignment): Always compile m_needsToResolveSlotElements. Added m_willBeRemovingAllChildren, m_slotMutationVersion, and m_slotResolutionVersion. (WebCore::ShadowRoot::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Calls the one in SlotAssignment. (WebCore::ShadowRoot::willRemoveAllChildren): Ditto. * html/HTMLSlotElement.cpp: (WebCore::HTMLSlotElement::removedFromAncestor): (WebCore::HTMLSlotElement::attributeChanged): Calls ShadowRoot::renameSlotElement instead of removeSlotElementByName and addSlotElementByName pair. 2018-09-04 Youenn Fablet Make LibWebRTCRtpSenderBackend own its libwebrtc RTP sender backend https://bugs.webkit.org/show_bug.cgi?id=189270 Reviewed by Eric Carlson. Previously, the libwebrtc senders were owned in LibWebRTCMediaEndpoint. This patch makes them be owned by LibWebRTCRtpSenderBackend. This simplifies the implementation of RTCRtpSender::getParameters. This will help simplify the implementation of RTCRtpSender::replaceTrack. removeTrack is also refactored so that LibWebRTCMediaEndpoint directly uses libwebrtc constructs and not WebCore libwebrtc-agnostic ones. No change of behavior. * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::removeTrack): (WebCore::PeerConnectionBackend::notifyRemovedTrack): Deleted. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::removeTrack): * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::getParameters): * Modules/mediastream/RTCRtpSender.h: (WebCore::RTCRtpSender::backend): * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): (WebCore::LibWebRTCMediaEndpoint::removeTrack): (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): (WebCore::LibWebRTCMediaEndpoint::stop): (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const): Deleted. (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const): Deleted. (WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::backendFromRTPSender): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::removeTrack): (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const): (WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack): Deleted. (WebCore::LibWebRTCPeerConnectionBackend::getParameters const): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::getParameters const): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-09-04 Wenson Hsieh Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs https://bugs.webkit.org/show_bug.cgi?id=188890 Reviewed by Tim Horton. Adds support for exposing a newline separated list of URLs via DataTransfer's "text/uri-list" type when pasting or dropping multiple items on the pasteboard that can be represented as URLs. Currently on iOS, only the URL of the first item (if present) is exposed, and on macOS, only the first out of all the URLs in the pasteboard is exposed. To fix this, we introduce `Pasteboard::readAllStrings`, which reads a list of pasteboard strings collected from all available items on the platform pasteboard. Currently, this is only used to provide a list of URL strings when fetching data for the "text/uri-list" type when calling `DataTransfer.getData()` and `DataTransferItem.getAsString()`. Tests: DragAndDropTests.ExposeMultipleURLsInDataTransfer UIPasteboardTests.DataTransferURIListContainsMultipleURLs PasteMixedContent.PasteOneOrMoreURLs * dom/DataTransfer.cpp: (WebCore::readURLsFromPasteboardAsString): Add a helper method that reads all URL strings from the pasteboard (for the MIME type "text/uri-list", which corresponds to NSURLPboardType and "public.url" on macOS and iOS, respectively) and returns a single string containing all non-empty URLs joined by newline characters. Also takes a filtering block which may be used to reject URLs from being included in "text/uri-list" output. (WebCore::DataTransfer::getDataForItem const): (WebCore::DataTransfer::readStringFromPasteboard const): Insteading of reading a single string from the pasteboard for "text/uri-list", call the above helper function to read all URL strings in the pasteboard. If there are files present in the pasteboard, we also filter out URLs whose schemes are not in the set of schemes that are safe to expose to the page (i.e. http(s), blob, and data). * platform/Pasteboard.cpp: (WebCore::Pasteboard::readAllStrings): Add a default non-Cocoa implementation of readAllStrings() that returns a vector, which may contain the result of readString(). * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: Add plumbing to grab a list of strings from the pasteboard for a given type. * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::readAllStrings): (WebCore::Pasteboard::readString): Implement these two methods in terms of `readPlatformValuesAsStrings`. `readAllStrings` returns the full list of results, while `readString` only returns the first result. * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readPlatformValuesAsStrings): (WebCore::Pasteboard::readPlatformValueAsString): Deleted. Refactor this Cocoa helper function to return a list of pasteboard string values for the given type, rather than a single string. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::allStringsForType const): Grab a string for each item (represented by an NSItemProvider) in the pasteboard that has data for the given type identifier. (WebCore::PlatformPasteboard::readString const): Return the absolute string of the NSURL, instead of WebCore::URL::string(). This is needed to handle the case where the NSURL is constructed from absolute and relative parts using a Plist. While -absoluteString gets us the full URL string, URL::string() only returns the relative portion. * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::readPlatformValuesAsStrings): (WebCore::Pasteboard::readPlatformValueAsString): Deleted. Also refactor this to retrieve a list of pasteboard strings, rather than a single result. * platform/mac/PlatformPasteboardMac.mm: (WebCore::typeIdentifierForPasteboardType): (WebCore::PlatformPasteboard::allStringsForType const): Add an implementation for `allStringsForType` on macOS. Unlike iOS, it's much trickier to get this right since we need to maintain compatibility with legacy "NS*Pboard" types, and `NSPasteboardItem` can only provide data for `NSPasteboardType`s (i.e. UTIs), so there's no way to just iterate through each pasteboard item and ask it for data that matches the given type, if the types are not UTIs. However, in the case where we have multiple items, the client must have used NSPasteboardWriting-conformant objects and/or NSPasteboardItem itself to write data to the pasteboard. Since NSPasteboardWriting-conformant objects register modern pasteboard types when writing to the pasteboard, we can simply iterate over these pasteboard items and ask for property lists using type identifiers instead of having to worry about legacy pasteboard types. Furthermore, in the case where there is only a single item in the pasteboard and we do need to handle legacy pasteboard types, using `-[NSPasteboard stringForType:]` in the same way we do currently should yield the correct result. As such, in the case where there is a single pasteboard item, we use `-[NSPasteboard stringForType:]` with the original legacy type, and in the case where there are multiple items on the pasteboard, we iterate over each of the pasteboard items and call `-[NSPasteboardItem propertyListForType:]` with the modern pasteboard type corresponding to the given legacy pasteboard type. The different corner cases in this logic are tested by the new API test, PasteMixedContent.PasteOneOrMoreURLs, which exercises several different ways of writing one or more URLs to the pasteboard on macOS, which each result in different legacy and modern pasteboard types being written to the pasteboard; our implementation of `PlatformPasteboard::allStringsForType` on macOS handles all cases correctly. 2018-09-04 Simon Fraser CSS reference filter that references a tiled feTurbulence is blank https://bugs.webkit.org/show_bug.cgi?id=188950 Reviewed by Dean Jackson. We need to run the code that was in RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion() for CSS reference filters, to set up the various rects in the filter effects. Do this by moving the code to FilterEffect::determineFilterPrimitiveSubregion(), which makes sense because it recurses on the FilterEffect input chain. To make it CSS/SVGFilter agnostic, we move filterRegionInUserSpace() to the Filter base class (for CSSFilter, it just returns m_filterRegion). Test: css3/filters/reference-filter-set-filter-regions.html * platform/graphics/filters/Filter.h: * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::determineFilterPrimitiveSubregion): * platform/graphics/filters/FilterEffect.h: * rendering/CSSFilter.cpp: (WebCore::CSSFilter::determineFilterPrimitiveSubregion): * rendering/CSSFilter.h: * rendering/RenderLayerFilters.cpp: (WebCore::RenderLayerFilters::beginFilterEffect): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): * rendering/svg/RenderSVGResourceFilterPrimitive.cpp: (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Deleted. * rendering/svg/RenderSVGResourceFilterPrimitive.h: * svg/graphics/filters/SVGFilter.h: 2018-09-04 Zalan Bujtas [LFC] Rename LayoutPair to BoxPair https://bugs.webkit.org/show_bug.cgi?id=189276 Reviewed by Antti Koivisto. * layout/FormattingContext.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): 2018-09-04 Youenn Fablet Disable WebRTC unified plan runtime flag by default https://bugs.webkit.org/show_bug.cgi?id=189264 Reviewed by Jer Noble. Covered by existing tests. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Activate unified plan for testing. 2018-09-04 Zalan Bujtas [LFC][BFC] Merge computeInFlowWidth(Height)AndMargin and computeFloatingWidth(Height)AndMargin. https://bugs.webkit.org/show_bug.cgi?id=189271 Reviewed by Antti Koivisto. This is in preparation for adding min/max-widht(height). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const): Deleted. (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const): Deleted. * layout/FormattingContext.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): Deleted. (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const): Deleted. * layout/blockformatting/BlockFormattingContext.h: 2018-09-04 Rob Buis Adjust XMLHttpRequest username/password precedence rules https://bugs.webkit.org/show_bug.cgi?id=184910 Reviewed by Chris Dumez. Steps 9.1 and 9.2 in the XMLHTTPRequest::open [1] algorithm specify that non null user or non null password ought to be set on the URL, so implement this. Behavior matches Firefox and Chrome. [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open Test: xhr/send-authentication-competing-names-passwords.htm * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): 2018-09-04 Simon Fraser Simplify RenderLayer filter code https://bugs.webkit.org/show_bug.cgi?id=189248 Reviewed by Dean Jackson. Painting filters in RenderLayer involved the confusingly named RenderLayer::FilterInfo, and FilterEffectRenderer/FilterEffectRendererHelper. Reduce confusion by just collapsing these together into RenderLayerFilters. RenderLayerFilters stores a reference to the CSSFilter, and knows how to set it up, and vend a GraphicsContext* for painting the content to be filtered. It's also simpler to just give RenderLayer a member variable for RenderLayerFilters, rather than using a side hash (we can recoup the space in other ways layer). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSFilterImageValue.cpp: * rendering/CSSFilter.h: * rendering/FilterEffectRenderer.cpp: Removed. * rendering/FilterEffectRenderer.h: Removed. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::~RenderLayer): (WebCore::RenderLayer::paintsWithFilters const): (WebCore::RenderLayer::requiresFullLayerImageForFilters const): (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect): (WebCore::RenderLayer::filtersForPainting const): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::applyFilters): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::calculateClipRects const): (WebCore::RenderLayer::filter const): Deleted. (WebCore::RenderLayer::filterPainter const): Deleted. (WebCore::RenderLayer::hasFilterThatIsPainting const): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerFilterInfo.cpp: Removed. * rendering/RenderLayerFilters.cpp: Added. (WebCore::RenderLayerFilters::RenderLayerFilters): (WebCore::RenderLayerFilters::~RenderLayerFilters): (WebCore::RenderLayerFilters::setFilter): (WebCore::RenderLayerFilters::hasFilterThatMovesPixels const): (WebCore::RenderLayerFilters::hasFilterThatShouldBeRestrictedBySecurityOrigin const): (WebCore::RenderLayerFilters::notifyFinished): (WebCore::RenderLayerFilters::updateReferenceFilterClients): (WebCore::RenderLayerFilters::removeReferenceFilterClients): (WebCore::RenderLayerFilters::buildFilter): (WebCore::RenderLayerFilters::beginFilterEffect): (WebCore::RenderLayerFilters::applyFilterEffect): * rendering/RenderLayerFilters.h: Renamed from Source/WebCore/rendering/RenderLayerFilterInfo.h. 2018-09-04 Dean Jackson Build fix. * testing/Internals.cpp: 2018-09-03 Dean Jackson Move SystemPreview code from WebKitAdditions to WebKit https://bugs.webkit.org/show_bug.cgi?id=189252 Reviewed by Wenson Hsieh. Move the WebKitAdditions code into WebKit/WebCore. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::relList const): Look for "ar". (WebCore::HTMLAnchorElement::isSystemPreviewLink const): Ditto. * platform/MIMETypeRegistry.cpp: Add a couple of new static methods for System Preview MIME types. (WebCore::initializeSystemPreviewMIMETypes): (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): * platform/MIMETypeRegistry.h: * rendering/RenderThemeIOS.mm: Load the ARKit artwork from the framework. (WebCore::arKitBundle): (WebCore::loadARKitPDFPage): (WebCore::systemPreviewLogo): (WebCore::RenderThemeIOS::paintSystemPreviewBadge): * testing/Internals.cpp: Remove internal helper. (WebCore::Internals::systemPreviewRelType): Deleted. * testing/Internals.h: * testing/Internals.idl: 2018-09-04 Andy Estes [Payment Request] PaymentResponse should have an onpayerdetailchange event handler https://bugs.webkit.org/show_bug.cgi?id=189249 Reviewed by Alex Christensen. Implemented the onpayerdetailchange event handler as defined in the Payment Request API W3C Editor's Draft of 30 August 2018. The "payer detail changed" algorithm will be implemented in a follow-up patch. Covered by existing web platform tests. * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::scriptExecutionContext const): * Modules/paymentrequest/PaymentResponse.h: * Modules/paymentrequest/PaymentResponse.idl: * dom/EventNames.h: * dom/EventTargetFactory.in: 2018-09-04 Youenn Fablet Introduce LibWebRTC backends for sender and receiver https://bugs.webkit.org/show_bug.cgi?id=189171 Reviewed by Alejandro G. Castro. Rename RTCRtpSender::Backend to RTCRtpSenderBackend, ditto for RTCRtpReceiver::Backend. Make RTCRtpSender/RTCRtpReceiver own their backend. This will allow the backends to own a libwebrtc sender/receiver ref counted object and might allow us to cleanly separate code from unified plan vs plan B. Update code so that libwebrtc code specific code is now creating senders and receivers. This moves code from RTCPeerConnection down to LibWebRTCPeerConnectionBackend, in particular for addTrack and addTransceiver methods. Moved some code from LibWebRTCMediaEndpoint to LibWebRTCUtils to ease readability. A future patch will allow to tie the libwebrtc sender/receiver to WebKit DOM sender/receiver. Covered by existing tests. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addTrack): (WebCore::PeerConnectionBackend::addTransceiver): * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::addTransceiver): (WebCore::RTCPeerConnection::enqueueReplaceTrackTask): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCRtpReceiver.cpp: (WebCore::RTCRtpReceiver::RTCRtpReceiver): * Modules/mediastream/RTCRtpReceiver.h: (WebCore::RTCRtpReceiver::create): (WebCore::RTCRtpReceiver::setBackend): * Modules/mediastream/RTCRtpReceiverBackend.h: Added. (WebCore::RTCRtpReceiverBackend::getParameters): * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::create): (WebCore::RTCRtpSender::RTCRtpSender): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSenderBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver): (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: Added. (WebCore::LibWebRTCRtpReceiverBackend::getParameters): * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: Added. (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): (WebCore::LibWebRTCRtpSenderBackend::getParameters const): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added. (WebCore::fillEncodingParameters): (WebCore::fillHeaderExtensionParameters): (WebCore::fillCodecParameters): (WebCore::fillRtpParameters): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: Added. (WebCore::fromStdString): * WebCore.xcodeproj/project.pbxproj: 2018-09-04 Antoine Quint [Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an empty top left container https://bugs.webkit.org/show_bug.cgi?id=189259 Reviewed by Dean Jackson. Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html Ensure the top left controls bar is hidden when none of its children are visible. * Modules/modern-media-controls/controls/inline-media-controls.js: (InlineMediaControls.prototype.layout): 2018-09-04 Daniel Bates Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925) An inline text box that does not have combined text and contains a single character should be considered as having text content. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::hasTextContent const): 2018-09-04 Per Arne Vollan Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922 https://bugs.webkit.org/show_bug.cgi?id=187925 Reviewed by Simon Fraser. This will test that the function primaryScreenDisplayID() returns a valid display ID. Test: fast/misc/valid-primary-screen-displayID.html * platform/PlatformScreen.h: * platform/mac/PlatformScreenMac.mm: (WebCore::primaryScreenDisplayID): * testing/Internals.cpp: (WebCore::Internals::primaryScreenDisplayID): * testing/Internals.h: * testing/Internals.idl: 2018-09-04 Daniel Bates Add helper function to create a potential CORS request https://bugs.webkit.org/show_bug.cgi?id=189251 Reviewed by Andy Estes. Add a new function, createPotentialAccessControlRequest, that we will use to implement the algorithm Create a potential- CORS request from the HTML standard: (31 August 2018). This function replaces CachedResourceRequest::setAsPotentiallyCrossOrigin() and is the first step towards separating the concepts of CORS settings states and module script credentials mode as well as implementing the aforementioned algorithm. Rename CachedResourceRequest::setAsPotentiallyCrossOrigin() to deprecatedSetAsPotentiallyCrossOrigin() and switch existing callers to use createPotentialAccessControlRequest(). For now, createPotentialAccessControlRequest() is implemented in terms of deprecatedSetAsPotentiallyCrossOrigin(). No functionality changed. So, no new tests. * bindings/js/CachedScriptFetcher.cpp: (WebCore::CachedScriptFetcher::requestScriptWithCache const): Write in terms of WebCore::createPotentialAccessControlRequest(). * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): Ditto. * html/parser/HTMLResourcePreloader.cpp: (WebCore::PreloadRequest::resourceRequest): Ditto. * loader/CrossOriginAccessControl.cpp: (WebCore::createPotentialAccessControlRequest): For now, implemented in terms of CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin(). * loader/CrossOriginAccessControl.h: * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): Write in terms of WebCore::createPotentialAccessControlRequest(). * loader/LinkLoader.cpp: (WebCore::LinkLoader::preloadIfNeeded): Ditto. * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): Ditto. Also renamed local variable cacheRequest to cachedRequest. * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): Write in terms of WebCore::createPotentialAccessControlRequest(). Also change local variable document from a pointer to a reference since this function asserts that the script execution context is a non-null Document. * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin): Renamed; formerly named setAsPotentiallyCrossOrigin. (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Deleted. * loader/cache/CachedResourceRequest.h: (WebCore::CachedResourceRequest::setPriority): Added. 2018-09-04 Daniel Bates Remove redundant inline text boxes for empty combined text https://bugs.webkit.org/show_bug.cgi?id=189119 Reviewed by Zalan Bujtas. We should consider inline text boxes that have a combined text renderer (RenderCombineText) whose composed string is empty as "redundant" just as we do for inline text boxes that have a non-combined text renderer that have zero length so that we remove them. Such boxes are visibly empty and do not take up space visually. By removing them we reduce memory and make it easier to reason about the line box tree. Currently RenderBlockFlow::computeBlockDirectionPositionsForLine() tests if an inline text box is empty by checking if it has a zero length (InlineTextBox::len()). However an inline text box associated with a RenderCombineText always has length 1 regardless of whether the composed string it represents is the empty string. Instead we should expose a way to check if an inline text box is visually empty and have RenderBlockFlow::computeBlockDirectionPositionsForLine() query the inline text box for this answer. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::hasTextContent const): Added. Returns whether an inline text box has text content. We do not need to consider hypenation since hypens are an embellishment (i.e. they are not part of the markup of the page). (WebCore::InlineTextBox::paint): Write in terms of hasTextContent(). (WebCore::InlineTextBox::subdivideAndResolveStyle): Assert that WebCore::subdivide() always returns a non-empty list of subdivisions. A non-empty text box should always have at least one subdivision, say for the unmarked text. I left the existing conditonal (though marked it as UNLIKELY()) so as to be forgiving and avoid a bad user experience should WebCore::subdivide() return an empty vector in a non-debug build. * rendering/InlineTextBox.h: * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): Write in terms of InlineTextBox::hasTextContent() so that we remove empty inline text boxes associated with combined text. * rendering/RenderText.cpp: (WebCore::RenderText::positionLineBox): Write in terms of InlineTextBox::hasTextContent(). 2018-09-04 Zan Dobersek and Ms2ger Implement support for passing ImageBitmap to texImage2D/texSubImage2D https://bugs.webkit.org/show_bug.cgi?id=187584 Reviewed by Dean Jackson. Test: fast/canvas/webgl/gl-teximage-imagebitmap.html * html/canvas/WebGL2RenderingContext.h: Update union type definition. * html/canvas/WebGL2RenderingContext.idl: Update union type definition. * html/canvas/WebGLRenderingContext.idl: Update union type definition. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texSubImage2D): implement. (WebCore::WebGLRenderingContextBase::texImage2D): implement. * html/canvas/WebGLRenderingContextBase.h: Update union type definition; add to TexFuncValidationSourceType. * html/canvas/WebGLRenderingContextBase.idl: Remove unused union type definition. 2018-09-04 Yacine Bandou [EME] Add the WebM initData support in ClearKey CDM https://bugs.webkit.org/show_bug.cgi?id=189240 Reviewed by Xabier Rodriguez-Calvar. Add the "webm" initDataType support in ClearKey CDM. Read the WebM initData by following the W3C spec https://www.w3.org/TR/eme-initdata-webm/#common-system, and put it in JSON object format like is specified in https://www.w3.org/TR/encrypted-media/#clear-key-request-format. Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-event-mse.html media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::extractKeyIdFromWebMInitData): (WebCore::CDMPrivateClearKey::supportsInitDataType const): (WebCore::CDMPrivateClearKey::supportsInitData const): (WebCore::CDMInstanceClearKey::requestLicense): 2018-09-03 Andy Estes [Payment Request] Remove PaymentAddress.languageCode https://bugs.webkit.org/show_bug.cgi?id=189254 Reviewed by Sam Weinig. PaymentAddress.languageCode is marked as "at risk" in the latest Payment Request Editor's Draft (30 August 2018). Firefox has already removed it, and Chrome is considering it. There is some compatibility risk in removing this attribute, but considering we never populated it with a meaningful value, the risk seems very low. If we learn about compatibility problems, we can address them by evangelising or even reverting this change. Updated existing tests. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::convert): * Modules/paymentrequest/PaymentAddress.cpp: (WebCore::PaymentAddress::PaymentAddress): * Modules/paymentrequest/PaymentAddress.h: * Modules/paymentrequest/PaymentAddress.idl: 2018-09-03 Andy Estes [Payment Request] Add a stub for PaymentResponse.retry https://bugs.webkit.org/show_bug.cgi?id=189253 Reviewed by Sam Weinig. Implemented the AddressErrors, PayerErrorFields, and PaymentValidationErrors dictionaries as defined in the Payment Request API W3C Editor's Draft of 30 August 2018. Also added a stub implementation of PaymentResponse.retry. This method will be implemented with tests in a follow-up patch. * CMakeLists.txt: * DerivedSources.make: * Modules/paymentrequest/AddressErrors.h: Added. * Modules/paymentrequest/AddressErrors.idl: Added. * Modules/paymentrequest/PayerErrorFields.h: Added. * Modules/paymentrequest/PayerErrorFields.idl: Added. * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::retry): * Modules/paymentrequest/PaymentResponse.h: * Modules/paymentrequest/PaymentResponse.idl: * Modules/paymentrequest/PaymentValidationErrors.h: Added. * Modules/paymentrequest/PaymentValidationErrors.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-09-03 Andy Estes [Payment Request] MerchantValidationEvent should be enabled by the PaymentRequest setting https://bugs.webkit.org/show_bug.cgi?id=189250 Reviewed by Daniel Bates. * Modules/paymentrequest/MerchantValidationEvent.idl: 2018-09-03 Youenn Fablet REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky https://bugs.webkit.org/show_bug.cgi?id=187658 Reviewed by Alexey Proskuryakov. Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset. This patch moves this state to the topDocument so that it will be reset for every navigation. Covered by existing test being no longer flaky. * dom/Document.h: (WebCore::Document::setAsRunningUserScripts): (WebCore::Document::isRunningUserScripts const): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * page/Page.h: (WebCore::Page::setAsRunningUserScripts): Deleted. (WebCore::Page::isRunningUserScripts const): Deleted. * testing/Internals.cpp: (WebCore::Internals::setAsRunningUserScripts): 2018-09-03 Andy Estes [Payment Request] Implement the MerchantValidationEvent constructor https://bugs.webkit.org/show_bug.cgi?id=189235 Reviewed by Daniel Bates. Implemented the constructor for MerchantValidationEvent as defined in the Payment Request API W3C Editor's Draft of 30 August 2018. Updated the payment-request web platform tests to include MerchantValidationEvent tests. Tests: imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html * CMakeLists.txt: * DerivedSources.make: * 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: Added. * Modules/paymentrequest/MerchantValidationEventInit.idl: Added. * Modules/paymentrequest/PaymentRequest.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2018-09-03 Philippe Normand [GStreamer] elements registration clean-ups https://bugs.webkit.org/show_bug.cgi?id=189192 Reviewed by Xabier Rodriguez-Calvar. Register all our elements from the base player class. This simplifies the MSE player by removing duplicated code. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): (WebCore::registerWebKitGStreamerElements): Deleted. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine): (WebCore::MediaPlayerPrivateGStreamerMSE::load): (WebCore::mimeTypeCache): (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Deleted. (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable): Deleted. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: 2018-09-02 Zalan Bujtas REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value() https://bugs.webkit.org/show_bug.cgi?id=189232 Reviewed by Brent Fulgham. It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value. Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): 2018-09-01 Simon Fraser Rename FilterEffectRenderer to CSSFilter https://bugs.webkit.org/show_bug.cgi?id=189223 Reviewed by Sam Weinig. Filter was subclassed by SVGFilter for SVG, and FilterEffectRenderer for CSS, which was very confusing, especially when the code uses renderer() to get it. Rename FilterEffectRenderer to CSSFilter, and access via filter(). Future cleanup will deal with FilterEffectRendererHelper. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::image): * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: * platform/graphics/filters/Filter.h: (WebCore::Filter::isCSSFilter const): * rendering/CSSFilter.cpp: Copied from Source/WebCore/rendering/FilterEffectRenderer.cpp. (WebCore::endMatrixRow): (WebCore::lastMatrixRow): (WebCore::CSSFilter::create): (WebCore::CSSFilter::CSSFilter): (WebCore::m_sourceGraphic): (WebCore::CSSFilter::inputContext): (WebCore::CSSFilter::buildReferenceFilter): (WebCore::CSSFilter::build): (WebCore::CSSFilter::updateBackingStoreRect): (WebCore::CSSFilter::allocateBackingStoreIfNeeded): (WebCore::CSSFilter::clearIntermediateResults): (WebCore::CSSFilter::apply): (WebCore::CSSFilter::computeSourceImageRectForDirtyRect): (WebCore::CSSFilter::output const): (WebCore::CSSFilter::setSourceImageRect): (WebCore::CSSFilter::setMaxEffectRects): (WebCore::CSSFilter::outputRect const): * rendering/CSSFilter.h: Copied from Source/WebCore/rendering/FilterEffectRenderer.h. (isType): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRendererHelper::prepareFilterEffect): (WebCore::FilterEffectRendererHelper::filterContext const): (WebCore::FilterEffectRendererHelper::beginFilterEffect): (WebCore::FilterEffectRendererHelper::applyFilterEffect): (WebCore::endMatrixRow): Deleted. (WebCore::lastMatrixRow): Deleted. (WebCore::FilterEffectRenderer::FilterEffectRenderer): Deleted. (WebCore::m_sourceGraphic): Deleted. (WebCore::FilterEffectRenderer::create): Deleted. (WebCore::FilterEffectRenderer::inputContext): Deleted. (WebCore::FilterEffectRenderer::buildReferenceFilter): Deleted. (WebCore::FilterEffectRenderer::build): Deleted. (WebCore::FilterEffectRenderer::updateBackingStoreRect): Deleted. (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Deleted. (WebCore::FilterEffectRenderer::clearIntermediateResults): Deleted. (WebCore::FilterEffectRenderer::apply): Deleted. (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect): Deleted. (WebCore::FilterEffectRenderer::output const): Deleted. (WebCore::FilterEffectRenderer::setMaxEffectRects): Deleted. (WebCore::FilterEffectRenderer::outputRect const): Deleted. * rendering/FilterEffectRenderer.h: (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): (WebCore::FilterEffectRenderer::setSourceImageRect): Deleted. * rendering/RenderBlockFlow.cpp: * rendering/RenderFrame.cpp: * rendering/RenderImage.cpp: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::requiresFullLayerImageForFilters const): (WebCore::RenderLayer::filter const): (WebCore::RenderLayer::filterPainter const): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::calculateClipRects const): (WebCore::RenderLayer::filterRenderer const): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayer::FilterInfo::setFilter): (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): (WebCore::RenderLayer::FilterInfo::setRenderer): Deleted. * rendering/RenderLayerFilterInfo.h: * rendering/updating/RenderTreeBuilderBlock.cpp: 2018-09-01 Darin Adler [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently https://bugs.webkit.org/show_bug.cgi?id=189072 Reviewed by Dan Bernstein. * platform/mac/WebCoreNSURLExtras.mm: Include CFNetworkSPI.h and remove a declaration of +[NSURLProtocol _protocolClassForRequest:]. * platform/network/mac/ResourceHandleMac.mm: Remove a declaration of -[NSURLConnection _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:]. (WebCore::ResourceHandle::createNSURLConnection): Add ignore of "-Wdeprecated-declarations" around use of the above method, since it is deprecated. 2018-09-01 Simon Fraser Add some more filter logging https://bugs.webkit.org/show_bug.cgi?id=189221 Reviewed by Anders Carlsson. Add logging in FilterEffect::apply() that shows all the filter rects, and logging that brackets the application of a whole filter chain, for both SVG and CSS filters. * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::apply): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRendererHelper::applyFilterEffect): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::postApplyResource): 2018-08-31 Youenn Fablet Move stats gathering out of LibWebRTCMediaEndpoint https://bugs.webkit.org/show_bug.cgi?id=189180 Reviewed by Alejandro G. Castro. Move stats gathering in LibWebRTCStatsCollector. Make sure that the lambda given to the collector is always called and destroyed from the main thread. This allows capturing the promise here instead of storing it into the peer connection backend. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::getStats): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::getStats): (WebCore::LibWebRTCPeerConnectionBackend::doStop): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: Added. (WebCore::LibWebRTCStatsCollector::LibWebRTCStatsCollector): (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector): (WebCore::fromStdString): (WebCore::fillRTCStats): (WebCore::fillRTCRTPStreamStats): (WebCore::fillInboundRTPStreamStats): (WebCore::fillOutboundRTPStreamStats): (WebCore::fillRTCMediaStreamTrackStats): (WebCore::fillRTCDataChannelStats): (WebCore::iceCandidatePairState): (WebCore::fillRTCIceCandidatePairStats): (WebCore::fillRTCCertificateStats): (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: Added. (WebCore::LibWebRTCStatsCollector::create): * WebCore.xcodeproj/project.pbxproj: 2018-08-31 Jer Noble Compile error in RealtimeOutgoingVideoSource.cpp; unused parameter in libwebrtc header https://bugs.webkit.org/show_bug.cgi?id=189203 Reviewed by Youenn Fablet. If RealtimeOutgoingVideoSource.cpp is compiled alone (non-unified) or if it is the first file compiled in a unified build, there is no pragma set to ignore unused parameter warnings in place. * platform/mediastream/RealtimeOutgoingVideoSource.cpp: 2018-08-31 Wenson Hsieh [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm https://bugs.webkit.org/show_bug.cgi?id=189054 Reviewed by Tim Horton. Remove redundant and unnecessary logic for reading from the pasteboard on iOS. * platform/PlatformPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::stringForType const): This currently grabs a string corresponding to the given type from the first item in the pasteboard. Make stringForType instead call readString with pasteboard item index 0. (WebCore::PlatformPasteboard::count const): (WebCore::PlatformPasteboard::readBuffer const): (WebCore::PlatformPasteboard::readString const): Make readString with "public.url" call readURL. (WebCore::PlatformPasteboard::readURL const): Remove logic for reading URLs from the pasteboard as property lists deserialized from properly lists. This was added in r223195 due to fix a case "when UIPasteboard serializes NSURL as a plist" when grabbing pasteboard data using -valuesForPasteboardType:inItemSet:. However, this case only arises in non-UI applications (i.e. when UIApplicationInitialize() has not been invoked); this is currently exercised by the test CopyURL.ValidURL, but doesn't really correspond to a real-world use case, since all UI applications where a user would be able to paste in a web view already invoke UIApplicationInitialize(). Instead of handling the case where the pasteboard contains a property list that has not been coerced to an NSURL, simply remove the code from PlatformPasteboard::readURL and allow UIKit to perform the coercion when running the test. (WebCore::PlatformPasteboard::count): Deleted. (WebCore::PlatformPasteboard::readBuffer): Deleted. (WebCore::PlatformPasteboard::readString): Deleted. (WebCore::PlatformPasteboard::readURL): Deleted. Mark these functions as `const`. * platform/wpe/PlatformPasteboardWPE.cpp: (WebCore::PlatformPasteboard::readString const): (WebCore::PlatformPasteboard::readString): Deleted. Mark this function as const. 2018-08-31 Jer Noble Compilation error in FormData.cpp: incomplete type 'WebCore::SharedBuffer' https://bugs.webkit.org/show_bug.cgi?id=189207 Reviewed by Youenn Fablet. If FormData.cpp is compiled alone (non-unified) or if it is the first file compiled in a unified build, SharedBuffer.h is not included. * platform/network/FormData.cpp: 2018-08-31 Chris Dumez [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky https://bugs.webkit.org/show_bug.cgi?id=183705 Reviewed by Youenn Fablet. Add internals.serviceWorkerClientIdentifier() utility function so that a layout test can get the service worker client identifier of a document. * testing/Internals.cpp: (WebCore::Internals::serviceWorkerClientIdentifier const): * testing/Internals.h: * testing/Internals.idl: 2018-08-31 John Wilander Storage Access API: Maintain access through same-site navigations https://bugs.webkit.org/show_bug.cgi?id=188564 Reviewed by Alex Christensen. Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html * dom/Document.h: Removed unused member variable m_hasFrameSpecificStorageAccess. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): * loader/FrameLoaderClient.h: 2018-08-31 Youenn Fablet WebAudioBufferList.cpp/.h is named as cocoa/WebAudioBufferList.cpp/.h https://bugs.webkit.org/show_bug.cgi?id=189160 Reviewed by Jer Noble. Add WebAudioBufferList.cpp to unified build. Update XCode project so that the file names are right. No change of behavior. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: 2018-08-31 Chris Dumez Assertion hit in ~CompletionHandler() from ~WebFrame() https://bugs.webkit.org/show_bug.cgi?id=189199 Reviewed by Youenn Fablet. The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame destruction. No new tests, covered by fast/frames/iframe-target.html. * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: 2018-08-31 Zalan Bujtas [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin. https://bugs.webkit.org/show_bug.cgi?id=189193 Reviewed by Antti Koivisto. Use the non-computed margin values to verify correctness. This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float sibling does not prevent collapsing with the parent's top/bottom margin. Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-08-31 Antti Koivisto Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): 2018-08-31 Aditya Keerthi [Datalist][iOS] Add suggestions UI for TextFieldInputTypes https://bugs.webkit.org/show_bug.cgi?id=186714 Reviewed by Wenson Hsieh. On iOS, the datalist button should appear as a downward triangle. Furthermore, the button should only be displayed if the input has focus and there are suggested values. * css/html.css: (input::-webkit-list-button): Draw the triangle using an SVG. * html/DataListSuggestionInformation.h: * html/HTMLInputElement.h: * html/TextFieldInputType.cpp: Added logic to show and hide the datalist button as necessary. (WebCore::TextFieldInputType::handleFocusEvent): (WebCore::TextFieldInputType::handleBlurEvent): (WebCore::TextFieldInputType::didSetValueByUserEdit): (WebCore::TextFieldInputType::listAttributeTargetChanged): (WebCore::TextFieldInputType::displaySuggestions): 2018-08-31 Youenn Fablet Move LibWebRTCMediaEndpoint data channel code to LibWebRTCDataChannelHandler https://bugs.webkit.org/show_bug.cgi?id=189182 Reviewed by Alejandro G. Castro. Moving data channel code outside of LibWebRTCMediaEndpoint. This will allow future development to support unified plan. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::fromRTCDataChannelInit): (WebCore::LibWebRTCDataChannelHandler::channelEvent): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::createDataChannel): (WebCore::LibWebRTCMediaEndpoint::OnDataChannel): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: 2018-08-31 Youenn Fablet Move session observers outside LibWebRTCMediaEndpoint https://bugs.webkit.org/show_bug.cgi?id=189181 Reviewed by Alejandro G. Castro. Move classes of LibWebRTCMediaEndpoint to a separate file. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: Added. * WebCore.xcodeproj/project.pbxproj: 2018-08-31 Eric Carlson [MediaStream] Remove AVMediaCaptureSource https://bugs.webkit.org/show_bug.cgi?id=189159 Reviewed by Youenn Fablet. No new tests, no change in functionality. Refactor video capture to get rid of a base class we don't need any more. * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/mac/AVMediaCaptureSource.h: Removed. * platform/mediastream/mac/AVMediaCaptureSource.mm: Removed. * platform/mediastream/mac/AVVideoCaptureSource.h: (WebCore::AVVideoCaptureSource::session const): (WebCore::AVVideoCaptureSource::device const): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::globaVideoCaptureSerialQueue): (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::startProducingData): (WebCore::AVVideoCaptureSource::stopProducingData): (WebCore::AVVideoCaptureSource::beginConfiguration): (WebCore::AVVideoCaptureSource::commitConfiguration): (WebCore::AVVideoCaptureSource::settingsDidChange): (WebCore::AVVideoCaptureSource::settings const): (WebCore::AVVideoCaptureSource::capabilities const): (WebCore::AVVideoCaptureSource::setPreset): (WebCore::AVVideoCaptureSource::setupSession): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange): (WebCore::AVVideoCaptureSource::interrupted const): (WebCore::AVVideoCaptureSource::captureSessionRuntimeError): (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption): (WebCore::AVVideoCaptureSource::captureSessionEndInterruption): (-[WebCoreAVVideoCaptureSourceObserver initWithCallback:]): (-[WebCoreAVVideoCaptureSourceObserver disconnect]): (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]): (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]): (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]): (WebCore::AVVideoCaptureSource::initializeCapabilities): Deleted. (WebCore::AVVideoCaptureSource::initializeSupportedConstraints): Deleted. (WebCore::AVVideoCaptureSource::updateSettings): Deleted. 2018-08-31 Philippe Normand Unreviewed, GTK Ubuntu LTS build fix after r235543. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 2018-08-31 Philippe Normand Unreviewed, fix compilation warning in EME GStreamer backend. Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:1293:19: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘unsigned int’ [-Wformat=] * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): 2018-08-31 Philippe Normand [GStreamer][GL] useless ifdef in pushTextureToCompositor https://bugs.webkit.org/show_bug.cgi?id=188552 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): There's no need for an ifdef because the frame holder already ensures a valid texture ID will be set if it maps a GL video frame. 2018-08-31 David Kilzer REGRESSION (r235190): Fix name of WebAudioBufferList.{cpp,h} in Xcode project * WebCore.xcodeproj/project.pbxproj: - Add the 'name' parameter to the file references, then fix the visual name everywhere else, so these files don't appear as "cocoa/WebAudioBufferList.{cpp,h}" in the project. 2018-08-31 Frederic Wang Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement https://bugs.webkit.org/show_bug.cgi?id=182053 Reviewed by Simon Fraser. This commit introduces a new CSSOMViewScrollingAPIEnabled flag that will be used to implement the standard behavior of DOM scroll* API as specified by the CSSOM View spec (see bug 5991). It changes the behavior of document.scrollingElement so that it follows the spec when the flag is enabled. This will allow to pass the WPT test cssom-view/scrollingElement.html when it becomes the default behavior. WPT tests cssom-view/scrollingElement-quirks-dynamic*.html still fail; comparing with Chromium's code, we might need to propagate the style of and to the viewport element. Behaviors for other scrolling attributes will be changed in follow-up bugs. Tests: fast/dom/Document/scrollingElement-quirks-mode.html fast/dom/Document/scrollingElement-standard-mode.html * dom/Document.cpp: (WebCore::Document::isBodyPotentiallyScrollable): Helper function to verify whether the body is potentially scrollable, as defined by the CSSOM View spec. It seems that RenderObject::hasOverflowClip() may return incorrect value at this point and we might need to do something similar to Chromium's style propagation to make it work. For now, we just use the computed style. See bug 182292. (WebCore::Document::scrollingElement): When CSSOMViewScrollingAPIEnabled is enabled, we implement the algorithm of the CSSOM View spec. (WebCore::Document::body const): Verify that the root is actually a element or otherwise return null. This is required by the CSSOM View spec and for WPT test scrollingElement.html. It is consistent with bodyOrFrameset(). * dom/Document.h: Add spec references for body() and bodyOrFrameset() and declare isBodyPotentiallyScrollable(). * page/Settings.yaml: Add developer option for enabling the CSSOM View behavior. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::isOverflowVisible const): Add helper function to check whether the style implies visible overflow. 2018-08-30 Zalan Bujtas CounterMaps should hold a unique_ptr of CounterMap. https://bugs.webkit.org/show_bug.cgi?id=189174 Reviewed by Ryosuke Niwa. In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object. Test: fast/css/counters/crash-when-cloning-body.html * rendering/RenderCounter.cpp: (WebCore::makeCounterNode): (WebCore::destroyCounterNodeWithoutMapRemoval): (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (showCounterRendererTree): 2018-08-30 Ross Kirsling Speculative build fix for WPE after r235531. * platform/graphics/filters/PointLightSource.cpp: Add missing include. 2018-08-30 Ryosuke Niwa Add assignedElements to HTMLSlotElement https://bugs.webkit.org/show_bug.cgi?id=189146 Reviewed by Darin Adler. Added assignedElements to HTMLSlotElement. For now, we simply filter the results returned by assignedNodes. Also fixed a bug that assignedNodes was returning the fallback content when the slot is not in a shadow tree, which is specified in step 2 of the concept to find flattened slotables for a slot. Spec: https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements https://dom.spec.whatwg.org/#find-flattened-slotables Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html * html/HTMLSlotElement.cpp: (WebCore::flattenAssignedNodes): Updated to take Vector> for consistency. (WebCore::HTMLSlotElement::assignedNodes const): Ditto. (WebCore::HTMLSlotElement::assignedElements const): * html/HTMLSlotElement.h: * html/HTMLSlotElement.idl: 2018-08-30 Don Olmstead [CMake] Replace AVFoundationSupport.py using CMake https://bugs.webkit.org/show_bug.cgi?id=182891 Reviewed by Per Arne Vollan. No new tests. No change in behavior. Remove refernces to PAL derived sources. * PlatformWin.cmake: * config.h: 2018-08-30 Olivia Barnett REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share https://bugs.webkit.org/show_bug.cgi?id=189170 Reviewed by Tim Horton. No new tests; fixing a failing existing test. * page/Navigator.cpp: (WebCore::Navigator::share): Added null check for frame. 2018-08-30 Truitt Savell Unreviewed, rolling out r235516. Caused 50 Crashes on Sierra Reverted changeset: "The width of a nullptr TextRun should be zero" https://bugs.webkit.org/show_bug.cgi?id=189154 https://trac.webkit.org/changeset/235516 2018-08-30 Tim Horton Bundle unified sources more tightly in projects with deep directory structures https://bugs.webkit.org/show_bug.cgi?id=189009 Reviewed by Simon Fraser. Fix a variety of unification errors due to reshuffling the bundles. * Modules/mediastream/RTCController.cpp: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: (WebCore::CryptoAlgorithmECDSA::importKey): * dom/Document.h: * html/parser/HTMLTreeBuilder.cpp: * loader/appcache/ApplicationCacheResourceLoader.h: * page/AlternativeTextClient.h: * platform/Pasteboard.h: * platform/graphics/DisplayRefreshMonitor.cpp: * platform/graphics/FontFamilySpecificationNull.cpp: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithGraphicsContext3D:]): (-[WebGLLayer copyImageSnapshotWithColorSpace:]): (-[WebGLLayer display]): (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): * platform/graphics/cocoa/WebGPULayer.mm: (-[WebGPULayer initWithGPUDevice:]): * platform/graphics/metal/GPUCommandQueueMetal.mm: * platform/mac/PasteboardMac.mm: * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: * platform/network/ResourceRequestBase.cpp: * rendering/updating/RenderTreeBuilderBlockFlow.cpp: * rendering/updating/RenderTreeBuilderInline.cpp: 2018-08-30 Andy Estes [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces https://bugs.webkit.org/show_bug.cgi?id=189100 Reviewed by Daniel Bates. Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary defined in the Payment Request API W3C Editor's Draft of 30 August 2018. The "payment method changed" algorithm will be implemented in a follow-up. Covered by existing web platform tests. * CMakeLists.txt: * DerivedSources.make: * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added. (WebCore::PaymentMethodChangeEvent::eventInterface const): (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent): * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added. * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added. * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added. * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added. * Modules/paymentrequest/PaymentRequest.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent): * Modules/paymentrequest/PaymentRequestUpdateEvent.h: * Modules/paymentrequest/PaymentRequestUpdateEventInit.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.h: * dom/EventNames.in: 2018-08-30 Brent Fulgham The width of a nullptr TextRun should be zero https://bugs.webkit.org/show_bug.cgi?id=189154 Reviewed by Zalan Bujtas. If a page has an empty TextRun and attempts to paint it we can crash with a nullptr. This patch recognizes that an empty TextRun should always produce a zero width, rather than attempt to compute this value from font data. Test: fast/text/null-string-textrun.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width. (WebCore::FontCascade::width const): Ditto. (WebCore::FontCascade::codePath const): ASSERT that the TextRun is non-empty. 2018-08-30 Eric Carlson Mock video devices should only support discrete sizes https://bugs.webkit.org/show_bug.cgi?id=189000 Reviewed by Youenn Fablet. While many/most video capture devices only support a finite number of discrete width/height pairs, our mock video capture devices supported arbitrary width and height combinations which made it difficult to write realistic tests using them. Change the mock devices to support finite "presets" like those supported by AVFoundation. Create a RealtimeVideoSource base class with support for these presets, so the same code will eventually be used by the mock and real capture devices. No new tests, existing tests updated for these changes. * Sources.txt: Add RealtimeVideoSource.cpp, remove MockRealtimeMediaSource.cpp. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/mediastream/MediaConstraints.h: Deal with min constraint less than the supported minimum and max larger than the supported maximum when there is no ideal. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::selectSettings): Use supportsSizeAndFrameRate for widths, heights, and framerates in advanced constraints so a width and height that are supported but in the same preset are filtered out. (WebCore::RealtimeMediaSource::setSize): New. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceSettings.h: Remove an unneeded include. * platform/mediastream/RealtimeVideoSource.cpp: Added. (WebCore::RealtimeVideoSource::RealtimeVideoSource): (WebCore::RealtimeVideoSource::~RealtimeVideoSource): (WebCore::RealtimeVideoSource::startProducingData): (WebCore::RealtimeVideoSource::setSupportedFrameRates): (WebCore::RealtimeVideoSource::addSupportedCapabilities const): (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate): (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight): (WebCore::RealtimeVideoSource::applySize): (WebCore::RealtimeVideoSource::applySizeAndFrameRate): (WebCore::RealtimeVideoSource::videoSampleAvailable): (WebCore::RealtimeVideoSource::applyFrameRate): (WebCore::RealtimeVideoSource::supportsFrameRate): * platform/mediastream/RealtimeVideoSource.h: Copied from Source/WebCore/platform/mock/MockRealtimeAudioSource.h. (WebCore::RealtimeVideoSource::setSupportedCaptureSizes): (WebCore::RealtimeVideoSource::setDefaultSize): (WebCore::RealtimeVideoSource::observedFrameRate const): * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::initializeSettings): Don't set label, it isn't used. * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::applySize): Call the base class. * platform/mock/MockMediaDevice.h: (WebCore::MockCameraProperties::encode const): Add frame rates, sizes, and facing mode. (WebCore::MockCameraProperties::decode): Ditto. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): No more MockRealtimeMediaSource. (WebCore::MockRealtimeAudioSource::settings const): Clean up. (WebCore::MockRealtimeAudioSource::capabilities const): Ditto. (WebCore::MockRealtimeAudioSource::settingsDidChange): Ditto. (WebCore::MockRealtimeAudioSource::stopProducingData): m_elapsedTime isn't used, delete it. (WebCore::MockRealtimeAudioSource::updateSettings): Deleted. (WebCore::MockRealtimeAudioSource::initializeCapabilities): Deleted. (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Deleted. (WebCore::MockRealtimeAudioSource::elapsedTime): Deleted. * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: Moved all of the mock device management code from MockRealtimeMediaSource.cpp here. (WebCore::defaultDevices): (WebCore::devices): (WebCore::deviceMap): (WebCore::deviceListForDevice): (WebCore::createCaptureDevice): (WebCore::MockRealtimeMediaSourceCenter::resetDevices): (WebCore::MockRealtimeMediaSourceCenter::setDevices): (WebCore::MockRealtimeMediaSourceCenter::addDevice): (WebCore::MockRealtimeMediaSourceCenter::removeDevice): (WebCore::MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID): (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID): (WebCore::MockRealtimeMediaSourceCenter::audioDevices): (WebCore::MockRealtimeMediaSourceCenter::videoDevices): (WebCore::MockRealtimeMediaSourceCenter::displayDevices): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Use RealtimeVideoSource, no more MockRealtimeMediaSource. (WebCore::MockRealtimeVideoSource::capabilities const): Ditto, cleanup. (WebCore::MockRealtimeVideoSource::settings const): Ditto. (WebCore::MockRealtimeVideoSource::settingsDidChange): Ditto. (WebCore::MockRealtimeVideoSource::startCaptureTimer): Ditto. (WebCore::MockRealtimeVideoSource::startProducingData): Ditto. (WebCore::MockRealtimeVideoSource::stopProducingData): Ditto. (WebCore::MockRealtimeVideoSource::elapsedTime): Ditto. (WebCore::MockRealtimeVideoSource::applySize): Ditto. (WebCore::MockRealtimeVideoSource::drawText): Render the actual frame rate. (WebCore::MockRealtimeVideoSource::generateFrame): Use m_fillColor. (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. (WebCore::MockRealtimeVideoSource::updateSettings): Deleted. (WebCore::MockRealtimeVideoSource::initializeCapabilities): Deleted. (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Deleted. (WebCore::MockRealtimeVideoSource::applyFrameRate): Deleted. * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Deleted. 2018-08-30 Zalan Bujtas [LFC][Floating] Block formatting context roots avoid floats. https://bugs.webkit.org/show_bug.cgi?id=189150 Reviewed by Antti Koivisto. This patch implements the float avoiding behaviour for block formatting context roots. When a box establishes a block formatting context, floats from outside of the context can't interfere with content inside. In order to achive this, such formatting root boxes need to be positioned so that they don't overlap with floats (floats that share the same context with the formatting root). In ltr block direction, roots start with avoiding floats on the left, while in rtl on the right. Tests: fast/block/block-only/float-avoider-multiple-roots.html fast/block/block-only/float-avoider-simple-left.html fast/block/block-only/float-avoider-simple-right.html fast/block/block-only/float-avoider-with-margins.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): * layout/blockformatting/BlockFormattingContext.h: * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): * layout/floats/FloatingContext.h: 2018-08-30 Zalan Bujtas [LFC][Floating] Move containing block constraint logic from FloatAvoider to FloatingContext https://bugs.webkit.org/show_bug.cgi?id=189145 Reviewed by Antti Koivisto. When the float avoider is constrained horizontally, simply align it with the left/right edge of its containing block (with the combination of the constraints) and check the overflow as part of the FloatingContext::floatingPosition() logic. It simplifies the constraint logic/helps implementing the non-float avoider case. * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::overflowsContainingBlock const): * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::floatingPosition const): 2018-08-30 Zalan Bujtas [LFC][Floating] Use non-computed horizontal margins when intersecting floats with float avoiders. https://bugs.webkit.org/show_bug.cgi?id=189143 Reviewed by Antti Koivisto. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::marginTop const): (WebCore::Layout::FloatAvoider::marginBottom const): (WebCore::Layout::FloatAvoider::marginLeft const): (WebCore::Layout::FloatAvoider::marginRight const): (WebCore::Layout::FloatAvoider::marginBoxWidth const): * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::rect const): (WebCore::Layout::FloatBox::horizontalPositionCandidate): (WebCore::Layout::FloatBox::verticalPositionCandidate): (WebCore::Layout::FloatBox::initialVerticalPosition const): * layout/floats/FloatBox.h: 2018-08-30 Zalan Bujtas [LFC][Margins] Add non-computed horizontal margins to DisplayBox https://bugs.webkit.org/show_bug.cgi?id=189141 Reviewed by Antti Koivisto. Inflow block boxes' horizontal margins extend all the way to the left/right edge of their containing block. See https://www.w3.org/TR/CSS22/visudet.html#blockwidth for example "... 10.3.3 Block-level, non-replaced elements in normal flow 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block ..." In certain cases (float avoiding) we need to know the original (non-extended) horiztonal margin values. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const): (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::initializeRoot): * layout/LayoutUnits.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): (WebCore::Display::Box::setHorizontalNonComputedMargin): (WebCore::Display::Box::nonComputedMarginLeft const): (WebCore::Display::Box::nonComputedMarginRight const): 2018-08-30 Yusuke Suzuki Unreviewed, add comments about enum names to bitfields https://bugs.webkit.org/show_bug.cgi?id=188944 * xml/XMLHttpRequest.h: 2018-08-30 Yusuke Suzuki Unreviewed, add comments about enum names to bitfields https://bugs.webkit.org/show_bug.cgi?id=188945 * html/HTMLCollection.h: 2018-08-29 Andy Estes Addressed additional review feedback after r235342. * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): Used '"' instead of "\"" with makeString(). 2018-08-29 Aditya Keerthi [Datalist] Display prefix-matched suggestions first https://bugs.webkit.org/show_bug.cgi?id=189106 Reviewed by Tim Horton. In order to increase suggestion relevancy, we should display suggestions that have the same prefix as the input value first. In order to achieve this, we can place the suggestions into two buckets, one that contains prefix-matched values and another that contains only substring-matched values. TextFieldInputType::suggestions() can be called up to three times before we display the values. In order to avoid generating the same suggestions multiple times, the most recent values can be stored and reused. We clear the cached values whenever the datalist element is modified or when the suggestions view is hidden. Finally, removed logic to de-duplicate the list of suggested values. This behavior is not a part of the specification and leads to unnecessary slowdown when populating the suggestions view. Test: fast/forms/datalist/datalist-textinput-suggestions-order.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::listAttributeTargetChanged): (WebCore::TextFieldInputType::suggestions): (WebCore::TextFieldInputType::didCloseSuggestions): * html/TextFieldInputType.h: * platform/DataListSuggestionsClient.h: 2018-08-29 Olivia Barnett Implement the Web Share API https://bugs.webkit.org/show_bug.cgi?id=171100 Reviewed by Tim Horton. Added one test in fast/events/ios called share.html; adjusted expectations for existing tests. * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * features.json: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::showShareSheet): * loader/EmptyClients.h: Added empty showShareSheet function. * page/Chrome.cpp: (WebCore::Chrome::showShareSheet): * page/Chrome.h: Added call to showShareSheet on client. * page/ChromeClient.h: Virtual showShareSheet function. * page/Navigator.cpp: (WebCore::Navigator::share): * page/Navigator.h: Share function that returns a promise and invokes the share sheet. * page/Navigator.idl: Implements NavigatorShare * page/NavigatorShare.idl: Added. Added definition of share function returning a promise. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Added RuntimeEnabledFeature switch. * page/ShareData.h: Added. * page/ShareData.idl: Added. Definition of ShareData struct. 2018-08-29 Daniel Bates REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany https://bugs.webkit.org/show_bug.cgi?id=184390 And Reviewed by Simon Fraser. Speculative fix for Epiphany. In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide() such that it returns an empty vector. One way this can happen is when subdividing an empty inline text box associated with combined text (RenderCombineText). For now we add a check to bail out of resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions. Test: fast/text/text-combine-surroundContents-crash.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::subdivideAndResolveStyle): 2018-08-29 Youenn Fablet Remove WebRTC legacy API implementation https://bugs.webkit.org/show_bug.cgi?id=189040 Reviewed by Eric Carlson. This API is no longer needed as the runtime flag is off by default. Removing this option allows removing some code and will ease future WebRTC improvements. Covered by existing tests. * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/MediaStreamEvent.cpp: Removed. * Modules/mediastream/MediaStreamEvent.h: Removed. * Modules/mediastream/MediaStreamEvent.idl: Removed. * Modules/mediastream/NavigatorUserMedia.idl: Removed. * Modules/mediastream/NavigatorUserMedia.js: Removed. * Modules/mediastream/PeerConnectionBackend.cpp: * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnection.js: (initializeRTCPeerConnection): (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getLocalStreams): Deleted. (getStreamById): Deleted. (addStream): Deleted. (): Deleted. * Modules/mediastream/RTCPeerConnectionInternals.js: (callbacksAndDictionaryOverload): (if): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream): (WebCore::LibWebRTCMediaEndpoint::addRemoteStream): (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::doStop): (WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted. (WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): (WebCore::isWebRTCLegacyAPIEnabled): Deleted. * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.in: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled): (WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted. 2018-08-29 Ryosuke Niwa Modernize SlotAssignment https://bugs.webkit.org/show_bug.cgi?id=189075 Reviewed by Antti Koivisto. Modernized the code related to SlotAssignment. Namely, use HashMap<>::get instead of HashMap<>::find, and use HashMap<>::ensure instead of HashMap<>::add. Also use WeakPtr to keep track of HTMLSlotElement instead of a raw pointer. * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::findAssignedSlot): (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::didChangeSlot): (WebCore::SlotAssignment::findFirstSlotElement): (WebCore::SlotAssignment::resolveAllSlotElements): (WebCore::SlotAssignment::assignToSlot): * dom/SlotAssignment.h: (WebCore::SlotAssignment::Slot::Slot): Renamed from SlotInfo since "Info" doesn't add any value. * html/HTMLSlotElement.h: 2018-08-29 Chris Dumez [PSON] We should only process-swap when eTLD+1 changes on navigation https://bugs.webkit.org/show_bug.cgi?id=189090 Reviewed by Geoffrey Garen. Add toRegistrableDomain() utility function to get the eTLD+1 (aka "registrable domain") from an URL. * platform/network/ResourceRequestBase.h: (WebCore::toRegistrableDomain): (WebCore::registrableDomainsAreEqual): 2018-08-29 Youenn Fablet Add a runtime flag for WebRTC unified plan https://bugs.webkit.org/show_bug.cgi?id=189068 Reviewed by Eric Carlson. Covered by existing updated tests. Main change is to call addTrack with a stream parameter so that on the other side, the track will be tied to a stream. Receive-only case in unified plan is not yet supported. This will be supported in follow-up patches. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::setConfiguration): Activate unified plan based on runtime flag. (WebCore::LibWebRTCMediaEndpoint::addTrack): Do not use AddStream in case of unified plan. (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const): (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const): (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): Use legacy webrtc option for receive only cases only in plan B case. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCUnifiedPlanEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCUnifiedPlanEnabled): 2018-08-28 Simon Fraser Fix crash when reflections and backdrop filter are combined https://bugs.webkit.org/show_bug.cgi?id=188504 rdar://problem/43225590 Reviewed by Dan Bates. GraphicsLayerCA::updateBackdropFiltersRect() was confused about which hash map to modify when changes to the clipping rect affect whether we make backdrop clipping layers; we need to add/remove from backdropClippingLayerClones, not backdropLayerClones. Test: compositing/filters/backdrop-filter-update-rect.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateBackdropFiltersRect): 2018-08-29 Jer Noble Muted elements do not have their Now Playing status updated when unmuted. https://bugs.webkit.org/show_bug.cgi?id=189069 Reviewed by Eric Carlson. Schedule an updateNowPlayingInfo() when an element becomes unmuted. * platform/audio/PlatformMediaSessionManager.h: * platform/audio/mac/MediaSessionManagerMac.h: * platform/audio/mac/MediaSessionManagerMac.mm: (WebCore::MediaSessionManagerMac::sessionCanProduceAudioChanged): 2018-08-29 Wenson Hsieh Use the null string instead of std::nullopt for missing attachment file names and content types https://bugs.webkit.org/show_bug.cgi?id=189080 Reviewed by Tim Horton. Replace instances of std::optional with just String instead, and use the null string to represent a missing value instead of std::nullopt. No change in behavior. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateAttributes): * html/HTMLAttachmentElement.h: 2018-08-29 David Kilzer Remove empty directories from from svn.webkit.org repository * Modules/proximity: Removed. 2018-08-28 Zalan Bujtas [LFC][Floating] Introduce FloatBox, a FloatAvoider subclass. https://bugs.webkit.org/show_bug.cgi?id=189074 Reviewed by Antti Koivisto. FloatBox is a float avoider and a float positioned box as well. This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/displaytree/DisplayBox.h: * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::setVerticalConstraint): (WebCore::Layout::FloatAvoider::horizontalPositionCandidate): (WebCore::Layout::FloatAvoider::verticalPositionCandidate): (WebCore::Layout::FloatAvoider::resetPosition): (WebCore::Layout::FloatAvoider::rectInContainingBlock const): (WebCore::Layout::FloatAvoider::initializePosition): Deleted. (WebCore::Layout::FloatAvoider::isLeftAligned const): Deleted. (WebCore::Layout::FloatAvoider::rect const): Deleted. (WebCore::Layout::FloatAvoider::resetHorizontalConstraints): Deleted. (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted. * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::rect const): (WebCore::Layout::FloatAvoider::isLeftAligned const): (WebCore::Layout::FloatAvoider::initialVerticalPosition const): (WebCore::Layout::FloatAvoider::floatingState const): (WebCore::Layout::FloatAvoider::layoutBox const): (WebCore::Layout::FloatAvoider::displayBox const): * layout/floats/FloatBox.cpp: Copied from Source/WebCore/layout/floats/FloatAvoider.h. (WebCore::Layout::FloatBox::FloatBox): (WebCore::Layout::FloatBox::horizontalPositionCandidate): (WebCore::Layout::FloatBox::verticalPositionCandidate): (WebCore::Layout::FloatBox::initialVerticalPosition const): * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatAvoider.h. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::floatingPosition const): 2018-08-29 Ali Juma [IntersectionObserver] Implement intersection logic for the same-document implicit root case https://bugs.webkit.org/show_bug.cgi?id=189055 Reviewed by Simon Fraser. Extend the intersection logic to handle computing the intersection of the target and the viewport, for the case where the target is in the main frame. Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer. * dom/Document.cpp: (WebCore::computeIntersectionRects): (WebCore::Document::updateIntersectionObservations): 2018-08-28 Ryosuke Niwa Changes to slot children should trigger slotchange https://bugs.webkit.org/show_bug.cgi?id=169718 Reviewed by Darin Adler. Fix the bug that slotchange event is not fired when a slot's fallback content is updated now that slotchange event is more formally specified. This particular behavior corresponds to step 7.5. of the concept *to insert a node* where it says: "[I]f parent’s root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal a slot change for parent." See https://dom.spec.whatwg.org/#concept-node-insert Tests: fast/shadow-dom/slotchange-in-fallback.html imported/w3c/web-platform-tests/shadow-dom/slotchange.html * dom/Element.cpp: (WebCore::Element::childrenChanged): Updated the comment. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::addSlotElementByName): Added an assertion. (WebCore::ShadowRoot::slotFallbackDidChange): Added. * dom/ShadowRoot.h: * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::slotFallbackDidChange): Added. When the assigned nodes is empty, we enqueue a slotchange. Because assignedNodesForSlot invokes assignSlots, this can be O(n) but we don't expect mutating slot's fallback contents and shadow host's children in turn to be a common scenario so this shouldn't be an issue in practice. * dom/SlotAssignment.h: * html/HTMLSlotElement.cpp: (WebCore::HTMLSlotElement::insertedIntoAncestor): Be explicit about auto* being used here. (WebCore::HTMLSlotElement::childrenChanged): Added. Invokes slotFallbackDidChange whenver child node is muated. * html/HTMLSlotElement.h: 2018-08-28 Don Olmstead Check for null renderer in canBeScrolledIntoView https://bugs.webkit.org/show_bug.cgi?id=188935 Reviewed by Simon Fraser. Test: fast/spatial-navigation/snav-display-contents-crash.html * page/SpatialNavigation.cpp: (WebCore::canBeScrolledIntoView): 2018-08-28 Youenn Fablet IDBDatabase should not return true to hasPendingActivity after being stopped https://bugs.webkit.org/show_bug.cgi?id=189073 Reviewed by Darin Adler. There is a chance that IDBDatabase::hasPendingActivity returns true. The case that might happen is when stop() is called but there are still some active/being committed transactions. In that case, hasPendingActivity will return true until these transactions get finalized. While these transactions will probably be finalized at some point, it delays GC for no good reason. And we might want in a follow-up patch to assert that ActiveDOMObject are GC-able whenever their context is stopped. For that purpose, make sure hasPendingActivity returns false when context is stopped. * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::hasPendingActivity const): 2018-08-28 Don Olmstead [CMake] Use CMake's FindFreetype https://bugs.webkit.org/show_bug.cgi?id=189071 Reviewed by Michael Catanzaro. No new tests. No change in behavior. * platform/FreeType.cmake: 2018-08-28 Wenson Hsieh Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm https://bugs.webkit.org/show_bug.cgi?id=189054 Reviewed by Andy Estes. Remove the pasteboard type argument from PlatformPasteboard::readURL(). Currently, we only ever pass it "public.url" anyways; for reading other types of strings, readString() already exists, which takes an arbitrary pasteboard type. * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readPasteboardWebContentDataForType): (WebCore::Pasteboard::readPlatformValueAsString): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::readURL): 2018-08-28 Youenn Fablet MediaDevices should be collectable as soon as its document is stopped https://bugs.webkit.org/show_bug.cgi?id=189021 Reviewed by Eric Carlson. Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped. Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped. Test: http/tests/media/collect-media-devices.https.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::hasPendingActivity const): * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::hasPendingActivity const): (WebCore::ActiveDOMObject::isContextStopped const): * dom/ActiveDOMObject.h: 2018-08-28 Basuke Suzuki [Curl] Fix issue that extra cookie is added when redirect happens. https://bugs.webkit.org/show_bug.cgi?id=187874 Reviewed by Alex Christensen. When initial request has cookie set and redirect happens, it add extra Cookie header to that abd request was broken. Just stop modifying the original request by passing a value. Test: http/tests/cookies/multiple-redirect-and-set-cookie.php * platform/network/ResourceHandle.h: * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::createCurlRequest): 2018-08-28 Aditya Keerthi [macOS] Color wells should appear rounded and textured https://bugs.webkit.org/show_bug.cgi?id=189039 Reviewed by Tim Horton. Color wells should have a rounded and textured appearance on macOS. We can use NSBezelStyleTexturedSquare to achieve this appearance. Also updated the user-agent stylesheet to match the system appearance. Rebaselined existing test: fast/forms/color/input-appearance-color.html * css/html.css: (input[type="color"]::-webkit-color-swatch-wrapper): (input[type="color"]::-webkit-color-swatch): * platform/mac/ThemeMac.mm: (WebCore::setUpButtonCell): * rendering/RenderThemeMac.h: Build fix. 2018-08-28 Youenn Fablet WebKitMediaSession should be GC collectable when its document is being stopped https://bugs.webkit.org/show_bug.cgi?id=189016 Reviewed by Eric Carlson. Make sure WebKitMediaSession is collectable after its document is stopped. This is done by nullifying m_session when calling close. This way hasPendingActivity() returns false when stop() is called. Test: http/tests/media/clearkey/collect-webkit-media-session.html * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: (WebCore::WebKitMediaKeySession::WebKitMediaKeySession): (WebCore::WebKitMediaKeySession::close): * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: 2018-08-28 Ali Juma [IntersectionObserver] Fix build after r235424 https://bugs.webkit.org/show_bug.cgi?id=189051 Rubber-stamped by Simon Fraser. Fix unused variable warning by using the variable. * page/FrameView.cpp: (WebCore::FrameView::viewportContentsChanged): 2018-08-28 Aditya Keerthi [iOS] Support inputmode=none https://bugs.webkit.org/show_bug.cgi?id=188896 Reviewed by Tim Horton. Updated InputMode.cpp to ensure that "none" is recognized as a valid value for the inputmode attribute. This keyword is useful for content that renders its own keyboard control. Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities%3A-the-inputmode-attribute Test: fast/forms/ios/inputmode-none.html * html/InputMode.cpp: (WebCore::inputModeForAttributeValue): (WebCore::stringForInputMode): (WebCore::InputModeNames::none): * html/InputMode.h: 2018-08-28 Ali Juma [IntersectionObserver] Schedule intersection observation updates https://bugs.webkit.org/show_bug.cgi?id=189007 Reviewed by Simon Fraser. Schedule intersection observation updates in the following situations: 1) A new observation target is added. 2) FrameView::viewportContentsChanged -- this covers changes to layout and to scroll positions for same-document observation. Scheduling for cross-document observation will be handled in a future patch. 3) Style is resolved without triggering layout -- this handles updates that were deferred because of a pending style recalculation. Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateIntersectionObservations): (WebCore::Document::scheduleIntersectionObservationUpdate): * dom/Document.h: * page/FrameView.cpp: (WebCore::FrameView::viewportContentsChanged): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::observe): 2018-08-28 Zalan Bujtas [LFC][Floating] Remove redundant FloatAvoider functions. https://bugs.webkit.org/show_bug.cgi?id=189035 Reviewed by Antti Koivisto. and move some code from FloatContext to FloatAvoider. * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::initializePosition): (WebCore::Layout::FloatAvoider::rect const): (WebCore::Layout::FloatAvoider::setVerticalConstraint): (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::resetHorizontalConstraint): (WebCore::Layout::FloatAvoider::initialVerticalPosition const): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): (WebCore::Layout::FloatAvoider::rectInContainingBlock const): (WebCore::Layout::FloatAvoider::setLeft): Deleted. (WebCore::Layout::FloatAvoider::setTopLeft): Deleted. (WebCore::Layout::FloatAvoider::resetVertically): Deleted. (WebCore::Layout::FloatAvoider::resetHorizontally): Deleted. (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): Deleted. * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::top const): Deleted. (WebCore::Layout::FloatAvoider::left const): Deleted. (WebCore::Layout::FloatAvoider::marginTop const): Deleted. (WebCore::Layout::FloatAvoider::marginLeft const): Deleted. (WebCore::Layout::FloatAvoider::marginBottom const): Deleted. (WebCore::Layout::FloatAvoider::marginRight const): Deleted. (WebCore::Layout::FloatAvoider::rectWithMargin const): Deleted. (WebCore::Layout::FloatAvoider::setTop): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::floatingPosition const): (WebCore::Layout::FloatingPair::horizontalConstraints const): (WebCore::Layout::FloatingPair::horiztonalPosition const): Deleted. 2018-08-28 Eric Carlson Revert changes to RealtimeMediaSource.cpp made in r235086 https://bugs.webkit.org/show_bug.cgi?id=189046 Unreviewed, reverting an accidental change. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): 2018-08-28 Alejandro G. Castro Fix gcc compilation warnings after r235230 https://bugs.webkit.org/show_bug.cgi?id=188981 Reviewed by Eric Carlson. Replace the pragma clang with pragma GCC, it is understood by clang and gcc. * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * 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: * testing/MockLibWebRTCPeerConnection.h: 2018-08-27 Justin Fan WebGL 2 conformance: framebuffer-test https://bugs.webkit.org/show_bug.cgi?id=188812 Reviewed by Jon Lee. Update WebGL 2 implementation to handle READ_FRAMEBUFFER and default framebuffer conformance. Also taking this chance to fix memory leak in PlatformScreenMac/gpuIDForDisplayMask(). Covered by existing WebGL tests as well as newly-enabled webgl/2.0.0/conformance2/renderbuffers/framebuffer-test.html. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::blitFramebuffer): (WebCore::WebGL2RenderingContext::framebufferTextureLayer): (WebCore::validateDefaultFramebufferAttachment): (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): (WebCore::WebGL2RenderingContext::validateFramebufferTarget): (WebCore::WebGL2RenderingContext::validateNonDefaultFramebufferAttachment): (WebCore::WebGL2RenderingContext::getParameter): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::isBound const): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::bindFramebuffer): (WebCore::WebGLRenderingContextBase::checkFramebufferStatus): (WebCore::WebGLRenderingContextBase::deleteFramebuffer): (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer): (WebCore::WebGLRenderingContextBase::framebufferTexture2D): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContext3D.h: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::blitFramebuffer): * platform/mac/PlatformScreenMac.mm: (WebCore::gpuIDForDisplayMask): 2018-08-27 Myles C. Maxfield Null pointer deref in WidthIterator https://bugs.webkit.org/show_bug.cgi?id=188993 Reviewed by Brent Fulgham. Test: fast/text/rtl-justification.html We simply need to guard glyphBuffer like we do in the rest of the function. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): 2018-08-27 Wenson Hsieh [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends https://bugs.webkit.org/show_bug.cgi?id=189004 Reviewed by Dan Bernstein. No new tests, since there is no change in behavior. * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::insertAttachment): * editing/Editor.h: * html/AttachmentTypes.h: Removed. * html/HTMLAttachmentElement.h: 2018-08-27 Keith Rollin Unreviewed build fix -- disable LTO for production builds * Configurations/Base.xcconfig: 2018-08-27 Youenn Fablet Various IndexDB tests abandon documents https://bugs.webkit.org/show_bug.cgi?id=188728 Reviewed by Alex Christensen. Some IDB objects implement hasPendingActivity but there are some possibilities that they continue returning true after being stopped. This is the case for requests that get stopped while still waiting for some pending activity. This is also the case for requests that emits upgradeneeded or blocked events. Enforce that these objects return false to hasPendingActivity once being stopped. This ensures that they can be garbage collected once their context is preparing for destruction like in Document::prepareForDestruction. Test: http/tests/IndexedDB/collect-IDB-objects.https.html * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::hasPendingActivity const): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::hasPendingActivity const): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::enqueueEvent): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::notifyDidAbort): In case the context is stopped, IDBTransaction should not ask IDBRequest to fire an event. 2018-08-27 Simon Fraser Teach WebKitTestRunner and DumpRenderTree about detecting world leaks https://bugs.webkit.org/show_bug.cgi?id=188994 Reviewed by Tim Horton. Export Document::postTask() for use by WTR's injected bundle. * dom/Document.h: 2018-08-27 Aditya Keerthi Consolidate ENABLE_INPUT_TYPE_COLOR and ENABLE_INPUT_TYPE_COLOR_POPOVER https://bugs.webkit.org/show_bug.cgi?id=188931 Reviewed by Wenson Hsieh. * Configurations/FeatureDefines.xcconfig: Removed ENABLE_INPUT_TYPE_COLOR_POPOVER. 2018-08-27 Simon Fraser Improve the showAllDocuments logging https://bugs.webkit.org/show_bug.cgi?id=188990 Reviewed by Tim Horton. Improve the output triggered by "notifyutil -p com.apple.WebKit.showAllDocuments" to denote SVG documents (which often have no URL), and to show the refCount and referencingNodeCount, which helps with leak debugging. Sample output: 2 live documents: Document 0x1236f1200 3 (refCount 6, referencingNodeCount 580) https://webkit.org/ SVGDocument 0x134b60000 13 (refCount 1, referencingNodeCount 197) * page/mac/PageMac.mm: (WebCore::Page::platformInitialize): 2018-08-27 Wenson Hsieh [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory https://bugs.webkit.org/show_bug.cgi?id=188903 Reviewed by Tim Horton. Fixes the exception for attachments that are created when dropping files with extensions that don't map to any known UTIs, and when dropping folders. See below for more detail. Tests: WKAttachmentTests.InsertFolderAndFileWithUnknownExtension WKAttachmentTests.DropFolderAsAttachmentAndMoveByDragging WKAttachmentTests.ChangeAttachmentDataAndFileInformation * editing/Editor.cpp: (WebCore::Editor::insertAttachment): * editing/Editor.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentReader::readFilePaths): When creating an attachment by dropping or pasting a file backed by a file path, handle the cases where… (1) the dropped path is a directory, by setting the UTI to "public.directory". This allows us to show a folder icon for the dropped attachment element on macOS. (2) the dropped path is a file whose UTI is unknown, by defaulting to "public.data". By ensuring that the UTI of a dropped file-backed attachment is set to a concrete type in any case, we avoid an exception when dragging the attachment on macOS, and on iOS, avoid silently failing to drag an attachment. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateAttributes): Change this method to take an optional file size (the subtitle attribute will only be set if the file size is not `std::nullopt`). Furthermore, allow callers of this method to clear attributes on the attachment element by passing in `std::nullopt` for any of the three arguments. This allows us to handle the case where an attachment's file wrapper is changed from a regular file to a folder whose total size is currently unknown. Instead of showing "0 bytes", we'll simply refrain from showing a subtitle at all (in the future, this should be improved by implementing a way to estimate the size of the files in the folder, or perhaps show the number of items in the folder as the subtitle). * html/HTMLAttachmentElement.h: 2018-08-27 Devin Rousso Web Inspector: provide autocompletion for event breakpoints https://bugs.webkit.org/show_bug.cgi?id=188717 Reviewed by Brian Burg. Test: inspector/dom/getSupportedEventNames.html * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getSupportedEventNames): Added. 2018-08-27 Keith Rollin Build system support for LTO https://bugs.webkit.org/show_bug.cgi?id=187785 Reviewed by Dan Bernstein. Update Base.xcconfig and DebugRelease.xcconfig to optionally enable LTO. No new tests -- no new WebKit functionality. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: 2018-08-27 Daniel Bates [iOS] Make color of spelling dots match UIKit https://bugs.webkit.org/show_bug.cgi?id=188861 Reviewed by Simon Fraser. * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Modified to call colorForMarkerLineStyle() for the color to use for the line style. (WebCore::colorForStyle): Deleted. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Added. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::colorForMarkerLineStyle): Added. 2018-08-27 Daniel Bates Spelling dots do not scale with page on iOS; share spelling dot painting code between Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=188828 Reviewed by Simon Fraser. The look of the spelling dots on Mac and iOS are identical up to color. Towards making the spelling dots in WebKit on iOS more closely match the look of the spelling dots in UIKit- apps, standardize on using the same painting code for both Mac and iOS. Currently iOS uses bitmaps to render the spelling dots and does not account for user/CSS zooming. As a result, the spelling dots on iOS render with artifacts (e.g. truncated dots). A side benefit of having iOS share the same painting code as Mac is that iOS will now paint the dots programmatically and we avoid both the need to use bitmaps and fix the bugs in the painting of the bitmap dots with respect to zooming. * Resources/DictationPhraseWithAlternativesDot.png: Removed. * Resources/DictationPhraseWithAlternativesDot@2x.png: Removed. * Resources/SpellingDot.png: Removed. * Resources/SpellingDot@2x.png: Removed. * Resources/SpellingDot@3x.png: Removed. * WebCore.xcodeproj/project.pbxproj: * page/Page.cpp: (WebCore::Page::setDeviceScaleFactor): * platform/graphics/GraphicsContext.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted. * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::GraphicsContext::drawLineForDocumentMarker): (WebCore::findImage): Deleted. (WebCore::createDotPattern): Deleted. (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted. * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted. * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted. * platform/ios/wak/WKGraphics.mm: (WKRectFill): Incorporated the logic from _FillRectUsingOperation(). (_FillRectUsingOperation): Deleted; moved the logic into WKRectFill() since WKRectFill() is now the only caller of this function. (WKRectFillUsingOperation): Deleted. (imageResourcePath): Deleted. (WKGraphicsCreateImageFromBundleWithName): Deleted. (WKDrawPatternBitmap): Deleted. (WKReleasePatternBitmap): Deleted. (WKSetPattern): Deleted. * platform/ios/wak/WKGraphicsInternal.h: Removed. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintPlatformDocumentMarker): * rendering/RenderThemeCocoa.h: Add headers RenderText.h and GraphicsContextCG.h. Fix some style nits while I am here; substitute #import for #include and remove some unnecessary headers TranslateTransformOperation.h, RenderStyle.h, and RenderElement.h. * rendering/RenderThemeCocoa.mm: (WebCore::colorForStyle): (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Moved from RenderThemeMac. I renamed the local variable ctx to context and fixed a type in a comment while moving this code. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::colorForStyle): Deleted; moved to class RenderThemeCocoa. (WebCore::RenderThemeMac::drawLineForDocumentMarker): Deleted; moved to class RenderThemeCocoa. 2018-08-27 Wenson Hsieh [Attachment Support] [WK2] Images copied from Mail message view paste with the wrong file name in compose https://bugs.webkit.org/show_bug.cgi?id=188957 Reviewed by Darin Adler. Allow the alt attribute of a pasted image element to determine the name of an image attachment, rather than using the source URL's last path component first. This is because in some clients, such as Mail, the source of the image element is some nondescript UUID, and the alt text contains the real name of the image. Test: WKAttachmentTests.PasteWebArchiveContainingImages * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::replaceRichContentWithAttachments): 2018-08-27 Alex Christensen Fix IOSMAC build https://bugs.webkit.org/show_bug.cgi?id=188934 Reviewed by Darin Adler. * platform/network/cf/FormDataStreamCFNet.cpp: 2018-08-27 Rob Buis XMLHTTPRequest.send for Document should have same Content-Type processing rules as String https://bugs.webkit.org/show_bug.cgi?id=188953 Reviewed by Darin Adler. Processing rules for Content-Type have been implemented for send with String as parameter, but not for Document, but both should be treated the same according to the spec [1]. This patch implements this. Behavior matches Firefox. [1] https://xhr.spec.whatwg.org/#the-send()-method Test: web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): 2018-08-27 Ali Juma [IntersectionObserver] Implement intersection logic for the explicit root case https://bugs.webkit.org/show_bug.cgi?id=188809 Reviewed by Simon Fraser. Add logic to Document::updateIntersectionObservations to compute the intersection between the target and root elements, for the case where an IntersectionObserver has a root element. There are no changes to the scheduling of intersection observations in this patch, so observations are still only computed once for each observer. * dom/Document.cpp: (WebCore::computeIntersectionRects): (WebCore::Document::updateIntersectionObservations): * page/FrameView.cpp: (WebCore::FrameView::absoluteToClientRect const): * page/FrameView.h: * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::createTimestamp const): * page/IntersectionObserver.h: * platform/graphics/FloatRect.h: (WebCore::FloatRect::area const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::isContainingBlockAncestorFor const): * rendering/RenderBlock.h: 2018-08-25 Yusuke Suzuki Shrink size of HTMLCollection https://bugs.webkit.org/show_bug.cgi?id=188945 Reviewed by Darin Adler. Shrink the size of HTMLCollection by reordering members. No behavior change. * html/HTMLCollection.cpp: (WebCore::HTMLCollection::HTMLCollection): * html/HTMLCollection.h: 2018-08-25 Yusuke Suzuki Shrink size of XMLHttpRequest https://bugs.webkit.org/show_bug.cgi?id=188944 Reviewed by Saam Barati. Shrink the size of XMLHttpRequest by packing bits and reordering members. It reduces the size from 1248 to 1176. No behavior change. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): (WebCore::XMLHttpRequest::responseText): (WebCore::XMLHttpRequest::createResponseBlob): (WebCore::XMLHttpRequest::createResponseArrayBuffer): (WebCore::XMLHttpRequest::setResponseType): (WebCore::XMLHttpRequest::changeState): (WebCore::XMLHttpRequest::callReadyStateChangeListener): (WebCore::XMLHttpRequest::setWithCredentials): (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::prepareToSend): (WebCore::XMLHttpRequest::createRequest): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::overrideMimeType): (WebCore::XMLHttpRequest::setRequestHeader): (WebCore::XMLHttpRequest::getAllResponseHeaders const): (WebCore::XMLHttpRequest::getResponseHeader const): (WebCore::XMLHttpRequest::status const): (WebCore::XMLHttpRequest::statusText const): (WebCore::XMLHttpRequest::didFinishLoading): (WebCore::XMLHttpRequest::createDecoder const): (WebCore::XMLHttpRequest::didReceiveData): (WebCore::XMLHttpRequest::didReachTimeout): (WebCore::XMLHttpRequest::readyState const): Deleted. * xml/XMLHttpRequest.h: (WebCore::XMLHttpRequest::responseType const): (WebCore::XMLHttpRequest::readyState const): * xml/XMLHttpRequestProgressEventThrottle.cpp: (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle): * xml/XMLHttpRequestProgressEventThrottle.h: 2018-08-26 Zalan Bujtas [LFC][Floating] FloatBox -> FloatAvoider https://bugs.webkit.org/show_bug.cgi?id=188941 Reviewed by Antti Koivisto. This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/displaytree/DisplayBox.h: * layout/floats/FloatAvoider.cpp: Renamed from Source/WebCore/layout/floats/FloatBox.cpp. (WebCore::Layout::FloatAvoider::FloatAvoider): (WebCore::Layout::FloatAvoider::initializePosition): (WebCore::Layout::FloatAvoider::isLeftAligned const): (WebCore::Layout::FloatAvoider::setLeft): (WebCore::Layout::FloatAvoider::setTopLeft): (WebCore::Layout::FloatAvoider::resetVertically): (WebCore::Layout::FloatAvoider::resetHorizontally): (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): * layout/floats/FloatAvoider.h: Renamed from Source/WebCore/layout/floats/FloatBox.h. (WebCore::Layout::FloatAvoider::top const): (WebCore::Layout::FloatAvoider::left const): (WebCore::Layout::FloatAvoider::marginTop const): (WebCore::Layout::FloatAvoider::marginLeft const): (WebCore::Layout::FloatAvoider::marginBottom const): (WebCore::Layout::FloatAvoider::marginRight const): (WebCore::Layout::FloatAvoider::rectWithMargin const): (WebCore::Layout::FloatAvoider::setTop): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::floatingPosition const): * layout/floats/FloatingContext.h: 2018-08-26 Christopher Reid [Curl] Implement deleteCookie() https://bugs.webkit.org/show_bug.cgi?id=188908 Reviewed by Fujii Hironori. Support deleting cookies from the web inspector Tested from the web inspector. * platform/network/curl/CookieJarCurlDatabase.cpp: (WebCore::CookieJarCurlDatabase::deleteCookie const): 2018-08-26 Zalan Bujtas [LFC][Floating] Simplify FloatingState::FloatItem class https://bugs.webkit.org/show_bug.cgi?id=188912 Reviewed by Antti Koivisto. Let's remove some redundant code now that FloatingState::FloatItem is not used for incoming floats anymore. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::resetVertically): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingPair::left const): (WebCore::Layout::FloatingPair::right const): (WebCore::Layout::FloatingPair::intersects const): (WebCore::Layout::previousFloatingIndex): (WebCore::Layout::Iterator::operator++): (WebCore::Layout::Iterator::set): * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): (WebCore::Layout::FloatingState::remove): (WebCore::Layout::FloatingState::bottom const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::operator== const): (WebCore::Layout::FloatingState::FloatItem::isLeftPositioned const): (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): (WebCore::Layout::FloatingState::leftBottom const): (WebCore::Layout::FloatingState::rightBottom const): (WebCore::Layout::FloatingState::bottom const): (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): (WebCore::Layout::FloatingState::FloatItem::layoutBox const): Deleted. (WebCore::Layout::FloatingState::FloatItem::containingBlock const): Deleted. (WebCore::Layout::FloatingState::FloatItem::displayBox const): Deleted. (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const): Deleted. 2018-08-26 Andy Estes [Apple Pay] Introduce new values for -apple-pay-button-type https://bugs.webkit.org/show_bug.cgi?id=188949 Reviewed by Anders Carlsson. Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type, and mapped those values to their equivalent PKPaymentButtonTypes. Tests: http/tests/ssl/applepay/ApplePayButton.html http/tests/ssl/applepay/ApplePayButtonV4.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-08-26 Youenn Fablet Make IDBCursor::m_request a WeakPtr https://bugs.webkit.org/show_bug.cgi?id=188938 Reviewed by Alex Christensen. Make m_request a WeakPtr so that if m_request is destroyed, the related cursor will not use the invalid pointer. Covered by existing tests. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::continuePrimaryKey): Other continue and advance methods that are calling uncheckedIterateCursor do check for m_request. Apply the same check for continuePrimaryKey. (WebCore::IDBCursor::uncheckedIterateCursor): * Modules/indexeddb/IDBCursor.h: (WebCore::IDBCursor::setRequest): (WebCore::IDBCursor::clearRequest): (WebCore::IDBCursor::request): * Modules/indexeddb/IDBRequest.h: 2018-08-26 Youenn Fablet IDBCursor does not need to be an ActiveDOMObject https://bugs.webkit.org/show_bug.cgi?id=188937 Reviewed by Alex Christensen. Remove ActiveDOMObject from IDBCursor IDL. Update constructors and call sites accordingly. This allows removing m_outstandingRequestCount and related code in IDBRequest. Covered by existing tests. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::create): (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::update): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::activeDOMObjectName const): Deleted. (WebCore::IDBCursor::canSuspendForDocumentSuspension const): Deleted. (WebCore::IDBCursor::hasPendingActivity const): Deleted. (WebCore::IDBCursor::decrementOutstandingRequestCount): Deleted. * Modules/indexeddb/IDBCursor.h: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBCursorWithValue.cpp: (WebCore::IDBCursorWithValue::create): (WebCore::IDBCursorWithValue::IDBCursorWithValue): * Modules/indexeddb/IDBCursorWithValue.h: * Modules/indexeddb/IDBCursorWithValue.idl: * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::requestOpenCursor): * WebCore.xcodeproj/project.pbxproj: 2018-08-26 Wenson Hsieh [Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments https://bugs.webkit.org/show_bug.cgi?id=188933 Reviewed by Darin Adler. Support the ability to drop and paste images as image elements, with attachment elements, only if attachment elements are enabled. See changes below for more detail. Tests: WKAttachmentTests.CutAndPastePastedImage WKAttachmentTests.MovePastedImageByDragging WKAttachmentTests.RemoveNewlinesBeforePastedImage * editing/Editor.h: * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): Adjust this helper to take an Element& rather than an HTMLAttachmentElement&, and address a FIXME by writing the document origin identifier to the pasteboard via custom pasteboard data when dragging an attachment. This allows us to avoid creating extra image and attachment elements when dragging an image backed by an attachment within the same document. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::contentTypeIsSuitableForInlineImageRepresentation): Add a helper to determine whether a content type (UTI or MIME type) should be read as an inline image. (WebCore::createFragmentForImageAttachment): (WebCore::replaceRichContentWithAttachments): (WebCore::WebContentReader::readFilePaths): Teach codepaths where we currently create attachment elements to instead create image elements if the MIME type, is something suitable for display via an inline image element; add the attachment element under the shadow root of the image element. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::appendCustomAttributes): (WebCore::restoreAttachmentElementsInFragment): When dragging or copying an image element, we need to make sure that any attachment element backing the image is preserved in the pasted or dropped fragment. To do this, we use a technique similar to what was done for r180785 and r224593 and write a temporary "webkitattachmentid" attribute to the serialized markup on copy. Upon deserializing the markup back to a fragment, we then create an attachment element with the same identifier under the image. (WebCore::createFragmentFromMarkup): * html/HTMLAttachmentElement.h: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::setAttachmentElement): (WebCore::HTMLImageElement::attachmentElement const): Helper methods to get and set an attachment element under an image element. Setting an image's attachment element puts that attachment element under the shadow root of the image, and also hides the attachment element. (WebCore::HTMLImageElement::attachmentIdentifier const): Returns the identifier of an attachment element associated with the image element, or null. * html/HTMLImageElement.h: * html/HTMLImageElement.idl: Add HTMLImageElement.webkitAttachmentIdentifier, a readonly attribute guarded by runtime-enabled attachment element feature. * page/DragController.cpp: (WebCore::DragController::startDrag): In the case of dragging an image, if that image element is backed by an attachment element, don't bother writing the image data to the clipboard; instead, write the attachment data as a promise. (WebCore::DragController::doImageDrag): Plumb promised attachment information to DragController::doSystemDrag. (WebCore::DragController::promisedAttachmentInfo): Teach this to handle attachment elements as well as image elements that are backed by attachment elements. * page/DragController.h: * platform/PromisedAttachmentInfo.h: (WebCore::PromisedAttachmentInfo::operator bool const): A valid PromisedAttachmentInfo no longer requires a contentType to be set; instead, an attachment identifier alone is sufficient, since an up-to-date content type can be requested in the UI process from the API attachment object. 2018-08-26 Andy Estes [Apple Pay] PaymentRequest.show() should reject when an unsupported ApplePayRequest version is specified https://bugs.webkit.org/show_bug.cgi?id=188954 Reviewed by Darin Adler. In Apple Pay JS, calling the ApplePaySession constructor with an unsupported version results in an exception being thrown. We need to do something similar for Payment Request. This patch moves the logic for validating the version from ApplePaySession to a common routine in ApplePayRequestBase that both APIs call to convert requests into a common format. In Apple Pay JS, an exception will still be thrown when constructing an ApplePaySession. In Payment Request, the promise returned by show() will be rejected. Added test cases to http/tests/ssl/applepay/PaymentRequest.https.html. * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::create): 2018-08-24 Ryosuke Niwa Click event from click() is not composed https://bugs.webkit.org/show_bug.cgi?id=170211 Reviewed by Wenson Hsieh. Fixed the bug. All simulated clicks should be composed regardless of whether it's trusted or not. See: https://html.spec.whatwg.org/multipage/interaction.html#dom-click https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-mouse-event * dom/SimulatedClick.cpp: 2018-08-24 Ryosuke Niwa Avoid calling setUntrusted in SimulatedMouseEvent https://bugs.webkit.org/show_bug.cgi?id=188929 Reviewed by Simon Fraser. Added IsTrusted flag to Event constructors instead of creating a trusted event and making it untrusted in the constructor of SimulatedMouseEvent. This makes EventTarget::dispatchEventForBindings the only caller of setUntrusted(). * dom/Event.cpp: (WebCore::Event::Event): * dom/Event.h: * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): (WebCore::MouseEvent::MouseEvent): * dom/MouseEvent.h: * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::MouseRelatedEvent): * dom/MouseRelatedEvent.h: * dom/SimulatedClick.cpp: * dom/UIEvent.cpp: (WebCore::UIEvent::UIEvent): * dom/UIEvent.h: * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::UIEventWithKeyState): * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): 2018-08-24 Jer Noble Using Touch Bar to scrub video on Youtube results in video playback freeze https://bugs.webkit.org/show_bug.cgi?id=188926 Reviewed by Eric Carlson. Test: media/media-source/media-source-seek-twice.html When converting from a double-precision float to a MediaTime, a certain amount of precision is lost. If that results in a round-trip between `float in -> MediaTime -> float out` where in != out, we will wait forever for the time jump observer to fire. Break the cycle by comparing m_lastSeekTime to the synchronizerTime only after m_lastSeekTime has been normalized into a rational-time value. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): 2018-08-24 Ryosuke Niwa Pass in IsComposed flag to Event constructors https://bugs.webkit.org/show_bug.cgi?id=188720 Reviewed by Simon Fraser. This patch replaces the logic in Event::isComposed to decide whether an event is composed or not by explicitly passing IsComposed flag to Event constructor. This decouples being composed from whether an event is trusted and of a partciular event type, paving our way to make synthetic click event dispatched by an author script composable in webkit.org/b/170211. This patch also removes IsTrusted from the argument list of event constructors and create functions to systematically eliminate the possibility of this patch making an event uncomposed by not setting IsComposed flag. No new tests since there should be no behavioral change. * dom/ClipboardEvent.cpp: (WebCore::ClipboardEvent::ClipboardEvent): A trusted ClipboardEvent is composed. * dom/ClipboardEvent.h: (WebCore::ClipboardEvent::ClipboardEvent): Removed IsTrusted from the variant which takes Init object to make sure this refactoring is correct. (WebCore::ClipboardEvent::create): Ditto. * dom/CompositionEvent.cpp: (WebCore::CompositionEvent::CompositionEvent): A trusted CompositionEvent is composed. * dom/CompositionEvent.h: * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): A trusted dblclick event is composed (this is a non-standard event but virtually every mouse event is composed so it makes sense to make this composed). * dom/Event.cpp: (WebCore::Event::Event): (WebCore::Event::create): (WebCore::Event::composed const): Deleted. The trival implementation moved to the header file. * dom/Event.h: (WebCore::Event::composed const): * dom/FocusEvent.cpp: (WebCore::FocusEvent::FocusEvent): A trusted Focus event is composed. * dom/FocusEvent.h: (WebCore::FocusEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. (WebCore::FocusEvent::FocusEvent): Ditto. * dom/InputEvent.cpp: (WebCore::InputEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. (WebCore::InputEvent::InputEvent): A trsuted InputEvent is composed. * dom/InputEvent.h: * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): A trsuted KeyboardEvent is composed. (WebCore::KeyboardEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. * dom/KeyboardEvent.h: * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. (WebCore::MouseEvent::MouseEvent): Explicitly take IsComposed flag from subclasses since simulated click does not currently compose. * dom/MouseEvent.h: * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::MouseRelatedEvent): A trusted touch event is composed. * dom/MouseRelatedEvent.h: * dom/Node.cpp: (WebCore::Node::dispatchDOMActivateEvent): A trusted DOMActivateEvent event is composed. (WebCore::Node::dispatchInputEvent): A trusted input event is composed. * dom/SimulatedClick.cpp: (SimulatedMouseEvent::SimulatedMouseEvent): A simulated click is composed if it's a trusted event for now. This is the bug to be fixed in webkit.org/b/170211. * dom/TextEvent.cpp: (WebCore::TextEvent::TextEvent): A trsuted textInput event is composed. * dom/UIEvent.cpp: (WebCore::UIEvent::UIEvent): Added IsComposed as an argument to the variant which creates a trusted event, and removed IsTrusted from Init variant for the correctness guarantee. * dom/UIEvent.h: (WebCore::UIEvent::create): Ditto. * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::UIEventWithKeyState): Ditto. * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): A trusted Wheel event, which is a subclass of MouseEvent, is composed. (WebCore::WheelEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. * dom/WheelEvent.h: * editing/Editor.cpp: (WebCore::dispatchBeforeInputEvent): (WebCore::dispatchInputEvent): (WebCore::dispatchClipboardEvent): Call the newly added variant which takes DataTransfer directly so that we can remove IsTrusted from the variant which takes Init for the correctness guarantee. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchDragEvent): A trusted mouse event is composed. 2018-08-24 Ryosuke Niwa Add getModifierState to MouseEvent https://bugs.webkit.org/show_bug.cgi?id=188913 Reviewed by Simon Fraser. Moved getModifierState from KeyboardEvent to UIEventWithKeyState and exposed it in MouseEvent. See https://www.w3.org/TR/2016/WD-uievents-20160804/#mouseevent This patch also fixes the bug that initMouseEvent was not clearing AltGraph and CapsLock states, which was preserved in the refactoring done in r235158. Tests: fast/events/constructors/mouse-event-getModifierState.html fast/events/dblclick-event-getModifierState.html * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::getModifierState const): Moved to UIEventWithKeyState. * dom/KeyboardEvent.h: * dom/KeyboardEvent.idl: Insert a blank line to match the spec's IDL. * dom/MouseEvent.idl: Added getModifierState. * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): Moved from the header file. (WebCore::UIEventWithKeyState::getModifierState const): (WebCore::UIEventWithKeyState::setModifierKeys): Moved from the header file. * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::modifierKeys const): (WebCore::UIEventWithKeyState::setModifierKeys): Deleted the variant which didn't take altGraphKey since that variant behaves same as the one which takes altGraphKey. 2018-08-24 Youenn Fablet libwebrtc PeerConnection::AddTrack sometimes fail https://bugs.webkit.org/show_bug.cgi?id=188914 Reviewed by Eric Carlson. AddTrack may fail so test the result and if not successful, make JS addTrack to throw an exception. This makes some tests to fail now. These tests should pass again when unified plan will be enabled. Covered by rebased tests. * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::notifyAddedTrack): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::addTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: 2018-08-24 Adrian Perez de Castro [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp https://bugs.webkit.org/show_bug.cgi?id=188919 Reviewed by Michael Catanzaro. No new tests needed. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Cast through "void (*)(void)" instead of GCallback to avoid the warning produced by -Wcast-function-type. 2018-08-24 Andy Estes [Apple Pay] Allow $0 totals https://bugs.webkit.org/show_bug.cgi?id=185150 Reviewed by Dan Bernstein. Relaxed payment request validation to allow $0 totals. This matches PassKit behavior. Updated test cases in http/tests/ssl/applepay/. * Modules/applepay/PaymentRequestValidator.mm: (WebCore::PaymentRequestValidator::validateTotal): 2018-08-24 Frederic Wang Remove ScrollByPrecisePixel granularity https://bugs.webkit.org/show_bug.cgi?id=188915 Reviewed by Carlos Garcia Campos. ScrollByPrecisePixel was introduced in bug 87535 and bug 91020 for Chromium Linux/Windows but it is no longer used. No new tests, behavior unchanged. * platform/ScrollAnimatorSmooth.cpp: (WebCore::ScrollAnimatorSmooth::scroll): Remove special handling for ScrollByPrecisePixel. * platform/ScrollTypes.h: Remove ScrollByPrecisePixel, it is never used. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::scroll): Remove special handling for ScrollByPrecisePixel. * platform/gtk/ScrollAnimatorGtk.cpp: (WebCore::ScrollAnimatorGtk::scroll): Remove special handling for ScrollByPrecisePixel. 2018-08-24 Antti Koivisto Allow creating WeakPtrs to const objects https://bugs.webkit.org/show_bug.cgi?id=188785 Reviewed by Geoff Garen. Remove some unneeded const_casts. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::MediaQueryEvaluator): (WebCore::MediaQueryEvaluator::evaluate const): * css/MediaQueryEvaluator.h: * rendering/FloatingObjects.cpp: (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter): (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter): (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter): (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter): (WebCore::FloatingObjects::FloatingObjects): * rendering/FloatingObjects.h: (WebCore::FloatingObjects::renderer const): 2018-08-24 Zan Dobersek [CoordGraphics] Move inline methods on CoordinatedGraphicsLayer out-of-line https://bugs.webkit.org/show_bug.cgi?id=188916 Reviewed by Carlos Garcia Campos. Style checker produced complaints that CoordinatedGraphicsLayer class is using inline-defined methods despite the WEBCORE_EXPORT macro being used for the whole class. Keep the macro where it is but instead move the method definitions out-of-line. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::isCoordinatedGraphicsLayer const): (WebCore::CoordinatedGraphicsLayer::id const): (WebCore::CoordinatedGraphicsLayer::primaryLayerID const): (WebCore::CoordinatedGraphicsLayer::usesContentsLayer const): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2018-08-24 Antti Koivisto Use OptionSet::containsAny and containsAll in some more places https://bugs.webkit.org/show_bug.cgi?id=188885 Reviewed by Sam Weinig. * page/PerformanceMonitor.cpp: (WebCore::PerformanceMonitor::activityStateChanged): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::~RenderLayerBacking): 2018-08-23 Simon Fraser Add support for dumping GC heap snapshots, and a viewer https://bugs.webkit.org/show_bug.cgi?id=186416 Reviewed by Joseph Pecoraro. Make a way to dump information about the GC heap that is useful for looking for leaked or abandoned objects. This dump is obtained (on Apple platforms) via: notifyutil -p com.apple.WebKit.dumpGCHeap which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector. This leverages the heap snapshot used by Web Inspector, adding an alternate format for the snapshot JSON that adds additional data about objects and why they are GC roots. The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(), and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute, CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument that need to decorate the heap snapshot cell data with things like the document URL. GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it to a file in /tmp. The file path is printed out to the system log. * bindings/js/DOMGCOutputConstraint.cpp: (WebCore::DOMGCOutputConstraint::executeImpl): * bindings/js/GCController.cpp: (WebCore::GCController::GCController): (WebCore::GCController::dumpHeap): * bindings/js/GCController.h: * bindings/js/JSCSSRuleListCustom.cpp: (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots): * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots): * bindings/js/JSCallbackData.h: * bindings/js/JSCanvasRenderingContext2DCustom.cpp: (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSDOMWindow::heapSnapshot): * bindings/js/JSDeprecatedCSSOMValueCustom.cpp: (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): * bindings/js/JSDocumentCustom.cpp: (WebCore::JSDocument::heapSnapshot): * bindings/js/JSMicrotaskCallback.h: (WebCore::JSMicrotaskCallback::call): * bindings/js/JSMutationObserverCustom.cpp: (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): * bindings/js/JSNavigatorCustom.cpp: (WebCore::JSNavigator::visitAdditionalChildren): * bindings/js/JSNodeCustom.cpp: (WebCore::isReachableFromDOM): (WebCore::JSNodeOwner::isReachableFromOpaqueRoots): * bindings/js/JSNodeListCustom.cpp: (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots): * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp: (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots): * bindings/js/JSPerformanceObserverCustom.cpp: (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots): * bindings/js/JSPopStateEventCustom.cpp: * bindings/js/JSTextTrackCueCustom.cpp: (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots): * bindings/js/WebCoreTypedArrayController.cpp: (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): * bindings/js/WebCoreTypedArrayController.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceName::heapSnapshot): (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSInterfaceName.h: * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSMapLike::heapSnapshot): (WebCore::JSMapLikeOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSMapLike.h: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSReadOnlyMapLike::heapSnapshot): (WebCore::JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSReadOnlyMapLike.h: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObject::heapSnapshot): (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestActiveDOMObject.h: * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSTestCEReactions::heapSnapshot): (WebCore::JSTestCEReactionsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestCEReactions.h: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSTestCEReactionsStringifier::heapSnapshot): (WebCore::JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracer::heapSnapshot): (WebCore::JSTestCallTracerOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestCallTracer.h: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::JSTestClassWithJSBuiltinConstructor::heapSnapshot): (WebCore::JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot): (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::JSTestDOMJIT::heapSnapshot): * bindings/scripts/test/JS/JSTestDOMJIT.h: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySetting::heapSnapshot): (WebCore::JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestEnabledBySetting.h: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructor::heapSnapshot): * bindings/scripts/test/JS/JSTestEventConstructor.h: * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTarget::heapSnapshot): * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::JSTestException::heapSnapshot): (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestException.h: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachable::heapSnapshot): (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::JSTestGlobalObject::heapSnapshot): (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifier::heapSnapshot): (WebCore::JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingException::heapSnapshot): (WebCore::JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifier::heapSnapshot): (WebCore::JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterface::heapSnapshot): (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestInterface.h: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::JSTestInterfaceLeadingUnderscore::heapSnapshot): (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::JSTestIterable::heapSnapshot): (WebCore::JSTestIterableOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestIterable.h: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListener::heapSnapshot): (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot): (WebCore::JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingException::heapSnapshot): (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot): (WebCore::JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructor::heapSnapshot): (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedConstructor.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifier::heapSnapshot): (WebCore::JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingException::heapSnapshot): (WebCore::JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifier::heapSnapshot): (WebCore::JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetter::heapSnapshot): (WebCore::JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWith::heapSnapshot): (WebCore::JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifier::heapSnapshot): (WebCore::JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifier::heapSnapshot): (WebCore::JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifier::heapSnapshot): (WebCore::JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingException::heapSnapshot): (WebCore::JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifier::heapSnapshot): (WebCore::JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetter::heapSnapshot): (WebCore::JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithOverrideBuiltins::heapSnapshot): (WebCore::JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgableProperties::heapSnapshot): (WebCore::JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot): (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNode::heapSnapshot): * bindings/scripts/test/JS/JSTestNode.h: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObj::heapSnapshot): (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructors::heapSnapshot): (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequence::heapSnapshot): (WebCore::JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::JSTestOverrideBuiltins::heapSnapshot): (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterface::heapSnapshot): (WebCore::JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestPluginInterface.h: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEvent::heapSnapshot): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h: * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerialization::heapSnapshot): (WebCore::JSTestSerializationOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestSerialization.h: * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: (WebCore::JSTestSerializationIndirectInheritance::heapSnapshot): * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInherit::heapSnapshot): * bindings/scripts/test/JS/JSTestSerializationInherit.h: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinal::heapSnapshot): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterface::heapSnapshot): (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::JSTestStringifier::heapSnapshot): (WebCore::JSTestStringifierOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifier.h: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::JSTestStringifierAnonymousOperation::heapSnapshot): (WebCore::JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::JSTestStringifierNamedOperation::heapSnapshot): (WebCore::JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::JSTestStringifierOperationImplementedAs::heapSnapshot): (WebCore::JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::JSTestStringifierOperationNamedToString::heapSnapshot): (WebCore::JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::JSTestStringifierReadOnlyAttribute::heapSnapshot): (WebCore::JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSTestStringifierReadWriteAttribute::heapSnapshot): (WebCore::JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefs::heapSnapshot): (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots): * bindings/scripts/test/JS/JSTestTypedefs.h: * dom/Document.idl: * page/DOMWindow.idl: 2018-08-23 Ryosuke Niwa initKeyboardEvent doesn't clear CapsLock state https://bugs.webkit.org/show_bug.cgi?id=188909 Reviewed by Wenson Hsieh. Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent. Test: fast/events/init-event-clears-capslock.html * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::setModifierKeys): 2018-08-23 Aditya Keerthi Unreviewed, fix the Windows build after r235245. * html/InputMode.cpp: (WebCore::stringForInputMode): 2018-08-23 Saam barati JSRunLoopTimer may run part of a member function after it's destroyed https://bugs.webkit.org/show_bug.cgi?id=188426 Reviewed by Mark Lam. * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformThreadBody): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformThreadBody): 2018-08-23 David Fenton Unreviewed, rolling out r235129. broke internal builds Reverted changeset: "Allow creating WeakPtrs to const objects" https://bugs.webkit.org/show_bug.cgi?id=188785 https://trac.webkit.org/changeset/235129 2018-08-23 Daniel Bates [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes https://bugs.webkit.org/show_bug.cgi?id=188898 Reviewed by Simon Fraser. Not all document markers may have a dictation metadata on iOS. Currently we assume that every marker has dictation alternatives (i.e. DocumentMarker::alternatives() can be called) when deleting a selection preserving document markers on iOS. However, only markers for dictation may have dictation alternatives. For example, document markers for misspelled words do not have dictation metadata by definition. Instead of assuming every marker has dictation alternatives on iOS we need to check the marker type to determine whether it has associated dictation metadata and invoke the appropriate DocumentMarkerController::addMarker() overload. * dom/DocumentMarker.h: (WebCore::DocumentMarker::isDictation const): Added. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Only access DocumentMarker::alternatives() and add a dictation marker on iOS if the marker is a dictation marker. 2018-08-23 Mark Lam Move vmEntryGlobalObject() to VM from CallFrame. https://bugs.webkit.org/show_bug.cgi?id=188900 Reviewed by Michael Saboff. No new tests needed because this patch does not introduce new functionality. * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::create): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::callerGlobalObject): (WebCore::toJSDOMGlobalObject): Deleted. * bindings/js/JSDOMWindowBase.cpp: (WebCore::firstDOMWindow): * bridge/c/c_utility.cpp: (JSC::Bindings::convertValueToNPVariant): * bridge/objc/WebScriptObject.mm: (WebCore::addExceptionToConsole): * bridge/objc/objc_instance.mm: (ObjcInstance::moveGlobalExceptionToExecState): * bridge/objc/objc_runtime.mm: (JSC::Bindings::convertValueToObjcObject): * bridge/objc/objc_utility.mm: (JSC::Bindings::convertValueToObjcValue): * testing/Internals.cpp: (WebCore::Internals::cloneArrayBuffer): 2018-08-23 Andy Estes [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave https://bugs.webkit.org/show_bug.cgi?id=188829 Reviewed by Tim Horton. Test: http/tests/ssl/applepay/ApplePaySessionV4.html * Configurations/FeatureDefines.xcconfig: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::supportsVersion): 2018-08-23 Devin Rousso Web Inspector: support breakpoints for timers and animation-frame events https://bugs.webkit.org/show_bug.cgi?id=188778 Reviewed by Brian Burg. The original implementation of "instrumentation" breakpoints relied upon the frontend sending somewhat arbitrary strings when enabling breakpoints for specific events. As an example, setting a breakpoint for `requestAnimationFrame` expects `"animationFrameFired"` as the string, which doesn't make much sense. This patch removes the usage of these strings and instead expects the agent to implement a method that matches what is happening. Tests: inspector/dom-debugger/event-animation-frame-breakpoints.html inspector/dom-debugger/event-listener-breakpoints.html inspector/dom-debugger/event-timer-breakpoints.html * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::willFireTimer): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInstallTimerImpl): (WebCore::InspectorInstrumentation::didRemoveTimerImpl): (WebCore::InspectorInstrumentation::willFireTimerImpl): (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl): (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl): (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl): (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): Deleted. * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): Added. (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): Added. (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): (WebCore::InspectorDOMDebuggerAgent::willFireTimer): Added. (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Added. (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Deleted. (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Deleted. (WebCore::InspectorDOMDebuggerAgent::setBreakpoint): Deleted. (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Deleted. (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Deleted. (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint): Deleted. (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): Deleted. Unify the event listener and instrumentation breakpoint commands into a single method, `setEventBreakpoint`, that takes in both an `EventBreakpointType` and `eventName`. * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): 2018-08-23 Aditya Keerthi [iOS] Support the inputmode attribute on contenteditable elements https://bugs.webkit.org/show_bug.cgi?id=188878 Reviewed by Ryosuke Niwa. The inputmode attribute should apply to contenteditable elements, in addition to textfield inputs and textareas. Moved the inputmode attribute from HTMLInputElement.idl and HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification. Also moved all logic to convert between the InputMode enum and string values into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore, InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the specification. Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute Tests: fast/forms/inputmode-attribute-contenteditable.html fast/forms/inputmode-attribute-input.html fast/forms/inputmode-attribute-textarea.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLElement.cpp: (WebCore::HTMLElement::canonicalInputMode const): (WebCore::HTMLElement::inputMode const): (WebCore::HTMLElement::setInputMode): * html/HTMLElement.h: * html/HTMLElement.idl: * html/HTMLInputElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTextFormControlElement.cpp: * html/HTMLTextFormControlElement.h: * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp. (WebCore::inputModeForAttributeValue): (WebCore::stringForInputMode): * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h. 2018-08-23 Eric Carlson [MediaStream] Store video preset sizes in a map https://bugs.webkit.org/show_bug.cgi?id=188866 Reviewed by Youenn Fablet. No new tests, tested manually. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::initializeCapabilities): (WebCore::AVVideoCaptureSource::sizeForPreset): (WebCore::AVVideoCaptureSource::setPreset): (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): (WebCore::sizeForPreset): Deleted. (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Deleted. 2018-08-23 Ryan Haddad Unreviewed, attempt to fix the build after r235230. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: 2018-08-23 Youenn Fablet Update libwebrtc up to 984f1a80c0 https://bugs.webkit.org/show_bug.cgi?id=188745 Reviewed by Eric Carlson. Updated implementation according new webrtc backend. Instead of modifying libwebrtc header files, we disable unused parameter warning for such headers included in WebCore. WebCore implementation is updated according new webrtc API, mostly AddRef/Release. RealtimeOutgoingVideoSource now uses a pixel convolver to convert RGB pixel buffers as I420. Covered by existing tests. * CMakeLists.txt: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream): (WebCore::fillEncodingParameters): (WebCore::fillRtpParameters): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: (WebCore::LibWebRTCMediaEndpoint::Release const): * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RealtimeIncomingAudioSource.h: * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): (WebCore::RealtimeMediaSource::supportsConstraint const): (WebCore::RealtimeMediaSource::supportsConstraints): * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: (WebCore::GStreamerVideoDecoder::newSampleCallback): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder): (WebCore::GStreamerVideoEncoder::newSampleCallback): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (WebCore::ConvertToI420): (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: Added. (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV): * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::MockLibWebRTCPeerConnection::AddTrack): * testing/MockLibWebRTCPeerConnection.h: (WebCore::MockRtpSender::GetParameters): (WebCore::MockRtpSender::SetParameters): 2018-08-23 Wenson Hsieh [Attachment Support] Attachment elements don't appear in drag images on macOS https://bugs.webkit.org/show_bug.cgi?id=188823 Reviewed by Tim Horton. Currently, attachment elements don't show up in the drag image snapshot on macOS. This is because only the "Selection" phase is painted when generating a drag image on macOS, and many replaced renderers (with some exceptions, such as RenderImage) only paint visible content during the "Foreground" phase. To fix this, we override RenderAttachment::paintReplaced to paint the attachment in the case where the Selection phase is being painted. Tests: WKAttachmentTestsMac.DragAttachmentAsFilePromise WKAttachmentTests.MoveAttachmentElementAsIconByDragging * rendering/RenderAttachment.cpp: (WebCore::RenderAttachment::paintReplaced): * rendering/RenderAttachment.h: * rendering/RenderThemeMac.mm: (WebCore::titleTextColorForAttachment): (WebCore::AttachmentLayout::layOutTitle): Plumb an AttachmentLayoutStyle (i.e. NonSelected or Selected) to AttachmentLayout, and use this bit when determining the title text color, as well whether to paint backgrounds for the icon and title. (WebCore::AttachmentLayout::AttachmentLayout): (WebCore::RenderThemeMac::attachmentIntrinsicSize const): (WebCore::RenderThemeMac::attachmentBaseline const): (WebCore::paintAttachmentIconBackground): (WebCore::paintAttachmentTitleBackground): Bail from painting backgrounds if a selected style is used for the attachment. (WebCore::RenderThemeMac::paintAttachment): Rather than check the RenderAttachment's selection state when determining whether to paint with a non-selected or selected style, only use selected style if the RenderAttachment has a selection _and_ the painting phase is not "Selection". While this sounds extremely counter-intuitive, the "Selection" painting phase refers to painting the selected foreground content _without_ including any part of the selection highlight. 2018-08-23 Zalan Bujtas [LFC][Floating] Decouple the incoming floats and floats already placed in the list https://bugs.webkit.org/show_bug.cgi?id=188886 Reviewed by Antti Koivisto. This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats. 1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float). 2. Use the existing FloatState::FloatItem class for placed floats. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/LayoutUnits.h: * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/displaytree/DisplayBox.h: * layout/floats/FloatBox.cpp: Added. (WebCore::Layout::FloatBox::FloatBox): (WebCore::Layout::FloatBox::initializePosition): (WebCore::Layout::FloatBox::isLeftAligned const): (WebCore::Layout::FloatBox::setLeft): (WebCore::Layout::FloatBox::setTopLeft): (WebCore::Layout::FloatBox::resetVertically): (WebCore::Layout::FloatBox::resetHorizontally): (WebCore::Layout::FloatBox::topLeftInContainingBlock const): * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h. (WebCore::Layout::FloatBox::top const): (WebCore::Layout::FloatBox::left const): (WebCore::Layout::FloatBox::marginTop const): (WebCore::Layout::FloatBox::marginLeft const): (WebCore::Layout::FloatBox::marginBottom const): (WebCore::Layout::FloatBox::marginRight const): (WebCore::Layout::FloatBox::rectWithMargin const): (WebCore::Layout::FloatBox::setTop): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingPair::verticalPosition const): (WebCore::Layout::begin): (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::floatingPosition const): (WebCore::Layout::FloatingPair::horiztonalPosition const): (WebCore::Layout::FloatingPair::bottom const): (WebCore::Layout::Iterator::Iterator): (WebCore::Layout::Iterator::operator++): (WebCore::Layout::Iterator::set): (WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted. (WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted. (WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted. (WebCore::Layout::FloatingContext::toContainingBlock const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::root const): (WebCore::Layout::FloatingState::layoutContext const): 2018-08-23 Zan Dobersek [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft https://bugs.webkit.org/show_bug.cgi?id=188881 Reviewed by Carlos Garcia Campos. Remove what's left of CoordinatedGraphicsLayerState usage in the CoordinatedGraphics subsystem. In CoordinatedGraphicsLayer, this means dropping the m_layerState member variable since at this point it is not used anymore in any capacity. Affected helper methods and member variables are also removed where possible. The syncLayerState() method on the CoordinatedGraphicsLayerClient interface is adjusted to not accept any parameters. Client should just mark frame synchronization as required while the layer state is now managed differently. Instead of the CoordinatedLayerID (which is removed) the Nicosia::PlatformLayer::LayerID alias is introduced as a layer ID type, aliased to the uint64_t type. CoordinatedGraphicsState.h file is rid of all structs except the basic CoordinatedGraphicsState struct that at this point contains only a reference to the Nicosia::Scene object. This will be further simplified in the patches that follow. * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::id const): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::didChangeAnimations): (WebCore::CoordinatedGraphicsLayer::didChangeChildren): (WebCore::CoordinatedGraphicsLayer::didChangeFilters): (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers): (WebCore::CoordinatedGraphicsLayer::didChangeGeometry): (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::setPosition): (WebCore::CoordinatedGraphicsLayer::setAnchorPoint): (WebCore::CoordinatedGraphicsLayer::setSize): (WebCore::CoordinatedGraphicsLayer::setTransform): (WebCore::CoordinatedGraphicsLayer::setChildrenTransform): (WebCore::CoordinatedGraphicsLayer::setPreserves3D): (WebCore::CoordinatedGraphicsLayer::setMasksToBounds): (WebCore::CoordinatedGraphicsLayer::setDrawsContent): (WebCore::CoordinatedGraphicsLayer::setContentsVisible): (WebCore::CoordinatedGraphicsLayer::setContentsOpaque): (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility): (WebCore::CoordinatedGraphicsLayer::setOpacity): (WebCore::CoordinatedGraphicsLayer::setContentsRect): (WebCore::CoordinatedGraphicsLayer::setContentsTileSize): (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase): (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor): (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder): (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter): (WebCore::CoordinatedGraphicsLayer::setMaskLayer): (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer): (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay): (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect): (WebCore::CoordinatedGraphicsLayer::setDebugBorder): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded): (WebCore::toCoordinatedLayerID): Deleted. (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Deleted. (WebCore::CoordinatedGraphicsLayer::syncChildren): Deleted. (WebCore::CoordinatedGraphicsLayer::syncFilters): Deleted. (WebCore::CoordinatedGraphicsLayer::syncLayerState): Deleted. (WebCore::CoordinatedGraphicsLayer::syncAnimations): Deleted. (WebCore::CoordinatedGraphicsLayer::resetLayerState): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: (): Deleted. (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): Deleted. (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): Deleted. 2018-08-22 Zan Dobersek [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer https://bugs.webkit.org/show_bug.cgi?id=188850 Reviewed by Michael Catanzaro. Remove the m_platformLayer member from the CoordinatedGraphicsLayer class as it's been unused since the rework in r235165. The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the related member variable can both be removed as well. On the CoordinatedGraphicsLayerState class, we can remove the obsolete flags and the TextureMapperPlatformLayerProxy member variable that's unused now that such objects are handled through the Nicosia impl class. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay): (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer): (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): 2018-08-22 Zan Dobersek [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer https://bugs.webkit.org/show_bug.cgi?id=188849 Reviewed by Michael Catanzaro. Remove the TiledBackingStoreClient inheritance from the CoordinatedGraphicsLayer class since it's not used anymore after changes made in r235165. Related TiledBackingStore objects on this class, along with tile state tracking member variables on the CoordinatedGraphicsLayerState class, are also removed. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::resetLayerState): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation): Deleted. (WebCore::CoordinatedGraphicsLayer::createTile): Deleted. (WebCore::CoordinatedGraphicsLayer::updateTile): Deleted. (WebCore::CoordinatedGraphicsLayer::removeTile): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): 2018-08-22 Zan Dobersek [CoordGraphics] Remove CoordinatedImageBacking and related functionality https://bugs.webkit.org/show_bug.cgi?id=188847 Reviewed by Michael Catanzaro. Remove the CoordinatedImageBacking class and its intertwining use in the CoordinatedGraphics system. Remove the now-unused m_coordinatedImageBacking member variable from the CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host inheritance. Various related helper methods are also removed. In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes, we are able to drop different CoordinatedImageBacking-related state values that are not used anymore. * platform/TextureMapper.cmake: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::setContentsToImage): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted. (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted. (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted. (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed. * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed. 2018-08-22 Ryosuke Niwa Store RefPtr in FocusNavigationScope https://bugs.webkit.org/show_bug.cgi?id=188864 Reviewed by Simon Fraser. Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer. * page/FocusController.cpp: (WebCore::FocusNavigationScope::parentInScope const): (WebCore::FocusNavigationScope::firstNodeInScope const): (WebCore::FocusNavigationScope::lastNodeInScope const): (WebCore::FocusNavigationScope::FocusNavigationScope): (WebCore::FocusNavigationScope::owner const): 2018-08-22 Jiewen Tan Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development" in features.json. * features.json: 2018-08-22 Wenson Hsieh [Attachment Support] Support dragging attachment elements out as files on macOS https://bugs.webkit.org/show_bug.cgi?id=181294 Reviewed by Tim Horton. Serialize a dragged attachment element as a web archive on macOS. This allows us to move attachment elements around a document by dragging, without performing a file upload upon every drop. Ideally, we should do this on iOS as well, but this currently causes attachment data to go missing; further investigation to fix this for iOS is tracked in . Tests: WKAttachmentTestsMac.DragAttachmentAsFilePromise WKAttachmentTests.MoveAttachmentElementAsIconByDragging * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): 2018-08-22 Aditya Keerthi [iOS] Add support for the inputmode attribute https://bugs.webkit.org/show_bug.cgi?id=183621 Reviewed by Tim Horton. Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL files. The possible values for the attribute are specified in InputModeNames. Test: fast/forms/inputmode-attribute.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLAttributeNames.in: * html/HTMLInputElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::inputMode const): (WebCore::HTMLTextFormControlElement::setInputMode): * html/HTMLTextFormControlElement.h: * html/InputModeNames.cpp: Added. (WebCore::InputModeNames::text): (WebCore::InputModeNames::tel): (WebCore::InputModeNames::url): (WebCore::InputModeNames::email): (WebCore::InputModeNames::numeric): (WebCore::InputModeNames::decimal): (WebCore::InputModeNames::search): * html/InputModeNames.h: Added. 2018-08-22 Eric Carlson Log more often during AirPlay state changes https://bugs.webkit.org/show_bug.cgi?id=188854 Always log some infrequent but important AirPlay state changes to make debugging easier. Reviewed by Jer Noble. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Low always. (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto. (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): Ditto. (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto. 2018-08-21 Ryosuke Niwa Focus navigation order in slot fallback contents is wrong https://bugs.webkit.org/show_bug.cgi?id=178001 Reviewed by Antti Koivisto. The bug here is that when a slot uses its fallback content, the fallback content's focus order doesn't get grouped by that of the slot. Consider the following DOM tree: - ShadowRoot - div tabindex = 2 - slot tabindex = 1 - span tabindex = 3 In this example, the sequential focus navigation should be slot, span, then div. Even though span has tabindex order of 3, which is lower than that of div, the fallback content of the slot should be grouped together before the focus moves out of the slot content. In WebKit, this concept of grouping elements for the sequential focus navigation ordering is implemeneted as FocusNavigationScope. Both ShadowRoot and HTMLSlotElement are treated as a focus scope owner but we had a bug that a slot element which uses its fallback content was not treated as a focus scope owner. This patch addresses the bug by treating a slot wich uses its fallback content as a focus scope owner. Test: fast/shadow-dom/focus-navigation-across-slots.html * page/FocusController.cpp: (WebCore::isFocusScopeOwner): Treat a slot elment hs a focus scope owner regardless of whether it has assigned nodes or not. (WebCore::FocusNavigationScope::SlotKind): Added. (WebCore::FocusNavigationScope::m_slotKind): Added. (WebCore::FocusNavigationScope::parentInScope const): Return null if `node` is a child of the slot element for which this FocusNavigationScope is created (i.e. `node` is slot's fallback content). (WebCore::FocusNavigationScope::firstNodeInScope const): Return the first child node when this FocusNavigationScope is for a slot element using its fallback content. (WebCore::FocusNavigationScope::lastNodeInScope const): Ditto for the last child. (WebCore::FocusNavigationScope::FocusNavigationScope): (WebCore::FocusNavigationScope::scopeOf): The scope of a child of a slot element which uses its fallback content is its slot element (i.e. the current node is a fallback content). We can't simply check the current node is a slot element which uses a fallback content since the scope of a slot element is the parent scope. e.g. its tree scope like ShadowRoot or Document inside which this slot element appears. (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Create the appropriate FocusNavigationScope based on whether the slot element has assigned or it uses its fallback content. 2018-08-22 David Kilzer Move files in WebCore project to match Xcode folder structure Reviewed by Tim Horton. * Scripts/LocalizableStrings.pm: Renamed from Source/WebCore/LocalizableStrings.pm. * Scripts/extract-localizable-strings.pl: Renamed from Source/WebCore/extract-localizable-strings.pl. * WebCore.xcodeproj/project.pbxproj: Update to match new location of files. * platform/audio/cocoa/WebAudioBufferList.cpp: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.cpp. * platform/audio/cocoa/WebAudioBufferList.h: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.h. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h. * platform/ios/wak/WAKViewInternal.h: Renamed from Source/WebCore/platform/WAKViewInternal.h. Also fix 3 webkit-style warnings. 2018-08-22 Zalan Bujtas [LFC][Floating] Move files to a dedicated directory. https://bugs.webkit.org/show_bug.cgi?id=188846 Reviewed by Simon Fraser. layout/Float* -> layout/floats * WebCore.xcodeproj/project.pbxproj: * layout/floatformatting/FloatingContext.cpp: Renamed from Source/WebCore/layout/FloatingContext.cpp. (WebCore::Layout::FloatingPair::isEmpty const): (WebCore::Layout::FloatingPair::verticalPosition const): (WebCore::Layout::Iterator::operator* const): (WebCore::Layout::begin): (WebCore::Layout::end): (WebCore::Layout::FloatingContext::FloatingContext): (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::floatingPosition const): (WebCore::Layout::FloatingContext::initialVerticalPosition const): (WebCore::Layout::FloatingContext::alignWithContainingBlock const): (WebCore::Layout::FloatingContext::alignWithFloatings const): (WebCore::Layout::FloatingContext::toContainingBlock const): (WebCore::Layout::FloatingPair::FloatingPair): (WebCore::Layout::FloatingPair::left const): (WebCore::Layout::FloatingPair::right const): (WebCore::Layout::FloatingPair::intersects const): (WebCore::Layout::FloatingPair::operator == const): (WebCore::Layout::FloatingPair::bottom const): (WebCore::Layout::Iterator::Iterator): (WebCore::Layout::previousFloatingIndex): (WebCore::Layout::Iterator::operator++): (WebCore::Layout::Iterator::set): (WebCore::Layout::Iterator::operator== const): (WebCore::Layout::Iterator::operator!= const): * layout/floatformatting/FloatingContext.h: Renamed from Source/WebCore/layout/FloatingContext.h. (WebCore::Layout::FloatingContext::floatingState const): (WebCore::Layout::FloatingContext::layoutContext const): * layout/floatformatting/FloatingState.cpp: Renamed from Source/WebCore/layout/FloatingState.cpp. (WebCore::Layout::FloatingState::FloatItem::FloatItem): (WebCore::Layout::FloatingState::FloatingState): (WebCore::Layout::belongsToThisFloatingContext): (WebCore::Layout::FloatingState::remove): (WebCore::Layout::FloatingState::append): (WebCore::Layout::FloatingState::bottom const): * layout/floatformatting/FloatingState.h: Renamed from Source/WebCore/layout/FloatingState.h. (WebCore::Layout::FloatingState::create): (WebCore::Layout::FloatingState::isEmpty const): (WebCore::Layout::FloatingState::FloatItem::layoutBox const): (WebCore::Layout::FloatingState::FloatItem::containingBlock const): (WebCore::Layout::FloatingState::FloatItem::displayBox const): (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const): (WebCore::Layout::FloatingState::floats const): (WebCore::Layout::FloatingState::last const): (WebCore::Layout::FloatingState::layoutContext const): (WebCore::Layout::FloatingState::root const): (WebCore::Layout::FloatingState::leftBottom const): (WebCore::Layout::FloatingState::rightBottom const): (WebCore::Layout::FloatingState::bottom const): 2018-08-22 Rob Buis Fetch: Stop checking Request.integrity's value in no-cors mode https://bugs.webkit.org/show_bug.cgi?id=188802 Reviewed by Frédéric Wang. Remove this check since it was removed from the spec. Behavior matches Chrome and Firefox. Test: http/tests/subresource-integrity/sri-fetch.js: * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeOptions): 2018-08-22 Youenn Fablet Mark MediaStream Recording API as under consideration https://bugs.webkit.org/show_bug.cgi?id=188822 Reviewed by Jon Lee. * features.json: 2018-08-22 Ms2ger [GTK] Never return an uninitialized ImageGStreamer object. https://bugs.webkit.org/show_bug.cgi?id=188305 Reviewed by Philippe Normand. The single caller was already checking for a null return value, so make that check actually do something. Also remove the null-check on the return value of image(), which asserted that it would never return null. Test: fast/canvas/canvas-createPattern-video-loading.html * platform/graphics/gstreamer/ImageGStreamer.h: (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created. (WebCore::ImageGStreamer::image): Return a reference. (WebCore::ImageGStreamer::rect): Always assert that m_image is present. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature. 2018-08-22 Zalan Bujtas Add changes missing from r234925. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::isMarginBottomCollapsedThrough): (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-08-22 Zan Dobersek [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking https://bugs.webkit.org/show_bug.cgi?id=188693 Reviewed by Carlos Garcia Campos. Populate Nicosia::CompositionLayer with additional LayerState member objects. For now we're using pending, staging and committed states, though it might be possible to narrow down these to just two. Pending state contains state that will be moved to staging during the final steps of the next layer flush. flushState() method accumulates all state changes in the staging state, and also allows the caller to additionally perform flushing operations that are specific to backing store, image backing or content layer containers. commitState() method moves staging state over into the committed state, again allowing user to pass a functor that receives the just-committed state and apply it to their composition engine. Changes in state objects are done under a thread-safe lock. This might not be completely necessary at this point, but will be useful when additonal layer state updates will be coming from e.g. the scrolling thread. It might also make sense to tie in this lock use with the Nicosia::Scene lock in the future. Nicosia::ContentLayerTextureMapperImpl is modified slightly to allow determining during flushes whether an update is pending. This is necessary for a special case in ThreadedCompositor where content (i.e. platform) layers like WebGL or video require an additional level of scene update coordination. This complete special case has to go through another review to see whether it's still necessary. Ideally we would be able to remove it. CoordinatedGraphicsLayer is finally switched over to using Nicosia layer objects for state updates of any kind. This patch only adds all the necessary bits, but doesn't yet remove any of the existing code (but rather disables it temporarily, before it's removed). Updating of simple state values is already in place. For backing stores, the flushCompositingStateForThisLayerOnly() method now takes care of preparing the backing store object if necessary as per layer state, while the updateContentBuffers() method is switched to operate with TiledBackingStore objects now kept on the BackingStoreTextureMapperImpl instance associated with that backing store. Helper methods like adjustContentsScale() and createBackingStore(), only called from the updateContentBuffers() method, are removed and the code there inlined. For image-backed layers, the update is now done directly in the flushCompositingStateForThisLayerOnly() method, if necessary. The helper syncImageBacking() method is commented out in order to prevent double-painting of image buffers for now, but all this (along with the CoordinatedImageBacking logic in CompositingCoordinator) will be removed later. For layers backed by platform layer objects, integration is relatively simple. setContentsToPlatformLayer() is changed to properly handle any passed-in platform layer object, and updatePlatformLayer() invokes the swapBuffersIfNeeded() method on the ContentLayerTextureMapperImpl object during each flush, if necessary. In order to ensure any Nicosia-specific state update properly triggers a composition update, m_nicosia.performLayerUpdate is added and flipped to true during the flush in case of any state change. This then triggers a layer sync in the CompositingCoordinator object when the syncPendingStateChangesIncludingSubLayers() method is called. While no old-style layer state update is provided, it causes the necessary synchronization step that properly picks up the Nicosia-provided state changes. Once the old-style layer state tracking is removed, this method of update triggering will have to be updated as well. * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::commitState): (Nicosia::CompositionLayer::accessCommitted): * platform/graphics/nicosia/NicosiaScene.h: * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::flushUpdate): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay): (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer): (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): (WebCore::CoordinatedGraphicsLayer::adjustContentsScale): Deleted. (WebCore::CoordinatedGraphicsLayer::createBackingStore): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2018-08-22 David Kilzer Remove stale file references in WebCore Xcode project I manually removed these using Xcode and verified that there was a commit that removed the original files. Found by tool created for Bug 188754: Tool to fix folders that should map to directories in Xcode project files. * WebCore.xcodeproj/project.pbxproj: (dom/DOMExceptions.in): Removed in r219741. (Modules/modern-media-controls/start-button.js): (Modules/modern-media-controls/volume-slider.css): (Modules/modern-media-controls/icon-button.css): (Modules/modern-media-controls/volume-slider.js): (Modules/modern-media-controls/macos-media-controls.js): (Modules/modern-media-controls/ios-inline-media-controls.css): (Modules/modern-media-controls/scrubber.css): (Modules/modern-media-controls/start-button.css): (Modules/modern-media-controls/scrubber.js): (Modules/modern-media-controls/icon-button.js): (Modules/modern-media-controls/macos-compact-inline-media-controls.css): (Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png): (Modules/modern-media-controls/images/iOS/start@1x.png): (Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png): (Modules/modern-media-controls/images/iOS/pause@2x.png): (Modules/modern-media-controls/images/iOS/play@3x.png): (Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png): (Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png): (Modules/modern-media-controls/images/iOS/pip-in@2x.png): (Modules/modern-media-controls/images/iOS/start@3x.png): (Modules/modern-media-controls/images/iOS/airplay@1x.png): (Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png): (Modules/modern-media-controls/images/iOS/slider-thumb@2x.png): (Modules/modern-media-controls/images/iOS/airplay@2x.png): (Modules/modern-media-controls/images/iOS/pause@3x.png): (Modules/modern-media-controls/images/iOS/pip-in@3x.png): (Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png): (Modules/modern-media-controls/images/iOS/pause@1x.png): (Modules/modern-media-controls/images/iOS/start@2x.png): (Modules/modern-media-controls/images/iOS/play@2x.png): (Modules/modern-media-controls/images/iOS/pip-in@1x.png): (Modules/modern-media-controls/images/iOS/play@1x.png): (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png): (Modules/modern-media-controls/images/macOS/rewind@1x.png): (Modules/modern-media-controls/images/macOS/play@2x.png): (Modules/modern-media-controls/images/macOS/volume-mute@2x.png): (Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/volume@2x.png): (Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png): (Modules/modern-media-controls/images/macOS/volume-compact@2x.png): (Modules/modern-media-controls/images/macOS/start@2x.png): (Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/airplay@2x.png): (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png): (Modules/modern-media-controls/images/macOS/airplay@1x.png): (Modules/modern-media-controls/images/macOS/pip-in@1x.png): (Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png): (Modules/modern-media-controls/images/macOS/rewind@2x.png): (Modules/modern-media-controls/images/macOS/play-compact@1x.png): (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/volume@1x.png): (Modules/modern-media-controls/images/macOS/pip-in@2x.png): (Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png): (Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/pause-compact@1x.png): (Modules/modern-media-controls/images/macOS/start@1x.png): (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/play@1x.png): (Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/forward@1x.png): (Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/pause@1x.png): (Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png): (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png): (Modules/modern-media-controls/images/macOS/pause@2x.png): (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/volume-compact@1x.png): (Modules/modern-media-controls/images/macOS/play-compact@2x.png): (Modules/modern-media-controls/images/macOS/media-selection@2x.png): (Modules/modern-media-controls/images/macOS/forward@2x.png): (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png): (Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png): (Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/media-selection@1x.png): (Modules/modern-media-controls/images/macOS/volume-mute@1x.png): (Modules/modern-media-controls/images/macOS/pause-compact@2x.png): (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png): (Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png): (Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png): (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png): (Modules/modern-media-controls/media/time-labels-support.js): - Removed in r217823. (Modules/webvr/VRDisplayCapabilities.cpp): Removed in r229089. (Modules/webvr/VRFieldOfView.cpp): Removed in r228819. (rendering/svg/RenderSVGAllInOne.cpp): Removed in r234655. 2018-08-22 Carlos Garcia Campos Do not try to update the compositing policy when not in accelerated compositing mode https://bugs.webkit.org/show_bug.cgi?id=188787 Reviewed by Simon Fraser. RenderLayerCompositor::updateCompositingPolicy() is called very often (called from RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though. Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode. 2018-08-21 Yusuke Suzuki Support "name" option for dedicated workers https://bugs.webkit.org/show_bug.cgi?id=188779 Reviewed by Joseph Pecoraro. This patch adds `new Worker(url, { name: "Worker Name" })` option support[1]. This name can be accessible from `self.name` of DedicatedWorkerGlobalScope. It is useful for debugging dedicated workers if the inspector can show the names of the workers. This enhancement is tracked by [2]. [1]: https://github.com/whatwg/html/issues/2477 [2]: https://bugs.webkit.org/show_bug.cgi?id=164678 Tests: http/wpt/workers/name-property-enhanced.html http/wpt/workers/name-property-no-name.html * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): Hold `name` member. * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerGlobalScope.idl: Add `name` attribute. * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/Worker.cpp: (WebCore::Worker::Worker): (WebCore::Worker::create): (WebCore::Worker::notifyFinished): * workers/Worker.h: * workers/Worker.idl: Add WorkerOptions for dedicated worker creation. * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Isolate copy the given `name` to pass the worker thread. (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): (WebCore::ServiceWorkerThread::createWorkerGlobalScope): * workers/service/context/ServiceWorkerThread.h: 2018-08-21 Ryosuke Niwa Replace booleans for modifier keys in UIEventWithKeyState with OptionSet https://bugs.webkit.org/show_bug.cgi?id=188777 Reviewed by Simon Fraser. Replaced boolean arguments and instance variables for modifier keys (ctrl, alt, shift, and meta keys) in UIEventWithKeyState with OptionSet and isSimulated boolean in MouseRelatedEvent with IsSimulated enum class. Also made movementDelta always compiled instead of only when ENABLE(POINTER_LOCK) to simplify the code. No new tests since there should be no observable behavioral change. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): (WebCore::KeyboardEvent::initKeyboardEvent): Call setModifierKeys. * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): (WebCore::MouseEvent::MouseEvent): (WebCore::MouseEvent::initMouseEvent): Ditto. * dom/MouseEvent.h: * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::MouseRelatedEvent): Added a new variant which takes the minimum arguments for gesture & touch events. In those events, detail is always set to 0, movementDelta is always set to 0,0, and they are never simulated. * dom/MouseRelatedEvent.h: (WebCore::MouseRelatedEvent::IsSimulated): Added. * dom/SimulatedClick.cpp: (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Get OptionSet out of the underlying event instead of manually setting each key state. This code now preserves the state of caps lock and alt-graph keys but this is not observable because we have yet to implement getModifierState on MouseEvent. (WebCore::SimulatedMouseEvent::modifiersFromUnderlyingEvent): Added. * dom/TouchEvent.cpp: (WebCore::TouchEvent::TouchEvent): * dom/TouchEvent.h: * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::Modifier): Alias to PlatformEvent::Modifier. (WebCore::UIEventWithKeyState::ctrlKey const): Updated to use m_modifiers. (WebCore::UIEventWithKeyState::shiftKey const): Ditto. (WebCore::UIEventWithKeyState::altKey const): Ditto. (WebCore::UIEventWithKeyState::metaKey const): Ditto. (WebCore::UIEventWithKeyState::altGraphKey const): Ditto. (WebCore::UIEventWithKeyState::capsLockKey const): Ditto. (WebCore::UIEventWithKeyState::modifierKeys): Added. (WebCore::UIEventWithKeyState::UIEventWithKeyState): Now takes OptionSet. (WebCore::UIEventWithKeyState::setModifierKeys): Added. Used by init*Event functions in subclasses. Note that these functions preseve the states of alt-graph and caps lock keys to match the existing behaviors in this cleanup patch but they don't match behaviors of Chrome or Firefox. (WebCore::UIEventWithKeyState::modifiersFromInitializer): Added. * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): Simulated::No corresponds to the last boolean being false. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchDragEvent): (WebCore::EventHandler::handleTouchEvent): * platform/PlatformEvent.h: (WebCore::PlatformEvent::Modifier): Added AltGraphKey. * platform/mac/PlatformEventFactoryMac.h: (WebCore::modifiersForEvent): Exported to be used in [WebPDFView PDFViewWillClickOnLink:withURL:]. * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * testing/Internals.cpp: (WebCore::Internals::accessKeyModifiers const): 2018-08-21 Wenson Hsieh [Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation https://bugs.webkit.org/show_bug.cgi?id=188715 Reviewed by Tim Horton. Rename didInsertAttachment to didInsertAttachmentWithIdentifier. See WebKit ChangeLog for more detail. Tests: WKAttachmentTests.InvalidateAttachmentsAfterMainFrameNavigation WKAttachmentTests.InvalidateAttachmentsAfterWebProcessTermination * editing/Editor.cpp: (WebCore::Editor::notifyClientOfAttachmentUpdates): * page/EditorClient.h: (WebCore::EditorClient::didInsertAttachmentWithIdentifier): (WebCore::EditorClient::didRemoveAttachmentWithIdentifier): (WebCore::EditorClient::didInsertAttachment): Deleted. (WebCore::EditorClient::didRemoveAttachment): Deleted. 2018-08-21 Ryan Haddad Unreviewed, rolling out r235128. The test added with this change is frequently failing. Reverted changeset: "Support "name" option for dedicated workers" https://bugs.webkit.org/show_bug.cgi?id=188779 https://trac.webkit.org/changeset/235128 2018-08-21 Commit Queue Unreviewed, rolling out r235107. https://bugs.webkit.org/show_bug.cgi?id=188832 "It revealed bugs in Blob code as well as regressed JS performance tests" (Requested by saamyjoon on #webkit). Reverted changeset: "JSRunLoopTimer may run part of a member function after it's destroyed" https://bugs.webkit.org/show_bug.cgi?id=188426 https://trac.webkit.org/changeset/235107 2018-08-21 Megan Gardner Use VisiblePosition to calculate selection ranges https://bugs.webkit.org/show_bug.cgi?id=188767 Reviewed by Ryosuke Niwa. Exposing comparePositions. * editing/Editing.h: 2018-08-21 Wenson Hsieh [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData https://bugs.webkit.org/show_bug.cgi?id=188496 Reviewed by Tim Horton. Refactors logic around HTMLAttachmentElement and pasteboard reading helpers, in support of moving the data backing for attachment elements to the client layer, instead of keeping it in the attachment element's File. Augmented existing API tests in WKAttachmentTests, and also added a new API test (see Tools for more detail). * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::didInsertAttachmentElement): Notify the client layer when a newly inserted attachment element's identifier has been updated to avoid colliding with the identifier of an existing attachment element. This can happen if, for instance, one or more attachments are copied and pasted within the same document. * editing/Editor.cpp: (WebCore::Editor::registerAttachmentIdentifier): (WebCore::Editor::cloneAttachmentData): Add new helper functions to notify the client when the attachment identifier to data mapping needs to be updated. This can happen in three ways: (1) an attachment is created with raw data, or (2) an attachment is created with a file path, or (3) the unique identifier for an attachment element has been reassigned. These correspond to the two versions of `registerAttachmentIdentifier`, and `cloneAttachmentData`, respectively. (WebCore::EditorClient::supportsClientSideAttachmentData const): Add a new EditorClient hook to determine whether client-side attachment data management is supported. Currently, this only returns true for WebKit2. If this flag is set to true, we register attachment identifiers and don't create a new File object for the attachment element; otherwise, fall back to creating and setting a File for the new attachment element. (WebCore::Editor::insertAttachment): (WebCore::Editor::insertAttachmentFromFile): Deleted. Adjust logic when inserting an attachment; we now only need to update the attributes of the attachment element with metadata from the client layer. * editing/Editor.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::supportsClientSideAttachmentData): (WebCore::createFragmentForImageAttachment): Notify the client when creating an attachment element from image data on the pasteboard. (WebCore::replaceRichContentWithAttachments): Refactor this helper function to no longer connect attachment elements to File objects created from subresources. Instead, just update each attachment element's attributes using information about the subresource, and then notify the client about the new attachment data and attachment identifier. (WebCore::createFragmentAndAddResources): (WebCore::sanitizeMarkupWithArchive): Plumb the current WebContentReader's Frame& to each of these helpers, so that it can call out to the client. (WebCore::WebContentReader::readWebArchive): (WebCore::WebContentMarkupReader::readWebArchive): (WebCore::WebContentReader::readImage): (WebCore::WebContentReader::readFilePaths): Notify the client when creating an attachment from the path of a dropped file. * html/AttachmentTypes.h: Remove AttachmentInfo. This is no longer necessary because we don't need to request attachment data from the web process anymore. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier): Add a helper function on the attachment element to create and return a unique identifier if needed. (WebCore::HTMLAttachmentElement::updateAttributes): Add a helper method to update the displayed element attributes (type, title and subtitle) or an attachment. (WebCore::AttachmentDataReader::create): Deleted. (WebCore::AttachmentDataReader::AttachmentDataReader): Deleted. Remove AttachmentDataReader. This helper class was only used to load attachment data when requesting attachment information in the client, but this is now obviated by moving attachment data to the client layer. (WebCore::HTMLAttachmentElement::updateFileWithData): Deleted. (WebCore::HTMLAttachmentElement::requestInfo): Deleted. (WebCore::HTMLAttachmentElement::destroyReader): Deleted. (WebCore::AttachmentDataReader::~AttachmentDataReader): Deleted. (WebCore::AttachmentDataReader::didFinishLoading): Deleted. (WebCore::AttachmentDataReader::didFail): Deleted. (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading): Deleted. * html/HTMLAttachmentElement.h: * page/DragClient.h: * page/DragController.cpp: (WebCore::DragController::startDrag): (WebCore::DragController::doSystemDrag): (WebCore::DragController::promisedAttachmentInfo): Allow dragging an attachment (even if it does not have a file) as long as it has a unique identifier and a content type. (WebCore::DragController::promisedBlobInfo): Deleted. * page/DragController.h: * page/EditorClient.h: (WebCore::EditorClient::registerAttachmentIdentifier): (WebCore::EditorClient::cloneAttachmentData): * platform/DragItem.h: (WebCore::DragItem::encode const): (WebCore::DragItem::decode): * platform/PromisedAttachmentInfo.h: Renamed from Source/WebCore/platform/PromisedBlobInfo.h. Add an attachment identifier to PromisedBlobInfo. Additionally, rename PromisedBlobInfo to PromisedAttachmentInfo, since it is currently exclusively used to attachment element data to the pasteboard. In the future, this could be renamed to something more general (e.g. PromisedPasteboardData), should we use this mechanism to write data from other sources to the pasteboard. (WebCore::PromisedAttachmentInfo::operator bool const): 2018-08-21 Brent Fulgham Remove experimental affiliated domain code now that StorageAccess API is available https://bugs.webkit.org/show_bug.cgi?id=188756 Reviewed by Alex Christensen. In Bug 174661 we added a compatibility quirk to support wsj.com authentication. This quirk is no longer needed, since the StorageAccess API provides the necessary tools to do this type of interaction without needing global cross-site access. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logSubresourceLoading): (WebCore::ResourceLoadObserver::logWebSocketLoading): (WebCore::areDomainsAssociated): Deleted. (WebCore::shouldEnableSiteSpecificQuirks): Deleted. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::areDomainsAssociated): Deleted. * loader/ResourceLoadStatistics.h: 2018-08-21 Antti Koivisto Allow creating WeakPtrs to const objects https://bugs.webkit.org/show_bug.cgi?id=188785 Reviewed by Geoffrey Garen. Remove some unneeded const_casts. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::MediaQueryEvaluator): (WebCore::MediaQueryEvaluator::evaluate const): * css/MediaQueryEvaluator.h: * rendering/FloatingObjects.cpp: (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter): (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter): (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter): (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter): (WebCore::FloatingObjects::FloatingObjects): * rendering/FloatingObjects.h: (WebCore::FloatingObjects::renderer const): 2018-08-21 Yusuke Suzuki Support "name" option for dedicated workers https://bugs.webkit.org/show_bug.cgi?id=188779 Reviewed by Joseph Pecoraro. This patch adds `new Worker(url, { name: "Worker Name" })` option support[1]. This name can be accessible from `self.name` of DedicatedWorkerGlobalScope. It is useful for debugging dedicated workers if the inspector can show the names of the workers. This enhancement is tracked by [2]. [1]: https://github.com/whatwg/html/issues/2477 [2]: https://bugs.webkit.org/show_bug.cgi?id=164678 * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): Hold `name` member. * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerGlobalScope.idl: Add `name` attribute. * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/Worker.cpp: (WebCore::Worker::Worker): (WebCore::Worker::create): (WebCore::Worker::notifyFinished): * workers/Worker.h: * workers/Worker.idl: Add WorkerOptions for dedicated worker creation. * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Isolate copy the given `name` to pass the worker thread. (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): (WebCore::ServiceWorkerThread::createWorkerGlobalScope): * workers/service/context/ServiceWorkerThread.h: 2018-08-21 Per Arne Vollan [WebGL] Contexts are not updated when display configuration changed. https://bugs.webkit.org/show_bug.cgi?id=188750 Reviewed by Brent Fulgham. Calling CGDisplayRegisterReconfigurationCallback in GraphicsContext3DManager::addContext returns kCGErrorSuccess when WindowServer access is blocked in the WebContent process, but the callback function is never called. We should register the callback function in the UI process, and send a message to the WebContent process when the display configuration changed. Test: fast/canvas/webgl/context-update-on-display-configuration.html * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContext3DManager.cpp: (WebCore::GraphicsContext3DManager::displayWasReconfigured): (WebCore::GraphicsContext3DManager::addContext): (WebCore::GraphicsContext3DManager::removeContext): (WebCore::displayWasReconfigured): Deleted. * platform/graphics/GraphicsContext3DManager.h: 2018-08-21 John Wilander Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames https://bugs.webkit.org/show_bug.cgi?id=188757 Reviewed by Alex Christensen. Test: http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::connect): Now logs even when a frame doesn't exist. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::shouldLog const): Now takes boolean 'usesEphemeralSession' instead of a page to support logging when there is no page. (WebCore::ResourceLoadObserver::logSubresourceLoading): Changed to send a boolean to ResourceLoadObserver::shouldLog(). (WebCore::ResourceLoadObserver::logWebSocketLoading): Changed to: - receive the main frame's URL and a boolean for ephemeral sessions instead of the Frame. - send a boolean to ResourceLoadObserver::shouldLog(). - No longer call areDomainsAssociated(). It is being removed in https://bugs.webkit.org/show_bug.cgi?id=188756. (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Changed to send a boolean to ResourceLoadObserver::shouldLog(). * loader/ResourceLoadObserver.h: 2018-08-21 Daniel Bates Disallow navigations when page cache updates the current document of the frame https://bugs.webkit.org/show_bug.cgi?id=188422 Reviewed by Ryosuke Niwa. Make use of NavigationDisabler to disallow navigations when associating the cached document back with its frame (i.e. calling Frame::setDocument()). When we associate a cached document with its frame we will construct its render tree and run post style resolution callbacks that can do anything, including performing a frame load. Until page restoration is comnplete the frame tree is in a transient state that makes reasoning about it difficult and error prone. We should not allow navigations in this state. Test: fast/history/go-back-to-object-subframe.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::open): 2018-08-21 Daniel Bates Replace TextCheckingTypeMask with OptionSet https://bugs.webkit.org/show_bug.cgi?id=188678 Reviewed by Antti Koivisto. Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally change the values of TextCheckingType such that all the enumerators fit within an uint8_t. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::hasMisspelling const): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributeStringSetSpelling): * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::isAutomaticTextReplacementType): (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work around the following MSVC compiler bug: . (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::editorUIUpdateTimerFired): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/Editor.h: * editing/SpellChecker.cpp: (WebCore::SpellCheckRequest::SpellCheckRequest): (WebCore::SpellCheckRequest::create): (WebCore::SpellChecker::didCheckSucceed): * editing/SpellChecker.h: * editing/TextCheckingHelper.cpp: (WebCore::findGrammaticalErrors): (WebCore::findMisspellings): (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): (WebCore::checkTextOfParagraph): * editing/TextCheckingHelper.h: * loader/EmptyClients.cpp: * platform/text/TextCheckerClient.h: * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default) the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor. (WebCore::TextCheckingRequestData::TextCheckingRequestData): (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String& to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in this string. (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask. (WebCore::TextCheckingRequestData::mask const): Deleted. * platform/text/mac/TextCheckingMac.mm: Added. (WebCore::nsTextCheckingTypes): * testing/Internals.cpp: (WebCore::Internals::handleAcceptedCandidate): 2018-08-21 Fujii Hironori Don't place "using namespace XXX;" in global space for unified source builds https://bugs.webkit.org/show_bug.cgi?id=188739 Reviewed by Yusuke Suzuki. No new tests (No behavior change). * html/track/AudioTrackList.cpp: * html/track/TextTrackList.cpp: * html/track/VideoTrackList.cpp: * page/SecurityOriginData.cpp: * page/TextIndicator.cpp: * platform/geoclue/GeolocationProviderGeoclue.cpp: * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: * platform/graphics/win/FullScreenController.cpp: * platform/mediastream/CaptureDeviceManager.cpp: * platform/mock/MediaPlaybackTargetPickerMock.cpp: * svg/animation/SMILTime.cpp: * testing/js/WebCoreTestSupport.cpp: * xml/XPathParser.cpp: 2018-08-21 Philippe Normand [GStreamer] Warn early about incomplete MSE track switching support https://bugs.webkit.org/show_bug.cgi?id=188653 Reviewed by Xabier Rodriguez-Calvar. The proper track switching support shall be fixed at some point by: https://bugs.webkit.org/show_bug.cgi?id=182531. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test. (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if this method is called by the MSE player. 2018-08-21 Philippe Normand [GStreamer][MSE] Generic main thread notification support https://bugs.webkit.org/show_bug.cgi?id=188647 Reviewed by Xabier Rodriguez-Calvar. Using GstBus for main thread notifications has the side effect of "leaking" the application messages to the media player, leading to CPU cycles wasting. No new tests, existing MSE tests cover this change. * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webkit_media_src_init): (webKitMediaSrcFinalize): (webKitMediaSrcSetMediaPlayerPrivate): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: 2018-08-21 Philippe Normand [GStreamer][MSE] Remove parsers from playback pipeline https://bugs.webkit.org/show_bug.cgi?id=188646 Reviewed by Xabier Rodriguez-Calvar. Decodebin already includes parsers in front of the decoders. No new tests, existing MSE tests cover this change. * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::addSourceBuffer): (WebCore::PlaybackPipeline::attachTrack): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcLinkSourcePad): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: 2018-08-21 Commit Queue Unreviewed, rolling out r234979. https://bugs.webkit.org/show_bug.cgi?id=188780 broke ubuntu LTS build (Requested by philn on #webkit). Reverted changeset: "[GTK] Never return an uninitialized ImageGStreamer object." https://bugs.webkit.org/show_bug.cgi?id=188305 https://trac.webkit.org/changeset/234979 2018-08-21 Saam barati JSRunLoopTimer may run part of a member function after it's destroyed https://bugs.webkit.org/show_bug.cgi?id=188426 Reviewed by Mark Lam. * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformThreadBody): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformThreadBody): 2018-08-20 Devin Rousso Web Inspector: allow breakpoints to be set for specific event listeners https://bugs.webkit.org/show_bug.cgi?id=183138 Reviewed by Joseph Pecoraro. Test: inspector/dom/breakpoint-for-event-listener.html * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getEventListenersForNode): (WebCore::InspectorDOMAgent::setEventListenerDisabled): (WebCore::InspectorDOMAgent::setBreakpointForEventListener): Added. (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): Added. (WebCore::InspectorDOMAgent::buildObjectForEventListener): (WebCore::InspectorDOMAgent::willRemoveEventListener): (WebCore::InspectorDOMAgent::isEventListenerDisabled): (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Added. (WebCore::InspectorDOMAgent::idForEventListener): Added. Rework the event listener data structure to be based on ID instead of `EventListener`, since it is possible to have the same `EventListener` be used for multiple events. * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Added. (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): For DOM events, also check to see if there is a matching event listener specific breakpoint set via the DOMAgent, and break on it if one is found. * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInstallTimerImpl): (WebCore::InspectorInstrumentation::didRemoveTimerImpl): (WebCore::InspectorInstrumentation::willHandleEventImpl): (WebCore::InspectorInstrumentation::willFireTimerImpl): (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl): (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl): (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl): Split off `pauseOnNativeEventIfNeeded` to only handle non-DOM events, since all DOM events would already only go through `willHandleEvent`. 2018-08-20 Michael Catanzaro [CMake] Sync unified build with Cocoa ports https://bugs.webkit.org/show_bug.cgi?id=188732 Reviewed by Tim Horton. For iOS, disambiguate between ::WebEvent declared in PlatformKeyboardEvent.h and WebCore::WebEvent declared in WebEvent.h. It's expected that we'll have to deal with random issues like this when modifying unrelated source files in higher-level projects, since any change to the sources list changes which files get bundled together, and headers from lower-level projects that were not included before may now be included together. * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::event const): 2018-08-20 David Kilzer REGRESSION (r223192): Remove invalid `path` for Modules/geolocation/ios folder * WebCore.xcodeproj/project.pbxproj: Remove invalid `path` setting for WebCore/Modules/geolocation/ios folder. This was found while working on a script for Bug 188754: Tool to fix folders that should map to directories in Xcode project files. 2018-08-20 David Kilzer REGRESSION (r235015): Xcode changes `mainGroup` name when updating WebCore project file * WebCore.xcodeproj/project.pbxproj: - Change `name` to "WebCore" within the group used by `mainGroup` so Xcode won't keep changing its value back to "WebKit". 2018-08-20 Jeremy Jones UIWebView crashes while attempting to play youtube video on phone https://bugs.webkit.org/show_bug.cgi?id=188351 rdar://problem/42489664 Reviewed by David Kilzer. Test will be incorporated with fix for 188749, which will test both fixes. VideoFullscreenControllerContext must remove unretained reference to it from m_playbackModel during cleanup. * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::didCleanupFullscreen): 2018-08-20 Eric Carlson [MediaStream] Move capture device monitoring to WebKit https://bugs.webkit.org/show_bug.cgi?id=188521 Reviewed by Youenn Fablet. No new tests, updated fast/mediastream/device-change-event-2.html for the changes. * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): Device change listener is added in addEventListener. (WebCore::MediaDevices::stop): Device change listener is on the user media controller. (WebCore::MediaDevices::addEventListener): Add the device change listener only once the first event handler is added. * Modules/mediastream/MediaDevices.h: * Modules/mediastream/UserMediaClient.h: * Modules/mediastream/UserMediaController.h: (WebCore::UserMediaController::addDeviceChangeObserver): Pass through to the client. (WebCore::UserMediaController::removeDeviceChangeObserver): Ditto. * platform/mediastream/CaptureDeviceManager.cpp: (CaptureDeviceManager::deviceChanged): Notify RealtimeMediaSourceCenter. (nextObserverToken): Deleted. (CaptureDeviceManager::addCaptureDeviceChangedObserver): Deleted. (CaptureDeviceManager::removeCaptureDeviceChangedObserver): Deleted. * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::setDevicesChangedObserver): (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged): (WebCore::observerMap): Deleted. (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Deleted. (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Deleted. * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Call base class. * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto. (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto. * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::deviceHasInputStreams): Drive-by fix, check the number of buffers to see if the device has input streams. (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): Use new bool parameter added to refreshAudioCaptureDevices so we won't trigger a device change event on the first scan. (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): Add param. (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Use new param. * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setDevices): Don't need to call captureDevicesChanged, it is done in the UI process. (WebCore::MockRealtimeMediaSourceCenter::addDevice): Ditto. (WebCore::MockRealtimeMediaSourceCenter::removeDevice): Ditto. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setPageIsFocusedAndActive): New, used by updated test. * testing/Internals.h: * testing/Internals.idl: 2018-08-20 Rob Buis Throw an exception if window.open() gets passed a URL that cannot be parsed https://bugs.webkit.org/show_bug.cgi?id=171656 Reviewed by Darin Adler. Throw a SyntaxError exception when an invalid url gets passed into window.open(). Tests: imported/w3c/web-platform-tests/url/failure.html fast/dom/Window/open-invalid-url.html * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): (WebCore::DOMWindow::open): (WebCore::DOMWindow::showModalDialog): * page/DOMWindow.h: * page/DOMWindow.idl: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2018-08-20 Ms2ger [SOUP] Check length before calling soup_message_body_append_buffer. https://bugs.webkit.org/show_bug.cgi?id=176803 Reviewed by Carlos Garcia Campos. The function has a precondition that the buffer is non-empty. Test: http/tests/local/blob/send-hybrid-blob-using-open-panel.html * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::appendEncodedBlobItemToSoupMessageBody): (WebCore::ResourceRequest::updateSoupMessageBody const): 2018-08-20 Rob Buis Relax Request constructor around referrers https://bugs.webkit.org/show_bug.cgi?id=168649 Reviewed by Darin Adler. Implement remaining part of fetch change https://github.com/whatwg/fetch/pull/377, i.e. if "parsedReferrer’s origin is not same origin with origin", then set request’s referrer to "client", instead of throwing an exception [1]. WebKit's new behavior matches that of Chrome and Firefox. Testing is covered by existing wpt tests. [1] Step 15.3.3 of https://fetch.spec.whatwg.org/#main-fetch * Modules/fetch/FetchRequest.cpp: (WebCore::computeReferrer): 2018-08-19 Yusuke Suzuki Shrink size of WebCore::Event further by reordering members https://bugs.webkit.org/show_bug.cgi?id=188734 Reviewed by Daniel Bates. Since WebCore::Event is ref-counted class, it has 4bytes m_refCount at the head of the class. So placing 4bytes just after that before placing 8bytes aligned member (like pointers in 64bit platforms) can save the size of WebCore::Event further. This patch reorders members of WebCore::Event to shrink the size from 80bytes to 72bytes. No behavior change. * dom/Event.cpp: (WebCore::Event::Event): * dom/Event.h: 2018-08-18 David Kilzer Let Xcode have its way with the WebCore project * WebCore.xcodeproj/project.pbxproj: - Let Xcode sort recently added resources by unique ID. - Manually change the `mainGroup` name from "WebKit" to "WebCore". There's no need to do this other than to make the inside of the proverbial cabinet match the outside. It's been this way since the project file was committed in r9857. 2018-08-18 Ali Juma [IntersectionObserver] Fire an initial dummy notification https://bugs.webkit.org/show_bug.cgi?id=188670 Reviewed by Simon Fraser. Add logic to track ongoing intersection observations. Create an IntersectionObserverRegistration and fire a single dummy notification for each one. Test: intersection-observer/root-element-moved.html Also tested by existing tests in imported/w3c/web-platform-tests/intersection-observer. * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::addIntersectionObserver): (WebCore::Document::removeIntersectionObserver): (WebCore::Document::updateIntersectionObservations): (WebCore::Document::notifyIntersectionObserversTimerFired): * dom/Document.h: (WebCore::Document::numberOfIntersectionObservers const): * dom/Element.cpp: (WebCore::Element::didMoveToNewDocument): (WebCore::Element::disconnectFromIntersectionObservers): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::~IntersectionObserver): (WebCore::IntersectionObserver::observe): (WebCore::IntersectionObserver::unobserve): (WebCore::IntersectionObserver::disconnect): (WebCore::IntersectionObserver::takeRecords): (WebCore::IntersectionObserver::targetDestroyed): (WebCore::IntersectionObserver::removeTargetRegistration): (WebCore::IntersectionObserver::removeAllTargets): (WebCore::IntersectionObserver::rootDestroyed): (WebCore::IntersectionObserver::appendQueuedEntry): (WebCore::IntersectionObserver::notify): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::trackingDocument): (WebCore::IntersectionObserver:: const): (WebCore::IntersectionObserver::hasObservationTargets const): * page/IntersectionObserver.idl: * testing/Internals.cpp: (WebCore::Internals::numberOfIntersectionObservers const): * testing/Internals.h: * testing/Internals.idl: 2018-08-18 Wenson Hsieh [iOS] Paste is missing from callout bar when pasteboard only contains custom data https://bugs.webkit.org/show_bug.cgi?id=184271 Reviewed by Ryosuke Niwa. Export a couple of WebCore functions for use in WebKit. * dom/Document.h: * platform/Pasteboard.h: 2018-08-17 Ryosuke Niwa Pack booleans in Event into a bitfield https://bugs.webkit.org/show_bug.cgi?id=188713 Reviewed by Daniel Bates. Use bitfields for booleans in Event class. * dom/Event.cpp: (WebCore::Event::Event): * dom/Event.h: (WebCore::Event::IsComposed): Added. (WebCore::Event): Packed booleans into a bitfield. 2018-08-17 Aditya Keerthi [Datalist][iOS] Display suggestions for input[type=color] https://bugs.webkit.org/show_bug.cgi?id=188669 Reviewed by Tim Horton. Expose suggestedColors() in HTMLInputElement in order to allow the UIProcess to access the list of suggested colors from a element. * html/ColorInputType.cpp: (WebCore::ColorInputType::suggestedColors const): * html/ColorInputType.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::suggestedColors const): * html/HTMLInputElement.h: * html/InputType.cpp: (WebCore::InputType::suggestedColors const): * html/InputType.h: * platform/ColorChooserClient.h: 2018-08-17 Alex Christensen Clean up CSSSelectorList after r234825 https://bugs.webkit.org/show_bug.cgi?id=188566 Reviewed by Megan Gardner. This is responding to Darin's feedback in https://bugs.webkit.org/show_bug.cgi?id=188539 * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::operator=): Deleted. * css/CSSSelectorList.h: (WebCore::CSSSelectorList::CSSSelectorList): * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::parsePageSelector): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumeComplexSelectorList): (WebCore::CSSSelectorParser::consumeCompoundSelectorList): 2018-08-17 Brent Fulgham Remove Adobe SSO exception now that StorageAccess API is available https://bugs.webkit.org/show_bug.cgi?id=188710 Reviewed by Alex Christensen. Remove custom quirk now that proper API exists to allow the same functions. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logSubresourceLoading): Remove unneeded quirk. (WebCore::resourceNeedsSSOQuirk): Deleted. 2018-08-17 Ryosuke Niwa Replace canBubble and cancelable booleans in Event by enum classes https://bugs.webkit.org/show_bug.cgi?id=188692 Rubber-stamped by Alex Christensen. Make these enum classes uint8_t. * dom/Event.h: 2018-08-17 Alex Christensen Add some plumbing for safe browsing https://bugs.webkit.org/show_bug.cgi?id=188709 Reviewed by Tim Horton. No change in behavior. Just passing around unused booleans. We will need this for a way to load a page even though safe browsing says it's unsafe. * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadArchive): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): (WebCore::FrameLoader::reloadWithOverrideEncoding): (WebCore::FrameLoader::reload): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/FrameLoader.h: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadWithNavigationAction): * loader/FrameLoaderClient.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/PolicyChecker.h: * loader/ShouldSkipSafeBrowsingCheck.h: Added. 2018-08-16 Ryosuke Niwa Replace canBubble and cancelable booleans in Event by enum classes https://bugs.webkit.org/show_bug.cgi?id=188692 Reviewed by Alex Christensen. Replaced booleans indicating whether an event can bubble and an event is cancelable by two enum classes: CanBubble and IsCancelable. No new tests since there should be no behavioral changes. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent): * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp: (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent): * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp: (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent): * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::didCancelPaymentSession): * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp: (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent): * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp: (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent): * Modules/applepay/ApplePayValidateMerchantEvent.cpp: (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent): * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::updateKeyStatuses): * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent): * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent): * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: (WebCore::WebKitMediaKeySession::addKeyTimerFired): (WebCore::WebKitMediaKeySession::sendError): * Modules/gamepad/GamepadEvent.cpp: (WebCore::GamepadEvent::GamepadEvent): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::connectionToServerLost): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::onSuccess): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBRequestCompletionEvent.cpp: (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent): * Modules/indexeddb/IDBRequestCompletionEvent.h: (WebCore::IDBRequestCompletionEvent::create): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): * Modules/indexeddb/IDBVersionChangeEvent.cpp: (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent): * Modules/mediasession/MediaSession.cpp: (WebCore::MediaSession::skipToNextTrack): (WebCore::MediaSession::skipToPreviousTrack): * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::scheduleEvent): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::scheduleEvent): * Modules/mediasource/SourceBufferList.cpp: (WebCore::SourceBufferList::scheduleEvent): * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::scheduledEventTimerFired): * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::internalAddTrack): (WebCore::MediaStream::internalRemoveTrack): * Modules/mediastream/MediaStreamEvent.cpp: (WebCore::MediaStreamEvent::create): (WebCore::MediaStreamEvent::MediaStreamEvent): * Modules/mediastream/MediaStreamEvent.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::trackEnded): (WebCore::MediaStreamTrack::trackMutedChanged): * Modules/mediastream/MediaStreamTrackEvent.cpp: (WebCore::MediaStreamTrackEvent::create): (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent): * Modules/mediastream/MediaStreamTrackEvent.h: * Modules/mediastream/OverconstrainedErrorEvent.h: (WebCore::OverconstrainedErrorEvent::create): (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent): * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::fireICECandidateEvent): (WebCore::PeerConnectionBackend::doneGatheringCandidates): (WebCore::PeerConnectionBackend::updateSignalingState): * Modules/mediastream/RTCDTMFToneChangeEvent.cpp: (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent): * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::didChangeReadyState): (WebCore::RTCDataChannel::didDetectError): (WebCore::RTCDataChannel::bufferedAmountIsDecreasing): * Modules/mediastream/RTCDataChannelEvent.cpp: (WebCore::RTCDataChannelEvent::create): (WebCore::RTCDataChannelEvent::RTCDataChannelEvent): * Modules/mediastream/RTCDataChannelEvent.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::updateIceGatheringState): (WebCore::RTCPeerConnection::updateIceConnectionState): (WebCore::RTCPeerConnection::updateConnectionState): (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): * Modules/mediastream/RTCPeerConnectionIceEvent.cpp: (WebCore::RTCPeerConnectionIceEvent::create): (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent): * Modules/mediastream/RTCPeerConnectionIceEvent.h: * Modules/mediastream/RTCTrackEvent.cpp: (WebCore::RTCTrackEvent::create): (WebCore::RTCTrackEvent::RTCTrackEvent): * Modules/mediastream/RTCTrackEvent.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addRemoteStream): (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): (WebCore::LibWebRTCMediaEndpoint::addDataChannel): * Modules/notifications/Notification.cpp: (WebCore::Notification::dispatchShowEvent): (WebCore::Notification::dispatchClickEvent): (WebCore::Notification::dispatchCloseEvent): (WebCore::Notification::dispatchErrorEvent): * Modules/paymentrequest/MerchantValidationEvent.cpp: (WebCore::MerchantValidationEvent::MerchantValidationEvent): * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent): * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::postEvent): * Modules/speech/SpeechSynthesisEvent.cpp: (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::setState): * Modules/webaudio/AudioProcessingEvent.cpp: (WebCore::AudioProcessingEvent::AudioProcessingEvent): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::finish): * Modules/webaudio/OfflineAudioCompletionEvent.cpp: (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent): * Modules/websockets/CloseEvent.h: (WebCore::CloseEvent::CloseEvent): * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::didConnect): (WebCore::WebSocket::dispatchOrQueueErrorEvent): * Modules/webvr/VRDisplayEvent.cpp: (WebCore::VRDisplayEvent::VRDisplayEvent): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): * accessibility/AccessibleSetValueEvent.cpp: (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent): * animation/AnimationPlaybackEvent.cpp: (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent): * dom/AbortSignal.cpp: (WebCore::AbortSignal::abort): * dom/AnimationEvent.cpp: (WebCore::AnimationEvent::AnimationEvent): * dom/BeforeLoadEvent.h: * dom/BeforeTextInsertedEvent.cpp: (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent): * dom/BeforeUnloadEvent.cpp: (WebCore::BeforeUnloadEvent::BeforeUnloadEvent): * dom/CharacterData.cpp: (WebCore::CharacterData::dispatchModifiedEvent): * dom/CompositionEvent.cpp: (WebCore::CompositionEvent::CompositionEvent): * dom/ContainerNode.cpp: (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/DeviceMotionEvent.cpp: (WebCore::DeviceMotionEvent::DeviceMotionEvent): * dom/DeviceOrientationEvent.cpp: (WebCore::DeviceOrientationEvent::DeviceOrientationEvent): * dom/Document.cpp: (WebCore::Document::setReadyState): (WebCore::Document::visibilityStateChanged): (WebCore::Document::finishedParsing): (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): (WebCore::Document::orientationChanged): * dom/DocumentEventQueue.cpp: (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent): (WebCore::DocumentEventQueue::enqueueScrollEvent): (WebCore::DocumentEventQueue::enqueueResizeEvent): * dom/DocumentEventQueue.h: * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): (WebCore::Element::dispatchFocusEvent): (WebCore::Element::dispatchBlurEvent): (WebCore::Element::dispatchWebKitImageReadyEventForTesting): * dom/ErrorEvent.cpp: (WebCore::ErrorEvent::ErrorEvent): * dom/Event.cpp: (WebCore::Event::Event): (WebCore::Event::create): * dom/Event.h: * dom/FocusEvent.cpp: (WebCore::FocusEvent::FocusEvent): * dom/FocusEvent.h: * dom/HashChangeEvent.h: * dom/InputEvent.cpp: (WebCore::InputEvent::create): (WebCore::InputEvent::InputEvent): * dom/InputEvent.h: * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): * dom/MessageEvent.cpp: (WebCore::MessageEvent::MessageEvent): * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): (WebCore::MouseEvent::MouseEvent): * dom/MouseEvent.h: * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::MouseRelatedEvent): * dom/MouseRelatedEvent.h: * dom/MutationEvent.cpp: (WebCore::MutationEvent::MutationEvent): * dom/MutationEvent.h: * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): (WebCore::Node::dispatchInputEvent): * dom/OverflowEvent.cpp: (WebCore::OverflowEvent::OverflowEvent): * dom/PageTransitionEvent.cpp: (WebCore::PageTransitionEvent::PageTransitionEvent): * dom/PopStateEvent.cpp: (WebCore::PopStateEvent::PopStateEvent): * dom/ProgressEvent.cpp: (WebCore::ProgressEvent::ProgressEvent): * dom/ScriptElement.cpp: (WebCore::ScriptElement::dispatchErrorEvent): * dom/SecurityPolicyViolationEvent.h: * dom/SimulatedClick.cpp: * dom/TextEvent.cpp: (WebCore::TextEvent::TextEvent): * dom/TransitionEvent.cpp: (WebCore::TransitionEvent::TransitionEvent): * dom/UIEvent.cpp: (WebCore::UIEvent::UIEvent): * dom/UIEvent.h: (WebCore::UIEvent::create): * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::UIEventWithKeyState): * dom/WebKitAnimationEvent.cpp: (WebCore::WebKitAnimationEvent::WebKitAnimationEvent): * dom/WebKitTransitionEvent.cpp: (WebCore::WebKitTransitionEvent::WebKitTransitionEvent): * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): * editing/Editor.cpp: (WebCore::dispatchBeforeInputEvent): (WebCore::dispatchBeforeInputEvents): (WebCore::Editor::willApplyEditing const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): (WebCore::FrameSelection::selectAll): (WebCore::FrameSelection::dispatchSelectStart): * html/HTMLDetailsElement.cpp: (WebCore::HTMLDetailsElement::dispatchPendingEvent): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::dispatchChangeEvent): (WebCore::HTMLFormControlElement::checkValidity): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::prepareForSubmission): (WebCore::HTMLFormElement::reset): * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::dispatchLoadEvent): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::onSearch): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::dispatchPendingEvent): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleEvent): (WebCore::HTMLMediaElement::notifyAboutPlaying): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::layoutSizeChanged): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::dispatchLoadEvent): * html/HTMLSlotElement.cpp: (WebCore::HTMLSlotElement::dispatchSlotChangeEvent): * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::errorEventTimerFired): * html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::dispatchPendingEvent): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::selectionChanged): * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::didCompleteLoad): * html/MediaController.cpp: (WebCore::MediaController::scheduleEvent): * html/canvas/WebGLContextEvent.cpp: (WebCore::WebGLContextEvent::WebGLContextEvent): * html/canvas/WebGLContextEvent.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent): (WebCore::WebGLRenderingContextBase::maybeRestoreContext): (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): * html/parser/HTMLScriptRunner.cpp: (WebCore::createScriptLoadEvent): * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: * html/track/TrackListBase.cpp: (WebCore::TrackListBase::scheduleTrackEvent): (WebCore::TrackListBase::scheduleChangeEvent): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): * loader/FrameLoader.cpp: (WebCore::FrameLoader::dispatchUnloadEvents): * loader/ImageLoader.cpp: (WebCore::ImageLoader::dispatchPendingErrorEvent): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::createApplicationCacheEvent): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): (WebCore::DOMWindow::languagesChanged): (WebCore::DOMWindow::dispatchLoadEvent): * page/EventHandler.cpp: (WebCore::dispatchSelectStart): (WebCore::EventHandler::dispatchDragEvent): * page/EventSource.cpp: (WebCore::EventSource::scheduleReconnect): (WebCore::EventSource::didReceiveResponse): (WebCore::EventSource::abortConnectionAttempt): * page/FocusController.cpp: (WebCore::dispatchEventsOnWindowAndFocusedElement): (WebCore::FocusController::setFocusedFrame): * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): * page/Page.cpp: (WebCore::networkStateChanged): * page/Performance.cpp: (WebCore::Performance::resourceTimingBufferFullTimerFired): * page/PointerLockController.cpp: (WebCore::PointerLockController::enqueueEvent): * page/VisualViewport.cpp: (WebCore::VisualViewport::enqueueResizeEvent): (WebCore::VisualViewport::enqueueScrollEvent): * storage/StorageEvent.cpp: (WebCore::StorageEvent::StorageEvent): * svg/SVGElement.cpp: (WebCore::SVGElement::sendSVGLoadEventIfPossible): * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::dispatchLoadEvent): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::notifyFinished): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::dispatchPendingEvent): * workers/Worker.cpp: (WebCore::Worker::notifyFinished): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::notifyNetworkStateChange): * workers/service/ExtendableEvent.cpp: (WebCore::ExtendableEvent::ExtendableEvent): * workers/service/ExtendableEvent.h: * workers/service/ExtendableMessageEvent.cpp: (WebCore::ExtendableMessageEvent::ExtendableMessageEvent): * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::scheduleTaskToUpdateState): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent): * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::callReadyStateChangeListener): 2018-08-17 Yusuke Suzuki and Fujii Hironori [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg https://bugs.webkit.org/show_bug.cgi?id=188589 Reviewed by Mark Lam. And reviewed by Yusuke Suzuki for Hironori's change. * cssjit/FunctionCall.h: (WebCore::FunctionCall::FunctionCall): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo): * html/HTMLKeygenElement.cpp: Remove `using namespace WebCore` not to introduce `operator+/-` which makes the resolution of `operator+/-` for RegisterID ambiguous. 2018-08-17 Philippe Normand [GStreamer] reduce position queries frequency https://bugs.webkit.org/show_bug.cgi?id=188645 Reviewed by Xabier Rodriguez-Calvar. There is no need to perform dozens of position queries per second. One every 300ms is enough. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone): (WebCore::MediaPlayerPrivateGStreamer::updateStates): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2018-08-17 Michael Catanzaro [SOUP] Handle OAuth authentication after r234912 https://bugs.webkit.org/show_bug.cgi?id=188651 Reviewed by Carlos Garcia Campos. Update this switch to consider the new OAuth enum value added in r234912. I suppose OAuth is used for HTTP Auth now. It will be a one-time compatibility break as passwords previously stored with type "Unknown" will no longer be accessible. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::authTypeFromProtectionSpaceAuthenticationScheme): 2018-08-17 Ms2ger [GTK] Never return an uninitialized ImageGStreamer object. https://bugs.webkit.org/show_bug.cgi?id=188305 Reviewed by Philippe Normand. The single caller was already checking for a null return value, so make that check actually do something. Also remove the null-check on the return value of image(), which asserted that it would never return null. Test: fast/canvas/canvas-createPattern-video-loading.html * platform/graphics/gstreamer/ImageGStreamer.h: (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created. (WebCore::ImageGStreamer::image): Return a reference. (WebCore::ImageGStreamer::rect): Always assert that m_image is present. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature. 2018-08-17 Philippe Normand [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled https://bugs.webkit.org/show_bug.cgi?id=188648 Reviewed by Xabier Rodriguez-Calvar. The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on. The text overlay is now enabled when GST_DEBUG tracing is enabled for the player. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): 2018-08-17 Philippe Normand [GStreamer][MSE] Disable last-sample support in AppendPipeline https://bugs.webkit.org/show_bug.cgi?id=188649 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): This property isn't used by the append pipeline. So as a micro-optimization, it is now disabled. 2018-08-16 Devin Rousso Web Inspector: support breakpoints for arbitrary event names https://bugs.webkit.org/show_bug.cgi?id=183118 Reviewed by Joseph Pecoraro. Tests: inspector/dom-debugger/event-breakpoints.html inspector/dom-debugger/event-breakpoints-with-navigation.html * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): 2018-08-16 Basuke Suzuki [Curl] Bug fix on deleting cookies when Max-Age is set to zero. https://bugs.webkit.org/show_bug.cgi?id=188617 Reviewed by Alex Christensen. Delete cookie if Max-Age is set to zero in Set-Cookie. Original implementation was compared using "less than", but it must be "less than or equal" to zero. Tests: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::setCookie): 2018-08-16 Basuke Suzuki [Curl] Implement deleteAllCookies() https://bugs.webkit.org/show_bug.cgi?id=188612 Reviewed by Alex Christensen. deleteAllCookies() was not implemented. Connect the interface to the implementation. Tests: http/tests/cookies/simple-cookies-expired.html http/tests/cookies/simple-cookies-max-age.html * platform/network/curl/CookieJarCurlDatabase.cpp: (WebCore::CookieJarCurlDatabase::deleteAllCookies const): 2018-08-16 Ross Kirsling REGRESSION(r234930): Don't embed a #if in an ASSERT https://bugs.webkit.org/show_bug.cgi?id=188680 Reviewed by Tim Horton. * page/EventHandler.cpp: (WebCore::EventHandler::handleDrag): Simplify the ASSERT -- it seems we just want to know that DragSourceActionSelection and exactly one other DragSourceAction is set. 2018-08-16 Alex Christensen Remove unused allowScriptsToCloseWindows setting https://bugs.webkit.org/show_bug.cgi?id=188602 Reviewed by Simon Fraser. No change in behaviour. It was always false. * page/DOMWindow.cpp: (WebCore::DOMWindow::close): * page/Settings.yaml: 2018-08-16 Ryosuke Niwa Custom element constructor doesn't use HTMLElement in new.target's realm https://bugs.webkit.org/show_bug.cgi?id=188634 Reviewed by Keith Miller. Fixed the bug that HTMLElement's constructor was constructing an element of its own realm instead of the realm of new.target. This results in the JS wrapper created for the element belonging to the global object of the HTMLElement constructor which was invoked instead of the global object of new.target as specified in: https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors In particular, step 9.2. specifies that we "perform element.[[SetPrototypeOf]](prototype)." where prototype is the result of Get(NewTarget, "prototype") in step 7. WebKit's new behavior matches that of Chrome and Firefox. Test: imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html * bindings/js/JSHTMLElementCustom.cpp: (WebCore::constructJSHTMLElement): 2018-08-16 Aditya Keerthi Unreviewed, fix the watchOS build after r188464. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::setColor): 2018-08-16 Ryosuke Niwa Custom element doesn't invalidate its style when :defined rule starts to apply https://bugs.webkit.org/show_bug.cgi?id=188637 Reviewed by Antti Koivisto. Fixed the bug by invalidating the subtree when a custom element gets defined. Test: fast/custom-elements/defined-update-style.html * dom/Element.cpp: (WebCore::Element::setIsDefinedCustomElement): 2018-08-16 Youenn Fablet Change the input camera in the sources & outputs example on Safari (11) with M.Way camera https://bugs.webkit.org/show_bug.cgi?id=187756 Reviewed by Eric Carlson. Covered by manual testing. 640x480x30fps is added as ideal constraints to getUserMedia if none other is added to provide consistent behavior. Some cameras do not support 30fps as they have discrete frame rate ranges. Before the patch, we were rejecting getUserMedia promise if the 'ideal' frameRate was not supported. After the patch, we do not check whether frame rate is supported if it is not mandatory. At capture time, we will still try to apply frame rate change and if not supported, the frame rate will not be set to 30 fps. While we could surface discrete width/height/frame rate ranges, it seems best to fix the issue this way. In the future, we might implement video interpolation for width/height/framerate at WebCore level. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): (WebCore::RealtimeMediaSource::supportsConstraint const): (WebCore::RealtimeMediaSource::supportsConstraints): 2018-08-16 Ryosuke Niwa Perform a microtask checkpoint before creating a custom element https://bugs.webkit.org/show_bug.cgi?id=188189 Reviewed by Geoffrey Garen. Fixed the bug that the HTML parser was not performing a microtask checkpoint prior to synchronously constructing a custom element in the concept to create an element for a token: https://html.spec.whatwg.org/multipage/parsing.html#creating-and-inserting-nodes:perform-a-microtask-checkpoint Also added a microtask checkpoint before dispatching DOMContentLoaded to work around webkit.org/b/82931 since scheduling a task to fire a DOMContentLoaded event in Document::finishedParsing as the HTML5 spec mandates is a long standing bug with a lot of implications, which is completely outside the scope of this bug fix: https://html.spec.whatwg.org/multipage/parsing.html#stop-parsing Test: fast/custom-elements/perform-microtask-checkpoint-before-construction.html * dom/Document.cpp: (WebCore::Document::finishedParsing): Perform a microtask checkpoint before dispatching DOMContentLoaded here as a workaround for webkit.org/b/82931. * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Perform a microtask checkpoint here to fix the bug. 2018-08-16 Alex Christensen Re-introduce assertion removed in r234890 https://bugs.webkit.org/show_bug.cgi?id=188611 Reviewed by Geoffrey Garen. The assertion was failing because Vector::operator== was using memcmp, which failed to consider different instances of equal Strings equal. Added an API test and this assertion, which now succeeds. * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): 2018-08-15 Jer Noble Add Experimental Feature support for SourceBuffer.changeType() https://bugs.webkit.org/show_bug.cgi?id=188626 Reviewed by Eric Carlson. Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html imported/w3c/web-platform-tests/media-source/mediasource-changetype.html The WICG is incubating a new proposal to allow clients to switch between streams with different codecs within the same SourceBuffer. The proposal is being tracked by and the proposed spec change is available at . Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching. The AVStreamDataParser does not necessarily emit every frame appended, and after a new init segment is appended, it's possible that frames from the previous media segment will be emitted. This causes an error condition to occur, due to an added check in the spec for a new flag. When the SourceBuffer asks its private implementation to reset the parser state, since there's no API on AVStreamDataParser to actually reset the parser state, just set a flag to drop all emitted buffers until the next initialization segment is parsed. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::contentTypeShouldGenerateTimestamps): (WebCore::MediaSource::setDurationInternal): (WebCore::MediaSource::addSourceBuffer): * Modules/mediasource/MediaSource.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::changeType): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::validateInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): * Modules/mediasource/SourceBuffer.h: * Modules/mediasource/SourceBuffer.idl: * page/Settings.yaml: * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::canSwitchToType): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): 2018-08-16 Christopher Reid [Curl] Not all Cookie database files are deleted on corruption https://bugs.webkit.org/show_bug.cgi?id=185873 Reviewed by Fujii Hironori. No new tests. Delete the cookie database file and the corruption flag file when corruption is detected. Adding a quick integrity check in case it can catch anything when opening the database. Removing PRAGMA temp_store = MEMORY and PRAGMA journal_mode = WAL as they are set in SQLiteDatabase::open. * platform/network/curl/CookieJarDB.cpp: 2018-08-16 Zan Dobersek [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl https://bugs.webkit.org/show_bug.cgi?id=188550 Reviewed by Carlos Garcia Campos. Add the Nicosia::ImageBackingTextureMapperImpl class, the TextureMapper-specific implementation that will extend the ImageBacking class. This class will be used to contain and manage updates for layers that are backed by image objects. The CoordinatedGraphicsLayer instance will use the LayerState object to track the currently-presented image objects and to store the latest update of these objects. The Update struct contains information about the current visibility of the image in the layer tree as well as the Nicosia::Buffer object containing the painted image data that's to be presented on the screen. During the layer flush the flushUpdate() method will move the current update data into the pending position, from which this data will be gathered by the composition component through the takeUpdate() method and used to update the CoordinatedBackingStore object that's kept in the CompositionState object on this impl class. This will be deployed for use in the CoordinatedGraphicsLayer at a later stage as it requires a larger rework in both CoordinatedGraphicsLayer as well as the CoordinatedGraphicsScene classes. The implementation itself differs from the current image backing support in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the idea of sharing single image backings between layers that might be backed by identical Image objects. We thus end up trading any memory consumption benefit in these scenarios for a much simplified implementation. Overall this area needs more research both in figuring out whether there's worthy improvements in grouping image backings, as well as investigating whether it's possible to avoid additional image rasterization by just leveraging direct pixel data via the NativeImagePtr object. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added. (Nicosia::ImageBackingTextureMapperImpl::createFactory): (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added. 2018-08-16 Aditya Keerthi Support drag-and-drop for input[type=color] https://bugs.webkit.org/show_bug.cgi?id=188464 Reviewed by Wenson Hsieh. input[type=color] should support native drag and drop on both macOS and iOS. Added methods to Pasteboard and PlatformPasteboard to enable colors to be read from and written to the pasteboard. On macOS, colors are managed through the NSColorPboardType, whereas on iOS, colors are managed through the 'com.apple.uikit.color' identifier. DragSourceActionColor was added to the list of DragSourceActions to identify when a color input is being dragged. Tests: editing/pasteboard/drag-and-drop-color-input-events.html editing/pasteboard/drag-and-drop-color-input.html * page/DragActions.h: * page/DragController.cpp: (WebCore::DragController::dragEnteredOrUpdated): (WebCore::isEnabledColorInput): (WebCore::DragController::concludeEditDrag): (WebCore::DragController::canProcessDrag): (WebCore::DragController::draggableElement const): (WebCore::DragController::startDrag): * page/EventHandler.cpp: (WebCore::EventHandler::dragHysteresisExceeded const): (WebCore::EventHandler::handleDrag): * page/EventHandler.h: * page/mac/DragControllerMac.mm: (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const): * platform/DragData.h: * platform/DragImage.cpp: (WebCore::DragImage::operator=): * platform/DragImage.h: Added the visiblePath property to DragImage, in order for us to be able to clip images in the UITargetedDragPreview on iOS. * platform/DragItem.h: (WebCore::DragItem::encode const): (WebCore::DragItem::decode): * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/gtk/DragImageGtk.cpp: (WebCore::createDragImageForColor): * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::write): * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForColor): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::write): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::color): (WebCore::PlatformPasteboard::setColor): * platform/mac/DragDataMac.mm: (WebCore::colorPasteboardType): (WebCore::DragData::containsCompatibleContent const): * platform/mac/DragImageMac.mm: (WebCore::createDragImageForColor): Draw a rounded rectangle with a fill color matching the value of the dragged color input. The rendered image is designed to mimic the preview shown when dragging an NSColorWell. * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::write): * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::setColor): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::write): * platform/wpe/PasteboardWPE.cpp: (WebCore::Pasteboard::write): 2018-08-16 Zalan Bujtas [lFC][Floating] Add estimated margin top computation. https://bugs.webkit.org/show_bug.cgi?id=188619 Reviewed by Antti Koivisto. In order to figure out whether a box should avoid a float, we need to know the final positions of both (ignore relative positioning for now). In block formatting context the final position for a normal flow box includes 1. the static position and 2. the corresponding (non)collapsed margins. Now the vertical margins are computed when all the descendants are finalized, because the margin values might be depending on the height of the box (and the height might be based on the content). So when we get to the point where we intersect the box with the float to decide if the box needs to move, we don't yet have the final vertical position. The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top margin. (if this holds true for all the cases, the estimated prefix could be removed and just use marginTop() instead.) Covered by existing block-only tests. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHasValidTop): (WebCore::Display::Box::setHasValidLeft): (WebCore::Display::Box::top const): (WebCore::Display::Box::left const): (WebCore::Display::Box::topLeft const): (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setEstimatedMarginTop): (WebCore::Display::Box::estimatedMarginTop const): 2018-08-16 Zalan Bujtas [LFC][BFC] Display::Box interface should reflect that padding is optional. https://bugs.webkit.org/show_bug.cgi?id=188630 Reviewed by Antti Koivisto. Certain type of boxes can't have paddings (see Layout::Box::isPaddingApplicable). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeBorderAndPadding const): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::width const): (WebCore::Display::Box::height const): (WebCore::Display::Box::contentBoxTop const): (WebCore::Display::Box::contentBoxLeft const): (WebCore::Display::Box::setPadding): (WebCore::Display::Box::paddingTop const): (WebCore::Display::Box::paddingLeft const): (WebCore::Display::Box::paddingBottom const): (WebCore::Display::Box::paddingRight const): 2018-08-16 Zalan Bujtas [LFC] Add showLayoutTree() that does not require LayoutContext. https://bugs.webkit.org/show_bug.cgi?id=188631 Reviewed by Antti Koivisto. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::formattingContextRoot const): (WebCore::Layout::Box::initialContainingBlock const): * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted. * layout/layouttree/LayoutTreeBuilder.h: 2018-08-16 Zalan Bujtas [LFC] Tree builder should construct block and inline containers based on the display type. https://bugs.webkit.org/show_bug.cgi?id=188632 Reviewed by Antti Koivisto. Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-08-16 Zalan Bujtas [LFC] Bail out of subtree verification when trees are out of sync. https://bugs.webkit.org/show_bug.cgi?id=188633 Reviewed by Antti Koivisto. There's no point of trying to match geometry when subtrees are out of sync. They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder). * layout/Verification.cpp: (WebCore::Layout::verifyAndOutputSubtree): 2018-08-16 Antti Koivisto Use OptionSet for ActivityState::Flags https://bugs.webkit.org/show_bug.cgi?id=188554 Reviewed by Brent Fulgham. More typesafe flags. * Modules/geolocation/GeolocationController.cpp: (WebCore::GeolocationController::activityStateDidChange): * Modules/geolocation/GeolocationController.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::activityStateDidChange): * html/canvas/WebGLRenderingContextBase.h: * page/ActivityState.cpp: (WebCore::operator<<): (WebCore::activityStateFlagsToString): Deleted. * page/ActivityState.h: (WebCore::ActivityState::allFlags): * page/ActivityStateChangeObserver.h: * page/FocusController.cpp: (WebCore::FocusController::FocusController): (WebCore::FocusController::setFocused): (WebCore::FocusController::setActivityState): (WebCore::FocusController::setActive): * page/FocusController.h: (WebCore::FocusController::isActive const): (WebCore::FocusController::isFocused const): (WebCore::FocusController::contentIsVisible const): * page/Page.cpp: (WebCore::pageInitialActivityState): (WebCore::Page::Page): (WebCore::Page::setIsInWindow): (WebCore::Page::updateTimerThrottlingState): (WebCore::Page::setActivityState): (WebCore::Page::isVisibleAndActive const): (WebCore::Page::isWindowActive const): (WebCore::Page::setIsVisible): * page/Page.h: (WebCore::Page::activityState const): (WebCore::Page::isVisible const): (WebCore::Page::isInWindow const): * page/PerformanceMonitor.cpp: (WebCore::activityStateForCPUSampling): (WebCore::PerformanceMonitor::activityStateChanged): * page/PerformanceMonitor.h: * platform/text/cocoa: Added. 2018-08-15 Ansh Shukla NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault https://bugs.webkit.org/show_bug.cgi?id=186870 Reviewed by Alex Christensen. Add the ProtectionSpaceAuthenticationSchemeOAuth type. * platform/network/ProtectionSpaceBase.cpp: (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge expects a token in return. * platform/network/ProtectionSpaceBase.h: * platform/network/cocoa/ProtectionSpaceCocoa.mm: (WebCore::scheme): (WebCore::ProtectionSpace::nsSpace const): 2018-08-15 Ben Richards We should cache the compiled sandbox profile in a data vault https://bugs.webkit.org/show_bug.cgi?id=184991 Reviewed by Ryosuke Niwa. Added functionality to FileHandle so that it can lock a file while open. Added a function to FileSystem to delete non empty directories. * platform/FileHandle.cpp: (WebCore::FileHandle::FileHandle): (WebCore::FileHandle::open): (WebCore::FileHandle::close): * platform/FileHandle.h: * platform/FileSystem.h: * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-08-15 Ryosuke Niwa Can't share an app on AppStore to WeChat due to a release assert https://bugs.webkit.org/show_bug.cgi?id=188621 Reviewed by Geoffrey Garen. Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert is getting hit by third party applications on iOS in UI process. * platform/Timer.cpp: (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check. 2018-08-15 Christopher Reid [Curl] Implement default cookie path handling correctly as outlined in RFC6265. https://bugs.webkit.org/show_bug.cgi?id=188609 Reviewed by Alex Christensen. Curl implementation of default cookie path was wrong so that some cookies cannot be accessible. It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4 Tests: http/tests/cookies/http-get-cookie-set-in-js.html * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::setCookie): * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::defaultPathForURL): * platform/network/curl/CookieUtil.h: 2018-08-15 Aditya Keerthi [Datalist] Add button to TextFieldInputs with a datalist https://bugs.webkit.org/show_bug.cgi?id=187741 Reviewed by Tim Horton. TextFieldInputs that have an associated datalist element should be drawn as combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox is not height-resizable. Furthermore, the input should also be able to contain additional elements, such as the stepper for type=number and the cancel button for type=search. For these reasons, we draw a button at the end of the input, mimicking appearance of a combo box. The list-button -webkit-appearance value was added to display the new button. Tests: fast/forms/datalist/datalist-searchinput-appearance.html fast/forms/datalist/datalist-textinput-appearance.html * Resources/ListButtonArrow.png: Added. * Resources/ListButtonArrow@2x.png: Added. * WebCore.xcodeproj/project.pbxproj: * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/html.css: (input::-webkit-list-button): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dataListButtonElement const): * html/HTMLInputElement.h: * html/InputType.h: (WebCore::InputType::dataListButtonElement const): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::needsContainer const): (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::destroyShadowSubtree): (WebCore::TextFieldInputType::listAttributeTargetChanged): (WebCore::TextFieldInputType::dataListButtonElement const): (WebCore::TextFieldInputType::dataListButtonElementWasClicked): (WebCore::TextFieldInputType::didCloseSuggestions): * html/TextFieldInputType.h: * html/shadow/DataListButtonElement.cpp: Added. (WebCore::DataListButtonElement::create): (WebCore::DataListButtonElement::DataListButtonElement): (WebCore::DataListButtonElement::~DataListButtonElement): (WebCore::DataListButtonElement::defaultEventHandler): * html/shadow/DataListButtonElement.h: Added. * platform/ThemeTypes.h: * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::adjustListButtonStyle const): * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (-[WebListButtonCell drawWithFrame:inView:]): (WebCore::RenderThemeMac::paintListButtonForInput): (WebCore::RenderThemeMac::adjustListButtonStyle const): (WebCore::RenderThemeMac::paintTextField): (WebCore::RenderThemeMac::paintSearchField): (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::listButton const): 2018-08-15 Ryan Haddad Unreviewed, rolling out r234870. The test introduced with this change is a flaky failure. Reverted changeset: "NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault" https://bugs.webkit.org/show_bug.cgi?id=186870 https://trac.webkit.org/changeset/234870 2018-08-14 Ryosuke Niwa connectedCallback is invoked by the HTML parser after child nodes had been inserted https://bugs.webkit.org/show_bug.cgi?id=183931 Reviewed by Alex Christensen. Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of: https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack. Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks. This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder is still in the stack. 2018-08-15 Basuke Suzuki [Curl] Don't send Content-Type header for POST request when body is null. https://bugs.webkit.org/show_bug.cgi?id=188588 Reviewed by Youenn Fablet. The Content-Type header was sent by libcurl automatically. Suppress that behavior when body is null. Tests: http/tests/xmlhttprequest/methods.html * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setupPOST): 2018-08-15 Alex Christensen Remove failing assertion introduced in r234873 https://bugs.webkit.org/show_bug.cgi?id=188581 * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): The assertion is correct but failing because VectorTraits is incorrect. I'll re-add it and fix VectorTraits in a separate patch. 2018-08-15 Wenson Hsieh [Attachment SPI] Remove attachment display mode options https://bugs.webkit.org/show_bug.cgi?id=188596 Reviewed by Dan Bernstein. Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic needed to allow an attachment element to render image or video elements in a shadow root. The requirements that initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme for images inserted into the document via rich editing operations. Removed some existing API tests in _WKAttachmentTests that exercised this functionality. * editing/Editor.cpp: (WebCore::Editor::insertAttachmentFromFile): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragmentForImageAttachment): (WebCore::replaceRichContentWithAttachments): * html/AttachmentTypes.h: (WebCore::AttachmentDisplayOptions::encode const): (WebCore::AttachmentDisplayOptions::decode): Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be needing any mechanism for influencing the display of attachment elements inserted via native SPI. (): Deleted. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::createElementRenderer): (WebCore::HTMLAttachmentElement::setFile): (WebCore::HTMLAttachmentElement::parseAttribute): (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted. (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted. (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted. (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted. (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted. (WebCore::HTMLAttachmentElement::innerImage const): Deleted. (WebCore::HTMLAttachmentElement::innerVideo const): Deleted. (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted. Remove logic for building the shadow root to house inline media elements. * html/HTMLAttachmentElement.h: The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`. * page/DragController.cpp: (WebCore::DragController::startDrag): * rendering/RenderAttachment.h: (WebCore::HTMLAttachmentElement::renderer const): 2018-08-15 Ali Juma [IntersectionObserver] Do not hold a strong reference to the root element https://bugs.webkit.org/show_bug.cgi?id=188575 Reviewed by Simon Fraser. Make IntersectionObserver have only a raw pointer to its root element rather than a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to to clear this pointer when the root element gets deleted. Test: intersection-observer/root-element-deleted.html * dom/Element.cpp: (WebCore::Element::~Element): (WebCore::Element::disconnectFromIntersectionObservers): (WebCore::Element::ensureIntersectionObserverData): (WebCore::Element::intersectionObserverData): * dom/Element.h: * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData::intersectionObserverData): (WebCore::ElementRareData::setIntersectionObserverData): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::~IntersectionObserver): (WebCore::IntersectionObserver::rootDestroyed): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::root const): 2018-08-14 Zan Dobersek [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl https://bugs.webkit.org/show_bug.cgi?id=188548 Reviewed by Carlos Garcia Campos. Add the Nicosia::BackingStoreTextureMapperImpl class, the TextureMapper-specific implementation that will extend the BackingStore class. Purpose of this class is to manage content of painted layers. In the LayerState object that will be exposed to the CoordinatedGraphicsLayer owner we keep the current and previous TiledBackingStore objects that will be used for painting. A TileUpdate object is used to store all tile creation, removal and update changes that happen during the painting that's performed during the CoordinatedGraphicsLayer flush. At the point of synchronization under the Nicosia::Scene object, these updates will be moved over to the pending TileUpdate object that will then be accessed during the composition step. For that purpose we keep in the CompositionState member object a reference to the CoordinatedBackingStore object that will get updated with the tile creation, removal and update changes (if there are any). The composition step will use the takeUpdate() method to retrieve all these changes and apply them outside of the point of synchronization (avoiding this sync step to take too long). This will be integrated into the CoordinatedGraphicsLayer class at a later point, when the switch to the new infrastructure can be made in one go. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added. (Nicosia::BackingStoreTextureMapperImpl::createFactory): (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation): (Nicosia::BackingStoreTextureMapperImpl::createTile): (Nicosia::BackingStoreTextureMapperImpl::updateTile): (Nicosia::BackingStoreTextureMapperImpl::removeTile): (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added. 2018-08-14 Fujii Hironori Unreviewed, rolling out r234874 and r234876. WinCairo port can't compile Reverted changesets: "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg" https://bugs.webkit.org/show_bug.cgi?id=188589 https://trac.webkit.org/changeset/234874 "Unreviewed, attempt to fix CLoop build" https://bugs.webkit.org/show_bug.cgi?id=188589 https://trac.webkit.org/changeset/234876 2018-08-14 Zalan Bujtas [LFC][Floating] Add support for negative clearance. https://bugs.webkit.org/show_bug.cgi?id=188555 Reviewed by Simon Fraser. 1. Compute clearance to avoid float(s) (border box needs to avoid floats) 2. Reset vertical margins to non-collapsed values. 4. Adjust clearance with the new margins. 5. Take the adjusted clearance and move the box vertically if needed. Test: fast/block/block-only/margin-collapse-with-clearance.html * layout/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::mapBoxToAncestor): (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): (WebCore::Layout::FormattingContext::mapToAncestor): Deleted. * layout/FormattingContext.h: * layout/LayoutUnits.h: (WebCore::Layout::Position::Position): (WebCore::Layout::Position::moveBy): * layout/displaytree/DisplayBox.h: 2018-08-14 Fujii Hironori Unreviewed, rolling out r234859. Windows ports can't compile 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/234859 2018-08-14 Yusuke Suzuki [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg https://bugs.webkit.org/show_bug.cgi?id=188589 Reviewed by Mark Lam. No behavior change. * cssjit/FunctionCall.h: (WebCore::FunctionCall::FunctionCall): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo): 2018-08-14 Alex Christensen isValidCSSSelector is unsafe to be called from a non-main thread https://bugs.webkit.org/show_bug.cgi?id=188581 Reviewed by Sam Weinig. Parsing and determining whether the css selectors are valid is fast enough to do before hopping to the background thread for the slow NFA/DFA operations and writing to disk. Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings. * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * contentextensions/ContentExtensionCompiler.h: * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::isValidCSSSelector): (WebCore::ContentExtensions::loadEncodedRules): (WebCore::ContentExtensions::parseRuleList): * contentextensions/ContentExtensionParser.h: * contentextensions/ContentExtensionRule.cpp: (WebCore::ContentExtensions::Trigger::isolatedCopy const): (WebCore::ContentExtensions::Action::isolatedCopy const): * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::Trigger::isEmpty const): (WebCore::ContentExtensions::Trigger::operator== const): (WebCore::ContentExtensions::Action::Action): (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const): (WebCore::ContentExtensions::ContentExtensionRule::operator== const): (WebCore::ContentExtensions::vectorIsolatedCopy): 2018-08-14 Ansh Shukla NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault https://bugs.webkit.org/show_bug.cgi?id=186870 Reviewed by Alex Christensen. Add the ProtectionSpaceAuthenticationSchemeOAuth type. * platform/network/ProtectionSpaceBase.cpp: (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge expects a token in return. * platform/network/ProtectionSpaceBase.h: * platform/network/cocoa/ProtectionSpaceCocoa.mm: (WebCore::scheme): (WebCore::ProtectionSpace::nsSpace const): 2018-08-14 Basuke Suzuki [Curl] Implement platform default timeout interval. https://bugs.webkit.org/show_bug.cgi?id=188565 Reviewed by Alex Christensen. Curl port didn't implement platform default timeout interval. It treated zero value for timeout interval as no timeout. Add platform dependent timeout interval into CurlContext and use that if timeout and default timeout aren't supplied. Tests: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::setTimeout): * platform/network/curl/CurlContext.h: (WebCore::CurlContext::defaultTimeoutInterval const): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setupTransfer): (WebCore::CurlRequest::timeoutInterval const): (WebCore::CurlRequest::didCompleteTransfer): * platform/network/curl/CurlRequest.h: 2018-08-14 Alex Christensen 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-08-14 Yusuke Suzuki Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object https://bugs.webkit.org/show_bug.cgi?id=188551 Reviewed by Youenn Fablet. Previously we dispatched ErrorEvent on the Worker object of the host side when the unhandled promise rejection happens in the worker. But that was wrong. We should not dispatch such an event and we should just log the error message. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection): 2018-08-14 Yusuke Suzuki Unreviewed, follow-up patch for comments https://bugs.webkit.org/show_bug.cgi?id=188265 * bindings/js/JSExecState.cpp: (WebCore::JSExecState::didLeaveScriptContext): Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected promise events after ScriptExecutionContext is gone. * dom/Microtasks.cpp: (WebCore::MicrotaskQueue::contextQueue): Drop unnecessary assertion since it is subsumed by downcast<>. 2018-08-14 Ali Juma Follow-up: [IntersectionObserver] Implement rootMargin parsing https://bugs.webkit.org/show_bug.cgi?id=188469 Address review feedback from Darin Adler. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::rootMargin const): Use StringBuilder::appendLiteral instead of ::append to append a literal. 2018-08-14 Antoine Quint [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation() https://bugs.webkit.org/show_bug.cgi?id=188519 Reviewed by Eric Carlson. Test: webanimations/css-animation-effect-target-change-and-animation-removal-crash.html We would crash because we blindly assumed an animation that was found in the previous style must be in the list of running animations but in fact it could have been removed already due to the element being removed from the DOM or its effect target changing, etc. So when we iterate over names of animations that were found in the previous style but not in the new style, we must make a null check to ensure that there is an animation to remove. Adding an ASSERT() in AnimationTimeline::cancelOrRemoveDeclarativeAnimation() will also clarify the expectation here. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSAnimationsForElement): (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): 2018-08-14 Zalan Bujtas [LFC][Floating] Adjust vertical position with non-collapsed previous sibling margin. https://bugs.webkit.org/show_bug.cgi?id=188543 Reviewed by Antti Koivisto. This patch ensures that the inital vertical position for a float is adjusted with the non-collapsed sibling margin.
While computing the static position for element "B", we simply call marginBottom() on A. In the case above, A's margin bottom is collapsed with C's margin top and the value is 0 (C.marginTop() is 20px). However CSS spec says that in block formatting context, the non-collapsed margin should be used instead to offset the float box. (The reason why this should not be part of the BlockMarginCollapse::marginBottom() logic is because it can not differentiate the context of sibling float/sibling inflow. When we margin collapse, we always do it in the context of inflow boxes.) Test: fast/block/block-only/float-and-siblings-with-margins.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): * layout/blockformatting/BlockFormattingContext.h: 2018-08-14 Yusuke Suzuki Worker should support unhandled promise rejections https://bugs.webkit.org/show_bug.cgi?id=188265 Reviewed by Darin Adler. This patch adds PromiseRejectionEvent support in workers. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::promiseRejectionTracker): Move promiseRejectionTracker handler from JSDOMWindowBase to JSDOMGlobalObject to share it with WorkerGlobalScope. * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::promiseRejectionTracker): Deleted. Moved to JSDOMGlobalObject. * bindings/js/JSDOMWindowBase.h: * bindings/js/JSExecState.cpp: (WebCore::JSExecState::didLeaveScriptContext): PromiseRejectionTracker is driven in workers too. * bindings/js/JSPromiseRejectionEventCustom.cpp: Added. (WebCore::JSPromiseRejectionEvent::visitAdditionalChildren): Marking PromiseRejectionEvent::m_reason. * bindings/js/JSWorkerGlobalScopeBase.cpp: Configure promiseRejectionTracker. * dom/Microtasks.cpp: (WebCore::MicrotaskQueue::contextQueue): * dom/Microtasks.h: * dom/PromiseRejectionEvent.cpp: (WebCore::PromiseRejectionEvent::PromiseRejectionEvent): * dom/PromiseRejectionEvent.h: * dom/PromiseRejectionEvent.idl: Expose it to worker scope. The custom mark function is required since we start using JSValueInWrappedObject. And the constructor no longer requires ExecState. * dom/RejectedPromiseTracker.cpp: (WebCore::RejectedPromiseTracker::reportUnhandledRejections): (WebCore::RejectedPromiseTracker::reportRejectionHandled): Remove state argument for PromiseRejectionEvent::create. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::removeRejectedPromiseTracker): * dom/ScriptExecutionContext.h: In worker thread, we should delete PromiseRejectionTracker before destroying VM because PromiseRejectionTracker's destruction requires VM. If we destroy VM first, PromiseRejectionTracker's destruction causes crashing. In main thread, we do not need to handle this case since we never destroy VM. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::prepareForTermination): (WebCore::WorkerGlobalScope::removeMicrotaskQueue): Deleted. * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScope.idl: Add onunhandledrejection and onrejectionhandled event handler attributes. * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): We call WorkerGlobalScope::prepareForTermination, which cleans up Worker's objects touching VM. 2018-08-14 Rob Buis Fetch: content-length header is being added to the safe-list https://bugs.webkit.org/show_bug.cgi?id=185473 Reviewed by Youenn Fablet. Content-Length is a CORS-safelisted reponse header: https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name Tests: web-platform-tests/fetch/api/cors/cors-filtering.html web-platform-tests/fetch/api/cors/cors-filtering-worker.html * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): 2018-08-13 Zalan Bujtas [LFC][Floating] Do not confuse clear with clearance. https://bugs.webkit.org/show_bug.cgi?id=188541 Reviewed by Simon Fraser. clear -> CSS property. clearance -> the offset required to avoid floats when clear is present. * layout/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForClear const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::hasClear const): (WebCore::Layout::Box::hasClearance const): Deleted. * layout/layouttree/LayoutBox.h: 2018-08-13 James Savage [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:] https://bugs.webkit.org/show_bug.cgi?id=188537 Reviewed by Tim Horton. * platform/ios/ValidationBubbleIOS.mm: (WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for presenting an already presented view controller by turning the scenario into an early return. 2018-08-13 Alex Christensen Make CSSSelectorList a little more sane https://bugs.webkit.org/show_bug.cgi?id=188539 Reviewed by Simon Fraser. This patch does four things: 1. Use a UniqueArray instead of a raw pointer and manually calling destructors. 2. Use move semantics a little bit better. 3. Add a CSSSelectorList&& to the StyleRule and StyleRulePage because every time we create either one of those objects we call a setter to give it a CSSSelectorList. That's what constructor arguments are for. 4. Don't use CSSSelectorList.componentCount(), which iterates all components, to determine if it's empty. Use first() instead. * css/CSSPageRule.cpp: (WebCore::CSSPageRule::setSelectorText): * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::componentCount const): (WebCore::CSSSelectorList::listSize const): (WebCore::CSSSelectorList::operator=): (WebCore::CSSSelectorList::deleteSelectors): Deleted. * css/CSSSelectorList.h: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::first const): (WebCore::CSSSelectorList::indexOfNextSelectorAfter const): (WebCore::CSSSelectorList::~CSSSelectorList): Deleted. (WebCore::CSSSelectorList::adoptSelectorArray): Deleted. (WebCore::CSSSelectorList::hasOneSelector const): Deleted. * css/CSSStyleRule.cpp: (WebCore::CSSStyleRule::setSelectorText): * css/StyleRule.cpp: (WebCore::StyleRule::StyleRule): (WebCore::StyleRule::createForSplitting): (WebCore::StyleRulePage::StyleRulePage): * css/StyleRule.h: * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumePageRule): (WebCore::CSSParserImpl::consumeStyleRule): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): 2018-08-13 Ali Juma [IntersectionObserver] Validate threshold values https://bugs.webkit.org/show_bug.cgi?id=188475 Reviewed by Simon Fraser. Throw an exception if any of an IntersectionObserver's thresholds are outside the range [0, 1]. Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html intersection-observer/intersection-observer-interface.html * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): * page/IntersectionObserver.h: 2018-08-13 Alex Christensen Remove unused CSSSelector::parseNth https://bugs.webkit.org/show_bug.cgi?id=188529 Reviewed by Simon Fraser. This was conceptually replaced by the call to setNth in CSSSelectorParser::consumePseudo. * css/CSSSelector.cpp: (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::setNth): (WebCore::CSSSelector::nthA const): (WebCore::CSSSelector::nthB const): (WebCore::CSSSelector::parseNth const): Deleted. (WebCore::CSSSelector::RareData::parseNth): Deleted. * css/CSSSelector.h: (WebCore::CSSSelector::CSSSelector): * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addNthChildType): 2018-08-13 Alex Christensen Remove unused code in CSSParserSelector/CSSSelector https://bugs.webkit.org/show_bug.cgi?id=188528 Reviewed by Simon Fraser. * css/CSSSelector.cpp: * css/CSSSelector.h: (WebCore::CSSSelector::serializingValue const): (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted. * css/parser/CSSParserSelector.h: (WebCore::CSSParserSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted. 2018-08-13 Alex Christensen Modernize CSSSelectorList a little https://bugs.webkit.org/show_bug.cgi?id=188527 Reviewed by Simon Fraser. No change in behavior. Just use make_unique and move semantics a little more. * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::adoptSelectorVector): Deleted. * css/CSSSelectorList.h: * css/StyleRule.h: * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::parsePageSelector): * css/parser/CSSParserSelector.cpp: (WebCore::CSSParserSelector::adoptSelectorVector): * css/parser/CSSParserSelector.h: * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumeComplexSelectorList): (WebCore::CSSSelectorParser::consumeCompoundSelectorList): (WebCore::CSSSelectorParser::consumePseudo): 2018-08-13 Antti Koivisto Meaning of OptionSet::contains is unclear when used with OptionSet argument https://bugs.webkit.org/show_bug.cgi?id=188501 Reviewed by Anders Carlsson. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::possiblyHasMarkers): * dom/DocumentMarkerController.h: (WebCore::DocumentMarkerController::hasMarkers const): * platform/FileSystem.h: (WebCore::FileSystem::openAndLockFile): * rendering/RenderElement.cpp: (WebCore::RenderElement::selectionColor const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintForegroundForFragments): 2018-08-13 Commit Queue Unreviewed, rolling out r234747. https://bugs.webkit.org/show_bug.cgi?id=188524 plugin processes crash on launch (Requested by smfr on #webkit). Reverted changeset: "We should cache the compiled sandbox profile in a data vault" https://bugs.webkit.org/show_bug.cgi?id=184991 https://trac.webkit.org/changeset/234747 2018-08-13 Wenson Hsieh [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup https://bugs.webkit.org/show_bug.cgi?id=188485 Reviewed by Tim Horton. Before r223678, -typeIdentifiersToLoadForRegisteredTypeIdentifiers:, which is responsible for determining which type identifiers to load upon performing a drop, returned the following when dropping a rich text selection onto a textarea: "public.plain-text", "public.html" After r223678, we now propagate a custom pasteboard data type when dragging, and the same list now looks like: "com.apple.WebKit.custom-pasteboard-data", "public.html", "public.plain-text" Subsequently, logic in `-_preLoadedDataConformingToType:…` (responsible for mapping a requested type identifier to data that has been loaded from an item provider) iterates through the aforementioned list of type identifiers and selects the data of the first type identifier in the list that conforms to the requested type identifier. However, this list of type identifiers is currently the result of `-[NSSet allObjects]`, which means that the type identifiers in the list are in no particular order! As such, this particular use case only worked by accident prior to r223678, and after that change, this latent bug was surfaced. The patch here makes two adjustments to pasteboard handling on iOS to fix the bug. Test: DragAndDropTests.NonEditableTextSelectionToTextarea * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::read): When reading plain text from the pasteboard, give "public.plain-text" priority over "public.text". This ensures that we don't end up reading markup as "plain text" when there's already more relevant plain text data present in the pasteboard. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Refactor existing logic to enforce a consistent ordering of type identifiers to load. First, we use NSMutableOrderedSet instead of just an NSMutableSet to store type identifiers we've added. Secondly, move all logic to insert type identifiers into this set to the end of the method, where we iterate over all of the type identifiers in order and add each type identifier to the set if needed. This ensures that the order of resulting types is from highest to lowest fidelity. (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]): (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]): Deleted. Fix a typo in the method name. 2018-08-13 Alex Christensen Use a 1-byte enum class for TextDirection https://bugs.webkit.org/show_bug.cgi?id=188350 Reviewed by Simon Fraser. * Modules/notifications/Notification.h: * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator TextDirection const): * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::matchAllRules): * dom/Document.cpp: (WebCore::Document::updateTitleFromTitleElement): (WebCore::Document::setTitle): * dom/Position.cpp: (WebCore::Position::primaryDirection const): * dom/Range.cpp: (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): * editing/Editing.cpp: (WebCore::directionOfEnclosingBlock): * editing/Editor.cpp: (WebCore::Editor::baseWritingDirectionForSelectionStart const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::willBeModified): (WebCore::FrameSelection::modifyExtendingRight): (WebCore::FrameSelection::modifyExtendingForward): (WebCore::FrameSelection::modifyMovingRight): (WebCore::FrameSelection::modifyExtendingLeft): (WebCore::FrameSelection::modifyExtendingBackward): (WebCore::FrameSelection::modifyMovingLeft): (WebCore::FrameSelection::textSelectionIntent): (WebCore::FrameSelection::modify): * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const): (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const): * editing/VisibleUnits.cpp: (WebCore::visualWordPosition): (WebCore::leftWordPosition): (WebCore::rightWordPosition): (WebCore::leftBoundaryOfLine): (WebCore::rightBoundaryOfLine): * html/HTMLElement.cpp: (WebCore::HTMLElement::directionalityIfhasDirAutoAttribute const): (WebCore::HTMLElement::directionality const): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setupDateTimeChooserParameters): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::directionForFormData const): (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const): * html/HTMLTitleElement.cpp: (WebCore::HTMLTitleElement::computedTextWithDirection): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::toTextDirection const): (WebCore::CanvasRenderingContext2D::direction const): (WebCore::CanvasRenderingContext2D::textOffset): * html/shadow/SliderThumbElement.cpp: (WebCore::RenderSliderContainer::layout): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * page/Chrome.cpp: (WebCore::Chrome::setToolTip): * page/FrameView.cpp: (WebCore::paginationModeForRenderStyle): * page/Settings.yaml: * platform/RectEdges.h: (WebCore::RectEdges::start): (WebCore::RectEdges::end): (WebCore::RectEdges::start const): (WebCore::RectEdges::end const): (WebCore::RectEdges::setStart): (WebCore::RectEdges::setEnd): * platform/UserInterfaceLayoutDirection.h: * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::computeExpansionOpportunity): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::expansionOpportunityCountInternal): (WebCore::FontCascade::leadingExpansionOpportunity): (WebCore::FontCascade::trailingExpansionOpportunity): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawBidiText): * platform/graphics/TextRun.h: (WebCore::TextRun::TextRun): (WebCore::TextRun::rtl const): (WebCore::TextRun::ltr const): (WebCore::TextRun::setDirection): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): * platform/ios/SelectionRect.cpp: (WebCore::SelectionRect::SelectionRect): * platform/text/BidiResolver.h: (WebCore::BidiStatus::BidiStatus): * platform/text/StringWithDirection.h: * platform/text/WritingMode.h: (WebCore::isLeftToRightDirection): (WebCore::isVerticalWritingMode): (WebCore::isFlippedWritingMode): (WebCore::mapLogicalSideToPhysicalSide): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::spellingToolTip const): (WebCore::HitTestResult::title const): (WebCore::HitTestResult::innerTextIfTruncated const): * rendering/InlineBox.h: (WebCore::InlineBox::direction const): (WebCore::InlineBox::isLeftToRightDirection const): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintFillLayer): * rendering/InlineIterator.h: (WebCore::embedCharFromDirection): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): (WebCore::mirrorRTLSegment): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::constructTextRun): * rendering/RenderBlockLineLayout.cpp: (WebCore::determineDirectionality): (WebCore::RenderBlockFlow::textAlignmentForLine const): (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment): (WebCore::RenderBlockFlow::handleTrailingSpaces): (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): * rendering/RenderBox.cpp: (WebCore::computeInlineStaticDistance): (WebCore::RenderBox::computePositionedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalWidthReplaced const): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::updateLogicalWidth): (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect): * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const): * rendering/RenderMarquee.cpp: (WebCore::RenderMarquee::direction const): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::adjustInnerStyle): (RenderMenuList::clientPaddingLeft const): (RenderMenuList::clientPaddingRight const): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::popupInternalPaddingBox const): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonDecorations): (WebCore::RenderThemeMac::popupInternalPaddingBox const): (WebCore::RenderThemeMac::setPopupButtonCellState): (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::paintSearchFieldResultsButton): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::mirrorIfNeeded const): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::layoutBlock): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::isLeftToRightDirection const): (WebCore::RenderStyle::initialDirection): * testing/InternalSettings.cpp: (WebCore::InternalSettings::systemLayoutDirection): (WebCore::InternalSettings::setSystemLayoutDirection): * testing/Internals.h: 2018-08-13 Said Abou-Hallawa Followup (r234683): Element::getAttribute() should return the first non-null attribute value https://bugs.webkit.org/show_bug.cgi?id=188419 Reviewed by Darin Adler. Element::getAttribute() should return the first non-null attribute value since an empty string is a legitimate attribute value. Test: svg/custom/href-svg-namespace-empty.html * dom/Element.h: (WebCore::Element::getAttribute const): 2018-08-13 Michael Catanzaro Unreviewed, since -Wsign-compare warnings in URL.cpp This regressed in r233798 when m_schemeEnd changed to a bitfield. The code looks safe to me, so just silence the warnings with casts. * platform/URL.cpp: (WebCore::URL::setHost): (WebCore::URL::setHostAndPort): (WebCore::URL::setUser): (WebCore::URL::setPass): 2018-08-13 Antti Koivisto Use OptionSet more in editing code https://bugs.webkit.org/show_bug.cgi?id=188500 Reviewed by Wenson Hsieh. Typesafe flags. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::selectComposition): (WebCore::Editor::changeSelectionAfterCommand): (WebCore::Editor::respondToChangedSelection): * editing/Editor.h: (WebCore::TemporarySelectionChange::TemporarySelectionChange): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): (WebCore::FrameSelection::setSelection): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand): * editing/ReplaceSelectionCommand.h: (WebCore::ReplaceSelectionCommand::create): * editing/SetSelectionCommand.cpp: (WebCore::SetSelectionCommand::SetSelectionCommand): * editing/SetSelectionCommand.h: (WebCore::SetSelectionCommand::create): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): 2018-08-13 Zalan Bujtas [LFC][Floating] Add basic clearance support https://bugs.webkit.org/show_bug.cgi?id=188492 Reviewed by Antti Koivisto. Adjust final position of a block level box with clearance when float is present. Test: fast/block/block-only/floating-left-and-right-with-clearance.html * layout/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::alignWithContainingBlock const): (WebCore::Layout::FloatingContext::toContainingBlock const): (WebCore::Layout::FloatingContext::computePosition const): Deleted. * layout/FloatingContext.h: * layout/FloatingState.cpp: (WebCore::Layout::FloatingState::bottom const): * layout/FloatingState.h: (WebCore::Layout::FloatingState::leftBottom const): (WebCore::Layout::FloatingState::rightBottom const): (WebCore::Layout::FloatingState::bottom const): * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): * layout/blockformatting/BlockFormattingContext.h: * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::hasClearance const): * layout/layouttree/LayoutBox.h: 2018-08-13 Yusuke Suzuki Expose CloseEvent and CustomEvent to workers https://bugs.webkit.org/show_bug.cgi?id=188493 Reviewed by Sam Weinig. This patch exposes CloseEvent and CustomEvent to workers. It is OK since they do not depend on things in the main thread. For example, we cannot expose FormData right now since it depends on Page. We do not expose PromiseRejectionEvent in this patch since it will be done in [1]. [1]: https://bugs.webkit.org/show_bug.cgi?id=188265 * Modules/websockets/CloseEvent.idl: * dom/CustomEvent.idl: 2018-08-13 Oriol Brufau [css-logical] Implement flow-relative margin, padding, border and sizing properties https://bugs.webkit.org/show_bug.cgi?id=188386 Reviewed by Manuel Rego Casasnovas. These properties provide the author with the ability to control margins through logical, rather than physical, direction and dimension mappings. Only longhand properties and border shorthands for specific sides are implemented as part of this patch. The existing prefixed properties become aliases of the new ones. The change in WebCore::isLayoutDependent fixes an existing issue that made getComputedStyle provide an old value for -webkit-logical-height and -webkit-logical-height (see https://crbug.com/849855). Tests: imported/w3c/web-platform-tests/css/css-logical/animation-001.html imported/w3c/web-platform-tests/css/css-logical/animation-002.html imported/w3c/web-platform-tests/css/css-logical/animation-003.tentative.html imported/w3c/web-platform-tests/css/css-logical/cascading-001.html 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-inset.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 imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size-vlr.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size-vlr.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-quirklength.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::isLayoutDependent): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/CSSProperty.cpp: (WebCore::CSSProperty::resolveDirectionAwareProperty): (WebCore::CSSProperty::isDirectionAwareProperty): * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): * css/parser/CSSParserFastPaths.cpp: (WebCore::isSimpleLengthPropertyID): (WebCore::isColorPropertyID): (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::CSSPropertyParser::parseShorthand): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computeCollapsedStartBorder const): (WebCore::RenderTableCell::computeCollapsedEndBorder const): (WebCore::RenderTableCell::computeCollapsedBeforeBorder const): (WebCore::RenderTableCell::computeCollapsedAfterBorder const): 2018-08-12 Sihui Liu CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient(WebCore::IDBServer::UniqueIDBDatabaseConnection&) https://bugs.webkit.org/show_bug.cgi?id=188474 Reviewed by Chris Dumez. UniqueIDBDatabaseConnection is refcounted by UniqueIDBDatabaseTransaction and it refcounts UniqueIDBDatabaseTransaction. This cycle could make UniqueIDBDatabaseConnection outlives UniqueIDBDatabase, so its reference to UniqueIDBDatabase may be stale. Calling a function on a stale object is probably the reason of recent various storage process crashes in indexedDB. This patch makes m_database a WeakPtr and adds assertions that could help us debug the crashes. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback): (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient): (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange): (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: (WebCore::IDBServer::UniqueIDBDatabaseConnection::database): * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers): * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::openDatabaseSuccess): (WebCore::IDBResultData::openDatabaseUpgradeNeeded): 2018-08-12 Yusuke Suzuki Break reference cycle in ErrorEvent by using JSValueInWrappedObject https://bugs.webkit.org/show_bug.cgi?id=188491 Reviewed by Darin Adler. ErrorEvent should not use Strong to hold error JSValue. This patch integrates JSValueInWrappedObject into ErrorEvent. * Modules/webvr/VRDisplayEvent.h: Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSErrorEventCustom.cpp: Copied from Source/WebCore/Modules/webvr/VRDisplayEvent.h. (WebCore::JSErrorEvent::visitAdditionalChildren): Add custom mark function for JSValueInWrappedObject. * bindings/js/JSEventListener.h: * bindings/js/WindowProxy.cpp: Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build. * dom/ErrorEvent.cpp: (WebCore::ErrorEvent::ErrorEvent): (WebCore::ErrorEvent::error): (WebCore::ErrorEvent::trySerializeError): Align the implementation to PushStateEvent::trySerializeState. * dom/ErrorEvent.h: * dom/ErrorEvent.idl: 2018-08-12 Aditya Keerthi [macOS] Color wells should appear pressed when presenting a color picker https://bugs.webkit.org/show_bug.cgi?id=188477 Reviewed by Tim Horton. Currently, when clicking on a color well, the color well loses its pressed appearance once the mouse is lifted. Because of this behavior, the color well does not appear to be active when the color picker is displayed. Added the color-well -webkit-appearance value to control the drawing of the color well separate from other buttons. Also added a new ControlState, named PresentingState. A control can be in this state whenever it is presenting some attached view. In the case of the color well this is the color picker. The Information as to whether a form control is in the presenting state comes from isPresentingAttachedView() in HTMLInputElement. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/html.css: (input[type="color"]::-webkit-color-swatch): * html/ColorInputType.cpp: (WebCore::ColorInputType::isPresentingAttachedView const): (WebCore::ColorInputType::elementDidBlur): (WebCore::ColorInputType::didEndChooser): * html/ColorInputType.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::isPresentingAttachedView const): * html/HTMLInputElement.h: * html/InputType.cpp: (WebCore::InputType::isPresentingAttachedView const): * html/InputType.h: * platform/ControlStates.h: * platform/ThemeTypes.h: * platform/mac/ThemeMac.mm: (WebCore::updateStates): (WebCore::setUpButtonCell): (WebCore::paintColorWell): (WebCore::ThemeMac::minimumControlSize const): (WebCore::ThemeMac::controlBorder const): (WebCore::ThemeMac::paint): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::paintBorderOnly): (WebCore::RenderTheme::paintDecorations): (WebCore::RenderTheme::isControlStyled const): (WebCore::RenderTheme::extractControlStatesForRenderer const): (WebCore::RenderTheme::isPresenting const): * rendering/RenderTheme.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::adjustRepaintRect): 2018-08-12 Zalan Bujtas [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent. https://bugs.webkit.org/show_bug.cgi?id=188487 Reviewed by Antti Koivisto. Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-08-10 Antti Koivisto Use OptionSet for various RenderLayer flags https://bugs.webkit.org/show_bug.cgi?id=188472 Followup, fix some mistakes. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::~RenderLayerBacking): 2018-08-10 Ryosuke Niwa [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime https://bugs.webkit.org/show_bug.cgi?id=188480 Reviewed by Simon Fraser. Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms). In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1 or WebKit2 APIs in non-main threads. * platform/Timer.cpp: (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime. (WebCore::TimerBase::~TimerBase): (WebCore::TimerBase::setNextFireTime): 2018-08-10 Daniel Bates Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore() https://bugs.webkit.org/show_bug.cgi?id=188459 Reviewed by Chris Dumez. It is unnessary for CachedFrameBase::restore() to explicitly resume animations on the document as it calls Document::resume(), which already does this. No functionality changed. So, no new tests. * history/CachedFrame.cpp: (WebCore::CachedFrameBase::restore): 2018-08-10 Antti Koivisto Use OptionSet for various RenderLayer flags https://bugs.webkit.org/show_bug.cgi?id=188472 Reviewed by Simon Fraser. Typesafe flags. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::paintContents): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositionsAfterLayout): (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paint): (WebCore::paintForFixedRootBackground): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::filterPainter const): (WebCore::RenderLayer::hasFilterThatIsPainting const): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::paintLayerContents): (RenderLayer::paintLayerByApplyingTransform): (RenderLayer::paintList): (RenderLayer::updatePaintingInfoForFragments): (RenderLayer::paintTransformedLayerIntoFragments): (RenderLayer::calculateClipRects const): (WebCore::RenderLayer::paintLayerByApplyingTransform): Deleted. (WebCore::RenderLayer::paintList): Deleted. (WebCore::RenderLayer::enclosingPaginationLayerInSubtree const): Deleted. (WebCore::RenderLayer::collectFragments): Deleted. (WebCore::RenderLayer::updatePaintingInfoForFragments): Deleted. (WebCore::RenderLayer::paintTransformedLayerIntoFragments): Deleted. (WebCore::RenderLayer::paintBackgroundForFragments): Deleted. (WebCore::RenderLayer::paintForegroundForFragments): Deleted. (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): Deleted. (WebCore::RenderLayer::paintOutlineForFragments): Deleted. (WebCore::RenderLayer::paintMaskForFragments): Deleted. (WebCore::RenderLayer::paintChildClippingMaskForFragments): Deleted. (WebCore::RenderLayer::paintOverflowControlsForFragments): Deleted. (WebCore::RenderLayer::hitTest): Deleted. (WebCore::RenderLayer::enclosingElement const): Deleted. (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): Deleted. (WebCore::computeZOffset): Deleted. (WebCore::RenderLayer::createLocalTransformState const): Deleted. (WebCore::isHitCandidate): Deleted. (WebCore::RenderLayer::hitTestLayer): Deleted. (WebCore::RenderLayer::hitTestContentsForFragments const): Deleted. (WebCore::RenderLayer::hitTestResizerInFragments const): Deleted. (WebCore::RenderLayer::hitTestTransformedLayerInFragments): Deleted. (WebCore::RenderLayer::hitTestLayerByApplyingTransform): Deleted. (WebCore::RenderLayer::hitTestContents const): Deleted. (WebCore::RenderLayer::hitTestList): Deleted. (WebCore::RenderLayer::updateClipRects): Deleted. (WebCore::RenderLayer::clipRects const): Deleted. (WebCore::RenderLayer::calculateClipRects const): Deleted. (WebCore::showLayerTree): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateCompositedBounds): (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): (WebCore::RenderLayerBacking::paintIntoLayer): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): * rendering/RenderLayerCompositor.h: * rendering/RenderReplica.cpp: (WebCore::RenderReplica::paint): 2018-08-10 Sihui Liu CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose https://bugs.webkit.org/show_bug.cgi?id=188461 Reviewed by Chris Dumez. When we try to schedule shutdown for database, we should cancel the timer so no scheduleShutdownForClose will be running after this. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose): 2018-08-10 Daniel Bates Once is hidden, its content won't be displayed again if its URL has fragment identifier ("#"). https://bugs.webkit.org/show_bug.cgi?id=187990 Reviewed by Simon Fraser. Fixes an issue where an HTML object element that behaves like an iframe and references a resource whose URL contains a fragment would not be repainted when its CSS display property changes. Rendering of an that behaves like an iframe is handled by a widget (FrameView). When the CSS display property for an is set to "none" we detach the widget from its renderer as part of destroying the render tree for the . Subsequently changing the CSS display to a non-"none"/"contents" value will create a new renderer for R. For an that behaves like an iframe, we navigate to the resource associated with the reusing the existing Frame F object created when we first displayed the . Unlike the case where the URL of the resource does not contain a fragment, navigating to a fragment in the same document uses a different code path that does not re-associate the FrameView of F with R before it scrolls the view; => the FrameView of F is not in the view hierarchy. Therefore we do not paint anything for the content of the and hence the scroll is not observable. Instead we need to ensure that the FrameView of F installed in the view hierarchy when navigating to an anchor in the same document. As a side benefit of this fix we now also repaint an that is programmatically navigated to a different anchor in the same document. Tests: fast/repaint/object-as-iframe-hide-and-show-document-at-anchor.html fast/repaint/object-as-iframe-navigate-to-same-document-anchor-repaint.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadInSameDocument): 2018-08-10 Ali Juma [IntersectionObserver] Implement rootMargin parsing https://bugs.webkit.org/show_bug.cgi?id=188469 Reviewed by Darin Adler. Parse IntersectionObserver's rootMargin argument and throw an exception if it's invalid. Change the stored rootMargin from a String to a LengthBox so that future patches can use this value in intersection logic. Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html intersection-observer/intersection-observer-interface.html * page/IntersectionObserver.cpp: (WebCore::parseRootMargin): (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::rootMargin const): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::create): Deleted. (WebCore::IntersectionObserver::rootMargin const): Deleted. * page/IntersectionObserver.idl: 2018-08-09 Ben Richards We should cache the compiled sandbox profile in a data vault https://bugs.webkit.org/show_bug.cgi?id=184991 Reviewed by Ryosuke Niwa. Added functionality to FileHandle so that it can lock a file while open. Added a function to FileSystem to delete non empty directories. * platform/FileHandle.cpp: (WebCore::FileHandle::FileHandle): (WebCore::FileHandle::open): (WebCore::FileHandle::close): * platform/FileHandle.h: * platform/FileSystem.h: * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-08-09 Chris Dumez InputType should not interact with an HTMLInputElement is no longer associated with https://bugs.webkit.org/show_bug.cgi?id=188410 Reviewed by Ryosuke Niwa. Clear InputType::m_element when the InputType is no longer associated with the HTMLInputElement because the element changed type. We were already dealing with the InputType no longer being associated with an element because the element died by using a WeakPtr. However, it is conceptually better (more correct) to also clear this pointer if the element is still alive but associated with another InputType. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateType): * html/InputType.h: (WebCore::InputType::detachFromElement): 2018-08-09 Jer Noble Video playback is using more power https://bugs.webkit.org/show_bug.cgi?id=188452 Reviewed by Eric Carlson. Test: TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm When the meaning of PlatformMediaSession::Video changed to "video-only", we failed to update MediaSessionManagerCocoa::updateSessionState() to use the new PlatformMediaSession::VideoAudio enum, so Video-only sessions were getting the higher audio buffer size (where it's not needed) and Video-and-Audio sessions were getting the default value. To enable testing, add a preferredAudioBufferSize property to Internals. Also, the getter for AudioSession::preferredBufferSize was using the wrong CoreAudio property address, and was always returning 0. * platform/audio/AudioSession.h: * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (MediaSessionManagerCocoa::updateSessionState): * platform/audio/mac/AudioSessionMac.cpp: (WebCore::AudioSession::preferredBufferSize const): * testing/Internals.cpp: (WebCore::Internals::preferredAudioBufferSize const): * testing/Internals.h: * testing/Internals.idl: 2018-08-09 Saam Barati memoryFootprint should return size_t not optional https://bugs.webkit.org/show_bug.cgi?id=188444 Reviewed by Simon Fraser. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): 2018-08-09 Ali Juma Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit https://bugs.webkit.org/show_bug.cgi?id=188445 Reviewed by Simon Fraser. Update IntersectionObserverEntry by making rootBounds nullable, and adding an isIntersecting attribute. Make the same changes to IntersectionObserverEntryInit, and also add an intersectionRatio attribute. Tested by intersection-observer/intersection-observer-entry-interface.html * page/IntersectionObserverEntry.cpp: (WebCore::IntersectionObserverEntry::IntersectionObserverEntry): * page/IntersectionObserverEntry.h: (WebCore::IntersectionObserverEntry::isIntersecting const): * page/IntersectionObserverEntry.idl: 2018-08-09 Charlie Turner Fix copyright headers on new ISO parsing class https://bugs.webkit.org/show_bug.cgi?id=188432 Unreviewed fix. This was left off from a previous bug by mistake, retrospectively adding the correct copyright headers. No tests required. * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp: * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: 2018-08-08 Ross Kirsling run-bindings-tests is not Win32-compatible https://bugs.webkit.org/show_bug.cgi?id=188424 Reviewed by Fujii Hironori. * bindings/scripts/preprocessor.pm: (applyPreprocessor): Ensure that we fall back to cl.exe if CC env var is not set on Windows. 2018-08-08 Ryosuke Niwa REGRESSION (r228260): Events handled by input method invoke default event handler https://bugs.webkit.org/show_bug.cgi?id=188370 Reviewed by Wenson Hsieh. The bug was caused by the default event handler being invoked for the "virtual" keydown events generated for input methods. Namely, when Japanese or Chinese input methods swallows TAB key, WebKit should not invoke the default event handler and move the focus during input composition. Fixed the bug by adding a new boolean on Event indicating whether the default event handler should be invoked, and restoring the behavior prior to r228260 for these virtual keydown events. Test: editing/input/press-tab-during-ime-composition.html * dom/Event.h: (WebCore::Event::isDefaultEventHandlerIgnored const): Added. (WebCore::Event::setIsDefaultEventHandlerIgnored): Added. * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): Don't invoke the default event handler if isDefaultEventHandlerIgnored is set. * page/EventHandler.cpp: (WebCore::EventHandler::internalKeyEvent): Set isDefaultEventHandlerIgnored. This restores WebKit's behavior prior to r228260. 2018-08-08 Justin Fan Prevent collectScreenProperties from crashing Base System https://bugs.webkit.org/show_bug.cgi?id=188429 Reviewed by Simon Fraser. Adding some error-checking and early returns to further prevent calling CGLDescribeRenderer with invalid parameters. Existing WebGL tests should cover; no expected change in behavior. Crash happened primarily on Base System. * platform/mac/PlatformScreenMac.mm: (WebCore::gpuIDForDisplayMask): 2018-08-08 Don Olmstead [Curl] Surface additional NetworkLoadMetrics https://bugs.webkit.org/show_bug.cgi?id=188391 Reviewed by Joseph Pecoraro. * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::getNetworkLoadMetrics): 2018-08-08 Don Olmstead [Nicosia] Add the Nicosia-specific PlatformLayer type alias https://bugs.webkit.org/show_bug.cgi?id=188405 Unreviewed build fix. * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: 2018-08-08 Simon Fraser Add a WebKit2 logging channel for ActivityState https://bugs.webkit.org/show_bug.cgi?id=188411 Reviewed by Tim Horton. Add logging for ActivityState changes and the entrypoints that affect ActivityState. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/ActivityState.cpp: Added. (WebCore::activityStateFlagsToString): * page/ActivityState.h: 2018-08-08 Eric Carlson Add LogArgument template for PlatformMediaSession::RemoteControlCommandType https://bugs.webkit.org/show_bug.cgi?id=188314 Reviewed by Alex Christensen. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Don't coerce to int for logging. * platform/audio/PlatformMediaSession.cpp: (WebCore::convertEnumerationToString): New. (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Log command. * platform/audio/PlatformMediaSession.h: (WTF::LogArgument::toString): 2018-08-08 Joseph Pecoraro Web Inspector: XHR content sometimes shows as error even though load succeeded https://bugs.webkit.org/show_bug.cgi?id=188385 Reviewed by Devin Rousso. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::didReceiveData): Avoid a double hash lookup in the common case. Allow synchronous XHR to have text data appended in the normal case. Allow synchronous XHR to set base64 encoded data right here for non-text data. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::hasBufferedData const): Getter to see if data is buffered or not for this resource. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::maybeAddResourceData): Return the updated ResourceData to avoid clients having to do a lookup. 2018-08-08 Sihui Liu Assertion failed in Webcore::Process::setIdentifier() https://bugs.webkit.org/show_bug.cgi?id=188404 Reviewed by Chris Dumez. App using both WebKit1 and WebKit may crash in WebKit initialization. * platform/Process.cpp: (WebCore::Process::setIdentifier): 2018-08-08 Charlie Turner Add CENC sanitization https://bugs.webkit.org/show_bug.cgi?id=188376 Reviewed by Xabier Rodriguez-Calvar. This patch adds support for sanitizing the CENC initialization data, to ensure there are no obviously bogus values in the untrusted input from generateRequest, see https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest for more details on sanitization. Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html * Modules/encryptedmedia/InitDataRegistry.cpp: The diff looks a bit wonky because I had to reorder extractKeyIDsCenc to come before sanitizeCenc. (WebCore::extractKeyIDsCenc): Added implementation, a nullopt return value here indicates the parsing found an error in the box values. (WebCore::sanitizeCenc): Added implementation, if the box can be parsed, return a copy of the buffer as before, otherwise an error value. * Sources.txt: Add the new PSSH box type. * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp: Added, parsing methods come from ISO/IEC 23001-7-2016 Section 8.1.1. (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): Ditto. * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::boxTypeName): Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::systemID const): Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::keyIDs const): Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::data const): Ditto. 2018-08-08 Zan Dobersek [Nicosia] Add the Nicosia-specific PlatformLayer type alias https://bugs.webkit.org/show_bug.cgi?id=188405 Reviewed by Carlos Garcia Campos. Add a Nicosia-specific PlatformLayer type alias that points to the Nicosia::PlatformLayer type. This is guarded by the USE(NICOSIA) macro, which guards additional code in this patch but will be added to other Nicosia-specific classes later. To keep things buildable when USE(NICOSIA) is defined, additional changes are made to classes that operate with platform layers. Cairo-specific ImageBuffer implementation and the related ImageBufferData class are modified to work with a Nicosia::ContentLayer object. This object is using the TextureMapper-specific Impl class which internally keeps a TextureMapperPlatformLayerProxy object. This way we can reuse existing code that also works with an object of this type, only difference is where the proxy object is kept. Main difference is in the ImageBuffer::platformLayer() method, where pointer to the Nicosia::ContentLayer object is returned when USE(NICOSIA) is enabled. Similar approach is taked for the MediaPlayerPrivateGStreamerBase class. When USE(NICOSIA) is enabled, a Nicosia::ContentLayer object is constructed, and with the TextureMapper-specific Impl we again operate on the TextureMapperPlatformLayerProxy object like before, so all of the proxy-specific code is bundled into helper lambdas that operate on the given proxy object. In the platformLayer() method, we again return pointer to the Nicosia::ContentLayer object when USE(NICOSIA) is on. For the GraphicsContext3D integration, we have to provide a separate class that replicates most of the functionality currently present in the TextureMapperGC3DPlatformLayer class. Main difference is that in the new Nicosia::GC3DLayer class, a Nicosia::ContentLayer object is spawned with the TextureMapper-specific Impl. The proxy object held by that Impl is then again used to push new buffers into the rendering pipeline. As before, pointer to the Nicosia::ContentLayer is returned in the GraphicsContext3D::platformLayer() object. Integration of the GraphicsContext3D class into Nicosia layering needs further work in the future. Target should be providing a class that is not specific to the TextureMapper layer. Additionally, when USE(NICOSIA) is enabled, we remove the TextureMapperGC3DPlatformLayer class from compilation since it depends on a PlatformLayer type alias to the TextureMapperPlatformLayerProxyProvider class. This patch also doesn't address the abundance of macros that this code now uses. While USE(NICOSIA) is introduced, we have to work around four additional macros in this code: USE(TEXTURE_MAPPER), USE(TEXTURE_MAPPER_GL), USE(COORDINATED_GRAPHICS) and USE(COORDINATED_GRAPHICS_THREADED). In a lot of places these are used interchangeably, but they should be merged and simplified in use. I hope to approach this once the USE(NICOSIA) functionality lands and is turned on for ports that currently build with USE(COORDINATED_GRAPHICS). * platform/TextureMapper.cmake: * platform/graphics/GraphicsContext3D.h: * platform/graphics/PlatformLayer.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBufferData::ImageBufferData): (WebCore::ImageBufferData::~ImageBufferData): (WebCore::ImageBufferData::swapBuffersIfNeeded): (WebCore::ImageBuffer::platformLayer const): * platform/graphics/cairo/ImageBufferDataCairo.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer const): (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded): (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp: Added. (Nicosia::GC3DLayer::GC3DLayer): (Nicosia::GC3DLayer::~GC3DLayer): (Nicosia::GC3DLayer::makeContextCurrent): (Nicosia::GC3DLayer::platformContext): (Nicosia::GC3DLayer::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h: Added. (Nicosia::GC3DLayer::contentLayer const): * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: (WebCore::GraphicsContext3D::GraphicsContext3D): (WebCore::GraphicsContext3D::makeContextCurrent): (WebCore::GraphicsContext3D::platformGraphicsContext3D): (WebCore::GraphicsContext3D::platformLayer const): * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer): (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): 2018-08-08 Manuel Rego Casasnovas [css-grid] Update behavior of percentage row tracks and gutters https://bugs.webkit.org/show_bug.cgi?id=188403 Reviewed by Sergio Villar Senin. The CSSWG decided to change how percentage row tracks and gutters in a grid container with indefinite height are resolved. The CSSWG issues are: - https://github.com/w3c/csswg-drafts/issues/1921 - https://github.com/w3c/csswg-drafts/issues/509 So far they were resolved as "auto", like it happens with percentage heights in regular blocks. But now they're going to behave similar to what happens in the columns axis, they would be ignored to compute the intrinsic height. This causes that we need to repeat the track sizing algorithm when we have a grid container with indefinite height that has some percentage rows using the intrinsic height calculated on the first pass. Then the percentages will be resolved against the intrinsic height. Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-002.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-002.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::gridTrackSize const): (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): (WebCore::GridTrackSizingAlgorithm::setup): (WebCore::GridTrackSizingAlgorithm::reset): * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::availableSpaceForGutters const): (WebCore::RenderGrid::repeatTracksSizingIfNeeded): (WebCore::RenderGrid::layoutBlock): 2018-08-07 Saam Barati ResourceUsageOverlay should use physical footprint for its "Footprint" label https://bugs.webkit.org/show_bug.cgi?id=188395 Reviewed by Simon Fraser. Let's use physical footprint on Cocoa for the number we say is "footprint". Before, we were just using the number of dirty pages multiplies by page size. This number was an upper bound on footprint since it doesn't take into account compressed memory. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): 2018-08-05 Darin Adler [Cocoa] More tweaks and refactoring to prepare for ARC https://bugs.webkit.org/show_bug.cgi?id=188245 Reviewed by Dan Bernstein. * bridge/objc/objc_instance.mm: Updated include for rename: FoundationSPI.h -> objcSPI.h. * platform/ios/wak/WebCoreThread.mm: Ditto. 2018-08-07 Chris Dumez navigator.sendBeacon does not work in pagehide callbacks https://bugs.webkit.org/show_bug.cgi?id=188329 Reviewed by Alex Christensen. Add support for sending beacons from pagehide event handlers. We normally do not allow loads because we're about to enter PageCache. However, in case of Beacon, this is fine since it uses PingLoad and does not WebCore to do the load. Test: http/wpt/beacon/sendBeacon-in-pagehide.html * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): - Allow Beacon loads to go through even if the document's pageCacheState is AboutToEnterPageCache (i.e. we're firing the 'pagehide' event) - Allow Becon loads to go though even if the FrameLoader's state is provisional (i.e. a load is pending) 2018-08-07 Said Abou-Hallawa Allow href attribute without xlink on SVG elements https://bugs.webkit.org/show_bug.cgi?id=153854 Reviewed by Dean Jackson. SVG 2 has moved the href attribute from xlink namespace to svg namespace. Instead of using xlink:href, svg:href should be used or simply use href if the svg namespace is defined. See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs. For backward compatibility, xlink:href will be treated as an alias to href till it is acceptable to completely remove the support for the deprecated xlink:href. Tests: svg/custom/href-svg-namespace-animate.svg svg/custom/href-svg-namespace-dynamic.svg svg/custom/href-svg-namespace-elements.html svg/custom/href-svg-namespace-expected.svg svg/custom/href-svg-namespace-static.svg * dom/Element.cpp: (WebCore::Element::absoluteLinkURL const): * dom/Element.h: (WebCore::Element::getAttribute const): This new template function with template pack parameter QualifiedNames is added to return the first none empty attribute value given a set of attributes' names. This should be useful for deprecated attributes. When we decide to remove the support for the deprecated attribute, all we need is to remove it as a parameter to getAttribute(). In this case, the none template function will be called. * dom/VisitedLinkState.cpp: (WebCore::linkAttribute): * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::filterScriptToken): * svg/SVGAElement.cpp: (WebCore::SVGAElement::isURLAttribute const): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGCursorElement.cpp: * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::rebuildElements): (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::animatableAttributeForName): * svg/SVGFEImageElement.cpp: * svg/SVGFilterElement.cpp: * svg/SVGFontFaceUriElement.cpp: (WebCore::SVGFontFaceUriElement::srcValue const): (WebCore::SVGFontFaceUriElement::parseAttribute): (WebCore::SVGFontFaceUriElement::loadFont): * svg/SVGForeignObjectElement.cpp: * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement const): * svg/SVGGradientElement.cpp: * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::imageSourceURL const): * svg/SVGMPathElement.cpp: * svg/SVGPatternElement.cpp: * svg/SVGScriptElement.h: * svg/SVGTRefElement.cpp: * svg/SVGTextPathElement.cpp: * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::registerAttributes): (WebCore::SVGURIReference::parseAttribute): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::expandUseElementsInShadowTree const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::isSupportedAttribute): (WebCore::SVGSMILElement::svgAttributeChanged): * svg/svgattrs.in: 2018-08-07 Ryosuke Niwa document.open and document.write must throw while the HTML parser is synchronously constructing a custom element https://bugs.webkit.org/show_bug.cgi?id=187319 Reviewed by Frédéric Wang. Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during a synchronous custom element construction as specified: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero. (WebCore::Document::closeForBindings): Ditto. (WebCore::Document::write): Ditto. (WebCore::Document::writeln): Ditto. * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs. * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer): (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer. 2018-08-07 Alex Christensen Use 1-byte enum class for Document::StandaloneStatus https://bugs.webkit.org/show_bug.cgi?id=188352 Reviewed by Chris Dumez. * dom/Document.cpp: (WebCore::Document::setXMLStandalone): * dom/Document.h: (WebCore::Document::xmlStandalone const): * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendXMLDeclaration): 2018-08-07 Rob Buis fetch() with subresource integrity crashes on zero length body https://bugs.webkit.org/show_bug.cgi?id=184325 Reviewed by Alex Christensen. Check that resourceBuffer() is non null before dereferencing. Tests: http/tests/subresource-integrity/sri-fetch.js http/tests/subresource-integrity/sri-fetch-worker.js * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::didFinishLoading): 2018-08-07 Justin Fan Prevent querying for renderer info for disconnected or uninitialized displays https://bugs.webkit.org/show_bug.cgi?id=188387 Reviewed by Simon Fraser. Calling CGL functions with a NULL displayMask crashes the process. No tests; requires multiple displays. * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): 2018-08-06 Ryosuke Niwa document.open and document.write must throw while the HTML parser is synchronously constructing a custom element https://bugs.webkit.org/show_bug.cgi?id=187319 Reviewed by Frédéric Wang. Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during a synchronous custom element construction as specified: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero. (WebCore::Document::closeForBindings): Ditto. (WebCore::Document::write): Ditto. (WebCore::Document::writeln): Ditto. * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs. * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer): (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer. 2018-08-07 Ryan Haddad Unreviewed, suppress warnings to fix the build. * crypto/CommonCryptoUtilities.cpp: (WebCore::getCommonCryptoDigestAlgorithm): 2018-08-07 Alex Christensen Removed unused *AllInOne.cpp https://bugs.webkit.org/show_bug.cgi?id=188369 Reviewed by Yusuke Suzuki. * accessibility/AccessibilityAllInOne.cpp: Removed. * bindings/js/JSBindingsAllInOne.cpp: Removed. * css/CSSAllInOne.cpp: Removed. * dom/DOMAllInOne.cpp: Removed. * editing/EditingAllInOne.cpp: Removed. * html/HTMLElementsAllInOne.cpp: Removed. * inspector/InspectorAllInOne.cpp: Removed. * loader/appcache/ApplicationCacheAllInOne.cpp: Removed. * mathml/MathMLAllInOne.cpp: Removed. * platform/text/TextAllInOne.cpp: Removed. * rendering/RenderingAllInOne.cpp: Removed. * rendering/style/StyleAllInOne.cpp: Removed. * rendering/svg/RenderSVGAllInOne.cpp: Removed. * svg/SVGAllInOne.cpp: Removed. 2018-08-07 Carlos Garcia Campos [WPE][GTK] Handle some virtual keys commonly used on TVs https://bugs.webkit.org/show_bug.cgi?id=188375 Reviewed by Žan Doberšek. * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode): * platform/wpe/PlatformKeyboardEventWPE.cpp: (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode): 2018-08-07 Zan Dobersek [Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl https://bugs.webkit.org/show_bug.cgi?id=188348 Reviewed by Carlos Garcia Campos. Add the Nicosia::CompositionLayerTextureMapperImpl class, the TextureMapper-specific implementation that will extend the CompositionLayer class. The important deatil of this implementation is the TextureMapperLayer object that's expected to be managed by the composition controller. As such, it is placed inside the CompositionState struct to clearly indicate its utility and expected place of management. In the current setup, this place would be the CoordinatedGraphicsScene class. The Nicosia::CompositionLayer object that's spawned for each CoordinatedGraphicsLayer instance is now switched to using the CompositionLayerTextureMapperImpl object, with the local temporary no-op CompositionLayer::Impl class removed. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added. (Nicosia::CompositionLayerTextureMapperImpl::createFactory): * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): (): Deleted. 2018-08-07 Zan Dobersek [Nicosia] Add the TextureMapper-specific ContentLayer::Impl derivative https://bugs.webkit.org/show_bug.cgi?id=188344 Reviewed by Carlos Garcia Campos. Add Nicosia::ContentLayerTextureMapperImpl class, providing the TextureMapper-specific implementation that derives from the ContentLayer::Impl class and which can be used by the Nicosia::ContentLayer instances. Internally a TextureMapperPlatformLayerProxy is created, and is accessible to others through a getter. This way the content producers can push new buffers into this proxy object, and the scene compositor can take these buffers for display purposes. Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded() will be called during layer flushes, and the call will cause the content layer clients to take their texture, wrap it into a buffer, and push it into the TextureMapperPlatformLayerProxy object. At the moment this operation is required by the ImageBuffer and GraphicsContext3D producers. The Client object is managed under its own lock. While the producers will only live on the main thread, the thread-safe check in the destructor is necessary in case the ContentLayerTextureMapperImpl object ends up being destroyed on some other thread. The patch only adds the class implementation. It will be integrated into the layer tree later, once all the other pieces of the puzzle land. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: Added. (Nicosia::ContentLayerTextureMapperImpl::createFactory): (Nicosia::ContentLayerTextureMapperImpl::ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: Added. 2018-08-07 Frederic Wang Make DOMWindow::scrollBy rely on DOMWindow::scrollTo https://bugs.webkit.org/show_bug.cgi?id=188343 Reviewed by Darin Adler. This patch makes DOMWindow::scrollBy rely on DOMWindow::scrollTo in order to perform actual scrolling of the view. In particular, this reduces the number of code path to modify in order to implement the ScrollBehavior option (bug 188043). The only change is an optimization when scrolling to position (0, 0) but it is not observable. No new tests, behavior unchanged and already tested. * page/DOMWindow.cpp: (WebCore::DOMWindow::scrollBy const): Add the current view position to the scrollBy offset in order to obtain the scrollTo offset. 2018-08-04 Ryosuke Niwa Add CEReactions=NotNeeded for reactions only needed for customized builtins https://bugs.webkit.org/show_bug.cgi?id=187851 Reviewed by Chris Dumez. Because WebKit doesn't and will not support customized builtin elements, there are many DOM APIs marked with [CEReactions] which don't actually need CustomElementReactionStack. To clarify and document this difference, this patch introduces WebKit extention: [CEReactions=NotNeeded]. When this IDL attribute is specified, we generate CustomElementReactionDisallowedScope in the bindings code to assert that there are no custom elements reactions being enqueued within the DOM API. We suppress this assertion in CustomElementReactionStack since a DOM API with [CEReactions=NotNeeded] can synchronously fire an event and otherwise execute arbirary scripts, which in turn could invoke a DOM API with [CEReactions]. This patch deployes this change to HTMLIFrameElement since "src" IDL attribute triggers this second scenario. Test: fast/custom-elements/custom-element-reaction-within-disallowed-scope.html * bindings/scripts/CodeGeneratorJS.pm: (GeneratePut): (GeneratePutByIndex): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (GenerateAttributeSetterBodyDefinition): (GenerateCustomElementReactionsStackIfNeeded): Added. Generate CustomElementReactionStack for [CEReactions] and CustomElementReactionDisallowedScope for [CEReactions=NotNeeded]. * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/TestCEReactions.idl: Added test cases for [CEReactions=NotNeeded]. * bindings/scripts/test/TestCEReactionsStringifier.idl: Ditto. * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion to catch cases where a DOM API with [CEReactions=NotNeeded] enqueues a custom element reaction; i.e. cases where [CEReactions] should have been used. (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Ditto. (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Ditto. * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope): Added. Enables the assertion in enqueue* functions above. (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::isReactionAllowed): Added. (WebCore::CustomElementReactionDisallowedScope::AllowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::AllowedScope::AllowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::AllowedScope::~AllowedScope): Added. (WebCore::CustomElementReactionStack): Suppress the assertion. See above for why this is needed. * html/HTMLIFrameElement.idl: 2018-08-06 Simon Fraser Clean up initialization of some RenderLayer members https://bugs.webkit.org/show_bug.cgi?id=188330 Reviewed by Dean Jackson. Use initializers for the pointers. No need to initialize LayoutUnits, which initialize to zero. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): * rendering/RenderLayer.h: 2018-08-06 Said Abou-Hallawa Remove the SVG elements' attributes macros https://bugs.webkit.org/show_bug.cgi?id=186751 Reviewed by Simon Fraser. This is how the SVG attributes are implemented after removing the SVG macros: 1) The SVG attribute is defined as a super class of SVGAttribute. The super classes of SVGAttribute are template classes. The type of these template are the property type or the TearOff type. 2) To unify accessing attributes of the SVGElements and its super classes an SVGAttributeAccessor template class is added. It is inherited by other template classes. The types of these templates are the owner and the attributes types. The main functions of these classes is to synchronize the new property value with the document attributes pool and to create and cache the TearOff objects. 3) To make code shorter and more readable, attribute types and attribute accessors are defined for every SVG TearOff type, e.g. -- SVGLength: SVGAnimatedLengthAttribute and SVGAnimatedLengthAttributeAccessor -- SVGAnimatedNumber: SVGAnimatedNumberAttribute and SVGAnimatedNumberAttributeAccessor 4) A special accessor is defined for animated pair and optional attributes: SVGAnimatedPairAttributeAccessor, e.g. -- SVGMarkerElement: orient attribute: "angle" or "type" -- SVGFEGaussianBlurElement: stdDeviation attribute: "x" and "y" 5) The SVG attributes have to be registered into an singleton SVGAttributeRegistry. The SVGAttributeRegistry is a template class. The types of this template class are the the type of the owner and the base classes of this owner. This registry holds a map from "attribute name" to "attribute accessor". 6) To make the code easier to read, the SVGAttributeRegistry implements registerAttribute() for different attribute types. The owner needs only to provide the attribute name and a pointer to the class member of this attribute to the same function "registerAttribute()". The compiler will pick the right function to call based on the type of the attribute. 7) Given a reference to the owner element, SVGAttributeRegistry can loop through the attributes of this owner and through the attributes of its base classes as well to do operations like synchronizing all the attributes or creating the TearOff object of a certain attribute. 8) To make the base class SVGElement have the ability to access the attributes of any of its super classes, SVGAttributeOwnerProxy will be used. SVGAttributeOwnerProxy is a base class which have all the functions that SVGElement needs as pure virtual functions. 9) SVGAttributeOwnerProxyImpl is a template class which implements SVGAttributeOwnerProxy and whose types are the owner and its base classes. SVGAttributeOwnerProxyImpl keeps a reference to the owner and the context SVGElement. 10) All the SVG attribute owners have to implement the virtual function attributeOwnerProxy() which returns a reference to SVGAttributeOwnerProxy. The local attributeOwnerProxy() returns a reference to a local SVGAttributeOwnerProxyImpl. Its type and base types are the class hierarchy of this element. All the attributes of the non-SVGElement-based classes are moved as members of these classes instead of adding them to all the super classes. These classes are: -- SVGExternalResourcesRequired -- SVGURIReference -- SVGFitToViewBox -- SVGZoomAndPan -- SVGLangSpace The svgAttributeChanged() of all the SVGElement-based classes are now simplified by distributing the responsibilities of changing an attribute to the base classes. One exception is the SVGURIReference since the action to be taken when changing the "href" is different for every super class. Other work will be done in separate patches. -- Shrinking the memory of the SVGElements. -- Making all the attributes RefCounted objects. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/svg/RenderSVGResourceMarker.cpp: (WebCore::RenderSVGResourceMarker::draw): * svg/SVGAElement.cpp: (WebCore::SVGAElement::SVGAElement): (WebCore::SVGAElement::registerAttributes): (WebCore::SVGAElement::parseAttribute): (WebCore::SVGAElement::svgAttributeChanged): * svg/SVGAElement.h: * svg/SVGAElement.idl: * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::SVGAltGlyphElement): * svg/SVGAltGlyphElement.h: * svg/SVGAnimatedAngle.h: * svg/SVGAnimatedBoolean.h: * svg/SVGAnimatedEnumeration.h: * svg/SVGAnimatedInteger.h: * svg/SVGAnimatedLength.h: * svg/SVGAnimatedLengthList.h: * svg/SVGAnimatedNumber.h: * svg/SVGAnimatedNumberList.h: * svg/SVGAnimatedPath.h: * svg/SVGAnimatedPointList.h: * svg/SVGAnimatedPreserveAspectRatio.h: * svg/SVGAnimatedRect.h: * svg/SVGAnimatedString.h: * svg/SVGAnimatedTransformList.h: * svg/SVGAnimatedTypeAnimator.cpp: (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::SVGAnimationElement): (WebCore::SVGAnimationElement::requiredFeatures): Deleted. (WebCore::SVGAnimationElement::requiredExtensions): Deleted. (WebCore::SVGAnimationElement::systemLanguage): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): * svg/SVGCircleElement.cpp: (WebCore::SVGCircleElement::SVGCircleElement): (WebCore::SVGCircleElement::registerAttributes): (WebCore::SVGCircleElement::parseAttribute): (WebCore::SVGCircleElement::svgAttributeChanged): * svg/SVGCircleElement.h: * svg/SVGClipPathElement.cpp: (WebCore::SVGClipPathElement::SVGClipPathElement): (WebCore::SVGClipPathElement::registerAttributes): (WebCore::SVGClipPathElement::parseAttribute): (WebCore::SVGClipPathElement::svgAttributeChanged): (WebCore::SVGClipPathElement::isSupportedAttribute): Deleted. * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.cpp: (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): (WebCore::SVGComponentTransferFunctionElement::registerAttributes): (WebCore::SVGComponentTransferFunctionElement::parseAttribute): (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): (WebCore::SVGComponentTransferFunctionElement::transferFunction const): (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Deleted. * svg/SVGComponentTransferFunctionElement.h: (WebCore::SVGComponentTransferFunctionElement::type const): (WebCore::SVGComponentTransferFunctionElement::tableValues const): (WebCore::SVGComponentTransferFunctionElement::slope const): (WebCore::SVGComponentTransferFunctionElement::intercept const): (WebCore::SVGComponentTransferFunctionElement::amplitude const): (WebCore::SVGComponentTransferFunctionElement::exponent const): (WebCore::SVGComponentTransferFunctionElement::offset const): (WebCore::SVGComponentTransferFunctionElement::typeAnimated): (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated): (WebCore::SVGComponentTransferFunctionElement::slopeAnimated): (WebCore::SVGComponentTransferFunctionElement::interceptAnimated): (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated): (WebCore::SVGComponentTransferFunctionElement::exponentAnimated): (WebCore::SVGComponentTransferFunctionElement::offsetAnimated): (WebCore::SVGComponentTransferFunctionElement::attributeRegistry): (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): * svg/SVGCursorElement.cpp: (WebCore::SVGCursorElement::SVGCursorElement): (WebCore::SVGCursorElement::registerAttributes): (WebCore::SVGCursorElement::parseAttribute): (WebCore::SVGCursorElement::svgAttributeChanged): (WebCore::SVGCursorElement::isSupportedAttribute): Deleted. (WebCore::SVGCursorElement::requiredFeatures): Deleted. (WebCore::SVGCursorElement::requiredExtensions): Deleted. (WebCore::SVGCursorElement::systemLanguage): Deleted. * svg/SVGCursorElement.h: * svg/SVGDefsElement.cpp: (WebCore::SVGDefsElement::SVGDefsElement): * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::SVGElement): (WebCore::SVGElement::registerAttributes): (WebCore::SVGElement::parseAttribute): (WebCore::SVGElement::animatedPropertyTypesForAttribute): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): (WebCore::SVGElement::svgAttributeChanged): (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted. (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted. (WebCore::SVGElement::synchronizeSystemLanguage): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeRegistry): (WebCore::SVGElement::isKnownAttribute): (WebCore::SVGElement::attributeOwnerProxy const): (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAttributes): (WebCore::SVGElement::animatedTypes const): (WebCore::SVGElement::lookupAnimatedProperty const): (WebCore::SVGElement::lookupOrCreateAnimatedProperty): (WebCore::SVGElement::lookupOrCreateAnimatedProperties): (WebCore::SVGElement::className const): (WebCore::SVGElement::classNameAnimated): (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted. (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted. (WebCore::SVGElement::synchronizeSystemLanguage): Deleted. * svg/SVGEllipseElement.cpp: (WebCore::SVGEllipseElement::SVGEllipseElement): (WebCore::SVGEllipseElement::registerAttributes): (WebCore::SVGEllipseElement::parseAttribute): (WebCore::SVGEllipseElement::svgAttributeChanged): * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.cpp: (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired): (WebCore::SVGExternalResourcesRequired::registerAttributes): (WebCore::SVGExternalResourcesRequired::parseAttribute): (WebCore::SVGExternalResourcesRequired::svgAttributeChanged): (WebCore::SVGExternalResourcesRequired::addSupportedAttributes): (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent): (WebCore::SVGExternalResourcesRequired::insertedIntoDocument): (WebCore::SVGExternalResourcesRequired::finishParsingChildren): (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const): (WebCore::SVGExternalResourcesRequired::isKnownAttribute): Deleted. (WebCore::SVGExternalResourcesRequired::handleAttributeChange): Deleted. * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated): (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const): (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): (WebCore::SVGExternalResourcesRequired::isKnownAttribute): (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::SVGFEBlendElement): (WebCore::SVGFEBlendElement::registerAttributes): (WebCore::SVGFEBlendElement::parseAttribute): * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): (WebCore::SVGFEColorMatrixElement::registerAttributes): (WebCore::SVGFEColorMatrixElement::parseAttribute): * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement): (WebCore::SVGFEComponentTransferElement::registerAttributes): (WebCore::SVGFEComponentTransferElement::parseAttribute): * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::SVGFECompositeElement): (WebCore::SVGFECompositeElement::registerAttributes): (WebCore::SVGFECompositeElement::parseAttribute): * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): (WebCore::SVGFEConvolveMatrixElement::registerAttributes): (WebCore::SVGFEConvolveMatrixElement::parseAttribute): (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute): (WebCore::SVGFEConvolveMatrixElement::setOrder): (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength): * svg/SVGFEConvolveMatrixElement.h: (WebCore::SVGPropertyTraits::initialValue): * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement): (WebCore::SVGFEDiffuseLightingElement::registerAttributes): (WebCore::SVGFEDiffuseLightingElement::parseAttribute): * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): (WebCore::SVGFEDisplacementMapElement::registerAttributes): (WebCore::SVGFEDisplacementMapElement::parseAttribute): * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement): (WebCore::SVGFEDropShadowElement::setStdDeviation): (WebCore::SVGFEDropShadowElement::registerAttributes): (WebCore::SVGFEDropShadowElement::parseAttribute): (WebCore::SVGFEDropShadowElement::svgAttributeChanged): * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement): (WebCore::SVGFEGaussianBlurElement::setStdDeviation): (WebCore::SVGFEGaussianBlurElement::registerAttributes): (WebCore::SVGFEGaussianBlurElement::parseAttribute): (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::SVGFEImageElement): (WebCore::SVGFEImageElement::registerAttributes): (WebCore::SVGFEImageElement::parseAttribute): * svg/SVGFEImageElement.h: * svg/SVGFELightElement.cpp: (WebCore::SVGFELightElement::SVGFELightElement): (WebCore::SVGFELightElement::registerAttributes): (WebCore::SVGFELightElement::parseAttribute): (WebCore::SVGFELightElement::svgAttributeChanged): * svg/SVGFELightElement.h: (WebCore::SVGFELightElement::azimuth const): (WebCore::SVGFELightElement::elevation const): (WebCore::SVGFELightElement::x const): (WebCore::SVGFELightElement::y const): (WebCore::SVGFELightElement::z const): (WebCore::SVGFELightElement::pointsAtX const): (WebCore::SVGFELightElement::pointsAtY const): (WebCore::SVGFELightElement::pointsAtZ const): (WebCore::SVGFELightElement::specularExponent const): (WebCore::SVGFELightElement::limitingConeAngle const): (WebCore::SVGFELightElement::azimuthAnimated): (WebCore::SVGFELightElement::elevationAnimated): (WebCore::SVGFELightElement::xAnimated): (WebCore::SVGFELightElement::yAnimated): (WebCore::SVGFELightElement::zAnimated): (WebCore::SVGFELightElement::pointsAtXAnimated): (WebCore::SVGFELightElement::pointsAtYAnimated): (WebCore::SVGFELightElement::pointsAtZAnimated): (WebCore::SVGFELightElement::specularExponentAnimated): (WebCore::SVGFELightElement::limitingConeAngleAnimated): (WebCore::SVGFELightElement::attributeRegistry): (WebCore::SVGFELightElement::isKnownAttribute): * svg/SVGFEMergeNodeElement.cpp: (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement): (WebCore::SVGFEMergeNodeElement::registerAttributes): (WebCore::SVGFEMergeNodeElement::parseAttribute): * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement): (WebCore::SVGFEMorphologyElement::setRadius): (WebCore::SVGFEMorphologyElement::registerAttributes): (WebCore::SVGFEMorphologyElement::parseAttribute): * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::SVGFEOffsetElement): (WebCore::SVGFEOffsetElement::registerAttributes): (WebCore::SVGFEOffsetElement::parseAttribute): (WebCore::SVGFEOffsetElement::svgAttributeChanged): * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): (WebCore::SVGFESpecularLightingElement::registerAttributes): (WebCore::SVGFESpecularLightingElement::parseAttribute): * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::SVGFETileElement): (WebCore::SVGFETileElement::registerAttributes): (WebCore::SVGFETileElement::parseAttribute): * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): (WebCore::SVGFETurbulenceElement::registerAttributes): (WebCore::SVGFETurbulenceElement::parseAttribute): (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): (WebCore::SVGFETurbulenceElement::svgAttributeChanged): * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::SVGFilterElement): (WebCore::SVGFilterElement::setFilterRes): (WebCore::SVGFilterElement::registerAttributes): (WebCore::SVGFilterElement::parseAttribute): (WebCore::SVGFilterElement::svgAttributeChanged): (WebCore::SVGFilterElement::isSupportedAttribute): Deleted. * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes): (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Deleted. * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): (WebCore::SVGFilterPrimitiveStandardAttributes::x const): (WebCore::SVGFilterPrimitiveStandardAttributes::y const): (WebCore::SVGFilterPrimitiveStandardAttributes::width const): (WebCore::SVGFilterPrimitiveStandardAttributes::height const): (WebCore::SVGFilterPrimitiveStandardAttributes::result const): (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): * svg/SVGFitToViewBox.cpp: (WebCore::SVGFitToViewBox::SVGFitToViewBox): (WebCore::SVGFitToViewBox::registerAttributes): (WebCore::SVGFitToViewBox::setViewBox): (WebCore::SVGFitToViewBox::resetViewBox): (WebCore::SVGFitToViewBox::reset): (WebCore::SVGFitToViewBox::parseAttribute): (WebCore::SVGFitToViewBox::parseViewBox): (WebCore::SVGFitToViewBox::isKnownAttribute): Deleted. (WebCore::SVGFitToViewBox::addSupportedAttributes): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): (WebCore::SVGFitToViewBox::viewBox const): (WebCore::SVGFitToViewBox::preserveAspectRatio const): (WebCore::SVGFitToViewBox::viewBoxAnimated): (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated): (WebCore::SVGFitToViewBox::setPreserveAspectRatio): (WebCore::SVGFitToViewBox::resetPreserveAspectRatio): (WebCore::SVGFitToViewBox::viewBoxString const): (WebCore::SVGFitToViewBox::preserveAspectRatioString const): (WebCore::SVGFitToViewBox::hasValidViewBox const): (WebCore::SVGFitToViewBox::hasEmptyViewBox const): (WebCore::SVGFitToViewBox::isKnownAttribute): (WebCore::SVGFitToViewBox::parseAttribute): Deleted. * svg/SVGFontElement.cpp: (WebCore::SVGFontElement::SVGFontElement): * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::SVGForeignObjectElement): (WebCore::SVGForeignObjectElement::registerAttributes): (WebCore::SVGForeignObjectElement::parseAttribute): (WebCore::SVGForeignObjectElement::svgAttributeChanged): (WebCore::SVGForeignObjectElement::isSupportedAttribute): Deleted. * svg/SVGForeignObjectElement.h: * svg/SVGGElement.cpp: (WebCore::SVGGElement::SVGGElement): (WebCore::SVGGElement::svgAttributeChanged): (WebCore::SVGGElement::isSupportedAttribute): Deleted. * svg/SVGGElement.h: * svg/SVGGeometryElement.cpp: (WebCore::SVGGeometryElement::SVGGeometryElement): (WebCore::SVGGeometryElement::registerAttributes): (WebCore::SVGGeometryElement::parseAttribute): (WebCore::SVGGeometryElement::svgAttributeChanged): (WebCore::SVGGeometryElement::isSupportedAttribute): Deleted. * svg/SVGGeometryElement.h: (WebCore::SVGGeometryElement::attributeRegistry): (WebCore::SVGGeometryElement::pathLengthAnimated): (WebCore::SVGGeometryElement::isKnownAttribute): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::SVGGradientElement): (WebCore::SVGGradientElement::registerAttributes): (WebCore::SVGGradientElement::parseAttribute): (WebCore::SVGGradientElement::svgAttributeChanged): (WebCore::SVGGradientElement::isSupportedAttribute): Deleted. * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): (WebCore::SVGGradientElement::spreadMethod const): (WebCore::SVGGradientElement::gradientUnits const): (WebCore::SVGGradientElement::gradientTransform const): (WebCore::SVGGradientElement::spreadMethodAnimated): (WebCore::SVGGradientElement::gradientUnitsAnimated): (WebCore::SVGGradientElement::gradientTransformAnimated): (WebCore::SVGGradientElement::isKnownAttribute): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::SVGGraphicsElement): (WebCore::SVGGraphicsElement::registerAttributes): (WebCore::SVGGraphicsElement::parseAttribute): (WebCore::SVGGraphicsElement::svgAttributeChanged): (WebCore::SVGGraphicsElement::isSupportedAttribute): Deleted. (WebCore::SVGGraphicsElement::requiredFeatures): Deleted. (WebCore::SVGGraphicsElement::requiredExtensions): Deleted. (WebCore::SVGGraphicsElement::systemLanguage): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): (WebCore::SVGGraphicsElement::transform const): (WebCore::SVGGraphicsElement::transformAnimated): (WebCore::SVGGraphicsElement::isKnownAttribute): * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::SVGImageElement): (WebCore::SVGImageElement::registerAttributes): (WebCore::SVGImageElement::parseAttribute): (WebCore::SVGImageElement::svgAttributeChanged): (WebCore::SVGImageElement::haveLoadedRequiredResources): (WebCore::SVGImageElement::isSupportedAttribute): Deleted. * svg/SVGImageElement.h: * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::dispatchLoadEvent): * svg/SVGLangSpace.cpp: (WebCore::SVGLangSpace::SVGLangSpace): (WebCore::SVGLangSpace::registerAttributes): (WebCore::SVGLangSpace::xmlspace const): (WebCore::SVGLangSpace::svgAttributeChanged): (WebCore::SVGLangSpace::setXmllang): Deleted. (WebCore::SVGLangSpace::setXmlspace): Deleted. (WebCore::SVGLangSpace::isKnownAttribute): Deleted. (WebCore::addWithAndWithoutXMLPrefix): Deleted. (WebCore::SVGLangSpace::addSupportedAttributes): Deleted. * svg/SVGLangSpace.h: (WebCore::SVGLangSpace::xmllang const): (WebCore::SVGLangSpace::setXmllang): (WebCore::SVGLangSpace::setXmlspace): (WebCore::SVGLangSpace::attributeRegistry): (WebCore::SVGLangSpace::isKnownAttribute): * svg/SVGLineElement.cpp: (WebCore::SVGLineElement::SVGLineElement): (WebCore::SVGLineElement::registerAttributes): (WebCore::SVGLineElement::parseAttribute): (WebCore::SVGLineElement::svgAttributeChanged): (WebCore::SVGLineElement::isSupportedAttribute): Deleted. * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::SVGLinearGradientElement): (WebCore::SVGLinearGradientElement::registerAttributes): (WebCore::SVGLinearGradientElement::parseAttribute): (WebCore::SVGLinearGradientElement::svgAttributeChanged): (WebCore::SVGLinearGradientElement::isSupportedAttribute): Deleted. * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::SVGMPathElement): (WebCore::SVGMPathElement::svgAttributeChanged): * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::SVGMarkerElement): (WebCore::SVGMarkerElement::registerAttributes): (WebCore::SVGMarkerElement::parseAttribute): (WebCore::SVGMarkerElement::svgAttributeChanged): (WebCore::SVGMarkerElement::setOrient): (WebCore::SVGMarkerElement::orientTypePropertyInfo): Deleted. (WebCore::SVGMarkerElement::isSupportedAttribute): Deleted. (WebCore::SVGMarkerElement::synchronizeOrientType): Deleted. (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): Deleted. (WebCore::SVGMarkerElement::orientType const): Deleted. (WebCore::SVGMarkerElement::orientTypeAnimated): Deleted. * svg/SVGMarkerElement.h: * svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::SVGMaskElement): (WebCore::SVGMaskElement::registerAttributes): (WebCore::SVGMaskElement::parseAttribute): (WebCore::SVGMaskElement::svgAttributeChanged): (WebCore::SVGMaskElement::isSupportedAttribute): Deleted. (WebCore::SVGMaskElement::requiredFeatures): Deleted. (WebCore::SVGMaskElement::requiredExtensions): Deleted. (WebCore::SVGMaskElement::systemLanguage): Deleted. * svg/SVGMaskElement.h: * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::registerAttributes): (WebCore::SVGPathElement::parseAttribute): (WebCore::SVGPathElement::svgAttributeChanged): (WebCore::SVGPathElement::pathByteStream const): (WebCore::SVGPathElement::lookupOrCreateDWrapper): (WebCore::SVGPathElement::animatedPropertyWillBeDeleted): (WebCore::SVGPathElement::pathSegList): (WebCore::SVGPathElement::animatedPathSegList): (WebCore::SVGPathElement::pathSegListChanged): (WebCore::SVGPathElement::dPropertyInfo): Deleted. (WebCore::SVGPathElement::isSupportedAttribute): Deleted. (WebCore::SVGPathElement::synchronizeD): Deleted. * svg/SVGPathElement.h: * svg/SVGPathSegListValues.h: (WebCore::SVGPropertyTraits::toString): * svg/SVGPathSegWithContext.h: (WebCore::SVGPathSegWithContext::animatedProperty const): * svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::SVGPatternElement): (WebCore::SVGPatternElement::registerAttributes): (WebCore::SVGPatternElement::parseAttribute): (WebCore::SVGPatternElement::svgAttributeChanged): (WebCore::SVGPatternElement::collectPatternAttributes const): (WebCore::SVGPatternElement::isSupportedAttribute): Deleted. (WebCore::SVGPatternElement::requiredFeatures): Deleted. (WebCore::SVGPatternElement::requiredExtensions): Deleted. (WebCore::SVGPatternElement::systemLanguage): Deleted. * svg/SVGPatternElement.h: * svg/SVGPointListValues.h: (WebCore::SVGPropertyTraits::toString): * svg/SVGPolyElement.cpp: (WebCore::SVGPolyElement::SVGPolyElement): (WebCore::SVGPolyElement::registerAttributes): (WebCore::SVGPolyElement::parseAttribute): (WebCore::SVGPolyElement::svgAttributeChanged): (WebCore::SVGPolyElement::points): (WebCore::SVGPolyElement::animatedPoints): (WebCore::SVGPolyElement::pointsPropertyInfo): Deleted. (WebCore::SVGPolyElement::synchronizePoints): Deleted. (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): Deleted. * svg/SVGPolyElement.h: (WebCore::SVGPolyElement::pointList const): (WebCore::SVGPolyElement::attributeRegistry): (WebCore::SVGPolyElement::isKnownAttribute): * svg/SVGPreserveAspectRatioValue.cpp: (WebCore::SVGPreserveAspectRatioValue::transformRect const): (WebCore::SVGPreserveAspectRatioValue::transformRect): Deleted. * svg/SVGPreserveAspectRatioValue.h: * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::SVGRadialGradientElement): (WebCore::SVGRadialGradientElement::registerAttributes): (WebCore::SVGRadialGradientElement::parseAttribute): (WebCore::SVGRadialGradientElement::svgAttributeChanged): (WebCore::SVGRadialGradientElement::isSupportedAttribute): Deleted. * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.cpp: (WebCore::SVGRectElement::SVGRectElement): (WebCore::SVGRectElement::registerAttributes): (WebCore::SVGRectElement::parseAttribute): (WebCore::SVGRectElement::svgAttributeChanged): * svg/SVGRectElement.h: * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::SVGSVGElement): (WebCore::SVGSVGElement::registerAttributes): (WebCore::SVGSVGElement::parseAttribute): (WebCore::SVGSVGElement::svgAttributeChanged): (WebCore::SVGSVGElement::viewBoxToViewTransform const): (WebCore::SVGSVGElement::resetScrollAnchor): (WebCore::SVGSVGElement::inheritViewAttributes): * svg/SVGSVGElement.h: (WebCore::SVGSVGElement::useCurrentView const): Deleted. (WebCore::SVGSVGElement::currentTranslateValue): Deleted. (WebCore::SVGSVGElement::zoomAndPan const): Deleted. (WebCore::SVGSVGElement::setZoomAndPan): Deleted. (WebCore::SVGSVGElement::timeContainer): Deleted. (WebCore::SVGSVGElement::hasEmptyViewBox const): Deleted. * svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::SVGScriptElement): (WebCore::SVGScriptElement::svgAttributeChanged): (WebCore::SVGScriptElement::insertedIntoAncestor): (WebCore::SVGScriptElement::addSubresourceAttributeURLs const): (WebCore::SVGScriptElement::isURLAttribute const): Deleted. (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted. (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted. (WebCore::SVGScriptElement::typeAttributeValue const): Deleted. (WebCore::SVGScriptElement::languageAttributeValue const): Deleted. (WebCore::SVGScriptElement::forAttributeValue const): Deleted. (WebCore::SVGScriptElement::eventAttributeValue const): Deleted. (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted. (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted. (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted. (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted. (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted. * svg/SVGScriptElement.h: * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::SVGStopElement): (WebCore::SVGStopElement::registerAttributes): (WebCore::SVGStopElement::parseAttribute): * svg/SVGStopElement.h: * svg/SVGStringListValues.h: (WebCore::SVGPropertyTraits::toString): * svg/SVGSwitchElement.cpp: (WebCore::SVGSwitchElement::SVGSwitchElement): * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.cpp: (WebCore::SVGSymbolElement::SVGSymbolElement): (WebCore::SVGSymbolElement::parseAttribute): (WebCore::SVGSymbolElement::svgAttributeChanged): * svg/SVGSymbolElement.h: * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::SVGTRefElement): * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::SVGTests): (WebCore::SVGTests::registerAttributes): (WebCore::SVGTests::attributeRegistry): (WebCore::SVGTests::isKnownAttribute): (WebCore::SVGTests::isValid const): (WebCore::SVGTests::parseAttribute): (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::requiredFeatures): (WebCore::SVGTests::requiredExtensions): (WebCore::SVGTests::systemLanguage): (WebCore::createSVGTestPropertyInfo): Deleted. (WebCore::createSVGTextAttributeToPropertyMap): Deleted. (WebCore::SVGTests::attributeToPropertyMap): Deleted. (WebCore::SVGTests::handleAttributeChange): Deleted. (WebCore::SVGTests::synchronizeAttribute): Deleted. (WebCore::SVGTests::synchronizeRequiredFeatures): Deleted. (WebCore::SVGTests::synchronizeRequiredExtensions): Deleted. (WebCore::SVGTests::synchronizeSystemLanguage): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: (WebCore::SVGTextContentElement::SVGTextContentElement): (WebCore::SVGTextContentElement::registerAttributes): (WebCore::SVGTextContentElement::parseAttribute): (WebCore::SVGTextContentElement::svgAttributeChanged): (WebCore::SVGTextContentElement::textLengthPropertyInfo): Deleted. (WebCore::SVGTextContentElement::synchronizeTextLength): Deleted. (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): Deleted. (WebCore::SVGTextContentElement::textLengthAnimated): Deleted. (WebCore::SVGTextContentElement::isSupportedAttribute): Deleted. * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::specifiedTextLength): (WebCore::SVGTextContentElement::attributeRegistry): (WebCore::SVGTextContentElement::textLength const): (WebCore::SVGTextContentElement::lengthAdjust const): (WebCore::SVGTextContentElement::textLengthAnimated): (WebCore::SVGTextContentElement::lengthAdjustAnimated): (WebCore::SVGTextContentElement::isKnownAttribute): (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute): (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize): (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::SVGTextPathElement): (WebCore::SVGTextPathElement::registerAttributes): (WebCore::SVGTextPathElement::parseAttribute): (WebCore::SVGTextPathElement::svgAttributeChanged): (WebCore::SVGTextPathElement::isSupportedAttribute): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.cpp: (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): (WebCore::SVGTextPositioningElement::registerAttributes): (WebCore::SVGTextPositioningElement::parseAttribute): (WebCore::SVGTextPositioningElement::svgAttributeChanged): * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): (WebCore::SVGTextPositioningElement::x const): (WebCore::SVGTextPositioningElement::y const): (WebCore::SVGTextPositioningElement::dx const): (WebCore::SVGTextPositioningElement::dy const): (WebCore::SVGTextPositioningElement::rotate const): (WebCore::SVGTextPositioningElement::xAnimated): (WebCore::SVGTextPositioningElement::yAnimated): (WebCore::SVGTextPositioningElement::dxAnimated): (WebCore::SVGTextPositioningElement::dyAnimated): (WebCore::SVGTextPositioningElement::rotateAnimated): (WebCore::SVGTextPositioningElement::isKnownAttribute): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::registerAttributes): (WebCore::SVGURIReference::attributeRegistry): (WebCore::SVGURIReference::isKnownAttribute): (WebCore::SVGURIReference::parseAttribute): (WebCore::SVGURIReference::href const): (WebCore::SVGURIReference::hrefAnimated): (WebCore::SVGURIReference::addSupportedAttributes): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::SVGUseElement): (WebCore::SVGUseElement::registerAttributes): (WebCore::SVGUseElement::parseAttribute): (WebCore::SVGUseElement::insertedIntoAncestor): (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const): (WebCore::SVGUseElement::svgAttributeChanged): (WebCore::SVGUseElement::notifyFinished): * svg/SVGUseElement.h: * svg/SVGValue.h: * svg/SVGViewElement.cpp: (WebCore::SVGViewElement::SVGViewElement): (WebCore::SVGViewElement::parseAttribute): * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): (WebCore::SVGViewSpec::registerAttributes): (WebCore::SVGViewSpec::transform): (WebCore::SVGViewSpec::reset): (WebCore::SVGViewSpec::parseViewSpec): (WebCore::SVGViewSpec::viewBoxPropertyInfo): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): Deleted. (WebCore::SVGViewSpec::transformPropertyInfo): Deleted. (WebCore::SVGViewSpec::viewBoxIdentifier): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): Deleted. (WebCore::SVGViewSpec::transformIdentifier): Deleted. (WebCore::SVGViewSpec::setZoomAndPan): Deleted. (WebCore::SVGViewSpec::transformString const): Deleted. (WebCore::SVGViewSpec::viewBoxString const): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioString const): Deleted. (WebCore::SVGViewSpec::viewBoxAnimated): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioAnimated): Deleted. (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Deleted. (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): Deleted. (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Deleted. * svg/SVGViewSpec.h: * svg/SVGViewSpec.idl: * svg/SVGZoomAndPan.cpp: (WebCore::SVGZoomAndPan::SVGZoomAndPan): (WebCore::SVGZoomAndPan::registerAttributes): (WebCore::SVGZoomAndPan::parseZoomAndPan): (WebCore::SVGZoomAndPan::parseAttribute): (WebCore::SVGZoomAndPan::parse): Deleted. (WebCore::SVGZoomAndPan::parseAttributeValue): Deleted. * svg/SVGZoomAndPan.h: (WebCore::SVGZoomAndPan::zoomAndPan const): (WebCore::SVGZoomAndPan::setZoomAndPan): (WebCore::SVGZoomAndPan::reset): (WebCore::SVGZoomAndPan::attributeRegistry): (WebCore::SVGZoomAndPan::isKnownAttribute): (WebCore::SVGZoomAndPan::parseFromNumber): Deleted. (WebCore::SVGZoomAndPan::parseAttribute): Deleted. * svg/SVGZoomAndPanType.h: Copied from Source/WebCore/svg/SVGValue.h. (WebCore::SVGPropertyTraits::initialValue): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::fromString): * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Copied from Source/WebCore/svg/SVGValue.h. (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: * svg/properties/SVGAnimatedProperty.cpp: (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted. * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::isAnimating const): (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): (WebCore::SVGAnimatedProperty::animatedPropertyCache): (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): Deleted. (WebCore::SVGAnimatedProperty::lookupWrapper): Deleted. * svg/properties/SVGAnimatedPropertyMacros.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Copied from Source/WebCore/svg/SVGAElement.idl. * svg/properties/SVGAttribute.h: Added. (WebCore::SVGPropertyAttribute::SVGPropertyAttribute): (WebCore::SVGPropertyAttribute::value): (WebCore::SVGPropertyAttribute::value const): (WebCore::SVGPropertyAttribute::setValue): (WebCore::SVGPropertyAttribute::resetValue): (WebCore::SVGPropertyAttribute::toString const): (WebCore::SVGPropertyAttribute::setShouldSynchronize): (WebCore::SVGPropertyAttribute::shouldSynchronize const): (WebCore::SVGPropertyAttribute::synchronize): (WebCore::SVGAnimatedAttribute::SVGAnimatedAttribute): (WebCore::SVGAnimatedAttribute::currentValue const): (WebCore::SVGAnimatedAttribute::animatedProperty): (WebCore::SVGAnimatedAttributeList::SVGAnimatedAttributeList): (WebCore::SVGAnimatedAttributeList::detachAnimatedListWrappers): * svg/properties/SVGAttributeAccessor.h: Added. (WebCore::SVGAttributeAccessor::SVGAttributeAccessor): (WebCore::SVGAttributeAccessor::attributeName const): (WebCore::SVGAttributeAccessor::isAnimatedLengthAttribute const): (WebCore::SVGAttributeAccessor::animatedType const): (WebCore::SVGAttributeAccessor::animatedTypes const): (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const): (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const): (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const): (WebCore::SVGPropertyAttributeAccessor::singleton): (WebCore::SVGPropertyAttributeAccessor::SVGPropertyAttributeAccessor): (WebCore::SVGPropertyAttributeAccessor::attribute const): (WebCore::SVGAnimatedAttributeAccessor::singleton): (WebCore::SVGAnimatedAttributeAccessor::SVGAnimatedAttributeAccessor): (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty): (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty): (WebCore::SVGAnimatedPairAttributeAccessor::SVGAnimatedPairAttributeAccessor): (WebCore::SVGAnimatedPairAttributeAccessor::secondAttribute const): * svg/properties/SVGAttributeOwnerProxy.h: Copied from Source/WebCore/svg/SVGValue.h. (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): (WebCore::SVGAttributeOwnerProxy::element const): * svg/properties/SVGAttributeOwnerProxyImpl.h: Added. (WebCore::SVGAttributeOwnerProxyImpl::SVGAttributeOwnerProxyImpl): (WebCore::SVGAttributeOwnerProxyImpl::attributeRegistry): (WebCore::SVGAttributeOwnerProxyImpl::isKnownAttribute): (WebCore::SVGAttributeOwnerProxyImpl::isAnimatedLengthAttribute): * svg/properties/SVGAttributeRegistry.h: Added. (WebCore::SVGAttributeRegistry::registerAttribute): (WebCore::SVGAttributeRegistry::isEmpty const): (WebCore::SVGAttributeRegistry::isKnownAttribute const): (WebCore::SVGAttributeRegistry::isAnimatedLengthAttribute const): (WebCore::SVGAttributeRegistry::animatedTypes const): (WebCore::SVGAttributeRegistry::synchronizeAttributes const): (WebCore::SVGAttributeRegistry::synchronizeAttribute const): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const): (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const): (WebCore::SVGAttributeRegistry::animatedTypesBaseTypes): (WebCore::SVGAttributeRegistry::synchronizeAttributesBaseTypes): (WebCore::SVGAttributeRegistry::synchronizeAttributeBaseTypes): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes): (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes): (WebCore::SVGAttributeRegistry::findAttributeAccessor const): * svg/properties/SVGAttributeToPropertyMap.cpp: Removed. * svg/properties/SVGAttributeToPropertyMap.h: Removed. * svg/properties/SVGPropertyInfo.cpp: Removed. * svg/properties/SVGPropertyInfo.h: Removed. 2018-08-06 Alex Christensen Use enum classes and OptionSets for PaintPhase and PaintBehavior https://bugs.webkit.org/show_bug.cgi?id=188323 Reviewed by Simon Fraser. No change in behaviour. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::FrameView::reset): (WebCore::FrameView::willPaintContents): (WebCore::FrameView::paintContents): (WebCore::FrameView::setPaintBehavior): (WebCore::FrameView::paintBehavior const): (WebCore::FrameView::paintContentsForSnapshot): * page/FrameView.h: * rendering/InlineElementBox.cpp: (WebCore::InlineElementBox::paint): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paint): (WebCore::InlineFlowBox::paintBoxDecorations): (WebCore::InlineFlowBox::paintMask): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): * rendering/PaintInfo.h: (WebCore::PaintInfo::PaintInfo): (WebCore::PaintInfo::forceBlackText const): (WebCore::PaintInfo::forceWhiteText const): (WebCore::PaintInfo::skipRootBackground const): (WebCore::PaintInfo::paintRootBackgroundOnly const): * rendering/PaintPhase.h: (): Deleted. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paint): (WebCore::RenderBlock::paintContents): (WebCore::RenderBlock::paintObject): (WebCore::RenderBlock::paintSelection): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::paintFloats): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintMask): (WebCore::RenderBox::paintClippingMask): (WebCore::RenderBox::paintMaskImages): (WebCore::RenderBox::pushContentsClip): (WebCore::RenderBox::popContentsClip): * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): (WebCore::RenderBoxModelObject::paintMaskForTextFillBox): (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const): * rendering/RenderDetailsMarker.cpp: (WebCore::RenderDetailsMarker::paint): * rendering/RenderElement.cpp: (WebCore::RenderElement::paintAsInlineBlock): (WebCore::RenderElement::selectionColor const): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paint): (WebCore::RenderEmbeddedObject::paintReplaced): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::paint): * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paintReplaced): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintReplaced): (WebCore::RenderImage::paint): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::renderableTransform const): (WebCore::transparencyClipBox): (WebCore::expandClipRectForDescendantsAndReflection): (WebCore::paintingExtent): (WebCore::RenderLayer::paint): (WebCore::RenderLayer::paintOverlayScrollbars): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintBackgroundForFragments): (WebCore::RenderLayer::paintForegroundForFragments): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): (WebCore::RenderLayer::paintOutlineForFragments): (WebCore::RenderLayer::paintMaskForFragments): (WebCore::RenderLayer::paintChildClippingMaskForFragments): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::paint const): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintObject): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::paint): (WebCore::RenderReplaced::shouldPaint): * rendering/RenderReplica.cpp: (WebCore::RenderReplica::paint): * rendering/RenderScrollbarPart.cpp: (WebCore::RenderScrollbarPart::paintIntoRect): * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::paint): * rendering/RenderTable.cpp: (WebCore::RenderTable::paintObject): (WebCore::RenderTable::paintMask): (WebCore::RenderTable::overflowClipRect): * rendering/RenderTable.h: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paint): (WebCore::RenderTableCell::paintCollapsedBorders): (WebCore::RenderTableCell::paintMask): * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::paintOutlineForRowIfNeeded): (WebCore::RenderTableRow::paint): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::paint): (WebCore::RenderTableSection::paintCell): (WebCore::RenderTableSection::paintObject): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay): (WebCore::RenderThemeMac::paintImageControlsButton): * rendering/RenderVideo.cpp: (WebCore::RenderVideo::paintReplaced): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): (WebCore::RenderWidget::paint): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::paintEllipsisBox const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/MathOperator.cpp: (WebCore::MathOperator::paint): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::paint): * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::paint): * rendering/mathml/RenderMathMLToken.cpp: (WebCore::RenderMathMLToken::paint): * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::paint): * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::paint): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint): * rendering/svg/RenderSVGResource.cpp: (WebCore::requestPaintingResource): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): * rendering/svg/RenderSVGResourceSolidColor.cpp: (WebCore::RenderSVGResourceSolidColor::applyResource): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::paintReplaced): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::paint): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::paint): * rendering/svg/SVGInlineFlowBox.cpp: (WebCore::SVGInlineFlowBox::paintSelectionBackground): (WebCore::SVGInlineFlowBox::paint): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paintSelectionBackground): (WebCore::SVGInlineTextBox::paint): * rendering/svg/SVGRenderingContext.cpp: (WebCore::isRenderingMaskImage): (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::SVGRootInlineBox::paint): 2018-08-06 Ryan Haddad Unreviewed, rolling out r234569. Breaks internal builds. Reverted changeset: "We should cache the compiled sandbox profile in a data vault" https://bugs.webkit.org/show_bug.cgi?id=184991 https://trac.webkit.org/changeset/234569 2018-08-06 Alex Christensen Make BlendMode an enum class https://bugs.webkit.org/show_bug.cgi?id=188325 Reviewed by Darin Adler. No change in behavior. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator BlendMode const): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::State::State): (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation): (WebCore::CanvasRenderingContext2DBase::drawImageFromRect): * platform/graphics/BitmapImage.h: * platform/graphics/GraphicsContext.h: (WebCore::ImagePaintingOptions::ImagePaintingOptions): * platform/graphics/GraphicsContextImpl.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsTypes.cpp: (WebCore::parseBlendMode): (WebCore::parseCompositeAndBlendOperator): (WebCore::compositeOperatorName): (WebCore::blendModeName): (WebCore::operator<<): * platform/graphics/GraphicsTypes.h: * platform/graphics/Image.cpp: (WebCore::Image::drawTiled): * platform/graphics/Image.h: * platform/graphics/ImageBuffer.h: * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (PlatformCAFilters::setBlendingFiltersOnLayer): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::selectCGBlendMode): * platform/graphics/cpu/arm/filters/FEBlendNEON.h: (WebCore::FEBlend::platformApplyNEON): * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::externalRepresentation const): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintFillLayers): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::updateBlendMode): (WebCore::RenderLayer::beginTransparencyLayers): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateBlendMode): * rendering/style/FillLayer.cpp: (WebCore::FillLayer::FillLayer): (WebCore::FillLayer::hasOpaqueImage const): * rendering/style/FillLayer.h: (WebCore::FillLayer::initialFillBlendMode): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setBlendMode): (WebCore::RenderStyle::hasBlendMode const): (WebCore::RenderStyle::blendMode const): (WebCore::RenderStyle::initialBlendMode): * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): * svg/SVGAnimatedEnumeration.cpp: (WebCore::enumerationValueForTargetAttribute): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::SVGFEBlendElement): (WebCore::SVGFEBlendElement::parseAttribute): * svg/SVGFEBlendElement.h: (WebCore::SVGPropertyTraits::highestEnumValue): (WebCore::SVGPropertyTraits::toString): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImageForCurrentFrame): (WebCore::SVGImage::nativeImage): (WebCore::SVGImage::drawPatternForContainer): (WebCore::SVGImage::draw): 2018-08-06 Aditya Keerthi [iOS] Indeterminate checkboxes appear unchecked https://bugs.webkit.org/show_bug.cgi?id=160484 Reviewed by Wenson Hsieh. Add support for rendering indeterminate checkboxes on iOS. We now paint the unchecked appearance only if the checkbox is not checked and is not indeterminate. Otherwise, we draw a checkmark if the checkbox is in the checked state and a dash if the checkbox is in the indeterminate state. Both of these states share the same dark background. Test: fast/forms/ios/render-indeterminate-checkbox.html * css/html.css: (input[type="checkbox"]:indeterminate): (input[type="checkbox"]:indeterminate:disabled): * rendering/RenderThemeIOS.mm: (WebCore::drawJoinedLines): (WebCore::RenderThemeIOS::paintCheckboxDecorations): 2018-08-06 Ryosuke Niwa HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element https://bugs.webkit.org/show_bug.cgi?id=188336 Reviewed by Frédéric Wang. Push and pop an element queue from the custom element reactions stack when constructing a custom element: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder where we synchronously construct a custom element. We don't have to worry about whether *will execute script* is set or not since the presence of an element queue should not be observable in the case where we're constructing a fallback element (since it would not enqueue any new custom element reaction). Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we don't insert the custom element into the parser until we finish processing the custom element reactions. 2018-08-06 Charlie Turner Return extracted key ids as an optional https://bugs.webkit.org/show_bug.cgi?id=188303 Reviewed by Darin Adler. An empty list of extracted key ids was being considered a failure case before this patch. In the PSSH boxes from the CENC standard, it's not uncommon for the box to be version 0, meaning it has no embedded key ids, so the case when there's an empty list should not be treated as an error. Given this, the interface should be more general and allow for a sentinel value indicating a parsing error rather than an absence of key ids. Covered by existing tests. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): Change return type to be wrapped in an optional, and make parsing errors return a nullopt rather than an empty vector. (WebCore::sanitizeKeyids): Use the new optional interface, return a null RefPtr in the case of a parsing error, this method may now return an empty vector. (WebCore::extractKeyIDsCenc): Not implemented, so return an error value rather than an empty vector. (WebCore::extractKeyIDsWebM): Ditto. (WebCore::InitDataRegistry::extractKeyIDs): Ditto. * Modules/encryptedmedia/InitDataRegistry.h: Update the interface to use an optional return type. * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf): Update to use the new interface. (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd): Ditto. * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Ditto. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Convert the optional value into a vector, since it is assumed you can not have an empty vector of key ids in the init datas FPS supports. * testing/MockCDMFactory.cpp: (WebCore::MockCDMInstance::requestLicense): Only return an error if there really was a parsing error, rather than the case of there being zero key ids in the init data payload. 2018-08-06 Frederic Wang Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions https://bugs.webkit.org/show_bug.cgi?id=188300 Reviewed by Darin Adler. This patch refactors a bit the scrollBy/scrollTo code, so that the two-arguments versions share the same code path as the more generic one-argument versions. In particular, this helps to implement the ScrollBehavior option (bug 188043) since the one-argument versions will require to distinguish between smooth and instant scrolling. The logic to normalize non finite left/right values or to use a fallback when they are absent is also factored out into ScrollToOptions. References: https://drafts.csswg.org/cssom-view/#dom-element-scroll https://drafts.csswg.org/cssom-view/#dom-element-scrollby https://drafts.csswg.org/cssom-view/#dom-window-scroll https://drafts.csswg.org/cssom-view/#dom-window-scrollby No new tests, behavior is unchanged. * dom/Element.cpp: (WebCore::Element::scrollBy): Make two-parameter version depends on one-parameter version and rewrite the normalize / fallback logic. (WebCore::Element::scrollTo): Rewrite the normalize / fallback logic. (WebCore::normalizeNonFiniteValue): Deleted. The logic is moved to ScrollToOptions. * page/DOMWindow.cpp: (WebCore::DOMWindow::scrollBy const): Make two-parameter version depends on one-parameter version and rewrite the normalize / fallback logic. (WebCore::DOMWindow::scrollTo const): Make two-parameter version depends on one-parameter version and rewrite the normalize / fallback logic. * page/ScrollToOptions.h: Add to use std::isfinite (WebCore::ScrollToOptions::normalizeNonFiniteCoordinatesOrFallBackTo): New function to normalize left/right values or fallback to the specified value if it is missing. 2018-08-06 Zan Dobersek Unreviewed follow-up to r234594. Add missing constructor and destructor definitions for the bunch of new classes that were added in that revision. * platform/graphics/nicosia/NicosiaPlatformLayer.cpp: (Nicosia::ContentLayer::ContentLayer): (Nicosia::BackingStore::BackingStore): (Nicosia::ImageBacking::ImageBacking): 2018-08-06 Zan Dobersek [Nicosia] Add additional layer state classes, use impl-based approach to make them extendable https://bugs.webkit.org/show_bug.cgi?id=188341 Reviewed by Carlos Garcia Campos. Add the ContentLayer, BackingStore and ImageBacking classes in the Nicosia namespace. State objects of CompositionLayer instances keep references to objects of these classes depending on the content that's presented in the associated GraphicsLayer. ContentLayer derives from the PlatformLayer class. It's used for layers that display things like WebGL and HTML5 canvas and media content in a platform-specific way. In case of TextureMapper the hardware-accelerated content is piped into that rendering pipeline. BackingStore is meant to represent the painted contents of a layer. The equivalent current functionality is using a tiled backing store that has its contents copied into the CoordinatedBackingStore instance. ImageBacking is used for a layer whose content is a simple Image object. Image's pixel data is rasterized and again managed through CoordinatedBackingStore for rendering. All these classes, along with the CompositionLayer class, should now be constructed with a factory function that returns an object that derives the class-specific Impl interface. This will allow for simpler implementation of different approaches in parallel. The TextureMapper variants will be the first ones, replicating the current behavior as it is implemented across classes in the CoordinatedGraphics and TextureMapper layers. * platform/graphics/nicosia/NicosiaPlatformLayer.cpp: (Nicosia::CompositionLayer::CompositionLayer): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::isContentLayer const): (Nicosia::CompositionLayer::Impl::isTextureMapperImpl const): (Nicosia::CompositionLayer::create): (Nicosia::CompositionLayer::impl const): (Nicosia::ContentLayer::Impl::isTextureMapperImpl const): (Nicosia::ContentLayer::create): (Nicosia::ContentLayer::impl const): (Nicosia::BackingStore::Impl::isTextureMapperImpl const): (Nicosia::BackingStore::create): (Nicosia::BackingStore::impl const): (Nicosia::ImageBacking::Impl::isTextureMapperImpl const): (Nicosia::ImageBacking::create): (Nicosia::ImageBacking::impl const): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): 2018-08-06 Zan Dobersek [Nicosia] Add Nicosia::Scene https://bugs.webkit.org/show_bug.cgi?id=188340 Reviewed by Carlos Garcia Campos. Add the Nicosia::Scene class that controls the scene's state and enables thread-safe updates to that state. The State struct itself holds a set of all the layers in the scene, and separates out the root layer specifically. An ID counter is also present there, allowing consumers of this state to easily check for any updates. A reference to the Nicosia::Scene object now replaces the HashSet-and-root-layer pair in the CoordinatedGraphicsState struct. * platform/TextureMapper.cmake: * platform/graphics/nicosia/NicosiaScene.cpp: Added. * platform/graphics/nicosia/NicosiaScene.h: Added. (Nicosia::Scene::create): (Nicosia::Scene::accessState): * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: 2018-08-06 Carlos Eduardo Ramalho [GTK] Buttons are drawn too large, text not centered https://bugs.webkit.org/show_bug.cgi?id=185854 Reviewed by Carlos Garcia Campos. Some pages require small buttons and the GTK theme was drawing only down to a minimum size. No new tests required. Current layout tests and ManualTests/gtk/theme.html already cover it. * platform/gtk/RenderThemeGadget.cpp: (WebCore::RenderThemeGadget::create): (WebCore::RenderThemeButtonGadget::RenderThemeButtonGadget): Added (WebCore::RenderThemeButtonGadget::minimumSize const): Allow sizes smaller than the minimum size. * platform/gtk/RenderThemeGadget.h: * platform/gtk/RenderThemeWidget.cpp: (WebCore::RenderThemeButton::RenderThemeButton): 2018-08-05 Yusuke Suzuki Implement self.queueMicrotask in Workers https://bugs.webkit.org/show_bug.cgi?id=188247 Reviewed by Ryosuke Niwa. This patch adds support for self.queueMicrotask to workers. Tests: http/wpt/workers/queue-microtask.any.html http/wpt/workers/queue-microtask.any.worker.html * bindings/js/JSWorkerGlobalScopeCustom.cpp: (WebCore::JSWorkerGlobalScope::queueMicrotask): * page/DOMWindow.idl: Move queueMicrotask declaration to WindowOrWorkerGlobalScope.idl. * page/WindowOrWorkerGlobalScope.idl: 2018-08-05 Rob Buis [GTK][WPE] Fetch tests assert in SubresourceLoader::didReceiveResponse() https://bugs.webkit.org/show_bug.cgi?id=188163 Reviewed by Frédéric Wang. Fetch in manual redirect mode uses didReceiveResponse instead of willSendRequestInternal, so update the ASSERT. * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): 2018-08-05 Yusuke Suzuki Add support for microtasks in workers https://bugs.webkit.org/show_bug.cgi?id=188246 Reviewed by Darin Adler. This patch adds the microtask mechanism to workers. To adopt the existing microtask mechanism from the main thread, we extend JSMainThreadExecState for non-main-threads. We rename it to JSExecState, and store stacked ExecState* data in thread local storage in ThreadGlobalData instead of a static variable s_mainThreadState. We add MicrotaskQueue to WorkerGlobalScope since each worker has its own thread and it should have its own microtask queue. * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): * bindings/js/JSCustomElementInterface.cpp: (WebCore::constructCustomElementSynchronously): (WebCore::JSCustomElementInterface::upgradeElement): (WebCore::JSCustomElementInterface::invokeCallback): * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): * bindings/js/JSDOMGlobalObjectTask.cpp: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueTaskToEventLoop): Queue a microtask to MicrotaskQueue instead of posting a macrotask. (WebCore::JSDOMWindowMicrotaskCallback::create): Deleted. (WebCore::JSDOMWindowMicrotaskCallback::call): Deleted. (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Deleted. (): Deleted. Extract JSDOMWindowMicrotaskCallback as JSMicrotaskCallback and create a new file for it. * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSExecState.cpp: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.cpp. (WebCore::JSExecState::didLeaveScriptContext): If we are in a main thread, we consume main thread microtask queue. If we are in worker thread, we consume a microtask queue per worker. (WebCore::functionCallHandlerFromAnyThread): (WebCore::evaluateHandlerFromAnyThread): * bindings/js/JSExecState.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.h. (WebCore::JSExecState::currentState): (WebCore::JSExecState::call): (WebCore::JSExecState::evaluate): (WebCore::JSExecState::profiledCall): (WebCore::JSExecState::profiledEvaluate): (WebCore::JSExecState::runTask): (WebCore::JSExecState::loadModule): (WebCore::JSExecState::linkAndEvaluateModule): (WebCore::JSExecState::JSExecState): (WebCore::JSExecState::~JSExecState): (WebCore::JSExecState::setCurrentState): Store and load ExecState in thread local storage, ThreadGlobalData. This allows us to use it for workers. (WebCore::JSMainThreadNullState::JSMainThreadNullState): (WebCore::JSMainThreadNullState::~JSMainThreadNullState): We keep this name "JSMainThreadNullState" since CustomElementReactionStack should be stick to the main thread. And this class is only used in the main thread. * bindings/js/JSExecStateInstrumentation.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h. (WebCore::JSExecState::instrumentFunctionInternal): (WebCore::JSExecState::instrumentFunctionCall): (WebCore::JSExecState::instrumentFunctionConstruct): * bindings/js/JSMicrotaskCallback.h: Copied from Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm. (WebCore::JSMicrotaskCallback::create): (WebCore::JSMicrotaskCallback::call): (WebCore::JSMicrotaskCallback::JSMicrotaskCallback): * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::loadModuleScriptInWorld): (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld): (WebCore::ScriptController::canAccessFromCurrentOrigin): * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate): * bridge/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): (-[WebScriptObject evaluateWebScript:]): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::printToConsole): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildObjectForCanvas): (WebCore::InspectorCanvas::buildAction): * inspector/InspectorController.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createGenericRecord): * inspector/WorkerInspectorController.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildInitiatorObject): * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): * page/PageConsoleClient.cpp: (WebCore::PageConsoleClient::addMessage): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::reportViolation const): * platform/ThreadGlobalData.h: (WebCore::ThreadGlobalData::ThreadGlobalData::currentState const): (WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::removeMicrotaskQueue): * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::microtaskQueue const): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): * workers/service/ExtendableEvent.cpp: (WebCore::ExtendableEvent::addExtendLifetimePromise): When dispatching an "install" event from service worker, we first create an event, dispatch it, and set a handler which is called when a pending promise count becomes zero. However, the old code checked pending promise count in a queued microtask. It worked previously because microtask is actually a macrotask in the service worker. So this check is done after a handler is set. But this patch introduces real microtask, and this check happens before a handler is set because dispatching an event can exhaust microtask queue. According to the spec, this check should not be done in microtask[1]. We make this checking part as a macrotask. We note that algorithm noted as FIXMEs should be done in this microtask while the checking part should not be done. [1]: https://w3c.github.io/ServiceWorker/#installation-algorithm 2018-08-05 Ryosuke Niwa Properties set on window.customElements can disappear due to GC https://bugs.webkit.org/show_bug.cgi?id=172575 Lexicologically sort the IDL attributes per Darin's comment. * dom/CustomElementRegistry.idl: 2018-08-05 Zalan Bujtas [LFC][BFC] contentHeightForFormattingContextRoot uses the wrong coordinate system to compute the height. https://bugs.webkit.org/show_bug.cgi?id=188319 Reviewed by Antti Koivisto. Display::Box::marginBox() is in the coordinate system of the box itself (8px top margin translates to y = -8px). What we need instead to compute the content height is the top/bottom position in the containing block's coordinate system (rect and rectWithMargin). * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): 2018-08-05 Ms2ger [GStreamer] Remove unsound assertions in MediaPlayerPrivateGStreamerBase. https://bugs.webkit.org/show_bug.cgi?id=188162 Reviewed by Philippe Normand. These assertions sometimes fail, and there's a runtime check right after them anyway. Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html fast/canvas/webgl/texImage2D-video-flipY-true.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture): (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime): 2018-08-05 Philippe Normand [MediaCapabilities] Platform integration https://bugs.webkit.org/show_bug.cgi?id=187850 Reviewed by Eric Carlson. Mock platform support for the MediaCapabilities specification. Test: media/mediacapabilities/mock-decodingInfo.html media/mediacapabilities/mock-encodingInfo.html * Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::MediaCapabilities::decodingInfo): (WebCore::MediaCapabilities::encodingInfo): * Modules/mediacapabilities/MediaCapabilitiesInfo.h: (WebCore::MediaCapabilitiesInfo::create): * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediacapabilities/MediaEngineConfiguration.cpp: Added. (WebCore::MediaEngineVideoConfiguration::MediaEngineVideoConfiguration): (WebCore::MediaEngineAudioConfiguration::MediaEngineAudioConfiguration): (WebCore::MediaEngineConfiguration::MediaEngineConfiguration): * platform/mediacapabilities/MediaEngineConfiguration.h: Added. (WebCore::MediaEngineVideoConfiguration::create): (WebCore::MediaEngineVideoConfiguration::contentType const): (WebCore::MediaEngineVideoConfiguration::size const): (WebCore::MediaEngineVideoConfiguration::bitrate const): (WebCore::MediaEngineVideoConfiguration::framerate const): (WebCore::MediaEngineAudioConfiguration::create): (WebCore::MediaEngineAudioConfiguration::contentType const): (WebCore::MediaEngineAudioConfiguration::channels const): (WebCore::MediaEngineAudioConfiguration::bitrate const): (WebCore::MediaEngineAudioConfiguration::samplerate const): (WebCore::MediaEngineConfiguration::audioConfiguration const): (WebCore::MediaEngineConfiguration::videoConfiguration const): * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: Added. (WebCore::mockEnabled): (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration): (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration): (WebCore::MediaEngineConfigurationFactory::enableMock): (WebCore::MediaEngineConfigurationFactory::disableMock): * platform/mediacapabilities/MediaEngineConfigurationFactory.h: Added. * platform/mediacapabilities/MediaEngineDecodingConfiguration.h: Added. (WebCore::MediaEngineDecodingConfiguration::MediaEngineDecodingConfiguration): (WebCore::MediaEngineDecodingConfiguration::canDecodeMedia): (WebCore::MediaEngineDecodingConfiguration::canSmoothlyDecodeMedia): (WebCore::MediaEngineDecodingConfiguration::canPowerEfficientlyDecodeMedia): (WebCore::MediaEngineDecodingConfiguration::decodingType const): * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Added. (WebCore::MediaEngineEncodingConfiguration::MediaEngineEncodingConfiguration): (WebCore::MediaEngineEncodingConfiguration::canEncodeMedia): (WebCore::MediaEngineEncodingConfiguration::canSmoothlyEncodeMedia): (WebCore::MediaEngineEncodingConfiguration::canPowerEfficientlyEncodeMedia): (WebCore::MediaEngineEncodingConfiguration::encodingType const): * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Added. (WebCore::MediaEngineDecodingConfigurationMock::canDecodeMedia): (WebCore::MediaEngineDecodingConfigurationMock::canSmoothlyDecodeMedia): (WebCore::MediaEngineDecodingConfigurationMock::canPowerEfficientlyDecodeMedia): * platform/mock/MediaEngineDecodingConfigurationMock.h: Added. * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Added. (WebCore::MediaEngineEncodingConfigurationMock::canEncodeMedia): (WebCore::MediaEngineEncodingConfigurationMock::canSmoothlyEncodeMedia): (WebCore::MediaEngineEncodingConfigurationMock::canPowerEfficientlyEncodeMedia): * platform/mock/MediaEngineEncodingConfigurationMock.h: Added. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::enableMockMediaCapabilities): * testing/Internals.h: * testing/Internals.idl: 2018-08-04 Simon Fraser Make WebCore::Timer more space-efficient https://bugs.webkit.org/show_bug.cgi?id=187455 Reviewed by Brent Fulgham. Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer. This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes). * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): * platform/Timer.h: 2018-08-04 Ryosuke Niwa Properties set on window.customElements can disappear due to GC https://bugs.webkit.org/show_bug.cgi?id=172575 Reviewed by Saam Barati. Fixed the bug that JS wrapper of CustomElementsRegistry can erroneously get collected during GC by keeping it alive as long as the global object is alive. Test: fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html * dom/CustomElementRegistry.cpp: (WebCore::CustomElementRegistry::create): (WebCore::CustomElementRegistry::CustomElementRegistry): * dom/CustomElementRegistry.h: (WebCore::CustomElementRegistry): Make this inherited from ContextDestructionObserver. * dom/CustomElementRegistry.idl: Set GenerateIsReachable=ImplScriptExecutionContext in IDL. This will make CustomElementRegistry reachable from the global object. * page/DOMWindow.cpp: (WebCore::DOMWindow::ensureCustomElementRegistry): 2018-08-03 Ryosuke Niwa innerHTML should not synchronously create a custom element https://bugs.webkit.org/show_bug.cgi?id=188327 Reviewed by Daniel Bates. Fixed the bug that the fragment parsing algorithm was synchronously constructing a custom element instead of enqueuing an element to upgrade. The fragment parsing algorithm creates an element for a token with *will execute script* flag set to false: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token which results in creating an element with synchronous custom elements flag *not* set: https://dom.spec.whatwg.org/#concept-create-element When synchronous custom elements flag is false, we're supposed to create an element and enqueue a custom element upgrade reaction. createHTMLElementOrFindCustomElementInterface was missing this last logic. Also fixed a bug that Element::enqueueToUpgrade would hit a debug assertion when a custom element which has been enqueued to upgrade is enqueued to upgrade for the second time. In this case, we need to put the element into the current element queue (https://html.spec.whatwg.org/multipage/custom-elements.html#current-element-queue) again. While the specification simply enqueues another upgrade reaction and bails out immediately in the first step of the upgrade, WebKit's implementation simply avoids this redundancy in the first place: https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element Existing tests such as imported/w3c/web-platform-tests/custom-elements/reactions/Document.html exercises this code path after the fragment parsing algorithm fix. Tests: imported/w3c/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueueItem::type const): Added for an assertion. (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Enqueue this element to the current element queue by calling ensureCurrentQueue and avoid inserting a redundant upgrade reaction. * dom/CustomElementReactionQueue.h: * dom/Element.cpp: (WebCore::Element::enqueueToUpgrade): Handle the case when a custom element is enqueued to upgrade for the second time while it had been waiting in some element queue. In this case, the reaction queue for this element has already been created and we simply need to put this element back into the current element queue (i.e. this element now belongs to both element queues). * html/parser/HTMLConstructionSite.cpp: (WebCore::findCustomElementInterface): Extracted out of createHTMLElementOrFindCustomElementInterface. (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Fixed the bug that the HTML parser was synchronously constructing a custom element even for the fragment parsing algorithm. 2018-08-03 Ben Richards We should cache the compiled sandbox profile in a data vault https://bugs.webkit.org/show_bug.cgi?id=184991 Reviewed by Ryosuke Niwa. Added functionality to FileHandle so that it can lock a file while open. Added a function to FileSystem to delete non empty directories. * platform/FileHandle.cpp: (WebCore::FileHandle::FileHandle): (WebCore::FileHandle::open): (WebCore::FileHandle::close): * platform/FileHandle.h: * platform/FileSystem.h: * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-08-03 Justin Fan WebGL 2 conformance: vertex_arrays/vertex_array_object.html https://bugs.webkit.org/show_bug.cgi?id=188291 Reviewed by Dean Jackson. Get https://www.khronos.org/registry/webgl/conformance-suites/2.0.0/conformance2/vertex_arrays/vertex-array-object.html working on Mac OS and iOS, and check in the new test expectations. Existing test: webgl/2.0.0/conformance2/vertex_arrays/vertex-array-object.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): (WebCore::WebGL2RenderingContext::deleteVertexArray): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::deleteObject): * html/canvas/WebGLVertexArrayObject.cpp: (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::checkVaryingsPacking const): (WebCore::GraphicsContext3D::createVertexArray): (WebCore::GraphicsContext3D::deleteVertexArray): (WebCore::GraphicsContext3D::isVertexArray): (WebCore::GraphicsContext3D::bindVertexArray): 2018-08-03 Sam Weinig Remove WebGPUObject https://bugs.webkit.org/show_bug.cgi?id=188114 Reviewed by Darin Adler. This removes the unecessary WebGPUObject base class and updates the classes that were inheriting from it to instead inherit directly from RefCounted. This shrinks the size of all the classes that were inheriting from it, as they no longer store a RefPtr member, which is unused. Most of the classes also shrink because they can be devirtualized. This also updates most of the create functions and constructors for the classes that were inheriting from WebGPUObject to no longer require the WebGPURenderingContext to be passed in. - For WebGPUBuffer, WebGPUCommandQueue, WebGPUComputeCommandEncoder, WebGPUComputePipelineState, WebGPUDepthStencilState, WebGPUDrawable, WebGPUFunction, WebGPULibrary, WebGPURenderCommandEncoder, WebGPURenderPassDepthAttachmentDescriptor, WebGPURenderPipelineColorAttachmentDescriptor, WebGPURenderPipelineState, and WebGPUTexture the WebGPURenderingContext and any other additional parameters needed for initialization were replaced with the underlying type (e.g. WebGPUBuffer now gets passed a GPUBuffer). - WebGPUCommandBuffer is passed a GPUCommandQueue, since it needs to construct the underlying GPUCommandBuffer itself so it can pass in the completion handler. - For WebGPUDepthStencilDescriptor, WebGPURenderPassAttachmentDescriptor, WebGPURenderPassColorAttachmentDescriptor, WebGPURenderPassDescriptor and WebGPURenderPipelineDescriptor the create and constructor functions are empty. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove WebGPUObject.h/cpp * html/canvas/WebGPUBuffer.cpp: (WebCore::WebGPUBuffer::WebGPUBuffer): * html/canvas/WebGPUBuffer.h: * html/canvas/WebGPUBuffer.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUBuffer directly, rather than the context. * html/canvas/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Update create and constructor to no longer require a context, as it would now be unused, as it no longer inherits from WebGPUObject nor needs to hold onto the context for any reason. (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor): Update to call the new WebGPURenderCommandEncoder::create, which no longer requires a context. (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Update to call the new WebGPUComputeCommandEncoder::create, which no longer requires a context. * html/canvas/WebGPUCommandBuffer.h: * html/canvas/WebGPUCommandBuffer.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to no longer take a context, and just take a GPUCommandQueue. We can't directly pass a GPUCommandBuffer as WebGPUCommandBuffer needs to pass in a completion handler on construction of the underlying GPUCommandBuffer. * html/canvas/WebGPUCommandQueue.cpp: (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): (WebCore::WebGPUCommandQueue::createCommandBuffer): Update to call the new WebGPUCommandBuffer::create, which no longer requires a context. * html/canvas/WebGPUCommandQueue.h: * html/canvas/WebGPUCommandQueue.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUCommandQueue directly. * html/canvas/WebGPUComputeCommandEncoder.cpp: (WebCore::WebGPUComputeCommandEncoder::create): (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): * html/canvas/WebGPUComputeCommandEncoder.h: * html/canvas/WebGPUComputeCommandEncoder.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUComputeCommandEncoder directly * html/canvas/WebGPUComputePipelineState.cpp: (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): * html/canvas/WebGPUComputePipelineState.h: * html/canvas/WebGPUComputePipelineState.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUComputePipelineState directly. * html/canvas/WebGPUDepthStencilDescriptor.cpp: Remove unneeded include of include "WebGPURenderingContext.h". * html/canvas/WebGPUDepthStencilDescriptor.h: * html/canvas/WebGPUDepthStencilDescriptor.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPUDepthStencilState.cpp: (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): * html/canvas/WebGPUDepthStencilState.h: * html/canvas/WebGPUDepthStencilState.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUDepthStencilState directly. * html/canvas/WebGPUDrawable.cpp: (WebCore::WebGPUDrawable::WebGPUDrawable): * html/canvas/WebGPUDrawable.h: * html/canvas/WebGPUDrawable.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUDrawable directly. * html/canvas/WebGPUFunction.cpp: (WebCore::WebGPUFunction::create): (WebCore::WebGPUFunction::WebGPUFunction): * html/canvas/WebGPUFunction.h: * html/canvas/WebGPUFunction.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUFunction directly. * html/canvas/WebGPULibrary.cpp: (WebCore::WebGPULibrary::WebGPULibrary): (WebCore::WebGPULibrary::functionWithName const): Update for new WebGPUFunction::create, which no longer requires a context. * html/canvas/WebGPULibrary.h: * html/canvas/WebGPULibrary.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPULibrary directly, rather than the context. Unlike the other create functions that take their underlying type, this one also continues to need the sourceCode String to be passed, as that is not available from the underlying GPULibrary and must be stored seperately. * html/canvas/WebGPUObject.cpp: Removed. * html/canvas/WebGPUObject.h: Removed. Deleted. * html/canvas/WebGPURenderCommandEncoder.cpp: (WebCore::WebGPURenderCommandEncoder::create): (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): * html/canvas/WebGPURenderCommandEncoder.h: * html/canvas/WebGPURenderCommandEncoder.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPURenderCommandEncoder directly. * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp: (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor): * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Also update create and constructor to no longer take a context, as it is now not used. This remains virtual as it is inherited from by WebGPURenderPassColorAttachmentDescriptor and WebGPURenderPassDepthAttachmentDescriptor. * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp: (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Update create and constructor to no longer take a context, as it is now not used. Declare final as this is not inherited by anything. * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp: (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Update create and constructor to no longer take a context, as it is now not used. Declare final as this is not inherited by anything. * html/canvas/WebGPURenderPassDescriptor.cpp: (WebCore::WebGPURenderPassDescriptor::depthAttachment): Update for new WebGPURenderPassDepthAttachmentDescriptor::create function which no longer requires a context. Semi-interesting note: This function was previously calling "*context()" to pass a WebGPURenderingContext& to WebGPURenderPassDepthAttachmentDescriptor::create. However, "context()" was always returning null, as the constructor of WebGPURenderPassDescriptor was not initializing the WebGPUObject with a WebGPURenderingContext. Now, one might think that this would cause a null-deref, but, because it was being assigned into a WebGPURenderingContext&, no dereference happens right away (it essentially just passes a pointer) and since the function it is being passed to does not use it, it never actually gets dereferenced. (WebCore::WebGPURenderPassDescriptor::colorAttachments): Update for new WebGPURenderPassColorAttachmentDescriptor::create function which no longer requires a context. * html/canvas/WebGPURenderPassDescriptor.h: * html/canvas/WebGPURenderPassDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp: (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to no longer take a context, as it is now not used. * html/canvas/WebGPURenderPipelineDescriptor.cpp: (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Update for new WebGPURenderPipelineColorAttachmentDescriptor::create which no longer requires a context. * html/canvas/WebGPURenderPipelineDescriptor.h: * html/canvas/WebGPURenderPipelineDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPURenderPipelineState.cpp: (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): * html/canvas/WebGPURenderPipelineState.h: * html/canvas/WebGPURenderPipelineState.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPURenderPipelineState directly. * html/canvas/WebGPURenderingContext.cpp: (WebCore::WebGPURenderingContext::createLibrary): (WebCore::WebGPURenderingContext::createRenderPipelineState): (WebCore::WebGPURenderingContext::createDepthStencilState): (WebCore::WebGPURenderingContext::createComputePipelineState): (WebCore::WebGPURenderingContext::createCommandQueue): (WebCore::WebGPURenderingContext::nextDrawable): (WebCore::WebGPURenderingContext::createBuffer): (WebCore::WebGPURenderingContext::createTexture): Update for new create functions which require the caller to pass the underlying type. * html/canvas/WebGPUTexture.cpp: (WebCore::WebGPUTexture::createFromDrawableTexture): Renamed to create. (WebCore::WebGPUTexture::create): Deleted All callers now pass a GPUTexture directly. * html/canvas/WebGPUTexture.h: * html/canvas/WebGPUTexture.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPUTextureDescriptor.h: * html/canvas/WebGPUTextureDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. 2018-08-03 Alex Christensen Fix spelling of "overridden" https://bugs.webkit.org/show_bug.cgi?id=188315 Reviewed by Darin Adler. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityLabel]): (-[WebAccessibilityObjectWrapper accessibilityValue]): * contentextensions/ContentExtensionsBackend.h: * editing/EditingStyle.cpp: (WebCore::EditingStyle::removeStyleFromRulesAndContext): * inspector/CommandLineAPIModuleSource.js: * platform/ScrollView.h: * platform/ScrollableArea.h: * platform/mediasession/MediaSessionInterruptionProvider.h: * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const): * rendering/RenderLayer.h: * rendering/RenderListBox.h: * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): * svg/SVGElement.cpp: (WebCore::SVGElement::localCoordinateSpaceTransform const): * svg/SVGLengthContext.cpp: (WebCore::SVGLengthContext::SVGLengthContext): (WebCore::SVGLengthContext::convertValueToUserUnits const): (WebCore::SVGLengthContext::determineViewport const): * svg/SVGLengthContext.h: 2018-08-03 Zalan Bujtas [LFC][BFC] Special case the document renderer when computing the height and margin https://bugs.webkit.org/show_bug.cgi?id=188313 Reviewed by Antti Koivisto. The document renderer is certainly special and its geometry is likely to be computed as part of "10.6.6 Complicated cases" (spec is unclear) but probably not by making the it a formatting root. Let's just special case it at contentHeightForFormattingContextRoot(), since having the document renderer as a context root has unwanted side effect. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesBlockFormattingContext const): 2018-08-03 Zalan Bujtas [LFC][BFC] Layout out-of-flow descendants only on the formatting context root. https://bugs.webkit.org/show_bug.cgi?id=188312 Reviewed by Antti Koivisto. Collect out-of-flow descendants on the formatting root container instead of the containing block and run layout on them on the root level. It's more efficient this way. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-08-03 Andy Estes ContentFilterUnblockHandler's constructors access moved-from variables https://bugs.webkit.org/show_bug.cgi?id=188308 Reviewed by Alex Christensen. * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: 2018-08-03 Zalan Bujtas [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching. https://bugs.webkit.org/show_bug.cgi?id=188306 Reviewed by Antti Koivisto. And add passing cases for floats. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::initialContainingBlock): (WebCore::Layout::isStretchedToInitialContainingBlock): (WebCore::Layout::stretchHeightToInitialContainingBlock): (WebCore::Layout::stretchWidthToInitialContainingBlock): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::isStretchedToViewport): Deleted. 2018-08-03 Zalan Bujtas [LFC] Do not check margin box while validating geometry. https://bugs.webkit.org/show_bug.cgi?id=188297 Reviewed by Antti Koivisto. The current RenderBox::marginBox implementation is not spec compliant. Ignore it for now. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): 2018-08-03 Carlos Garcia Campos [WPE] Use WPE key symbols and new API instead of xkbcommon and the key mapper https://bugs.webkit.org/show_bug.cgi?id=188093 Reviewed by Žan Doberšek. Add helper functions to get key code, hardware key code, key identifier and windows key code from a WPE key symbol. * platform/PlatformKeyboardEvent.h: * platform/wpe/PlatformKeyboardEventWPE.cpp: (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode): (WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode): (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode): (WebCore::PlatformKeyboardEvent::singleCharacterString): 2018-08-02 Ryosuke Niwa Release assert when throwing exceptions in custom element reactions https://bugs.webkit.org/show_bug.cgi?id=187805 Reviewed by Saam Barati. The release assertion was hit because we were not catching & re-throwing the exception thrown by DOM API before trying to execute custom elements reactions in ~CustomElementReactionStack as specified here: https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions Fixed the bug by capturing the exception and re-throwing the exception as specified. Tests: imported/w3c/web-platform-tests/custom-elements/reactions/with-exceptions.html * bindings/js/JSMainThreadExecState.h: (WebCore::JSMainThreadNullState::JSMainThreadNullState): Use the previous JS state. * bindings/scripts/CodeGeneratorJS.pm: (GeneratePut): Pass in the exec state to CustomElementReactionStack. (GeneratePutByIndex): Ditto. (GenerateDefineOwnProperty): Ditto. (GenerateDeletePropertyCommon): Ditto. (GenerateAttributeSetterBodyDefinition): Ditto. (GenerateOperationBodyDefinition): Ditto. * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::setJSTestCEReactionsStringifierValueSetter): * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::ElementQueue::processQueue): Added. If there is a script running in the stack (i.e. ExecState is not null), catch any exception before executing custom element reactions, then re-throw the exception afterwards. ExecState is null when DOM API is invoked via Objective-C bindings or when custom element reactions are executed in the backup queue (e.g. for editing operations). (WebCore::CustomElementReactionStack::processQueue): (WebCore::CustomElementReactionQueue::processBackupQueue): * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionStack::CustomElementReactionStack): (WebCore::CustomElementReactionStack::~CustomElementReactionStack): 2018-08-02 Zalan Bujtas [LFC][BFC] Apply the "10.6.6 Complicated cases" when computing height and margin for the document renderer https://bugs.webkit.org/show_bug.cgi?id=188296 Reviewed by Simon Fraser. The spec is not clear about what to do with the document renderer. It behaves as if it was a formatting context root when it comes to computing the content height. Let's apply "10.6.6 Complicated cases" for now. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesBlockFormattingContext const): * layout/layouttree/LayoutBox.h: 2018-08-02 Zalan Bujtas [LFC][Floating] Add FloatingState::bottom() to enable content height computation for formatting roots. https://bugs.webkit.org/show_bug.cgi?id=188294 Reviewed by Simon Fraser. "10.6.7 'Auto' heights for block formatting context roots ... In addition, if the element has any floating descendants whose bottom margin edge is below the element's bottom content edge, then the height is increased to include those edges. Only floats that participate in this block formatting context are taken into account, e.g., floats inside absolutely positioned descendants or other floats are not..." * layout/FloatingState.cpp: (WebCore::Layout::FloatingState::bottom const): * layout/FloatingState.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): 2018-08-02 Jer Noble Control center controls disappear when pausing, locking device. https://bugs.webkit.org/show_bug.cgi?id=188282 Reviewed by Eric Carlson. Test: platform/mac/media/audio-session-category-video-paused.html MediaRemote will set any app whose audio session category changes from MediaPlayback to Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of events, we never moved from MediaPlayback to Ambient when pausing