haikuwebkit/Source/WebCore/ChangeLog-2018-09-11

85819 lines
4.0 MiB
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

2018-09-11 Philippe Normand <pnormand@igalia.com>
[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 <jiewen_tan@apple.com>
[WebAuthN] Polish AuthenticatorManager and rename it to AuthenticatorCoordinator
https://bugs.webkit.org/show_bug.cgi?id=189277
<rdar://problem/44115936>
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 <Hironori.Fujii@sony.com>
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 <msaboff@apple.com>
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 <megan_gardner@apple.com>
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 <youenn@apple.com>
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 <megan_gardner@apple.com>
Correctly interpret from angle for conic gradients
https://bugs.webkit.org/show_bug.cgi?id=189445
<rdar://problem/44158271>
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 <james.savage@apple.com>
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 <rniwa@webkit.org>
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 <rniwa@webkit.org>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <don.olmstead@sony.com>
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 <dabates@apple.com>
[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 <mitz@apple.com>
[macOS] Editor::readSelectionFromPasteboards MailBlockquoteHandling argument is effectively unused
https://bugs.webkit.org/show_bug.cgi?id=189480
Reviewed by Anders Carlsson.
No new tests, because this doesnt change behavior.
* editing/Editor.h: Removed the MailBlockquoteHandling argument from
readSelectionFromPasteboard.
* editing/mac/EditorMac.mm:
(WebCore::Editor::readSelectionFromPasteboard): Dont pass mailBlockquoteHandling to
pasteWithPasteboard. It was always set to RespectBlockquote, which is the latters
default.
2018-09-10 Andy Estes <aestes@apple.com>
[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 <graouts@apple.com>
[Web Animations] Positive delays of accelerated animations are not respected
https://bugs.webkit.org/show_bug.cgi?id=189411
<rdar://problem/44151416>
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 <yusukesuzuki@slowstart.org>
[WTF] Add Markable<T, Traits>
https://bugs.webkit.org/show_bug.cgi?id=189231
Reviewed by Sam Weinig.
Use Markable<Seconds> and Markable<WallTime> 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 <mrajca@apple.com>
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
<rdar://problem/44186498> 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 <aboya@igalia.com>
[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 <fwang@igalia.com>
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 <pnormand@igalia.com>
[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 <rbuis@igalia.com>
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 <graouts@apple.com>
[Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails
https://bugs.webkit.org/show_bug.cgi?id=189405
<rdar://problem/43342639>
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 <Hironori.Fujii@sony.com>
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 <wtf/HashTraits.h>.
* bindings/js/SerializedScriptValue.cpp: Ditto.
* page/DebugPageOverlays.cpp: Added #include "ColorHash.h" to instantiate HashMap<String, Color>.
* platform/URLHash.h: Added DefaultHash<URL> 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<String, IntSize>.
2018-09-09 Fujii Hironori <Hironori.Fujii@sony.com>
[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 <aestes@apple.com>
[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 <simon.fraser@apple.com>
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 <yusukesuzuki@slowstart.org>
[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 <Hironori.Fujii@sony.com>
[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 <Basuke.Suzuki@sony.com>
[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 <Hironori.Fujii@sony.com>
[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 <youenn@apple.com>
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<MediaStreamTrack>.
RTCRtpSender keeps having a RefPtr<MediaStreamTrack>.
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 <dabates@apple.com>
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 <wenson_hsieh@apple.com>
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 <Basuke.Suzuki@sony.com>
[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 <youenn@apple.com>
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 <youenn@apple.com>
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 <rbuis@igalia.com>
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 <fwang@igalia.com>
[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 <don.olmstead@sony.com>
[AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY)
https://bugs.webkit.org/show_bug.cgi?id=189423
<rdar://problem/44231775>
Reviewed by Yusuke Suzuki.
No new tests. Compilation fix.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::AXObjectCache):
2018-09-07 Zalan Bujtas <zalan@apple.com>
[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 <rniwa@webkit.org>
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 <zalan@apple.com>
[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 <wenson_hsieh@apple.com>
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 <simon.fraser@apple.com>
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 <zalan@apple.com>
[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 <megan_gardner@apple.com>
Add Support for Conic Gradients
https://bugs.webkit.org/show_bug.cgi?id=189329
<rdar://problem/21444701>
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 <wenson_hsieh@apple.com>
[macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through)
https://bugs.webkit.org/show_bug.cgi?id=189356
<rdar://problem/44185674>
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 <zalan@apple.com>
[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 <eric.carlson@apple.com>
[MediaStream] Include supported frame rates in video capture presets
https://bugs.webkit.org/show_bug.cgi?id=189351
<rdar://problem/44188917>
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 <antti@apple.com>
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 <youenn@apple.com>
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 <aestes@apple.com>
[Apple Pay] Rename the -apple-pay-button-type value "checkout" to "check-out"
https://bugs.webkit.org/show_bug.cgi?id=189366
<rdar://problem/44193218>
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 <jer.noble@apple.com>
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 <fwang@igalia.com>
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 <wenson_hsieh@apple.com>
[macOS] Cannot change font size at selection until font panel is shown
https://bugs.webkit.org/show_bug.cgi?id=189295
<rdar://problem/35593389>
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 <zalan@apple.com>
[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 <eric.carlson@apple.com>
[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 <ajuma@chromium.org>
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 <zalan@apple.com>
[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 <calvaris@igalia.com>
[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 <youenn@apple.com>
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 <bfulgham@apple.com>
The width of an empty or nullptr TextRun should be zero
https://bugs.webkit.org/show_bug.cgi?id=189154
<rdar://problem/43685926>
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 <zalan@apple.com>
[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 <youenn@apple.com>
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 <zalan@apple.com>
[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 <youenn@apple.com>
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 <simon.fraser@apple.com>
Remove some logging that I committed by mistake.
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::RenderLayerFilters):
(WebCore::RenderLayerFilters::~RenderLayerFilters):
2018-09-05 Zalan Bujtas <zalan@apple.com>
[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 <woodrow_wang@apple.com>
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
<https://bugs.webkit.org/show_bug.cgi?id=187773>.
* loader/ResourceLoadStatistics.h:
2018-09-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, fix the build with recent SDKs.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
2018-09-05 Woodrow Wang <woodrow_wang@apple.com>
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 <youenn@apple.com>
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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <jer.noble@apple.com>
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 <woodrow_wang@apple.com>
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 <https://bugs.webkit.org/show_bug.cgi?id=187773>.
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 <zdobersek@igalia.com>
[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 <eric.carlson@apple.com>
[MediaStream] Simplify logic when changing RealtimeMediaSource settings
https://bugs.webkit.org/show_bug.cgi?id=189284
<rdar://problem/44117948>
Reviewed by Youenn Fablet.
Remove all "apply<setting>" 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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <fwang@igalia.com>
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 <obrufau@igalia.com>
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 <antti@apple.com>
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 <emilio@crisal.io>
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 <dino@apple.com>
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 <rniwa@webkit.org>
slotchange event doesn't get fired when inserting, removing, or renaming slot elements
https://bugs.webkit.org/show_bug.cgi?id=189144
<rdar://problem/43871061>
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 <youenn@apple.com>
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 <wenson_hsieh@apple.com>
Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
https://bugs.webkit.org/show_bug.cgi?id=188890
<rdar://problem/43648605>
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 <simon.fraser@apple.com>
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 <zalan@apple.com>
[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 <youenn@apple.com>
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 <zalan@apple.com>
[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 <rbuis@igalia.com>
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 <simon.fraser@apple.com>
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 <dino@apple.com>
Build fix.
* testing/Internals.cpp:
2018-09-03 Dean Jackson <dino@apple.com>
Move SystemPreview code from WebKitAdditions to WebKit
https://bugs.webkit.org/show_bug.cgi?id=189252
<rdar://problem/44080245>
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 <aestes@apple.com>
[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 <youenn@apple.com>
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 <graouts@apple.com>
[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
<rdar://problem/42026625>
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 <dabates@apple.com>
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 <pvollan@apple.com>
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 <dabates@apple.com>
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: <https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request> (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 <dabates@apple.com>
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 <zdobersek@igalia.com> and Ms2ger <Ms2ger@igalia.com>
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 <yacine.bandou_ext@softathome.com>
[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 <aestes@apple.com>
[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 <aestes@apple.com>
[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 <aestes@apple.com>
[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 <youenn@apple.com>
REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
https://bugs.webkit.org/show_bug.cgi?id=187658
<rdar://problem/42306442>
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 <aestes@apple.com>
[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 <pnormand@igalia.com>
[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 <zalan@apple.com>
REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
https://bugs.webkit.org/show_bug.cgi?id=189232
<rdar://problem/43886373>
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 <simon.fraser@apple.com>
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 <darin@apple.com>
[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 <simon.fraser@apple.com>
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 <youenn@apple.com>
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 <jer.noble@apple.com>
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 <wenson_hsieh@apple.com>
[iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
https://bugs.webkit.org/show_bug.cgi?id=189054
<rdar://problem/43819779>
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 <jer.noble@apple.com>
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 <cdumez@apple.com>
[ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
https://bugs.webkit.org/show_bug.cgi?id=183705
<rdar://problem/42440606>
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 <wilander@apple.com>
Storage Access API: Maintain access through same-site navigations
https://bugs.webkit.org/show_bug.cgi?id=188564
<rdar://problem/43445160>
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 <youenn@apple.com>
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 <cdumez@apple.com>
Assertion hit in ~CompletionHandler() from ~WebFrame()
https://bugs.webkit.org/show_bug.cgi?id=189199
<rdar://problem/42657233>
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 <zalan@apple.com>
[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 <antti@apple.com>
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 <akeerthi@apple.com>
[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 <youenn@apple.com>
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 <youenn@apple.com>
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 <eric.carlson@apple.com>
[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 <pnormand@igalia.com>
Unreviewed, GTK Ubuntu LTS build fix after r235543.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2018-08-31 Philippe Normand <pnormand@igalia.com>
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 <philn@igalia.com>
[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 <ddkilzer@apple.com>
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 <fwang@igalia.com>
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 <html>
and <body> 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 <html> 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 <zalan@apple.com>
CounterMaps should hold a unique_ptr of CounterMap.
https://bugs.webkit.org/show_bug.cgi?id=189174
<rdar://problem/43686458>
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 <ross.kirsling@sony.com>
Speculative build fix for WPE after r235531.
* platform/graphics/filters/PointLightSource.cpp:
Add missing include.
2018-08-30 Ryosuke Niwa <rniwa@webkit.org>
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<Ref<Node>> for consistency.
(WebCore::HTMLSlotElement::assignedNodes const): Ditto.
(WebCore::HTMLSlotElement::assignedElements const):
* html/HTMLSlotElement.h:
* html/HTMLSlotElement.idl:
2018-08-30 Don Olmstead <don.olmstead@sony.com>
[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 <obarnett@apple.com>
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 <tsavell@apple.com>
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 <timothy_horton@apple.com>
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 <aestes@apple.com>
[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.
<https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>
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 <bfulgham@apple.com>
The width of a nullptr TextRun should be zero
https://bugs.webkit.org/show_bug.cgi?id=189154
<rdar://problem/43685926>
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 <eric.carlson@apple.com>
Mock video devices should only support discrete sizes
https://bugs.webkit.org/show_bug.cgi?id=189000
<rdar://problem/43766551>
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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <yusukesuzuki@slowstart.org>
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 <yusukesuzuki@slowstart.org>
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 <aestes@apple.com>
Addressed additional review feedback after r235342.
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
Used '"' instead of "\"" with makeString().
2018-08-29 Aditya Keerthi <akeerthi@apple.com>
[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 <obarnett@apple.com>
Implement the Web Share API
https://bugs.webkit.org/show_bug.cgi?id=171100
<rdar://problem/31751734>
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 <dabates@apple.com>
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
<rdar://problem/41804994>
And
<rdar://problem/39771867>
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 <youenn@apple.com>
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 <rniwa@webkit.org>
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 <cdumez@apple.com>
[PSON] We should only process-swap when eTLD+1 changes on navigation
https://bugs.webkit.org/show_bug.cgi?id=189090
<rdar://problem/43799225>
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 <youenn@apple.com>
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 <simon.fraser@apple.com>
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 <jer.noble@apple.com>
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 <wenson_hsieh@apple.com>
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<String> 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 <ddkilzer@apple.com>
Remove empty directories from from svn.webkit.org repository
<https://webkit.org/b/189081>
* Modules/proximity: Removed.
2018-08-28 Zalan Bujtas <zalan@apple.com>
[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 <ajuma@chromium.org>
[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 <rniwa@webkit.org>
Changes to slot children should trigger slotchange
https://bugs.webkit.org/show_bug.cgi?id=169718
<rdar://problem/43317496>
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 parents 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 <don.olmstead@sony.com>
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 <youenn@apple.com>
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 <don.olmstead@sony.com>
[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 <wenson_hsieh@apple.com>
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 <youenn@apple.com>
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 <Basuke.Suzuki@sony.com>
[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 <akeerthi@apple.com>
[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 <youenn@apple.com>
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 <ajuma@chromium.org>
[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 <akeerthi@apple.com>
[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 <ajuma@chromium.org>
[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 <zalan@apple.com>
[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 <eric.carlson@apple.com>
Revert changes to RealtimeMediaSource.cpp made in r235086
https://bugs.webkit.org/show_bug.cgi?id=189046
<rdar://problem/43794875>
Unreviewed, reverting an accidental change.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
2018-08-28 Alejandro G. Castro <alex@igalia.com>
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 <justin_fan@apple.com>
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 <mmaxfield@apple.com>
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 <wenson_hsieh@apple.com>
[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 <krollin@apple.com>
Unreviewed build fix -- disable LTO for production builds
* Configurations/Base.xcconfig:
2018-08-27 Youenn Fablet <youenn@apple.com>
Various IndexDB tests abandon documents
https://bugs.webkit.org/show_bug.cgi?id=188728
<rdar://problem/43651095>
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 <simon.fraser@apple.com>
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 <akeerthi@apple.com>
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 <simon.fraser@apple.com>
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 <wenson_hsieh@apple.com>
[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
<rdar://problem/43702993>
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 <drousso@apple.com>
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 <krollin@apple.com>
Build system support for LTO
https://bugs.webkit.org/show_bug.cgi?id=187785
<rdar://problem/42353132>
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 <dabates@apple.com>
[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 <dabates@apple.com>
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
<rdar://problem/15966403>
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 <wenson_hsieh@apple.com>
[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
<rdar://problem/43737715>
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 <achristensen@webkit.org>
Fix IOSMAC build
https://bugs.webkit.org/show_bug.cgi?id=188934
<rdar://problem/43694979>
Reviewed by Darin Adler.
* platform/network/cf/FormDataStreamCFNet.cpp:
2018-08-27 Rob Buis <rbuis@igalia.com>
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 <ajuma@chromium.org>
[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 <yusukesuzuki@slowstart.org>
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 <yusukesuzuki@slowstart.org>
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 <zalan@apple.com>
[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 <chris.reid@sony.com>
[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 <zalan@apple.com>
[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 <aestes@apple.com>
[Apple Pay] Introduce new values for -apple-pay-button-type
https://bugs.webkit.org/show_bug.cgi?id=188949
<rdar://problem/39992228>
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 <youenn@apple.com>
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 <youenn@apple.com>
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 <wenson_hsieh@apple.com>
[Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments
https://bugs.webkit.org/show_bug.cgi?id=188933
<rdar://problem/43699724>
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 <aestes@apple.com>
[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 <rniwa@webkit.org>
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 <rniwa@webkit.org>
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 <jer.noble@apple.com>
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 <rniwa@webkit.org>
Pass in IsComposed flag to Event constructors
https://bugs.webkit.org/show_bug.cgi?id=188720
<rdar://problem/43580387>
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 <rniwa@webkit.org>
Add getModifierState to MouseEvent
https://bugs.webkit.org/show_bug.cgi?id=188913
<rdar://problem/43668772>
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 <youenn@apple.com>
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 <aperez@igalia.com>
[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 <aestes@apple.com>
[Apple Pay] Allow $0 totals
https://bugs.webkit.org/show_bug.cgi?id=185150
<rdar://problem/39212331>
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 <fwang@igalia.com>
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 <antti@apple.com>
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 <zdobersek@igalia.com>
[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 <antti@apple.com>
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 <simon.fraser@apple.com>
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 <rniwa@webkit.org>
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 <akeerthi@apple.com>
Unreviewed, fix the Windows build after r235245.
* html/InputMode.cpp:
(WebCore::stringForInputMode):
2018-08-23 Saam barati <sbarati@apple.com>
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 <david_fenton@apple.com>
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 <dabates@apple.com>
[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 <mark.lam@apple.com>
Move vmEntryGlobalObject() to VM from CallFrame.
https://bugs.webkit.org/show_bug.cgi?id=188900
<rdar://problem/43655753>
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 <aestes@apple.com>
[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 <drousso@apple.com>
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 <akeerthi@apple.com>
[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 <eric.carlson@apple.com>
[MediaStream] Store video preset sizes in a map
https://bugs.webkit.org/show_bug.cgi?id=188866
<rdar://problem/43622643>
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 <ryanhaddad@apple.com>
Unreviewed, attempt to fix the build after r235230.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2018-08-23 Youenn Fablet <youenn@apple.com>
Update libwebrtc up to 984f1a80c0
https://bugs.webkit.org/show_bug.cgi?id=188745
<rdar://problem/43539177>
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 <wenson_hsieh@apple.com>
[Attachment Support] Attachment elements don't appear in drag images on macOS
https://bugs.webkit.org/show_bug.cgi?id=188823
<rdar://problem/43616378>
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 <zalan@apple.com>
[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 <zdobersek@igalia.com>
[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 <zdobersek@igalia.com>
[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 <zdobersek@igalia.com>
[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 <zdobersek@igalia.com>
[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 <rniwa@webkit.org>
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 <jiewen_tan@apple.com>
Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development"
in features.json.
* features.json:
2018-08-22 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Support dragging attachment elements out as files on macOS
https://bugs.webkit.org/show_bug.cgi?id=181294
<rdar://problem/36298801>
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 <https://bugs.webkit.org/show_bug.cgi?id=181514>.
Tests: WKAttachmentTestsMac.DragAttachmentAsFilePromise
WKAttachmentTests.MoveAttachmentElementAsIconByDragging
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getPasteboardTypesAndDataForAttachment):
2018-08-22 Aditya Keerthi <akeerthi@apple.com>
[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 <eric.carlson@apple.com>
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 <rniwa@webkit.org>
Focus navigation order in slot fallback contents is wrong
https://bugs.webkit.org/show_bug.cgi?id=178001
<rdar://problem/42842997>
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 <ddkilzer@apple.com>
Move files in WebCore project to match Xcode folder structure
<https://webkit.org/b/188851>
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 <zalan@apple.com>
[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 <rbuis@igalia.com>
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 <youenn@apple.com>
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 <Ms2ger@igalia.com>
[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 <zalan@apple.com>
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 <zdobersek@igalia.com>
[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 <ddkilzer@apple.com>
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 <cgarcia@igalia.com>
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 <yusukesuzuki@slowstart.org>
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 <rniwa@webkit.org>
Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
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<Modifier> 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<Modifier> 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<Modifier>.
(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 <wenson_hsieh@apple.com>
[Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation
https://bugs.webkit.org/show_bug.cgi?id=188715
<rdar://problem/43541790>
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 <ryanhaddad@apple.com>
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 <commit-queue@webkit.org>
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 <megan_gardner@apple.com>
Use VisiblePosition to calculate selection ranges
https://bugs.webkit.org/show_bug.cgi?id=188767
<rdar://problem/43577166>
Reviewed by Ryosuke Niwa.
Exposing comparePositions.
* editing/Editing.h:
2018-08-21 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
https://bugs.webkit.org/show_bug.cgi?id=188496
<rdar://problem/43216836>
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 <bfulgham@apple.com>
Remove experimental affiliated domain code now that StorageAccess API is available
https://bugs.webkit.org/show_bug.cgi?id=188756
<rdar://problem/43527848>
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 <antti@apple.com>
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 <yusukesuzuki@slowstart.org>
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 <pvollan@apple.com>
[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 <wilander@apple.com>
Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
https://bugs.webkit.org/show_bug.cgi?id=188757
<rdar://problem/38713390>
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 <dabates@apple.com>
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 <dabates@apple.com>
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: <https://developercommunity.visualstudio.com/content/problem/316713/msvc-cant-compile-webkits-optionsetcontainsany.html>.
(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 <Hironori.Fujii@sony.com>
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 <philn@igalia.com>
[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 <philn@igalia.com>
[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 <philn@igalia.com>
[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 <commit-queue@webkit.org>
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 <sbarati@apple.com>
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 <drousso@apple.com>
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 <mcatanzaro@igalia.com>
[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 <ddkilzer@apple.com>
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 <ddkilzer@apple.com>
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 <jeremyj@apple.com>
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 <eric.carlson@apple.com>
[MediaStream] Move capture device monitoring to WebKit
https://bugs.webkit.org/show_bug.cgi?id=188521
<rdar://problem/43251787>
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 <rbuis@igalia.com>
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 <Ms2ger@igalia.com>
[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 <rbuis@igalia.com>
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 "parsedReferrers origin is not same origin with origin",
then set requests 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 <yusukesuzuki@slowstart.org>
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 <ddkilzer@apple.com>
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 <ajuma@chromium.org>
[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 <wenson_hsieh@apple.com>
[iOS] Paste is missing from callout bar when pasteboard only contains custom data
https://bugs.webkit.org/show_bug.cgi?id=184271
<rdar://problem/39256708>
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 <rniwa@webkit.org>
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 <akeerthi@apple.com>
[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 <datalist> 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 <achristensen@webkit.org>
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 <bfulgham@apple.com>
Remove Adobe SSO exception now that StorageAccess API is available
https://bugs.webkit.org/show_bug.cgi?id=188710
<rdar://problem/35056707>
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 <rniwa@webkit.org>
Replace canBubble and cancelable booleans in Event by enum classes
https://bugs.webkit.org/show_bug.cgi?id=188692
<rdar://problem/43411944>
Rubber-stamped by Alex Christensen.
Make these enum classes uint8_t.
* dom/Event.h:
2018-08-17 Alex Christensen <achristensen@webkit.org>
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 <rniwa@webkit.org>
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 <yusukesuzuki@slowstart.org> and Fujii Hironori <Hironori.Fujii@sony.com>
[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 <philn@igalia.com>
[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 <mcatanzaro@igalia.com>
[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 <Ms2ger@igalia.com>
[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 <philn@igalia.com>
[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 <philn@igalia.com>
[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 <drousso@apple.com>
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 <Basuke.Suzuki@sony.com>
[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 <Basuke.Suzuki@sony.com>
[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 <ross.kirsling@sony.com>
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 <achristensen@webkit.org>
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 <rniwa@webkit.org>
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 <akeerthi@apple.com>
Unreviewed, fix the watchOS build after r188464.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::setColor):
2018-08-16 Ryosuke Niwa <rniwa@webkit.org>
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 <youenn@apple.com>
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
<rdar://problem/42332178>
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 <rniwa@webkit.org>
Perform a microtask checkpoint before creating a custom element
https://bugs.webkit.org/show_bug.cgi?id=188189
<rdar://problem/42843022>
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 <achristensen@webkit.org>
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<String>::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 <jer.noble@apple.com>
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 <https://github.com/w3c/media-source/issues/155> and the proposed spec change
is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.
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 <chris.reid@sony.com>
[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 <zdobersek@igalia.com>
[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 <akeerthi@apple.com>
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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <antti@apple.com>
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 <ansh_shukla@apple.com>
NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
https://bugs.webkit.org/show_bug.cgi?id=186870
<rdar://problem/41314410>
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 <benton_richards@apple.com>
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 <rniwa@webkit.org>
Can't share an app on AppStore to WeChat due to a release assert
https://bugs.webkit.org/show_bug.cgi?id=188621
<rdar://problem/43343976>
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 <chris.reid@sony.com>
[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 <akeerthi@apple.com>
[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 <ryanhaddad@apple.com>
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 <rniwa@webkit.org>
connectedCallback is invoked by the HTML parser after child nodes had been inserted
https://bugs.webkit.org/show_bug.cgi?id=183931
<rdar://problem/38843548>
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 <Basuke.Suzuki@sony.com>
[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 <achristensen@webkit.org>
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<String> is incorrect.
I'll re-add it and fix VectorTraits<String> in a separate patch.
2018-08-15 Wenson Hsieh <wenson_hsieh@apple.com>
[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 <ajuma@chromium.org>
[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 <zdobersek@igalia.com>
[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 <Hironori.Fujii@sony.com>
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 <zalan@apple.com>
[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 <Hironori.Fujii@sony.com>
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 <yusukesuzuki@slowstart.org>
[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 <achristensen@webkit.org>
isValidCSSSelector is unsafe to be called from a non-main thread
https://bugs.webkit.org/show_bug.cgi?id=188581
<rdar://problem/40517358>
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 <ansh_shukla@apple.com>
NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
https://bugs.webkit.org/show_bug.cgi?id=186870
<rdar://problem/41314410>
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 <Basuke.Suzuki@sony.com>
[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 <achristensen@webkit.org>
Use a Variant instead of a union in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=188559
Reviewed by Antti Koivisto.
No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
I only have m_isForPage when assertions are enabled because it's only used for an assertion.
The rest is pretty straightforward translating union syntax to Variant syntax.
I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::createRareData):
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setArgument):
(WebCore::CSSSelector::setLangArgumentList):
(WebCore::CSSSelector::setSelectorList):
(WebCore::CSSSelector::setNth):
(WebCore::CSSSelector::matchNth const):
(WebCore::CSSSelector::nthA const):
(WebCore::CSSSelector::nthB const):
(WebCore::CSSSelector::RareData::RareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::argument const):
(WebCore::CSSSelector::langArgumentList const):
(WebCore::CSSSelector::selectorList const):
(WebCore::CSSSelector::attribute const):
(WebCore::CSSSelector::attributeCanonicalLocalName const):
(WebCore::CSSSelector::setValue):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::~CSSSelector):
(WebCore::CSSSelector::tagQName const):
(WebCore::CSSSelector::tagLowercaseLocalName const):
(WebCore::CSSSelector::value const):
(WebCore::CSSSelector::serializingValue const):
(WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
(WebCore::CSSSelector::RareData::create): Deleted.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
* css/parser/CSSParserSelector.h:
2018-08-14 Yusuke Suzuki <yusukesuzuki@slowstart.org>
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 <yusukesuzuki@slowstart.org>
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 <ajuma@chromium.org>
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 <graouts@apple.com>
[Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation()
https://bugs.webkit.org/show_bug.cgi?id=188519
<rdar://problem/43237889>
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 <zalan@apple.com>
[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.
<div id=A style="margin-bottom: 20px;"></div>
<div id=B style='float: left'></div>
<div id=C style="margin-top: 10px;"></div>
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 <yusukesuzuki@slowstart.org>
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 <rbuis@igalia.com>
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 <zalan@apple.com>
[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 <james.savage@apple.com>
[iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:]
https://bugs.webkit.org/show_bug.cgi?id=188537
<rdar://problem/41400259>
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 <achristensen@webkit.org>
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<CSSSelector> 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 <ajuma@chromium.org>
[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 <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <antti@apple.com>
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 <commit-queue@webkit.org>
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 <wenson_hsieh@apple.com>
[iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup
https://bugs.webkit.org/show_bug.cgi?id=188485
<rdar://problem/43168784>
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 <achristensen@webkit.org>
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 <sabouhallawa@apple.com>
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 <mcatanzaro@igalia.com>
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 <antti@apple.com>
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 <zalan@apple.com>
[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 <yusukesuzuki@slowstart.org>
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 <obrufau@igalia.com>
[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 <sihui_liu@apple.com>
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 <yusukesuzuki@slowstart.org>
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<Unkonwn> 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 <akeerthi@apple.com>
[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 <zalan@apple.com>
[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 <antti@apple.com>
Use OptionSet for various RenderLayer flags
https://bugs.webkit.org/show_bug.cgi?id=188472
<rdar://problem/43153059>
Followup, fix some mistakes.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
2018-08-10 Ryosuke Niwa <rniwa@webkit.org>
[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 <dabates@apple.com>
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 <antti@apple.com>
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 <sihui_liu@apple.com>
CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
https://bugs.webkit.org/show_bug.cgi?id=188461
<rdar://problem/33555052>
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 <dabates@apple.com>
Once <object> 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 <object> that behaves like an iframe is handled by a widget (FrameView). When
the CSS display property for an <object> is set to "none" we detach the widget from its renderer
as part of destroying the render tree for the <object>. Subsequently changing the CSS display
to a non-"none"/"contents" value will create a new renderer for <object> R. For an <object> that
behaves like an iframe, we navigate to the resource associated with the <object> reusing the
existing Frame F object created when we first displayed the <object>. 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 <object> 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 <object> 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 <ajuma@chromium.org>
[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 <benton_richards@apple.com>
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 <cdumez@apple.com>
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 <jer.noble@apple.com>
Video playback is using more power
https://bugs.webkit.org/show_bug.cgi?id=188452
<rdar://problem/42298937>
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 <sbarati@apple.com>
memoryFootprint should return size_t not optional<size_t>
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 <ajuma@chromium.org>
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 <cturner@igalia.com>
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 <ross.kirsling@sony.com>
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 <rniwa@webkit.org>
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 <justin_fan@apple.com>
Prevent collectScreenProperties from crashing Base System
https://bugs.webkit.org/show_bug.cgi?id=188429
<rdar://problem/43075662>
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 <don.olmstead@sony.com>
[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 <don.olmstead@sony.com>
[Nicosia] Add the Nicosia-specific PlatformLayer type alias
https://bugs.webkit.org/show_bug.cgi?id=188405
<rdar://problem/43039520>
Unreviewed build fix.
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
2018-08-08 Simon Fraser <simon.fraser@apple.com>
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 <eric.carlson@apple.com>
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<WebCore::PlatformMediaSession::RemoteControlCommandType>::toString):
2018-08-08 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: XHR content sometimes shows as error even though load succeeded
https://bugs.webkit.org/show_bug.cgi?id=188385
<rdar://problem/42646160>
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 <sihui_liu@apple.com>
Assertion failed in Webcore::Process::setIdentifier()
https://bugs.webkit.org/show_bug.cgi?id=188404
<rdar://problem/43029137>
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 <cturner@igalia.com>
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 <zdobersek@igalia.com>
[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 <rego@igalia.com>
[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 <sbarati@apple.com>
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 <darin@apple.com>
[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 <cdumez@apple.com>
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 <sabouhallawa@apple.com>
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 <rniwa@webkit.org>
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
<rdar://problem/42843012>
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 <achristensen@webkit.org>
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 <rbuis@igalia.com>
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 <justin_fan@apple.com>
Prevent querying for renderer info for disconnected or uninitialized displays
https://bugs.webkit.org/show_bug.cgi?id=188387
<rdar://problem/42588769>
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 <rniwa@webkit.org>
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
<rdar://problem/42843012>
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 <ryanhaddad@apple.com>
Unreviewed, suppress warnings to fix the build.
* crypto/CommonCryptoUtilities.cpp:
(WebCore::getCommonCryptoDigestAlgorithm):
2018-08-07 Alex Christensen <achristensen@webkit.org>
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 <cgarcia@igalia.com>
[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 <zdobersek@igalia.com>
[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 <zdobersek@igalia.com>
[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 <fwang@igalia.com>
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 <rniwa@webkit.org>
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 <simon.fraser@apple.com>
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 <sabouhallawa@apple.com>
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<EdgeModeType>::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<SVGPathSegListValues>::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<SVGPointListValues>::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<SVGStringListValues>::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<SVGZoomAndPanType>::initialValue):
(WebCore::SVGPropertyTraits<SVGZoomAndPanType>::toString):
(WebCore::SVGPropertyTraits<SVGZoomAndPanType>::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 <achristensen@webkit.org>
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 <ryanhaddad@apple.com>
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 <achristensen@webkit.org>
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<BlendMode>::highestEnumValue):
(WebCore::SVGPropertyTraits<BlendMode>::toString):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::nativeImage):
(WebCore::SVGImage::drawPatternForContainer):
(WebCore::SVGImage::draw):
2018-08-06 Aditya Keerthi <akeerthi@apple.com>
[iOS] Indeterminate checkboxes appear unchecked
https://bugs.webkit.org/show_bug.cgi?id=160484
<rdar://problem/31143185>
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 <rniwa@webkit.org>
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 <cturner@igalia.com>
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 <fwang@igalia.com>
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 <cmath> 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 <zdobersek@igalia.com>
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 <zdobersek@igalia.com>
[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 <zdobersek@igalia.com>
[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 <cadubentzen@gmail.com>
[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 <utatane.tea@gmail.com>
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 <rbuis@igalia.com>
[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 <utatane.tea@gmail.com>
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 <rniwa@webkit.org>
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 <zalan@apple.com>
[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 <Ms2ger@igalia.com>
[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 <pnormand@igalia.com>
[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 <simon.fraser@apple.com>
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 <rniwa@webkit.org>
Properties set on window.customElements can disappear due to GC
https://bugs.webkit.org/show_bug.cgi?id=172575
<rdar://problem/32440668>
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 <rniwa@webkit.org>
innerHTML should not synchronously create a custom element
https://bugs.webkit.org/show_bug.cgi?id=188327
<rdar://problem/42923114>
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 <benton_richards@apple.com>
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 <justin_fan@apple.com>
WebGL 2 conformance: vertex_arrays/vertex_array_object.html
https://bugs.webkit.org/show_bug.cgi?id=188291
<rdar://problem/42792709>
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 <sam@webkit.org>
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<WebGPURenderingContext> 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<WebGPUBuffer>. 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<WebGPUCommandBuffer>. 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<WebGPUCommandQueue>. 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<WebGPUComputeCommandEncoder>. 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<WebGPUComputePipelineState>. 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<WebGPUDepthStencilDescriptor>. 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<WebGPUDepthStencilState>. 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<WebGPUDrawable>. 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<WebGPUFunction>. 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<WebGPULibrary>. 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<WebGPURenderCommandEncoder>. 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<WebGPURenderPassAttachmentDescriptor>. 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<WebGPURenderPassDescriptor>. 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<WebGPURenderPipelineColorAttachmentDescriptor>. 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<WebGPURenderPipelineDescriptor>. 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<WebGPURenderPipelineState>. 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<WebGPUTexture>. 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<WebGPUTextureDescriptor>. Since this de-virtualizes it, also add
ImplementationLacksVTable to the IDL file.
2018-08-03 Alex Christensen <achristensen@webkit.org>
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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <aestes@apple.com>
ContentFilterUnblockHandler's constructors access moved-from variables
https://bugs.webkit.org/show_bug.cgi?id=188308
<rdar://problem/42882758>
Reviewed by Alex Christensen.
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2018-08-03 Zalan Bujtas <zalan@apple.com>
[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 <zalan@apple.com>
[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 <cgarcia@igalia.com>
[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 <rniwa@webkit.org>
Release assert when throwing exceptions in custom element reactions
https://bugs.webkit.org/show_bug.cgi?id=187805
<rdar://problem/42432714>
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 <zalan@apple.com>
[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 <zalan@apple.com>
[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 <jer.noble@apple.com>
Control center controls disappear when pausing, locking device.
https://bugs.webkit.org/show_bug.cgi?id=188282
<rdar://problem/42497809>
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 <video>, even though that
was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote.
To solve the new issue, make our audio session category policy more explicit: once we are in
MediaPlayback category, we will remain so as long as the media element in queston stays
loaded, has played, and is never interrupted by the system.
Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make
MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new
m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes
to Playing, and cleared during an interruption. Check this flag when deciding what audio
sessino category to set in MediaSessionManagerCocoa.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::setState):
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const):
(WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateSessionState): Deleted.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::audioHardwareListener):
(WebCore::PlatformMediaSessionManager::updateSessionState):
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(PlatformMediaSessionManager::updateSessionState): Deleted.
* platform/audio/cocoa/MediaSessionManagerCocoa.h: Added.
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
2018-08-02 Nan Wang <n_wang@apple.com>
AX: [iOS] add support to return the attributed string under the element
https://bugs.webkit.org/show_bug.cgi?id=188276
<rdar://problem/42872357>
Reviewed by Chris Fleizach.
Provided a way on iOS to return the attributed string under the element for
better performance.
Test: accessibility/ios-simulator/attributed-string-for-element.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _stringFromStartMarker:toEndMarker:attributed:]):
(-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
(-[WebAccessibilityObjectWrapper attributedStringForElement]):
2018-08-02 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Remove redundant LayoutContext member variable.
https://bugs.webkit.org/show_bug.cgi?id=188286
Reviewed by Simon Fraser.
* layout/FloatingContext.cpp:
(WebCore::Layout::begin):
(WebCore::Layout::end):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::FloatingPair):
(WebCore::Layout::Iterator::Iterator):
2018-08-02 Ryosuke Niwa <rniwa@webkit.org>
Move queue processing logic from CustomElementReactionStack to CustomElementReactionQueue
https://bugs.webkit.org/show_bug.cgi?id=188277
Reviewed by Wenson Hsieh.
Moved ensureCurrentQueue, processBackupQueue, ElementQueue, ensureBackupQueue, and backupElementQueue
from CustomElementReactionStack to CustomElementReactionQueue to simplify CustomElementReactionStack.
No new tests since there is no behavior change.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::ElementQueue::add): Moved from CustomElementReactionStack.
(WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Ditto.
(WebCore::CustomElementReactionQueue::ensureCurrentQueue): Ditto.
(WebCore::CustomElementReactionQueue::ensureBackupQueue): Ditto.
(WebCore::CustomElementReactionQueue::processBackupQueue): Ditto.
(WebCore::CustomElementReactionQueue::backupElementQueue): Ditto.
* dom/CustomElementReactionQueue.h:
(WebCore::CustomElementReactionStack::hasCurrentProcessingStack): Deleted. It was never called.
2018-08-02 Timothy Hatcher <timothy@apple.com>
Text selection color is hard to see in dark mode web views.
https://bugs.webkit.org/show_bug.cgi?id=188260
rdar://problem/42721294
Reviewed by Simon Fraser.
Stop using blendWithWhite() to transform the AppKit selection color in dark mode.
Using an alpha of 80% gives good contrast, and still works good for selections over images.
* platform/graphics/Color.cpp:
(WebCore::Color::blendWithWhite const): Mark new colors as semantic if the original is.
(WebCore::Color::colorWithAlpha const): Ditto.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionBackgroundColor const): Use transformSelectionBackgroundColor.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeSelectionBackgroundColor const): Use transformSelectionBackgroundColor.
(WebCore::RenderTheme::inactiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderTheme::transformSelectionBackgroundColor const): Added. Just blend with white.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Added. Use an alpha with the color
in dark mode, otherwise fallback to RenderTheme.
(WebCore::RenderThemeMac::systemColor const): Use activeListBoxSelectionBackgroundColor()
and activeSelectionBackgroundColor() instead of caching the colors again. Update hardcoded color.
2018-08-02 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Use displayBox.rectWithMargin().bottom instead of displayBox.bottom() to where applicable.
https://bugs.webkit.org/show_bug.cgi?id=188274
Reviewed by Antti Koivisto.
Float placement uses the margin box.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingPair::bottom const):
(WebCore::Layout::Iterator::operator++):
(WebCore::Layout::Iterator::set):
2018-08-02 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Right aligned float's horizontal candidate position is miscomputed.
https://bugs.webkit.org/show_bug.cgi?id=188273
Reviewed by Antti Koivisto.
rightAlignedBoxLeft is already shifted with the size of the margin box.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::alignWithFloatings const):
2018-08-02 Zalan Bujtas <zalan@apple.com>
[LFC] Display:Box::rectWithMargin()'s width and height don't include margin left/top.
https://bugs.webkit.org/show_bug.cgi?id=188272
Reviewed by Antti Koivisto.
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rectWithMargin const):
2018-08-02 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Containing block of a float could push the candidate position beyond the current float.
https://bugs.webkit.org/show_bug.cgi?id=188264
Reviewed by Antti Koivisto.
<div id=first style="float: left; width: 100px; height: 10px;"></div>
<div id=second style="float: left; width: 10px; height: 10px;"></div>
<div style="width: 50px; height: 50px;>
<div id=third style="float: left; width: 10px; height: 10px;"></div>
</div>
In the example above by the time the "third" float comes in, we are already at 110px horizontally. However the containing block of the "third" float forces
the candidate position at 0px. In such cases intersecting won't work since the candidate position is beyond the last(second) float (horizontally).
We could either keep going back to the previous floats on this vertical position and eventually intersect with "first" or just compare the horizontal
positions and ensure that the left/right float is not going to be placed to the left/right of the last float on the current vertical position.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingPair::intersects const):
2018-08-01 Ryosuke Niwa <rniwa@webkit.org>
Implement customElements.upgrade()
https://bugs.webkit.org/show_bug.cgi?id=183397
Reviewed by Frédéric Wang.
Added the support to upgrade custom elements directly. Ordinarily, custom elements get upgraded as they are
inserted / connected into a document but some script libraries and authors want to be able to upgrade them before that.
Also see https://github.com/w3c/webcomponents/issues/710
Implemented the method as specified at:
https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-upgrade
When invoked, the upgrade(root) method must run these steps:
1. Let candidates be a list of all of root's shadow-including inclusive descendant elements,
in shadow-including tree order.
2. For each candidate of candidates, try to upgrade candidate.
Tests: imported/w3c/web-platform-tests/custom-elements/custom-element-registry/upgrade.html
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Removed the assertion that the upgraded element
is connected since the whole point of this API is to upgrade a disconnected element.
* dom/CustomElementRegistry.cpp:
(WebCore::upgradeElementsInShadowIncludingdescendants): Added.
(WebCore::CustomElementRegistry::upgrade): Added.
* dom/CustomElementRegistry.h: Forward declare DeferredPromise instead of unnecessarily including JSDOMPromiseDeferred.h.
* dom/CustomElementRegistry.idl:
* dom/Element.cpp:
(WebCore::Element::insertedIntoAncestor): Moved the assertion here.
2018-08-02 Simon Fraser <simon.fraser@apple.com>
Convert calc-related enums to 8-bit enum classes
https://bugs.webkit.org/show_bug.cgi?id=188215
Reviewed by Zalan Bujtas.
This shrinks CSSCalcOperation from 48 to 32 bytes.
* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::determineCategory):
(WebCore::resolvedTypeForMinOrMax):
(WebCore::isIntegerResult):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
(WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
(WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
(WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
(WebCore::createBlendHalf):
(WebCore::createCSS):
* css/CSSCalculationValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::primitiveType const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumberRaw):
(WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
(WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeTime):
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionNumber::operator== const):
(WebCore::CalcExpressionOperation::evaluate const):
(WebCore::CalcExpressionOperation::operator== const):
(WebCore::CalcExpressionOperation::dump const):
(WebCore::CalcExpressionLength::operator== const):
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
(WebCore::CalcExpressionBlendLength::operator== const):
(WebCore::operator<<):
* platform/CalculationValue.h:
(WebCore::CalcExpressionNumber::CalcExpressionNumber):
(WebCore::toCalcExpressionNumber):
(WebCore::CalcExpressionLength::CalcExpressionLength):
(WebCore::toCalcExpressionLength):
(WebCore::CalcExpressionOperation::CalcExpressionOperation):
(WebCore::toCalcExpressionOperation):
(WebCore::toCalcExpressionBlendLength):
* platform/Length.cpp:
(WebCore::convertTo100PercentMinusLength):
2018-08-02 Charlie Turner <cturner@igalia.com>
Handle zero-sized ISOMP4 boxes appropriately
https://bugs.webkit.org/show_bug.cgi?id=188256
Reviewed by Jer Noble.
According to ISO/IEC 14496-12:2012(E), when the Box classes' size
field is zero, the implied size of the box extends to the end of
the file. If this detail is not taken into account, CENC
sanitization can incorrectly report an invalid box size, since 0
!= the number of bytes in this box, specifically, the data layout
of Box is as follows,
aligned(8) class Box (unsigned int(32) boxtype,
optional unsigned int(8)[16] extended_type) {
unsigned int(32) size;
unsigned int(32) type = boxtype;
if (size==1) {
unsigned int(64) largesize;
} else if (size==0) { // This is the case now handled.
// box extends to end of file
}
if (boxtype==uuid) {
unsigned int(8)[16] usertype = extended_type;
}
}
Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
* platform/graphics/iso/ISOBox.cpp:
(WebCore::ISOBox::peekBox): Check if the parsed size is zero, and
if it is, the size is calculated as the total number of bytes in
the incoming DataView.
(WebCore::ISOBox::parse): Ditto.
2018-08-01 Dan Bernstein <mitz@apple.com>
Optionally expose Attr::style to JavaScript
https://bugs.webkit.org/show_bug.cgi?id=188226
<rdar://problem/42818113>
Reviewed by Darin Adler.
Test: TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm
* dom/Attr.cpp: Update comment.
* dom/Attr.idl: Define the style attribute, enabled at runtime by the AttrStyle feature.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAttrStyleEnabled): Added this accessor.
(WebCore::RuntimeEnabledFeatures::attrStyleEnabled const): Ditto.
2018-08-02 David Fenton <david_fenton@apple.com>
Unreviewed, rolling out r234489.
Caused 50+ crashes and 60+ API failures on iOS
Reverted changeset:
"[WTF] Rename String::format to String::deprecatedFormat"
https://bugs.webkit.org/show_bug.cgi?id=188191
https://trac.webkit.org/changeset/234489
2018-08-02 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Do not pass formatting root to FloatingContext
https://bugs.webkit.org/show_bug.cgi?id=188257
Reviewed by Antti Koivisto.
If we ever need it, we can get it from FloatingState.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::FloatingContext):
* layout/FloatingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
2018-08-01 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Convert all coordinates relative to the formatting context root.
https://bugs.webkit.org/show_bug.cgi?id=188249
Reviewed by Antti Koivisto.
The idea here is that all the float related computation should be happening in the same coordinate system.
FloatItem holds the transformed Display::Box for both the layout box and its containing block.
* layout/FloatingContext.cpp:
(WebCore::Layout::begin):
(WebCore::Layout::end):
(WebCore::Layout::FloatingContext::computePosition 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::Iterator::Iterator):
(WebCore::Layout::previousFloatingIndex):
(WebCore::Layout::Iterator::operator++):
(WebCore::Layout::Iterator::set):
* layout/FloatingContext.h:
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatItem::FloatItem):
(WebCore::Layout::FloatingState::remove):
(WebCore::Layout::FloatingState::append):
* layout/FloatingState.h:
(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::root const):
(WebCore::Layout::FloatingState::floatings const): Deleted.
* layout/displaytree/DisplayBox.h:
2018-08-02 Charlie Turner <cturner@igalia.com>
[GStreamer] Dynamically adjust blocksize
https://bugs.webkit.org/show_bug.cgi?id=188194
Reviewed by Xabier Rodriguez-Calvar.
Update the blocksize depending on how much is obtained from a read
of the input stream. This avoids doing too many reads in small
chunks when larger amounts of data are available and also prevents
using a very large memory area to read a small chunk of data.
Adapted from https://bugzilla.gnome.org/show_bug.cgi?id=767833
No tests new tests since no change in functionality.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(CachedResourceStreamingClient::checkUpdateBlocksize):
(CachedResourceStreamingClient::dataReceived):
2018-08-02 Charlie Turner <cturner@igalia.com>
[GStreamer] Stop pushing buffers when seeking status changes
https://bugs.webkit.org/show_bug.cgi?id=188193
Reviewed by Xabier Rodriguez-Calvar.
After switching to splitting buffers into smaller block sizes in
https://bugs.webkit.org/show_bug.cgi?id=182829
It was found that during the individual buffer pushes, the seeking
status could change behind our backs from another thread. When
this happens, buffers from incorrect offsets would find their way
into appsrc and eventually the demuxer itself, which would start
parsing from a random place and at best give a confusing error
message.
The solution here is break from pushing buffers when the seeking
status has been has changed. Flushes will clear out what we've
already delivered into the appsrc, then we must make sure to not
continue sending buffers in there after the flush.
No new tests since this is a timing bug.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::dataReceived):
2018-08-01 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, revert TransformationMatrix::operator== change
https://bugs.webkit.org/show_bug.cgi?id=188197
This change partially revert cleaning up of TransformationMatrix since memcmp does not
follow double comparison algorithm. So semantics was accidentally changed.
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::operator== const):
2018-08-01 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, rename TransformationMatrix::Identity to TransformationMatrix::identity
https://bugs.webkit.org/show_bug.cgi?id=188204
Follow the coding style.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::transform const):
(WebCore::GraphicsLayer::childrenTransform const):
* platform/graphics/transforms/TransformationMatrix.cpp:
* platform/graphics/transforms/TransformationMatrix.h:
2018-08-01 Yusuke Suzuki <utatane.tea@gmail.com>
Add self.queueMicrotask(f) on DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=188212
Reviewed by Ryosuke Niwa.
This patch adds self.queueMicrotask(f) in DOMWindow, which takes a function and enqueue it into microtask queue.
We do not add this to Worker's global scope since our worker does not support microtasks correctly.
Tests: js/dom/queue-microtask-window.html
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::queueMicrotask):
Post a microtask to JSC's microtask mechanism. This will eventually go to WebCore's MicrotaskQueue code.
* page/DOMWindow.idl:
2018-08-01 Tomas Popela <tpopela@redhat.com>
[WTF] Rename String::format to String::deprecatedFormat
https://bugs.webkit.org/show_bug.cgi?id=188191
Reviewed by Darin Adler.
It should be replaced with string concatenation.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString const):
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString const):
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString const):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const):
(WebCore::IDBIndexInfo::condensedLoggingString const):
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString const):
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString const):
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString const):
* Modules/webdatabase/Database.cpp:
(WebCore::formatErrorMessage):
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create):
* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString):
* accessibility/win/AccessibilityObjectWrapperWin.cpp:
(WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
* css/CSSUnicodeRangeValue.cpp:
(WebCore::CSSUnicodeRangeValue::customCSSText const):
* css/MediaQueryEvaluator.cpp:
(WebCore::aspectRatioValueAsString):
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseHexColor):
* dom/Document.cpp:
(WebCore::Document::lastModified):
* html/FTPDirectoryDocument.cpp:
(WebCore::processFilesizeString):
(WebCore::processFileDateString):
* html/HTMLMediaElement.h:
(WTF::ValueToString<WebCore::TextTrackCue::string):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setLength):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageUpdated):
* html/canvas/WebGLRenderingContextBase.cpp:
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
(WebCore::InspectorFrontendClientLocal::setAttachedWindow):
(WebCore::InspectorFrontendClientLocal::setDebuggingEnabled):
(WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled):
(WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
* inspector/agents/InspectorCSSAgent.cpp:
* inspector/agents/InspectorIndexedDBAgent.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/MemoryRelease.cpp:
(WebCore::logMemoryStatisticsAtTimeOfDeath):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::formatByteNumber):
(WebCore::gcTimerString):
(WebCore::ResourceUsageOverlay::platformDraw):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::logFootprintComparison):
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString):
(WebCore::formatByteNumber):
(WebCore::gcTimerString):
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::snapOffsetsToString):
(WebCore::snapOffsetRangesToString):
(WebCore::snapPortOrAreaToString):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const):
(WebCore::DateComponents::toString const):
* platform/LocalizedStrings.cpp:
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const):
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyIdentifierForCharCode):
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::HIDGamepad):
* platform/glib/UserAgentGLib.cpp:
(WebCore::platformVersionForUAString):
* platform/graphics/Color.cpp:
(WebCore::Color::nameForRenderTreeAsText const):
* platform/graphics/FloatPolygon.h:
(WTF::ValueToString<WebCore::FloatPolygonEdge::string):
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::id const):
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName):
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateContentsImage):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::simpleBusMessageCallback):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::handleStateChangeMessage):
(WebCore::AppendPipeline::resetPipeline):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcAddPad):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::makeElement):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* platform/network/ParsedContentRange.cpp:
(WebCore::ParsedContentRange::headerValue const):
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::unauthorizedSQLFunction):
* platform/text/PlatformLocale.cpp:
(WebCore::DateTimeStringBuilder::visitField):
* platform/win/GDIObjectCounter.cpp:
(WebCore::GDIObjectCounter::GDIObjectCounter):
* platform/win/KeyEventWin.cpp:
(WebCore::keyIdentifierForWindowsKeyCode):
* rendering/FloatingObjects.h:
(WTF::ValueToString<WebCore::FloatingObject::string):
* rendering/RenderFragmentedFlow.h:
(WTF::ValueToString<WebCore::RenderFragmentContainer::string):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const):
* testing/Internals.cpp:
(WebCore::Internals::address):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::ensureValidRecordsTable):
(WebCore::RegistrationDatabase::importRecords):
2018-08-01 Alex Christensen <achristensen@webkit.org>
Move all calls to ResourceLoader::start to WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=184946
Reviewed by Andy Estes.
This is in preparation for moving ResourceLoader::start to WebKitLegacy along with all ResourceHandle code.
I move the code that moves m_deferredRequest into m_request into WebKitLegacy, which won't change behavior for
modern WebKit because modern WebKit never calls ResourceLoader::start, the only place where m_deferredRequest
is ever set. This won't change behavior for WebKitLegacy because the same operations happen in the same order.
* loader/LoaderStrategy.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::setDefersLoading):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::setRequest):
(WebCore::ResourceLoader::deferredRequest const):
(WebCore::ResourceLoader::takeDeferredRequest):
2018-08-01 Nan Wang <n_wang@apple.com>
AX: AOM: Add ARIA IDL Attribute Reflection
https://bugs.webkit.org/show_bug.cgi?id=184676
<rdar://problem/39476882>
Reviewed by Chris Fleizach.
Test: accessibility/ARIA-reflection.html
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityRole.idl: Added.
* accessibility/AriaAttributes.idl: Added.
* dom/Element.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled):
(WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const):
2018-08-01 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Revert back to only one list for the all the floatings.
https://bugs.webkit.org/show_bug.cgi?id=188232
Reviewed by Antti Koivisto.
If the combined floating list turns out to be a performance bottleneck, we can still split it into left and right. However at this point
having 2 dedicated lists just makes the implementation more complicated.
* layout/FloatingContext.cpp:
(WebCore::Layout::begin):
(WebCore::Layout::end):
(WebCore::Layout::FloatingPair::FloatingPair):
(WebCore::Layout::FloatingPair::left const):
(WebCore::Layout::FloatingPair::right const):
(WebCore::Layout::Iterator::Iterator):
(WebCore::Layout::previousFloatingIndex):
(WebCore::Layout::Iterator::operator++):
(WebCore::Layout::Iterator::set):
(WebCore::Layout::floatingDisplayBox): Deleted.
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::remove):
(WebCore::Layout::FloatingState::append):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::isEmpty const):
(WebCore::Layout::FloatingState::floatings const):
(WebCore::Layout::FloatingState::last const):
2018-08-01 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Change synchronous request logic using MessageQueue to match with Mac port.
https://bugs.webkit.org/show_bug.cgi?id=188206
Reviewed by Alex Christensen.
Port synchronous request logic from ResourceHandleMac to use MessageQueue for
client callback invocation. This makes simplify the logic of CurlRequest because
now every requests are handled in Curl thread and there's no difference between
sync and async requests.
Test: Covered by these tests:
- http\tests\xmlhttprequest\simple-sync.html
- http\tests\xmlhttprequest\xmlhttprequest-unsafe-redirect.html
* platform/network/ResourceHandleInternal.h:
* platform/network/curl/CurlRequest.cpp: Remove synchronous request logics.
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::invalidateClient):
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::runOnMainThread): Added message queue handling.
(WebCore::CurlRequest::runOnWorkerThreadIfRequired):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::completeDidReceiveResponse):
(WebCore::CurlRequest::updateHandlePauseState):
(WebCore::CurlRequest::isHandlePaused const):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
(WebCore::CurlRequest::resourceRequest const):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::continueAfterDidReceiveResponse):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
(WebCore::ResourceHandle::handleDataURL):
2018-08-01 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Use margin box consistently while placing a floating.
https://bugs.webkit.org/show_bug.cgi?id=188222
Reviewed by Antti Koivisto.
The floating box fits when its margin box fits.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::computePosition const):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingContext::initialVerticalPosition const):
(WebCore::Layout::FloatingContext::alignWithContainingBlock const):
(WebCore::Layout::FloatingContext::alignWithFloatings const):
(WebCore::Layout::FloatingPair::intersects const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rectWithMargin const):
2018-08-01 Zalan Bujtas <zalan@apple.com>
[LFC] Add FormattingContext::mapToAncestor geometry mapping function
https://bugs.webkit.org/show_bug.cgi?id=188188
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapToAncestor):
* layout/FormattingContext.h:
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::clone const):
* layout/displaytree/DisplayBox.h:
2018-08-01 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Bugfix on ResourceHandle::cancel()
https://bugs.webkit.org/show_bug.cgi?id=188234
Reviewed by Darin Adler.
Trivial bug. The actual request was not cancelled correctly.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::cancel):
2018-08-01 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] FloatingState should take the formatting root box.
https://bugs.webkit.org/show_bug.cgi?id=188214
Reviewed by Antti Koivisto.
This will be taken into use when FormattingContext takes all boxes in the coordinate system of the formatting root.
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::belongsToThisFloatingContext):
(WebCore::Layout::FloatingState::append):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::create):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::establishedFormattingState):
2018-08-01 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Align new floating with the bottom of the existing floatings.
https://bugs.webkit.org/show_bug.cgi?id=188213
Reviewed by Antti Koivisto.
When the incoming floating does not fit at all, align its top with the bottom of the existing floatings.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::bottom const):
2018-08-01 Eric Carlson <eric.carlson@apple.com>
Always use MediaPlayback audio category when playing to AppleTV
https://bugs.webkit.org/show_bug.cgi?id=188230
<rdar://problem/42497809>
Reviewed by Jer Noble.
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().
2018-08-01 Timothy Hatcher <timothy@apple.com>
Hardcode some system colors to avoid fingerprinting exposure.
https://bugs.webkit.org/show_bug.cgi?id=188203
rdar://problem/42781630
Reviewed by Tim Horton.
Passes existing tests with the hardcoded blue system appearance.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
Adds special handling for some system colors. Fixes -apple-system-selected-text-background
to match the real selection color by using blendWithWhite().
2018-08-01 Eric Carlson <eric.carlson@apple.com>
[iOS] Remove the delay before setting audio session category added in r233535
https://bugs.webkit.org/show_bug.cgi?id=188225
Reviewed by Jer Noble.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
(WebCore::PlatformMediaSessionManager::addSession): Ditto.
(WebCore::PlatformMediaSessionManager::removeSession): Ditto.
(WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
(WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
(WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
(WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
(WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):
(PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateClipRects):
2018-08-01 Yusuke Suzuki <utatane.tea@gmail.com>
Add TransformationMatrix::Identity
https://bugs.webkit.org/show_bug.cgi?id=188204
Reviewed by Simon Fraser.
This patch adds TransformationMatrix::Identity, which is a static const variable holding an identity matrix.
No behavior change.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::transform const):
(WebCore::GraphicsLayer::childrenTransform const):
(): Deleted.
* platform/graphics/transforms/TransformationMatrix.cpp:
* platform/graphics/transforms/TransformationMatrix.h:
2018-08-01 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Make sure that first buffer running time is 0 in GStreamerMediaStreamSource
https://bugs.webkit.org/show_bug.cgi?id=188210
This is a live source and the first frame is the beginning of the stream,
but that doesn't mean that the incoming stream from the camera didn't start
before. We need to set a pad offset on each srcpad of the source to compensate
for that. This is the exact same logic as in webrtc GStreamerVideo/Enc/Dec/oder.
Reviewed by Alejandro G. Castro.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkit_media_stream_src_init):
(WebCore::webkitMediaStreamSrcPushVideoSample):
(WebCore::webkitMediaStreamSrcPushAudioSample):
2018-08-01 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Move CoordinatedBackingStore to WebCore
https://bugs.webkit.org/show_bug.cgi?id=188158
Reviewed by Carlos Garcia Campos.
Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
dependency on anything in the WebKit layer, and it's more suitable to
future needs to keep it in the WebCore layer.
* platform/TextureMapper.cmake:
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
(WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
(WebCore::CoordinatedBackingStore::rect const):
2018-07-31 Myles C. Maxfield <mmaxfield@apple.com>
[WIN] Fix tests for text with initial advances
https://bugs.webkit.org/show_bug.cgi?id=188099
Reviewed by Darin Adler.
Fixup after r234318.
Tests: fast/text/complex-first-glyph-with-initial-advance.html
fast/text/initial-advance-in-intermediate-run-complex.html
* platform/graphics/ComplexTextController.cpp:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawGlyphBuffer const):
2018-07-31 Alex Christensen <achristensen@webkit.org>
REGRESSION (r231107): MoviStar+ launches to a blank black screen
https://bugs.webkit.org/show_bug.cgi?id=188139
Reviewed by Brent Fulgham.
For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
r231107 increased our fetch spec conformance, which we intend to keep. This makes a low-risk
targeted fix that will fix the affected app until they update.
I manually verified this fixes the app.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::applicationSDKVersionOverride):
(WebCore::setApplicationSDKVersion):
(WebCore::applicationSDKVersion):
(WebCore::IOSApplication::isMoviStarPlus):
2018-07-31 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Addressing post-review comments on r234158
https://bugs.webkit.org/show_bug.cgi?id=188202
Reviewed by Darin Adler.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::lastResortFallbackFont):
2018-07-31 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
https://bugs.webkit.org/show_bug.cgi?id=188109
<rdar://problem/42664391>
Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.
Tests: http/tests/resourceLoadStatistics/cookie-deletion.html
http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-user-interaction.html
http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-pop-window.html
http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe.html
http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-but-access-from-wrong-frame.html
http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe.html
http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html
This patch removes cookie partitioning which reduces the model to just
blocked cookies (in third-party contexts) and first-party cookie access.
Several of the changes are renaming to reflect that there are no more
cookie partitions. However, the compile-time check remains for now since
this change is not ready to ship.
The test cases mentioned about are not new. They are just renamed to
reflect the code changes and to shorten their names (as requested by
non-Cocoa platforms).
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
Removed the use of isMarkedForCookiePartitioning.
* loader/ResourceLoadStatistics.h:
Removed isMarkedForCookiePartitioning.
* platform/network/NetworkStorageSession.h:
* platform/network/ResourceHandle.h:
Renamed applySniffingPoliciesAndStoragePartitionIfNeeded() to
applySniffingPoliciesIfNeeded().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::getPartitioningDomain):
(WebCore::NetworkStorageSession::shouldBlockCookies const):
Now takes a frame ID and a page ID to be able to support
the Storage Access API. This was previously handled by
shouldPartitionCookies() which is now deleted.
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
Renamed from setPrevalentDomainsToPartitionOrBlockCookies().
(WebCore::NetworkStorageSession::removePrevalentDomains):
No longer needs to clear the member variable for partitioned cookie domains.
(WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Deleted.
(WebCore::NetworkStorageSession::cookieStoragePartition const): Deleted.
(WebCore::NetworkStorageSession::shouldPartitionCookies const): Deleted.
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Deleted.
Renamed to setPrevalentDomainsToBlockCookiesFor().
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesForURL):
Now calls session.shouldBlockCookies() instead of the
wrapper cookiesAreBlockedForURL().
(WebCore::setCookiesFromDOM):
No longer checks for partition.
(WebCore::applyPartitionToCookies): Deleted.
(WebCore::cookiesAreBlockedForURL): Deleted.
This was just a wrapper for session.shouldBlockCookies().
(WebCore::cookiesInPartitionForURL): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
Renamed from applySniffingPoliciesAndStoragePartitionIfNeeded().
(WebCore::ResourceHandle::createNSURLConnection):
Consequence of function name change.
(WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Deleted.
Renamed to applySniffingPoliciesIfNeeded().
2018-07-31 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
https://bugs.webkit.org/show_bug.cgi?id=188107
<rdar://problem/42354250>
Reviewed by Tim Horton.
After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
which allows the page to handle click events inside editable content. However, this means that codepaths in
EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
mechanism for modifying the selection on iOS.
To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
content that is already selected.
Test: fast/forms/ios/click-should-not-suppress-misspelling.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):
2018-07-31 Yusuke Suzuki <utatane.tea@gmail.com>
Clean up TransformationMatrix implementation
https://bugs.webkit.org/show_bug.cgi?id=188197
Reviewed by Simon Fraser.
We perform cleaning up of TransformationMatrix.
1. We drop user-defined operator= and copy constructor. Default ones works well for TransformationMatrix.
2. Remove unused setMatrix. We explicitly use memcpy in TransformationMatrix.cpp (only one place).
3. Use memcmp for implementing operator==.
In (2) and (3), we use `memcpy(&matrix[0][0], &tmp[0][0], sizeof(Matrix4))` instead of `memcpy(matrix, tmp, sizeof(Matrix4))`,
since they both are non nullptr and the former is easier to understand.
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::multiply):
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::setMatrix):
(WebCore::TransformationMatrix::operator== const):
(WebCore::TransformationMatrix::operator =): Deleted.
2018-07-31 Timothy Hatcher <timothy@apple.com>
Don't call RenderTheme::platformColorsDidChange() during printing.
https://bugs.webkit.org/show_bug.cgi?id=188181
rdar://problem/42360070
Reviewed by Tim Horton.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
* page/FrameView.cpp:
(WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().
2018-07-31 Yusuke Suzuki <utatane.tea@gmail.com>
Use static const global variable for TransformationMatrix instead of NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=188195
Reviewed by Darin Adler.
Since TransformationMatrix does not have a non-trivial destructor, we can put it
as static const global variable if its constructor is constexpr. This patch makes
some of constructors constexpr and makes identityTransform static const global variable
instead of NeverDestroyed<> + static function. This removes unnecessary static function
and lazy initialization.
No behavior change.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::transform const):
(WebCore::GraphicsLayer::childrenTransform const):
(WebCore::identityTransform): Deleted.
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::TransformationMatrix):
2018-07-31 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Add basic left/right floating positioning.
https://bugs.webkit.org/show_bug.cgi?id=188148
Reviewed by Antti Koivisto.
This patch implements simple floating positioning.
(Floatings with different containing blocks do not work yet.)
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingPair::isEmpty const):
(WebCore::Layout::Iterator::current const):
(WebCore::Layout::Iterator::verticalPosition const):
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::computePosition const):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingContext::initialVerticalPosition const):
(WebCore::Layout::FloatingContext::alignWithContainingBlock const):
(WebCore::Layout::FloatingContext::alignWithFloatings const):
(WebCore::Layout::floatingDisplayBox):
(WebCore::Layout::FloatingPair::FloatingPair):
(WebCore::Layout::FloatingPair::left const):
(WebCore::Layout::FloatingPair::right const):
(WebCore::Layout::FloatingPair::intersects const):
(WebCore::Layout::Iterator::Iterator):
(WebCore::Layout::Iterator::operator++):
(WebCore::Layout::Iterator::set):
(WebCore::Layout::FloatingContext::computePosition): Deleted.
* layout/FloatingContext.h:
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::append):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::floatings const):
(WebCore::Layout::FloatingState::last const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Rect::Rect):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::Rect::intersects const):
(WebCore::Display::Box::rect const):
2018-07-31 Rob Buis <rbuis@igalia.com>
Remove ResourceResponse::cacheBodyKey API
https://bugs.webkit.org/show_bug.cgi?id=188192
Reviewed by Frédéric Wang.
Removed unused API.
No new tests needed since this API is not used.
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::encode const):
(WebCore::ResourceResponseBase::decode):
(WebCore::ResourceResponseBase::cacheBodyKey const): Deleted.
(WebCore::ResourceResponseBase::setCacheBodyKey): Deleted.
2018-07-30 Simon Fraser <simon.fraser@apple.com>
Shrink GraphicsLayerCA
https://bugs.webkit.org/show_bug.cgi?id=188141
Reviewed by Zalan Bujtas.
Shrink GraphicsLayerCA from 1040 to 880 bytes by:
* moving all the clone-related stuff into the lazily-allocated m_layerClones
* moving all the animation-related stuff into the lazily-allocated m_animations
* making enums be 8-bit
* re-ordering data members
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformInitialize):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::operator<<):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/WindRule.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::addProcessingActionForAnimation):
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
(WebCore::GraphicsLayerCA::setContentsToImage):
(WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
(WebCore::GraphicsLayerCA::contentsLayerForMedia const):
(WebCore::GraphicsLayerCA::layerDidDisplay):
(WebCore::layerTypeForCustomBackdropAppearance):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateGeometry):
(WebCore::GraphicsLayerCA::updateMasksToBounds):
(WebCore::GraphicsLayerCA::updateContentsVisibility):
(WebCore::GraphicsLayerCA::updateContentsOpaque):
(WebCore::GraphicsLayerCA::updateBackfaceVisibility):
(WebCore::GraphicsLayerCA::updateFilters):
(WebCore::GraphicsLayerCA::updateBackdropFilters):
(WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::updateDrawsContent):
(WebCore::GraphicsLayerCA::updateCoverage):
(WebCore::GraphicsLayerCA::updateDebugIndicators):
(WebCore::GraphicsLayerCA::updateContentsImage):
(WebCore::GraphicsLayerCA::updateContentsPlatformLayer):
(WebCore::GraphicsLayerCA::updateContentsColorLayer):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
(WebCore::GraphicsLayerCA::updateMaskLayer):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
(WebCore::GraphicsLayerCA::ensureLayerAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::animationIsRunning const):
(WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted.
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const):
* platform/graphics/ca/TileCoverageMap.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::PlatformCALayerCocoa):
(PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const):
(PlatformCALayerCocoa::updateCustomAppearance):
(PlatformCALayer::drawLayerContents):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCustomAppearance):
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2018-07-30 Justin Fan <justin_fan@apple.com>
[WebGL2] Support compilation of GLSL ES version 300 shaders
https://bugs.webkit.org/show_bug.cgi?id=187982
<rdar://problem/42564229>
Reviewed by Dean Jackson.
Test: fast/canvas/webgl/webgl2-glsl3-compile.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
* platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support.
(WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
2018-07-30 Justin Fan <justin_fan@apple.com>
Match GraphicsContext3D with correct virtual screen using registryID
https://bugs.webkit.org/show_bug.cgi?id=188072
<rdar://problem/42634940>
Reviewed by Dean Jackson.
Follow up to https://bugs.webkit.org/show_bug.cgi?id=187750. Rather than matching rendererIDs,
which can vary between processes, match GPU to display using registryID that is unique to a GPU,
which was added to CGL in MacOS 10.13.
No new tests. Manually tested on MacBookPro13,3 and iMacPro1,1 with Apple DisplayPort Cinema Display
and RX 580 external GPU.
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::setGPUByRegistryID):
(WebCore::setGPUByDisplayMask):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::screenDidChange):
(WebCore::identifyAndSetCurrentGPU): Deleted.
* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::primaryRegistryID):
(WebCore::registryIDForDisplay):
(WebCore::registryIDForDisplayMask):
(WebCore::rendererIDForDisplayMask): Deleted.
(WebCore::rendererIDForDisplay): Deleted.
(WebCore::primaryRendererID): Deleted.
2018-07-30 Rob Buis <rbuis@igalia.com>
Merge PlatformCookieJar functions into NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=188137
Reviewed by Alex Christensen.
No new tests -- no change in WebKit functionality.
* PlatformMac.cmake: Remove CookieJarMac.mm reference
* SourcesCocoa.txt: Remove CookieJarMac.mm reference
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp: Remove PlatformCookieJar.h reference.
* platform/Curl.cmake: Remove CookieJarCurl.cpp reference.
* platform/SourcesSoup.txt: Remove CookieJarSoup.cpp reference.
* platform/network/CacheValidation.cpp: Adapt callsites to use
NetworkStorageSession instead of CookieJar functions.
(WebCore::headerValueForVary):
* platform/network/NetworkStorageSession.h: Add PlatformCookieJar
functions.
* platform/network/PlatformCookieJar.h: Removed.
* platform/network/SocketStreamHandleImpl.cpp: Adapt callsites to
use NetworkStorageSession instead of CookieJar functions.
(WebCore::cookieDataForHandshake):
* platform/network/cf/CookieJarCFNet.cpp: Removed.
* platform/network/cf/NetworkStorageSessionCFNet.cpp: Move functions
from CookieJarCFNet.cpp.
(WebCore::cookieDomain):
(WebCore::canonicalCookieTime):
(WebCore::cookieCreatedTime):
(WebCore::cookieExpirationTime):
(WebCore::cookieName):
(WebCore::cookiePath):
(WebCore::cookieValue):
(WebCore::filterCookies):
(WebCore::copyCookiesForURLWithFirstPartyURL):
(WebCore::createCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::containsSecureCookies):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
(WebCore::NetworkStorageSession::cookiesEnabled const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::NetworkStorageSession::deleteCookie const):
(WebCore::NetworkStorageSession::getHostnamesWithCookies):
(WebCore::NetworkStorageSession::deleteAllCookies):
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
(WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm: Move functions
from CookieJarMac.mm.
(WebCore::httpCookies):
(WebCore::deleteHTTPCookie):
(WebCore::policyProperties):
(WebCore::cookiesForURL):
(WebCore::setHTTPCookiesForURL):
(WebCore::httpCookiesForURL):
(WebCore::filterCookies):
(WebCore::applyPartitionToCookies):
(WebCore::cookiesAreBlockedForURL):
(WebCore::cookiesInPartitionForURL):
(WebCore::cookiesForSession):
(WebCore::deleteAllHTTPCookies):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::httpCookieAcceptPolicy):
(WebCore::NetworkStorageSession::cookiesEnabled const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::NetworkStorageSession::deleteCookie const):
(WebCore::NetworkStorageSession::getHostnamesWithCookies):
(WebCore::NetworkStorageSession::deleteAllCookies):
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
(WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
* platform/network/curl/CookieJarCurl.cpp: Removed.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp: Merge functions
from CookieJarCurl.cpp.
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::cookiesEnabled const):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::deleteCookie const):
(WebCore::NetworkStorageSession::deleteAllCookies):
(WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
(WebCore::NetworkStorageSession::getHostnamesWithCookies):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
* platform/network/mac/CookieJarMac.mm: Removed.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
* platform/network/soup/CookieJarSoup.cpp: Removed.
* platform/network/soup/NetworkStorageSessionSoup.cpp: Merge functions
from CookieJarSoup.cpp.
(WebCore::NetworkStorageSession::cookiesEnabled const):
(WebCore::httpOnlyCookieExists):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::deleteCookie const):
(WebCore::NetworkStorageSession::deleteAllCookies):
(WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
(WebCore::NetworkStorageSession::getHostnamesWithCookies):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::cookiesForSession):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
2018-07-30 Chris Dumez <cdumez@apple.com>
Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
https://bugs.webkit.org/show_bug.cgi?id=187284
Unreviewed, roll r233496 and r233571 now that all known issues have been fixed via
dependency bugs.
Test: media/track/video-track-addition-and-frame-removal.html
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::suspend):
(WebCore::WebKitMediaKeySession::resume):
(WebCore::WebKitMediaKeySession::stop):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer):
(WebCore::MediaSource::suspend):
(WebCore::MediaSource::resume):
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::suspend):
(WebCore::SourceBuffer::resume):
(WebCore::SourceBuffer::stop):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::SourceBufferList):
(WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
(WebCore::SourceBufferList::suspend):
(WebCore::SourceBufferList::resume):
(WebCore::SourceBufferList::stop):
(WebCore::SourceBufferList::activeDOMObjectName const):
* Modules/mediasource/SourceBufferList.h:
* Modules/mediasource/SourceBufferList.idl:
* dom/Document.h:
(WebCore::Document::hasBrowsingContext const):
* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueue::dispatchOneEvent):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::prepareToPlay):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::sourceWasAdded):
* html/track/AudioTrackList.cpp:
(AudioTrackList::activeDOMObjectName const):
* html/track/AudioTrackList.h:
* html/track/AudioTrackList.idl:
* html/track/TextTrackList.cpp:
(TextTrackList::activeDOMObjectName const):
* html/track/TextTrackList.h:
* html/track/TextTrackList.idl:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::TrackListBase):
(WebCore::TrackListBase::canSuspendForDocumentSuspension const):
(WebCore::TrackListBase::suspend):
(WebCore::TrackListBase::resume):
(WebCore::TrackListBase::stop):
* html/track/TrackListBase.h:
* html/track/VideoTrackList.cpp:
(VideoTrackList::activeDOMObjectName const):
* html/track/VideoTrackList.h:
* html/track/VideoTrackList.idl:
2018-07-30 Chris Dumez <cdumez@apple.com>
Unreviewed internal build fix after r234347.
* html/StepRange.cpp:
(WebCore::StepRange::StepRange):
2018-07-29 Simon Fraser <simon.fraser@apple.com>
Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
https://bugs.webkit.org/show_bug.cgi?id=188143
Reviewed by Zalan Bujtas.
m_transform and m_childrenTransform are usually identity; save space by making
these unique_ptrs. The getters still return references by returning a reference
to a NeverDestroyed<TransformationMatrix> if necessary.
Shrinks GraphicsLayerCA from 840 to 640 bytes.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::identityTransform):
(WebCore::GraphicsLayer::transform const):
(WebCore::GraphicsLayer::setTransform):
(WebCore::GraphicsLayer::childrenTransform const):
(WebCore::GraphicsLayer::setChildrenTransform):
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::hasNonIdentityTransform const):
(WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
(WebCore::GraphicsLayer::transform const): Deleted.
(WebCore::GraphicsLayer::setTransform): Deleted.
(WebCore::GraphicsLayer::childrenTransform const): Deleted.
(WebCore::GraphicsLayer::setChildrenTransform): Deleted.
(WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setTransform):
(WebCore::GraphicsLayerCA::setChildrenTransform):
(WebCore::GraphicsLayerCA::layerTransform const):
(WebCore::GraphicsLayerCA::updateTransform):
(WebCore::GraphicsLayerCA::updateChildrenTransform):
(WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):
2018-07-30 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Make codecparsers optionnal
https://bugs.webkit.org/show_bug.cgi?id=188010
And avoid building libWebRTC if it won't be used. While there is no other
WebRTC backend, it makes no sense to expose an option.
Error out when WEBRTC or MEDIA_STREAM is enabled but GStreamer < 1.10
Reviewed by Alejandro G. Castro.
* platform/GStreamer.cmake:
2018-07-28 Darin Adler <darin@apple.com>
[Cocoa] Update more WebCore Objective-C code to be ARC compatible
https://bugs.webkit.org/show_bug.cgi?id=188140
Reviewed by Sam Weinig.
This make sure we don't put any Objective-C objects into HashMap/Set
data structures, which doesn't work under ARC at this time. We could
fix that some day, but it's pretty simple to change code not to rely
on it, for now, and not as simple to support it in HashMap/Set.
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
Use CFRetain/CFAutorelease instead of retain/autorelease.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap): Use CFStringRef in a HashMap rather than
NSString * for string constants.
(roleValueToNSString): Updated for above change.
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject stringRepresentation]): Updated since objectValue
is now CFTypeRef rather than NSObject *.
* bridge/objc/objc_instance.mm:
(ObjcInstance::create): Use CFTypeRef instead of id for the key types
in a HashMap.
(ObjcInstance::~ObjcInstance): Updated for the above change.
(ObjcInstance::invokeObjcMethod): Updated since objectValue is now
CFTypeRef.
(ObjcInstance::invokeDefaultMethod): Ditto.
(ObjcInstance::setValueOfUndefinedField): Ditto.
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcArray::setValueAt const): Ditto.
* bridge/objc/objc_utility.h: Use #pragma once. Use CFTypeRef instead
of NSObject * for objectValue, since it's in a union and ARC does not
support strong Objective-C object pointers in a union.
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertValueToObjcValue): Updated since objectValue is
now CFTypeRef.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_processElement): Use CFTypeRef rather than NSTextTable
for a HashMap.
(HTMLConverter::_exitElement): Ditto.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attributesForAttributedStringConversion): Use CFRetain rather
than -[NSObject retain] in a workaround for an overrelease.
* editing/mac/DictionaryLookup.h: Removed code to make this usable from
non-Objective-C source files. Use tuples rather than out arguments
for the results of the various functions.
* editing/mac/DictionaryLookup.mm:
(WebCore::DictionaryLookup::rangeForSelection): Return a tuple rather
than using an out argument for options.
(WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
(WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
(WebCore::showPopupOrCreateAnimationController): Removed use of typedef
PlatformAnimationController.
(WebCore::DictionaryLookup::animationControllerForPopup): Ditto.
* html/HTMLMediaElement.h: Put the videoFullscreenLayer function inside
an __OBJC__ ifdef since we can't do the type conversion without the
full Objective-C type.
* page/mac/EventHandlerMac.mm:
(WebCore::selfRetainingNSScrollViewScrollWheel): Use CFRetain/CFRelease
instead of retain/release.
(WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
Updated to use tuple return value from DictionaryLookup.
* page/scrolling/ScrollingStateNode.h: Replaced direct use of PlatformLayer*
in a union with use of a "typless" void* pointer and added helper functions
to convert in both directions.
* page/scrolling/cocoa/ScrollingStateNode.mm:
(WebCore::LayerRepresentation::retainPlatformLayer): Use CFRetain instead
of retain.
(WebCore::LayerRepresentation::releasePlatformLayer): Use CFRelease instead
of release.
(WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
(WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
* page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
(WebCore::LayerRepresentation::retainPlatformLayer): Updated argument type.
(WebCore::LayerRepresentation::releasePlatformLayer): Ditto.
(WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
(WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
* platform/gamepad/cocoa/GameControllerGamepadProvider.h: Use CFTypeRef
instad of GCController * for key type of HashMap.
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
(WebCore::GameControllerGamepadProvider::controllerDidConnect): Updated
for the above change.
(WebCore::GameControllerGamepadProvider::controllerDidDisconnect): Ditto.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
types under ARC.
(WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): Added checks
for the constants.
(WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): Ditto.
(WebCore::AVTrackPrivateAVFObjCImpl::label const): Ditto.
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
Use #pragma once and use CFTypeRef instead of AVMediaSelectionOption *
in the key to a HashMap.
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions): Updated for
the above change.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
types under ARC.
(WebCore::customSchemeURL): Removed unnecessary use of
NeverDestroyed<RetainPtr>. Can just use a straight pointer without calling
release, and that works with or without ARC.
(WebCore::imageDecoderAssetOptions): Ditto. Here, had to add a retain,
which we'll remove when we turn on ARC. Added canLoad checks, needed
because of SOFT_LINK_CONSTANT_MAY_FAIL.
(WebCore::ImageDecoderAVFObjC::firstEnabledTrack): Added canLoad check,
needed because of SOFT_LINK_CONSTANT_MAY_FAIL.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
Use CFTypeRef instead of AVAssetResourceLoadingRequest in HashMap.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
Updated for above.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
Use CFTypeRef instead of AVSampleBufferAudioRenderer in HashMap.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Updated for above.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.
* platform/graphics/metal/GPUDrawableMetal.mm: Updated include; under ARC, it's
not safe to call a method on a class without seeing its interface.
* platform/mac/VideoFullscreenInterfaceMac.mm: Added an explicit
__unsafe_unretained for a delegate. Could consider moving to weak, but for now
this preserves the current behavior and compiles under ARC.
* platform/mac/WebCoreFullScreenPlaceholderView.h: Use strong for the contents,
weak for the target, and changed the action to be hard-coded instead of an
arbitrary selector. If we find we need the flexibility again later, we can do
it with a block, which is more ARC-friendly than calling an arbitrary selector.
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
(-[WebCoreFullScreenPlaceholderView initWithFrame:]): Call function directly
instead of taking advantage of "using".
(-[WebCoreFullScreenPlaceholderView mouseDown:]): Call cancelOperation: on the
target rather than performing an arbitrary selector.
* platform/mac/WebCoreObjCExtras.mm:
(WebCoreObjCScheduleDeallocateOnMainThread): Use sel_registerName instead of
@selector, since @selector is not supported under ARC.
* platform/network/ResourceHandle.h: Use a return value rather than using an
inout argument in applySniffingPoliciesAndStoragePartitionIfNeeded.
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::startObserving): Removed unnecessary
assertion of repondsToSelector since we are about to dispatch it immediately
after. Call the selector in the conventional way instead of using performSelector.
* platform/network/cocoa/WebCoreNSURLSession.h: Use #pragma once and use
CFTypeRef instead of an Objective-C type. Also use an explicit __unsafe_unretained
for the session in the data task.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession dealloc]): Updated for the above.
(-[WebCoreNSURLSession taskCompleted:]): Ditto.
(-[WebCoreNSURLSession invalidateAndCancel]): Ditto.
(-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
(-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
(-[WebCoreNSURLSession dataTaskWithRequest:]): Ditto.
(-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
Use a return value instead of an inout argument. Also use bridging casts.
(WebCore::ResourceHandle::createNSURLConnection): Updated for the change above.
Also use a bridging cast.
(WebCore::ResourceHandle::schedule): Use a bridging cast.
(WebCore::ResourceHandle::unschedule): Ditto.
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::adjustMIMETypeIfNecessary): Use a bridging cast.
* testing/Internals.cpp:
(WebCore::Internals::rangeForDictionaryLookupAtLocation): Moved the macOS
version of this function out of this file ...
* testing/Internals.mm:
(WebCore::Internals::rangeForDictionaryLookupAtLocation): ... to here.
2018-07-29 Yusuke Suzuki <utatane.tea@gmail.com>
Use static global variables instead of static NeverDestroyed inside function if possible
https://bugs.webkit.org/show_bug.cgi?id=188146
Reviewed by Darin Adler.
This patch leverages constexpr constructors / trivial destructors more to remove unnecessary `static NeverDestroyed`
inside a function. It simplifies the code, removes the unnecessary function, and ensures the initialization at
a program loader phase.
We make StepRange::StepDescription constructor constexpr to remove bunch of `static NeverDestroyed<const StepRange::StepDescription>`.
And we use `static Lock` since WTF::Lock has constexpr constructor.
No behavior change.
* dom/MessagePort.cpp:
(WebCore::MessagePort::deref const):
(WebCore::MessagePort::isExistingMessagePortLocallyReachable):
(WebCore::MessagePort::notifyMessageAvailable):
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::allMessagePortsLock): Deleted.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::contextIdentifier const):
(WebCore::ScriptExecutionContext::removeFromContextsMap):
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore::ScriptExecutionContext::postTaskTo):
(WebCore::allScriptExecutionContextsMapLock): Deleted.
* html/DateInputType.cpp:
(WebCore::DateInputType::createStepRange const):
* html/DateTimeInputType.cpp:
(WebCore::DateTimeInputType::createStepRange const):
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::createStepRange const):
* html/MonthInputType.cpp:
(WebCore::MonthInputType::createStepRange const):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createStepRange const):
* html/StepRange.h:
(WebCore::StepRange::StepDescription::StepDescription):
* html/TimeInputType.cpp:
(WebCore::TimeInputType::createStepRange const):
* html/WeekInputType.cpp:
(WebCore::WeekInputType::createStepRange const):
* page/SecurityPolicy.cpp:
(WebCore::originAccessMap):
(WebCore::SecurityPolicy::isAccessWhiteListed):
(WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
(WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
(WebCore::SecurityPolicy::resetOriginAccessWhitelists):
(WebCore::originAccessMapLock): Deleted.
* platform/SchemeRegistry.cpp:
(WebCore::allBuiltinSchemes):
(WebCore::builtinLocalURLSchemes):
(WebCore::localURLSchemes):
(WebCore::displayIsolatedURLSchemes):
(WebCore::builtinSecureSchemes):
(WebCore::secureSchemes):
(WebCore::builtinSchemesWithUniqueOrigins):
(WebCore::schemesWithUniqueOrigins):
(WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
(WebCore::canDisplayOnlyIfCanRequestSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsLocal):
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
(WebCore::ContentSecurityPolicyBypassingSchemes):
(WebCore::cachePartitioningSchemes):
(WebCore::serviceWorkerSchemes):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
(WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
(WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
(WebCore::SchemeRegistry::registerURLSchemeAsSecure):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
(WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
(WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
(WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
(WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
(WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
(WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
(WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
(WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
(WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
(WebCore::schemeRegistryLock): Deleted.
2018-07-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix the bug when client reject the redirect on WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=188130
Reviewed by Darin Adler.
ResourceHandle for Curl port has a bug when a client returns en empty request which
indicates the redirecti is rejected by the client. It should be quit the task immediately,
but it kept doing the job. Fixed.
NetworkDataTask implementation did the right thing and there's no bug for them.
Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::continueAfterWillSendRequest):
2018-07-28 Simon Fraser <simon.fraser@apple.com>
Reset CompositingPolicyOverride between tests
https://bugs.webkit.org/show_bug.cgi?id=188138
Reviewed by Zalan Bujtas.
WK1 tests were failing after r234330 because the compositing policy override optional
was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having
Internals::resetToConsistentState clear this state.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2018-07-24 Simon Fraser <simon.fraser@apple.com>
Animation stops with object-fit:contain on an animated 2d canvas
https://bugs.webkit.org/show_bug.cgi?id=187840
Reviewed by Zalan Bujtas.
If a canvas has object-fit: cover or contain, repaints need to mapped through
the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
all but RenderVideo just pass the RenderReplaced's intrinsicSize.
Test: fast/repaint/canvas-object-fit.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::didDraw):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::updateInnerContentRect):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::contentsBox const):
* rendering/RenderReplaced.h:
(WebCore::RenderReplaced::replacedContentRect const):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::createShapeForImage const):
2018-07-27 Simon Fraser <simon.fraser@apple.com>
Adjust the color matrix for the inverse apple-invert-lightness() transformation
https://bugs.webkit.org/show_bug.cgi?id=188131
rdar://problem/42673070
Reviewed by Zalan Bujtas.
Use the correct inverse matrix values.
Test: editing/style/inverse-color-filter.html
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
2018-07-27 Eric Carlson <eric.carlson@apple.com>
[iOS] Don't deactivate audio session
https://bugs.webkit.org/show_bug.cgi?id=188127
<rdar://problem/42544143>
Reviewed by Jon Lee.
r233435 includes a change that deactivates the shared audio session when there are no more
active media sessions. This is a good in WK2 because it allows other applications to resume
playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
app may also be playing audio.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
2018-07-27 Chris Dumez <cdumez@apple.com>
Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
https://bugs.webkit.org/show_bug.cgi?id=188097
<rdar://problem/42558823>
Reviewed by Eric Carlson.
Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable(). RealtimeMediaSource::audioSamplesAvailable()
is called on a background thread but iterates over observers that may get destroyed concurrently on the main thread.
To address the issue:
- Introduce a Lock to protect m_observer accesses
- Copy observers to a Vector before iterating over them
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::forEachObserver const):
(WebCore::MediaStreamTrackPrivate::addObserver):
(WebCore::MediaStreamTrackPrivate::removeObserver):
(WebCore::MediaStreamTrackPrivate::setEnabled):
(WebCore::MediaStreamTrackPrivate::endTrack):
(WebCore::MediaStreamTrackPrivate::sourceStarted):
(WebCore::MediaStreamTrackPrivate::sourceStopped):
(WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
(WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
(WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
(WebCore::MediaStreamTrackPrivate::updateReadyState):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated):
(WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::addObserver):
(WebCore::RealtimeMediaSource::removeObserver):
(WebCore::RealtimeMediaSource::forEachObserver const):
(WebCore::RealtimeMediaSource::notifyMutedObservers const):
(WebCore::RealtimeMediaSource::settingsDidChange):
(WebCore::RealtimeMediaSource::videoSampleAvailable):
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
(WebCore::RealtimeMediaSource::start):
(WebCore::RealtimeMediaSource::requestStop):
(WebCore::RealtimeMediaSource::captureFailed):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2018-07-27 Alex Christensen <achristensen@webkit.org>
Don't include WebPageProxy.h just for UndoOrRedo
https://bugs.webkit.org/show_bug.cgi?id=188086
Reviewed by Saam Barati.
* platform/DragItem.h:
2018-07-27 Alex Christensen <achristensen@webkit.org>
Make CompletionHandler more const correct
https://bugs.webkit.org/show_bug.cgi?id=186543
Reviewed by Saam Barati.
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::checkRemotePortForActivity):
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::pushChanges):
(WebCore::RegistrationDatabase::clearAll):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::matchAll):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::matchAll):
* workers/service/server/SWServerWorker.h:
2018-07-27 Simon Fraser <simon.fraser@apple.com>
Be more conservative with compositing layer creation when memory is low
https://bugs.webkit.org/show_bug.cgi?id=187866
rdar://problem/42366345
Reviewed by Zalan Bujtas.
When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
compositing layers. We avoid compositing for these situations:
1. Layers with 3D transforms which are affine (like translateZ(0)).
2. Layers with will-change
3. Layers for canvases (other than WebGL/WebGPU)
We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
flakily falling into a different mode, and so that we can impose the conservative
mode for testing.
Test: compositing/layer-creation/compositing-policy.html
* page/Page.h:
(WebCore::Page::compositingPolicyOverride const):
(WebCore::Page::setCompositingPolicyOverride):
* platform/graphics/transforms/Matrix3DTransformOperation.cpp:
(WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
* platform/graphics/transforms/Matrix3DTransformOperation.h:
* platform/graphics/transforms/PerspectiveTransformOperation.h:
* platform/graphics/transforms/RotateTransformOperation.h:
* platform/graphics/transforms/ScaleTransformOperation.h:
* platform/graphics/transforms/TransformOperation.h:
(WebCore::TransformOperation::isRepresentableIn2D const):
* platform/graphics/transforms/TransformOperations.h:
(WebCore::TransformOperations::has3DOperation const):
(WebCore::TransformOperations::isRepresentableIn2D const):
* platform/graphics/transforms/TranslateTransformOperation.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::updateCompositingPolicy):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
(WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
(WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
(WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
(WebCore::operator<<):
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::Internals::setCompositingPolicyOverride):
(WebCore::Internals::compositingPolicyOverride const):
* testing/Internals.h:
* testing/Internals.idl:
2018-07-27 Zalan Bujtas <zalan@apple.com>
[WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
https://bugs.webkit.org/show_bug.cgi?id=188122
<rdar://problem/42584790>
Reviewed by Simon Fraser.
When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
Skip assertion for now on WK1 (see webkit.org/b/188121)
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2018-07-27 Myles C. Maxfield <mmaxfield@apple.com>
[WIN] Crash when trying to access store pages
https://bugs.webkit.org/show_bug.cgi?id=188032
<rdar://problem/42467016>
Reviewed by Brent Fulgham.
The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
an additional offset to the position to paint each glyph. It also has two add() functions, one
which appends to this vector, and one which doesn't. The one that doesn't append to the vector
should never be called on Windows (because Windows requires this vector to be full).
There were two situations where it was getting called:
1) Inside ComplexTextController
2) Inside display list playback
Windows shouldn't be using ComplexTextController because the Windows implementation of this
class isn't ready yet; instead it should be using UniscribeController. The display list playback
code should be used on Windows.
Rather than fix the function to append an offset, we actually don't need the m_offsets vector
in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
to distinguish between layout advances and paint advances, so we can bake them together and
just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
performance and memory improvement.
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
isn't used on Windows.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
UniscribeController on Windows.
(WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
no reason to consult it when drawing.
* platform/graphics/GlyphBuffer.h: Remove m_offsets
(WebCore::GlyphBuffer::clear):
(WebCore::GlyphBuffer::advanceAt const):
(WebCore::GlyphBuffer::add):
(WebCore::GlyphBuffer::expandLastAdvance):
(WebCore::GlyphBuffer::shrink):
(WebCore::GlyphBuffer::swap):
(WebCore::GlyphBuffer::offsetAt const): Deleted.
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
to consult it when drawing.
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs): Ditto.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.
2018-07-27 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Crash on synchronous request via ResourceHandle.
https://bugs.webkit.org/show_bug.cgi?id=188033
Reviewed by Alex Christensen.
The timing of instantiation of delegate was wrong. Move it inside `delegate` getter().
This bug was introduced at r228577.
Test: http/tests/xmlhttprequest/simple-sync.html
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::delegate):
2018-07-03 David Fenton <david_fenton@apple.com>
Unreviewed, rolling out r233461.
assertions triggered on ios11 Debug wk2
Reverted changeset:
"[iOS] Add assert to catch improper use of WebCore::Timer in
UI Process"
https://bugs.webkit.org/show_bug.cgi?id=185330
https://trac.webkit.org/changeset/233461
2018-07-27 Chris Dumez <cdumez@apple.com>
[Media] Avoid unnecessarily constructing *TrackList objects
https://bugs.webkit.org/show_bug.cgi?id=188094
Reviewed by Eric Carlson.
Avoid unnecessarily constructing *TrackList objects as this is preventing us from making them
ActiveDOMObjects.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addAudioTrack):
(WebCore::HTMLMediaElement::addTextTrack):
(WebCore::HTMLMediaElement::addVideoTrack):
(WebCore::HTMLMediaElement::ensureAudioTracks):
(WebCore::HTMLMediaElement::ensureTextTracks):
(WebCore::HTMLMediaElement::ensureVideoTracks):
(WebCore::HTMLMediaElement::setSelectedTextTrack):
(WebCore::HTMLMediaElement::audioTracks): Deleted.
(WebCore::HTMLMediaElement::textTracks): Deleted.
(WebCore::HTMLMediaElement::videoTracks): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::audioTracks const):
(WebCore::HTMLMediaElement::textTracks const):
(WebCore::HTMLMediaElement::videoTracks const):
* html/HTMLMediaElement.idl:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::setKind):
(WebCore::TextTrack::trackIndex):
(WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
(WebCore::TextTrack::setLanguage):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::setKind):
(WebCore::VideoTrack::setLanguage):
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
2018-07-27 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Set correct source info to ResourceResponse.
https://bugs.webkit.org/show_bug.cgi?id=188069
Reviewed by Fujii Hironori.
ResourceResponseBase::Source::Network must be set by each ports. Curl port
didn't set this.
Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
2018-07-26 Andy VanWagoner <andy@vanwagoner.family>
[INTL] Remove INTL sub-feature compile flags
https://bugs.webkit.org/show_bug.cgi?id=188081
Reviewed by Michael Catanzaro.
Compile time feature flags for INTL sub features were removed, and are covered by existing tests.
* Configurations/FeatureDefines.xcconfig:
2018-07-26 Zalan Bujtas <zalan@apple.com>
[Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
https://bugs.webkit.org/show_bug.cgi?id=188087
<rdar://problem/42632124>
Reviewed by Simon Fraser.
Sibling composited layers prevent battery lifetime optimizations when in fullscreen.
Test: compositing/no-compositing-when-fulll-screen-is-present.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isDescendantOf const):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::isDescendantOfFullScreenLayer):
(WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2018-07-26 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r234281.
Broke internal builds.
Reverted changeset:
"[Datalist] Add button to TextFieldInputs with a datalist"
https://bugs.webkit.org/show_bug.cgi?id=187741
https://trac.webkit.org/changeset/234281
2018-07-26 Aditya Keerthi <akeerthi@apple.com>
[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):
(WebCore::HTMLInputElement::isShowingList const):
* html/HTMLInputElement.h:
* html/InputType.h:
(WebCore::InputType::dataListButtonElement const):
(WebCore::InputType::isShowingList 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):
(WebCore::TextFieldInputType::isShowingList const):
* 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-07-26 Antoine Quint <graouts@apple.com>
[Web Animations] Accelerated animations don't respect a positive delay value
https://bugs.webkit.org/show_bug.cgi?id=186930
<rdar://problem/41393393>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-with-delay.html
We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
will in turn call into the document timeline so that we may consider these animations on the next tick.
For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
animations to this list. That list is now copied and cleared prior to iterating through its members.
We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
to have a more similar name.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2018-07-26 Ross Kirsling <ross.kirsling@sony.com>
String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
https://bugs.webkit.org/show_bug.cgi?id=187963
Reviewed by Alex Christensen.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/cache/DOMCache.cpp:
(WebCore::hasResponseVaryStarHeaderValue):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::queryCacheMatch):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::filterICECandidate):
(WebCore::PeerConnectionBackend::filterSDP const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::shouldCancelDefaultAction):
* editing/markup.cpp:
(WebCore::fillContainerFromString):
(WebCore::createFragmentFromText):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::typeMismatchFor const):
(WebCore::EmailInputType::sanitizeValue const):
* html/HTMLInputElement.cpp:
(WebCore::parseAcceptAttribute):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compileShader):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::nodeForPath):
* loader/FormSubmission.cpp:
(WebCore::encodingFromAcceptCharset):
* loader/ResourceTiming.cpp:
(WebCore::passesTimingAllowCheck):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
(WebCore::parseDialogFeaturesMap):
* platform/URL.cpp:
(WebCore::isIPv4Address):
(WebCore::isIPv6Address):
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::version):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::patternToFamilies):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::extractGStreamerOptionsFromCommandLine):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::fillSelectionData):
* platform/gtk/SelectionData.cpp:
(WebCore::SelectionData::setURIList):
* platform/network/CacheValidation.cpp:
(WebCore::collectVaryingRequestHeaders):
* platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
(WebCore::parseXFrameOptionsHeader):
(WebCore::parseAccessControlExposeHeadersAllowList):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::loadResponseHeaders):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::loadIndex):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::parseAttribute):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendOS2Table):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseBeginOrEnd):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeResponse const):
(WebCore::MockCDMInstance::updateLicense):
Update split/splitAllowingEmptyEntries usage.
2018-07-26 Nan Wang <n_wang@apple.com>
AX: nothing returned for various previous text marker APIs from one div/p node to another
https://bugs.webkit.org/show_bug.cgi?id=188071
Reviewed by Chris Fleizach.
TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
corresponding text node in the DOM tree, so we are not able to handle that for
text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to
the previous child text node.
Test: accessibility/mac/text-marker-p-tags.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
2018-07-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r234181 and r234189.
https://bugs.webkit.org/show_bug.cgi?id=188075
These are not needed right now (Requested by thorton on
#webkit).
Reverted changesets:
"Enable Web Content Filtering on watchOS"
https://bugs.webkit.org/show_bug.cgi?id=187979
https://trac.webkit.org/changeset/234181
"HAVE(PARENTAL_CONTROLS) should be true on watchOS"
https://bugs.webkit.org/show_bug.cgi?id=187985
https://trac.webkit.org/changeset/234189
2018-07-26 Timothy Hatcher <timothy@apple.com>
Use the Page's appearance when converting pasteboard attributed strings.
https://bugs.webkit.org/show_bug.cgi?id=188067
rdar://problem/42632246
Reviewed by Wenson Hsieh.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.
2018-07-26 Eric Carlson <eric.carlson@apple.com>
Switching tabs should not close PiP window
https://bugs.webkit.org/show_bug.cgi?id=188054
<rdar://problem/41212379>
Reviewed by Jon Lee.
No new tests, fixes an existing test.
Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
selectors to close the PiP window. requestHideAndExitFullscreen is also called from
WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
a new method that is only used by the delegate to exit PiP.
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
do-nothing method.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
2018-07-04 Darin Adler <darin@apple.com>
Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
https://bugs.webkit.org/show_bug.cgi?id=187333
Reviewed by Sam Weinig.
- Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
The code previously had used OBJC_CLASS, but that created unrelated classes.
Fixing this allows removing many typecasts that were in the existing code, makes it
ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
were calling methods that don't exist.
- Eliminated use of separate heap-allocated, reference-counted objects to
hold pointers to Metal objects.
- Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
They are now used only as part of the DOM binding; the inner GPU objects are used
whenever possible. This cuts down the number of separate functions needed a bit,
since we don't always need accessors for the things inside the wrappers.
- Used references rather than pointers in many cases.
- Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
"do nothing and return 0" behavior for methods without return values and that return
integer scalars. 2) Checks that aren't needed because the code has clear, invariant
guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
that can be obviated by using reference types instead of pointer types.
- For Metal-specific functions and data members, used the function name metal() and
the data member name m_metal rather than longer wordier names with the word "platform"
in them. We could use "platform" if these objects were platform-specific objects used
in a cross-platform way that needed a common name. But in this case it's clearer to
call them "metal" since we are dropping down to the metal with Metal API, and
shared platform-independent code will not be accessing these.
- Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.
- Used "const" more in the GPU functions that are wrappers around Metal objects to
reflect the fact that these have semantics of smart pointers; most operations can be
done without changing which object is pointed to. This allows us to use const
references to pass things around without reference count churn.
- Reduced includes.
- Added "explicit" keywords where appropriate.
- Removed unused functions. In particular, removed non-Metal stub versions of the
functions in the GPU classes: the right way to start a new port is to clone the
Metal-specific files and turn the into stubs if needed, it does not make it
significantly more convenient to have stubs in the platform independent files,
especially ones that are not compiled for any platform.
- Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
support testing with TestWebKitAPI.
- Fixed two storage leaks in GPUDevice by adding missing adoptNS.
* PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
* SourcesCocoa.txt: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
Made the platform files that abstract GPU all be "project" visible, not "private", since
they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
which does not seem to be a source file, a derived source file, or mentioned in any change log.
* bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
(WebCore::toJSNewlyCreated): Create the correct wrapper for a
WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
used to access the clearDepth attribute.
* html/canvas/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
that are never null. Added comment about possibly returning null on failure in future.
(WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
instead of in a separate reference counted object.
* html/canvas/WebGPUBuffer.h: Ditto.
* html/canvas/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
inside the class.
(WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
(WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
(WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
Removed unneeded local variable.
(WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
(WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
class, not in GPUCommandBuffer.
* html/canvas/WebGPUCommandBuffer.h: Ditto.
* html/canvas/WebGPUCommandQueue.cpp:
(WebCore::WebGPUCommandQueue::create): Use references and lower level types.
(WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
inside the class.
(WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
* html/canvas/WebGPUCommandQueue.h: Ditto.
* html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
is no longer nullable.
* html/canvas/WebGPUComputeCommandEncoder.cpp:
(WebCore::WebGPUComputeCommandEncoder::create): More of the same.
(WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
(WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
(WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
(WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
(WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
* html/canvas/WebGPUComputeCommandEncoder.h: Ditto.
* html/canvas/WebGPUComputePipelineState.cpp:
(WebCore::WebGPUComputePipelineState::create): More of the same.
(WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
* html/canvas/WebGPUComputePipelineState.h: Ditto.
* html/canvas/WebGPUDepthStencilDescriptor.cpp:
(WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
(WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
(WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
(WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
(WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
* html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
where m_depthCompareFunction was uninitialized in newly created objects.
* html/canvas/WebGPUDepthStencilState.cpp:
(WebCore::WebGPUDepthStencilState::create): More of the same.
(WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
(WebCore::WebGPUDepthStencilState::label const): Ditto.
(WebCore::WebGPUDepthStencilState::setLabel): Ditto.
* html/canvas/WebGPUDepthStencilState.h: Ditto.
* html/canvas/WebGPUDrawable.cpp:
(WebCore::WebGPUDrawable::create): More of the same.
(WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
* html/canvas/WebGPUDrawable.h: Ditto.
* html/canvas/WebGPUEnums.cpp: Removed some stray const.
* html/canvas/WebGPUEnums.h: Ditto.
* html/canvas/WebGPUFunction.cpp:
(WebCore::WebGPUFunction::create): More of the same.
(WebCore::WebGPUFunction::WebGPUFunction): Ditto.
* html/canvas/WebGPUFunction.h: Ditto.
* html/canvas/WebGPULibrary.cpp:
(WebCore::WebGPULibrary::create): More of the same.
(WebCore::WebGPULibrary::WebGPULibrary): Ditto.
(WebCore::WebGPULibrary::functionNames const): Ditto.
(WebCore::WebGPULibrary::functionWithName const): Ditto.
* html/canvas/WebGPULibrary.h: Ditto.
* html/canvas/WebGPUObject.cpp:
(WebCore::WebGPUObject::WebGPUObject):
(WebCore::WebGPUObject::deleteObject): Deleted this unused function.
We can bring it back later if we find we need it the way we did with the
WebGL implementation, but currently it's a never-called stub. Also
deleted the isDeleted and m_deleted for the same reason.
* html/canvas/WebGPUObject.h: Ditto.
* html/canvas/WebGPURenderCommandEncoder.cpp:
(WebCore::WebGPURenderCommandEncoder::create): More of the same.
(WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
(WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
(WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
(WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
(WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
(WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
(WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
* html/canvas/WebGPURenderCommandEncoder.h: Ditto.
* html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
More of the same.
(WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
(WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
* html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
(WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.
* html/canvas/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::create): More of the same.
(WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
(WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
* html/canvas/WebGPURenderPassDescriptor.h: Ditto.
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
(WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
* html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.
* html/canvas/WebGPURenderPipelineDescriptor.cpp:
(WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
(WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
(WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
* html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.
* html/canvas/WebGPURenderPipelineState.cpp:
(WebCore::WebGPURenderPipelineState::create): More of the same.
(WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
(WebCore::WebGPURenderPipelineState::label const): Ditto.
(WebCore::WebGPURenderPipelineState::setLabel): Ditto.
* html/canvas/WebGPURenderPipelineState.h: Ditto.
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create): More of the same.
(WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
(WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
(WebCore::WebGPURenderingContext::platformLayer const): Ditto.
(WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
(WebCore::WebGPURenderingContext::reshape): Ditto.
(WebCore::WebGPURenderingContext::createLibrary): Ditto.
(WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
(WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
(WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
(WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
(WebCore::WebGPURenderingContext::nextDrawable): Ditto.
(WebCore::WebGPURenderingContext::createBuffer): Ditto.
(WebCore::WebGPURenderingContext::createTexture): Ditto.
* html/canvas/WebGPURenderingContext.h: Made many functions final and
private.
* html/canvas/WebGPURenderingContext.idl: The return value of most of
the create functions are no longer nullable.
* html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".
* html/canvas/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
(WebCore::WebGPUTexture::create): Ditto.
(WebCore::WebGPUTexture::WebGPUTexture): Ditto.
* html/canvas/WebGPUTexture.h: Ditto.
* html/canvas/WebGPUTextureDescriptor.cpp:
(WebCore::WebGPUTextureDescriptor::create): More of the same.
(WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
(WebCore::WebGPUTextureDescriptor::width const): Ditto.
(WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
(WebCore::WebGPUTextureDescriptor::height const): Ditto.
(WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
(WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
(WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
(WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
(WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
(WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
(WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
(WebCore::WebGPUTextureDescriptor::usage const): Ditto.
(WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
* html/canvas/WebGPUTextureDescriptor.h: Ditto.
* platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
(WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
"metal" naming.
* platform/graphics/metal/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
completed handler and set it up.
(WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
(WebCore::GPUCommandBuffer::commit const): Ditto.
(WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.
* platform/graphics/metal/GPUCommandQueueMetal.mm:
(WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
(WebCore::GPUCommandQueue::label const): Ditto.
(WebCore::GPUCommandQueue::setLabel const): Ditto.
* platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
(WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
(WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
(WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
(WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
(WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.
* platform/graphics/metal/GPUComputePipelineStateMetal.mm:
(WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.
* platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
(WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
(WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
(WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
(WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
(WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.
* platform/graphics/metal/GPUDepthStencilStateMetal.mm:
(WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
(WebCore::GPUDepthStencilState::label const): Ditto.
(WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
functions that was calling a method that does not exist. Added a comment.
* platform/graphics/metal/GPUDeviceMetal.mm:
(WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
(WebCore::GPUDevice::reshape const): Ditto.
(WebCore::GPUDevice::platformLayer const): Ditto.
(WebCore::GPUDevice::operator! const): Ditto.
* platform/graphics/metal/GPUDrawableMetal.mm:
(WebCore::GPUDrawable::GPUDrawable): Ditto.
(WebCore::GPUDrawable::release): Ditto.
(WebCore::GPUDrawable::metal const): Ditto.
(WebCore::GPUDrawable::texture const): Ditto.
* platform/graphics/metal/GPUFunctionMetal.mm:
(WebCore::GPUFunction::GPUFunction): Ditto.
(WebCore::GPUFunction::name const): Ditto.
(WebCore::GPUFunction::metal const): Ditto.
(WebCore::GPUFunction::operator! const): Ditto.
* platform/graphics/metal/GPULibraryMetal.mm:
(WebCore::GPULibrary::GPULibrary): Ditto.
(WebCore::GPULibrary::label const): Ditto.
(WebCore::GPULibrary::setLabel const): Ditto.
(WebCore::GPULibrary::functionNames const): Ditto.
(WebCore::GPULibrary::metal const): Ditto.
* platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
(WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
(WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
(WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
(WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
(WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
(WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
(WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.
* platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
(WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.
* platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
(WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
(WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
(WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.
* platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
(WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
(WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
(WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.
* platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
(WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
(WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
(WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
(WebCore::GPURenderPassDescriptor::metal const): Ditto.
* platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
(WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
(WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.
* platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
(WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
(WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
(WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
(WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
(WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
(WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
(WebCore::GPURenderPipelineDescriptor::metal const): Ditto.
* platform/graphics/metal/GPURenderPipelineStateMetal.mm:
(WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
(WebCore::GPURenderPipelineState::label const): Ditto.
(WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
functions that was calling a method that does not exist. Added a comment.
(WebCore::GPURenderPipelineState::metal const): Ditto.
* platform/graphics/metal/GPUTextureDescriptorMetal.mm:
(WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
(WebCore::GPUTextureDescriptor::width const): Ditto.
(WebCore::GPUTextureDescriptor::setWidth const): Ditto.
(WebCore::GPUTextureDescriptor::height const): Ditto.
(WebCore::GPUTextureDescriptor::setHeight const): Ditto.
(WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
(WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
(WebCore::GPUTextureDescriptor::textureType const): Ditto.
(WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
(WebCore::GPUTextureDescriptor::storageMode const): Ditto.
(WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
(WebCore::GPUTextureDescriptor::usage const): Ditto.
(WebCore::GPUTextureDescriptor::setUsage const): Ditto.
(WebCore::GPUTextureDescriptor::metal const): Ditto.
* platform/graphics/metal/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture): Ditto.
(WebCore::GPUTexture::width const): Ditto.
(WebCore::GPUTexture::height const): Ditto.
(WebCore::GPUTexture::metal const): Ditto.
* platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
(WebCore::GPUBuffer::length const): Moved this function here since it has
a useful platform-independent implementation.
* platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
no longer be RefCounted, etc.
* platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
* platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
for MTLCommandBuffer.
* platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
* platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
MTLCommandQueue.
* platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
* platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
MTLComputeCommandEncoder.
* platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
* platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
MTLComputePipelineState.
* platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.
* platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
* platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
MTLDepthStencilState.
* platform/graphics/gpu/GPUDevice.cpp: Ditto.
* platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.
* platform/graphics/gpu/GPUDrawable.cpp: Ditto.
* platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
MTLDrawable and MTLTexture.
* platform/graphics/gpu/GPUEnums.h: Tweaked formatting.
* platform/graphics/gpu/GPUFunction.cpp: Ditto.
* platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
MTLFunction.
* platform/graphics/gpu/GPULibrary.cpp: Ditto.
* platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
MTLLibrary.
* platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
* platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
Use OBJC_PROTOCOL for MTLRenderCommandEncoder.
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.
* platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.
* platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.
* platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
* platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
for MTLRenderPipelineState.
* platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".
* platform/graphics/gpu/GPUTexture.cpp: Ditto.
* platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
MTLTexture.
* platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
* platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.
2018-07-26 Zalan Bujtas <zalan@apple.com>
[LFC][Floating] Add skeleton for basic positioning.
https://bugs.webkit.org/show_bug.cgi?id=187974
Reviewed by Antti Koivisto.
Add floating boxes to an empty floating context.
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::computePosition):
* layout/FloatingContext.h:
(WebCore::Layout::FloatingContext::floatingState const):
(WebCore::Layout::FloatingContext::layoutContext const):
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::append):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::create):
(WebCore::Layout::FloatingState::isEmpty const):
(WebCore::Layout::FloatingState::layoutContext const):
* layout/FormattingState.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockInvalidation.cpp:
(WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isLeftFloatingPositioned const):
(WebCore::Layout::Box::isRightFloatingPositioned const):
* layout/layouttree/LayoutBox.h:
2018-07-26 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Do not try to access containing block's height during descendant height computation
https://bugs.webkit.org/show_bug.cgi?id=187970
Reviewed by Antti Koivisto.
Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2018-07-26 Frederic Wang <fwang@igalia.com>
Unreviewed, add bug references into FIXME comments for CSSOM View API
* dom/Element.idl:
* page/ScrollToOptions.idl:
2018-07-26 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
https://bugs.webkit.org/show_bug.cgi?id=187969
Reviewed by Antti Koivisto.
Assert on unsupported height types when computing inflow non-replaced height.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-07-26 Antoine Quint <graouts@apple.com>
[Web Animations] REGRESSION: transition added immediately after element creation doesn't work
https://bugs.webkit.org/show_bug.cgi?id=187942
Reviewed by Dean Jackson.
Tests: webanimations/accelerated-transition-by-removing-property.html
webanimations/partly-accelerated-transition-by-removing-property.html
The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
running animations on an element should yield a change in composited state for that element's layer. We did not
have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
circumstances, see test).
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::resolveAnimationsForElement):
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2018-07-25 Chris Dumez <cdumez@apple.com>
Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
https://bugs.webkit.org/show_bug.cgi?id=188025
Reviewed by Alex Christensen.
Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.
We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
(WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
* dom/ScriptExecutionContext.h:
2018-07-25 Justin Fan <justin_fan@apple.com>
Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
https://bugs.webkit.org/show_bug.cgi?id=188023
<rdar://problem/42476622>
Reviewed by Simon Fraser.
On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
will thus hit an assertion rather than returning 0. Removing the assertion for now.
Covered by existing tests.
* platform/mac/PlatformScreenMac.mm:
(WebCore::rendererIDForDisplay):
2018-07-25 Zalan Bujtas <zalan@apple.com>
Build fix after r234215. Unreviewed.
* rendering/RenderTheme.cpp:
2018-07-25 Zalan Bujtas <zalan@apple.com>
REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
https://bugs.webkit.org/show_bug.cgi?id=188018
<rdar://problem/42517520>
Reviewed by Dean Jackson.
Manual rollout of r227577.
Test: fast/overflow/line-clamp-with-text-shadow.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeLinesClamp): Deleted.
* page/Settings.yaml:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::heightForLineCount):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
(WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
(WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
* rendering/RenderFragmentContainer.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
(WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderLinesClampFlow.cpp: Removed.
* rendering/RenderLinesClampFlow.h: Removed.
* rendering/RenderLinesClampSet.cpp: Removed.
* rendering/RenderLinesClampSet.h: Removed.
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
(WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
* rendering/RenderMultiColumnFlow.h:
(WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
(WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
(WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
(WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
(WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
(WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
(WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
(WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
(WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
(WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
(WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
(WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
(WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
(WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
(WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
(WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
(WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
(WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::collectLayerFragments):
(WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
* rendering/RenderMultiColumnSet.h:
(WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
(WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
(WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
(WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
(WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
(WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
(WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
(WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
(WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
(WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
(WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
(WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
(WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
* rendering/style/LineClampValue.h:
(WebCore::LinesClampValue::LinesClampValue): Deleted.
(WebCore::LinesClampValue::isNone const): Deleted.
(WebCore::LinesClampValue::operator== const): Deleted.
(WebCore::LinesClampValue::operator!= const): Deleted.
(WebCore::LinesClampValue::start const): Deleted.
(WebCore::LinesClampValue::end const): Deleted.
(WebCore::LinesClampValue::center const): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::lineClamp const):
(WebCore::RenderStyle::setLineClamp):
(WebCore::RenderStyle::initialLineClamp):
(WebCore::RenderStyle::hasInlineColumnAxis const):
(WebCore::RenderStyle::linesClamp const): Deleted.
(WebCore::RenderStyle::hasLinesClamp const): Deleted.
(WebCore::RenderStyle::setLinesClamp): Deleted.
(WebCore::RenderStyle::initialLinesClamp): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::isValidColumnSpanner):
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
2018-07-25 Chris Dumez <cdumez@apple.com>
navigator.userAgent may return outdated value after webView.customUserAgent is set
https://bugs.webkit.org/show_bug.cgi?id=188009
<rdar://problem/42566456>
Reviewed by Alex Christensen.
Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
outdated values to JavaScript.
* page/Navigator.cpp:
(WebCore::Navigator::userAgentChanged):
* page/Navigator.h:
* page/NavigatorID.idl:
* page/Page.cpp:
(WebCore::Page::userAgentChanged):
* page/Page.h:
2018-07-25 David Fenton <david_fenton@apple.com>
Unreviewed, rolling out r234187.
the layout test added with this change is flaky on the bots
Reverted changeset:
"Animation stops with object-fit:contain on an animated 2d
canvas"
https://bugs.webkit.org/show_bug.cgi?id=187840
https://trac.webkit.org/changeset/234187
2018-07-25 Chris Dumez <cdumez@apple.com>
Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
https://bugs.webkit.org/show_bug.cgi?id=187978
Reviewed by Eric Carlson.
Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
release assertion, we would find the culprits right away. The assertion guarding against addition of
ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
* dom/ScriptExecutionContext.h:
2018-07-24 Chris Dumez <cdumez@apple.com>
REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
https://bugs.webkit.org/show_bug.cgi?id=187411
<rdar://problem/41920593>
Reviewed by Sam Weinig.
Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
for the response instead of the caller's exec.
Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::response const):
2018-07-24 Simon Fraser <simon.fraser@apple.com>
Animation stops with object-fit:contain on an animated 2d canvas
https://bugs.webkit.org/show_bug.cgi?id=187840
Reviewed by Zalan Bujtas.
If a canvas has object-fit: cover or contain, repaints need to mapped through
the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
all but RenderVideo just pass the RenderReplaced's intrinsicSize.
Test: fast/repaint/canvas-object-fit.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::didDraw):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::updateInnerContentRect):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::contentsBox const):
* rendering/RenderReplaced.h:
(WebCore::RenderReplaced::replacedContentRect const):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::createShapeForImage const):
2018-07-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Add support for wss:// websockets
https://bugs.webkit.org/show_bug.cgi?id=172630
Reviewed by Fujii Hironori.
To support secure WebSocket connection, it is almost rewritten by using existing
backend for CurlHandle to handle TLS connection and proxy support.
Test: http/tests/websocket/tests/hybi/simple-wss.html
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlSocketHandle::CurlSocketHandle):
(WebCore::CurlSocketHandle::connect):
(WebCore::CurlSocketHandle::send):
(WebCore::CurlSocketHandle::receive):
(WebCore::CurlSocketHandle::wait):
* platform/network/curl/CurlContext.h:
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::SocketData::SocketData): Deleted.
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::platformSendInternal):
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::threadEntryPoint):
(WebCore::SocketStreamHandleImpl::handleError):
(WebCore::SocketStreamHandleImpl::stopThread):
(WebCore::createCopy): Deleted.
(WebCore::SocketStreamHandleImpl::readData): Deleted.
(WebCore::SocketStreamHandleImpl::sendData): Deleted.
(WebCore::SocketStreamHandleImpl::waitForAvailableData): Deleted.
(WebCore::SocketStreamHandleImpl::startThread): Deleted.
(WebCore::SocketStreamHandleImpl::didReceiveData): Deleted.
(WebCore::SocketStreamHandleImpl::didOpenSocket): Deleted.
2018-07-24 Tim Horton <timothy_horton@apple.com>
Enable Web Content Filtering on watchOS
https://bugs.webkit.org/show_bug.cgi?id=187979
<rdar://problem/42559346>
Reviewed by Wenson Hsieh.
* Configurations/FeatureDefines.xcconfig:
2018-07-24 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r233496 and r233571.
Likely cause of <rdar://problem/42160890> and
<rdar://problem/42329658> as ActiveDOMObjects can now be
constructed / destroyed while we are iterating over them.
Reverted changesets:
"Nullptr crash accessing Document in
GenericEventQueue::dispatchOneEvent()"
https://bugs.webkit.org/show_bug.cgi?id=187284
https://trac.webkit.org/changeset/233496
"REGRESSION(r233496): macOS Sierra hits debug assertions in
TrackListBase::suspend"
https://bugs.webkit.org/show_bug.cgi?id=187378
https://trac.webkit.org/changeset/233571
2018-07-24 Aditya Keerthi <akeerthi@apple.com>
[Datalist][macOS] Display suggestions for input[type=color]
https://bugs.webkit.org/show_bug.cgi?id=187794
Reviewed by Tim Horton.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shouldRespectListAttribute):
2018-07-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r234121.
Caused perf test failures.
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/234121
2018-07-24 Antoine Quint <graouts@apple.com>
[Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a valid effect in setTimingProperties()
https://bugs.webkit.org/show_bug.cgi?id=187954
Reviewed by Dean Jackson.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::setTimingProperties):
2018-07-24 Antoine Quint <graouts@apple.com>
[Web Animations] Crash when setting an animation style on an existing animation that had its effect set to null
https://bugs.webkit.org/show_bug.cgi?id=187953
Reviewed by Dean Jackson.
Test: webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html
Ensure that we have a valid effect before proceeding to update its timing.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2018-07-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Restructure getDisplayMedia classes
https://bugs.webkit.org/show_bug.cgi?id=187905
<rdar://problem/42500215>
Unreviewed build fix.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2018-07-24 Antoine Quint <graouts@apple.com>
[Web Animations] Crash when setting "animation: none" after clearing an animation's effect
https://bugs.webkit.org/show_bug.cgi?id=187952
Reviewed by Dean Jackson.
Test: webanimations/setting-css-animation-none-after-clearing-effect.html
We need to ensure that the animation we're trying to remove has not had its effect cleared via the
Web Animations API since its creation before trying to check its phase.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2018-07-24 Antoine Quint <graouts@apple.com>
[Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
https://bugs.webkit.org/show_bug.cgi?id=187950
<rdar://problem/42515747>
Reviewed by Dean Jackson.
Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html
While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsCurrentTime const):
2018-07-24 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
https://bugs.webkit.org/show_bug.cgi?id=187965
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
2018-07-24 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Stop crashing in lastResortFallbackFont()
https://bugs.webkit.org/show_bug.cgi?id=187936
Reviewed by Jon Lee.
CoreText can get into a state where both Times and Lucida Grande are inaccessible.
Instead of crashing, we should use the real LastResort, which is backed by a section
in the .rodata of the CoreText dylib, and as such should always exist.
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForFamily):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::lastResortFallbackFont):
2018-07-24 Daniel Bates <dabates@apple.com>
Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
https://bugs.webkit.org/show_bug.cgi?id=187870
<rdar://problem/41190880>
Reviewed by Dean Jackson.
Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.
Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
from the opener.
Developers that want to block plugin content from being loaded in a same-origin child window must now
serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
(Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
behavior of Chrome and Firefox.
Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html
* dom/Document.cpp:
(WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
to inherit all directives from the owner frame as we do now.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
inheriting only the plugin-types and report-uri directives.
* page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
loaded in a child window.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
recognize the plugin-types and report-uri directives when parsing the policy.
2018-07-24 Daniel Bates <dabates@apple.com>
Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
https://bugs.webkit.org/show_bug.cgi?id=187892
Reviewed by Dean Jackson.
Standardize on the spec. language "site for cookies" for the names of the setter and getter
on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.
No functionality changed. So, no new tests.
* dom/Document.h:
(WebCore::Document::siteForCookies const):
(WebCore::Document::setSiteForCookies):
(WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
(WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies):
(WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):
2018-07-24 Ross Kirsling <ross.kirsling@sony.com>
WebCore::URL::hostIsIPAddress needs a Windows implementation
https://bugs.webkit.org/show_bug.cgi?id=187859
Reviewed by Fujii Hironori.
* platform/URL.cpp:
(WebCore::isIPv4Address): Added.
(WebCore::isIPv6Address): Added.
(WebCore::URL::hostIsIPAddress):
Turn this stub into a platform-agnostic default implementation.
2018-07-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Restructure getDisplayMedia classes
https://bugs.webkit.org/show_bug.cgi?id=187905
Reviewed by Dean Jackson.
No new tests, no functional changes.
* platform/mediastream/CaptureDeviceManager.h:
(WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a
virtual method.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
no longer virtual.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::captureDevices):
(WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality
to ScreenDisplayCaptureSourceMac.
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
(WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
(WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
(WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
(WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
(WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
(WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::updateDisplayID):
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
(WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
DisplayCaptureManagerCocoa.
(WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
(WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
(WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.
2018-07-24 Zalan Bujtas <zalan@apple.com>
[LFC] Move geometry data structures to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=187939
Reviewed by Antti Koivisto.
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
* 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::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/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):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setVerticalNonCollapsedMargin):
(WebCore::Display::Box::setBorder):
(WebCore::Display::Box::setPadding):
2018-07-24 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Implement bitrate modulation support in GStreamer based libwebrtc Encoders
https://bugs.webkit.org/show_bug.cgi?id=187643
Reviewed by Philippe Normand.
Problem being that we do not have a proper unified encoder API in GStreamer, some work
started at https://bugzilla.gnome.org/show_bug.cgi?id=796716 but it is quite controversial
and meanwhile we should just move forward working around that limitation.
Source/WebCore:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::getBitrateSetter):
(WebCore::GStreamerVideoEncoder::createEncoder):
(WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
(WebCore::GStreamerVideoEncoder::CreateEncoder): Deleted.
2018-07-24 Zan Dobersek <zdobersek@igalia.com>
REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
https://bugs.webkit.org/show_bug.cgi?id=187944
Reviewed by Carlos Garcia Campos.
The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
return false when the URL protocol is `data:`, and should return true
when the given SecurityOrigin cannot access the media URL.
This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
which the new method falls back to when the MediaPlayerPrivate
implementation doesn't or can't determine the would-taint result.
This fixes a bunch of failing and timing-out WebGL test cases on ports
using GStreamer (on which the MediaPlayerPrivate derivate doesn't
implement the wouldTaintOrigin() method).
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::wouldTaintOrigin const):
2018-07-24 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] Separate repaint counter state from debug visuals
https://bugs.webkit.org/show_bug.cgi?id=187946
Reviewed by Carlos Garcia Campos.
Instead of managing the repaint counter visibility along with the
debug border visuals, do that together with the repaint count value.
TextureMapperLayer::setRepaintCount() is renamed to setRepaintCounter()
and now also sets the repaint counter visibility state instead of the
setDebugVisuals() method.
GraphicsLayerTextureMapper implementation is adjusted appropriately.
The unused setRepaintCount() method is also removed.
CoordinatedGraphicsLayerState now holds repaint counter state (both
visibility and count value) in a struct that's separate from debug
border state. CoordinatedGraphicsLayer implementation now updates
that state accordingly.
No new tests -- no change in behavior.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::setRepaintCount): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setDebugVisuals):
(WebCore::TextureMapperLayer::setRepaintCounter):
(WebCore::TextureMapperLayer::setRepaintCount): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
(WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
(WebCore::DebugVisuals::DebugVisuals): Deleted.
2018-07-24 Thibault Saunier <tsaunier@igalia.com>
[WPE][GTK] Implement PeerConnection API on top of libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=186932
Reviewed by Philippe Normand.
Enabled many webrtc tests.
* platform/GStreamer.cmake: Build new files
* platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
and give useful names to pipelines with sources comming from a PeerConnection
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
to represent a kNative GStreamer video frame.
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
* platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.
2018-07-24 Dirk Schulze <krit@webkit.org>
[css-masking] Black backdrop on -webkit-clip-path on SVG root
https://bugs.webkit.org/show_bug.cgi?id=187880
Reviewed by Simon Fraser.
For SVG document root elements, we currently clip twice:
In RenderLayer and SVGRenderSupport.
Avoid clipping in RenderLayer which currently clips before we established a
backdrop for an SVG document.
Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
svg/clip-path/clip-path-on-svg-005.svg
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupClipPath): Skip actual clipping.
2018-07-24 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
https://bugs.webkit.org/show_bug.cgi?id=187941
Reviewed by Carlos Garcia Campos.
Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
member that will be assigned a list of all active animations during each
layer flush. Despite the name, TextureMapperAnimations doesn't depend on
any other TextureMapper class. It might be renamed and moved in the
future, but for now it's used as-is.
In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
the animationsChanged flag in the LayerState::Delta struct. This causes
all the active animations to be copied over into the layer state in
flushCompositingStateForThisLayerOnly().
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::syncAnimations):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2018-07-24 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Add FilterOperations member to CompositionLayer::LayerState
https://bugs.webkit.org/show_bug.cgi?id=187901
Reviewed by Carlos Garcia Campos.
Nicosia::CompositionLayer::LayerState gains a FilterOperations member
that can be assigned the list of filter operations for a given layer.
The corresponding filtersChanged boolean is added to LayerState::Delta.
CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
which in turn causes the FilterOperations value to be updated during
the layer flush, in flushCompositingStateForThisLayerOnly().
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::syncFilters):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2018-07-24 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
https://bugs.webkit.org/show_bug.cgi?id=187899
Reviewed by Carlos Garcia Campos.
As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
position, anchor point and size values should be used when updating the
corresponding Nicosia::CompositionLayer::LayerState members.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2018-07-23 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Add support for calc() in gutter properties
https://bugs.webkit.org/show_bug.cgi?id=187902
Reviewed by Simon Fraser.
The parsing was already accepting calc() in grid row and column gaps,
however the code was not taking that into account properly.
If the calc() had a percentage it was ignored and that's wrong.
The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().
Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::availableSpaceForGutters const):
2018-07-23 Aditya Keerthi <akeerthi@apple.com>
Remove extraneous #endif in html.css
https://bugs.webkit.org/show_bug.cgi?id=187934
Reviewed by Tim Horton.
* css/html.css: Remove extraneous #endif.
2018-07-23 Sihui Liu <sihui_liu@apple.com>
CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
https://bugs.webkit.org/show_bug.cgi?id=187927
Reviewed by Chris Dumez.
IDBKeyData is valid only when each key of it is valid.
Test: LayoutTests/storage/indexeddb/index-multientry.html
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::isValid const):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::isValid const): Deleted.
2018-07-23 Ben Richards <benton_richards@apple.com>
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-07-23 Justin Fan <justin_fan@apple.com>
[macOS] Ensure that WebGL contexts are always set to an accelerated virtual screen
https://bugs.webkit.org/show_bug.cgi?id=187923
Reviewed by Dean Jackson.
On eGPU displays, it is possible that CGL does not match the preferred renderer.
In this case, and when the web process is blocked from accessing the window server,
3D contexts *may* default to the software renderer. Ensure that even if this occurs,
we set the context to use a hardware-accelerated renderer/virtual screen.
No new tests. Existing behavior covered by existing tests.
Requires multiple screens, at least one attached to an eGPU, to stress.
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::identifyAndSetCurrentGPU):
2018-07-23 Sam Weinig <sam@webkit.org>
Convert some obvious never-null pointers to references in the editing code
https://bugs.webkit.org/show_bug.cgi?id=187914
Reviewed by Dean Jackson.
Fixup trivial cases of never-null pointers that really should be references.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
(WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
(WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
(WebCore::ApplyStyleCommand::removeCSSStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::overrideWithStyle):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::conflictsWithImplicitStyleOfElement const):
(WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes const):
(WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes const):
(WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
(WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
(WebCore::EditingStyle::mergeInlineStyleOfElement):
(WebCore::EditingStyle::wrappingStyleForSerialization):
(WebCore::EditingStyle::legacyFontSize const):
(WebCore::StyleChange::StyleChange):
(WebCore::StyleChange::extractTextStyles):
(WebCore::legacyFontSizeFromCSSValue):
* editing/EditingStyle.h:
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
* editing/Editor.cpp:
(WebCore::Editor::selectionStartCSSPropertyValue):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::isInlineNodeWithStyle):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendElement):
(WebCore::StyledMarkupAccumulator::serializeNodes):
2018-07-23 Per Arne Vollan <pvollan@apple.com>
WebCore::primaryScreenDisplayID() always return 0
https://bugs.webkit.org/show_bug.cgi?id=187922
<rdar://problem/42286933>
Reviewed by Geoffrey Garen.
This function should return a valid display ID.
No new tests. Testing this requires a dual monitor setup.
* platform/mac/PlatformScreenMac.mm:
(WebCore::primaryScreenDisplayID):
2018-07-23 Nan Wang <n_wang@apple.com>
AX: Press tab to highlight items on a webpage is not working with voiceover enabled
https://bugs.webkit.org/show_bug.cgi?id=187824
Reviewed by Zalan Bujtas.
We are deferring posting focused element change notification when the document needs a
style recalculation. However, we only perform the cache update after a layout is completed.
Added a timer to perform the cache update in the next runloop when non-layout type of mutation
happens.
Test: accessibility/mac/tab-focus-post-notification.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
(WebCore::AXObjectCache::performCacheUpdateTimerFired):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::performCacheUpdateTimerFired):
2018-07-23 Chris Dumez <cdumez@apple.com>
WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
https://bugs.webkit.org/show_bug.cgi?id=187910
<rdar://problem/42356526>
Reviewed by Brent Fulgham.
Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
for the 5 second delay.
* testing/Internals.cpp:
(WebCore::Internals::notifyResourceLoadObserver):
* testing/Internals.h:
* testing/Internals.idl:
2018-07-23 Zalan Bujtas <zalan@apple.com>
[LCF][IFC] Add support for hyphenation.
https://bugs.webkit.org/show_bug.cgi?id=187913
Reviewed by Antti Koivisto.
Move the hyphenation logic over from SimpleLineLayout::TextFragmentIterator.
* layout/inlineformatting/textlayout/Runs.h:
(WebCore::Layout::TextRun::hasHyphen const):
(WebCore::Layout::LayoutRun::setHasHyphen):
(WebCore::Layout::LayoutRun::hasHyphen const):
(WebCore::Layout::LayoutRun::LayoutRun):
(WebCore::Layout::TextRun::createNonWhitespaceRunWithHyphen):
(WebCore::Layout::TextRun::TextRun):
* layout/inlineformatting/textlayout/TextContentProvider.cpp:
(WebCore::Layout::TextContentProvider::findTextItemSlow const):
(WebCore::Layout::TextContentProvider::width const):
(WebCore::Layout::TextContentProvider::hyphenPositionBefore const):
* layout/inlineformatting/textlayout/TextContentProvider.h:
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
(WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
(WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
(WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
(WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
(WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
(WebCore::Layout::SimpleLineBreaker::Line::append):
(WebCore::Layout::SimpleLineBreaker::Line::reset):
(WebCore::Layout::SimpleLineBreaker::Style::Style):
(WebCore::Layout::SimpleLineBreaker::handleLineEnd):
(WebCore::Layout::SimpleLineBreaker::createRunsForLine):
(WebCore::Layout::SimpleLineBreaker::hyphenPositionBefore const):
(WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const):
(WebCore::Layout::SimpleLineBreaker::split const):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
2018-07-23 Antoine Quint <graouts@apple.com>
[Web Animations] Querying the current time of a finished CSSAnimation after removing its target leads to a crash
https://bugs.webkit.org/show_bug.cgi?id=187906
Reviewed by Dean Jackson.
Test: webanimations/accessing-current-time-after-finished-css-animation-target-removal.html
Because we carelessly look at a CSSAnimation's effect's timing in DeclarativeAnimation::bindingsCurrentTime
without checking that the effect is non-null, we can crash in the case where the animation is finished and
its target element has been removed, which caused the effect to be set to null.
We do not actually fix the lack of a null check, which will be the scope of a different patch, but instead
ensure that we do _not_ set the animation's effect to null when its target is removed, which used to be
performed via a call to WebAnimation::remove(). Instead, we introduce AnimationTimeline::elementWasRemoved()
which notifies the timeline of an element being removed such that we may stop referencing any animation
targeting this element from the various data structures holding strong references to the animation in question,
and we then cancel the animation silently, which is a new option that ensures promises aren't resolved or
rejected as a result.
Finally, the WebAnimation and AnimationEffectReadOnly classes established a ref-cycle as WebAnimation has
`RefPtr<AnimationEffectReadOnly> m_effect` and AnimationEffectReadOnly has `RefPtr<WebAnimation> m_animation`.
While it is correct that WebAnimation owns its effect, which is established by the DOM API, the
reverse is not correct since we only hold the reverse internally for the benefit of our implementation.
As such, we change AnimationEffectReadOnly's m_animation to be a WeakPtr<WebAnimation>. This means not
calling WebAnimation::remove() and simply removing the animation from the animation maps on the timeline
is sufficient to guarantee that the document timeline will not leak (and with it the document).
* animation/AnimationEffectReadOnly.h:
(WebCore::AnimationEffectReadOnly::setAnimation):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::elementWasRemoved):
* animation/AnimationTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::resetPendingTasks):
* animation/WebAnimation.h:
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-07-23 Aditya Keerthi <akeerthi@apple.com>
[iOS] Add support for input[type=color]
https://bugs.webkit.org/show_bug.cgi?id=187871
Reviewed by Tim Horton.
* css/html.css: Remove unwanted styling for color inputs with a list attribute.
* html/ColorInputType.cpp: Make the element focusable.
(WebCore::ColorInputType::isMouseFocusable const):
(WebCore::ColorInputType::isKeyboardFocusable const):
* html/ColorInputType.h:
* html/HTMLInputElement.h: Expose isColorControl() to WebKit.
* page/Chrome.cpp:
(WebCore::Chrome::createColorChooser):
2018-07-22 Dean Jackson <dino@apple.com>
fullscreen env() variables should have initial values
https://bugs.webkit.org/show_bug.cgi?id=187897
<rdar://problem/42485682>
Reviewed by Sam Weinig.
The env() values for fullscreen properties need to be
initialized, rather than wait for values to be set from WebKit.
Without this, feature detection doesn't work, and properties
won't parse correctly.
Test: fullscreen/fullscreen-env-initial.html
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
(WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
also updates the duration value.
(WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
(WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
* dom/ConstantPropertyMap.h:
* page/Page.cpp:
(WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
* page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
(WebCore::Page::fullscreenAutoHideDuration const):
2018-07-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add center/right/justify line alignment support.
https://bugs.webkit.org/show_bug.cgi?id=187890
Reviewed by Antti Koivisto.
Move over some more code from simple line layout.
(though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
-as opposed to iterting through the runs again when we reach the end of the line.)
* layout/inlineformatting/textlayout/Runs.h:
(WebCore::Layout::LayoutRun::setLeft):
(WebCore::Layout::LayoutRun::setExpansion):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
(WebCore::Layout::SimpleLineBreaker::Line::Line):
(WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
(WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
(WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
(WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
(WebCore::Layout::expansionOpportunity):
(WebCore::Layout::expansionBehavior):
(WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
(WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
(WebCore::Layout::SimpleLineBreaker::Line::append):
(WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
(WebCore::Layout::SimpleLineBreaker::Line::reset):
(WebCore::Layout::SimpleLineBreaker::Style::Style):
(WebCore::Layout::SimpleLineBreaker::handleLineEnd):
(WebCore::Layout::SimpleLineBreaker::handleLineStart):
(WebCore::Layout::isTextAlignRight):
(WebCore::Layout::SimpleLineBreaker::createRunsForLine):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
(WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
(WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):
2018-07-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add verification for inline text runs.
https://bugs.webkit.org/show_bug.cgi?id=187879
Reviewed by Antti Koivisto.
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
(WebCore::Layout::verifyAndOutputSubtree):
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addLayoutRuns):
(WebCore::Layout::InlineFormattingState::layoutRuns const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::TreeBuilder::showLayoutTree):
2018-07-21 Zalan Bujtas <zalan@apple.com>
[LFC] Do not use virtual methods to construct floating/formatting states.
https://bugs.webkit.org/show_bug.cgi?id=187875
Reviewed by Antti Koivisto.
LayoutContext::establishedFormattingState() does not require FormattingContext anymore only the root of the context.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutContext::formattingStateForBox const):
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::createFormattingState const): Deleted.
(WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::createFormattingState const): Deleted.
(WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-07-21 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Do not collapse top/bottom margin with first/last inflow child from a non-block formatting context.
https://bugs.webkit.org/show_bug.cgi?id=187867
Reviewed by Antti Koivisto.
The box's top/bottom margin never collapses with a non-block inflow child.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithSibling):
(WebCore::Layout::isMarginBottomCollapsedWithSibling):
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::isMarginBottomCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesBlockFormattingContextOnly const): <div style="overflow: hidden">foobar</div> establishes both inline and block formatting context (inline wins though).
* layout/layouttree/LayoutBox.h: establishesBlockFormattingContext() does not need to be virtual since we can determine it by looking at the box's style. -while in case
of inline formatting context, it is about the content.
2018-07-20 Jer Noble <jer.noble@apple.com>
REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
https://bugs.webkit.org/show_bug.cgi?id=187873
Reviewed by Jon Lee.
When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the
necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
2018-07-20 Justin Fan <justin_fan@apple.com>
Safari WebGL does not consistently provide correct GPU context on eGPU systems
https://bugs.webkit.org/show_bug.cgi?id=187750
<rdar://problem/39531436>
Reviewed by Dean Jackson.
Move GraphicsContext3DManager into its own class, and notify it when page/Chrome receives a
windowScreenDidChange message. Add a private data struct to track which hostWindow created each context.
Upon notification, Manager updates the contexts that match the hostWindow with the
provided displayID. Each context matches displayID to rendererID (set during process creation
if window server is blocked), which is matched to a virtual screen, and updates its GPU accordingly.
No new tests. This requires multiple GPUs or eGPUs, each with attached display(s), to test.
* WebCore.xcodeproj/project.pbxproj:
* page/Chrome.cpp:
(WebCore::Chrome::windowScreenDidChange): Now calls GraphicsContext3DManager::screenDidChange().
* platform/PlatformScreen.h:
* platform/ScreenProperties.h: Add rendererID to struct.
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsContext3DManager.cpp: Added (copied out of GraphicsContext3DCocoa.mm).
(WebCore::attachToAppleGraphicsControl):
(WebCore::hasMuxCapability):
(WebCore::hasMuxableGPU):
(WebCore::GraphicsContext3DManager::sharedManager):
(WebCore::displayWasReconfigured):
(WebCore::GraphicsContext3DManager::updateAllContexts):
(WebCore::GraphicsContext3DManager::screenDidChange):
(WebCore::GraphicsContext3DManager::addContext):
(WebCore::GraphicsContext3DManager::removeContext):
(WebCore::GraphicsContext3DManager::hostWindowForContext const):
(WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
(WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
(WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
* platform/graphics/GraphicsContext3DManager.h: Added (copied out of GraphicsContext3DCocoa.mm).
(WebCore::GraphicsContext3DManager::hasTooManyContexts const):
(WebCore::GraphicsContext3DManager::GraphicsContext3DManager):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::createShared):
(WebCore::identifyAndSetCurrentGPU): Now matches rendererIDs to determine virtual screen.
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextVisibility):
(WebCore::GraphicsContext3D::simulateContextChanged):
(WebCore::GraphicsContext3D::screenDidChange):
(WebCore::attachToAppleGraphicsControl): Deleted.
(WebCore::hasMuxCapability): Deleted.
(WebCore::hasMuxableGPU): Deleted.
(WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Deleted.
(WebCore::GraphicsContext3DManager::hasTooManyContexts const): Deleted.
(WebCore::manager): Deleted.
(WebCore::displayWasReconfigured): Deleted.
(WebCore::GraphicsContext3DManager::updateAllContexts): Deleted.
(WebCore::GraphicsContext3DManager::addContext): Deleted.
(WebCore::GraphicsContext3DManager::removeContext): Deleted.
(WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance): Deleted.
(WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance): Deleted.
(WebCore::GraphicsContext3DManager::updateHighPerformanceState): Deleted.
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Deleted.
(WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Deleted.
* platform/mac/PlatformScreenMac.mm: Provide a display's rendererID.
(WebCore::rendererIDForDisplayMask):
(WebCore::collectScreenProperties):
(WebCore::rendererIDForDisplay):
(WebCore::primaryRendererID):
2018-07-19 Simon Fraser <simon.fraser@apple.com>
Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
https://bugs.webkit.org/show_bug.cgi?id=187844
rdar://problem/40387294
Reviewed by Dean Jackson.
A keyframe animation which animates 3D transforms, and is fill-forwards, currently
leaves the GraphicsLayer in a state where it has a "running" animation. However, the
logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
so for running or paused animations. GraphicsLayer then thinks that it has an active
transform animation with unknown extent, and refuses to detach its backing store.
This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).
Fix by always removing animations from the GraphicsLayer when they finish, whether
or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
always call endAnimation().
This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
to fix the other code path.
Also improve some logging that would have revealed this problem sooner.
Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::endAnimation):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::endAnimation):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::endAnimation):
(WebCore::KeyframeAnimation::onAnimationEnd):
* page/animation/KeyframeAnimation.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::updateCoverage):
2018-07-20 Ryosuke Niwa <rniwa@apple.com>
Picking a color from the color panel for typing attributes needs to inverse transform through color-filter
https://bugs.webkit.org/show_bug.cgi?id=187846
Reviewed by Simon Fraser.
This patch refines the color inversion for editing introduced in r234005 so that font panels and WebKit embedders
can get and set inverted colors using attributed strings for a selected text in an editable region.
More specifically, when font panels or WebKit embedders set a font color or a background color via WebView's
_applyStyleToSelection and _applyEditingStyleToSelection, WebKit would automatically invert the color before inserting
into DOM so that the color visible to the user matches that's given to WebKit. Conversely,
[WebView attributedSubstringFromRange:nsRange] now return the color visible to the user, i.e. the color after
the color filter had been applied, so that some WebKit embedders can present the visually identical color to the user.
Because DOM never sees the color filter's effect in the computed style, etc... this patch reverts the change made to
StyleChange in r234005 to avoid inverting the color passed to execCommand. This makes editing apps which is unaware
of the dark mode or -apple-color-filter continue to function (because the color picker implemented in DOM will be
applied of the same color filter before being presented to the user).
Finally, this patch introduces a testing hook in applyCommandToFrame so that executing foreColor or backColor with
the soruce of CommandFromMenuOrKeyBinding would trigger the same code path as the one taken by Objective-C
Tests: editing/execCommand/set-backColor-with-color-filter-from-scripts.html
editing/execCommand/set-foreColor-with-color-filter-from-scripts.html
editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
editing/style/set-backColor-with-color-filter.html
editing/style/set-foreColor-with-color-filter.html
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::inverseTransformColorIfNeeded): Added.
(WebCore::StyleChange::StyleChange): Revert the change made in r234005 since this code is also used by execCommand
which is not desirable, and won't work for background color.
(WebCore::StyleChange::extractTextStyles): Ditto.
* editing/EditingStyle.h:
* editing/Editor.cpp:
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyStyleToSelection): Call EditingStyle::inverseTransformColorIfNeeded when ColorFilterMode is
set to InvertColor.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::applyCommandToFrame): Added the aforementioned testing hook.
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedStringFromRange): Take the color filtr into account. Some WebKit embedders use this
function to compute the font color in the selected text. Note that this function is mostly used for input methods
so the color doesn't really matter, and its implementation is distinct from that of HTMLConverter.
2018-07-19 Jer Noble <jer.noble@apple.com>
HLS resources with remote subresources will not taint canvasses.
https://bugs.webkit.org/show_bug.cgi?id=187731
<rdar://problem/42290703>
Reviewed by Brady Eidson.
Test: http/tests/security/canvas-remote-read-remote-video-hls.html
Most media sources are single-resource; they are accessed from a single origin. HLS manifests can contain many
subresources from arbitrary origins, and canvases should be tainted when painted from media elements whose
subresources were retrieved from tainting origins.
Add a new method to HTMLMediaElement, wouldTaintOrigin(), taking a SecurityOrigin, and returning whether the
media element would taint that origin. This gets piped all the way down to MediaPlayerPrivateAVFoundationObjC
which uses WebCoreNSURLSession to track all the origins of all the responses which resulted from the media
element's load.
Drive-by fix: also fix this issue for media elements which render to an AudioContext.
Drive-by fix #2: CanvasRenderingContext2DBase::createPattern() needs to check the return value of
ImageBuffer::create() before using it.
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didAttachRenderers):
(WebCore::HTMLMediaElement::didDetachRenderers):
(WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::wouldTaintOrigin const):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createPattern):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::wouldTaintOrigin const):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::hasSingleSecurityOrigin const):
(WebCore::MediaPlayerPrivateInterface::wouldTaintOrigin const):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
* platform/network/cocoa/WebCoreNSURLSession.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession task:didReceiveResponseFromOrigin:]):
(-[WebCoreNSURLSession wouldTaintOrigin:]):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
2018-07-20 Zalan Bujtas <zalan@apple.com>
Update FrameView::paintContents to use release logging.
https://bugs.webkit.org/show_bug.cgi?id=187854
<rdar://problem/42432371>
Reviewed by Simon Fraser.
Adding release logging helps identifying blank content cases.
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
2018-07-20 Jer Noble <jer.noble@apple.com>
First Auto-PiP from Fullscreen too small & animation blocks
https://bugs.webkit.org/show_bug.cgi?id=187745
<rdar://problem/42316583>
Reviewed by Jon Lee.
1) When Auto-PiPing, we don't have the luxury of setting up the fullscreen state
ahead of time; we get notified that PiP has already started. The area of the code
which does this just-in-time setup needs to set the video layer's frame so that the
transform within the PiP window is correct.
2) We generate a placeholder image when going into fullscreen, but we need to do
so synchronously. Create the AVPlayerItemVideoOutput up front at AVPlayerItem creation
time wherever AVPIVO is available.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::doSetup):
2018-07-20 Antoine Quint <graouts@apple.com>
DeclarativeAnimation should suspend, resume, & stop m_eventQueue
https://bugs.webkit.org/show_bug.cgi?id=187216
<rdar://problem/41669739>
Reviewed by Ryosuke Niwa.
Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::stop):
(WebCore::DeclarativeAnimation::suspend):
(WebCore::DeclarativeAnimation::resume):
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.h:
2018-07-20 Zalan Bujtas <zalan@apple.com>
[LFC][Inline formatting context] Add basic text content handling.
https://bugs.webkit.org/show_bug.cgi?id=187860
Reviewed by Antti Koivisto.
InlineFormattingContext::layout() walks through the formatting root's descendant list in a post-order fashion and
feeds the TextContentProvider.
Eventually this would turn into a more generic loop where we stop and process the text content when finding a non-text content box (float, inline-box etc), but right now
this is about text content only.
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::contentBoxBottom const):
(WebCore::Display::Box::contentBoxRight const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
* layout/inlineformatting/textlayout/TextContentProvider.cpp:
(WebCore::Layout::TextContentProvider::textRuns): Add a helper function to support the case when all we need is just the run list in one go.
* layout/inlineformatting/textlayout/TextContentProvider.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isDescendantOf const):
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutInlineBox.h:
(WebCore::Layout::InlineBox::textContent const):
2018-07-20 Youenn Fablet <youenn@apple.com>
FetchResponse should close its stream when loading finishes
https://bugs.webkit.org/show_bug.cgi?id=187790
Reviewed by Chris Dumez.
It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
This is consistent to errors sent back through callbacks.
Covered by existing tests.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::~FetchBodyOwner):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchBodySource.cpp:
(WebCore::FetchBodySource::FetchBodySource):
(WebCore::FetchBodySource::setActive):
(WebCore::FetchBodySource::setInactive):
(WebCore::FetchBodySource::doStart):
(WebCore::FetchBodySource::doPull):
(WebCore::FetchBodySource::doCancel):
(WebCore::FetchBodySource::cleanBodyOwner):
* Modules/fetch/FetchBodySource.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didFail):
2018-07-20 Jer Noble <jer.noble@apple.com>
REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
https://bugs.webkit.org/show_bug.cgi?id=187814
<rdar://problem/42391869>
Reviewed by Eric Carlson.
After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
assertion no longer holds true.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
2018-07-19 Antoine Quint <graouts@apple.com>
Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation
https://bugs.webkit.org/show_bug.cgi?id=187530
<rdar://problem/42095186>
Reviewed by Dean Jackson.
We would crash in cancelOrRemoveDeclarativeAnimation() because updateCSSAnimationsForElement() would pass
nullptr values due to the return value of cssAnimationsByName.take(nameOfAnimationToRemove). This is because
we would create animations for animation names that may be empty or not match an existing @keyframes rule.
Not only was that wasteful, but it was also non-compliant, and as a result of fixing this we're actually
seeing a progression in the CSS Animations WPT tests.
* animation/AnimationTimeline.cpp:
(WebCore::shouldConsiderAnimation): New function that performs all required steps to see if a provided animation
is valid and has a name that is not "none", not the empty string and matches the name of a @keyframes rule.
(WebCore::AnimationTimeline::updateCSSAnimationsForElement):
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): We no longer need to check whether we have
an empty animation name since we're no longer creating CSSAnimation objects in that circumstance.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::isAnimationNameValid): Add a new method that checks whether the provided animation name
a known @keyframes rule.
* css/StyleResolver.h:
2018-07-19 Chris Dumez <cdumez@apple.com>
Crash under WebCore::DocumentWriter::addData()
https://bugs.webkit.org/show_bug.cgi?id=187819
<rdar://problem/41328743>
Reviewed by Brady Eidson.
When AppCache is used a DocumentLoader may start a NetworkLoad even though it has substitute data.
In DocumentLoader::continueAfterContentPolicy(), if we have substitute data we commit this data
and call finishLoad(). However, if the case where there was a NetworkLoad started, we'll send the
ContinueDidReceiveResponse IPC back to the network process and it will start sending us data for
the load. This could lead to crashes such as <rdar://problem/41328743> since the DocumentLoader
has already committed data and finished loading when it gets the data from the network process.
To address the issue, we now call clearMainResource() in continueAfterContentPolicy(), after we've
decided to commit the substitute data. This effectively removes the DocumentLoader as a client of
the CachedResource so that its will not be notified of following load progress. We do not cancel
the load as other CachedResourceClients may be interested in the load (ApplicationCacheResourceLoader
in particular, in order to update its cached data).
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
2018-07-19 Dean Jackson <dino@apple.com>
CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: std::optional<WTF::Vector<WebCore::PluginInfo, 0ul, WTF::CrashOnOverflow, 16ul> >::operator* & + 73
https://bugs.webkit.org/show_bug.cgi?id=187820
<rdar://problem/42017759>
Reviewed by Antoine Quint.
Speculative fix for this crash, which is accessing an optional without checking
if it exists. The crash logs didn't point to a reproducible test case.
* plugins/PluginData.cpp:
(WebCore::PluginData::supportsWebVisibleMimeTypeForURL const): Return false if
the optional doesn't exist.
2018-07-19 Antoine Quint <graouts@apple.com>
Ensure DocumentTimeline is kept alive until the VM::whenIdle callback is called
https://bugs.webkit.org/show_bug.cgi?id=187692
Reviewed by Ryosuke Niwa.
Ensure we keep the DocumentTimeline alive until the VM::whenIdle callback is called.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
2018-07-18 Simon Fraser <simon.fraser@apple.com>
Setting foreground color when editing should take color-filter into account, and report the correct foreground color for collapsed selections
https://bugs.webkit.org/show_bug.cgi?id=187778
Reviewed by Ryosuke Niwa.
Fix two aspects of editing with color-filter:
1. When setting foreground color, inverse-transform the color through -apple-color-filter so that the user gets the color
they chose when in Dark Mode. Tested by editing/style/exec-command-foreColor-with-color-filter.html.
2. When retrieving the style of the collapsed selection, take color filter into account so that color picker
reflects the color the users sees, instead of the content color. Tested by editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
Add two additional tests that ensure that -apple-color-filter does not impact the NSAttributedString code
path, since -apple-color-filter should not affect the behavior of Copy.
Tests: editing/mac/attributed-string/attrib-string-colors-with-color-filter.html
editing/mac/attributed-string/attrib-string-range-with-color-filter.html
editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
editing/style/exec-command-foreColor-with-color-filter.html
* editing/EditingStyle.cpp:
(WebCore::StyleChange::StyleChange):
(WebCore::StyleChange::extractTextStyles):
* editing/EditingStyle.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::fontAttributesForSelectionStart const):
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::inverseTransformColor const):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
(WebCore::FilterOperations::inverseTransformColor const):
* platform/graphics/filters/FilterOperations.h:
2018-07-19 David Fenton <david_fenton@apple.com>
Unreviewed, rolling out r233994.
Caused EWS and bot failures due to assertions added
Reverted changeset:
"FetchResponse should close its stream when loading finishes"
https://bugs.webkit.org/show_bug.cgi?id=187790
https://trac.webkit.org/changeset/233994
2018-07-19 Jer Noble <jer.noble@apple.com>
REGRESSION(r233926): media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html is a TIMEOUT failure
https://bugs.webkit.org/show_bug.cgi?id=187813
Reviewed by Jon Lee.
In r233926, we changed the behavior of entering PiP to exit fullscreen only after entering PiP completes. The
test in question will immediately request "inline" presentation mode once the PiP animation begins, and thus
it's asking to "exit fullscreen" when both in standard fullscreen and also in PiP. The fix is not to bail out
early if we're in standard (element) fullscreen, but to allow the remaining steps to complete and exit PiP as
well.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::exitFullscreen):
2018-07-19 Zalan Bujtas <zalan@apple.com>
[LFC] Introduce simple line breaker.
https://bugs.webkit.org/show_bug.cgi?id=187688
Reviewed by Antti Koivisto.
This patch takes the simple line layout implementation and refactors it in a way it is no longer requires a RenderBlockFlow object to run on.
Also this patch decouples text run generation and line breaking (and this implementation is going to replace the current simple line layout codebase)
TextContentProvider: Acts both as the container for all the text content (including hard line breaks) and as an iterator for the generated text runs.
SimpleTextRunGenerator: TextContentProvider uses it as the text run generator for simple content (in the future we'll have a ComplexTextRunGenerator).
SimpleLineBreaker: Input -> text runs + line constraints; Output -> layout runs after line breaking.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/textlayout/ContentProvider.cpp: Added.
(WebCore::Layout::TextContentProvider::TextItem::Style::Style):
(WebCore::Layout::TextContentProvider::ContentProvider):
(WebCore::Layout::TextContentProvider::~ContentProvider):
(WebCore::Layout::TextContentProvider::appendText):
(WebCore::Layout::TextContentProvider::appendLineBreak):
(WebCore::Layout::TextContentProvider::width const):
(WebCore::Layout::TextContentProvider::textWidth const):
(WebCore::Layout::TextContentProvider::fixedPitchWidth const):
(WebCore::Layout::TextContentProvider::toTextItemIndex const):
(WebCore::Layout::TextContentProvider::length const):
(WebCore::Layout::TextContentProvider::iterator):
(WebCore::Layout::TextContentProvider::findNextRun):
(WebCore::Layout::TextContentProvider::current const):
* layout/inlineformatting/textlayout/ContentProvider.h: Added.
(WebCore::Layout::TextContentProvider::textContent const):
(WebCore::Layout::TextContentProvider::hardLineBreaks const):
(WebCore::Layout::TextContentProvider::Iterator::current const):
(WebCore::Layout::TextContentProvider::contains const):
(WebCore::Layout::TextContentProvider::Iterator::Iterator):
(WebCore::Layout::TextContentProvider::Iterator::operator++):
* layout/inlineformatting/textlayout/Runs.h: Added.
(WebCore::Layout::TextRun::isWhitespace const):
(WebCore::Layout::TextRun::isNonWhitespace const):
(WebCore::Layout::TextRun::isLineBreak const):
(WebCore::Layout::TextRun::isSoftLineBreak const):
(WebCore::Layout::TextRun::isHardLineBreak const):
(WebCore::Layout::TextRun::isValid const):
(WebCore::Layout::TextRun::isCollapsed const):
(WebCore::Layout::TextRun::type const):
(WebCore::Layout::TextRun::setIsCollapsed):
(WebCore::Layout::TextRun::setWidth):
(WebCore::Layout::LayoutRun::start const):
(WebCore::Layout::LayoutRun::end const):
(WebCore::Layout::LayoutRun::length const):
(WebCore::Layout::LayoutRun::left const):
(WebCore::Layout::LayoutRun::right const):
(WebCore::Layout::LayoutRun::width const):
(WebCore::Layout::LayoutRun::isEndOfLine const):
(WebCore::Layout::LayoutRun::setEnd):
(WebCore::Layout::LayoutRun::setRight):
(WebCore::Layout::LayoutRun::setIsEndOfLine):
(WebCore::Layout::LayoutRun::LayoutRun):
(WebCore::Layout::TextRun::createWhitespaceRun):
(WebCore::Layout::TextRun::createNonWhitespaceRun):
(WebCore::Layout::TextRun::createSoftLineBreakRun):
(WebCore::Layout::TextRun::createHardLineBreakRun):
(WebCore::Layout::TextRun::TextRun):
(WebCore::Layout::TextRun::start const):
(WebCore::Layout::TextRun::end const):
(WebCore::Layout::TextRun::length const):
(WebCore::Layout::TextRun::width const):
* layout/inlineformatting/textlayout/simple/SimpleContentProvider.cpp: Added.
(WebCore::Layout::SimpleContentProvider::SimpleContentProvider):
(WebCore::Layout::SimpleContentProvider::current const):
(WebCore::Layout::SimpleContentProvider::reset):
(WebCore::Layout::SimpleContentProvider::findNextRun):
(WebCore::Layout::SimpleContentProvider::moveToNextBreakablePosition):
(WebCore::Layout::SimpleContentProvider::moveToNextNonWhitespacePosition):
(WebCore::Layout::SimpleContentProvider::isAtLineBreak const):
(WebCore::Layout::SimpleContentProvider::isAtSoftLineBreak const):
* layout/inlineformatting/textlayout/simple/SimpleContentProvider.h: Added.
(WebCore::Layout::SimpleContentProvider::Iterator::reset):
(WebCore::Layout::SimpleContentProvider::Position::operator== const):
(WebCore::Layout::SimpleContentProvider::Position::operator< const):
(WebCore::Layout::SimpleContentProvider::Position::operator ContentPosition const):
(WebCore::Layout::SimpleContentProvider::Position::resetItemPosition):
(WebCore::Layout::SimpleContentProvider::Position::contentPosition const):
(WebCore::Layout::SimpleContentProvider::Position::itemPosition const):
(WebCore::Layout::SimpleContentProvider::Iterator<T>::Iterator):
(WebCore::Layout::SimpleContentProvider::Iterator<T>::current const):
(WebCore::Layout::SimpleContentProvider::Iterator<T>::operator):
(WebCore::Layout::SimpleContentProvider::Position::operator++):
(WebCore::Layout::SimpleContentProvider::Position::operator+=):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Added.
(WebCore::Layout::SimpleLineBreaker::TextRunList::TextRunList):
(WebCore::Layout::SimpleLineBreaker::Line::Line):
(WebCore::Layout::adjustedEndPosition):
(WebCore::Layout::SimpleLineBreaker::Line::append):
(WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
(WebCore::Layout::SimpleLineBreaker::Line::reset):
(WebCore::Layout::SimpleLineBreaker::Style::Style):
(WebCore::Layout::SimpleLineBreaker::SimpleLineBreaker):
(WebCore::Layout::SimpleLineBreaker::runs):
(WebCore::Layout::SimpleLineBreaker::createRunsForLine):
(WebCore::Layout::SimpleLineBreaker::handleOverflownRun):
(WebCore::Layout::SimpleLineBreaker::collapseLeadingWhitespace):
(WebCore::Layout::SimpleLineBreaker::collapseTrailingWhitespace):
(WebCore::Layout::SimpleLineBreaker::splitTextRun):
(WebCore::Layout::SimpleLineBreaker::split const):
(WebCore::Layout::SimpleLineBreaker::availableWidth const):
(WebCore::Layout::SimpleLineBreaker::verticalPosition const):
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Added.
(WebCore::Layout::SimpleLineBreaker::TextRunList::overrideCurrent):
(WebCore::Layout::SimpleLineBreaker::TextRunList::isCurrentOverridden const):
(WebCore::Layout::SimpleLineBreaker::Line::availableWidth const):
(WebCore::Layout::SimpleLineBreaker::Line::hasContent const):
(WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
(WebCore::Layout::SimpleLineBreaker::Line::hasTrailingWhitespace const):
(WebCore::Layout::SimpleLineBreaker::Line::isWhitespaceOnly const):
(WebCore::Layout::SimpleLineBreaker::wrapContentOnOverflow const):
(WebCore::Layout::SimpleLineBreaker::TextRunList::current const):
(WebCore::Layout::SimpleLineBreaker::TextRunList::operator++):
2018-07-19 Keith Rollin <krollin@apple.com>
Remove duplicate compilation of WebKitNSImageExtras.mm
https://bugs.webkit.org/show_bug.cgi?id=187782
Reviewed by Alex Christensen.
WebKitNSImageExtras.mm gets compiled twice, once because it's in
WebCore.xcodeproj/project.pbxproj and once because it's in
Webcore/SourcesCocoa.txt. This can lead to duplicate definition
errors, particularly when building with LTO enabled. Fix this by
removing the entry from the Xcode project.
No new tests -- no change in WebKit functionality.
* WebCore.xcodeproj/project.pbxproj:
2018-07-19 Youenn Fablet <youenn@apple.com>
FetchResponse should close its stream when loading finishes
https://bugs.webkit.org/show_bug.cgi?id=187790
Reviewed by Chris Dumez.
It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
This is consistent to errors sent back through callbacks.
Covered by existing tests.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::~FetchBodyOwner):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchBodySource.cpp:
(WebCore::FetchBodySource::FetchBodySource):
(WebCore::FetchBodySource::setActive):
(WebCore::FetchBodySource::setInactive):
(WebCore::FetchBodySource::doStart):
(WebCore::FetchBodySource::doPull):
(WebCore::FetchBodySource::doCancel):
(WebCore::FetchBodySource::cleanBodyOwner):
* Modules/fetch/FetchBodySource.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didFail):
2018-07-19 Jon Lee <jonlee@apple.com>
Update iOS fullscreen alert text again
https://bugs.webkit.org/show_bug.cgi?id=187797
rdar://problem/42373783
Reviewed by Jer Noble.
* English.lproj/Localizable.strings:
2018-07-19 Keith Rollin <krollin@apple.com>
Adjust WEBCORE_EXPORT annotations for LTO
https://bugs.webkit.org/show_bug.cgi?id=187781
<rdar://problem/42351124>
Reviewed by Alex Christensen.
Continuation of Bug 186944. This bug addresses issues not caught
during the first pass of adjustments. The initial work focussed on
macOS; this one addresses issues found when building for iOS. From
186944:
Adjust a number of places that result in WebKit's
'check-for-weak-vtables-and-externals' script reporting weak external
symbols:
ERROR: WebCore has a weak external symbol in it (/Volumes/Data/dev/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
...
These cases are caused by inline methods being marked with WTF_EXPORT
(or related macro) or with an inline function being in a class marked
as such, and when enabling LTO builds.
For the most part, address these by removing the WEBCORE_EXPORT
annotation from inline methods. In some cases, move the implementation
out-of-line because it's the class that has the WEBCORE_EXPORT on it
and removing the annotation from the class would be too disruptive.
Finally, in other cases, move the implementation out-of-line because
check-for-weak-vtables-and-externals still complains when keeping the
implementation inline and removing the annotation; this seems to
typically (but not always) happen with destructors.
No new tests. There is no changed functionality. Only the annotation
and treatment of inline methods are altered.
* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):
* platform/graphics/IntPoint.h:
(WebCore::IntPoint::IntPoint):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::Observer::~Observer):
(WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory):
(WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory):
* platform/mediastream/RealtimeMediaSource.h:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::~ServiceWorkerProvider):
* workers/service/ServiceWorkerProvider.h:
2018-07-19 Charlie Turner <cturner@igalia.com>
[GStreamer] Return a valid time values in unprerolled states
https://bugs.webkit.org/show_bug.cgi?id=187111
Reviewed by Xabier Rodriguez-Calvar.
After r230584 in bug 180253, asserts were added in
PlatformTimeRanges::add to check that both ends of the range were
valid times. In the non-MSE GStreamer player, this assert was
firing on https://www.w3.org/2010/05/video/mediaevents.html due to
seekable being called in nonprerolled states. In this case
MediaPlayerPrivateInterface::seekable was calling GStreamer's
maxTimeSeekable, which calls in durationMediaTime. The guard
against calling gst_element_query_duration when not prerolled was
returning a different time value than when the duration query
itself failed. Hence the assert firing.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
2018-07-19 Antoine Quint <graouts@apple.com>
Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
https://bugs.webkit.org/show_bug.cgi?id=187793
<rdar://problem/42308469>
Reviewed by Chris Dumez.
Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
* html/HTMLMediaElement.h:
2018-07-19 Philippe Normand <pnormand@igalia.com>
[GStreamer][MSE] imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported.html crashes
https://bugs.webkit.org/show_bug.cgi?id=187469
Reviewed by Žan Doberšek.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcFreeStream): Fix critical warning. The appsrc
element is created only when a valid sourcebuffer is in use.
2018-07-19 Frederic Wang <fwang@igalia.com>
Fix message of NotSupportedError exception thrown during custom element creation
https://bugs.webkit.org/show_bug.cgi?id=187757
Reviewed by Yusuke Suzuki.
In bug 161528, some new exceptions were introduced for custom element creation [1] but the
actual text has some issues. This patch fixes one typo and one wrong message.
[1] https://dom.spec.whatwg.org/#concept-create-element
Test: fast/custom-elements/exceptions-for-synchronous-custom-element-creation.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
2018-07-18 Jer Noble <jer.noble@apple.com>
Unreviewed API Test fix; restored a line inadventantly removed in r233926.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2018-07-18 Antoine Quint <graouts@apple.com>
[Web Animations] Interpolation between font-styles with a keyword value should be discrete
https://bugs.webkit.org/show_bug.cgi?id=187722
Reviewed by Myles Maxfield.
Animating between "font-style: normal" or "font-style: oblique" and any another value should yield a discrete
interpolation where the from-value is used from 0 and up to (but excluding) 0.5, and the to-value from 0.5 to 1.
In order to be able to detect the "normal" value, we make the "slope" of a FontSelectionRequest an optional type
where the std::nullopt value indicates "normal" and other values an "oblique" value. Since we also need to
distinguish the "italic" value from an "oblique" value, we implement a custom PropertyWrapper for the "font-style"
property where we ensure the fontStyleAxis property of the font description matches the value we're blending to.
Indeed, in the case where we may animate from "normal" to "italic", the fontStyleAxis on the blended style would
remain "slnt" since it is the base value for "normal".
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasPlainText const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
* css/CSSComputedStyleDeclaration.h:
* css/CSSFontFace.cpp:
(WebCore::calculateItalicRange):
* css/CSSFontFaceSet.cpp:
(WebCore::computeFontSelectionRequest):
* css/FontSelectionValueInlines.h:
(WebCore::fontStyleKeyword):
(WebCore::fontStyleValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStyleFromValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::PropertyWrapperFontStyle::PropertyWrapperFontStyle):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::computeHash const):
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::italic const):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::italic const):
(WebCore::FontDescription::setItalic):
(WebCore::FontDescription::setIsItalic):
(WebCore::FontCascadeDescription::initialItalic):
* platform/graphics/FontSelectionAlgorithm.cpp:
(WebCore::FontSelectionAlgorithm::styleDistance const):
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::isItalic):
(WebCore::FontSelectionRequest::tied const):
(WebCore::operator<<): Implement the required stream operator.
(WebCore::operator==): Mark this function as inline instead of constexpr since tied() is no longer constexpr
due to taking an std::optional<>.
(WebCore::operator!=):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::createFontPlatformData):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontItalic):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontItalic const):
2018-07-18 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r233926; BOOL !== bool.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
2018-07-18 Jer Noble <jer.noble@apple.com>
PiP from Element Fullscreen should match AVKit's behavior
https://bugs.webkit.org/show_bug.cgi?id=187623
Reviewed by Jon Lee.
PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
Add VideoFullscreenModelClient virutal methods for PiP change notifications:
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModelClient::hasVideoChanged):
(WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
(WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
(WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
(WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
(WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
(WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
(WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::willEnterPictureInPicture):
(VideoFullscreenModelVideoElement::didEnterPictureInPicture):
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
(VideoFullscreenModelVideoElement::willExitPictureInPicture):
(VideoFullscreenModelVideoElement::didExitPictureInPicture):
(VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::willEnterPictureInPicture):
(VideoFullscreenControllerContext::didEnterPictureInPicture):
(VideoFullscreenControllerContext::failedToEnterPictureInPicture):
(VideoFullscreenControllerContext::willExitPictureInPicture):
(VideoFullscreenControllerContext::didExitPictureInPicture):
(VideoFullscreenControllerContext::failedToExitPictureInPicture):
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
(-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
(-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
(WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
(WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
(WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
2018-07-18 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Disable CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST specified by setAllowsAnyHTTPSCertificate.
https://bugs.webkit.org/show_bug.cgi?id=187611
Reviewed by Fujii Hironori.
Current interface for TLS certificate validation for Curl port are as follows:
- WEBCORE_EXPORT void setHostAllowsAnyHTTPSCertificate(const String&);
- bool isAllowedHTTPSCertificateHost(const String&);
- bool canIgnoredHTTPSCertificate(const String&, const Vector<CertificateInfo::Certificate>&);
First one registers a host to be ignored for any certificate check. Once it is registered, no
further certificate validation check is executed.
Second one checks the host is registered in the list above.
Third one is weird. The method signature implies it checks the certificate for the host and detect
whether we can ignore this certificate for the host, but actually it just check only the host and
register the certificate into the vector. Then in the next request for the host, the certificate
will be checked with the previously stored certificate.
It's hard to understand, but in short,
- We can register a host as an exception for any TLS certificate validation.
- But only certificate arrived first is ignored, not any certificates for the host
(which is rare, but possible for mis configured web cluster).
This behavior is incomplete. To ignore any certificates of the host, these two methods are enough:
- void allowAnyHTTPSCertificatesForHost(const String&)
- bool canIgnoreAnyHTTPSCertificatesForHost(const String&)
No new tests. Covered by existing tests.
* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableSSLForHost): Ignore TLS verification for registered host.
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): Added.
(WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): Ditto.
(WebCore::CurlSSLHandle::setClientCertificateInfo): Separate lock.
(WebCore::CurlSSLHandle::getSSLClientCertificate const): Ditto and add const.
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate): Deleted.
(WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost): Deleted.
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate): Deleted.
(WebCore::CurlSSLHandle::getSSLClientCertificate): Deleted.
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::collectInfo): Renamed from verify.
(WebCore::CurlSSLVerifier::verifyCallback):
(WebCore::CurlSSLVerifier::verify): Renamed to collectInfo.
* platform/network/curl/CurlSSLVerifier.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Rename calling method.
2018-07-18 Myles C. Maxfield <mmaxfield@apple.com>
Rename WordBreak::Break to WordBreak::BreakWord
https://bugs.webkit.org/show_bug.cgi?id=187767
Reviewed by Simon Fraser.
These breaking properties are very confusing. There are:
1. word-break: break-all, a standard value that allows breaking after every
character.
2. word-break: break-word, a non-standard value which allows for breaking after
every character, but only if the word is too long for the available width (otherwise
it works the same as word-break: normal). This affects the min-content-size of the
text (and makes it equal to what it would be if word-break: break-all was
specified).
3. word-wrap: break-word, which is the same as word-break: break-word, but doesn't
affect the min-content-size of the text.
4. overflow-wrap: break-word, which is the same as word-wrap: break-word.
Because this is so confusing it's valuable for our internal enums to match the names
of the official CSS properties/values.
No new tests because there is no behavior change.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WordBreak const):
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::breakWords const):
* rendering/style/RenderStyleConstants.h:
2018-07-18 Wenson Hsieh <wenson_hsieh@apple.com>
Add SPI to defer running async script until after document load
https://bugs.webkit.org/show_bug.cgi?id=187748
<rdar://problem/42317378>
Reviewed by Ryosuke Niwa and Tim Horton.
On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
until after document load (i.e. the same timing as DOMContentLoaded).
This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
until after document load; this, in combination with the parser yielding token introduced in r233891, allows
Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
most article-like pages. See below for more details.
Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument
* dom/Document.cpp:
(WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
(WebCore::Document::finishedParsing):
Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.
* dom/Document.h:
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::documentFinishedParsing):
When the document is finished parsing, kick off the script execution timer if needed to run any async script
that has been deferred.
(WebCore::ScriptRunner::notifyFinished):
(WebCore::ScriptRunner::timerFired):
Instead of always taking from the list of async scripts to execute, check our document to see whether we should
defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.
* dom/ScriptRunner.h:
* page/Settings.yaml:
Add a WebCore setting for this behavior.
2018-07-18 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Add debug border, repaint counter state tracking to Nicosia::CompositionLayer
https://bugs.webkit.org/show_bug.cgi?id=187749
Reviewed by Carlos Garcia Campos.
Add the RepaintCounter and DebugBorder structs to
Nicosia::CompositionLayer::LayerState, tracking visibility as well as
repaint count or debug color and width.
Instances of RepaintCounter and DebugBorder types are kept in each
CoordinatedGraphicsLayer object, updating the relevant data as it is
changed (since the GraphicsLayer object isn't tracking these values on
its own). During layer flush these values (if changed) are then copied
over into the CompositionLayer state.
* platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
Also fix the year in the license header.
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
Also fix the year in the license header.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
(WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
(WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
(WebCore::CoordinatedGraphicsLayer::setDebugBorder):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2018-07-18 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
https://bugs.webkit.org/show_bug.cgi?id=187751
Reviewed by Carlos Garcia Campos.
Start including the Nicosia::CompositionLayer objects in the
CoordinatedGraphicsState struct, under a separate NicosiaState struct.
References to all the layers in a given scene are kept in a HashSet,
and a separate reference to the root layer kept in a separate member
variable.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::compositionLayer const):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
Add the getter method that returns internal Nicosia::CompositionLayer
object. This can't be defined in the class definition because of
WEBCORE_EXPORT used on the CoordinatedGraphicsLayer class.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2018-07-18 Simon Fraser <simon.fraser@apple.com>
Shrink CompositeAnimation and AnimationBase
https://bugs.webkit.org/show_bug.cgi?id=187683
Reviewed by Daniel Bates.
Reduce the size of CompositeAnimation and AnimationBase.
* page/animation/AnimationBase.h:
* page/animation/CompositeAnimation.h:
2018-07-17 Antoine Quint <graouts@apple.com>
Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().
https://bugs.webkit.org/show_bug.cgi?id=187637
<rdar://problem/42157915>
Reviewed by Dean Jackson.
Test: webanimations/empty-keyframes-crash.html
Unlike what we assumed, it is possible to have a non-declarative animation without any parsed keyframes.
This can happen as a result of calling `Element.animate({}, …)`. In this case, we want to return a null
value in timingFunctionForKeyframeAtIndex() so we update the call site in setAnimatedPropertiesInStyle()
which is the only place where we didn't check for a null value and didn't know for sure that there would
be parsed keyframes to rely on in the case of a WebAnimation instance.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
2018-07-15 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Crypto operations should copy their parameters before hoping to another thread
https://bugs.webkit.org/show_bug.cgi?id=187501
<rdar://problem/41438160>
Reviewed by Youenn Fablet.
This patch aims at making all captured variables in all crypto lambdas that need to be passed
to a worker thread thread safe, which includes:
1) changing ref counted objects to thread safe ref counted object.
2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
In addition to above changes, this patch also does the following things:
1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
to make it clear that lambdas will be passed to a secondary thread.
2) make CryptoAlgorithmParameters as const parameters for all methods.
3) add null checks on BufferSource.length() and .data().
Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
http/wpt/crypto/aes-cbc-crash.any.html
http/wpt/crypto/aes-cbc-crash.any.worker.html
http/wpt/crypto/aes-ctr-crash.any.html
http/wpt/crypto/aes-ctr-crash.any.worker.html
http/wpt/crypto/aes-gcm-crash.any.html
http/wpt/crypto/aes-gcm-crash.any.worker.html
http/wpt/crypto/derive-hmac-key-crash.any.html
http/wpt/crypto/derive-hmac-key-crash.any.worker.html
http/wpt/crypto/ecdsa-crash.any.html
http/wpt/crypto/ecdsa-crash.any.worker.html
http/wpt/crypto/hkdf-crash.any.html
http/wpt/crypto/hkdf-crash.any.worker.html
http/wpt/crypto/pbkdf2-crash.any.html
http/wpt/crypto/pbkdf2-crash.any.worker.html
http/wpt/crypto/rsa-oaep-crash.any.html
http/wpt/crypto/rsa-oaep-crash.any.worker.html
http/wpt/crypto/rsa-pss-crash.any.html
http/wpt/crypto/rsa-pss-crash.any.worker.html
http/wpt/crypto/unwrap-ec-key-crash.any.html
http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
http/wpt/crypto/unwrap-rsa-key-crash.any.html
http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
* bindings/js/BufferSource.h:
(WebCore::BufferSource::data const):
(WebCore::BufferSource::length const):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
(WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2018-07-17 Antoine Quint <graouts@apple.com>
[Web Animations] Interpolation between lengths with an "auto" value should be discrete
https://bugs.webkit.org/show_bug.cgi?id=187721
Reviewed by Dean Jackson.
When interpolating between two Length values, if one is "auto", we should use the from-value
from 0 and up to (but excluding) 0.5, and use the to-value from 0.5 to 1.
This change caused a regression in the legacy animation engine since it would create a CSS
transition even when the underlying and target values were non-interpolable. As such, the
underlying value would be used until the transition's mid-point and the tests at
legacy-animation-engine/imported/blink/transitions/transition-not-interpolable.html and
legacy-animation-engine/fast/animation/height-auto-transition-computed-value.html would fail
expecting the target value to be used immediately. We now ensure that no transition is actually
started if two values for a given property cannot be interpolated.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
* platform/Length.cpp:
(WebCore::blend):
2018-07-17 Wenson Hsieh <wenson_hsieh@apple.com>
Add an SPI hook to allow clients to yield document parsing and script execution
https://bugs.webkit.org/show_bug.cgi?id=187682
<rdar://problem/42207453>
Reviewed by Ryosuke Niwa.
Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
and we don't eat the additional cost of a web process launch if prewarming fails.
However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
original page may contend with work being done to load and render the Reader page. This is especially bad when
the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
the page is available, but before it has finished loading the Reader page. The result is that script on the
original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).
To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
a document. This capability is surfaced in the form of an opaque token which clients may request from a
WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
active tokens on the document causes it to stop yielding and resume execution of scripts if needed.
Tests: ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
ParserYieldTokenTests.TakeMultipleParserYieldTokens
ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
ParserYieldTokenTests.AsyncScriptRunsWhenFetched
* dom/Document.cpp:
(WebCore::Document::implicitOpen):
If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
start yielding immediately after creation.
(WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
(WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
* dom/Document.h:
Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
parser yield count (respectively).
(WebCore::Document::createParserYieldToken):
(WebCore::Document::hasActiveParserYieldToken const):
* dom/DocumentParser.h:
(WebCore::DocumentParser::didBeginYieldingParser):
(WebCore::DocumentParser::didEndYieldingParser):
Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
script.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::resume):
(WebCore::ScriptRunner::notifyFinished):
* dom/ScriptRunner.h:
(WebCore::ScriptRunner::didBeginYieldingParser):
(WebCore::ScriptRunner::didEndYieldingParser):
Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
and resume.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::didBeginYieldingParser):
(WebCore::HTMLDocumentParser::didEndYieldingParser):
Plumb to didBegin/didEnd calls to the HTMLParserScheduler.
* html/parser/HTMLDocumentParser.h:
* html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
parser yield token.
(WebCore::HTMLParserScheduler::isScheduledForResume const):
Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
parser is no longer scheduled to pump its tokenizer.
(WebCore::HTMLParserScheduler::didBeginYieldingParser):
(WebCore::HTMLParserScheduler::didEndYieldingParser):
When the Document begins yielding due to the documet having active tokens or ends yielding after the document
loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
to resume, we'll never get the document load or load events after relinquishing the yield token.
2018-07-17 Dirk Schulze <krit@webkit.org>
[clip-path] Implement support for margin-box as reference box and box shape
https://bugs.webkit.org/show_bug.cgi?id=127984
Reviewed by Simon Fraser.
Compute the margin-box rectangle as needed for clip-path based on the actual
computed values for the margin-top, *-left, *-bottom, *-right properties.
Test: css3/masking/clip-path-margin-box.html
* rendering/RenderBox.h:
(WebCore::RenderBox::marginBoxRect const):
* rendering/RenderBoxModelObject.h:
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
2018-07-17 Javier Fernandez <jfernandez@igalia.com>
Delete content of a single cell table should not delete the whole table
https://bugs.webkit.org/show_bug.cgi?id=173117
Reviewed by Ryosuke Niwa.
We should not extend selection looking for special elements if the
delete operation has been triggered by a caret based selection.
This change is based on a recent [1] resolution of the Editing TF,
which acknowledges that behavior of single-cell tables must be the
same that multi-cell tables and even if the last character is
deleted, we should not delete the whole table structure.
A different case would be when the user actively selects the whole
content of a table; in this case, as we do in multi-cell tables,
the structure of single-cell tables should be deleted together
with the content.
[1] https://github.com/w3c/editing/issues/163
Tests: editing/deleting/backspace-delete-last-char-in-table.html
editing/deleting/forward-delete-last-char-in-table.html
editing/deleting/select-and-delete-last-char-in-table.html
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
2018-07-16 Megan Gardner <megan_gardner@apple.com>
Correctly adjust scroll offsets when a page is zoomed
https://bugs.webkit.org/show_bug.cgi?id=187673
<rdar://problem/41712829>
Reviewed by Wenson Hsieh.
Will add test later.
Make sure that distance is scaled by the pageScaleFactor, to
make sure that we scroll correctly when we are zoomed in.
* page/ios/EventHandlerIOS.mm:
(WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
2018-07-16 Simon Fraser <simon.fraser@apple.com>
Roll out r233873 and r233875 since they caused 8 new layout test crashes.
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
(WebCore::crossThreadCopyImportParams): Deleted.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2018-07-16 Ryosuke Niwa <rniwa@webkit.org>
Release assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
https://bugs.webkit.org/show_bug.cgi?id=187713
<rdar://problem/41759548>
Reviewed by Simon Fraser.
Turn this into a debug assertion in WebKit1 on iOS since JSC API doesn't grab the web thread lock,
which means that Timer can get destroyed without the web thread lock in the main thread.
* platform/Timer.cpp:
(WebCore::TimerBase::~TimerBase):
(WebCore::TimerBase::setNextFireTime):
2018-07-16 Simon Fraser <simon.fraser@apple.com>
Add color filter for transforming colors in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=187717
rdar://problem/41146650
Reviewed by Dean Jackson.
Add a new filter function for use in -apple-color-filter for transforming colors
when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().
Test: css3/color-filters/color-filter-apple-invert-lightness.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForFilter):
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::filterOperationForType):
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFilterImage):
(WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
(WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilter):
(WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* platform/graphics/Color.cpp:
* platform/graphics/ColorUtilities.cpp:
(WebCore::sRGBToLinearComponents):
(WebCore::linearToSRGBComponents):
(WebCore::sRGBToLinearColorComponentForLuminance):
(WebCore::luminance):
(WebCore::sRGBToHSL):
(WebCore::calcHue):
(WebCore::HSLToSRGB):
(WebCore::ColorMatrix::ColorMatrix):
* platform/graphics/ColorUtilities.h:
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(PlatformCAFilters::filterValueForOperation):
(PlatformCAFilters::colorMatrixValueForFilter):
* platform/graphics/filters/FEColorMatrix.cpp:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::InvertLightnessFilterOperation::operator== const):
(WebCore::InvertLightnessFilterOperation::blend):
(WebCore::InvertLightnessFilterOperation::transformColor const):
(WebCore::operator<<):
* platform/graphics/filters/FilterOperation.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
2018-07-16 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, build fix for r233873.
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
2018-07-15 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Crypto operations should copy their parameters before hoping to another thread
https://bugs.webkit.org/show_bug.cgi?id=187501
<rdar://problem/41438160>
Reviewed by Youenn Fablet.
This patch aims at making all captured variables in all crypto lambdas that need to be passed
to a worker thread thread safe, which includes:
1) changing ref counted objects to thread safe ref counted object.
2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
In addition to above changes, this patch also does the following things:
1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
to make it clear that lambdas will be passed to a secondary thread.
2) make CryptoAlgorithmParameters as const parameters for all methods.
Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
http/wpt/crypto/aes-cbc-crash.any.html
http/wpt/crypto/aes-cbc-crash.any.worker.html
http/wpt/crypto/aes-ctr-crash.any.html
http/wpt/crypto/aes-ctr-crash.any.worker.html
http/wpt/crypto/aes-gcm-crash.any.html
http/wpt/crypto/aes-gcm-crash.any.worker.html
http/wpt/crypto/derive-hmac-key-crash.any.html
http/wpt/crypto/derive-hmac-key-crash.any.worker.html
http/wpt/crypto/ecdsa-crash.any.html
http/wpt/crypto/ecdsa-crash.any.worker.html
http/wpt/crypto/hkdf-crash.any.html
http/wpt/crypto/hkdf-crash.any.worker.html
http/wpt/crypto/pbkdf2-crash.any.html
http/wpt/crypto/pbkdf2-crash.any.worker.html
http/wpt/crypto/rsa-oaep-crash.any.html
http/wpt/crypto/rsa-oaep-crash.any.worker.html
http/wpt/crypto/rsa-pss-crash.any.html
http/wpt/crypto/rsa-pss-crash.any.worker.html
http/wpt/crypto/unwrap-ec-key-crash.any.html
http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
http/wpt/crypto/unwrap-rsa-key-crash.any.html
http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
(WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2018-07-16 Said Abou-Hallawa <sabouhallawa@apple.com>
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
https://bugs.webkit.org/show_bug.cgi?id=187375
Reviewed by Simon Fraser.
An immediate-paint transaction should force all the images which are pending
decoding to be repainted.
To do that, FrameView::paintControlTints() will be re-factored to a new
generic function such that it takes PaintInvalidationReasons. The new function
which is named 'traverseForPaintInvalidation' will traverse the render tree
for a specific PaintInvalidationReasons.
invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
the underlying image and repaint all the clients which are waiting for the
decoding to finish.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::createImage):
(WebCore::CachedImage::imageFrameAvailable):
(WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
* loader/cache/CachedImage.h:
* page/FrameView.cpp:
(WebCore::FrameView::paintScrollCorner):
(WebCore::FrameView::updateControlTints):
(WebCore::FrameView::traverseForPaintInvalidation):
(WebCore::FrameView::adjustPageHeightDeprecated):
(WebCore::FrameView::paintControlTints): Deleted.
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::paint):
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::performingPaintInvalidation const):
(WebCore::GraphicsContext::invalidatingControlTints const):
(WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
(WebCore::GraphicsContext::updatingControlTints const): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::paintLayer):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::paint):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* testing/Internals.cpp:
(WebCore::Internals::invalidateControlTints):
(WebCore::Internals::paintControlTints): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-07-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed attempt to fix the build.
* rendering/RenderThemeMac.mm:
2018-07-11 Dean Jackson <dino@apple.com>
Allow removal of white backgrounds
https://bugs.webkit.org/show_bug.cgi?id=187574
<rdar://problem/41146792>
Reviewed by Simon Fraser.
Add a drawing mode that turns white backgrounds into transparent
regions, such that a hosting app can see through to its window.
Test: css3/color-filters/punch-out-white-backgrounds.html
* page/Settings.yaml: New Setting.
* rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
if the background is white and we are punching out backgrounds, which means
that it will erase the destination.
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBackground): Ditto.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
the composition mode if necessary.
2018-07-16 David Fenton <david_fenton@apple.com>
Unreviewed, rolling out r233867.
caused build failures on High Sierra, Sierra and iOS
Reverted changeset:
"[WebCrypto] Crypto operations should copy their parameters
before hoping to another thread"
https://bugs.webkit.org/show_bug.cgi?id=187501
https://trac.webkit.org/changeset/233867
2018-07-15 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Crypto operations should copy their parameters before hoping to another thread
https://bugs.webkit.org/show_bug.cgi?id=187501
<rdar://problem/41438160>
Reviewed by Youenn Fablet.
This patch aims at making all captured variables in all crypto lambdas that need to be passed
to a worker thread thread safe, which includes:
1) changing ref counted objects to thread safe ref counted object.
2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
In addition to above changes, this patch also does the following things:
1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
to make it clear that lambdas will be passed to a secondary thread.
2) make CryptoAlgorithmParameters as const parameters for all methods.
Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
http/wpt/crypto/aes-cbc-crash.any.html
http/wpt/crypto/aes-cbc-crash.any.worker.html
http/wpt/crypto/aes-ctr-crash.any.html
http/wpt/crypto/aes-ctr-crash.any.worker.html
http/wpt/crypto/aes-gcm-crash.any.html
http/wpt/crypto/aes-gcm-crash.any.worker.html
http/wpt/crypto/derive-hmac-key-crash.any.html
http/wpt/crypto/derive-hmac-key-crash.any.worker.html
http/wpt/crypto/ecdsa-crash.any.html
http/wpt/crypto/ecdsa-crash.any.worker.html
http/wpt/crypto/hkdf-crash.any.html
http/wpt/crypto/hkdf-crash.any.worker.html
http/wpt/crypto/pbkdf2-crash.any.html
http/wpt/crypto/pbkdf2-crash.any.worker.html
http/wpt/crypto/rsa-oaep-crash.any.html
http/wpt/crypto/rsa-oaep-crash.any.worker.html
http/wpt/crypto/rsa-pss-crash.any.html
http/wpt/crypto/rsa-pss-crash.any.worker.html
http/wpt/crypto/unwrap-ec-key-crash.any.html
http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
http/wpt/crypto/unwrap-rsa-key-crash.any.html
http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
(WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:
2018-07-16 Aditya Keerthi <akeerthi@apple.com>
[Datalist][macOS] Add suggestions UI for TextFieldInputTypes
https://bugs.webkit.org/show_bug.cgi?id=186531
Reviewed by Tim Horton.
Tests: fast/forms/datalist/datalist-show-hide.html
fast/forms/datalist/datalist-textinput-keydown.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton): The suggestions view takes precedence when handling arrow key events.
2018-07-16 Jeremy Jones <jeremyj@apple.com>
Fullscreen requires active document.
https://bugs.webkit.org/show_bug.cgi?id=186226
rdar://problem/36187413
Reviewed by Jer Noble.
Test: media/no-fullscreen-when-hidden.html
This change guarantees the document to be visible for both element fullscreen and video fullscreen.
User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
be hidden.
Document::hidden() can't be relied upon because it won't update while JavaScript spins.
This change adds a sync call to the UI process to get the current UI visibility state.
* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* page/ChromeClient.h:
2018-07-16 Alex Christensen <achristensen@webkit.org>
Reduce size of NetworkLoadMetrics and therefore ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=187671
Reviewed by Darin Adler.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::toProtocol):
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy const):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::clearNonTimingData):
2018-07-16 Chris Dumez <cdumez@apple.com>
Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=187702
Reviewed by Youenn Fablet.
Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since
it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is
ThreadSafeRefCounted and frequently passed to other threads.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2018-07-16 Sihui Liu <sihui_liu@apple.com>
IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
https://bugs.webkit.org/show_bug.cgi?id=187631
<rdar://problem/42164227>
Reviewed by Brady Eidson.
When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin
is that origin. Given that the origin may create IndexedDB from subframes, we should delete
databases whose openingOrigin is that origin too.
Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
2018-07-16 Simon Fraser <simon.fraser@apple.com>
Shrink some font-related classes and enums
https://bugs.webkit.org/show_bug.cgi?id=187686
Reviewed by Myles Maxfield.
Use enum class for enums in TextFlags.h and make them one byte big.
Re-order members of Font to shrink it from 360 to 328 bytes.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontSmoothingMode const):
(WebCore::CSSPrimitiveValue::operator FontSmallCaps const):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode const):
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::verticalRightOrientationFont const):
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::offsetToMiddleOfGlyph):
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::advancedTextRenderingMode const):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::glyphPageFromFontRanges):
* platform/graphics/FontDescription.cpp:
(WebCore::FontCascadeDescription::FontCascadeDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::setTextRenderingMode):
(WebCore::FontDescription::setOrientation):
(WebCore::FontDescription::setWidthVariant):
(WebCore::FontCascadeDescription::setFontSmoothing):
(WebCore::FontCascadeDescription::initialSmallCaps):
(WebCore::FontCascadeDescription::initialFontSmoothing):
(WebCore::FontCascadeDescription::initialTextRenderingMode):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isForTextCombine const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::showGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformWidthForGlyph const):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash const):
(WebCore::mapFontWidthVariantToCTFeatureSelector):
(WebCore::FontPlatformData::ctFont const):
(WebCore::FontPlatformData::description const):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::buildScaledFont):
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformWidthForGlyph const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::fontFeatures):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes const):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformWidthForGlyph const):
* platform/text/TextFlags.h:
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/TextPainter.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::fontAndGlyphOrientation):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
2018-07-16 Sergio Villar Senin <svillar@igalia.com>
[WebVR] Add support for connect/disconnect and mount/unmount device events
https://bugs.webkit.org/show_bug.cgi?id=187343
Reviewed by Žan Doberšek.
WebVR specs define a series of events as part of the Window Interface Extension. We're
adding support for the connect/disconnect and mount/unmount events both at the module level
and the platform level using OpenVR.
In order to do that we need to keep lists of VRPlatformDisplays at platform level and
VRDisplays at bindings level. We then update those lists accordingly to detect potential
additions/removals, and emit the corresponding signals. A new client interface
VRPlatformDisplayClient was also defined so that VRPlatformDisplay implementations could
notify their clients (typically a VRDisplay).
Last but not least, NavigatorWebVR was updated so it supplements Navigator instead of
supplementing Page.
* Modules/webvr/NavigatorWebVR.cpp: Supplement Navigator not Page.
(WebCore::NavigatorWebVR::getVRDisplays): Keep a list of VRDisplays and update them
conveniently, also emitting the required events under certain conditions (like device
disconnection).
(WebCore::NavigatorWebVR::supplementName): New method.
(WebCore::NavigatorWebVR::from): Ditto.
* Modules/webvr/NavigatorWebVR.h: Supplement Navigator not Page.
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::create): Moved suspendIfNeeded() to constructor.
(WebCore::VRDisplay::VRDisplay): Set itself as VRPlatformDisplay client.
(WebCore::VRDisplay::~VRDisplay): Unset as VRPlatformDisplay client.
(WebCore::VRDisplay::VRPlatformDisplayConnected): Dispatch event on DOM window.
(WebCore::VRDisplay::VRPlatformDisplayDisconnected): Ditto.
(WebCore::VRDisplay::VRPlatformDisplayMounted): Ditto.
(WebCore::VRDisplay::VRPlatformDisplayUnmounted): Ditto.
* Modules/webvr/VRDisplay.h: Extend from VRPlatformDisplayClient.
(WebCore::VRDisplay::document):
* Modules/webvr/VRDisplayEvent.cpp: Updated Copyright.
* Modules/webvr/VRDisplayEvent.h: Ditto.
* Sources.txt: Added the two new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/vr/VRManager.cpp:
(WebCore::VRManager::getVRDisplays): Keep a list of VRPlatformDisplays and update them conveniently,
also emitting the required events under certain conditions (like device disconnection).
* platform/vr/VRManager.h:
* platform/vr/VRPlatformDisplay.cpp: New file with common implementations for VRPlatformDisplays.
(WebCore::VRPlatformDisplay::setClient):
(WebCore::VRPlatformDisplay::notifyVRPlatformDisplayEvent):
* platform/vr/VRPlatformDisplay.h: Added a generic method to notify about different
events. Added the client pointer.
* platform/vr/VRPlatformDisplayClient.h: New file. VRPlatformDisplay implementations will
call the client methods in the event of some circumstances happening.
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayConnected):
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayDisconnected):
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayMounted):
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayUnmounted):
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::updateDisplayInfo): Poll the device for new events to
detect connection/disconnections or device activations/deactivations (HMD
mounted/unmounted).
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2018-07-16 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
https://bugs.webkit.org/show_bug.cgi?id=187693
Reviewed by Carlos Garcia Campos.
Add the Nicosia::PlatformLayer class. This will be the base platform
layer class from which different derivatives will be created, addressing
different use cases. The generic PlatformLayer type alias will point to
this class in the future.
First class deriving from Nicosia::PlatformLayer is
Nicosia::CompositionLayer, purpose of which will be to mirror the state
that's stored in the platform-specific GraphicsLayer derivative. It will
also allow making thread-safe updates to that state.
CoordinatedGraphicsLayer implementation now spawns a CompositionLayer
object and tracks state changes in a separate
CompositionLayer::LayerState::Delta object. During flushing, the changed
state is applied to the layer's pending state before the delta is nulled
out. The updated state isn't used anywhere yet, but future changes will
implement committing this state into the rendering pipeline.
There's bits of state not yet being managed by CompositionLayer, e.g.
debug visuals, filters and animations. These will be addressed later.
The m_solidColor member variable is added to CoordinatedGraphicsLayer in
order to properly store the solid color value. Normally this would be
contained by the parent GraphicsLayer class, but no such member variable
exists there.
* platform/TextureMapper.cmake:
* platform/graphics/nicosia/NicosiaPlatformLayer.cpp: Added.
(Nicosia::PlatformLayer::PlatformLayer):
(Nicosia::CompositionLayer::CompositionLayer):
* platform/graphics/nicosia/NicosiaPlatformLayer.h: Added.
(Nicosia::PlatformLayer::isCompositionLayer const):
(Nicosia::PlatformLayer::id const):
(Nicosia::CompositionLayer::create):
(Nicosia::CompositionLayer::LayerState::Flags::Flags):
(Nicosia::CompositionLayer::updateState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(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::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
(WebCore::CoordinatedGraphicsLayer::syncChildren):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2018-07-15 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web process
https://bugs.webkit.org/show_bug.cgi?id=187690
<rdar://problem/41869703>
Reviewed by Tim Horton.
Work around unexpected behavior when soft-linking AVFoundation. After using `dlopen_preflight` to check for the
existence of a library prior to loading the library using `dlopen`, `dlsym` subsequently returns null for some
symbols that would otherwise be available. This causes us to RELEASE_ASSERT later down the road when we try to
load AVAudioSessionModeDefault in AudioSessionIOS.mm.
To fix this for now, simply check for the library directly instead of using the more lightweight preflight
check. See clone: <rdar://problem/42224780> for more detail.
* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
(WebCore::AVFoundationMIMETypeCache::isAvailable const):
2018-07-14 Simon Fraser <simon.fraser@apple.com>
Shrink StyleFillData, StyleStrokeData and StyleMiscData
https://bugs.webkit.org/show_bug.cgi?id=187681
Reviewed by Anders Carlsson.
Shrink these data structures by making more enum classes one byte in size, and
re-ordering. StyleFillData goes from 56 to 48, StyleStrokeData from 80 to 72,
StyleMiscData from 40 to 32 bytes.
* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleFillData::StyleFillData):
(WebCore::StyleFillData::operator== const):
(WebCore::StyleStrokeData::StyleStrokeData):
(WebCore::StyleStrokeData::operator== const):
(WebCore::StyleStopData::operator== const):
(WebCore::StyleMiscData::StyleMiscData):
* rendering/style/SVGRenderStyleDefs.h:
2018-07-14 Simon Fraser <simon.fraser@apple.com>
Shrink CachedResource and subclasses
https://bugs.webkit.org/show_bug.cgi?id=187546
Reviewed by Daniel Bates.
Shrink CachedResource down from 1384 to 1336 bytes, CachedImage from 1480 to
1424 bytes, and CachedFont a little.
This saves about 23KB on cnn.com.
* loader/ResourceLoaderOptions.h:
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResource.h:
* platform/network/CacheValidation.h:
(WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
* platform/network/NetworkLoadMetrics.h:
* platform/network/ParsedContentRange.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
2018-07-14 Simon Fraser <simon.fraser@apple.com>
Shrink some style-related classes and enums
https://bugs.webkit.org/show_bug.cgi?id=187680
Reviewed by Antti Koivisto.
Make all the enum classes in RenderStyleConstants be one byte big (all have less
than 256 values).
Shrink DocumentRuleSet from 384 to 368 bytes by re-ordering, which also helps shrink
StyleResolver from 1024 to 952 bytes.
Shrink BorderValue by re-ordering (now that the layout of Color has changed) which
shrinks BorderData from 168 to 136 bytes.
Convert a couple of other enums to enum class so that they can have explicit size.
* css/DocumentRuleSets.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle const):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium const):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::cascadedPropertiesForRollback):
(WebCore::StyleResolver::applyProperty):
(WebCore::cascadeLevelForIndex):
* css/StyleResolver.h:
* rendering/style/BorderValue.h:
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyleConstants.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::overrideComputedStyle):
2018-07-14 Kocsen Chung <kocsen_chung@apple.com>
Ensure WebKit stack is ad-hoc signed
https://bugs.webkit.org/show_bug.cgi?id=187667
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig:
2018-07-14 Dirk Schulze <krit@webkit.org>
[css-masking] Fully support -webkit-clip-path on SVG elements
https://bugs.webkit.org/show_bug.cgi?id=185829
Reviewed by Simon Fraser.
-webkit-clip-path contributes to SVG elements with boxes, shapes and now with
element references to <clipPath> elements as well. Make sure that all types
contribute to hit-testing of the SVG element as well as they should.
Tests: svg/clip-path/webkit-clip-path-after-expected.svg
svg/clip-path/webkit-clip-path-after.svg
svg/clip-path/webkit-clip-path-before-expected.svg
svg/clip-path/webkit-clip-path-before.svg
svg/dynamic-updates/SVGClipPath-prefixed-influences-hitTesting.html
svg/dynamic-updates/SVGClipPath-prefixed-path-influences-hitTesting.html
svg/dynamic-updates/SVGClipPathElement-prefixed-css-transform-influences-hitTesting.html
svg/dynamic-updates/SVGClipPathElement-prefixed-transform-influences-hitTesting.html
* rendering/svg/SVGRenderSupport.cpp: Share code as much as possible.
(WebCore::clipPathReferenceBox):
(WebCore::isPointInCSSClippingArea): Take -webkit-clip-path into account.
(WebCore::SVGRenderSupport::clipContextToCSSClippingArea):
(WebCore::SVGRenderSupport::pointInClippingArea):
* rendering/svg/SVGRenderSupport.h:
* rendering/svg/SVGRenderingContext.cpp: Clip to -webkit-clip-path boxes, shapes and references.
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
* rendering/svg/SVGResources.cpp: Add -webkit-clip-path references to cached resources. Mimic SVG clip-path.
(WebCore::SVGResources::buildCachedResources):
2018-07-13 Simon Fraser <simon.fraser@apple.com>
Avoid fetching visitedDependentColor() so many times in editing code
https://bugs.webkit.org/show_bug.cgi?id=187676
Reviewed by Zalan Bujtas.
editingAttributedStringFromRange called style.visitedDependentColor() twice for each property,
and fontAttributesForSelectionStart() called it two or three times. Use a local Color variable
to avoid so many calls. Also replace a call to alpha() with isVisible() which makes the usage more clear.
No behavior change.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::fontAttributesForSelectionStart const):
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedStringFromRange):
2018-07-13 Youenn Fablet <youenn@apple.com>
Support connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=187627
<rdar://problem/35334400>
Reviewed by Jer Noble.
When MediaStreamAudioSource is called to read new audio samples,
convert these samples to a WebAudioBufferList and call RealtimeMediaSource::audioSamplesAvailable.
This makes its observers to get the audio data.
Test: webrtc/peer-connection-createMediaStreamDestination.html
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create): Minor refactoring.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::createMediaStream):
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::process):
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
(WebCore::MediaStreamAudioSource::consumeAudio):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: Added.
(WebCore::streamDescription):
(WebCore::MediaStreamAudioSource::consumeAudio):
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/AudioDestinationConsumer.h: Removed.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
* platform/mediastream/MediaStreamPrivate.h:
2018-07-13 Christopher Reid <chris.reid@sony.com>
[WinCairo] Enable WebGL when Accelerated Compositing is disabled
https://bugs.webkit.org/show_bug.cgi?id=187664
Reviewed by Fujii Hironori.
AC was disabled for WinCairo in r233725 but it can still run WebGL without AC.
* html/HTMLCanvasElement.cpp:
2018-07-13 Chris Dumez <cdumez@apple.com>
Crash under ApplicationCacheGroup::didFailLoadingEntry()
https://bugs.webkit.org/show_bug.cgi?id=187661
<rdar://problem/42179755>
Reviewed by Youenn Fablet.
If ApplicationCacheResourceLoader::create() fails synchronously with
ApplicationCacheResourceLoader::Error::CannotCreateResource error, then
m_entryLoader will be null when didFailLoadingEntry() is called. However,
didFailLoadingEntry() fails to null check m_entryLoader before using it.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::startLoadingEntry):
* loader/appcache/ApplicationCacheGroup.h:
2018-07-13 Alex Christensen <achristensen@webkit.org>
Add release assertion to check thread in TimerBase::setNextFireTime
https://bugs.webkit.org/show_bug.cgi?id=187666
Reviewed by Ryosuke Niwa.
This should give us insight into what is causing <rdar://problem/33352721>
* platform/Timer.cpp:
(WebCore::TimerBase::setNextFireTime):
2018-07-13 Ryosuke Niwa <rniwa@webkit.org>
[iOS] [WK1] Crash inside IOSurfacePool::platformGarbageCollectNow() in WebThread
https://bugs.webkit.org/show_bug.cgi?id=187635
<rdar://problem/34297065>
Reviewed by Simon Fraser.
r167717 added code to trigger a CA commit in the web process via platformGarbageCollectNow() in order to free IOSurface-related memory.
However, that code is also running in the web thread in apps using WebKit1, causing unwanted UIView layout on the web thread.
Fix by not triggering this CA commit if it's called on the web thread.
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
(WebCore::IOSurfacePool::platformGarbageCollectNow):
2018-07-13 Antoine Quint <graouts@apple.com>
Dark Mode: document markers are difficult to see
https://bugs.webkit.org/show_bug.cgi?id=187632
<rdar://problem/41099719>
Reviewed by Simon Fraser.
We update the way we draw the document markers for macOS and use more constrasting colors in dark mode.
Paving the way for future improvements, we move the drawLineForDocumentMarker() method from GraphicsContext
to RenderTheme and implement a first version in RenderThemeMac. The circles used for the underline are now
drawn directly with Core Graphics and we no longer use an image resource. To allow both GraphicsContext
and RenderTheme to have different versions of the drawLineForDocumentMarker() method, the DocumentMarkerLineStyle
enum is now an "enum class".
No new test due to webkit.org/b/105616, webkit.org/b/187655 was raised to track the creation of new tests
when it becomes possible again.
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawLineForDocumentMarker):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawLineForDocumentMarker):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawLineForDocumentMarker::create):
(WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawLineForDocumentMarker):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawLineForDocumentMarker):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker): Call drawLineForDocumentMarker() on the RenderTheme on
macOS and on GraphicsContext in all other cases.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::drawLineForDocumentMarker):
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::colorForStyle): Provide different colors for light and dark modes.
(WebCore::RenderThemeMac::drawLineForDocumentMarker): A new macOS-specific version of drawLineForDocumentMarker()
where we paint circles using Core Graphics directly.
2018-07-13 Charlie Turner <cturner@igalia.com>
[GStreamer] Use smart pointers for GstByteReader
https://bugs.webkit.org/show_bug.cgi?id=187638
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Add
specialisation for GstByteReader.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
Use the new smart pointer class to avoid needing to remember where
to call gst_byte_reader_free.
(webKitMediaClearKeyDecryptorDecrypt):
2018-07-13 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Move HTTP Setup logic from CurlRequest to CurlHandle for reuse.
https://bugs.webkit.org/show_bug.cgi?id=187427
Reviewed by Fujii Hironori.
CurlContext will be used by Secure WebSocket client, but HTTP setup code is
in CurlRequest, which is only for regular HTTP/HTTPS transaction. This patch
allows wss client to setup CurlHandle for HTTPS communication, such as TLS,
proxy or authentication.
No new tests because there's no behavior change.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::CurlHandle):
(WebCore::CurlHandle::enableSSLForHost):
(WebCore::CurlHandle::willSetupSslCtx):
(WebCore::CurlHandle::willSetupSslCtxCallback):
(WebCore::CurlHandle::sslErrors const):
(WebCore::CurlHandle::setUrl):
(WebCore::CurlHandle::enableHttp):
(WebCore::CurlHandle::enableConnectionOnly):
(WebCore::CurlHandle::certificateInfo const):
(WebCore::CurlHandle::enableStdErrIfUsed):
(WebCore::CurlHandle::initialize): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlHandle::url const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::willSetupSslCtx): Deleted.
(WebCore::CurlRequest::willSetupSslCtxCallback): Deleted.
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::verify):
* platform/network/curl/CurlSSLVerifier.h:
2018-07-13 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
https://bugs.webkit.org/show_bug.cgi?id=187636
Reviewed by Carlos Garcia Campos.
When we have more than one source buffer, only one will be
rendered and the inactive branch will report linking errors that
we have to deal with.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GstFlowCombiner.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webkitMediaSrcChain): Combine the flow in the flow combiner.
(webkit_media_src_init): Initialize the flow combiner.
(webKitMediaSrcLinkStreamToSrcPad): Add the proxypad to the
combiner and set the chain function.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
Declare the flow combiner.
2018-07-13 Charlie Turner <cturner@igalia.com>
[GStreamer] Add GstBufferMapped abstraction
https://bugs.webkit.org/show_bug.cgi?id=187600
Reviewed by Xabier Rodriguez-Calvar.
There is a similar abstraction called `mapGstBuffer` and friends,
which have a slightly different use-case: wanting a buffer that is
mapped for a longer lifetime without have to keep track of the map
infos separately. They could be subsumed by this abstraction, but
everytime they need to write to the buffer, they'd have to remap
the memory blocks.
This abstraction is more for one-short reads and writes saving the user
from remembering to unmap the buffer and having to manage to
auxiliary GstMapInfo structures.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::GstMappedBuffer):
(WebCore::GstMappedBuffer::~GstMappedBuffer):
(WebCore::GstMappedBuffer::data):
(WebCore::GstMappedBuffer::size const):
(WebCore::GstMappedBuffer::operator bool const):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorSetupCipher):
(webKitMediaClearKeyDecryptorDecrypt):
2018-07-12 Wenson Hsieh <wenson_hsieh@apple.com>
Make it easier to hit the significant rendered text layout milestone on pages with main article elements
https://bugs.webkit.org/show_bug.cgi?id=187578
<rdar://problem/42104637>
Reviewed by Ryosuke Niwa.
Our current heuristics for triggering the significant rendered text layout milestone are very conservative, with
the intention of avoiding false positives. In practice, we can relax some of these constraints when we've
detected the presence of a main article element on the page. (e.g. in New York Times articles). See per-method
changes below for more detail.
Test: RenderingProgressTests.DidRenderSignificantAmountOfText
* dom/Document.cpp:
(WebCore::Document::registerArticleElement):
(WebCore::Document::unregisterArticleElement):
(WebCore::Document::updateMainArticleElementAfterLayout):
As a post layout task, update the main article element by looping through the articles (up to a maximum limit of
10) in search of an article element that is several times larger than the second largest article element.
* dom/Document.h:
Store a set containing the article elements in the document, as well as the current main article on the page.
(WebCore::Document::hasMainArticleElement const):
* html/Element.cpp:
(WebCore::Element::insertedIntoAncestor):
(WebCore::Element::removedFromAncestor):
Keep track of the article elements that exist in the document whenever elements with the article tag are added
to or removed from the document.
* page/FrameView.cpp:
Add new minimum thresholds for firing the significant rendered text milestone when there exists a main article.
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
Take the main article element into consideration when determining whether to fire the significant text
layout milestone.
2018-07-12 Daniel Bates <dabates@apple.com>
JavaScript URL gives incorrect result when frame is navigated
https://bugs.webkit.org/show_bug.cgi?id=187203
<rdar://problem/41438443>
Reviewed by David Kilzer.
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame):
2018-07-12 Alex Christensen <achristensen@webkit.org>
Reduce size of WebCore::URL
https://bugs.webkit.org/show_bug.cgi?id=186820
Reviewed by Yusuke Suzuki and Youenn Fablet.
We were using 32 bits for the length of the port, which is always between 0 and 5 inclusive
because port numbers are missing or between 0 and 65535. Let's just use 3 bits here.
We were using 32 bits for the length of the scheme, which is usually 3-5 characters and can be
longer for some custom schemes, but I've never seen one more than 20 characters. If we assume
schemes are always less than 64MB, we can save 8 bytes per URL!
No change in behavior, just less memory use!
To restore the IPC encoding to how it was before r221165, I just encode the string and reparse it.
* platform/URL.cpp:
(WebCore::URL::invalidate):
(WebCore::URL::lastPathComponent const):
(WebCore::URL::port const):
(WebCore::URL::protocolHostAndPort const):
(WebCore::URL::path const):
(WebCore::URL::removePort):
(WebCore::URL::setPort):
(WebCore::URL::setHostAndPort):
(WebCore::URL::setPath):
* platform/URL.h:
(WebCore::URL::encode const):
(WebCore::URL::decode):
(WebCore::URL::hasPath const):
(WebCore::URL::pathStart const):
* platform/URLParser.cpp:
(WebCore::URLParser::copyBaseWindowsDriveLetter):
(WebCore::URLParser::urlLengthUntilPart):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::shouldPopPath):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parse):
(WebCore::URLParser::parsePort):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::allValuesEqual):
(WebCore::URLParser::internalValuesConsistent):
* workers/service/server/RegistrationDatabase.cpp:
Increment the service worker registration schema version because of the URL encoding change.
2018-07-12 Youenn Fablet <youenn@apple.com>
Add a FrameLoaderClient willInjectUserScriptForFrame callback
https://bugs.webkit.org/show_bug.cgi?id=187565
Reviewed by Alex Christensen.
Test: http/tests/contentextensions/injected-script-callback.html.
* loader/FrameLoaderClient.h:
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
Calling the new callback whenever being about to inject a new script.
2018-07-12 Megan Gardner <megan_gardner@apple.com>
Keep Selections within Shadow DOM boundaries
https://bugs.webkit.org/show_bug.cgi?id=187556
<rdar://problem/41664567>
Reviewed by Ryosuke Niwa.
Expose needed functionality to WebKit to help with determing editing and shadow dom boundries.
Only exposing functionality to WebKit.
* dom/TreeScope.h:
* editing/Editing.h:
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::adjustPositionForEnd const):
(WebCore::VisibleSelection::adjustPositionForStart const):
(WebCore::adjustPositionForEnd): Deleted.
(WebCore::adjustPositionForStart): Deleted.
* editing/VisibleSelection.h:
2018-07-12 Sihui Liu <sihui_liu@apple.com>
IndexedDB: database file of subframe cannot be removed
https://bugs.webkit.org/show_bug.cgi?id=187564
Reviewed by Youenn Fablet.
For IndexedDB, if openingOrigin is different from mainFrameOrigin, there will be another
layer in the database file path.
IDBServer should delete database files recursively to make sure all files are removed.
Covered by modified test: WebKit.WebsiteDataStoreCustomPaths.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::removeAllDatabasesForOriginPath):
2018-07-12 Per Arne Vollan <pvollan@apple.com>
Add compile guard for enabling NSRunLoop in the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=187563
Reviewed by Chris Dumez.
No new tests, no change in behavior.
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):
2018-07-12 Zalan Bujtas <zalan@apple.com>
Newly added float should trigger full layout on the block.
https://bugs.webkit.org/show_bug.cgi?id=187251
<rdar://problem/41726137>
Reviewed by David Kilzer.
RenderBlockFlow::determineStartPosition() is one of the places where we decide the extent of the line layout for the current block.
In here we try to figure out the first line in the block that requires layout. In certain cases when floats are present,
(due to their intrusive behavior) we just trigger a full layout on the entire block.
One of the special cases is when a new float is added to the block. determineStartPosition() checks for such floats (floats inserted
after the "last known float") and marks the block for full layout. However it missed the case when other, unrelated mutations happened
in addition to this newly inserted float. This patch fixes this case by checking if the floats after the "last know float" actually need layout.
Test: fast/inline/new-float-needs-layout-when-line-is-dirty.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::determineStartPosition):
2018-07-12 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Add pads to the GstFlowCombiner in MediaStreamSrc
https://bugs.webkit.org/show_bug.cgi?id=187552
Reviewed by Alejandro G. Castro.
This was overlooked and it is the way the API is supposed to be used.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcAddPad):
2018-07-12 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Thread VM& to JSCell::methodTable(VM&)
https://bugs.webkit.org/show_bug.cgi?id=187548
Reviewed by Saam Barati.
* bindings/js/JSDOMConstructorBase.h:
(WebCore::JSDOMConstructorBase::className):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementCustomGetCallData):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceName::estimatedSize):
* bindings/scripts/test/JS/JSInterfaceName.h:
2018-07-11 Youenn Fablet <youenn@apple.com>
MediaDevices should derive from EventTarget in its IDL
https://bugs.webkit.org/show_bug.cgi?id=187575
Reviewed by Chris Dumez.
Test: fast/mediastream/MediaDevices-addEventListener.html
* Modules/mediastream/MediaDevices.idl:
2018-07-11 Jon Lee <jonlee@apple.com>
Update iOS fullscreen alert text
https://bugs.webkit.org/show_bug.cgi?id=187576
rdar://problem/42052284
Reviewed by Ryosuke Niwa.
* English.lproj/Localizable.strings:
2018-07-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r233742.
https://bugs.webkit.org/show_bug.cgi?id=187577
Binary incompatible change with respect to Service Worker
registration map (Requested by dydz on #webkit).
Reverted changeset:
"Reduce size of WebCore::URL"
https://bugs.webkit.org/show_bug.cgi?id=186820
https://trac.webkit.org/changeset/233742
2018-07-11 Aditya Keerthi <akeerthi@apple.com>
REGRESSION (231276): Attempting to copy an image fails
https://bugs.webkit.org/show_bug.cgi?id=187212
<rdar://problem/41540074>
Reviewed by Ryosuke Niwa.
Renamed methods to make it clear that one URL and one title are being passed in.
Test: editing/mac/pasteboard/can-copy-url-without-title.html
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::setURL):
* platform/mac/PasteboardMac.mm:
(WebCore::writeURLForTypes):
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::setURL):
2018-07-11 Alex Christensen <achristensen@webkit.org>
Add SPI for immediate injection of user scripts
https://bugs.webkit.org/show_bug.cgi?id=173342
<rdar://problem/29202285>
Reviewed by Brady Eidson, Youenn Fablet, and Geoff Garen.
The new SPI is WKUserContentController._addUserScriptImmediately.
It is covered by new API tests.
Existing functionality remains unchanged unless the new SPI is adopted.
* page/Frame.cpp:
(WebCore::Frame::injectUserScripts):
(WebCore::Frame::injectUserScriptImmediately):
Move injection functionality to allow us to call it directly from the new SPI.
* page/Frame.h:
* page/Page.cpp:
(WebCore::Page::forEachPage):
* page/Page.h:
2018-07-11 Alex Christensen <achristensen@webkit.org>
Reduce size of WebCore::URL
https://bugs.webkit.org/show_bug.cgi?id=186820
Reviewed by Yusuke Suzuki.
We were using 32 bits for the length of the port, which is always between 0 and 5 inclusive
because port numbers are missing or between 0 and 65535. Let's just use 3 bits here.
We were using 32 bits for the length of the scheme, which is usually 3-5 characters and can be
longer for some custom schemes, but I've never seen one more than 20 characters. If we assume
schemes are always less than 64MB, we can save 8 bytes per URL!
No change in behavior, just less memory use!
* platform/URL.cpp:
(WebCore::URL::invalidate):
(WebCore::URL::lastPathComponent const):
(WebCore::URL::port const):
(WebCore::URL::protocolHostAndPort const):
(WebCore::URL::path const):
(WebCore::URL::removePort):
(WebCore::URL::setPort):
(WebCore::URL::setHostAndPort):
(WebCore::URL::setPath):
* platform/URL.h:
(WebCore::URL::encode const):
(WebCore::URL::decode):
(WebCore::URL::hasPath const):
(WebCore::URL::pathStart const):
* platform/URLParser.cpp:
(WebCore::URLParser::copyBaseWindowsDriveLetter):
(WebCore::URLParser::urlLengthUntilPart):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::shouldPopPath):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parse):
(WebCore::URLParser::parsePort):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::allValuesEqual):
(WebCore::URLParser::internalValuesConsistent):
2018-07-11 Youenn Fablet <youenn@apple.com>
Fix remaining Cross-Origin-Resource-Policy failures, if any
https://bugs.webkit.org/show_bug.cgi?id=186761
<rdar://problem/41209829>
Reviewed by Alex Christensen.
Add case-sensitive check for CORP header value, as per fetch specification.
Add HTTP->HTTPS check for same-site case, as per fetch specification.
https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
Test: imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.https.window.html
* loader/CrossOriginAccessControl.cpp:
(WebCore::shouldCrossOriginResourcePolicyCancelLoad):
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginResourcePolicyHeader):
2018-07-11 Ross Kirsling <ross.kirsling@sony.com>
[WinCairo] MIME type registry doesn't explicitly recognize *.xht
https://bugs.webkit.org/show_bug.cgi?id=187555
Reviewed by Konstantin Tokarev.
Follow-up to r233715 -- WinCairo bots are failing on *.xht layout tests as they lack a registry key for this filetype.
(Hopefully this is the last one to add.)
* platform/win/MIMETypeRegistryWin.cpp:
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
Add *.xht to the list of recognized filetypes.
2018-07-11 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186501
<rdar://problem/41000224>
Unreviewed build fix after r233729 and r233730.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processIterableKeyframes):
2018-07-11 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186501
<rdar://problem/41000224>
Unreviewed build fix after r233729.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processIterableKeyframes):
2018-07-10 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186501
<rdar://problem/41000224>
Reviewed by Dean Jackson.
There were two remaining assertions that we were failing in this WPT test file, both related to processing iterable keyframes.
The first one was failing because didn't correctly propagate the TypeError exception in the forEachInIterable() callback. The
second one was failing because we didn't use the "process a keyframe-like object" procedure when processing iterable keyframes
and, as such, we didn't correctly sort property alphabetically before reading their values.
To fix this second issue, we make processIterableKeyframes() use processKeyframeLikeObject(). To do so, we update processKeyframeLikeObject()
to accept a new boolean flag to match the "allow lists" flag from the specification. We also ensure we sort the properties *before*
reading from them which we didn't use to do previously.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processKeyframeLikeObject):
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
* animation/KeyframeEffectReadOnly.h:
* animation/KeyframeEffectReadOnly.idl:
2018-07-11 Zalan Bujtas <zalan@apple.com>
SimpleLineLayout::FlowContents wastes 54KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186709
<rdar://problem/41173793>
Reviewed by Simon Fraser.
The size of the m_segments vector in SimpleLineLayoutFlowContents is alway pre-computed and don't change after the initial append.
Not testable.
* rendering/SimpleLineLayoutFlowContents.h:
2018-07-10 Youenn Fablet <youenn@apple.com>
Make fetch() use "same-origin" credentials by default
https://bugs.webkit.org/show_bug.cgi?id=176023
Reviewed by Chris Dumez.
Covered by updated tests.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
Setting credentials mode to same-origin for FetchRequest by default.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
Handle correctly referrer in case we restart a load.
* page/PerformanceResourceTiming.cpp:
(WebCore::entryStartTime):
(WebCore::entryEndTime):
In case it is not allowed to disclose resource timing info, update as
https://www.w3.org/TR/resource-timing-1/#performanceresourcetiming
2018-07-10 Chris Dumez <cdumez@apple.com>
"serviceworker.js" is fetched several times in a row
https://bugs.webkit.org/show_bug.cgi?id=187435
<rdar://problem/41940569>
Reviewed by Youenn Fablet.
Soft updates happen every time a fetch event is sent to a service worker for a main resource request.
This can happen many times during a page load and will cause us to spam the HTTP server with update
requests, especially considering that the default behavior is to bypass the HTTP cache. To address
the issue, we now do soft updates on a 1 second delay and we keep rescheduling this timer was long as
soft update requests keep coming. Based on my understanding of the Chromium code, this seems to be
what they are doing so this should align our behavior with them.
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::scheduleSoftUpdate):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
2018-07-10 Ross Kirsling <ross.kirsling@sony.com>
[WinCairo] MIME type registry doesn't explicitly recognize *.css
https://bugs.webkit.org/show_bug.cgi?id=187538
Reviewed by Yusuke Suzuki.
MIMETypeRegistryWin doesn't explicitly recognize *.css; it instead falls back to the registry key "Content Type"
under HKEY_CLASSES_ROOT\.css. This key doesn't exist on Windows Server unless an application actually registers
it -- as a result, WinCairo bots are currently viewing it as an unrecognized filetype!
* platform/win/MIMETypeRegistryWin.cpp:
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
Add *.css to the list of recognized filetypes.
2018-07-10 Timothy Hatcher <timothy@apple.com>
REGRESSION (r233552): Find highlight has white text on yellow background
https://bugs.webkit.org/show_bug.cgi?id=187535
rdar://problem/42043371
Reviewed by Tim Horton.
Fixes existing image tests:
- fast/text/mark-matches-rendering.html
- fast/text/mark-matches-broken-line-rendering.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::resolveStyleForMarkedText): Remove incorect UseDarkAppearance.
2018-07-10 Chris Fleizach <cfleizach@apple.com>
AX: Crash in accessing AXObjectCache in textMarkerDataForVisiblePosition
https://bugs.webkit.org/show_bug.cgi?id=187528
<rdar://problem/37231941>
Reviewed by Joanmarie Diggs.
Occasional crashes reported when running accessibility/mac/search-field-cancel-button.html.
Looks like the cache object retrieved was not valid and we weren't checking for it.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::visiblePositionForTextMarkerData):
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
2018-07-10 Zalan Bujtas <zalan@apple.com>
FragmentInterval, FragmentIntervalTree and FragmentSearchAdapter should hold not hold raw pointers to renderers.
https://bugs.webkit.org/show_bug.cgi?id=187249
<rdar://problem/41725869>
Reviewed by Simon Fraser.
Test: fast/multicol/crash-in-vertical-writing-mode.html
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
* rendering/RenderFragmentedFlow.h:
(WTF::ValueToString<WeakPtr<WebCore::RenderFragmentContainer>>::string):
2018-07-10 Ryosuke Niwa <rniwa@webkit.org>
Disable cross-origin-window-policy by default
https://bugs.webkit.org/show_bug.cgi?id=187509
Reviewed by Chris Dumez.
Disabled the feature by default.
* page/Settings.yaml:
2018-07-10 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] The LibWebRTCProvider object in RealtimeMediaSourceCenterLibWebRTC is not needed anymore
https://bugs.webkit.org/show_bug.cgi?id=187513
Reviewed by Youenn Fablet.
We used the factory of the LibWebRTCProvider in
RealtimeMediaSourceCenterLibWebRTC as a singleton to make sure the
devices were correctly listed and used, we needed this when using
libwebrtc media devices management. We are now using GStreamer to handle
the media devices so this is not needed anymore.
No new tests, this change removed unused code.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenterLibWebRTC::RealtimeMediaSourceCenterLibWebRTC):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
2018-07-10 Zalan Bujtas <zalan@apple.com>
Rollout r233530: Candidate for Speedometer regression.
https://bugs.webkit.org/show_bug.cgi?id=187518
* rendering/SimpleLineLayoutFlowContents.h:
2018-07-09 Antoine Quint <graouts@apple.com>
[Web Animations] Correct handle repetition of composite and easing values
https://bugs.webkit.org/show_bug.cgi?id=187498
<rdar://problem/41999183>
Reviewed by Dean Jackson.
If there are fewer values for "easing" and "composite" than there are keyframes, we are supposed to
fill in missing values by repeating the pattern of specified values. We were starting our iteration
to fill those missing values on the second missing value rather than the first missing value.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processPropertyIndexedKeyframes):
2018-07-09 Youenn Fablet <youenn@apple.com>
Add the possibility to run unsandboxed plug-ins
https://bugs.webkit.org/show_bug.cgi?id=187310
<rdar://problem/41798808>
Reviewed by Alexey Proskuryakov.
Add a runtime flag to enforce plugin sandboxing.
Covered by manual testing.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSandboxPlugInEnabled):
(WebCore::RuntimeEnabledFeatures::sandboxPlugInEnabled const):
2018-07-09 Dean Jackson <dino@apple.com>
Remove fullscreen-auto-hide-delay
https://bugs.webkit.org/show_bug.cgi?id=187493
<rdar://problem/41830852>
Reviewed by Antoine Quint.
Remove the env() value for fullscreen-auto-hide-delay.
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::nameForProperty const):
(WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay): Deleted.
* dom/ConstantPropertyMap.h:
* page/Page.cpp:
(WebCore::Page::setFullscreenAutoHideDelay): Deleted.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): No need to reset delay.
(WebCore::Internals::setFullscreenAutoHideDelay): Deleted.
* testing/Internals.h: Remove the delay setter/getter.
* testing/Internals.idl:
2018-07-09 Timothy Hatcher <timothy@apple.com>
Semantic colors don't update when accessibility Increase Contrast mode is enabled.
https://bugs.webkit.org/show_bug.cgi?id=187425
rdar://problem/39948240
Reviewed by Tim Horton.
Added a listener for the accessibility change notification to invalidate our color caches.
Removed calls to RenderTheme::singleton().platformColorsDidChange() in Page, since that
ended up calling Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment multiple times.
Instead, changed the functions to use the new instance version instead.
* page/Page.cpp:
(WebCore::Page::updateStyleAfterChangeInEnvironment): Added. Gives Page a direct way to do this work
per instance instead of on all pages (since appearance can be difference per view).
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Call updateStyleAfterChangeInEnvironment.
(WebCore::Page::setUseSystemAppearance): Call updateStyleAfterChangeInEnvironment.
(WebCore::Page::setUseDarkAppearance): Added. Call updateStyleAfterChangeInEnvironment.
* page/Page.h:
(WebCore::Page::setUseDarkAppearance): Moved to the implementation file.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Removed recursive check since it was interfering
with the setting of m_usingDarkAppearance and causing the wrong color cache to be used.
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
* rendering/RenderThemeMac.mm:
(-[WebCoreRenderThemeNotificationObserver init]): Listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
(-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]): Removed assert since multiple notifications are used now.
(WebCore::RenderThemeMac::systemColor): Change how system link colors are cached. Don't store useSystemAppearance link colors in the
ColorCache, since that special bool isn't considered in the cache after the first time.
2018-07-09 Simon Fraser <simon.fraser@apple.com>
Shrink various loading-related enums to shrink CachedResource
https://bugs.webkit.org/show_bug.cgi?id=187443
Reviewed by Chris Dumez.
ResourceRequestBase, ResourceResponseBase, ResourceLoaderOptions, FetchOptions and
CachedResource have a lot of enum members variables most of which took 4 bytes each.
These can be packed much more efficiently if the enums are declared with an 8-bit size.
This requires turning enums into enum classes in some cases.
This reduces the size of CachedResource from 1464 to 1384 bytes, which saves about 49KB
over the ~600 CachedResources on nytimes.com.
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
(WebCore::FetchLoader::start):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::appendBytes):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::emitRule):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::resourceType const):
* inspector/NetworkResourcesData.cpp:
(WebCore::shouldBufferResourceData):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
(WebCore::InspectorNetworkAgent::loadResource):
(WebCore::InspectorNetworkAgent::cachedResourceContent):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::sourceMapURLForResource):
(WebCore::InspectorPageAgent::inspectorResourceType):
* loader/ApplicationManifestLoader.cpp:
(WebCore::ApplicationManifestLoader::startLoading):
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::deliverResourceData):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
(WebCore::DocumentLoader::subresource const):
(WebCore::DocumentLoader::loadMainResource):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::preflightSuccess):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FetchOptions.h:
(WebCore::FetchOptions::FetchOptions):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::defaultRequestCachingPolicy):
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::resourceTypeFromAsAttribute):
(WebCore::createLinkPreloadResourceClient):
(WebCore::LinkLoader::isSupportedType):
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange):
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::setDataBufferingPolicy):
(WebCore::ResourceLoader::addDataOrBuffer):
(WebCore::ResourceLoader::willSendRequestInternal):
(WebCore::ResourceLoader::didReceiveResponse):
(WebCore::ResourceLoader::didReceiveDataOrBuffer):
(WebCore::ResourceLoader::didFinishLoadingOnePart):
(WebCore::ResourceLoader::cleanupForError):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::shouldSendResourceLoadCallbacks const):
(WebCore::ResourceLoader::shouldSniffContent const):
(WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
* loader/ResourceLoaderOptions.h:
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
(WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse const):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::logResourceLoaded):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::didCancel):
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::CachedApplicationManifest):
* loader/cache/CachedApplicationManifest.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
(WebCore::CachedImage::updateBuffer):
(WebCore::CachedImage::updateData):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):
(WebCore::CachedRawResource::updateData):
(WebCore::CachedRawResource::finishLoading):
(WebCore::CachedRawResource::canReuse const):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType):
(WebCore::deadDecodedDataDeletionIntervalForResourceType):
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::load):
(WebCore::CachedResource::updateBuffer):
(WebCore::CachedResource::updateData):
(WebCore::CachedResource::isCORSSameOrigin const):
(WebCore::CachedResource::freshnessLifetime const):
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::areAllClientsXMLHttpRequests const):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isImage const):
(WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
(WebCore::CachedResource::ignoreForRequestCount const):
(WebCore::CachedResource::shouldSendResourceLoadCallbacks const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestFont):
(WebCore::CachedResourceLoader::requestTextTrack):
(WebCore::CachedResourceLoader::requestCSSStyleSheet):
(WebCore::CachedResourceLoader::requestScript):
(WebCore::CachedResourceLoader::requestXSLStyleSheet):
(WebCore::CachedResourceLoader::requestSVGDocument):
(WebCore::CachedResourceLoader::requestLinkResource):
(WebCore::CachedResourceLoader::requestMedia):
(WebCore::CachedResourceLoader::requestIcon):
(WebCore::CachedResourceLoader::requestRawResource):
(WebCore::CachedResourceLoader::requestBeaconResource):
(WebCore::CachedResourceLoader::requestMainResource):
(WebCore::CachedResourceLoader::requestApplicationManifest):
(WebCore::contentTypeFromResourceType):
(WebCore::CachedResourceLoader::checkInsecureContent const):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox const):
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
(WebCore::isResourceSuitableForDirectReuse):
(WebCore::destinationForType):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
(WebCore::CachedResourceLoader::cachePolicy const):
(WebCore::CachedResourceLoader::preload):
(WebCore::CachedResourceLoader::warnUnusedPreloads):
(WebCore::CachedResourceLoader::clearPreloads):
(WebCore::CachedResourceLoader::defaultCachedResourceOptions):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateAccordingCacheMode):
* loader/cache/CachedResourceRequest.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::CachedSVGFont):
* loader/cache/CachedSVGFont.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::CachedTextTrack):
(WebCore::CachedTextTrack::doUpdateBuffer):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::getStatistics):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponseAsync):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/EventSource.cpp:
(WebCore::EventSource::connect):
* platform/ReferrerPolicy.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
* platform/ios/QuickLook.mm:
(WebCore::registerQLPreviewConverterIfNeeded):
* platform/network/CacheValidation.cpp:
(WebCore::updateRedirectChainStatus):
(WebCore::redirectChainAllowsReuse):
* platform/network/CacheValidation.h:
(WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
* platform/network/ResourceErrorBase.h:
* platform/network/ResourceLoadPriority.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::httpBody const):
(WebCore::ResourceRequestBase::updatePlatformRequest const):
(WebCore::ResourceRequestBase::updateResourceRequest const):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* platform/network/StoredCredentialsPolicy.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy):
(WebCore::fromPlatformRequestCachePolicy):
(WebCore::ResourceRequest::doUpdateResourceRequest):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::fromPlatformRequestCachePolicy):
(WebCore::toPlatformRequestCachePolicy):
(WebCore::ResourceRequest::doUpdateResourceRequest):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
* platform/network/ios/PreviewConverter.mm:
(WebCore::PreviewConverter::safeRequest const):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
* testing/Internals.cpp:
(WebCore::toResourceRequestCachePolicy):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
2018-07-09 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/DocumentTimeline/constructor.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186498
<rdar://problem/41000205>
Reviewed by Dean Jackson.
Add a Constructor to the DocumentTimeline IDL to match the spec and ensure we respect the provided
origin time. To ensure all DocumentTimeline instances report matching current times, we read the
current time from the "main" document timeline, the one created by the Document automatically.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::currentTime):
* animation/DocumentTimeline.h:
* animation/DocumentTimeline.idl:
* animation/DocumentTimelineOptions.h:
* animation/DocumentTimelineOptions.idl:
2018-07-09 Antoine Quint <graouts@apple.com>
[Web Animations] Support overlapping keyframes
https://bugs.webkit.org/show_bug.cgi?id=187481
<rdar://problem/41988674>
Reviewed by Dean Jackson.
We now support parsing of multiple keyframes for the same offset.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::computeMissingKeyframeOffsets): Keyframes with a null offset that don't yet have a non-zero
computed offset are keyframes with an offset that needs to be computed.
(WebCore::KeyframeEffectReadOnly::processKeyframes): Only file an exception if an offset is found that
is lower than a previously-parsed one, allowing offsets with the same value.
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::insert): Remove the assertion that prevented an offset to be found more than once.
2018-07-09 Youenn Fablet <youenn@apple.com>
StringView operator==(char*) should check the length of the string
https://bugs.webkit.org/show_bug.cgi?id=187422
Reviewed by Chris Dumez.
Covered by existing tests.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename):
2018-07-09 Simon Fraser <simon.fraser@apple.com>
Shrink WebCore::Pair
https://bugs.webkit.org/show_bug.cgi?id=187450
Reviewed by Sam Weinig.
Move m_encoding to pack in with m_refCount and remove the virtual destructor,
shrinking the class from 40 to 24 bytes.
Also make the enum take only a byte, in case it gets used elsewhere
There are about 500 Pairs on nytimes.com, so this memory saving is non-trivial.
* css/Pair.h:
2018-07-09 Yusuke Suzuki <utatane.tea@gmail.com>
[WebCore] Annotate classes with WTF_MAKE_FAST_ALLOCATED as much as possible
https://bugs.webkit.org/show_bug.cgi?id=187474
Reviewed by Mark Lam.
When opening cnn.com, debugger says that so many objects in WebCore are allocated
from system allocator. This patch attempts to annotate these found classes with
WTF_MAKE_FAST_ALLOCATED.
We also annotate WebAudio classes with `final` to make WebAudio class hierarchy solid.
No behavior change.
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/mediastream/UserMediaController.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/webaudio/AsyncAudioDecoder.h:
* Modules/webaudio/AudioListener.h:
(WebCore::AudioListener::create): Deleted.
(WebCore::AudioListener::setPosition): Deleted.
(WebCore::AudioListener::position const): Deleted.
(WebCore::AudioListener::setOrientation): Deleted.
(WebCore::AudioListener::orientation const): Deleted.
(WebCore::AudioListener::setUpVector): Deleted.
(WebCore::AudioListener::upVector const): Deleted.
(WebCore::AudioListener::setVelocity): Deleted.
(WebCore::AudioListener::velocity const): Deleted.
(WebCore::AudioListener::setDopplerFactor): Deleted.
(WebCore::AudioListener::dopplerFactor const): Deleted.
(WebCore::AudioListener::setSpeedOfSound): Deleted.
(WebCore::AudioListener::speedOfSound const): Deleted.
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNodeInput.h:
(WebCore::AudioNodeInput::node const): Deleted.
* Modules/webaudio/AudioNodeOutput.h:
* Modules/webaudio/AudioParam.h:
(WebCore::AudioParam::create): Deleted.
(WebCore::AudioParam::name const): Deleted.
(WebCore::AudioParam::minValue const): Deleted.
(WebCore::AudioParam::maxValue const): Deleted.
(WebCore::AudioParam::defaultValue const): Deleted.
(WebCore::AudioParam::units const): Deleted.
(WebCore::AudioParam::resetSmoothedValue): Deleted.
(WebCore::AudioParam::setSmoothingConstant): Deleted.
(WebCore::AudioParam::setValueAtTime): Deleted.
(WebCore::AudioParam::linearRampToValueAtTime): Deleted.
(WebCore::AudioParam::exponentialRampToValueAtTime): Deleted.
(WebCore::AudioParam::setTargetAtTime): Deleted.
(WebCore::AudioParam::setValueCurveAtTime): Deleted.
(WebCore::AudioParam::cancelScheduledValues): Deleted.
(WebCore::AudioParam::hasSampleAccurateValues): Deleted.
(WebCore::AudioParam::AudioParam): Deleted.
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/AudioProcessingEvent.h:
(WebCore::AudioProcessingEvent::create): Deleted.
(WebCore::AudioProcessingEvent::createForBindings): Deleted.
(WebCore::AudioProcessingEvent::inputBuffer): Deleted.
(WebCore::AudioProcessingEvent::outputBuffer): Deleted.
(WebCore::AudioProcessingEvent::playbackTime const): Deleted.
* Modules/webaudio/BiquadDSPKernel.h:
(WebCore::BiquadDSPKernel::BiquadDSPKernel): Deleted.
(WebCore::BiquadDSPKernel::biquadProcessor): Deleted.
* Modules/webaudio/BiquadFilterNode.h:
(WebCore::BiquadFilterNode::create): Deleted.
(WebCore::BiquadFilterNode::frequency): Deleted.
(WebCore::BiquadFilterNode::q): Deleted.
(WebCore::BiquadFilterNode::gain): Deleted.
(WebCore::BiquadFilterNode::detune): Deleted.
(WebCore::BiquadFilterNode::biquadProcessor): Deleted.
* Modules/webaudio/BiquadProcessor.h:
(WebCore::BiquadProcessor::filterCoefficientsDirty const): Deleted.
(WebCore::BiquadProcessor::hasSampleAccurateValues const): Deleted.
(WebCore::BiquadProcessor::parameter1): Deleted.
(WebCore::BiquadProcessor::parameter2): Deleted.
(WebCore::BiquadProcessor::parameter3): Deleted.
(WebCore::BiquadProcessor::parameter4): Deleted.
(WebCore::BiquadProcessor::type const): Deleted.
* Modules/webaudio/ChannelMergerNode.h:
* Modules/webaudio/ChannelSplitterNode.h:
* Modules/webaudio/DelayDSPKernel.h:
(WebCore::DelayDSPKernel::maxDelayTime const): Deleted.
(WebCore::DelayDSPKernel::setDelayFrames): Deleted.
(WebCore::DelayDSPKernel::delayProcessor): Deleted.
* Modules/webaudio/DelayNode.h:
* Modules/webaudio/DelayProcessor.h:
(WebCore::DelayProcessor::delayTime const): Deleted.
(WebCore::DelayProcessor::maxDelayTime): Deleted.
* Modules/webaudio/DynamicsCompressorNode.h:
(WebCore::DynamicsCompressorNode::create): Deleted.
(WebCore::DynamicsCompressorNode::threshold): Deleted.
(WebCore::DynamicsCompressorNode::knee): Deleted.
(WebCore::DynamicsCompressorNode::ratio): Deleted.
(WebCore::DynamicsCompressorNode::attack): Deleted.
(WebCore::DynamicsCompressorNode::release): Deleted.
(WebCore::DynamicsCompressorNode::reduction): Deleted.
* Modules/webaudio/GainNode.h:
(WebCore::GainNode::create): Deleted.
(WebCore::GainNode::gain): Deleted.
* Modules/webaudio/MediaElementAudioSourceNode.h:
(WebCore::MediaElementAudioSourceNode::mediaElement): Deleted.
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
(WebCore::MediaStreamAudioDestinationNode::stream): Deleted.
* Modules/webaudio/MediaStreamAudioSourceNode.h:
(WebCore::MediaStreamAudioSourceNode::mediaStream): Deleted.
* Modules/webaudio/OfflineAudioCompletionEvent.h:
(WebCore::OfflineAudioCompletionEvent::renderedBuffer): Deleted.
* Modules/webaudio/OfflineAudioDestinationNode.h:
(WebCore::OfflineAudioDestinationNode::create): Deleted.
* Modules/webaudio/PannerNode.h:
(WebCore::PannerNode::create): Deleted.
(WebCore::PannerNode::panningModel const): Deleted.
(WebCore::PannerNode::position const): Deleted.
(WebCore::PannerNode::setPosition): Deleted.
(WebCore::PannerNode::orientation const): Deleted.
(WebCore::PannerNode::setOrientation): Deleted.
(WebCore::PannerNode::velocity const): Deleted.
(WebCore::PannerNode::setVelocity): Deleted.
(WebCore::PannerNode::refDistance): Deleted.
(WebCore::PannerNode::setRefDistance): Deleted.
(WebCore::PannerNode::maxDistance): Deleted.
(WebCore::PannerNode::setMaxDistance): Deleted.
(WebCore::PannerNode::rolloffFactor): Deleted.
(WebCore::PannerNode::setRolloffFactor): Deleted.
(WebCore::PannerNode::coneInnerAngle const): Deleted.
(WebCore::PannerNode::setConeInnerAngle): Deleted.
(WebCore::PannerNode::coneOuterAngle const): Deleted.
(WebCore::PannerNode::setConeOuterAngle): Deleted.
(WebCore::PannerNode::coneOuterGain const): Deleted.
(WebCore::PannerNode::setConeOuterGain): Deleted.
(WebCore::PannerNode::distanceGain): Deleted.
(WebCore::PannerNode::coneGain): Deleted.
* Modules/webaudio/PeriodicWave.h:
(WebCore::PeriodicWave::rateScale const): Deleted.
(WebCore::PeriodicWave::periodicWaveSize const): Deleted.
(WebCore::PeriodicWave::sampleRate const): Deleted.
(WebCore::PeriodicWave::numberOfRanges const): Deleted.
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/ScriptProcessorNode.h:
(WebCore::ScriptProcessorNode::bufferSize const): Deleted.
(WebCore::ScriptProcessorNode::doubleBufferIndex const): Deleted.
(WebCore::ScriptProcessorNode::swapBuffers): Deleted.
* Modules/webaudio/WaveShaperDSPKernel.h:
(WebCore::WaveShaperDSPKernel::waveShaperProcessor): Deleted.
* Modules/webaudio/WaveShaperProcessor.h:
(WebCore::WaveShaperProcessor::curve): Deleted.
(WebCore::WaveShaperProcessor::oversample const): Deleted.
* dom/MessagePort.h:
* html/FormAssociatedElement.h:
* loader/LinkPreloadResourceClients.h:
* page/WheelEventDeltaFilter.h:
* page/mac/WheelEventDeltaFilterMac.h:
* platform/RemoteCommandListener.h:
* platform/audio/AudioDSPKernel.h:
* platform/audio/AudioProcessor.h:
* platform/audio/PlatformMediaSession.h:
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* workers/service/ServiceWorkerContainer.h:
2018-07-09 Simon Fraser <simon.fraser@apple.com>
Shrink RenderSVGShape
https://bugs.webkit.org/show_bug.cgi?id=187459
Reviewed by Zalan Bujtas.
Shrink RenderSVGShape from 328 to 320 bytes by moving the bits before the AffineTransform,
which is 16-byte aligned. This saves 9.6KB on nytimes.com.
* rendering/svg/RenderSVGShape.h:
2018-07-09 Simon Fraser <simon.fraser@apple.com>
Shrink CSSFontFace
https://bugs.webkit.org/show_bug.cgi?id=187456
Reviewed by Anders Carlsson.
Shrink CSSFontFace by 56 bytes, from 288 to 256 bytes, mostly by defining enums as 8-bit,
but also re-ordering the member variables. There are over 400 of these objects on nytimes.com,
so this saves about 22KB.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
* css/CSSFontFace.h:
* platform/text/TextFlags.h:
* rendering/style/RenderStyleConstants.h:
2018-07-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r233612.
https://bugs.webkit.org/show_bug.cgi?id=187475
Revision caused the api test LinkColorWithSystemAppearance to
fail on all systems. (Requested by Truitt on #webkit).
Reverted changeset:
"Semantic colors don't update when accessibility Increase
Contrast mode is enabled."
https://bugs.webkit.org/show_bug.cgi?id=187425
https://trac.webkit.org/changeset/233612
2018-07-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Remove useless workaround
https://bugs.webkit.org/show_bug.cgi?id=186921
Reviewed by Xabier Rodriguez-Calvar.
In bug 67407 a workaround was added for GStreamer 0.10. With 1.x
the media/video-reverse-play-duration.html test passes without any
workaround needed. The other test mentioned in that bug was
removed, it seems.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
Removed early return, position queries shouldn't be avoided on EOS
because the pipeline is in READY state, not NULL.
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
2018-07-08 Simon Fraser <simon.fraser@apple.com>
Optimize packing of RenderSVGViewportContainer
https://bugs.webkit.org/show_bug.cgi?id=187458
Reviewed by Zalan Bujtas.
Shrink RenderSVGViewportContainer from 296 bytes to 280 bytes, saving about 6KB on nytimes.com.
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::RenderSVGContainer):
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGViewportContainer.h:
2018-07-08 Simon Fraser <simon.fraser@apple.com>
Shrink RenderTableSection
https://bugs.webkit.org/show_bug.cgi?id=187457
Reviewed by Zalan Bujtas.
Shrink RenderTableSection from 344 to 336 bytes, saving about 3.6KB on nytimes.com.
* rendering/RenderTableSection.h:
2018-07-08 Simon Fraser <simon.fraser@apple.com>
Optimize packing of RootInlineBox
https://bugs.webkit.org/show_bug.cgi?id=187430
Reviewed by Zalan Bujtas.
In InlineBox, move the m_logicalWidth float up next to the m_expansion float with m_topLeft next; this
avoids padding of 4 bytes after this float.
In InlineFlowBox, move the bitfields before the pointers so they can snug up into the
4 bytes after m_expansion in the base class.
The comment about m_lineBreakPos's padding in RootInlineBox is wrong; just move it to the end
to avoid padding before the m_lineBreakObj pointer.
Make m_logicalWidth private and have derived classes use the accessor.
Make EllipsisBox 4 bytes smaller too.
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::EllipsisBox):
(WebCore::EllipsisBox::paintMarkupBox):
(WebCore::EllipsisBox::nodeAtPoint):
* rendering/EllipsisBox.h:
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox):
* rendering/InlineFlowBox.cpp:
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
(WebCore::InlineFlowBox::frameRectIncludingLineHeight const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox):
* rendering/RootInlineBox.h:
2018-07-08 Antoine Quint <graouts@apple.com>
[Web Animations] A number of tests report an incorrect computed offset
https://bugs.webkit.org/show_bug.cgi?id=187410
<rdar://problem/41905790>
Reviewed by Dean Jackson.
While we would correctly avoid computing missing offsets when processing the first keyframe following the last
keyframes with a specified offset, we were forgetting to update the index of the last keyframe with a specified
offset which meant we would accidentally override a specified offset with an automically-computed one.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::computeMissingKeyframeOffsets):
2018-07-08 David Kilzer <ddkilzer@apple.com>
DOMMatrix.invertSelf() returns garbage values for a non-invertible matrix
<https://webkit.org/b/187446>
<rdar://problem/41853187>
Reviewed by Daniel Bates.
Test: http/wpt/css/geometry/DOMMatrix-invertSelf.html
* css/DOMMatrix.cpp:
(WebCore::DOMMatrix::invertSelf): Add missing `else`, and
restructure to use positive logic.
2018-07-07 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce a layout milestone to track when the document contains a large number of rendered characters
https://bugs.webkit.org/show_bug.cgi?id=187412
<rdar://problem/41744338>
Reviewed by Ryosuke Niwa.
Implements a new layout milestone: `DidRenderSignificantAmountOfText`. This is similar to the existing
`DidFirstVisuallyNonEmptyLayout` milestone, but with a few important additional constraints:
• The minimum threshold of rendered characters is much larger (3000 instead of 200).
• The mean length of a text node must be large (at least 50).
This is a (computationally) lightweight heuristic intended to estimate the likelihood that a page is capable of
being presented in Reader mode. In many article-like pages, the average length of a text node is significantly
longer than other types of pages; thus, on pages where the average length of a text node is very large *and*
there is a large quantity of text, we can use this as a cue to opportunistically detect and enter Safari reader
mode on watchOS.
Test: RenderingProgressTests.DidRenderSignificantAmountOfText
* page/FrameView.cpp:
(WebCore::FrameView::reset):
Clear out new state members that keep track of whether the significant rendered text milestone has been met.
(WebCore::elementOverflowRectIsLargerThanThreshold):
Factor out logic to grab the overflow height of an element into a separate helper function.
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
Determines whether to fire this new milestone after the next layout pass is finished. The logic here is similar
to the logic in qualifiesAsVisuallyNonEmpty, requiring that there are not still pending stylesheets in the head
and that the document height is at least a minimum threshold. However, unlike the first visually non-empty
layout, this milestone is never guaranteed to fire.
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
* page/LayoutMilestones.h:
2018-07-06 Timothy Hatcher <timothy@apple.com>
Semantic colors don't update when accessibility Increase Contrast mode is enabled.
https://bugs.webkit.org/show_bug.cgi?id=187425
rdar://problem/39948240
Reviewed by Tim Horton.
Added a listener for the accessibility change notification to invalidate our color caches.
Removed calls to RenderTheme::singleton().platformColorsDidChange() in Page, since that
ended up calling Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment multiple times.
Instead, changed the functions to use the new instance version instead.
* page/Page.cpp:
(WebCore::Page::updateStyleAfterChangeInEnvironment): Added. Gives Page a direct way to do this work
per instance instead of on all pages (since appearance can be difference per view).
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Call updateStyleAfterChangeInEnvironment.
(WebCore::Page::setUseSystemAppearance): Call updateStyleAfterChangeInEnvironment.
(WebCore::Page::setUseDarkAppearance): Added. Call updateStyleAfterChangeInEnvironment.
* page/Page.h:
(WebCore::Page::setUseDarkAppearance): Moved to the implementation file.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Removed recursive check since it was interfering
with the setting of m_usingDarkAppearance and causing the wrong color cache to be used.
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
* rendering/RenderThemeMac.mm:
(-[WebCoreRenderThemeNotificationObserver init]): Listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
(-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]): Removed assert since multiple notifications are used now.
2018-07-06 Ryosuke Niwa <rniwa@webkit.org>
Make ReasonForSuspension enum class
https://bugs.webkit.org/show_bug.cgi?id=187405
Reviewed by Zalan Bujtas.
Made ReasonForSuspension an enum class instead of enum and moved out of ActiveDOMObject.
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::suspend):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::suspend):
* dom/ActiveDOMObject.h:
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::suspendActiveDOMObjects):
(WebCore::Document::resumeActiveDOMObjects):
(WebCore::Document::suspend):
(WebCore::Document::resume):
(WebCore::Document::suspendScheduledTasks):
(WebCore::Document::resumeScheduledTasks):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::reasonForSuspendingActiveDOMObjects const):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::suspend):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::suspend):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
* page/Frame.cpp:
(WebCore::Frame::suspendActiveDOMObjectsAndAnimations):
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
* page/PageGroupLoadDeferrer.cpp:
(WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
(WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::suspend):
2018-07-06 Nan Wang <n_wang@apple.com>
AX: add a subrole for meter elements on macOS
https://bugs.webkit.org/show_bug.cgi?id=187409
<rdar://problem/41905702>
Reviewed by Chris Fleizach.
Test: accessibility/mac/meter-subrole.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper subrole]):
2018-07-06 Jeremy Jones <jeremyj@apple.com>
For <video> element, use video fullscreen instead of element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=186093
rdar://problem/40144751
Reviewed by Jer Noble.
Some pages use webkitRequestFullscreen directly on the video element, without any custom controls.
This will prevent native fullscreeen presentation mode conrols from being used.
This change makes webkitRequestFullscreen on a video element call webKitSetPresentationMode.
* dom/Element.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitRequestFullscreen):
* html/HTMLVideoElement.h:
2018-07-06 Youenn Fablet <youenn@apple.com>
WebRTC MediaStreamTrack Enable / Disable causes video delay / lag
https://bugs.webkit.org/show_bug.cgi?id=186889
<rdar://problem/41370285>
Reviewed by Eric Carlson.
Libwebrtc expects a continuous flow of calls for audio data since the API
does not provide any possiblity to give timestamps.
We were optimizing previously when a source is muted so that we would not transmit audio data.
This breaks synchronization between audio and video frames (which are timestamped).
This patch reverts the optimization and instead makes sure to send zeros for silenced audio tracks.
This requires MediaStreamTrackPrivate to send audio data even if disabled,
so that RealtimeOutgoingAudioSource will continue sending zeros at the correct pace.
This also requires WebAudioSourceProviderAVFObjC to exit early if its track is disabled.
Covered by existing tests.
Manual testing shows that synchronization is kept.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::initializeConverter):
(WebCore::RealtimeOutgoingAudioSource::stop):
(WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
(WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded): Deleted.
* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::pullAudioData):
(WebCore::RealtimeOutgoingAudioSource::isSilenced const):
(WebCore::RealtimeOutgoingAudioSource::sendSilence): Deleted.
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
(WebCore::RealtimeOutgoingAudioSourceCocoa::handleMutedIfNeeded): Deleted.
(WebCore::RealtimeOutgoingAudioSourceCocoa::sendSilence): Deleted.
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
2018-07-06 Youenn Fablet <youenn@apple.com>
Make RealtimeOutgoingVideoSource use DestructionThread::Main
https://bugs.webkit.org/show_bug.cgi?id=187402
Reviewed by Chris Dumez.
No change of behavior.
* platform/mediastream/RealtimeOutgoingVideoSource.h:
2018-07-06 Ryosuke Niwa <rniwa@webkit.org>
Make HTMLMediaElement::remove*Track take a Ref<>&&
https://bugs.webkit.org/show_bug.cgi?id=187407
Reviewed by Zalan Bujtas.
Make these functions take Ref<>&& since they can delete track objects.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack):
(WebCore::HTMLMediaElement::removeTextTrack):
(WebCore::HTMLMediaElement::removeVideoTrack):
(WebCore::HTMLMediaElement::forgetResourceSpecificTracks):
* html/HTMLMediaElement.h:
2018-07-06 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186502
<rdar://problem/41000229>l
Reviewed by Dean Jackson.
Ensure we only attempt to convert defined objects or we risk to throw errors in valid situations.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processKeyframeLikeObject):
2018-07-05 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/Animation/finish.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186496
<rdar://problem/41000179>
Reviewed by Dean Jackson.
We used to only resolve animations that had a target element, but animations need not have a target and their
current time should still advance so that their finished promise may resolve. We now maintain a list of animations
without targets and we iterate through them as well as animations with targets in DocumentTimeline::updateAnimations().
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::animationWasAddedToElement):
(WebCore::AnimationTimeline::animationWasRemovedFromElement):
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline:: const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:
2018-07-05 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at interfaces/Animation/finished.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186497
<rdar://problem/41000193>
Reviewed by Dean Jackson.
We need to ensure the finished state is updated as a result of any timing property changing.
* animation/AnimationEffectReadOnly.cpp:
(WebCore::AnimationEffectReadOnly::timingDidChange):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTimingPropertiesDidChange):
* animation/WebAnimation.h:
2018-07-06 Antoine Quint <graouts@apple.com>
[Web Animations] Using a Web Animation leaks the Document
https://bugs.webkit.org/show_bug.cgi?id=187088
<rdar://problem/41392046>
Reviewed by Darin Adler.
Test: webanimations/leak-document-with-web-animation.html
We need to ensure that any remaining animation is cleared when the DocumentTimeline is detached from its Document.
We rename WebAnimation::prepareAnimationForRemoval() to WebAnimation::remove() since it really actively disassociates
the animation from its timeline.
An earlier version of this patch (r233349) was rolled out due to crashes caught in the ASan configuration. The following
changes were made to make it safe:
- We protect the DocumentAnimationScheduler instance in displayRefreshFired() against code that might run in a
requestAnimationFrame() callback that would trigger the object to be deleted.
- We protect the WebAnimation instance in remove() against setEffectInternal() or setTimelineInternal() potentially
causing the object to be deleted. Similar protections were addede to setEffect() and setTimeline().
- We changed ~DocumentTimeline() to a default implementation to ensure it calls ~DisplayRefreshMonitorClient()
to avoid callbacks after the object has been marked for deletion.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimationsForElement): We no longer need the call to removeAnimation()
since the new WebAnimation::remove() method will also set the timeline to null which will eventually call
removeAnimation() on the disassociated timeline.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::remove):
(WebCore::DeclarativeAnimation::prepareAnimationForRemoval): Deleted.
* animation/DeclarativeAnimation.h:
* animation/DocumentAnimationScheduler.cpp:
(WebCore::DocumentAnimationScheduler::displayRefreshFired):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument): Call remove() on all known animations.
(WebCore::DocumentTimeline::~DocumentTimeline): Deleted.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::remove): Set the timeline to null to fully disassociate this animation from its timeline.
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline): Factor the internal timeline-association code out of this JS API method so
that we can call this code without any JS-facing implications.
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::prepareAnimationForRemoval): Deleted.
* animation/WebAnimation.h:
2018-07-06 Daniel Bates <dabates@apple.com>
Remove Strong Confirmation Password button
https://bugs.webkit.org/show_bug.cgi?id=187306
<rdar://problem/41795185>
Reviewed by Sam Weinig.
Remove support for the Strong Confirmation Password button because we never made use of it.
* English.lproj/Localizable.strings:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const):
* html/HTMLTextFormControlElement.h:
* html/TextFieldInputType.cpp:
(WebCore::autoFillButtonTypeToAccessibilityLabel):
(WebCore::autoFillButtonTypeToAutoFillButtonText):
(WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
(WebCore::isAutoFillButtonTypeChanged):
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillStrongConfirmationPasswordLabel): Deleted.
* platform/LocalizedStrings.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
* testing/Internals.cpp:
(WebCore::toAutoFillButtonType):
(WebCore::toInternalsAutoFillButtonType):
* testing/Internals.h:
* testing/Internals.idl:
2018-07-06 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] REGRESSION(r233239): proxy settings not applied after r233239
https://bugs.webkit.org/show_bug.cgi?id=187381
Reviewed by Yusuke Suzuki.
This is because the static variable for proxy settings was replaced by a NeverDestroyed, but the function is not
returning a reference, but a copy. This is causing several unit tests to fail.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::proxySettings):
2018-07-06 Frederic Wang <fwang@igalia.com>
[Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase::updateStateMachine
https://bugs.webkit.org/show_bug.cgi?id=187382
Reviewed by Carlos Garcia Campos.
WebCore::AnimationBase::updateStateMachine has two potential places where the use of an
uninitialized std:optional value is possible and one of them is hit when using Google drive.
Since that old animation code is going to be removed soon, we just quickly patch this issue
via value_or() so that we can restore the ASSERT added in bug 186536.
No new tests, code is going to be removed soon.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine): Use value_or(0) to avoid potential crashes.
2018-07-06 Frederic Wang <fwang@igalia.com>
Rename HTMLTreeBuilder::didCreateCustomOrCallbackElement
https://bugs.webkit.org/show_bug.cgi?id=187317
Reviewed by Ryosuke Niwa.
This function is called with a new custom element or the fallback HTMLUnknownElement element
so we rename it didCreateCustomOrFallbackElement.
No new tests, behavior unchanged.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::didCreateCustomOrFallbackElement):
(WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Deleted.
* html/parser/HTMLTreeBuilder.h:
2018-07-05 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r233496): macOS Sierra hits debug assertions in TrackListBase::suspend
https://bugs.webkit.org/show_bug.cgi?id=187378
<rdar://problem/41878885>
Reviewed by Eric Carlson.
These assertions were wrong since inline debugger, alert, etc... can suspend active DOM objects without
calling canSuspendForDocumentSuspension. Fixed the bug by removing the assertion and instead suspending
and resuming the generic event queue.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::suspend):
(WebCore::MediaSource::resume):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::suspend):
(WebCore::SourceBuffer::resume):
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::suspend):
(WebCore::SourceBufferList::resume):
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::suspend):
(WebCore::TrackListBase::resume):
2018-07-05 Youenn Fablet <youenn@apple.com>
REGRESSION (r230843): Flash doesn't work; Produces blue box on page
https://bugs.webkit.org/show_bug.cgi?id=187346
<rdar://problem/41773974>
Reviewed by Ryosuke Niwa.
Introduce clearPagesPluginData used by WebProcess when a plugin policy changes.
Add a new internals API to get the plugin count as navigator.plugin is filtering plugins.
Test: http/tests/plugins/plugin-allow-then-reload.html
* plugins/PluginData.h:
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::clearPagesPluginData):
* plugins/PluginInfoProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::pluginCount):
* testing/Internals.h:
* testing/Internals.idl:
2018-07-05 Brady Eidson <beidson@apple.com>
IndexedDB operations in a Page fail after a StorageProcess crash.
<rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123
Reviewed by Alex Christensen.
Test: storage/indexeddb/modern/opendatabase-after-storage-crash.html
When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
in the WebProcess about it.
This puts Documents/Workers in an error mode where requests fail instead of timeout.
It also clears the Page's connection so *new* Documents and Workers will get a fresh
new connection that works.
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::callResultFunctionLater):
(WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
(WebCore::IDBClient::IDBConnectionToServer::openDatabase):
(WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::createIndex):
(WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
(WebCore::IDBClient::IDBConnectionToServer::renameIndex):
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
(WebCore::IDBClient::IDBConnectionToServer::getRecord):
(WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
(WebCore::IDBClient::IDBConnectionToServer::getCount):
(WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
(WebCore::IDBClient::IDBConnectionToServer::openCursor):
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
(WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
(WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
(WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer):
(WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
(WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
(WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::serverConnectionLostError):
* page/Page.cpp:
(WebCore::Page::setSessionID):
(WebCore::Page::idbConnection):
(WebCore::Page::optionalIDBConnection):
(WebCore::Page::clearIDBConnection):
* page/Page.h:
2018-07-05 Ryosuke Niwa <rniwa@webkit.org>
Youtube video pages crash after a couple of minutes
https://bugs.webkit.org/show_bug.cgi?id=187316
Reviewed by Antti Koivisto.
The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
which traverses all media players across different documents including the one in the main frame while its iframe
is getting removed (to update the Touch Bar's media control).
Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.
Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
a timer via scheduleUpdateNowPlayingInfo instead.
Test: media/remove-video-best-media-element-in-main-frame-crash.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
moved to Page.
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
a raw pointer while we're at it.
(WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::schedulePlaybackControlsManagerUpdate): Renamed from scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::playbackControlsManagerUpdateTimerFired.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
(WebCore::Page::playbackControlsManagerUpdateTimerFired): Moved from HTMLMediaElement::updatePlaybackControlsManager.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:
2018-07-05 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r233496): Crash in WebCore::VideoTrack::clearClient()
https://bugs.webkit.org/show_bug.cgi?id=187377
Reviewed by Simon Fraser.
Clear m_client of an audio track or a video track before removing it from the list
since TrackListBase::m_inbandTracks may hold the last ref to the track.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack):
(WebCore::HTMLMediaElement::removeVideoTrack):
2018-07-05 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur-radius
https://bugs.webkit.org/show_bug.cgi?id=187336
Reviewed by Carlos Garcia Campos.
drawGlyphsShadow has a fast path to draw a shadow without a shadow
layer. Since r233495, it is not used for zero blur-radius shadow.
In Bug 187244, I changed ShadowState::isRequired not to check
blur-radius is zero. This is not a right fix.
This change reverts r233495.
No new tests (Covered by existing tests).
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::ShadowState::isRequired const): Return false if
'blur' is zero.
(WebCore::Cairo::fillRectWithRoundedHole): Use
ShadowState::isVisible instead of ShadowState::isRequired to check
a shadow should be drawn.
2018-07-05 Timothy Hatcher <timothy@apple.com>
Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
https://bugs.webkit.org/show_bug.cgi?id=187369
rdar://problem/41870420
Reviewed by Tim Horton.
* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
* css/StyleColor.h:
* dom/Document.cpp:
(WebCore::Document::useDarkAppearance const):
(WebCore::Document::styleColorOptions const):
(WebCore::Document::useDefaultAppearance const): Deleted.
* dom/Document.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
* page/Page.cpp:
(WebCore::Page::useDarkAppearance const):
(WebCore::Page::defaultAppearance const): Deleted.
* page/Page.h:
(WebCore::Page::setUseDarkAppearance):
(WebCore::Page::setDefaultAppearance): Deleted.
* platform/Theme.h:
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::paint):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
* platform/mock/MediaPlaybackTargetPickerMock.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::resolveStyleForMarkedText):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const):
(WebCore::RenderThemeMac::colorCache const):
(WebCore::RenderThemeMac::systemColor const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):
2018-07-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r233539.
https://bugs.webkit.org/show_bug.cgi?id=187368
Changes made for youtube crashes has caused 15 api failures
(Requested by Truitt on #webkit).
Reverted changeset:
"Youtube video pages crash after a couple of minutes"
https://bugs.webkit.org/show_bug.cgi?id=187316
https://trac.webkit.org/changeset/233539
2018-07-05 Chris Dumez <cdumez@apple.com>
Update Element API to use qualifiedName instead of name/localName where applicable
https://bugs.webkit.org/show_bug.cgi?id=187347
Reviewed by Darin Adler.
Update Element API to use qualifiedName instead of name/localName where applicable. Naming
is now consistent with the IDL and the specification:
- https://dom.spec.whatwg.org/#element
Our implementation properly deals with qualified names already, even though the parameters
were named localName.
* dom/Element.cpp:
(WebCore::Element::getAttribute const):
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::removeAttribute):
(WebCore::Element::getAttributeNode):
(WebCore::Element::hasAttribute const):
* dom/Element.h:
2018-07-04 Ryosuke Niwa <rniwa@webkit.org>
Youtube video pages crash after a couple of minutes
https://bugs.webkit.org/show_bug.cgi?id=187316
Reviewed by Antti Koivisto.
The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
which traverses all media players across different documents including the one in the main frame while its iframe
is getting removed (to update the Touch Bar's media control).
Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.
Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
a timer via scheduleUpdateNowPlayingInfo instead.
Test: media/remove-video-best-media-element-in-main-frame-crash.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
moved to Page.
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
a raw pointer while we're at it.
(WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
(WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::schedulePlaybackControlsManagerUpdate.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:
2018-07-05 Zalan Bujtas <zalan@apple.com>
Do not assume that hypen's width can be computed using the simplified text measure codepath.
https://bugs.webkit.org/show_bug.cgi?id=187352
<rdar://problem/40821283>
Reviewed by Simon Fraser.
Just because the text content is qualified for simplified text measure, it does not necessarily mean the hyphen is simple enough as well.
Test: fast/text/hyphen-is-complex-crash.html
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
2018-07-05 Eric Carlson <eric.carlson@apple.com>
Video sometimes flickers when playing to AppleTV
https://bugs.webkit.org/show_bug.cgi?id=187193
<rdar://problem/40153865>
Unreviewed, fix a broken API test.
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory): None should set the category to AVAudioSessionCategoryAmbient,
because it signals that WebKit is not playing audio so we want allow other apps to play.
2018-07-05 Per Arne Vollan <pvollan@apple.com>
Use ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) in ScrollAnimatorMac.mm
https://bugs.webkit.org/show_bug.cgi?id=187334
Reviewed by Alex Christensen.
Use ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) instead of __MAC_OS_X_VERSION_MIN_REQUIRED when deciding
to use NSTimer or NSAnimation for scrollbar animation.
No new tests. No change in behavior.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
(-[WebScrollbarPartAnimation startAnimation]):
(-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
2018-07-05 Timothy Hatcher <timothy@apple.com>
Don't invert text color for selections in light mode.
https://bugs.webkit.org/show_bug.cgi?id=187349
rdar://problem/41297946
Reviewed by Tim Horton.
Fix color caching in RenderTheme so we don't cache a dark mode color
for a light appearance, or vise versa. Use the new color caching
in RenderThemeMac, and clear the color caches in purgeCaches.
Allow supportsSelectionForegroundColors to conditionalize on StyleColor::Options.
Return true only in dark mode.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeSelectionBackgroundColor const):
(WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
(WebCore::RenderTheme::activeSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveSelectionForegroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::purgeCaches):
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::activeTextSearchHighlightColor const):
(WebCore::RenderTheme::inactiveTextSearchHighlightColor const):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::supportsSelectionForegroundColors const):
(WebCore::RenderTheme::supportsListBoxSelectionForegroundColors const):
(WebCore::RenderTheme::colorCache const):
(WebCore::RenderTheme::purgeCaches): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::purgeCaches):
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformColorsDidChange):
(WebCore::RenderThemeMac::colorCache const):
(WebCore::RenderThemeMac::systemColor const):
2018-07-05 Zalan Bujtas <zalan@apple.com>
SimpleLineLayout::FlowContents wastes 54KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186709
<rdar://problem/41173793>
Reviewed by Simon Fraser.
The size of the m_segments vector in SimpleLineLayoutFlowContents is alway pre-computed and don't change after the initial append.
Not testable.
* rendering/SimpleLineLayoutFlowContents.h:
2018-07-05 Nan Wang <n_wang@apple.com>
AX: setValue on text controls should send out key events
https://bugs.webkit.org/show_bug.cgi?id=186690
<rdar://problem/41169985>
Reviewed by Chris Fleizach.
Use Editor's insertText function when the text control element is being
focused, so that the InputEvent will be dispatched properly.
Test: accessibility/mac/set-value-editable-dispatch-events.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):
2018-07-05 Chris Dumez <cdumez@apple.com>
ASSERT(m_dictionaryStack.size() == 1) assertion hit in ~KeyedDecoderCF() when decoding fails
https://bugs.webkit.org/show_bug.cgi?id=187152
Reviewed by Brent Fulgham.
Whenever a call to KeyedDecoderCF::beginArrayElement() succeeds (returns true), it
appends an item to m_dictionaryStack which is expected to get popped later on via
a matching call to KeyedDecoderCF::endArrayElement(). The ASSERT(m_dictionaryStack.size() == 1)
assertion in the destructor protects against a begin / end mismatch.
However, there was a bug in KeyedDecoder::decodeObjects(), which would cause us to return early
after a call to beginArrayElement() when the lambda function call returns false, causing us
not to call the matching endArrayElement() in this case. This patch addresses the issue by
calling endArrayElement() before returning early.
This bug was uncovered by r233309 which slightly changed the ITP encoding / decoding format.
Because empty HashCountedSets are now expected to be encoded as empty array, decoding of old
data fails and we hit the buggy code path.
* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::decodeObjects):
2018-07-05 Antti Koivisto <antti@apple.com>
Move CSSParserContext to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=187342
Reviewed by Zalan Bujtas.
Move it out from CSSParserMode.h and CSSParser.cpp.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionParser.cpp:
* css/PropertySetCSSStyleDeclaration.h:
* css/StyleProperties.h:
* css/StyleSheetContents.h:
* css/parser/CSSDeferredParser.h:
* css/parser/CSSParser.cpp:
(WebCore::strictCSSParserContext): Deleted.
(WebCore::CSSParserContext::CSSParserContext): Deleted.
(WebCore::operator==): Deleted.
* css/parser/CSSParser.h:
* css/parser/CSSParserContext.cpp: Added.
(WebCore::strictCSSParserContext):
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
Also add the missing textAutosizingEnabled bit.
* css/parser/CSSParserContext.h: Copied from Source/WebCore/css/parser/CSSParserMode.h.
(WebCore::CSSParserContextHash::hash):
Also add the missing bits to the hash function.
(WebCore::isQuirksModeBehavior): Deleted.
(WebCore::isUASheetBehavior): Deleted.
(WebCore::isUnitLessValueParsingEnabledForMode): Deleted.
(WebCore::isCSSViewportParsingEnabledForMode): Deleted.
(WebCore::strictToCSSParserMode): Deleted.
(WebCore::isStrictParserMode): Deleted.
* css/parser/CSSParserIdioms.h:
* css/parser/CSSParserImpl.h:
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContext::completeURL const): Deleted.
(WebCore::operator!=): Deleted.
(WebCore::CSSParserContextHash::hash): Deleted.
(WebCore::CSSParserContextHash::equal): Deleted.
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue): Deleted.
(WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue): Deleted.
(WTF::HashTraits<WebCore::CSSParserContext>::emptyValue): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* css/parser/CSSSelectorParser.cpp:
* css/parser/CSSVariableParser.cpp:
2018-07-05 Antoine Quint <graouts@apple.com>
[Web Animations] The ready promise should initially be resolved
https://bugs.webkit.org/show_bug.cgi?id=187341
<rdar://problem/41844711>
Reviewed by Dean Jackson.
The Web Animations spec mandates that the ready promise is initially resolved.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
2018-07-05 Sergio Villar Senin <svillar@igalia.com>
[WebVR] Fix VRDisplayEvent implementation
https://bugs.webkit.org/show_bug.cgi?id=187337
Reviewed by Žan Doberšek.
VRDisplayEvent implementation had two issues. First there were no attributes storing the
VRDisplay the event refers to. Secondly the VRDisplayEventReason is not mandatory so it
should be handled via an optional.
* Modules/webvr/VRDisplayEvent.cpp:
(WebCore::VRDisplayEvent::VRDisplayEvent):
(WebCore::VRDisplayEvent::display const): Deleted.
(WebCore::VRDisplayEvent::reason const): Deleted.
* Modules/webvr/VRDisplayEvent.h:
2018-07-04 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r233325): [GTK] Broke 40 animations tests
https://bugs.webkit.org/show_bug.cgi?id=187264
Reviewed by Žan Doberšek.
This is because DocumentAnimationScheduler uses DisplayRefreshMonitor, that is only used by GTK port when
accelerated compositing is enabled. Add a GTK display refresh monitor implementation to be used as the default.
* PlatformGTK.cmake: Add new file to compilation.
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): Create DisplayRefreshMonitorGtk in GTK.
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: Added.
(WebCore::DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk):
(WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk):
(WebCore::onFrameClockUpdate):
(WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorGtk::displayLinkFired):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h: Added.
(WebCore::DisplayRefreshMonitorGtk::create):
2018-07-04 Antti Koivisto <antti@apple.com>
Reparse user stylesheets when _useSystemAppearance changes
https://bugs.webkit.org/show_bug.cgi?id=187312
<rdar://problem/38565834>
Reviewed by Tim Horton.
This setting may affect user stylesheet parsing. Reparse if it changes.
Test: fast/media/use-system-appearance-user-stylesheet-parsing.html
* page/Page.cpp:
(WebCore::Page::setUseSystemAppearance):
* page/Page.h:
(WebCore::Page::setUseSystemAppearance): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::setUseSystemAppearance):
* testing/Internals.h:
* testing/Internals.idl:
2018-07-04 Thibault Saunier <tsaunier@igalia.com>
RealtimeIncomingVideoSources: Call stop() directly in the destructor
https://bugs.webkit.org/show_bug.cgi?id=187303
Reviewed by Youenn Fablet.
Avoiding to call stopProducingData when we are not actually producing data.
This fixes tests that will run once the WPE/GTK PeerConnection implementation is merged.
* platform/mediastream/RealtimeIncomingVideoSource.h:
(WebCore::RealtimeIncomingVideoSource::~RealtimeIncomingVideoSource):
2018-07-04 Thibault Saunier <tsaunier@igalia.com>
[GTK][WPE] Stop pushing the StreamCollection as event in GStreamerMediaStreamSource
https://bugs.webkit.org/show_bug.cgi?id=187304
Reviewed by Philippe Normand.
We let parsebin build the StreamCollection for us and pass extra metadata through the
`TAG_EVENT` pushing the collection ourself is not bringing anything but adds extra work in the
MediaPlayerGStreamer duplicating the STREAM_COLLECTION message for no good reason.
MediaStream layout tests already test that code path.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcPadProbeCb):
2018-07-04 Frederic Wang <fwang@igalia.com>
[WebIDL] Remove custom bindings for HTMLDocument
https://bugs.webkit.org/show_bug.cgi?id=173444
Unreviewed, add missing bugzilla link for FIXME comments.
* dom/Document.cpp:
(WebCore::Document::closeForBindings):
(WebCore::Document::write):
(WebCore::Document::writeln):
2018-07-04 Tim Horton <timothy_horton@apple.com>
Introduce PLATFORM(IOSMAC)
https://bugs.webkit.org/show_bug.cgi?id=187315
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebCore.xcconfig:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
(WebCore::GeolocationPosition::GeolocationPosition):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routingContextUID const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList itemProvider]):
2018-07-03 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at timing-model/timelines/timelines.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186508
<rdar://problem/41000260>
Reviewed by Dean Jackson.
The remaining failing assertion in this test assumes that the ready promise for an animation is fired
prior to requestAnimationFrame callbacks being fired in the current event loop such that registering
the requestAnimationFrame() call within the ready promise has its callback fired with the same timeline
time. To ensure that is true, we perform a microtask checkpoint as soon as we're done running pending
tasks, which will resolve the ready promise for any play-pending animations.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
2018-07-03 Ryosuke Niwa <rniwa@webkit.org>
Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
https://bugs.webkit.org/show_bug.cgi?id=187284
Reviewed by Eric Carlson.
The null pointer crash was caused by some GenericEventQueue dispatching an event in a stopped document,
which does not have a valid script execution context because some uses of GenericEventQueue in media code
was not closing the queue upon stopping of all active DOM objects.
Fixed all uses of GenericEventQueue which did not suspend or stop the queue with active DOM objects.
Made SourceBufferList and TrackListBase (along with AudioTrackList, TextTrackList, and VideoTrackList)
inherit from ActiveDOMObject instead of ContextDestructionObserver to do this.
Also fixed a bug that media elements inside a template element (and other cases where the document doesn't
have a browsing context) were scheduling events since this would hit the newly added debug assertion in
GenericEventQueue::dispatchOneEvent.
Test: media/track/video-track-addition-and-frame-removal.html
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::suspend): Assert that we never try to suspend when the document has
this object alive since canSuspendForDocumentSuspension always returns false.
(WebCore::WebKitMediaKeySession::resume): Ditto.
(WebCore::WebKitMediaKeySession::stop): Stop the event queue to avoid the crash.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer): Don't do any work to update tracks when the active DOM
objects are stopped since this MediaSource and the related media objects are about to be destructed.
(WebCore::MediaSource::suspend): Assert that m_asyncEventQueue is empty as canSuspendForDocumentSuspension
returns false whenever the queue is not empty.
(WebCore::MediaSource::resume): Ditto.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::suspend): Ditto.
(WebCore::SourceBuffer::resume): Ditto.
(WebCore::SourceBuffer::stop): Stop the event queue to avoid the crash.
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList): Made this an active DOM object.
(WebCore::SourceBufferList::SourceBufferList):
(WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Added. Return false when there are
pending events to match other media code.
(WebCore::SourceBufferList::suspend): Added. Assert that the event queue is empty here.
(WebCore::SourceBufferList::resume): Ditto.
(WebCore::SourceBufferList::stop): Added. Stop the event queue to avoid the crash.
(WebCore::SourceBufferList::activeDOMObjectName const): Added.
* Modules/mediasource/SourceBufferList.h:
(WebCore::SourceBufferList): Made this an active DOM object.
* Modules/mediasource/SourceBufferList.idl:
* dom/Document.h:
(WebCore::Document::hasBrowsingContext const): Added.
* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueue::dispatchOneEvent): Added an assertion to catch when an event is dispatched
inside a stopped document, which is never correct and causes this crash down the line.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal): Exit early when the document doesn't have a browsing context;
e.g. when the media element is inside a template element.
(WebCore::HTMLMediaElement::pauseInternal): Ditto.
(WebCore::HTMLMediaElement::sourceWasAdded): Ditto.
* html/track/AudioTrackList.cpp:
(AudioTrackList::activeDOMObjectName const): Added.
* html/track/AudioTrackList.h:
* html/track/AudioTrackList.idl:
* html/track/TextTrackList.cpp::
(TextTrackList::activeDOMObjectName const): Added.
* html/track/TextTrackList.h:
* html/track/TextTrackList.idl:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase): Made this an active DOM object.
(WebCore::TrackListBase::TrackListBase):
(WebCore::TrackListBase::canSuspendForDocumentSuspension const): Added. Return false when there are pending events
to match other media code.
(WebCore::TrackListBase::suspend): Added. Assert that the event queue is empty here.
(WebCore::TrackListBase::resume): Ditto.
(WebCore::TrackListBase::stop): Added. Stop the event queue to avoid the crash.
* html/track/TrackListBase.h:
* html/track/VideoTrackList.cpp:
(VideoTrackList::activeDOMObjectName const): Added.
* html/track/VideoTrackList.h:
* html/track/VideoTrackList.idl:
2018-07-03 Fujii Hironori <Hironori.Fujii@sony.com>
[cairo] Doesn't paint box-shadow with zero blur-radius
https://bugs.webkit.org/show_bug.cgi?id=187244
Reviewed by Žan Doberšek.
Cairo::ShadowState::isRequired() returned false if blur-radius is
zero.
No new tests (Covered by existing tests).
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::ShadowState::isRequired const): Do not check blur
is zero.
2018-07-03 Ryosuke Niwa <rniwa@webkit.org>
Add a release assert to diagnose infinite recursions in removeAllEventListeners()
https://bugs.webkit.org/show_bug.cgi?id=187287
Reviewed by Keith Miller.
Assert that we never re-enter removeAllEventListeners per thread.
* dom/EventTarget.cpp:
(WebCore::EventTarget::removeAllEventListeners):
* platform/ThreadGlobalData.h:
(WebCore::ThreadGlobalData::ThreadGlobalData::isInRemoveAllEventListeners const):
(WebCore::ThreadGlobalData::ThreadGlobalData::setIsInRemoveAllEventListeners):
2018-07-03 Chris Dumez <cdumez@apple.com>
performance-api/performance-observer-no-document-leak.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=186938
<rdar://problem/41379336>
Reviewed by Simon Fraser.
Add internals API to get the identifier of a document and to ask if the document with
a given identifier is still alive. This is helpful to write tests for document leaking
fixes.
* testing/Internals.cpp:
(WebCore::Internals::documentIdentifier const):
(WebCore::Internals::isDocumentAlive const):
* testing/Internals.h:
* testing/Internals.idl:
2018-07-03 Chris Dumez <cdumez@apple.com>
Improve window.event compliance: Should not be set when target is in shadow tree
https://bugs.webkit.org/show_bug.cgi?id=186266
Reviewed by Ryosuke Niwa.
Stop exposing window.event to Shadow DOM by not setting window.event if the event's target
is a Node inside a shadow tree. This is as per the latest DOM specification:
- https://github.com/whatwg/dom/pull/407
This aligns our behavior with Blink as well:
- https://bugs.chromium.org/p/chromium/issues/detail?id=779461
Tests: imported/w3c/web-platform-tests/dom/events/event-global.html
imported/w3c/web-platform-tests/dom/events/event-global.worker.html
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
2018-07-03 Chris Dumez <cdumez@apple.com>
[Cocoa] Disable vnode guard related simulated crashes for WKTR / DRT and WebSQL
https://bugs.webkit.org/show_bug.cgi?id=187270
<rdar://problem/40674034>
Reviewed by Geoffrey Garen.
Disable vnode guard related simulated crashes for WebSQL by setting the expected
environment variable, if not already set by WKTR / DRT.
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::initialize):
(WebCore::DatabaseManager::platformInitialize):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm: Added.
(WebCore::DatabaseManager::paltformInitialize):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/FileSystem.h:
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::realPath):
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::realPath):
2018-07-03 Eric Carlson <eric.carlson@apple.com>
Don't allow autoplay when the element is suspended
https://bugs.webkit.org/show_bug.cgi?id=187299
<rdar://problem/41044691>
Reviewed by Youenn Fablet.
Block autoplay when a media element is suspended. Add more release logging to the methods
that handle autoplay attempts to help diagnose future media playback problems.
* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString): Convert PlaybackWithoutUserGesture to a string.
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks): Add logging.
(WebCore::HTMLMediaElement::hardwareMutedStateDidChange): Ditto.
(WebCore::HTMLMediaElement::handleAutoplayEvent): Ditto.
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Ditto.
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Ditto.
* html/HTMLMediaElement.h:
(WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Playback is not permitted when the
element is suspended.
* html/MediaElementSession.h:
2018-07-03 Zalan Bujtas <zalan@apple.com>
[LFC] Generate anonymous inline box for text content.
https://bugs.webkit.org/show_bug.cgi?id=187301
Reviewed by Antti Koivisto.
Always have a inline container for text content (and no dedicated text renderer).
* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
(WebCore::Layout::InlineBox::setContent):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-07-03 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Embed certificate information into ResourceResponse.
https://bugs.webkit.org/show_bug.cgi?id=187102
Reviewed by Youenn Fablet.
No new tests but tested internally.
Collect certificate information from the communication and put them into
ResourceResponse for the sake of advanced security checking and information
providing to the user.
* platform/Curl.cmake:
* platform/network/curl/CertificateInfo.cpp: Copied from Source/WebCore/platform/network/curl/CertificateInfo.h.
(WebCore::CertificateInfo::CertificateInfo):
(WebCore::CertificateInfo::isolatedCopy const):
(WebCore::CertificateInfo::makeCertificate):
* platform/network/curl/CertificateInfo.h:
(WebCore::CertificateInfo::verificationError const):
(WebCore::CertificateInfo::certificateChain const):
(WebCore::operator==):
(WebCore::CertificateInfo::CertificateInfo): Deleted.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::getCertificateInfo const):
(WebCore::CurlRequest::getNetworkLoadMetrics const):
(WebCore::CurlRequest::getNetworkLoadMetrics): Deleted.
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
(WebCore::CurlResourceHandleDelegate::curlDidComplete):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::verifyCallback):
(WebCore::StackOfX509::StackOfX509): For RAII. Used in pemDataFromCtx().
(WebCore::StackOfX509::~StackOfX509): Ditto.
(WebCore::StackOfX509::count): Ditto.
(WebCore::StackOfX509::item): Ditto.
(WebCore::BIOHolder::BIOHolder): Ditto.
(WebCore::BIOHolder::~BIOHolder): Ditto.
(WebCore::BIOHolder::write): Ditto.
(WebCore::BIOHolder::asCertificate): Ditto.
(WebCore::pemDataFromCtx): Become simple static function.
(WebCore::convertToSSLCertificateFlags): Ditto.
(WebCore::CurlSSLVerifier::certVerifyCallback): Deleted.
(WebCore::CurlSSLVerifier::getPemDataFromCtx): Deleted.
(WebCore::CurlSSLVerifier::convertToSSLCertificateFlags): Deleted.
* platform/network/curl/CurlSSLVerifier.h:
(WebCore::CurlSSLVerifier::verificationError):
(WebCore::CurlSSLVerifier::certificateChain const):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
(WebCore::ResourceError::isSSLConnectError const):
(WebCore::ResourceError::isSSLCertVerificationError const):
(WebCore::ResourceError::hasSSLConnectError const): Deleted.
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::setCertificateInfo):
(WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):
2018-07-02 Simon Fraser <simon.fraser@apple.com>
Clean up the layer volatility code and logging
https://bugs.webkit.org/show_bug.cgi?id=187286
Reviewed by Tim Horton.
Export a function.
* platform/graphics/cocoa/IOSurface.h:
2018-07-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r233112.
https://bugs.webkit.org/show_bug.cgi?id=187300
this revision is causing crashes on iOS 11 simulator
(Requested by Truitt on #webkit).
Reverted changeset:
"[Fullscreen] Restore ASSERT_NOT_REACHED() checks in exit
fullscreen handler after r231924"
https://bugs.webkit.org/show_bug.cgi?id=186945
https://trac.webkit.org/changeset/233112
2018-07-03 Chris Dumez <cdumez@apple.com>
Implement support for Element.toggleAttribute
https://bugs.webkit.org/show_bug.cgi?id=186883
Reviewed by Sam Weinig.
Implement support for Element.toggleAttribute as per:
- https://github.com/whatwg/dom/issues/461
- https://dom.spec.whatwg.org/#dom-element-toggleattribute
This was already implemented in Blink:
- https://bugs.chromium.org/p/chromium/issues/detail?id=854960
Edge expressed public support:
- https://github.com/whatwg/dom/issues/461#issuecomment-398206390
Gecko is working on it:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1469592
* dom/Element.cpp:
(WebCore::Element::toggleAttribute):
* dom/Element.h:
* dom/Element.idl:
2018-07-03 Zalan Bujtas <zalan@apple.com>
[LFC] Implement minimum/maximum content width logic.
https://bugs.webkit.org/show_bug.cgi?id=187241
Reviewed by Antti Koivisto.
Compute the minimum/maximum content width if needed and cache the values on the formatting state.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::shrinkToFitWidth): Deleted.
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setMinimumMaximumContentWidth):
(WebCore::Layout::FormattingState::clearMinimumMaximumContentWidth):
(WebCore::Layout::FormattingState::minimumMaximumContentWidth const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::createFormattingState const):
(WebCore::Layout::BlockFormattingContext::minimumMaximumContentWidth const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::minimumMaximumContentWidthNeedsChildrenWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::minimumMaximumContentWidth):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::createFormattingState const):
(WebCore::Layout::InlineFormattingContext::minimumMaximumContentWidth const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* page/FrameViewLayoutContext.cpp:
2018-07-03 Jonathan Bedard <jbedard@apple.com>
Unreviewed, rolling out r233461.
Assertions triggered during iOS 11 debug layout and API tests
Reverted changeset:
"[iOS] Add assert to catch improper use of WebCore::Timer in
UI Process"
https://bugs.webkit.org/show_bug.cgi?id=185330
https://trac.webkit.org/changeset/233461
2018-07-03 Jer Noble <jer.noble@apple.com>
Update Fullscreen anti-phishing alert text
https://bugs.webkit.org/show_bug.cgi?id=187199
<rdar://problem/41162543>
Reviewed by Brent Fulgham.
* English.lproj/Localizable.strings:
2018-07-03 Frederic Wang <fwang@igalia.com>
REGRESSION (r232186): Hardware-accelerated CSS animations using steps() timing function no longer work
https://bugs.webkit.org/show_bug.cgi?id=186129
Reviewed by Antoine Quint.
When the WebAnimationsCSSIntegration flag is enabled, animating the transform property with
a steps() timing function no longer works. This is because the WebAnimation code wrongly
assumes that the transform property can always be accelerated (for counterexamples, see
GraphicsLayerCA::animationCanBeAccelerated). For consistency with AnimationBase, we make
WebAnimation fallback to non-accelerated mode when RenderBoxModelObject::startAnimation
fails. This addresses the regression previously mentioned.
Test: http/wpt/css/css-animations/start-animation-001.html
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Fallback to
non-accelerated mode if startAnimation failed.
2018-07-03 David Kilzer <ddkilzer@apple.com>
[iOS] Add assert to catch improper use of WebCore::Timer in UI Process
<https://webkit.org/b/185330>
<rdar://problem/32816079>
Reviewed by Darin Adler.
* platform/RuntimeApplicationChecks.cpp:
(WebCore::s_webKitProcessType): Add. Global to track process
type.
(WebCore::setWebKitProcessType): Implement new function that is
called when initializing Web, Network, and Storage processes.
(WebCore::isInNetworkProcess): Add.
(WebCore::isInStorageProcess): Add.
(WebCore::isInWebProcess): Add.
- Check value in s_webKitProcessType to determine which process
is currently running.
* platform/RuntimeApplicationChecks.h:
(WebCore::isInNetworkProcess): Add.
(WebCore::isInStorageProcess): Add.
(WebCore::isInWebProcess):
- Make available for all platforms.
* platform/Timer.cpp:
(WebCore::TimerBase::TimerBase): Add assert and os_log_fault.
This catches the unwanted behavior on iOS using isAllowed().
(WebCore::TimerBase::isAllowed): Add implementation.
* platform/Timer.h:
(WebCore::TimerBase::isAllowed): Add declaration.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::isInWebProcess): Delete. Replace with method in
RuntimeApplicationChecks.cpp.
2018-07-02 Antti Koivisto <antti@apple.com>
Tighter limit for canvas memory use on iOS
https://bugs.webkit.org/show_bug.cgi?id=187279
<rdar://problem/38420562>
Reviewed by Simon Fraser.
We allowed 448MB of canvas buffer memory. This is still too much in some cases. Painting a large
canvas may also requires several other temporary canvas sized buffers getting us easily over
the process size limit.
* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
Drop to (ramSize() / 4) which computes to 224MB on 2GB devices.
2018-07-02 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Google Fonts doesn't work if the user has the requested font locally-installed
https://bugs.webkit.org/show_bug.cgi?id=187228
<rdar://problem/40967280>
Reviewed by Brent Fulgham.
This is due to the local() items in the src: descriptor in the @font-family blocks.
This is because of a behavior difference between CSSFontFaceSource::load() and CSSFontFaceSource::font().
load() is supposed to set the status() to Success iff the font can be used, and then CSSFontFaceSource::font()
is supposed to return the font itself to use. load() works by constructing a dummy FontDescription and
performing a system lookup (to see if the local font really exists). However, this dummy FontDescription
doesn't set the ShouldAllowUserInstalledFonts flag. Then, in CSSFontFaceSource::font(), a similar lookup is
performed, except this one has the original FontDescription (with the correct value of the
ShouldAllowUserInstalledFonts flag set. Therefore, the two functions disagree about the state of the flag.
When the CSSFontFaceSource's status gets set to Success, that means "this is the font face source that
represents the @font-face block" but when CSSFontFaceSource::font() returns nullptr, that means "The font face
source can't be used for some reason" so we then continue searching down the font-family list (and render the
text in Helvetica or whatever comes next).
The solution is simple - just set the ShouldAllowUserInstalledFonts flag correctly in the dummy
FontDescription.
Test: fast/text/user-installed-fonts/local.html
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::allowUserInstalledFonts const):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
2018-06-29 Ryosuke Niwa <rniwa@webkit.org>
Generate event and event target interface types directly instead of via macros
https://bugs.webkit.org/show_bug.cgi?id=187215
Reviewed by Chris Dumez.
Made make_event_factory.pl directly generate EventInterface enum values and toJSNewlyCreated for Event,
and EventTargetInterface enum values and toJS for EventTarget. Removed the code to generate EventFactory::create
since it was never even compiled or used anywhere.
This patch faithfully replicates what the macro used to generate but we should consider always generating either
toJS or toJSNewlyCreated for both interfaces in the future.
No new tests since there should be no observable behavioral changes.
* DerivedSources.make: Generate EventTargetFactory.cpp, which is used to generate toJS function for EventTarget.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp:
(WebCore::toJSNewlyCreated): Deleted. Now generated directly in EventFactory.cpp.
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped): Removed the use of TRY_TO_UNWRAP_WITH_INTERFACE.
(WebCore::toJS): Deleted. Now generated directly in EventFactory.cpp.
* bindings/scripts/InFilesCompiler.pm:
(generateInterfacesHeader): Use #pragma once. Generate enum values directly. Added the support for suffixing
each type name with namespace for EventTarget.
* dom/Event.h: Removed the declaration of EventInterface enum. It's now directly generated in EventInterfaces.h
* dom/EventNames.in: Generate toJSNewlyCreated.
* dom/EventTarget.h: Removed the declaration of EventTargetInterface as it's now done in EventTargetInterfaces.h.
* dom/EventTargetFactory.in: Generate toJS.
* dom/make_event_factory.pl:
(defaultParameters): Added two new options. factoryFunction specifies whether toJS or toJSNewlyCreated is generated,
and useNamespaceAsSuffix specifies whether each entry should be suffixed by the namespace (used by EventTarget).
(generateCode): Added a missing semicolon.
(generateImplementation): Removed the early exit for EventTarget since we now need to generate its toJS function.
Replaced the code to generate EventFactory::create by the one to generate toJS / toJSNewlyCreated.
2018-07-02 Zalan Bujtas <zalan@apple.com>
HTML widget displays blank when playing on page
https://bugs.webkit.org/show_bug.cgi?id=187272
<rdar://problem/39317899>
Reviewed by Simon Fraser.
When a composited layer gains content (in this particular case, going from NoContentsLayer to ContentsLayerForMedia),
we need to size the associated graphics layer accordingly (NoContentsLayer means zero sized graphics layer).
Not testable on iOS.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
2018-07-02 David Kilzer <ddkilzer@apple.com>
Refactor InlineTextBox::emphasisMarkExistsAndIsAbove()
<https://webkit.org/b/187204>
Reviewed by Darin Adler.
No new tests since there is no change in behavior.
Refactor emphasisMarkExistsAndIsAbove() to return a
std::optional<bool> instead of returning a bool and taking a
std::optional<bool> argument. The state returned is now:
- std::nullopt => emphasis mark doesn't exist or is suppressed.
- false => emphasis mark exists and is not suppressed, but is not above.
- true => emphasis mark exists and is not suppressed, and is above.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
- Update for refactored method. Remove some redundant checks
for TextEmphasisMark::None that already happen in
emphasisMarkExistsAndIsAbove().
* rendering/InlineTextBox.cpp:
(WebCore::emphasisPositionHasNeitherLeftNorRight): Delete.
- Replaced by an OptionSet<TextEmphasisPosition>.
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Refactor as described above.
(WebCore::InlineTextBox::paintMarkedTextForeground):
- Update for refactored method.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Update for new method signature.
2018-07-02 Megan Gardner <megan_gardner@apple.com>
Enable copy paste on iOS apps for Mac
https://bugs.webkit.org/show_bug.cgi?id=187194
<rdar://problem/41451148>
Reviewed by Darin Adler.
Difficult to test this platform.
UIKit doesn't support itemProviders for iOS apps for Mac, so we need to revert to the
older way of setting a dictionary of objects and keys for items. Not everything is
availble in this form, and we haven't cleaned up our itemProvider code yet, so we
need to case some things out for now. Hopefully in the future, this will be implmented
and can just work as expected, but for now, this is the best workaround.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::write):
(WebCore::PlatformPasteboard::readURL):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList itemProvider]):
2018-07-02 Eric Carlson <eric.carlson@apple.com>
Video sometimes flickers when playing to AppleTV
https://bugs.webkit.org/show_bug.cgi?id=187193
<rdar://problem/40153865>
Reviewed by Jer Noble and Youenn Fablet.
No new tests, existing test updated.
Delay 100ms before changing the iOS audio session category because it is an expensive and
potentially disruptive operation, and changing an audio or video element configuration
can result in several quick, ultimately unnecessary, category changes.
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::clientWillBeginPlayback): Add logging.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager): Initialize timer.
(WebCore::PlatformMediaSessionManager::removeSession): Deactivate audio session when there
are no sessions.
(WebCore::PlatformMediaSessionManager::updateSessionStateTimerFired): New, update session now.
(WebCore::PlatformMediaSessionManager::updateSessionState): Add parameter.
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState): Defer update if it isn't supposed to happen
immediately.
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory): Drive-by: setting the audio category to nil is a noop,
so don't waste time doing it.
(WebCore::AudioSession::tryToSetActive): Allow other apps to resume playback when we deactivate
the audio session.
* platform/Timer.h:
(WebCore::DeferrableOneShotTimer): Add WTF_MAKE_FAST_ALLOCATED so it can be used in a unique_ptr.
2018-07-02 Wenson Hsieh <wenson_hsieh@apple.com>
Clean up some spellchecking code
https://bugs.webkit.org/show_bug.cgi?id=187238
Reviewed by Tim Horton.
A few minor tweaks to modernize some spellchecking code. No change in behavior.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired):
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
Use move semantics when passing Ranges to markAllMisspellingsAndBadGrammarInRanges.
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
Change this to take RefPtr<Range>&& instead of Range*.
(WebCore::Editor::markMisspellingsAndBadGrammar):
Remove an unnecessary call to `RefPtr::get()`.
* editing/Editor.h:
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingParagraph::invalidateParagraphRangeValues):
(WebCore::TextCheckingParagraph::checkingStart const):
(WebCore::TextCheckingParagraph::checkingEnd const):
(WebCore::TextCheckingParagraph::checkingLength const):
(WebCore::TextCheckingParagraph::automaticReplacementStart const):
(WebCore::TextCheckingParagraph::automaticReplacementLength const):
Currently, all of these cached range offsets are `int`s, and use a value of -1 to denote that their values are
missing and must be recomputed. Instead, make these `std::optional`s and let `std::nullopt` represent the
missing value.
* editing/TextCheckingHelper.h:
2018-07-02 Antoine Quint <graouts@apple.com>
Crash in WebCore::WebAnimation::timeToNextRequiredTick when running imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html
https://bugs.webkit.org/show_bug.cgi?id=187145
Reviewed by Dean Jackson.
Ensure we have a resolved time value before trying to use it.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const):
2018-07-02 Antoine Quint <graouts@apple.com>
[Web Animations] Crash in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
https://bugs.webkit.org/show_bug.cgi?id=187139
Reviewed by Dean Jackson.
Ensure we have a resolved time value before trying to use it.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2018-07-02 Youenn Fablet <youenn@apple.com>
Reject getUserMedia promise if capture fails
https://bugs.webkit.org/show_bug.cgi?id=187190
Reviewed by Eric Carlson.
In case PendingActivationMediaStream is notified of a change,
Check whether any track failed to capture.
If so, reject the promise.
Add more release logging in error case.
Covered by manual testing.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
(WebCore::UserMediaRequest::PendingActivationMediaStream::characteristicsChanged):
(WebCore::UserMediaRequest::mediaStreamIsReady):
(WebCore::UserMediaRequest::mediaStreamDidFail):
* Modules/mediastream/UserMediaRequest.h:
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::captureFailed):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupCaptureSession):
2018-07-01 Fujii Hironori <Hironori.Fujii@sony.com>
[WK2] fast/parser/document-open-in-unload.html makes the following test crash
https://bugs.webkit.org/show_bug.cgi?id=98345
<rdar://problem/12474923>
Reviewed by Ryosuke Niwa.
m_documentLoader can become null in the middle of
FrameLoader::commitProvisionalLoad by stopping the loading.
No new tests (Covered by existing tests).
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Do null check of m_documentLoader.
2018-07-01 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] LastResort in the font family list causes emoji with joiners to be rendered as multiple .notdef characters
https://bugs.webkit.org/show_bug.cgi?id=187209
<rdar://problem/40920785>
Reviewed by Darin Adler.
Inside our complex text codepath, we perform our own font fallback, which
includes a function that asks "can this font support this grapheme cluster?"
Because of the mechanics of how fonts work, the implementation of this
function is "Does the font's cmap table support every character of the
cluster?" We were using Font::glyphForCharacter() to determine this; however,
this function maps certain control characters to the zero width space
character (with the intention that these control characters shouldn't be
visible in the fast text codepath). That replacement, however, was causing
us to get false negatives, because Apple Color Emoji doesn't support zero
width space. Therefore, Apple Color Emoji was looking like it didn't support
emoji combining sequences.
The best solution to this would be to get Font::glyphForCharacter() to stop
performing these replacements (see https://bugs.webkit.org/show_bug.cgi?id=187166).
However, that is too risky of a change to be making right now. Instead,
a more localized solution is to implement a version of "Does the font's cmap
table support every character of the cluster" that doesn't perform the
substitutions. This patch does exactly that, and uses a bit vector to cache
the results. In order to not have a giant bit vector, we take the old code
path if we know the substitutions won't affect us (and uses ASSERT()s to
validate this) so the bit vector only holds at maximum 3 words of storage.
Test: fast/text/emoji-with-joiner.html
* platform/graphics/Font.cpp:
(WebCore::codePointSupportIndex):
(WebCore::createAndFillGlyphPage):
(WebCore::Font::platformSupportsCodePoint const):
(WebCore::Font::supportsCodePoint const):
(WebCore::Font::canRenderCombiningCharacterSequence const):
* platform/graphics/Font.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformSupportsCodePoint const):
2018-07-01 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Text replacements that end with symbols are expanded immediately
https://bugs.webkit.org/show_bug.cgi?id=187225
<rdar://problem/41112433>
Reviewed by Darin Adler.
In shipping Safari, enabling grammar correction causes text shortcuts that end with symbols or punctuation marks
to immediately trigger when typing; normally, when grammar correction is off, this is only triggered after the
user has additionally inserted a punctuation mark or whitespace character after the replaced text.
This bug happens because enabling grammar checking causes the spell checking range to expand to the range of the
full sentence, so any text checking results that replace an existing range are triggered as long as they end
anywhere in the sentence. In contrast, when grammar checking is disabled, the spell checking range is limited to
the nearest adjacent word, which prevents text replacement from occurring elsewhere in the sentence.
However, after r232530, we now always expand the spell checking range to the extent of the sentence when a word
is typed regardless of whether grammar checking is enabled, which means that the issue described above now
happens everywhere. To fix this recent regression and the existing bug, we:
- Augment our spellchecking codepaths to include a new automatic text replacement range, alongside
spellchecking and paragraph ranges.
- Let this automatic text replacement range be the range of the adjacent word in the case where the user has
finished typing a word.
- When marking and replacing text checking results, consult this new automatic text replacement instead of the
spellchecking range.
This keeps the behavior grammar and sentence retro correction results intact, while limiting the scope in which
text replacement results are applied.
Test: editing/spelling/text-replacement-after-typing-to-word.html
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired):
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
Pass in the adjacent word range for the `automaticReplacementRange`, instead of the spell checking range (which
may be extended to the full range of the sentence).
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
Add an `automaticReplacementRange` argument to markAllMisspellingsAndBadGrammarInRanges, and adjust call sites
to pass in a range (generally the same as the spell checking range, but in the case where a word has been typed,
this is a narrower range).
(WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
(WebCore::Editor::markAndReplaceFor):
When replacing text, only allow text replacement in the automatic replacement range rather than the spell
checking range.
(WebCore::Editor::markMisspellingsAndBadGrammar):
* editing/Editor.h:
* editing/SpellChecker.cpp:
(WebCore::SpellCheckRequest::SpellCheckRequest):
Add a new version of this constructor that takes a single Range representing both the spellchecking range and
the automatic text replacement range, for convenience.
(WebCore::SpellCheckRequest::create):
* editing/SpellChecker.h:
Add plumbing for the automatic replacement range.
(WebCore::SpellCheckRequest::automaticReplacementRange const):
* editing/TextCheckingHelper.cpp:
Add plumbing for the automatic replacement range, and new helpers to locate the range as offsets within the
text checking paragraph range.
(WebCore::TextCheckingParagraph::TextCheckingParagraph):
(WebCore::TextCheckingParagraph::invalidateParagraphRangeValues):
(WebCore::TextCheckingParagraph::automaticReplacementStart const):
(WebCore::TextCheckingParagraph::automaticReplacementLength const):
* editing/TextCheckingHelper.h:
2018-06-30 David Kilzer <ddkilzer@apple.com>
Follow-up: Fix clang static analyzer warnings: Garbage return value
<https://webkit.org/b/187224>
Address review feedback from Eric Carlson.
* platform/mediastream/MediaConstraints.h:
(WebCore::NumericConstraint::valueForCapabilityRange const):
- Use brace initialization for more local variables.
2018-06-30 Michael Catanzaro <mcatanzaro@igalia.com>
Asan false positive: stack use after scope under WebCore::ApplyPropertyBorderImageModifier in WebCore::Length::Length(WebCore::Length&&)
https://bugs.webkit.org/show_bug.cgi?id=186980
<rdar://problem/41409838>
Reviewed by Oliver Hunt.
We believe that we have found a bug in GCC's address sanitizer. It is blocking work on other
issues, so work around it by changing a temporary into a local variable.
* css/StyleBuilderCustom.h:
(WebCore::ApplyPropertyBorderImageModifier::applyInitialValue):
2018-06-30 David Kilzer <ddkilzer@apple.com>
Fix clang static analyzer warnings: Garbage return value
<https://webkit.org/b/187224>
Reviewed by Eric Carlson.
* platform/mediastream/MediaConstraints.h:
(WebCore::NumericConstraint::valueForCapabilityRange const):
- Use brace initialization for local variables.
2018-06-30 Zalan Bujtas <zalan@apple.com>
[LFC] Do not add the containing block's offset while computing the out-of-flow static position.
https://bugs.webkit.org/show_bug.cgi?id=187202
Reviewed by Antti Koivisto.
The static position for an out-of-flow elements is
1. the distance from the parent's border box.
2. climbing up on the containing block chain and offset the containers until we reach the out-of-flow element's containing block.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2018-06-30 Zalan Bujtas <zalan@apple.com>
[LFC] If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
https://bugs.webkit.org/show_bug.cgi?id=187220
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginBottomCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
2018-06-30 Zalan Bujtas <zalan@apple.com>
[LFC] Adjust final out-of-flow position with the computed margin value.
https://bugs.webkit.org/show_bug.cgi?id=187219
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2018-06-29 Antoine Quint <graouts@apple.com>
[Web Animations] Make WPT test at timing-model/timelines/document-timelines.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186507
<rdar://problem/41000257>
Reviewed by Dean Jackson.
The Web Animations spec, along with the HTML5 event loop spec, specify some assumptions on the time reported by
document.timeline.currentTime:
- it should only increase once per frame
- it should have the same value as the timestamp passed to requestAnimationFrame() callbacks
The WPT test at web-platform-tests/web-animations/timing-model/timelines/document-timelines.html relies on these
assumptions to be true so that we check that the start time of a new animation is not the same as the timeline time
when it was created, since it will be in the "play-pending" state for a frame.
In order to support this, we add two new methods on DocumentAnimationScheduler. First, when a scheduled display update
fires, we record the timestamp and expose it via lastTimestamp() such that DocumentTimeline and ScriptedAnimationController
can use the same value when updating animations. Then, to know whether code is run as a result of a display update, we
expose isFiring().
Now, within DocumentTimeline::currentTime(), we can cache the current time this way:
- if we're in the middle of a display update, use the value returned by lastTimestamp().
- otherwise, compute what would have been the ideal number of frames (at 60fps or less if throttled) and add those to
the lastTimestamp() value.
Then, we remove this cached current time when both currently-running JavaScript has completed and all animation update
code has completed by waiting on the invalidation task to run.
* animation/DocumentAnimationScheduler.cpp:
(WebCore::DocumentAnimationScheduler::displayRefreshFired):
* animation/DocumentAnimationScheduler.h:
(WebCore::DocumentAnimationScheduler::lastTimestamp):
(WebCore::DocumentAnimationScheduler::isFiring const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::performInvalidationTask):
(WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
* animation/DocumentTimeline.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
2018-06-29 Nan Wang <n_wang@apple.com>
Crash under WebCore::AXObjectCache::handleMenuItemSelected
https://bugs.webkit.org/show_bug.cgi?id=186918
<rdar://problem/41365984>
Reviewed by Chris Fleizach.
When a node is being destroyed, we deregister it from the AX cache through the Node's destructor.
But we did not remove the corresponding entry from the m_deferredFocusedNodeChange list. It would
then lead to a crash if we try to access the deleted node from m_deferredFocusedNodeChange.
Fixed it by removing the entry if the newly focused node is being destroyed.
Test: accessibility/accessibility-crash-focused-element-change.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
2018-06-29 Antti Koivisto <antti@apple.com>
REGRESSION (r232806): Facebook login fields have blue fill background instead of white
https://bugs.webkit.org/show_bug.cgi?id=187207
<rdar://problem/41606349>
Reviewed by Tim Horton.
This happens because a 'prefers-dark-interface' media query on UA sheet always evaluates to true in dark mode.
Tests: fast/forms/input-background-ua-media-query.html
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
Make prefers-dark-interface media query match only when using system appearance.
2018-06-29 Daniel Bates <dabates@apple.com>
REGRESSION (r230921): Cannot log in to forums.swift.org using GitHub account
https://bugs.webkit.org/show_bug.cgi?id=187197
<rdar://problem/40420821>
Reviewed by Brent Fulgham.
Fixes an issue where a Same-Site cookies are not sent with any child window load if the
load is cross-origin with respect to the window's opener. One example where this issue
manifest itself was in the GitHub sign in flow on forums.swift.org.
Currently we always consider the origin of the window's opener (if we have one) when
determining whether a frame load request is same-origin and hence should send Same-Site
cookies when performing the request. So, when page A.com opens a child window to B.com and
then a person clicks a hyperlink or submits a form to B.com/b2 then we do not send Same-
Site cookies with the request to B.com/b2 (because its origin, B.com, is cross-origin
with its opener, A.com). But we should send Same-Site cookies with the request to B.com/b2
because it is same-origin with the page that initiated the request, B.com. Instead of
always considering the origin the window's opener for every frame load we should only
consider it for the first non-empty document load.
Tests: http/tests/cookies/same-site/fetch-in-about-blank-popup.html
http/tests/cookies/same-site/post-from-cross-site-popup.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest):
2018-06-29 Nan Wang <n_wang@apple.com>
AX: [iOS] VoiceOver scroll position is jumpy in frames
https://bugs.webkit.org/show_bug.cgi?id=186956
Reviewed by Simon Fraser.
iOS is using delegate scrolling and we should not take into account
the scroll offset when converting rects.
Also fixed a issue where we want to scroll the element into view even
if it's partially visible.
Test: fast/scrolling/ios/iframe-scroll-into-view.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::scrollToMakeVisible const):
* platform/ScrollView.cpp:
(WebCore::ScrollView::contentsToContainingViewContents const):
2018-06-29 Chris Dumez <cdumez@apple.com>
WebKitLegacy: Can trigger recursive loads triggering debug assertions
https://bugs.webkit.org/show_bug.cgi?id=187121
<rdar://problem/41259430>
Reviewed by Brent Fulgham.
In order to support asynchronous policy delegates, r229722 added a call to
FrameLoader::clearProvisionalLoadForPolicyCheck() when starting a navigation
policy decision in PolicyChecker::checkNavigationPolicy(). This calls
stopLoading() on the current provisional loader if there is one, and potentially
calls the didFailProvisionalLoadWithError cleint delegate. This delegate call
is synchronous on WebKit1, so the client may start a new load from this delegate
and re-enter Webcore. This happens in practive with Quickens 2017 / 2018 on Mac.
Before r229722, this was not an issue because pending loads were canceled after
the (asynchronous) navigation policy decision, via FrameLoader::stopAllLoaders().
FrameLoader::stopAllLoaders() sets a m_inStopAllLoaders flag and we return early
in FrameLoader::loadRequest() when this flag is set to prevent recursive loads.
To maintain shipping behavior as much as possible, this patch introduces a similar
inClearProvisionalLoadForPolicyCheck which gets set during
FrameLoader::clearProvisionalLoadForPolicyCheck() and we prevent new loads while
this flag is set.
I have verified that Quickens 2017 / 2018 works again after this change and I added
API test coverage for this behavior.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
* loader/FrameLoader.h:
2018-06-25 Said Abou-Hallawa <sabouhallawa@apple.com>
Infinite loop if a <use> element references its ancestor and the DOMNodeInserted event handler of one its ancestor's descents updates the document style
https://bugs.webkit.org/show_bug.cgi?id=186925
Reviewed by Antti Koivisto.
This patches fixes two issues:
-- SVGTRefTargetEventListener should not assume it has to be attached to
target when its handleEvent() is called.
Because SVGTRefTargetEventListener::handleEvent() references the target
element, we just return if the listener is detached.
-- The <use> element should not clone its shadow tree if it references one
of its ancestors. The DOMNodeInserted of any node in the target element
tree may issue a document command. This document command will cause the
shadow tree to be re-cloned so this will cause infinite loop to happen.
Test: svg/dom/svg-use-infinite-loop-cloning.html
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefTargetEventListener::handleEvent):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree):
2018-06-29 Manuel Rego Casasnovas <rego@igalia.com>
[WPE] Three CSS Grid Layout tests crash due to valueless std::optional access
https://bugs.webkit.org/show_bug.cgi?id=186752
Reviewed by Frédéric Wang.
This is a simple fix for the crash we're getting on WPE
in IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep().
Covered by existent tests, just remove them from TestExpectations file.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
Check if minSize is null before trying to access it's value.
2018-06-29 David Fenton <david_fenton@apple.com>
Unreviewed, rolling out r233349.
caused 42 crashes on iOS GuardMalloc and iOS ASan tests
Reverted changeset:
"[Web Animations] Using a Web Animation leaks the Document"
https://bugs.webkit.org/show_bug.cgi?id=187088
https://trac.webkit.org/changeset/233349
2018-06-29 Jer Noble <jer.noble@apple.com>
Returning PiP'd video to fullscreen while playing leaves video muted.
https://bugs.webkit.org/show_bug.cgi?id=187181
<rdar://problem/41408335>
Reviewed by Eric Carlson.
Test: media/picture-in-picture-interruption.html
Don't reset the media session's state at the end of an interruption if it wasn't changed an the beginning of one.
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::endInterruption):
* testing/Internals.cpp:
(WebCore::Internals::mediaSessionState):
* testing/Internals.h:
* testing/Internals.idl:
2018-06-29 Zalan Bujtas <zalan@apple.com>
[LFC] When the formatting root is also a containing block for out-of-flow elements.
https://bugs.webkit.org/show_bug.cgi?id=187179
Reviewed by Antti Koivisto.
Out-of-flow descendants' layout requires their containing block height to be computed. This patch takes care of the case
when the containing block is also a formatting context root (e.g. relative positioned with overflow other than visible).
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2018-06-29 Zalan Bujtas <zalan@apple.com>
[LFC] Do not skip the next inflow sibling after finishing a formatting context root layout.
https://bugs.webkit.org/show_bug.cgi?id=187178
Reviewed by Antti Koivisto.
Since the block formatting layout is based on pre-order traversal, after finishing a formatting
context layout (which takes care of its entire subtre), we need to visit the next (in-flow)sibling.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
2018-06-29 Zalan Bujtas <zalan@apple.com>
[LFC] The static position for an out-of-flow box should include the previous sibling's collapsed margin
https://bugs.webkit.org/show_bug.cgi?id=187169
Reviewed by Antti Koivisto.
When computing the static position of an absolutely positioned box, we need to look at the previous sibling's bottom margin.
If the previous sibling happens to collapse its bottom margin with the parent's bottom margin, we still need to account for it
and compute the static vertical position as if the bottom margin was not collapsed.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setVerticalNonCollapsedMargin):
(WebCore::Display::Box::nonCollapsedMarginTop const):
(WebCore::Display::Box::nonCollapsedMarginBottom const):
2018-06-27 Antoine Quint <graouts@apple.com>
[Web Animations] Using a Web Animation leaks the Document
https://bugs.webkit.org/show_bug.cgi?id=187088
<rdar://problem/41392046>
Reviewed by Dean Jackson.
Test: webanimations/leak-document-with-web-animation.html
We need to ensure that any remaining animation is cleared when the DocumentTimeline is detached from its Document.
We rename WebAnimation::prepareAnimationForRemoval() to WebAnimation::remove() since it really actively disassociates
the animation from its timeline.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimationsForElement): We no longer need the call to removeAnimation()
since the new WebAnimation::remove() method will also set the timeline to null which will eventually call
removeAnimation() on the disassociated timeline.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::remove):
(WebCore::DeclarativeAnimation::prepareAnimationForRemoval): Deleted.
* animation/DeclarativeAnimation.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument): Call remove() on all known animations.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::remove): Set the timeline to null to fully disassociate this animation from its timeline.
(WebCore::WebAnimation::setTimeline): Factor the internal timeline-association code out of this JS API method so
that we can call this code without any JS-facing implications.
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::prepareAnimationForRemoval): Deleted.
* animation/WebAnimation.h:
2018-06-28 Zalan Bujtas <zalan@apple.com>
[LFC] Out-of-flow positioned height does not necessarily equal to "bottom - top".
https://bugs.webkit.org/show_bug.cgi?id=187168
Reviewed by Antti Koivisto.
According to the spec "For absolutely positioned elements, the used values of the vertical dimensions must satisfy this constraint:
'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block"
With a non-auto "height" value, the bottom - top does not necessarily compute to the height of the element.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2018-06-28 Olivia Barnett <obarnett@apple.com>
Find in page for typographic quotes does not find low (German) quotes
https://bugs.webkit.org/show_bug.cgi?id=187164
<rdar://problem/29612785>
Reviewed by Tim Horton.
Added additional quote test to LayoutTests/fast/text/find-quotes.html.
Added functionality to replace German quotes when matching.
* editing/TextIterator.cpp:
(WebCore::foldQuoteMark):
(WebCore::foldQuoteMarks):
2018-06-28 Antti Koivisto <antti@apple.com>
REGRESSION (233281): fast/dom/location-new-window-no-crash.html and some other tests are timing out
https://bugs.webkit.org/show_bug.cgi?id=187156
Reviewed by Zalan Bujtas.
We need still need to re-enable memory cache client calls even when not doing other post-resolution callbacks.
* style/StyleTreeResolver.cpp:
(WebCore::Style::memoryCacheClientCallsResumeQueue):
Add a separate queue for this.
(WebCore::Style::suspendMemoryCacheClientCalls):
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):
2018-06-28 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] DataTransfer.getData always returns the empty string when dropping text
https://bugs.webkit.org/show_bug.cgi?id=187130
<rdar://problem/41014117>
Reviewed by Ryosuke Niwa.
Currently, DataTransfer.getData() always returns the empty string on drop. This is because all data on drop is
backed by local files in the temporary directory, so the number of files is never 0; this, combined with the
fact that WebKit will suppress access to the DataTransfer object if there is one or more file in the pasteboard,
means that getData() never works for drag and drop on iOS at the moment. To fix this, we need to know whether a
dropped item provider is a file.
Ideally, we'd have a flag to tell us whether or not an NSItemProvider being dropped is a file, or instead just
inline data - in fact, this flag already exists in the form of UIPreferredPresentationStyle. Unfortunately, not
all apps that vend draggable files specify this, so we can't simply ask the item provider whether it's intended
to be a file. As a workaround, we can use several heuristics to determine the "file content state" of the drag
pasteboard on iOS (see below for more details).
This patch adds some plumbing through the client layers to grab a list of item information describing each
dropped item provider on iOS. Using this information, we tweak the logic in Pasteboard::fileContentState to make
an educated guess at whether or not the pasteboard really contains files; if we determine that the pasteboard
probably contains no files, we'll allow DataTransfer.getData() to retrieve information from the pasteboard.
Otherwise, if the pasteboard may contain files, we'll fall back to our current behavior of including the "Files"
type in DataTransfer.types and allowing the page to grab file data using DataTransfer.files or
DataTransfer.items.
Tests: DataInteractionTests.DataTransferGetDataReadPlainAndRichText
DataInteractionTests.DataTransferSuppressGetDataDueToPresenceOfTextFile
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::filesFromPasteboardAndItemList const):
Check Pasteboard::fileContentState() to ensure that we don't expose files when DataTransfer.types does not
contain the "Files" type, and vice versa, and DataTranser.files is also empty in this case.
* dom/DataTransferItemList.cpp:
* platform/PasteboardItemInfo.h:
Add a couple of additional members to PasteboardItemInfo: suggestedFileName and hasDeclaredNonTextType, a flag
that indicates whether or not the pasteboard item has a type representation that is a declared type, but is not
a text type (i.e. does not conform to "public.text", "public.url", or rich text format with attachment types).
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
Instead of always considering a dropped item provider on iOS to represent a file, only do so if at least one of
the following conditions are met:
- The drop session contains multiple item providers (flocking text selections is a very rare use case).
- The item provider was explicitly marked as an attachment.
- The item provider has a suggested file name.
- The item provider has any other content that is not text.
In the case where none of the above conditions are met, the item provider (if it ends up being a file) is
essentially indistinguishable from inline data. An example of this is dropping a plain text file that is
unnamed, with no presentation style, and alongside no other items nor other known type representations. These
are cases in which whether the item is treated as a file or as inline data is (hopefully) irrelevant.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::allPasteboardItemInfo):
(WebCore::PlatformPasteboard::informationForItemAtIndex):
2018-06-28 Timothy Hatcher <timothy@apple.com>
Don't force black text when TextIndicator draws backgrounds or all content.
https://bugs.webkit.org/show_bug.cgi?id=187161
rdar://problem/40434644
Reviewed by Tim Horton.
* page/TextIndicator.cpp:
(WebCore::snapshotOptionsForTextIndicatorOptions):
Only set SnapshotOptionsForceBlackText when TextIndicatorOptionRespectTextColor and
TextIndicatorOptionPaintBackgrounds are not set.
2018-06-28 Timothy Hatcher <timothy@apple.com>
Find on page selection color isn't adapted for dark mode.
https://bugs.webkit.org/show_bug.cgi?id=187072
Unreviewed, revert part of r233280.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Use pure yellow again.
2018-06-28 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_animation-starttime.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183834
<rdar://problem/40997932>
Reviewed by Dean Jackson.
We need to run pending tasks in the "update animations" procedure to ensure that the start time has been set
to a different time than the timeline time at the time the animation was asked to play(). This ensure the
timeline current time has progressed and can be queried to a different value in a requestAnimationFrame()
callback.
When invalidating events, we need to make sure we disregard instances when an animation has and is still pending
so that we wait until we change the pending state to work out which events to enqueue.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updatePendingTasks):
(WebCore::WebAnimation::timeToNextRequiredTick const):
(WebCore::WebAnimation::runPendingTasks):
* animation/WebAnimation.h:
2018-06-28 Ryosuke Niwa <rniwa@webkit.org>
Release assert in ScriptController::canExecuteScripts via WebCore::SVGUseElement::insertedIntoAncestor
https://bugs.webkit.org/show_bug.cgi?id=187137
<rdar://problem/41081885>
Reviewed by Zalan Bujtas.
The bug was caused by SVGUseElement::notifyFinished firing a DOM event via SVGUseElement::updateExternalDocument
inside SVGUseElement::insertedIntoAncestor. Ideally, we make every call to notifyFinished asynchronous
but simply delay the call to updateExternalDocument() until didFinishInsertingNode() for now.
No new tests since the failure is caught with the newly added assertion in notifyFinished by existing SVG tests
such as svg/batik/filters/filterRegions.svg and svg/batik/text/smallFonts.svg. Unfortunately, I could not
construct a test case which hits this release assertion since the real crash happens when the cached resource
had an error but in the all cases I could find, the resource response with an error results in a reload or
an asynchronous failure callback.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAddClient): Added a FIXME.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedIntoAncestor): Delay the call to updateExternalDocument.
(WebCore::SVGUseElement::didFinishInsertingNode): Invoke updateExternalDocument.
(WebCore::SVGUseElement::notifyFinished): Added an assertion.
* svg/SVGUseElement.h:
2018-06-28 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r233309.
Invalidates previous database model without versioning
Reverted changeset:
"Fix encoding / decoding issues in ResourceLoadStatistics"
https://bugs.webkit.org/show_bug.cgi?id=186890
https://trac.webkit.org/changeset/233309
2018-06-28 Timothy Hatcher <timothy@apple.com>
Focus ring color does not honor dark mode or system accent color.
https://bugs.webkit.org/show_bug.cgi?id=187144
rdar://problem/41105081
Reviewed by Tim Horton.
Pass the focus ring color through to the GraphicsContext methods that draw it.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
(WebCore::drawFocusRing):
(WebCore::drawFocusRingToContext):
(WebCore::drawFocusRingToContextAtTime):
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::GraphicsContext::focusRingColor): Deleted.
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
2018-06-28 Aditya Keerthi <akeerthi@apple.com>
REGRESSION (r232040): Cursor jumping in Safari text fields
https://bugs.webkit.org/show_bug.cgi?id=187142
<rdar://problem/41397577>
Reviewed by Tim Horton.
r232040 enabled click events to fire on nodes that are already being edited in
iOS. This resulted FrameSelection::setSelection being called twice. One call
originated from the UIWKTextInteractionAssistant, which snaps the caret to word
boundaries. The other call originates from handleMousePressEvent in EventHandler,
and uses character boundaries. Consequently, we see the caret jumping around.
To fix this issue, an early return was added in the handleMousePressEvent
codepath, which prevents FrameSelection::setSelection from being called when
clicking on a node that is already being edited. This ensures that the
UIWKTextInteractionAssistant codepath is the only influence on the caret position.
Test: fast/events/ios/click-selectionchange-once.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
2018-06-28 Chris Dumez <cdumez@apple.com>
Fix encoding / decoding issues in ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=186890
Reviewed by Brent Fulgham.
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashCountedSet):
(WebCore::encodeHashSet):
Do not return early if the container we're trying to encode is empty. Instead,
have the encoder encode an empty array. This is important for encoding / decoding
to be fully symmetric. Otherwise, when trying to decode one of these empty containers,
the decoder would fail (silently since we were ignoring decoding errors). Worse, the
decoder might succeed but actually be decoding the *next* container in the file, since
we have several HashCountedSets / HashSets encoded one after another.
(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
Return a boolean to indicate if the decoding suceeded or not.
(WebCore::ResourceLoadStatistics::decode):
Check for container decoding errors and return false when decoding fails.
Otherwise, we would just silently keep going.
2018-06-28 Sihui Liu <sihui_liu@apple.com>
Cookie API: cookie creation time is wrong
https://bugs.webkit.org/show_bug.cgi?id=187101
Reviewed by Geoffrey Garen.
Covered by API test: WebKit.WKHTTPCookieStoreCreationTime.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable const):
2018-06-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
https://bugs.webkit.org/show_bug.cgi?id=187140
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setVerticalNonCollapsedMargin):
2018-06-28 Zalan Bujtas <zalan@apple.com>
[LFC] The margin bottom of the document element does not collapse with its last inflow child's bottom margin.
https://bugs.webkit.org/show_bug.cgi?id=187135
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
2018-06-28 Dirk Schulze <krit@webkit.org>
[css-masking] Update clip-path box mapping to unified box
https://bugs.webkit.org/show_bug.cgi?id=185797
Reviewed by Simon Fraser.
The box mapping for fill-box, stroke-box, view-box on HTML elements
and content-box, padding-box, margin-box, border-box for SVG elements
was aligned with the transform-box CSS property.
Furthermore, the keywords fill changed to fill-box and stroke changed
to stroke-box.
https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box
Update the -webkit-clip-path property.
Tests: svg/clip-path/clip-path-shape-border-box-expected.svg
svg/clip-path/clip-path-shape-border-box.svg
svg/clip-path/clip-path-shape-content-box-expected.svg
svg/clip-path/clip-path-shape-content-box.svg
svg/clip-path/clip-path-shape-margin-box-expected.svg
svg/clip-path/clip-path-shape-margin-box.svg
svg/clip-path/clip-path-shape-padding-box-expected.svg
svg/clip-path/clip-path-shape-padding-box.svg
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CSSBoxType const):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
* rendering/shapes/BoxShape.cpp:
(WebCore::computeRoundedRectForBoxShape):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
(WebCore::ShapeOutsideInfo::logicalTopOffset const):
(WebCore::ShapeOutsideInfo::logicalLeftOffset const):
* rendering/style/RenderStyleConstants.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2018-06-27 Timothy Hatcher <timothy@apple.com>
Don't expose new semantic -apple-system color keywords on iOS.
https://bugs.webkit.org/show_bug.cgi?id=187080
rdar://problem/41505699
Reviewed by Tim Horton.
* DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.
* css/CSSValueKeywords.in: Define new semantic colors only on macOS.
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Compute both the collapsed and the non-collapsed margin values.
https://bugs.webkit.org/show_bug.cgi?id=187129
Reviewed by Antti Koivisto.
For validation purposes only at this point.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Align inFlowNonReplacedHeightAndMargin() style with the rest of the compute functions.
https://bugs.webkit.org/show_bug.cgi?id=187126
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-06-27 Yusuke Suzuki <utatane.tea@gmail.com>
[GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
https://bugs.webkit.org/show_bug.cgi?id=187089
Reviewed by Michael Catanzaro.
Do not allow copying since XErrorTrapper's logic relies on the address of XErrorTrapper.
* platform/graphics/x11/XErrorTrapper.h:
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Align inFlowNonReplacedWidthAndMargin() style with the rest of the compute functions.
https://bugs.webkit.org/show_bug.cgi?id=187124
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2018-06-27 Dirk Schulze <krit@webkit.org>
-webkit-clip-path wrong offset for clipPath references
https://bugs.webkit.org/show_bug.cgi?id=129246
Reviewed by Simon Fraser.
Compute the correct offset for reference clip-paths by reusing
some of the logic from basic shapes.
Makes reference based clip-path interoperable and follows the
spec.
Test: css3/masking/clip-path-reference-2.html
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::computeClipPath const):
(WebCore::RenderLayer::setupClipPath):
2018-06-27 Antti Koivisto <antti@apple.com>
Don't invoke post resolution callbacks when resolving computed style
https://bugs.webkit.org/show_bug.cgi?id=187113
<rdar://problem/41365766>
Reviewed by Geoff Garen.
Post-resolution callbacks should only be invoked when we resolve the full document style,
not when resolving computed style for a single element.
Tests: fast/dom/object-computed-style-event.html
* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* dom/Element.cpp:
(WebCore::Element::resolveComputedStyle):
Also ref the ancestor stack to be safe.
* style/StyleTreeResolver.cpp:
(WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):
Add an option to not drain the callback queue on destruction. In this mode we
just block network loads.
* style/StyleTreeResolver.h:
2018-06-27 Timothy Hatcher <timothy@apple.com>
Find on page selection color isn't adapted for dark mode.
https://bugs.webkit.org/show_bug.cgi?id=187072
rdar://problem/40354841
Reviewed by Tim Horton.
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Use [NSColor findHighlightColor].
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): Added.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Set m_usingDarkAppearance.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Use TextPaintPhase::Decoration since this
matches step three of InlineTextBox::paint ("Paint fancy decorations"). This allows TextMatch to
paint a forground and not end up painting during this "fancy decorations" phase.
(WebCore::InlineTextBox::resolveStyleForMarkedText): Set the fillColor for TextMarker to force a
dark text color which will draw over the yellow highlight.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Added support for TextPaintPhase::Decoration.
Seperate DocumentMarker::TelephoneNumber and DocumentMarker::TextMatch. Have DocumentMarker::TextMatch
support Forground and Background phases.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::activeTextSearchHighlightColor const): Added. Call the platfrom version.
(WebCore::RenderTheme::inactiveTextSearchHighlightColor const): Added. Ditto.
(WebCore::RenderTheme::platformActiveTextSearchHighlightColor const): Added StyleColor::Options.
(WebCore::RenderTheme::platformInactiveTextSearchHighlightColor const): Ditto.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformInactiveTextSearchHighlightColor const): Added.
(WebCore::RenderThemeMac::platformColorsDidChange): Clear new color caches.
(WebCore::RenderThemeMac::systemColor const): Cache system colors by light and dark mode.
2018-06-27 Chris Dumez <cdumez@apple.com>
Crash under SWServer::unregisterServiceWorkerClient()
https://bugs.webkit.org/show_bug.cgi?id=187115
<rdar://problem/41539197>
Reviewed by Youenn Fablet.
Connections are usually destroyed before their SWServer. However, as per crash traces, it is possible
for SWServers to get destroyed while they still have connections. When this happens, the connections
(which are owned by the SWServer) get destroyed with other SWServer data members. In turn, the
connection destructor tries to unregister its clients from the server that is currently being destroyed.
To address the issue, the SWServer destructor now destroys remaining connections early, before SWServer's
other data members get destroyed.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
2018-06-27 Youenn Fablet <youenn@apple.com>
NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
https://bugs.webkit.org/show_bug.cgi?id=186551
Reviewed by Daniel Bates.
No change of behavior.
Add a way to set the client receiving any CSP warning/error notification.
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::setClient):
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Do not collapse margin with the parent when element has border/padding.
https://bugs.webkit.org/show_bug.cgi?id=187114
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
2018-06-27 Simon Fraser <simon.fraser@apple.com>
Fix Windows build after r233268.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::hasContents const):
* platform/graphics/ca/win/PlatformCALayerWin.h:
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Out-of-flow positioned element's height depends on its containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=187082
Reviewed by Antti Koivisto.
We can't really compute the final height of an out-of-flow element until after its containing block's height is computed.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/layouttree/LayoutContainer.h:
(WebCore::Layout::Container::outOfFlowDescendants const):
(WebCore::Layout::Container::outOfFlowDescendants): Deleted.
2018-06-27 Youenn Fablet <youenn@apple.com>
Disable content blockers in NetworkLoadChecker except for ping loads
https://bugs.webkit.org/show_bug.cgi?id=187083
<rdar://problem/41440083>
Reviewed by Chris Dumez.
Add internals API to reload a frame without content extensions.
Test: http/tests/contentextensions/reload-without-contentextensions.html
* testing/Internals.cpp:
(WebCore::Internals::reloadWithoutContentExtensions):
* testing/Internals.h:
* testing/Internals.idl:
2018-06-27 Simon Fraser <simon.fraser@apple.com>
https://hackernoon.com/ uses lots of layer backing store
https://bugs.webkit.org/show_bug.cgi?id=186909
rdar://problem/40257540
Reviewed by Tim Horton.
The existing "backing store detached" logic, which was used to eliminate backing store
for compositing layers outside the viewport, had a number of bugs that allowed layers
to have backing store when they should not.
Specifically, any code path that ended up in setNeedsDisplay{InRect}() in PlatformCALayer
could trigger backing store creation on layers that should have never had any.
Rather than monkeypatch all the GraphicsLayerCA call sites that call setNeedsDisplay{InRect}(),
just bail early from the PlatformCALayer* methods that trigger repaints.
Tests didn't catch this because they just dumped the state of the backingStoreAttached flag. To fix this,
create backingStoreAttachedForTesting() which also tests whether the layer has contents.
Test: compositing/backing/backing-store-attachment-outside-viewport.html
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::backingStoreAttachedForTesting const):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::backingStoreAttachedForTesting const):
(WebCore::GraphicsLayerCA::setNeedsDisplay):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::setNeedsDisplay):
(PlatformCALayerCocoa::setNeedsDisplayInRect):
(PlatformCALayerCocoa::hasContents const):
2018-06-27 David Kilzer <ddkilzer@apple.com>
Fix clang static analyzer warnings: Branch condition evaluates to a garbage value
<https://webkit.org/b/186968>
Reviewed by Zalan Bujtas.
This patch changes two stack-allocated `bool` variables into
`std::optional<bool>` since the functions that set the variable
may return early without setting it. It also changes one
stack-allocated pointer to be initialized to `nullptr`.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
Update for change to CSSPropertyAnimation::getPropertyAtIndex()
argument type.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard): Initialize
`cachedImage` stack pointer to nullptr since getImage() has an
early return that doesn't set `cachedImage`.
* editing/mac/EditorMac.mm:
(WebCore::Editor::writeImageToPasteboard): Ditto.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
* page/animation/CSSPropertyAnimation.h:
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
- Change method to take `std::optional<bool>` instead of `bool`
as second argument since the method may return early without
setting `isShorthand`.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions): Update for
change to CSSPropertyAnimation::getPropertyAtIndex() argument
type.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection): Also
rename local `emphasisMarkIsOver` to `emphasisMarkIsAbove` to
match other call sites.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
- Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
argument type.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Change method to take `std::optional<bool>` instead of `bool`
as second argument since the method may return early without
setting `above`.
(WebCore::InlineTextBox::paintMarkedTextForeground):
- Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
argument type.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Change method to take `std::optional<bool>` instead of `bool`.
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Move formatting context root layout logic to a dedicated function.
https://bugs.webkit.org/show_bug.cgi?id=187097
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/blockformatting/BlockFormattingContext.h:
2018-06-27 Zalan Bujtas <zalan@apple.com>
[LFC] Compute static position for out-of-flow elements only when required.
https://bugs.webkit.org/show_bug.cgi?id=187096
Reviewed by Antti Koivisto.
Computing static position for out-of-flow elements could be somewhat expensive, so let's not do it unless we actually need it.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
(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::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned): Deleted.
2018-06-27 Nan Wang <n_wang@apple.com>
AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
https://bugs.webkit.org/show_bug.cgi?id=187076
Reviewed by Chris Fleizach.
We shouldn't set keyboard focus when assistive technology takes focus since
this is causing website incompatibility issues by causing focus to be lost.
Test: accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
2018-06-21 Emilio Cobos Álvarez <emilio@crisal.io>
Move clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants.
https://bugs.webkit.org/show_bug.cgi?id=186881
Reviewed by Antti Koivisto.
Every caller does this already.
No new tests, no change in behavior.
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveComposedTree):
2018-06-27 Tomas Popela <tpopela@redhat.com>
[GStreamer] Coverity scan issues
https://bugs.webkit.org/show_bug.cgi?id=187087
Reviewed by Xabier Rodriguez-Calvar.
Fix uninitialized members.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2018-06-27 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Move definitions of GCryptUtilities helpers into a separate source file
https://bugs.webkit.org/show_bug.cgi?id=187033
Reviewed by Michael Catanzaro.
Move the GCryptUtilities helpers that operate on libgcrypt values and
constants into a separate source file. This limits a bit the amount of
inlining the compiler might feel compelled to do, and the resulting
shared library is 8kB smaller in size.
* crypto/gcrypt/GCryptUtilities.cpp: Copied from Source/WebCore/crypto/gcrypt/GCryptUtilities.h.
(WebCore::hmacAlgorithm):
(WebCore::digestAlgorithm):
(WebCore::hashCryptoDigestAlgorithm):
(WebCore::mpiLength):
(WebCore::mpiData):
(WebCore::mpiZeroPrefixedData):
(WebCore::mpiSignedData):
* crypto/gcrypt/GCryptUtilities.h:
(WebCore::hmacAlgorithm): Deleted.
(WebCore::digestAlgorithm): Deleted.
(WebCore::hashCryptoDigestAlgorithm): Deleted.
(WebCore::mpiLength): Deleted.
(WebCore::mpiData): Deleted.
(WebCore::mpiZeroPrefixedData): Deleted.
(WebCore::mpiSignedData): Deleted.
* platform/SourcesGCrypt.txt:
2018-06-26 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Pass VM& to functions more
https://bugs.webkit.org/show_bug.cgi?id=186241
Reviewed by Mark Lam.
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
2018-06-26 Simon Fraser <simon.fraser@apple.com>
CSSGradientValue's color stops vector wastes 12KB on theverge.com
https://bugs.webkit.org/show_bug.cgi?id=186988
Reviewed by Sam Weinig.
Shrink the color stops vector when we're done parsing the stops.
* css/CSSGradientValue.h:
(WebCore::CSSGradientValue::doneAddingStops):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
2018-06-25 Yusuke Suzuki <utatane.tea@gmail.com>
Remove static initializers more
https://bugs.webkit.org/show_bug.cgi?id=186969
Reviewed by Michael Catanzaro.
This patch removes static initializers more. They typically exists in GTK port.
No behavior change.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/ResourceUsageData.cpp: Removed.
* page/ResourceUsageData.h:
Remove ResourceUsageData constructors since default constructors are enough.
(WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::markupPrefix):
(WebCore::removeMarkupPrefix):
(WebCore::PasteboardHelper::fillSelectionData):
Use NeverDestroyed<> and static functions.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::defaultVolumeCapability):
(WebCore::GStreamerAudioCaptureSource::capabilities const):
CapabilityValueOrRange's constructor is not constexpr.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::initialAcceptLanguages):
(WebCore::proxySettings):
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setupProxy):
(WebCore::SoupNetworkSession::setProxySettings):
(WebCore::SoupNetworkSession::setInitialAcceptLanguages):
Use NeverDestroyed<> and static functions.
2018-06-26 Daniel Bates <dabates@apple.com>
REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
https://bugs.webkit.org/show_bug.cgi?id=186090
<rdar://problem/40692595>
Reviewed by Andy Estes.
Fix up Content Security Policy logic for checking the frame ancestors now that we
exclude the frame that initiated the load request.
Test: http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow.html
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowFrameAncestors const):
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):
2018-06-26 Chris Dumez <cdumez@apple.com>
Simplify NetworkStorageSession::getAllStorageAccessEntries()
https://bugs.webkit.org/show_bug.cgi?id=187016
Reviewed by Youenn Fablet.
Iterate over the HashMaps' values instead of iterating over their keys and then looking them
up in the HashMap.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2018-06-26 Eric Carlson <eric.carlson@apple.com>
[Mac] AirPlay picker uses incorrect theme in Dark mode
https://bugs.webkit.org/show_bug.cgi?id=187054
<rdar://problem/41291093>
Reviewed by Timothy Hatcher.
* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Add useDefaultAppearance parameter.
* Modules/mediasession/WebMediaSessionManager.h:
* platform/graphics/MediaPlaybackTargetPicker.cpp:
(WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Ditto.
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Choose theme based on
useDefaultAppearance parameter.
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): Log parameter.
* platform/mock/MediaPlaybackTargetPickerMock.h:
2018-06-26 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Do not forget to set stream on track switching
https://bugs.webkit.org/show_bug.cgi?id=187049
Reviewed by Philippe Normand.
This was an overlooked issue introduced in Bug #186678
This is already tested, but we currently run only tests against playbin2
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
2018-06-26 Zalan Bujtas <zalan@apple.com>
[LFC] Fixed positioning is a subcategory of absolute positioning.
https://bugs.webkit.org/show_bug.cgi?id=187043
Reviewed by Antti Koivisto.
https://www.w3.org/TR/CSS22/visuren.html#absolute-positioning
References in this specification to an absolutely positioned element (or its box) imply that the element's 'position'
property has the value 'absolute' or 'fixed'.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isAbsolutelyPositioned const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isOutOfFlowPositioned const):
2018-06-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r233143.
https://bugs.webkit.org/show_bug.cgi?id=187046
broke media/video-ended-event-negative-playback.html
(Requested by philn on #webkit).
Reverted changeset:
"[GStreamer] Remove useless workaround"
https://bugs.webkit.org/show_bug.cgi?id=186921
https://trac.webkit.org/changeset/233143
2018-06-25 Zalan Bujtas <zalan@apple.com>
[LFC] Computed height for in-flow non-replaced should not include padding and border.
https://bugs.webkit.org/show_bug.cgi?id=187031
Reviewed by Antti Koivisto.
In certain cases the height of a non-replaced in-flow box is computed using the bottom position of its last in-flow child.
The in-flow child's bottom position is in the coordinate system of the containing block's border box (border box's top left is 0, 0) ->
it includes both the (top) border and the padding of the containing block.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-06-26 Zan Dobersek <zdobersek@igalia.com>
Crash in WebAnimation::runPendingPlayTask
https://bugs.webkit.org/show_bug.cgi?id=186189
Reviewed by Carlos Garcia Campos.
Avoid crashes on nullopt std::optional dereference in the
runPendingPlayTask() and runPendingPauseTask() methods of the
WebAnimation class by defaulting to a Seconds(0) value.
In both cases the std::optional value is the current time retrieved from
the associated DocumentTimeline object. But there's no guarantee that
the timeline is active and the resulting time value is resolved (i.e.
not nullopt). Dereferencing the nullopt Seconds value doesn't cause a
problem on configurations still building as C++14 and the fallback
std::optional implementation provided by WTF -- no signal is raised, and
a 0 value is returned. Configurations building as C++17 on the other
hand use the stdlib-provided std::optional that does raise a signal on
invalid access, leading to crashes.
The default-to-Seconds(0) solution avoids crashes on configurations
that build with C++17 support enabled, and thus match configurations
that are still using WTF's std::optional. This still doesn't address the
underlying problem of retrieving current time from an inactive document
timeline and using it as ready time for the pending play/pause task
execution.
runPendingPlayTask() change addresses crashes in the following tests:
- fast/animation/css-animation-resuming-when-visible.html
- fast/animation/css-animation-resuming-when-visible-with-style-change.html
- imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html
- imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/getAnimations.html
runPendingPauseTask() change addresses crashes in the following tests:
- animations/multiple-animations-timing-function.html
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):
2018-06-26 Antoine Quint <graouts@apple.com>
[Web Animations] Show the feature as "Supported in Preview"
https://bugs.webkit.org/show_bug.cgi?id=187037
Reviewed by Dean Jackson.
Web Animations are enabled by default in STP.
* features.json:
2018-06-26 Miguel Gomez <magomez@igalia.com>
[GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
https://bugs.webkit.org/show_bug.cgi?id=179304
Reviewed by Michael Catanzaro.
When adding new CoordinatedGraphicsLayers to the tree, check that they have the appropriate
CompositingCoordinator. If that's not the case, set the appropriate one to the layer and its
children and set the state of those layers so they are rendered properly.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2018-06-25 Keith Rollin <krollin@apple.com>
Adjust WEBCORE_EXPORT annotations for LTO
https://bugs.webkit.org/show_bug.cgi?id=186944
<rdar://problem/41384880>
Reviewed by David Kilzer.
Adjust a number of places that result in WebKit's
'check-for-weak-vtables-and-externals' script reporting weak external
symbols:
ERROR: WebCore has a weak external symbol in it (/Volumes/Data/dev/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
...
These cases are caused by inline methods being marked with WTF_EXPORT
(or related macro) or with an inline function being in a class marked
as such, and when enabling LTO builds.
For the most part, address these by removing the WEBCORE_EXPORT
annotation from inline methods. In some cases, move the implementation
out-of-line because it's the class that has the WEBCORE_EXPORT on it
and removing the annotation from the class would be too disruptive.
Finally, in other cases, move the implementation out-of-line because
check-for-weak-vtables-and-externals still complains when keeping the
implementation inline and removing the annotation; this seems to
typically (but not always) happen with destructors.
No new tests. There is no changed functionality. Only the annotation
and treatment of inline methods are altered.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::pause):
* page/CacheStorageProvider.h:
(): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
(WebCore::ScrollingTree::reportExposedUnfilledArea):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const):
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::~CARingBuffer):
* platform/audio/mac/CARingBuffer.h:
(WebCore::CARingBuffer::~CARingBuffer): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/gamepad/GamepadProvider.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::displayListAsText const):
(WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
(WebCore::GraphicsLayer::isTrackingDisplayListReplay const):
(WebCore::GraphicsLayer::replayDisplayListAsText const):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::setActive):
(WebCore::LibWebRTCProvider::createDecoderFactory):
(WebCore::LibWebRTCProvider::createEncoderFactory):
(WebCore::LibWebRTCProvider::disableEnumeratingAllNetworkInterfaces):
(WebCore::LibWebRTCProvider::enableEnumeratingAllNetworkInterfaces):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponseAsync):
* testing/MockGamepadProvider.h:
* workers/service/server/SWServer.h:
(WebCore::SWServer::Connection::~Connection):
2018-06-25 Zalan Bujtas <zalan@apple.com>
[LFC] Adjust static position for out-of-flow positioned boxes.
https://bugs.webkit.org/show_bug.cgi?id=187000
Reviewed by Antti Koivisto.
The static position of an out-of-flow positioned box is the the position where box would go
if it was in-flow positioned. This position needs to the resolved in the containing block's coordinate system.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2018-06-25 Brady Eidson <beidson@apple.com>
Remove RELEASE_ASSERT added in r230875.
<rdar://problem/40860061> and https://bugs.webkit.org/show_bug.cgi?id=187022
Reviewed by Brent Fulgham.
There's actually more than one way for a network session to be destroyed, and that can happen
asynchronously and unpredictably.
And the request to start up a WebSocket and do its handshake is also asynchronous and unpredictable
It's an expected race.
If the NetworkStorageSession cannot be found then the WebSocket handshake should just fail.
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake): If the NetworkStorageSession cannot be found, return std::nullopt.
(WebCore::SocketStreamHandleImpl::platformSendHandshake): If the cookieData is null, fail the handshake.
2018-06-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iPad apps on macOS] Web process crashes when attempting to play embedded YouTube video in News
https://bugs.webkit.org/show_bug.cgi?id=187011
<rdar://problem/40906808>
Reviewed by Tim Horton.
Disable remote media commands when running iOS WebKit on macOS. The iOS flavor of RemoteCommandListener
currently throws an exception when attempting to soft-link the MediaPlayer framework, which prevents video from
being played altogether. For a followup tracking touch bar integration in iOS WebKit on macOS, see:
<rdar://problem/39164732>.
Manually tested by playing a YouTube video in News.
* platform/RemoteCommandListener.cpp:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
2018-06-25 Keith Rollin <krollin@apple.com>
Unreviewed, rolling out r233087.
Causes 5% Mac PLT regression.
Reverted changeset:
"Recalc styles every time defaultAppearance changes."
https://bugs.webkit.org/show_bug.cgi?id=186866
https://trac.webkit.org/changeset/233087
2018-06-25 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r229722): WebKitLegacy clients can crash when loading alternate page
https://bugs.webkit.org/show_bug.cgi?id=187008
Reviewed by Chris Dumez.
The new call to 'clearProvisionalLoadForPolicyCheck' added in r229722 broke loading
behavior in WebKitLegacy.
1. We can now enter 'cancelPolicyCheckIfNeeded' without a Frame loader, in what appears
to be a recursive call during the load cancellation (the 'm_waitingForContentPolicy'
and 'm_waitingForNavigationPolicy' have already been nulled). It seems like we should
return early here, or perhaps just move the RELEASE_ASSERT inside the case where we
have an active policy check happening.
2. We also enter FrameLoader::checkContentPolicy without an active document loader. We
should recognize this case and handle it, rather than trying to dereference a nullptr
document loader.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::cancelPolicyCheckIfNeeded): Move the RELEASE_ASSERT inside the
conditional where the frameLoader is actually used.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkContentPolicy): Recognize that the activeDocumentLoader may
be nullptr at this point, and take appropriate action (rather than crashing).
2018-06-25 Simon Fraser <simon.fraser@apple.com>
MatchedPropertiesCacheItem wastes 388KB of vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186990
Reviewed by Antti Koivisto.
MatchedPropertiesCacheItem.matchedProperties was appended to, so it allocated capacity
in 16-size chunks. Instead, assign to it so it only allocates as much capacity as is needed.
Copy-constructing is more wasteful, since it copies the 64-chunk size from the right-hand side.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addToMatchedPropertiesCache):
* css/StyleResolver.h:
(WebCore::StyleResolver::MatchedPropertiesCacheItem::MatchedPropertiesCacheItem):
2018-06-25 Chris Dumez <cdumez@apple.com>
Null dereference crash un ApplicationCacheGroup::startLoadingEntry()
https://bugs.webkit.org/show_bug.cgi?id=187012
<rdar://problem/40793716>
Reviewed by Youenn Fablet.
m_entryLoader can be null because ApplicationCacheResourceLoader::create() return null when
CachedResourceLoader::requestRawResource() fails synchronously. In such case, the completion
handler gets called with a ApplicationCacheResourceLoader::Error::CannotRequestResource error.
To address the issue, we capture the request's URL in the lambda and use it instead of trying
to get the URL from the loader's resource.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::startLoadingEntry):
2018-06-25 Ross Kirsling <ross.kirsling@sony.com>
REGRESSION (r233140): Windows build failure due to incomplete FrameView and RenderBox types
https://bugs.webkit.org/show_bug.cgi?id=186997
* animation/KeyframeEffectReadOnly.cpp:
2018-06-25 Antoine Quint <graouts@apple.com>
REGRESSION: hardware-accelerated animation fails on inline element
https://bugs.webkit.org/show_bug.cgi?id=186981
<rdar://problem/41418697>
Reviewed by Dean Jackson.
Ensure we only queue accelerated actions when we have a renderer so we don't attempt
to start an accelerated animation too soon.
Test: webanimations/opacity-animation-yields-compositing-span.html
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
2018-06-25 David Kilzer <ddkilzer@apple.com>
REGRESSION (r233140): v2: Windows build failure due to incomplete DocumentAnimationScheduler type
<https://webkit.org/b/186997>
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::windowScreenDidChange):
* dom/Document.h:
- DocumentAnimationScheduler is behind the
USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) macro, which
is disabled on Windows.
- This also reverts my fix in r233144 since it didn't work.
2018-06-25 Youenn Fablet <youenn@apple.com>
Add API to control mock media devices
https://bugs.webkit.org/show_bug.cgi?id=186958
Reviewed by Eric Carlson.
Refactor code to introduce a MockDevice structure that can be used in multiple processes.
Update mock sources and center to use MockDevice.
Add API to update mock media devices.
Make MediaDevices an ActiveDOMObject so that it does not get collected when ondevicechange is set.
Test: fast/mediastream/device-change-event-2.html
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices):
(WebCore::MediaDevices::stop):
(WebCore::MediaDevices::scheduledEventTimerFired):
(WebCore::MediaDevices::hasPendingActivity const):
(WebCore::MediaDevices::activeDOMObjectName const):
(WebCore::MediaDevices::canSuspendForDocumentSuspension const):
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaDevices.idl:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mock/MockMediaDevice.h: Added.
(WebCore::MockMicrophoneProperties::encode const):
(WebCore::MockMicrophoneProperties::decode):
(WebCore::MockCameraProperties::encode const):
(WebCore::MockCameraProperties::decode):
(WebCore::MockDisplayProperties::encode const):
(WebCore::MockDisplayProperties::decode):
(WebCore::MockMediaDevice::isMicrophone const):
(WebCore::MockMediaDevice::isCamera const):
(WebCore::MockMediaDevice::isDisplay const):
(WebCore::MockMediaDevice::type const):
(WebCore::MockMediaDevice::encode const):
(WebCore::MockMediaDevice::decodeMockMediaDevice):
(WebCore::MockMediaDevice::decode):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::defaultDevices):
(WebCore::devices):
(WebCore::deviceMap):
(WebCore::deviceListForDevice):
(WebCore::MockRealtimeMediaSource::createCaptureDevice):
(WebCore::MockRealtimeMediaSource::resetDevices):
(WebCore::MockRealtimeMediaSource::setDevices):
(WebCore::MockRealtimeMediaSource::addDevice):
(WebCore::MockRealtimeMediaSource::removeDevice):
(WebCore::MockRealtimeMediaSource::captureDeviceWithPersistentID):
(WebCore::MockRealtimeMediaSource::audioDevices):
(WebCore::MockRealtimeMediaSource::videoDevices):
(WebCore::MockRealtimeMediaSource::displayDevices):
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
(WebCore::MockRealtimeMediaSource::initializeCapabilities):
(WebCore::MockRealtimeMediaSource::initializeSettings):
(WebCore::MockRealtimeMediaSource::settings const):
(WebCore::MockRealtimeMediaSource::supportedConstraints):
* platform/mock/MockRealtimeMediaSource.h:
(WebCore::MockRealtimeMediaSource::device const):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::singleton):
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
(WebCore::MockRealtimeMediaSourceCenter::setDevices):
(WebCore::MockRealtimeMediaSourceCenter::addDevice):
(WebCore::MockRealtimeMediaSourceCenter::removeDevice):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::initializeCapabilities):
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockCamera const):
(WebCore::MockRealtimeVideoSource::mockScreen const):
2018-06-25 Simon Fraser <simon.fraser@apple.com>
AutoTableLayout wastes 52KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186710
Reviewed by Zalan Bujtas.
Call resizeToFit() to only allocate enough capacity for the number of columns.
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::fullRecalc):
(WebCore::AutoTableLayout::insertSpanCell): Whitespace fix.
* rendering/AutoTableLayout.h:
2018-06-25 Zalan Bujtas <zalan@apple.com>
[LFC] Adjust static position with containing block's content box top/left
https://bugs.webkit.org/show_bug.cgi?id=186999
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::contentBoxTop const):
(WebCore::Display::Box::contentBoxLeft const):
2018-06-25 David Kilzer <ddkilzer@apple.com>
REGRESSION (r233140): Windows build failure due to incomplete DocumentAnimationScheduler type
<https://webkit.org/b/186997>
* dom/Document.cpp:
* dom/Document.h:
- Attempt to fix Windows build failure by moving include of
DocumentAnimationScheduler.h from Document.cpp to Document.h.
2018-06-25 Philippe Normand <pnormand@igalia.com>
[GStreamer] Remove useless workaround
https://bugs.webkit.org/show_bug.cgi?id=186921
Reviewed by Xabier Rodriguez-Calvar.
In bug 67407 a workaround was added for GStreamer 0.10. With 1.x
the media/video-reverse-play-duration.html test passes without any
workaround needed. The other test mentioned in that bug was
removed, it seems.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
2018-06-24 Tomas Popela <tpopela@redhat.com>
Unreviewed, address Darin's comment
https://bugs.webkit.org/show_bug.cgi?id=186757
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::cpuPeriod):
2018-06-25 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183826
<rdar://problem/40997412>
Reviewed by Dean Jackson.
The CSS Animations Level 2 specification defines that calling pause() on a CSSAnimation object is "sticky"
until a call to play() is made, meaning that any changes to the running state via the CSS animation-play-state
property is overridden by the stickiness of the pause() call. In this patch we add an m_stickyPaused flag which
is set in API calls to pause() and play(). While this flag is true, changes to the animation-play-state property
to the "running" value are ignored.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):
* animation/CSSAnimation.h:
2018-06-25 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure animations are updated prior to requestAnimationFrame callbacks
https://bugs.webkit.org/show_bug.cgi?id=186997
<rdar://problem/41419414>
Reviewed by Dean Jackson.
Some sub-tests of imported/mozilla/css-animations/test_animation-pausing.html clearly expect that animations
would be resolved prior to firing a requestAnimationFrame() callback, as the HTML5 event loop mandates. But until
now, both DocumentTimeline and ScriptedAnimationController would make calls to DisplayRefreshMonitorManager::scheduleAnimation()
that were not coordinated and so the order in which the DocumentTimeline and ScriptedAnimationController callbacks
were performed was not guaranteed.
In this patch we add a new DocumentAnimationScheduler class which is created by a Document to manage this specific
situation. Now DocumentTimeline and ScriptedAnimationController use this supporting object instead of being their
own DisplayRefreshMonitorClient and call scheduleWebAnimationsResolution() and scheduleScriptedAnimationResolution()
respectively to indicate the need to schedule an animation through the DisplayRefreshMonitorManager to serve the specific
needs of either, or both, classes. Then DocumentAnimationScheduler ensures that Web Animations resolution happens
prior to requestAnimationFrame callbacks when both are scheduled.
In the future we should be able to move more code from DocumentTimeline and ScriptedAnimationController over to
DocumentAnimationScheduler, such as support for throttling and using a timer-based fallback, but this patch provides
the minimal functionality required to provide a sounder foundation.
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::requestAnimationFrame):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentAnimationScheduler.cpp: Added.
(WebCore::DocumentAnimationScheduler::create):
(WebCore::DocumentAnimationScheduler::DocumentAnimationScheduler):
(WebCore::DocumentAnimationScheduler::detachFromDocument):
(WebCore::DocumentAnimationScheduler::scheduleWebAnimationsResolution):
(WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution):
(WebCore::DocumentAnimationScheduler::displayRefreshFired):
(WebCore::DocumentAnimationScheduler::windowScreenDidChange):
(WebCore::DocumentAnimationScheduler::createDisplayRefreshMonitor const):
* animation/DocumentAnimationScheduler.h: Copied from Source/WebCore/animation/CSSAnimation.h.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::windowScreenDidChange): Deleted.
(WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Deleted.
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::windowScreenDidChange):
(WebCore::Document::requestAnimationFrame):
(WebCore::Document::animationScheduler):
(WebCore::Document::timeline):
* dom/Document.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
(WebCore::ScriptedAnimationController::windowScreenDidChange): Deleted.
(WebCore::ScriptedAnimationController::displayRefreshFired): Deleted.
(WebCore::ScriptedAnimationController::createDisplayRefreshMonitor const): Deleted.
* dom/ScriptedAnimationController.h:
(WebCore::ScriptedAnimationController::create):
2018-06-25 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Zero-prefix (if necessary) output of RSA-based encryption and signing operations
https://bugs.webkit.org/show_bug.cgi?id=186967
Reviewed by Michael Catanzaro.
Output for RSA-based encryption and signing operations should match the
length of the RSA key. The way we retrieve the MPI data means libgcrypt
can ignore the high-bit zero values and leave us with a valid result
that's shorter in length compared to the RSA key. For instance, if the
output MPI fits into 2040 bits while a 2048-bit key was used we'll end
up with MPI data that will be fitted into a 255-byte Vector, one byte
short of the expected output length.
To avoid this, mpiZeroPrefixedData() is now used when retrieving output
of these RSA operations, and the value of the key size in bytes is
passed to it. This efficiently prepares the output Vector and then
copies the MPI data into it, respecting the MPI data length as well as
the desired length of the output.
No new tests -- relevant tests are now stable (i.e. not sporadically
failing anymore), associated expectations are removed.
* crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
(WebCore::gcryptDerive): Also use mpiZeroPrefixedData().
* crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
(WebCore::gcryptEncrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
(WebCore::gcryptSign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::gcryptEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::gcryptSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
* crypto/gcrypt/GCryptUtilities.h:
(WebCore::mpiZeroPrefixedData):
2018-06-24 Simon Fraser <simon.fraser@apple.com>
Fix the DUMP_NODE_STATISTICS code so that it compiles
https://bugs.webkit.org/show_bug.cgi?id=186982
Reviewed by Anders Carlsson.
The DUMP_NODE_STATISTICS code had bitrotted. ENTITY_NODE no longer exists.
liveNodeSet needs to be a static function with a NeverDestroyed<>.
* dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::Node::trackForDebugging):
(WebCore::Node::~Node):
2018-06-24 Simon Fraser <simon.fraser@apple.com>
Fix the composition underline to be transformed by -apple-color-filter
https://bugs.webkit.org/show_bug.cgi?id=186983
rdar://problem/40515558
Reviewed by Zalan Bujtas.
Transform the composition underline color with the color filter.
Test: css3/color-filters/color-filter-composition-underline-color.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionUnderline const):
2018-06-23 Zalan Bujtas <zalan@apple.com>
[Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
https://bugs.webkit.org/show_bug.cgi?id=186585
<rdar://problem/30685325>
Reviewed by Tim Horton.
Use the existing "override viewport size for viewport units" mechanism to compute the preferred
viewport unit values for the Mail Viewer html content.
Test: fast/dynamic/mail-autosize-viewport-unit.html
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::enableAutoSizeMode):
(WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
(WebCore::FrameView::overrideViewportSizeForCSSViewportUnits):
(WebCore::FrameView::viewportSizeForCSSViewportUnits const):
* page/FrameView.h:
2018-06-23 Zalan Bujtas <zalan@apple.com>
[LFC] Relatively positioned renderer needs offsetting for validation
https://bugs.webkit.org/show_bug.cgi?id=186959
Reviewed by Antti Koivisto.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
2018-06-23 Zalan Bujtas <zalan@apple.com>
[LFC] Miscellaneous fixes to fix simple absolute positioning.
https://bugs.webkit.org/show_bug.cgi?id=186962
Reviewed by Antti Koivisto.
1. Collect out-of-flow formatting root descendants.
2. Remove invalid and redundant ASSERTs
invalid because the assertion is missing border, padding etc.
redundant becasue we assert on geometry correctness in validateGeometryConstraintsAfterLayout.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::addOutOfFlowDescendant):
(WebCore::Layout::Container::setOutOfFlowDescendants): Deleted.
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-06-23 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Add user-defined literal for ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=186839
Reviewed by Darin Adler.
No behavior change.
* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseManifest):
(WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
(WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
(WebCore::ApplicationManifestParser::logDeveloperWarning):
(WebCore::ApplicationManifestParser::parseStartURL):
(WebCore::ApplicationManifestParser::parseDisplay):
(WebCore::ApplicationManifestParser::parseName):
(WebCore::ApplicationManifestParser::parseDescription):
(WebCore::ApplicationManifestParser::parseShortName):
(WebCore::ApplicationManifestParser::parseScope):
* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::logError):
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::requestFromInfo):
(WebCore::DOMCache::addAll):
(WebCore::DOMCache::put):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::errorToException):
* Modules/credentialmanagement/BasicCredential.cpp:
(WebCore::BasicCredential::type const):
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::store):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess const):
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::root):
(WebCore::validatePathIsExpectedType):
(WebCore::resolveRelativeVirtualPath):
(WebCore::DOMFileSystem::getEntry):
* Modules/entriesapi/FileSystemDirectoryEntry.cpp:
(WebCore::FileSystemDirectoryEntry::getEntry):
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
(WebCore::FileSystemDirectoryReader::readEntries):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeAsStream):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::loadingFailed):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
(WebCore::FetchBodyOwner::blobLoadingFailed):
(WebCore::FetchBodyOwner::consumeBodyAsStream):
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader):
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
(WebCore::FetchLoader::start):
* Modules/fetch/FetchRequest.cpp:
(WebCore::setMethod):
(WebCore::computeReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::initializeOptions):
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::referrer const):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::clone):
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::timerFired):
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::startRequest):
(WebCore::Geolocation::requestUsesCachedPosition):
(WebCore::Geolocation::makeCachedPositionCallbacks):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::cancelRequests):
(WebCore::Geolocation::handlePendingPermissionNotifiers):
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::deleteObjectStore):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
(WebCore::IDBFactory::cmp):
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::setName):
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const):
* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::loggingString const):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::getKey):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::count):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::result const):
(WebCore:: const):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::abort):
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::begin):
(WebCore::IDBServer::SQLiteIDBTransaction::commit):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::userDeleteError):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::loggingString const):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::deny):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::checkAndCanonicalizeTotal):
(WebCore::PaymentRequest::create):
* Modules/quota/DOMWindowQuota.cpp:
(WebCore::DOMWindowQuota::webkitStorageInfo const):
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::looping):
(WebCore::AudioBufferSourceNode::setLooping):
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::channelCountMode):
(WebCore::AudioNode::channelInterpretation):
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
* Modules/webauthn/AuthenticatorManager.cpp:
(WebCore::AuthenticatorManagerInternal::produceClientDataJson):
(WebCore::AuthenticatorManagerInternal::initTimeoutTimer):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
(WebCore::AuthenticatorManager::isUserVerifyingPlatformAuthenticatorAvailable const):
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticator::makeCredential):
(WebCore::LocalAuthenticator::getAssertion):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::usage):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
(WebCore::WebSocket::close):
(WebCore::WebSocket::binaryType const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readStatusLine):
(WebCore::WebSocketHandshake::readHTTPHeaders):
(WebCore::WebSocketHandshake::checkResponseHeaders):
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::requestPresent):
(WebCore::VRDisplay::exitPresent):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
(WebCore::AccessibilityObject::invalidStatus const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
(WebCore::validateCustomElementNameAndThrowIfNeeded):
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMConstructorBase.cpp:
(WebCore::callThrowTypeError):
* bindings/js/JSDOMConstructorBase.h:
(WebCore::JSDOMConstructorBase::className):
* bindings/js/JSDOMConstructorNotConstructable.h:
(WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
(WebCore::throwSequenceTypeError):
(WebCore::throwNonFiniteTypeError):
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::isResponseCorrect):
(WebCore::handleResponseOnStreamingAction):
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::preventExtensions):
(WebCore::JSDOMWindow::toStringName):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::preventExtensions):
(WebCore::JSLocation::toStringName):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamDefaultController):
(WebCore::constructJSReadableByteStreamController):
(WebCore::constructJSReadableStreamBYOBRequest):
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::preventExtensions):
(WebCore::JSRemoteDOMWindow::toStringName):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::resolveModuleSpecifier):
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::evaluate):
(WebCore::ScriptModuleLoader::importModule):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::maybeThrowExceptionIfSerializationFailed):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
(GenerateConstructorHelperMethods):
(GenerateCallTracer):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceNameConstructor::initializeProperties):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::JSMapLikeConstructor::initializeProperties):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::JSReadOnlyMapLikeConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactionsConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::JSTestCallTracerConstructor::initializeProperties):
(WebCore::jsTestCallTracerTestAttributeInterfaceGetter):
(WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
(WebCore::jsTestCallTracerTestAttributeSpecifiedGetter):
(WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
(WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
(WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody):
(WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJITConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySettingConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestIndexedSetterNoIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::JSTestIndexedSetterThrowingExceptionConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestIndexedSetterWithIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
(WebCore::JSTestInterfaceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterableConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingExceptionConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorConstructor::initializeProperties):
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
(WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::JSTestNamedDeleterNoIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::JSTestNamedDeleterThrowingExceptionConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::JSTestNamedDeleterWithIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::JSTestNamedDeleterWithIndexedGetterConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::JSTestNamedGetterCallWithConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::JSTestNamedGetterNoIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::JSTestNamedGetterWithIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingExceptionConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetterConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithOverrideBuiltinsConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::JSTestObjConstructor::initializeProperties):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValueBody):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterfaceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::JSTestPromiseRejectionEventConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerializationConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
(WebCore::JSTestSerializationIndirectInheritanceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::JSTestSerializationInheritConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::JSTestSerializationInheritFinalConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::JSTestStringifierConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::JSTestStringifierAnonymousOperationConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::JSTestStringifierNamedOperationConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::JSTestStringifierOperationImplementedAsConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::JSTestStringifierOperationNamedToStringConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::JSTestStringifierReadOnlyAttributeConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::JSTestStringifierReadWriteAttributeConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::initializeProperties):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):
(JSC::Bindings::CInstance::invokeDefaultMethod):
(JSC::Bindings::CInstance::invokeConstruct):
(JSC::Bindings::CInstance::stringValue const):
(JSC::Bindings::CInstance::toJSPrimitive const):
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeMethod):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcArray::setValueAt const):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
* crypto/SubtleCrypto.cpp:
(WebCore::rejectWithException):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::exportKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::algorithm const):
* css/CSSInheritedValue.cpp:
(WebCore::CSSInheritedValue::customCSSText const):
* css/CSSInitialValue.cpp:
(WebCore::CSSInitialValue::customCSSText const):
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::insertRule):
* css/CSSRevertValue.cpp:
(WebCore::CSSRevertValue::customCSSText const):
* css/CSSStyleSheet.h:
* css/CSSUnsetValue.cpp:
(WebCore::CSSUnsetValue::customCSSText const):
* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCSSText const):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::validateAndFixup):
(WebCore::DOMMatrixReadOnly::toFloat32Array const):
(WebCore::DOMMatrixReadOnly::toFloat64Array const):
(WebCore::DOMMatrixReadOnly::toString const):
* css/DeprecatedCSSOMValueList.cpp:
(WebCore::DeprecatedCSSOMValueList::cssText const):
* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::unicodeRange const):
(WebCore::FontFace::featureSettings const):
* css/MediaQuery.cpp:
(WebCore::MediaQuery::serialize const):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::toString const):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::commitMediaQuery):
* dom/CDATASection.cpp:
(WebCore::CDATASection::nodeName const):
* dom/Comment.cpp:
(WebCore::Comment::nodeName const):
* dom/DOMException.cpp:
(WebCore::DOMException::description const):
(WebCore::DOMException::create):
* dom/DOMException.h:
(WebCore::DOMException::name):
(WebCore::DOMException::message):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createHTMLDocument):
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::DataTransfer):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::createForInputEvent):
(WebCore::DataTransfer::dropEffect const):
(WebCore::DataTransfer::effectAllowed const):
* dom/DataTransferItem.cpp:
(WebCore::DataTransferItem::kind const):
* dom/Document.cpp:
(WebCore::Document::suggestedMIMEType const):
(WebCore::Document::contentType const):
(WebCore::Document::nodeName const):
(WebCore::Document::writeln):
(WebCore::Document::canNavigate):
(WebCore::Document::designMode const):
(WebCore::Document::requestFullScreenForElement):
* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::nodeName const):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEventQuirk):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/ScriptedAnimationController.cpp:
(WebCore::throttlingReasonsToString):
* dom/Text.cpp:
(WebCore::Text::nodeName const):
* dom/TextEncoder.cpp:
(WebCore::TextEncoder::encoding const):
* dom/Traversal.cpp:
(WebCore::NodeIteratorBase::acceptNode):
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editing.cpp:
(WebCore::createTabSpanElement):
* editing/Editor.cpp:
(WebCore::createDataTransferForClipboardEvent):
* editing/EditorCommand.cpp:
(WebCore::executeInsertBacktab):
(WebCore::executeInsertLineBreak):
(WebCore::executeInsertNewline):
(WebCore::executeInsertTab):
(WebCore::executeJustifyCenter):
(WebCore::executeJustifyFull):
(WebCore::executeJustifyLeft):
(WebCore::executeJustifyRight):
(WebCore::executeStrikethrough):
(WebCore::executeSubscript):
(WebCore::executeSuperscript):
(WebCore::executeToggleBold):
(WebCore::executeToggleItalic):
(WebCore::executeUnderline):
(WebCore::executeUnscript):
(WebCore::stateBold):
(WebCore::stateItalic):
(WebCore::stateStrikethrough):
(WebCore::stateSubscript):
(WebCore::stateSuperscript):
(WebCore::stateUnderline):
(WebCore::stateJustifyCenter):
(WebCore::stateJustifyFull):
(WebCore::stateJustifyLeft):
(WebCore::stateJustifyRight):
(WebCore::Editor::Command::value const):
* editing/SmartReplace.cpp:
(WebCore::getSmartSet):
* fileapi/FileCocoa.mm:
(WebCore::File::computeNameAndContentTypeForReplacedFile):
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::saveFormControlState const):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::fallbackValue const):
* html/DOMFormData.cpp:
(WebCore::DOMFormData::createFileEntry):
* html/FTPDirectoryDocument.cpp:
(WebCore::processFilesizeString):
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList const):
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::HTMLAppletElement):
(WebCore::HTMLAppletElement::updateWidget):
* html/HTMLCanvasElement.cpp:
(WebCore::toEncodingMimeType):
(WebCore::HTMLCanvasElement::toDataURL):
(WebCore::HTMLCanvasElement::captureStream):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::contentEditable const):
* html/HTMLFormControlElement.cpp:
(WebCore::shouldAutofocus):
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::keytype const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::stringForNetworkState):
(WebCore::HTMLMediaElement::preload const):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* html/HTMLObjectElement.cpp:
(WebCore::mapDataParamToSrc):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::setReplacement):
* html/ImageData.cpp:
(WebCore::ImageData::create):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::appendFormData const):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLCompressedTextureASTC.cpp:
(WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
(WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
(WebCore::WebGLCompressedTextureASTC::supported):
(WebCore::m_isLDRSupported): Deleted.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::enableSupportedExtension):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPUEnums.cpp:
(WebCore::web3DCompareFunctionName):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseCORSSettingsAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::initiatorFor):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
* html/track/DataCue.cpp:
(WebCore::DataCue::toJSONString const):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::updateCueFromCueData):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::toJSON const):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::toJSONString const):
* html/track/TrackBase.cpp:
(WebCore::TrackBase::setLanguage):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::toJSON const):
* inspector/CommandLineAPIModule.cpp:
(WebCore::CommandLineAPIModule::CommandLineAPIModule):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::getCanvasContentAsDataURL):
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::buildArrayForCanvasGradient):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):
* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::debuggableType):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
(WebCore::InspectorFrontendHost::platform):
(WebCore::InspectorFrontendHost::port):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::setIndicating):
(WebCore::InspectorOverlay::drawPaintRects):
(WebCore::InspectorOverlay::drawRulers):
(WebCore::appendPathSegment):
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorCSSId::InspectorCSSId):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
(WebCore::TimelineRecordFactory::createFunctionCallData):
(WebCore::TimelineRecordFactory::createConsoleProfileData):
(WebCore::TimelineRecordFactory::createProbeSampleData):
(WebCore::TimelineRecordFactory::createEventDispatchData):
(WebCore::TimelineRecordFactory::createGenericTimerData):
(WebCore::TimelineRecordFactory::createTimerInstallData):
(WebCore::TimelineRecordFactory::createEvaluateScriptData):
(WebCore::TimelineRecordFactory::createTimeStampData):
(WebCore::TimelineRecordFactory::createAnimationFrameData):
(WebCore::TimelineRecordFactory::createPaintData):
(WebCore::TimelineRecordFactory::appendLayoutRoot):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::subtype):
(WebCore::jsStringForPaymentRequestState):
(WebCore::WebInjectedScriptHost::getInternalProperties):
* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::InspectorCSSAgent):
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::createStyleSheet):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::elementForId):
(WebCore::InspectorCSSAgent::assertStyleSheetForId):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::requestNode):
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::InspectorCanvasAgent::resolveCanvasContext):
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::assertInspectorCanvas):
(WebCore::InspectorCanvasAgent::assertInspectorProgram):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::assertNode):
(WebCore::InspectorDOMAgent::assertDocument):
(WebCore::InspectorDOMAgent::assertElement):
(WebCore::InspectorDOMAgent::assertEditableNode):
(WebCore::InspectorDOMAgent::assertEditableElement):
(WebCore::InspectorDOMAgent::getDocument):
(WebCore::InspectorDOMAgent::pushNodeToFrontend):
(WebCore::InspectorDOMAgent::requestChildNodes):
(WebCore::InspectorDOMAgent::querySelector):
(WebCore::InspectorDOMAgent::querySelectorAll):
(WebCore::InspectorDOMAgent::releaseBackendNodeIds):
(WebCore::InspectorDOMAgent::setAttributesAsText):
(WebCore::InspectorDOMAgent::removeNode):
(WebCore::InspectorDOMAgent::setOuterHTML):
(WebCore::InspectorDOMAgent::insertAdjacentHTML):
(WebCore::InspectorDOMAgent::setNodeValue):
(WebCore::InspectorDOMAgent::setEventListenerDisabled):
(WebCore::InspectorDOMAgent::performSearch):
(WebCore::InspectorDOMAgent::getSearchResults):
(WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
(WebCore::InspectorDOMAgent::highlightQuad):
(WebCore::InspectorDOMAgent::highlightSelector):
(WebCore::InspectorDOMAgent::highlightNode):
(WebCore::InspectorDOMAgent::highlightNodeList):
(WebCore::InspectorDOMAgent::moveTo):
(WebCore::InspectorDOMAgent::focus):
(WebCore::InspectorDOMAgent::setInspectedNode):
(WebCore::InspectorDOMAgent::resolveNode):
(WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
(WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend):
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::setBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeBreakpoint):
(WebCore::domTypeName):
(WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/agents/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
(WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
* inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::Inspector::idbKeyRangeFromKeyRange):
(WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
(WebCore::InspectorIndexedDBAgent::requestData):
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::layersForNode):
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
(WebCore::InspectorNetworkAgent::getResponseBody):
(WebCore::InspectorNetworkAgent::loadResource):
(WebCore::InspectorNetworkAgent::resolveWebSocket):
(WebCore::InspectorNetworkAgent::createTextDecoder):
(WebCore::InspectorNetworkAgent::searchInRequest):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::resourceContent):
(WebCore::InspectorPageAgent::InspectorPageAgent):
(WebCore::InspectorPageAgent::navigate):
(WebCore::InspectorPageAgent::assertFrame):
(WebCore::InspectorPageAgent::assertDocumentLoader):
(WebCore::InspectorPageAgent::snapshotNode):
(WebCore::InspectorPageAgent::snapshotRect):
(WebCore::InspectorPageAgent::archive):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
(WebCore::InspectorTimelineAgent::setInstruments):
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::stopFromConsole):
(WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
(WebCore::InspectorWorkerAgent::initialized):
(WebCore::InspectorWorkerAgent::sendMessageToWorker):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::setLoggingChannelLevel):
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::injectedScriptForEval):
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::scriptExecutionContext):
* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::injectedScriptForEval):
* inspector/agents/worker/ServiceWorkerAgent.cpp:
(WebCore::ServiceWorkerAgent::ServiceWorkerAgent):
* inspector/agents/worker/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/agents/worker/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::handleProvisionalLoadFailure):
* loader/CrossOriginAccessControl.cpp:
(WebCore::passesAccessControlCheck):
(WebCore::validatePreflightResponse):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
(WebCore::CrossOriginPreflightChecker::doPreflight):
* loader/DocumentLoader.cpp:
(WebCore::isRemoteWebArchive):
(WebCore::DocumentLoader::startIconLoading):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::reportRedirectionWithBadScheme):
(WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError):
(WebCore::DocumentThreadableLoader::reportCrossOriginResourceSharingError):
(WebCore::DocumentThreadableLoader::reportIntegrityMetadataError):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::Attributes::parseEncodingType):
* loader/FormSubmission.h:
(WebCore::FormSubmission::Attributes::methodString):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::initForSynthesizedDocument):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::defaultSubstituteDataForURL):
(WebCore::FrameLoader::addHTTPUpgradeInsecureRequestsIfNeeded):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preconnectIfNeeded):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange):
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendViolationReport):
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::primaryDomain):
(WebCore::ResourceLoadStatistics::areDomainsAssociated):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didBlockAuthenticationChallenge):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::logError):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::abort):
(WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::createFileURL):
* loader/appcache/ManifestParser.cpp:
(WebCore::parseManifest):
* loader/archive/ArchiveFactory.cpp:
(WebCore::createArchiveMIMETypesMap):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::acceptHeaderValueFromType):
(WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::getOriginsWithCache):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::type const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::close):
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::createWindow):
* page/DebugPageOverlays.cpp:
(WebCore::touchEventRegionColors):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
(WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
(WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
(WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
(WebCore::DiagnosticLoggingKeys::missingValidatorFieldsKey):
(WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
(WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingCPUUsageKey):
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingMemoryUsageKey):
(WebCore::DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey):
(WebCore::DiagnosticLoggingKeys::postPageLoadCPUUsageKey):
(WebCore::DiagnosticLoggingKeys::postPageLoadMemoryUsageKey):
(WebCore::DiagnosticLoggingKeys::provisionalLoadKey):
(WebCore::DiagnosticLoggingKeys::pageContainsPluginKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey):
(WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
(WebCore::DiagnosticLoggingKeys::pageLoadedKey):
(WebCore::DiagnosticLoggingKeys::playedKey):
(WebCore::DiagnosticLoggingKeys::engineFailedToLoadKey):
(WebCore::DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey):
(WebCore::DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey):
(WebCore::DiagnosticLoggingKeys::navigationKey):
(WebCore::DiagnosticLoggingKeys::needsRevalidationKey):
(WebCore::DiagnosticLoggingKeys::networkCacheKey):
(WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
(WebCore::DiagnosticLoggingKeys::networkKey):
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
(WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
(WebCore::DiagnosticLoggingKeys::noKey):
(WebCore::DiagnosticLoggingKeys::noCacheKey):
(WebCore::DiagnosticLoggingKeys::noStoreKey):
(WebCore::DiagnosticLoggingKeys::nonVisibleStateKey):
(WebCore::DiagnosticLoggingKeys::notInMemoryCacheKey):
(WebCore::DiagnosticLoggingKeys::pageCacheKey):
(WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
(WebCore::DiagnosticLoggingKeys::noDocumentLoaderKey):
(WebCore::DiagnosticLoggingKeys::noLongerInCacheKey):
(WebCore::DiagnosticLoggingKeys::otherKey):
(WebCore::DiagnosticLoggingKeys::mainDocumentErrorKey):
(WebCore::DiagnosticLoggingKeys::mainResourceKey):
(WebCore::DiagnosticLoggingKeys::isErrorPageKey):
(WebCore::DiagnosticLoggingKeys::isExpiredKey):
(WebCore::DiagnosticLoggingKeys::isReloadIgnoringCacheDataKey):
(WebCore::DiagnosticLoggingKeys::loadingKey):
(WebCore::DiagnosticLoggingKeys::hasPluginsKey):
(WebCore::DiagnosticLoggingKeys::httpsNoStoreKey):
(WebCore::DiagnosticLoggingKeys::imageKey):
(WebCore::DiagnosticLoggingKeys::inMemoryCacheKey):
(WebCore::DiagnosticLoggingKeys::inactiveKey):
(WebCore::DiagnosticLoggingKeys::internalErrorKey):
(WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
(WebCore::DiagnosticLoggingKeys::isAttachmentKey):
(WebCore::DiagnosticLoggingKeys::isConditionalRequestKey):
(WebCore::DiagnosticLoggingKeys::isDisabledKey):
(WebCore::DiagnosticLoggingKeys::noCurrentHistoryItemKey):
(WebCore::DiagnosticLoggingKeys::quirkRedirectComingKey):
(WebCore::DiagnosticLoggingKeys::rawKey):
(WebCore::DiagnosticLoggingKeys::redirectKey):
(WebCore::DiagnosticLoggingKeys::isLoadingKey):
(WebCore::DiagnosticLoggingKeys::documentLoaderStoppingKey):
(WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
(WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
(WebCore::DiagnosticLoggingKeys::simulatedPageCrashKey):
(WebCore::DiagnosticLoggingKeys::exceededActiveMemoryLimitKey):
(WebCore::DiagnosticLoggingKeys::exceededInactiveMemoryLimitKey):
(WebCore::DiagnosticLoggingKeys::exceededBackgroundCPULimitKey):
(WebCore::DiagnosticLoggingKeys::domainVisitedKey):
(WebCore::DiagnosticLoggingKeys::cannotSuspendActiveDOMObjectsKey):
(WebCore::DiagnosticLoggingKeys::cpuUsageKey):
(WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
(WebCore::DiagnosticLoggingKeys::activeInForegroundTabKey):
(WebCore::DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey):
(WebCore::DiagnosticLoggingKeys::applicationCacheKey):
(WebCore::DiagnosticLoggingKeys::applicationManifestKey):
(WebCore::DiagnosticLoggingKeys::audioKey):
(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
(WebCore::DiagnosticLoggingKeys::canCacheKey):
(WebCore::DiagnosticLoggingKeys::cacheControlNoStoreKey):
(WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationKey):
(WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
(WebCore::DiagnosticLoggingKeys::deniedByClientKey):
(WebCore::DiagnosticLoggingKeys::deviceMotionKey):
(WebCore::DiagnosticLoggingKeys::deviceOrientationKey):
(WebCore::DiagnosticLoggingKeys::diskCacheKey):
(WebCore::DiagnosticLoggingKeys::diskCacheAfterValidationKey):
(WebCore::DiagnosticLoggingKeys::reloadKey):
(WebCore::DiagnosticLoggingKeys::replaceKey):
(WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
(WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
(WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):
(WebCore::DiagnosticLoggingKeys::retrievalKey):
(WebCore::DiagnosticLoggingKeys::revalidatingKey):
(WebCore::DiagnosticLoggingKeys::reloadFromOriginKey):
(WebCore::DiagnosticLoggingKeys::reloadRevalidatingExpiredKey):
(WebCore::DiagnosticLoggingKeys::sameLoadKey):
(WebCore::DiagnosticLoggingKeys::scriptKey):
(WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
(WebCore::DiagnosticLoggingKeys::streamingMedia):
(WebCore::DiagnosticLoggingKeys::styleSheetKey):
(WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey):
(WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey):
(WebCore::DiagnosticLoggingKeys::svgDocumentKey):
(WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
(WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
(WebCore::DiagnosticLoggingKeys::timedOutKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::occurredKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::uncacheableStatusCodeKey):
(WebCore::DiagnosticLoggingKeys::underMemoryPressureKey):
(WebCore::DiagnosticLoggingKeys::unknownEntryRequestKey):
(WebCore::DiagnosticLoggingKeys::unlikelyToReuseKey):
(WebCore::DiagnosticLoggingKeys::unsupportedHTTPMethodKey):
(WebCore::DiagnosticLoggingKeys::unsuspendableDOMObjectKey):
(WebCore::DiagnosticLoggingKeys::unusedKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonCredentialSettingsKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonErrorKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonMustRevalidateNoValidatorKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonNoStoreKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonRedirectChainKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonReloadKey):
(WebCore::DiagnosticLoggingKeys::unusedReasonTypeMismatchKey):
(WebCore::DiagnosticLoggingKeys::usedKey):
(WebCore::DiagnosticLoggingKeys::userZoomActionKey):
(WebCore::DiagnosticLoggingKeys::varyingHeaderMismatchKey):
(WebCore::DiagnosticLoggingKeys::videoKey):
(WebCore::DiagnosticLoggingKeys::visibleNonActiveStateKey):
(WebCore::DiagnosticLoggingKeys::visibleAndActiveStateKey):
(WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey):
(WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey):
(WebCore::DiagnosticLoggingKeys::webViewKey):
(WebCore::DiagnosticLoggingKeys::yesKey):
(WebCore::DiagnosticLoggingKeys::expiredKey):
(WebCore::DiagnosticLoggingKeys::fontKey):
(WebCore::DiagnosticLoggingKeys::prunedDueToMemoryPressureKey):
(WebCore::DiagnosticLoggingKeys::prunedDueToMaxSizeReached):
(WebCore::DiagnosticLoggingKeys::prunedDueToProcessSuspended):
(WebCore::WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey):
(WebCore::WebCore::DiagnosticLoggingKeys::webGLStateKey):
(WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
(WebCore::DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLoggingKey):
(WebCore::DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLoggingKey):
(WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
* page/DisabledAdaptations.cpp:
(WebCore::watchAdaptationName):
* page/EventHandler.cpp:
(WebCore::EventHandler::handlePasteGlobalSelection):
(WebCore::convertDragOperationToDropZoneOperation):
* page/EventSource.cpp:
(WebCore::EventSource::EventSource):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::appName):
(WebCore::NavigatorBase::appCodeName):
* page/Page.cpp:
(WebCore::Page::logNavigation):
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::url const):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeCSSStyleSheet):
* page/PerformanceMark.h:
* page/PerformanceMeasure.h:
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::observe):
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
* page/PerformanceUserTiming.cpp:
(WebCore::restrictedMarkFunction):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::toString const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::databaseIdentifier const):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::gcTimerString):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
(WebCore::ContentSecurityPolicy::reportUnsupportedDirective const):
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString):
(WebCore::gcTimerString):
* platform/ContentType.cpp:
(WebCore::ContentType::codecsParameter):
(WebCore::ContentType::profilesParameter):
* platform/Decimal.cpp:
(WebCore::Decimal::toString const):
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
(WebCore::typesForCommonExtension):
(WebCore::initializeUnsupportedTextMIMETypes):
(WebCore::MIMETypeRegistry::getNormalizedMIMEType):
* platform/SchemeRegistry.cpp:
(WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
* platform/URL.cpp:
(WebCore::mimeTypeFromDataURL):
* platform/UserAgentQuirks.cpp:
(WebCore::UserAgentQuirks::stringForQuirk):
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyForCharCode):
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::unblockHandler const):
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::unblockHandler const):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::MacApplication::isSafari):
(WebCore::MacApplication::isAppleMail):
(WebCore::MacApplication::isIBooks):
(WebCore::MacApplication::isITunes):
(WebCore::MacApplication::isMicrosoftMessenger):
(WebCore::MacApplication::isAdobeInstaller):
(WebCore::MacApplication::isAOLInstantMessenger):
(WebCore::MacApplication::isMicrosoftMyDay):
(WebCore::MacApplication::isMicrosoftOutlook):
(WebCore::MacApplication::isQuickenEssentials):
(WebCore::MacApplication::isAperture):
(WebCore::MacApplication::isVersions):
(WebCore::MacApplication::isHRBlock):
(WebCore::MacApplication::isIAdProducer):
(WebCore::MacApplication::isSolidStateNetworksDownloader):
(WebCore::IOSApplication::isMobileMail):
(WebCore::IOSApplication::isMobileSafari):
(WebCore::IOSApplication::isWebBookmarksD):
(WebCore::IOSApplication::isDumpRenderTree):
(WebCore::IOSApplication::isMobileStore):
(WebCore::IOSApplication::isSpringBoard):
(WebCore::IOSApplication::isWebApp):
(WebCore::IOSApplication::isIBooks):
(WebCore::IOSApplication::isIBooksStorytime):
(WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
(WebCore::IOSApplication::isCardiogram):
(WebCore::IOSApplication::isNike):
* platform/cocoa/UserAgentCocoa.mm:
(WebCore::userAgentBundleVersion):
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
(WebCore::GameControllerGamepad::setupAsGamepad):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::toJSONString const):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMFactoryFairPlayStreaming::supportsKeySystem):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::isEqual):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::generateKeyRequest):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::propertyIdToString):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileGridContainerLayerName):
(WebCore::TileController::zoomedOutTileGridContainerLayerName):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::toDataURL const):
(WebCore::dataURL):
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::VideoTextureCopierCV::initializeContextObjects):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::toJSONString const):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getUnmangledInfoLog):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::get):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::toDataURL const):
(WebCore::ImageDataToDataURL):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::typesForLegacyUnsafeBindings):
* platform/gtk/PasteboardHelper.cpp:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode):
(WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode):
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.h:
* platform/ios/Device.cpp:
(WebCore::deviceName):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
(WebCore::codeForKeyEvent):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
(WebCore::codeForKeyEvent):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
* platform/mediastream/MediaConstraints.cpp:
(WebCore::addDefaultVideoConstraints):
* platform/mediastream/PeerMediaDescription.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::deviceMap):
(WebCore::MockRealtimeMediaSource::audioDevices):
(WebCore::MockRealtimeMediaSource::videoDevices):
(WebCore::MockRealtimeMediaSource::displayDevices):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::parseMediaType):
* platform/network/FormData.cpp:
(WebCore::FormData::appendMultiPartFileValue):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPRequestLine):
(WebCore::parseHTTPHeader):
(WebCore::normalizeHTTPMethod):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::redirectedRequest const):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::ResourceRequestBase):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::handleDataURL):
* platform/network/curl/SynchronousLoaderClientCurl.cpp:
(WebCore::SynchronousLoaderClient::platformBadResponseError):
* platform/network/win/DownloadBundleWin.cpp:
(WebCore::DownloadBundle::fileExtension):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
(WebCore::SQLiteDatabase::setFullsync):
(WebCore::SQLiteDatabase::maximumSize):
(WebCore::SQLiteDatabase::pageSize):
(WebCore::SQLiteDatabase::freeSpaceSize):
(WebCore::SQLiteDatabase::totalSize):
(WebCore::SQLiteDatabase::clearAllTables):
(WebCore::SQLiteDatabase::runVacuumCommand):
(WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
(WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum):
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::deleteDatabaseFile):
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::dateFormat):
(WebCore::getFormatForSkeleton):
* platform/text/LocaleNone.cpp:
(WebCore::LocaleNone::dateFormat):
(WebCore::LocaleNone::monthFormat):
(WebCore::LocaleNone::shortMonthFormat):
(WebCore::LocaleNone::timeFormat):
(WebCore::LocaleNone::shortTimeFormat):
(WebCore::LocaleNone::dateTimeFormatWithSeconds):
(WebCore::LocaleNone::dateTimeFormatWithoutSeconds):
* platform/text/LocaleToScriptMappingDefault.cpp:
(WebCore::scriptNameToCode):
(WebCore::localeToScriptCodeForFontSelection):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::defaultTextEncodingNameForSystemLanguage):
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::bundleName):
* platform/wpe/RenderThemeWPE.cpp:
(WebCore::RenderThemeWPE::mediaControlsStyleSheet):
* rendering/RenderMenuList.cpp:
(RenderMenuList::setText):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):
* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGPropertyTraits<ComponentTransferType>::toString):
* svg/SVGFEColorMatrixElement.h:
(WebCore::SVGPropertyTraits<ColorMatrixType>::toString):
* svg/SVGFECompositeElement.h:
(WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
* svg/SVGFEConvolveMatrixElement.h:
(WebCore::SVGPropertyTraits<EdgeModeType>::toString):
* svg/SVGFEDisplacementMapElement.h:
(WebCore::SVGPropertyTraits<ChannelSelectorType>::toString):
* svg/SVGFEMorphologyElement.h:
(WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString):
* svg/SVGFETurbulenceElement.h:
(WebCore::SVGPropertyTraits<SVGStitchOptions>::toString):
(WebCore::SVGPropertyTraits<TurbulenceType>::toString):
* svg/SVGGradientElement.h:
(WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString):
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGMarkerTypes.h:
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
* svg/SVGMatrixValue.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):
(WebCore::SVGSVGElement::parseAttribute):
* svg/SVGTextContentElement.h:
(WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString):
* svg/SVGTextPathElement.h:
(WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString):
(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendCFFTable):
* svg/SVGUnitTypes.h:
(WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::filenameExtension const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::userInterfaceDirectionPolicy):
(WebCore::InternalSettings::systemLayoutDirection):
* testing/Internals.cpp:
(WebCore::Internals::areSVGAnimationsPaused const):
(WebCore::Internals::accessKeyModifiers const):
(WebCore::Internals::setMediaDeviceState):
(WebCore::Internals::audioSessionCategory const):
(WebCore::Internals::systemPreviewRelType):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeResponse const):
(WebCore::MockCDMInstance::updateLicense):
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::unblockRequestDeniedScript const):
* testing/MockCredentialsMessenger.cpp:
(WebCore::MockCredentialsMessenger::~MockCredentialsMessenger):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::getAssertion):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::debuggerMode):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::createResourceRequest):
(WebCore::WorkerScriptLoader::didReceiveData):
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::waitUntil):
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::~FetchEvent):
(WebCore::FetchEvent::respondWith):
(WebCore::FetchEvent::promiseIsSettled):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::clearPendingJobs):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClients.cpp:
(WebCore::ServiceWorkerClients::openWindow):
(WebCore::ServiceWorkerClients::claim):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):
(WebCore::ServiceWorkerJob::didReceiveResponse):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::update):
* workers/service/ServiceWorkerWindowClient.cpp:
(WebCore::ServiceWorkerWindowClient::focus):
(WebCore::ServiceWorkerWindowClient::navigate):
* workers/service/context/ServiceWorkerDebuggable.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::runRegisterJob):
(WebCore::SWServerJobQueue::runUnregisterJob):
(WebCore::SWServerJobQueue::runUpdateJob):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::responseMIMEType const):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/XPathPredicate.cpp:
(WebCore::XPath::evaluatePredicate):
* xml/XPathValue.cpp:
(WebCore::XPath::Value::toString const):
* xml/parser/CharacterReferenceParserInlines.h:
(WebCore::consumeCharacterReference):
2018-06-22 Youenn Fablet <youenn@apple.com>
Disable WebSocket in WatchOS
https://bugs.webkit.org/show_bug.cgi?id=186931
<rdar://problem/39584458>
Reviewed by Wenson Hsieh.
Add a runtime flag to enable/disable WebSocket.
By default, flag is on for all platforms except for WatchOS.
Test: fast/dom/Window/watchos/websocket/watchos/no-websocket-in-watchos.html
* Modules/websockets/WebSocket.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebSocketEnabled):
(WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
2018-06-22 Woodrow Wang <woodrow_wang@apple.com>
SubresourceLoader::didFail() should only log message if state is Initialized
https://bugs.webkit.org/show_bug.cgi?id=185124
Reviewed by Daniel Bates.
Functionality does not change. Moved console logging to be
after checking state of subresource loader. We only need to
log if the state is initialized. This is consistent with other
functions in the file. We can also remove a null check for the
frame pointer (m_frame). The superclass ResourceLoader constructor
takes an lvalue reference and initializes m_frame, ensuring
m_frame cannot be null. It is only set to null by
ResourceLoader::releaseResources(), which is only called after the
resource finishes loading or fails to load. Thus, in didFail(),
m_frame must be non-null when we're logging and up until the end of the function.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
2018-06-22 Timothy Hatcher <timothy@apple.com>
Corner of two scroll bars is white with dark mode enabled.
https://bugs.webkit.org/show_bug.cgi?id=186819
rdar://problem/40434350
Reviewed by Tim Horton.
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint): Added LocalDefaultSystemAppearance.
* page/Page.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paintScrollCorner): Dropped ScrollView argument.
* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::paintScrollCorner): Ditto.
* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::paintScrollCorner): Deleted. Default is the same.
* platform/ScrollbarThemeComposite.h:
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Added recursion early return.
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paintScrollCorner): Added.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintScrollCorner): Call ScrollbarTheme::paintScrollCorner.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents): Added LocalDefaultSystemAppearance.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents): Added LocalDefaultSystemAppearance.
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::paintScrollCorner): Call ScrollbarTheme::paintScrollCorner.
* rendering/RenderScrollbarTheme.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Added LocalDefaultSystemAppearance.
2018-06-22 Tim Horton <timothy_horton@apple.com>
Make it possible to add a border around loading or failed-to-load images
https://bugs.webkit.org/show_bug.cgi?id=186614
<rdar://problem/39050152>
Reviewed by Zalan Bujtas.
Tests: http/tests/images/loading-image-border.html
http/tests/images/loading-image-no-border.html
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIncompleteImageOutline):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderImage.h:
Factor the missing-image outline out, and - if desired - paint it in
cases where the image is still loading or otherwise pending, not just
when the image fails to load.
* page/Settings.yaml:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setIncompleteImageBorderEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Add and expose a setting to enable the feature.
2018-06-22 Brady Eidson <beidson@apple.com>
WKURLSchemeHandler doesn't handle sync XHR.
<rdar://problem/40955884> and https://bugs.webkit.org/show_bug.cgi?id=186902
Reviewed by Chris Dumez.
* English.lproj/Localizable.strings:
2018-06-22 Jer Noble <jer.noble@apple.com>
[Fullscreen] Restore ASSERT_NOT_REACHED() checks in exit fullscreen handler after r231924
https://bugs.webkit.org/show_bug.cgi?id=186945
<rdar://problem/37277469>
Reviewed by Simon Fraser.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):
2018-06-22 Per Arne Vollan <pvollan@apple.com>
Unreviewed build fix on Windows.
* testing/Internals.h:
2018-06-22 Youenn Fablet <youenn@apple.com>
Incoming G722 doesn't work
https://bugs.webkit.org/show_bug.cgi?id=186307
<rdar://problem/40809745>
Reviewed by Eric Carlson.
WebRTC backends usually does the following:
- Initially call RealtimeIncomingAudioSource with 16KHz data
- Switch to 48KHz when actual data is decoded.
We added a check that was discarding any 16KHz data, but in case of G722, the data remains as 16KHz and is then never read.
The solution is to remove the check that discards 16KHz information.
We then need to fix a bug in AudioTrackPrivateMediaStreamCocoa that was preventing proper handling of change of audio data configuration.
Test: webrtc/audio-peer-connection-g722.html
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2018-06-22 Timothy Hatcher <timothy@apple.com>
Recalc styles every time defaultAppearance changes.
https://bugs.webkit.org/show_bug.cgi?id=186866
rdar://problem/41309805
Reviewed by Tim Horton.
* page/Page.cpp:
(WebCore::Page::setUseSystemAppearance): Added. Recalc styles and update system colors.
(WebCore::Page::setDefaultAppearance): Added. Ditto.
* page/Page.h:
(WebCore::Page::setUseSystemAppearance): Deleted impl.
(WebCore::Page::setDefaultAppearance): Deleted impl.
2018-06-22 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Avoid sending SELECT_STREAM events when nothing changed
https://bugs.webkit.org/show_bug.cgi?id=186678
Reviewed by Philippe Normand.
This avoid extra work in decodebin3 and should work around a crash
in decodebin3 when we send spurious SELECT_STREAM in the mediastream
layout tests.
GStreamer was also missing safe guards in the GstStream APIs which have been
added in gstreamer core in 8833ca942ea21c58c0f63822f0e2b61695b39447
"stream: Add some missing API safe guards".
Should fix following flakes:
- fast/mediastream/MediaStream-video-element-track-stop.html
- fast/mediastream/change-tracks-media-stream-being-played.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
2018-06-22 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r230950): [GTK] WebKit::CoordinatedBackingStoreTile::setBackBuffer(): WebKitWebProcess killed by SIGSEGV (ASSERTION FAILED: it != m_tiles.end())
https://bugs.webkit.org/show_bug.cgi?id=186206
Unreviewed manual rollout of r230950
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::shouldHaveBackingStore const):
2018-06-20 Darin Adler <darin@apple.com>
[Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
https://bugs.webkit.org/show_bug.cgi?id=186875
Reviewed by Anders Carlsson.
* platform/cocoa/ThemeCocoa.mm:
(WebCore::passKitBundle): Use isDirectory:YES when creating a URL pointing to a framework,
since frameworks are directories.
2018-06-22 Miguel Gomez <magomez@igalia.com>
[WPE][ThreadedRendering] WPE crashes rendering SVG content when using ThreadedRendering
https://bugs.webkit.org/show_bug.cgi?id=186914
Reviewed by Carlos Garcia Campos.
Add GraphicsContextImpl::clipToImageBuffer() to the interface and the implementors. Forward
the call to GraphicsContext::clipToImageBuffer() to the implementation if possible in the
cairo case.
Covered by existent tests.
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::clipToImageBuffer):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::clipToImageBuffer):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::clipToImageBuffer):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::clipToImageBuffer):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
2018-06-22 Carlos Garcia Campos <cgarcia@igalia.com>
[CMake] Generated sources depending on SelectorPseudoClassAndCompatibilityElementMap.in are not regenerated
https://bugs.webkit.org/show_bug.cgi?id=186911
Reviewed by Michael Catanzaro.
This is causing test fullscreen/fullscreen-env.html to fail since it was added in r233066 in the bots that
didn't start a clean build. The problem is that the CMake command to generate
SelectorPseudoClassAndCompatibilityElementMap.cpp doesn't depend on
SelectorPseudoClassAndCompatibilityElementMap.in.
* CMakeLists.txt:
2018-06-22 Miguel Gomez <magomez@igalia.com>
[WPE][ThreadedRendering] WPE crashes rendering some pieces of text when using ThreadedRendering
https://bugs.webkit.org/show_bug.cgi?id=186886
Reviewed by Žan Doberšek.
Modify DisplayList DrawGlyphs element to use a GraphicsContext for replaying. To do so, modify
GraphicsContext::drawGlyphs() API so it doesn't require a FontCascade, and update all the calls
to it.
Covered by existent tests.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawGlyphBuffer const):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawGlyphs):
* platform/graphics/GraphicsContext.h:
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::apply const):
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paintGlyph):
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
2018-06-15 Jer Noble <jer.noble@apple.com>
Address fullscreen api CSS env feedback
https://bugs.webkit.org/show_bug.cgi?id=186684
Reviewed by Simon Fraser.
Test: fullscreen/fullscreen-env.html
+ Update the phishing alert text to be more explicit about the specific threats
phishing sites represent.
+ Make the top inset static, rather than dynamic.
+ Add bottom, left, and right insets for completeness.
+ Set the fullscreen animation duration as well as delay.
+ Notify the page when the controls show and hide.
* English.lproj/Localizable.strings:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFullScreenControlsHiddenPseudoClass):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::nameForProperty const):
(WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets):
(WebCore::ConstantPropertyMap::didChangeFullscreenInsets):
(WebCore::ConstantPropertyMap::setFullscreenAutoHideDuration):
(WebCore::ConstantPropertyMap::setFullscreenInsetTop): Deleted.
* dom/ConstantPropertyMap.h:
* dom/Document.cpp:
(WebCore::Document::areFullscreenControlsHidden const):
(WebCore::Document::setFullscreenControlsHidden):
* dom/Document.h:
* page/Page.cpp:
(WebCore::Page::setFullscreenInsets):
(WebCore::Page::setFullscreenAutoHideDuration):
(WebCore::Page::setFullscreenControlsHidden):
(WebCore::Page::setFullscreenInsetTop): Deleted.
* page/Page.h:
(WebCore::Page::fullscreenInsets const):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setFullscreenInsets):
(WebCore::Internals::setFullscreenAutoHideDuration):
(WebCore::Internals::setFullscreenControlsHidden):
(WebCore::Internals::setFullscreenInsetTop): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-06-21 Jer Noble <jer.noble@apple.com>
[Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=186822
Reviewed by Simon Fraser.
* dom/Document.cpp:
(WebCore::Document::setOverrideViewportArguments):
(WebCore::Document::updateViewportArguments):
* dom/Document.h:
2018-06-20 Said Abou-Hallawa <sabouhallawa@apple.com>
RenderSVGInline has to be inline always regardless of its css display value
https://bugs.webkit.org/show_bug.cgi?id=186656
Reviewed by Zalan Bujtas.
According to https://www.w3.org/TR/SVG2/text.html#TextLayout, the <text>
element has to be laid out as if it were a block element and any <tspan>,
<textPath>, <a> and <tref> descendants were inline elements.
If a css rule, which contains the property "display: block;", is applied
to any of children of a <text> element, this property has to be ignored.
We currently ignore this property in RenderSVGInline::updateFromStyle()
by forcing setInline(true). But we do not do the same thing in
RenderTreeBuilder::normalizeTreeAfterStyleChange(). In fact we allow
making the children of the <text> element to be non-inline. This puts
the render tree in weired state and causes many assertions to fire while
laying out RenderSVGText.
Test: svg/dom/svg-inline-text-display-block-crash.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):
2018-06-20 Zalan Bujtas <zalan@apple.com>
Do not reuse generated inline renderer for the first letter.
https://bugs.webkit.org/show_bug.cgi?id=186657
<rdar://problem/41157892>
Reviewed by Simon Fraser.
When the first letter pseudo element is present, we construct a dedicated subtree for its content like this:
<div><span>foobar</span></div> -> with ::first-letter on the <div>
DIV RenderBlock
SPAN RenderInline
RenderInline (generated wrapper for the first letter content)
RenderText (fist letter content)
RenderText (remaining text content)
"display: contents" on the <span> forces us not to construct a RenderInline for the <span> (or just come up with a wrapper at best).
FirstLetter::createRenderers logic needs to check for such cases and pick the correct parent for the first letter subtree accordingly.
Test: fast/text/first-letter-with-display-contents-crash.html
imported/w3c/web-platform-tests/css/css-display/display-contents-first-letter-002.html is not crashing anymore either.
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2018-06-21 Chris Dumez <cdumez@apple.com>
JSPerformanceObserverCallback creates a GC strongly-referenced Function that is never cleaned up
https://bugs.webkit.org/show_bug.cgi?id=186873
<rdar://problem/41271574>
Reviewed by Simon Fraser.
Add [IsWeakCallback] to PerformanceObserverCallback interface so that the generated
JSPerformanceObserverCallback uses a JSC::Weak instead of a JSC::Strong to store the
js function. To keep the function alive, add [JSCustomMarkFunction] to PerformanceObserver
interface and have its visitAdditionalChildren() visit the callback's js function.
Finally, because we want the callback to still be called even if the JS does not keep
the PerformanceObserver wrapper alive, add [CustomIsReachable] to PerformanceObserver
interface and have its isReachableFromOpaqueRoots() return true if the observer is
registered (i.e. it may need to call the callback in the future).
I have confirmed locally, that the Performance / PerformanceObserver / Document
objects properly get destroyed if I navigate away from a page that had a performance
observer and trigger a memory pressure warning. Also,
`notifyutil -p com.apple.WebKit.showAllDocuments` no longer shows the old document.
Tests: performance-api/performance-observer-callback-after-gc.html
performance-api/performance-observer-no-document-leak.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPerformanceObserverCustom.cpp: Added.
(WebCore::JSPerformanceObserver::visitAdditionalChildren):
(WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
* bindings/js/ScriptController.cpp:
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::disassociate):
* page/PerformanceObserver.h:
(WebCore::PerformanceObserver::isRegistered const):
(WebCore::PerformanceObserver::callback):
* page/PerformanceObserver.idl:
* page/PerformanceObserverCallback.h:
* page/PerformanceObserverCallback.idl:
2018-06-20 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_animation-ready.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183830
<rdar://problem/40997539>
Reviewed by Dean Jackson.
The CSS Animations Level 2 spec explains how the Web Animations API and CSS Animations interact and requires
pending styles changes on the target element of a CSS Animation to be flushed when using a Web Animations API
on it in order to ensure that any animation- CSS property is accounted for.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsStartTime const):
(WebCore::CSSAnimation::setBindingsStartTime):
(WebCore::CSSAnimation::bindingsCurrentTime const):
(WebCore::CSSAnimation::setBindingsCurrentTime):
(WebCore::CSSAnimation::bindingsPlayState const):
(WebCore::CSSAnimation::bindingsPending const):
(WebCore::CSSAnimation::bindingsReady):
(WebCore::CSSAnimation::bindingsFinished):
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):
(WebCore::CSSAnimation::flushPendingStyleChanges const):
* animation/CSSAnimation.h:
* animation/WebAnimation.h:
(WebCore::WebAnimation::bindingsPlayState const):
(WebCore::WebAnimation::bindingsPending const):
(WebCore::WebAnimation::bindingsReady):
(WebCore::WebAnimation::bindingsFinished):
(WebCore::WebAnimation::bindingsPlay):
(WebCore::WebAnimation::bindingsPause):
* animation/WebAnimation.idl:
2018-06-21 Jer Noble <jer.noble@apple.com>
[Fullscreen] Suspend page (and pause video) while phishing warning is presented
https://bugs.webkit.org/show_bug.cgi?id=186856
<rdar://problem/41212444>
Reviewed by Tim Horton.
Pause the media element when the page is suspended, and unpause when the page resumes.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
* html/HTMLMediaElement.h:
2018-06-21 Michael Catanzaro <mcatanzaro@igalia.com>
Bad optional access in WebCore::ContentSecurityPolicySource::portMatches
https://bugs.webkit.org/show_bug.cgi?id=186535
Reviewed by Daniel Bates.
Make sure the ports have explicit values before dereferencing them.
This is hard to test. If the layout test script-src-parsing-implicit-and-explicit-port-number
continues to pass for WebKitLegacy, then I have at least probably not broken anything. To
reproduce the crash in a layout test that I can run, I think I would need to implement
internals.registerDefaultPortForProtocol for modern WebKit, which is too much work for this
crash. Otherwise, we'd need to run the test server on port 80, which would be unfriendly.
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::portMatches const):
2018-06-21 Fujii Hironori <Hironori.Fujii@sony.com>
[GStreamer] ASSERTION FAILED: end.isValid() in PlatformTimeRanges::add
https://bugs.webkit.org/show_bug.cgi?id=186880
Reviewed by Xabier Rodriguez-Calvar.
Bug 180253 has added assertions the arugments `start` and `end` is
valid MediaTime in PlatformTimeRanges::add. Since then, some
LayoutTests fail due to the assertion failure.
The invalid MediaTime is added into the PlatformTimeRanges in
MediaPlayerPrivateGStreamer::buffered. Before adding MediaTime,
original implementation checks MediaTime::operator bool() returns
true. But, this method returns true if the time value is invalid.
Then, PlatformTimeRanges::add is called with an invalid MediaTime.
No new tests (No behavior change).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::buffered const): Check
maxTimeLoaded() is valid before adding to `timeRanges`.
2018-06-20 David Kilzer <ddkilzer@apple.com>
Fix leaks in WebCore found by clang static analyzer in deep mode
<https://webkit.org/b/186865>
Reviewed by Joseph Pecoraro.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNames): Fix leak of an empty NSMutableArray
during an early return. RetainPtr<> is not used here since
a pointer to the NSMutableArray * is passed around.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
Fix leak of a CGDisplayModeRef during an early return.
2018-06-20 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the watchOS build after r233016.
* page/EventHandler.cpp:
(WebCore::EventHandler::selectionExtentRespectingEditingBoundary):
Move this helper out of the ENABLE(DRAG_SUPPORT) guard.
* page/EventHandler.h:
2018-06-20 Simon Fraser <simon.fraser@apple.com>
AnimationList wastes 60KB of vector capacity
https://bugs.webkit.org/show_bug.cgi?id=186701
Reviewed by Chris Dumez.
AnimationList was the second most wasteful call site for Vector capacity on theverge.com,
wasting almost 60KB. Lists had between 1 and 3 entries, so give AnimationList's vector of
Animations a min capacity of zero so it doesn't grow in increments of 16.
Also shrink Animation from 88 bytes to 72 bytes by optimizing packing.
* platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
(WebCore::Animation::operator=):
(WebCore::Animation::animationsMatch const):
* platform/animation/Animation.h:
(WebCore::Animation::animationMode const):
(WebCore::Animation::setAnimationMode):
* platform/animation/AnimationList.h:
2018-06-20 Simon Fraser <simon.fraser@apple.com>
ContentSecurityPolicySourceList wastes 51KB of Vector capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=186706
Reviewed by Chris Dumez.
Make ContentSecurityPolicySourceList::parse() call shrinkToFit() on m_list
after parsing to eliminate wasted vector capacity.
Shrink ContentSecurityPolicySource down to 40 bytes by optimizing packing.
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::matches const):
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::matches): Deleted.
* page/csp/ContentSecurityPolicySourceList.h:
2018-06-20 Megan Gardner <megan_gardner@apple.com>
Restrict Selection in contenteditable the extent of that contenteditable
https://bugs.webkit.org/show_bug.cgi?id=186792
Reviewed by Wenson Hsieh.
My system currently will not allow me to run tests. I will add one when I can update.
Expose the already existing funcitonality to restrict a selection to a single contentenditable
* page/EventHandler.cpp:
(WebCore::EventHandler::selectionExtentRespectingEditingBoundary):
(WebCore::selectionExtentRespectingEditingBoundary): Deleted.
* page/EventHandler.h:
* rendering/HitTestResult.h:
2018-06-20 Simon Fraser <simon.fraser@apple.com>
CSSFontFace wastes 59KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186708
Reviewed by Anders Carlsson.
Most CSSFontFace have one or two CSSFontFaceSource so don't allocate
vector capacity in the default 16-size chunks.
* css/CSSFontFace.h:
2018-06-20 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-transitions/test_element-get-animations.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183841
<rdar://problem/40998101>
Reviewed by Dean Jackson.
We must ignore CSS Animations with "animation-name: none".
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement):
2018-06-20 Miguel Gomez <magomez@igalia.com>
[GTK][ThreadedRendering][Nicosia] Themed elements cannot be rendered using threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=186840
Reviewed by Carlos Garcia Campos.
Disable threaded rendering for GTK port.
* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
2018-06-20 Yusuke Suzuki <utatane.tea@gmail.com>
[GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
https://bugs.webkit.org/show_bug.cgi?id=186836
Reviewed by Carlos Garcia Campos.
Use "PaintingThread" name.
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
2018-06-19 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_pseudoElement-get-animations.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183818
<rdar://problem/40997015>
Reviewed by Dean Jackson.
We add a new opt-in flag to return sorted animations when calling AnimationTimeline::animationsForElement() so that
Element::getAnimations() can opt into returning animations sorted by the rules defined by the CSS Transitions spec.
The rule is that CSS Transitions must be sorted prior to CSS Animations and regular Web Animations, and then sorted
by the time they were generated and, if generated at the same time, sorted alphabetically based on the transitioned
property. To be able to accomodate this, we add a new generationTime() method to CSSTransition.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationsForElement const):
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/AnimationTimeline.h:
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::CSSTransition):
* animation/CSSTransition.h:
* dom/Element.cpp:
(WebCore::Element::getAnimations):
2018-06-19 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Allow passing contents of Root CA data directly.
https://bugs.webkit.org/show_bug.cgi?id=185782
Currently the data must be in a file and set by its path. This patch
allow application to set root CA data by passing binary data directly.
Reviewed by Yusuke Suzuki.
No new tests. Tested internally.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::getCACertPathEnv):
(WebCore::CurlSSLHandle::setCACertPath):
(WebCore::CurlSSLHandle::setCACertData):
(WebCore::CurlSSLHandle::clearCACertInfo):
* platform/network/curl/CurlSSLHandle.h:
(WebCore::CurlSSLHandle::getCipherList const):
(WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
(WebCore::CurlSSLHandle::getCurvesList const):
(WebCore::CurlSSLHandle::setCipherList):
(WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
(WebCore::CurlSSLHandle::setCurvesList):
(WebCore::CurlSSLHandle::setIgnoreSSLErrors):
(WebCore::CurlSSLHandle::getCACertInfo const):
(WebCore::CurlSSLHandle::getCACertPath const): Deleted.
(WebCore::CurlSSLHandle::setCACertPath): Deleted.
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
2018-06-19 Dean Jackson <dino@apple.com>
ARKit badge drop shadow updates its blur radius based on page zoom
https://bugs.webkit.org/show_bug.cgi?id=186829
<rdar://problem/40738779>
Reviewed by Tim Horton.
We need to make sure the shadow blur radius takes into account the
current zoom. Thankfully, the GraphicsContext platform code already
does this, so just use it.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2018-06-19 Dean Jackson <dino@apple.com>
Blank viewer comes up and then auto-dismisses when device is not connected to Internet
https://bugs.webkit.org/show_bug.cgi?id=186825
<rdar://problem/40294170>
Reviewed by Tim Horton.
Export isSuccessful() to WebKit.
* platform/network/ResourceResponseBase.h:
2018-06-19 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Enable Proxy Authentication.
https://bugs.webkit.org/show_bug.cgi?id=185266
Add support for Proxy Authentication to curl network layer.
Reviewed by Alex Christensen.
No new tests in public. Tested internally.
* platform/network/curl/AuthenticationChallenge.h:
* platform/network/curl/AuthenticationChallengeCurl.cpp:
(WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
(WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
(WebCore::AuthenticationChallenge::determineProxyPort):
(WebCore::AuthenticationChallenge::authenticationSchemeFromCurlAuth):
(WebCore::AuthenticationChallenge::parseRealm):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableProxyIfExists):
(WebCore::CurlHandle::getProxyUrl):
(WebCore::CurlHandle::getProxyAuthAvail):
(WebCore::CurlHandle::getPrimaryPort): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::setDefaultProxyAuthMethod):
(WebCore::CurlContext::setProxyAuthMethod):
* platform/network/curl/CurlProxySettings.cpp:
(WebCore::determineAuthMethod):
(WebCore::CurlProxySettings::setAuthMethod):
(WebCore::protocolIsInSocksFamily):
* platform/network/curl/CurlProxySettings.h:
(WebCore::CurlProxySettings::setDefaultAuthMethod):
(WebCore::CurlProxySettings::authMethod const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::isProxyAuthenticationRequired const):
2018-06-19 Tim Horton <timothy_horton@apple.com>
Unpainted area while scrolling in Reader is white
https://bugs.webkit.org/show_bug.cgi?id=186541
<rdar://problem/40471363>
Reviewed by Timothy Hatcher.
New test: tiled-drawing/simple-document-with-dynamic-background-color.html
For platforms that do not use the overhang layer, we depend on
RenderView's background color to fill unpainted space.
RenderView's background color is only updated inside updateRootLayerConfiguration,
and it is possible with a simple enough page to change the document's
background color without running that code.
* page/FrameView.cpp:
(WebCore::FrameView::setTransparent):
(WebCore::FrameView::setBaseBackgroundColor):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.
(WebCore::FrameView::calculateExtendedBackgroundMode const):
Update a comment, since the function it mentioned is no longer.
(WebCore::FrameView::updateTilesForExtendedBackgroundMode):
Remove this code that clears the root extended background color
if using tiles to extend in both directions. Two reasons:
1) it seems harmless to also have a root extended background color
2) this just gets clobbered by the call in RenderView::paintBoxDecorations
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Add a bit that will do a updateConfiguration() on the root layer if no
other work needs to be done, so that we can update the root layer's
transparency or background color without doing a full layer rebuild.
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
Change rootBackgroundTransparencyChanged to also cover color changes.
Fold setRootExtendedBackgroundColor in here, and make use of
setRootLayerConfigurationNeedsUpdate() instead of doing a full rebuild.
Previously, we would bail if the transparency state hadn't changed;
now, we'll also update the root layer's background color and the
exposed-to-WebKit extended background color if they change too.
(WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Deleted.
(WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): Deleted.
* rendering/RenderLayerCompositor.h:
Add setRootLayerConfigurationNeedsUpdate, remove setRootExtendedBackgroundColor,
and add both a bit indicating that the root layer configuration needs updating
and the cached view background color to make the early return in
rootBackgroundColorOrTransparencyChanged possible.
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.
2018-06-19 Youenn Fablet <youenn@apple.com>
Need to properly handle removal of worker in SWServer::unregisterServiceWorkerClient timer lambda
https://bugs.webkit.org/show_bug.cgi?id=186674
<rdar://problem/40974812>
Reviewed by Chris Dumez.
While looping over the running workers map and trying to terminate some of the workers,
there is a chance that the map will be modified synchronously which may affect iterating the map.
This patch removes that potential threat.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::unregisterServiceWorkerClient):
2018-06-19 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_animation-playstate.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183828
<rdar://problem/40997469>
Reviewed by Dean Jackson.
We need to ensure pending styles have been resolved prior to returning the play state for a CSS Animation since
it can be controlled by the animation-play-state CSS property. To that end we expose a specific bindings-only
method which we override for CSSAnimation to force a style update.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsPlayState const):
* animation/CSSAnimation.h:
* animation/WebAnimation.h:
(WebCore::WebAnimation::bindingsPlayState const):
* animation/WebAnimation.idl:
2018-06-19 David Kilzer <ddkilzer@apple.com>
Revert: Add logging when splashboardd enables WebThread
<https://webkit.org/b/186793>
<rdar://problem/41213255>
Turns out this isn't needed, so reverting r232959.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSplashBoardd): Deleted.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable):
2018-06-19 Wenson Hsieh <wenson_hsieh@apple.com>
[WebKit on watchOS] Vend username text content type when using scribble in login fields
https://bugs.webkit.org/show_bug.cgi?id=186791
<rdar://problem/41226935>
Reviewed by Beth Dakin.
Expose AutofillElements' autofillable username input element. See WebKit ChangeLog for more details.
* editing/ios/AutofillElements.h:
(WebCore::AutofillElements::username const):
2018-06-19 Chris Dumez <cdumez@apple.com>
WebCoreNSURLSessionDataTaskClient::redirectReceived() calls WebCore on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=186805
<rdar://problem/36960714>
Reviewed by Youenn Fablet.
Make sure WebCoreNSURLSessionDataTaskClient::redirectReceived() dispatches to the main
thread before calling its completion handler. Otherwise, we end up calling into WebCore
on a NSOperationQueue background thread and we crash.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
2018-06-19 Chris Dumez <cdumez@apple.com>
HTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=186735
<rdar://problem/41189164>
Reviewed by Geoffrey Garen.
Resource requests and responses normally do not have a large amount of HTTP headers
(local testing shows 6 common headers on average and 0.3 uncommon ones).
As a result, move the internal representation of HTTPHeaderMap from HashMaps to
Vectors. Given the number of headers, the impact on performance should be negligible.
However, the new implementation uses a lot less memory. In a follow-up, we can save
even more memory by calling HTTPHeaderMap::shrinkToFit() when possible.
* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::canReuse const):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::isolatedCopy const):
(WebCore::HTTPHeaderMap::get const):
(WebCore::HTTPHeaderMap::set):
(WebCore::HTTPHeaderMap::add):
(WebCore::HTTPHeaderMap::append):
(WebCore::HTTPHeaderMap::addIfNotPresent):
(WebCore::HTTPHeaderMap::contains const):
(WebCore::HTTPHeaderMap::remove):
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::CommonHeader::isolatedCopy const):
(WebCore::HTTPHeaderMap::CommonHeader::operator== const):
(WebCore::HTTPHeaderMap::UncommonHeader::isolatedCopy const):
(WebCore::HTTPHeaderMap::UncommonHeader::operator== const):
(WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::HTTPHeaderMapConstIterator):
(WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
(WebCore::HTTPHeaderMap::shrinkToFit):
(WebCore::HTTPHeaderMap::commonHeaders const):
(WebCore::HTTPHeaderMap::uncommonHeaders const):
(WebCore::HTTPHeaderMap::commonHeaders):
(WebCore::HTTPHeaderMap::uncommonHeaders):
(WebCore::HTTPHeaderMap::CommonHeader::encode const):
(WebCore::HTTPHeaderMap::CommonHeader::decode):
(WebCore::HTTPHeaderMap::UncommonHeader::encode const):
(WebCore::HTTPHeaderMap::UncommonHeader::decode):
(WebCore::HTTPHeaderMap::encode const):
(WebCore::HTTPHeaderMap::decode):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
2018-06-19 Youenn Fablet <youenn@apple.com>
Network Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=186312
<rdar://problem/40495434>
Reviewed by Chris Dumez.
Test: http/wpt/fetch/inspect-preflight.html
No change of behavior in regular conditions.
All intermediate requests/responses are now buffered in NetworkProcess if Web inspector shows up.
Add NetworkLoadInformation and NetworkIntermediateLoadInformation for that purpose.
Add a new LoaderStrategy method to grab this information from NetworkProcess synchronously.
Add Internals API for testing the storage by the Network Process and the sending to WebProcess.
* WebCore.xcodeproj/project.pbxproj:
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
* loader/LoaderStrategy.h:
* platform/network/NetworkLoadInformation.h: Added.
(WebCore::NetworkTransactionInformation::encode const):
(WebCore::NetworkTransactionInformation::decode):
* testing/Internals.cpp:
(WebCore::Internals::setCaptureExtraNetworkLoadMetricsEnabled):
(WebCore::Internals::ongoingLoadDescriptions):
* testing/Internals.h:
* testing/Internals.idl:
2018-06-19 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183821
<rdar://problem/40997034>
Reviewed by Dean Jackson.
If an element gets a "display: none" style RenderTreeUpdater::tearDownRenderers() will be called with a RendererUpdateCancelingAnimations
teardown type on all of its children. We need to ensure all declarative animations, and only those since regular Web Animations should be
kept active regardless of their target's style, are canceled in this situation.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
* animation/AnimationTimeline.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-06-19 David Kilzer <ddkilzer@apple.com>
Add logging when splashboardd enables WebThread
<https://webkit.org/b/186793>
<rdar://problem/41213255>
Reviewed by Daniel Bates.
* platform/RuntimeApplicationChecks.h:
(WebCore::IOSApplication::isSplashBoardd): Add declaration.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSplashBoardd): Add implementation.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
splashboardd.
2018-06-19 Miguel Gomez <magomez@igalia.com>
[GTK][WPE][Nicosia] Add environment variable to enable threaded rendering and set the number of painting threads
https://bugs.webkit.org/show_bug.cgi?id=186801
Reviewed by Carlos Garcia Campos.
Add and environment variable to enable the usage of the threaded renderer and define the number
of painting threads.
No new tests.
* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
2018-06-19 Youenn Fablet <youenn@apple.com>
RTCRtpSender.replaceTrack(null) ends current track
https://bugs.webkit.org/show_bug.cgi?id=184911
<rdar://problem/40758138>
Reviewed by Eric Carlson.
Before the patch, when replacing the sender track by null, the previous track was stopped.
Instead of doing that, the track now stays alive and it is the realtime source that is stopped.
This ensures that the data is no longer sent while the track can still be used elsewhere.
Covered by updated and rebased tests.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver):
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::updateTrackSource):
(WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2018-06-18 Chris Dumez <cdumez@apple.com>
Better pack ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=186717
Reviewed by Darin Adler.
Better pack ResourceRequest to reduce its size from 240 to 232 bytes
on Mac.
* platform/network/ResourceRequestBase.h:
2018-06-18 Antoine Quint <graouts@apple.com>
[Web Animations] Implement "Starting of transitions" section from CSS Transitions
https://bugs.webkit.org/show_bug.cgi?id=186517
<rdar://problem/41000798>
Reviewed by Dean Jackson.
We implement the whole section at https://drafts.csswg.org/css-transitions-1/#starting so that we have spec-compliant starting of CSS Transitions.
To correctly implement this we now maintain two maps of transitions for a given property, a set of running transitions (m_elementToRunningCSSTransitionByCSSPropertyID)
and a set of completed transition (m_elementToCompletedCSSTransitionByCSSPropertyID).
* animation/AnimationTimeline.cpp:
(WebCore::removeCSSTransitionFromMap): Add a utility to remove a CSSTransition from one of the two HashMap<Element*, HashMap<CSSPropertyID, RefPtr<CSSTransition>>>
managed by AnimationTimeline (m_elementToRunningCSSTransitionByCSSPropertyID and m_elementToCompletedCSSTransitionByCSSPropertyID).
(WebCore::AnimationTimeline::animationWasRemovedFromElement): Use the new removeCSSTransitionFromMap() utility.
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): We rename "oldStyle" to "currentStyle" to align with the naming used by updateCSSAnimationsForElement().
We also remove an initial check that has been pushed up to Style::TreeResolver::createAnimatedElementUpdate().
(WebCore::propertyInStyleMatchesValueForTransitionInMap): When running the steps mandated by the spec we often need to check whether a given property has a transition
in an AnimationList that matches the value used in a given RenderStyle.
(WebCore::transitionCombinedDuration): We need to compute the combined duration twice while running the steps mandated by the spec, so we have a dedicated utility.
(WebCore::transitionMatchesProperty): New utility that indicates whether a WebCore::Animation matches a given property, by virtue of targeting it directly, targeting
a shorthand for which this property is a longhand, or targeting "all".
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): This is where all of the new implementation for starting transitions happens. We implement the steps
as they appear in the spec.
(WebCore::shouldBackingAnimationBeConsideredForCSSTransition): Deleted.
* animation/AnimationTimeline.h:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Since only CSS Animations respect the delay and duration values as parsed directly in a WebCore:Animation
object, we move code that was previously in DeclarativeAnimation::syncPropertiesWithBackingAnimation to this method. CSS Transitions set those values based on the
delay and duration parameters passed to CSSTransition::create() and computed in AnimationTimeline::updateCSSTransitionsForElement().
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Since the transition's delay and duration is computed in AnimationTimeline::updateCSSTransitionsForElement(), we now require them
to be passed when creating a CSSTransition and pass those to the new setTimingProperties() function. We also expect a target style and reversing-adjusted start style,
as well as a reversing-shortening factor.
(WebCore::CSSTransition::CSSTransition):
(WebCore::CSSTransition::resolve): We need to be able to query the last style computed by a call to resolve() from AnimationTimeline::updateCSSTransitionsForElement(),
we subclass this newly-virtual WebAnimation method and clone the style after we blended the property targeted by this transition.
(WebCore::CSSTransition::setTimingProperties): Set the transition delay and duration as provided in the call to create().
(WebCore::CSSTransition::canBeListed const): Fix a crash that was found while working on this bug where we could access a null effect.
(WebCore::CSSTransition::initialize): Deleted.
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Deleted.
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): This virtual method now has an empty definition since the timing properties are now only set
for CSSAnimation.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Deleted.
* animation/KeyframeEffectReadOnly.h:
* animation/WebAnimation.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::AnimationPropertyWrapperBase::canInterpolate const): Since we need to be able to determine whether some property values can be interpolated, we add a new
canInterpolate() method to the base wrapper class so the cases where we can't interpolate values (length with an "auto" type) may return false.
(WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Lengths can only be interpolated if both the start and end values are not "auto".
(WebCore::LengthVariantPropertyWrapper::LengthVariantPropertyWrapper):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::CSSPropertyAnimation::canPropertyBeInterpolated):
* page/animation/CSSPropertyAnimation.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate): Move a check found in both updateCSSAnimationsForElement() and updateCSSTransitionsForElement() to their
shared call site.
2018-06-18 Nan Wang <n_wang@apple.com>
AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
https://bugs.webkit.org/show_bug.cgi?id=186697
Reviewed by Darin Adler.
Now that web process doesn't have access to NSScreen. The conversion of the
rects is wrong. Fixed this by using the right function that's available in
WebCore to get the rects.
* editing/mac/FrameSelectionMac.mm:
(WebCore::accessibilityConvertScreenRect):
2018-06-18 Youenn Fablet <youenn@apple.com>
Expose RTCPeerConnectionIceEventInit constructor
https://bugs.webkit.org/show_bug.cgi?id=186770
Reviewed by Alex Christensen.
Add event constructor as per specification.
Add support for the url attribute.
For that purpose, we need to pipe that information from LibWebRTCMediaEndpoint
up to RTCPeerConnectionIceEvent.
Covered by rebased test.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::fireICECandidateEvent):
(WebCore::PeerConnectionBackend::disableICECandidateFiltering):
(WebCore::PeerConnectionBackend::newICECandidate):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
(WebCore::RTCPeerConnectionIceEvent::create):
(WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
* Modules/mediastream/RTCPeerConnectionIceEvent.h:
(WebCore::RTCPeerConnectionIceEvent::url const):
* Modules/mediastream/RTCPeerConnectionIceEvent.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:
2018-06-18 Simon Fraser <simon.fraser@apple.com>
SVGTransformListValues wastes 127KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186704
Reviewed by Said Abou-Hallawa.
SVGTransformListValues has inline capacity 1, and every SVGGraphicsElement has
a SVGSynchronizableAnimatedProperty<WebCore::SVGTransformListValues>, so the inline
capacity wastes space for every SVGGraphicsElement that doesn't have a transform (i.e.
most of them).
So make SVGTransformListValues have zero inline capacity, and set its min capacity to
2, rather than the default 16, since most transform lists are short.
* svg/SVGTransformListValues.h:
2018-06-18 Said Abou-Hallawa <sabouhallawa@apple.com>
Document should not be mutated under SMILTimeContainer::updateAnimations()
https://bugs.webkit.org/show_bug.cgi?id=186658
Reviewed by Simon Fraser.
To update the animation of an SVG <animate> element, we call
SVGAnimateElementBase::resetAnimatedType(). It ensures the pointer m_animator
is valid. If it animates a css property, it calls computeCSSPropertyValue()
which calls resolveStyle() via other calls. resolveStyle() may call delayed
callbacks through the destructor of PostResolutionCallbackDisabler. These
callbacks may fire events. These events may execute JS event handlers.
If one of these event handlers deletes the same SVG <animate> we animate,
we will end up calling SVGAnimateElementBase::resetAnimatedPropertyType()
of the same <animate> element. This function will delete the same m_animator
which resetAnimatedType() still holds and will use later. This code
re-entrance is unexpected and unwanted.
The fix is to disable mutating the DOM while updating the SVG animations.
Test: svg/dom/css-animate-input-foucs-crash.html
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateAnimations):
2018-06-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r232935.
https://bugs.webkit.org/show_bug.cgi?id=186783
This patch broke macOS 32-bit build (Requested by n_wang on
#webkit).
Reverted changeset:
"AX: [macOS] When zoom is enabled, focus doesn't follow text
cursor"
https://bugs.webkit.org/show_bug.cgi?id=186697
https://trac.webkit.org/changeset/232935
2018-06-18 Nan Wang <n_wang@apple.com>
AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
https://bugs.webkit.org/show_bug.cgi?id=186697
Reviewed by Darin Adler.
Now that web process doesn't have access to NSScreen. The conversion of the
rects is wrong. Fixed this by using the right function that's available in
WebCore to convert the rects.
* editing/mac/FrameSelectionMac.mm:
(WebCore::accessibilityConvertScreenRect):
2018-06-18 Youenn Fablet <youenn@apple.com>
Validate Cross-Origin-Resource-Policy for resources cached in the MemoryCache
https://bugs.webkit.org/show_bug.cgi?id=186639
<rdar://problem/41106984>
Reviewed by Geoffrey Garen.
Add a method to check CORP.
Make use of it to validate any memory cached resource.
Whitelist CORP header so that it is not filtered out by Network Process.
Test: http/wpt/cross-origin-resource-policy/image-in-iframe-loads.html
* loader/CrossOriginAccessControl.cpp:
(WebCore::shouldCrossOriginResourcePolicyCancelLoad):
(WebCore::validateCrossOriginResourcePolicy):
* loader/CrossOriginAccessControl.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* platform/network/ResourceResponseBase.cpp:
(WebCore::isSafeRedirectionResponseHeader):
(WebCore::isSafeCrossOriginResponseHeader):
2018-06-18 Carlos Alberto Lopez Perez <clopez@igalia.com>
[WTF] Remove workarounds needed to support libstdc++-4
https://bugs.webkit.org/show_bug.cgi?id=186762
Reviewed by Michael Catanzaro.
Revert r226299, r226300 r226301 and r226302.
No new tests, no change in behaviour.
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::FontSelectionValue::clampFloat):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const):
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem):
2018-06-18 Karl Leplat <karl.leplat_ext@softathome.com>
[Threaded paintingEngine] Fix rendering glitches
https://bugs.webkit.org/show_bug.cgi?id=186764
Reviewed by Žan Doberšek.
* platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp:
(Nicosia::PaintingEngineBasic::paint):
To keep backwards compatibility with no multi-threaded,
we call Nicosia::Buffer functions beginPainting() and completePainting().
2018-06-18 Tomas Popela <tpopela@redhat.com>
Properly check the sscanf return valua
https://bugs.webkit.org/show_bug.cgi?id=186757
Reviewed by Carlos Garcia Campos.
Check if we matched anything and if we matched the expected amount of
data.
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::cpuPeriod):
2018-06-18 Tomas Popela <tpopela@redhat.com>
[GTK] Wrong variable used in RenderThemeGtk
https://bugs.webkit.org/show_bug.cgi?id=186756
Reviewed by Carlos Garcia Campos.
Use SliderThumbHorizontalPart instead of SliderHorizontalPart.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustSliderThumbSize const):
2018-06-18 Philippe Normand <pnormand@igalia.com>
[GStreamer] Crash when adding in-band text track with playbin3 enabled
https://bugs.webkit.org/show_bug.cgi?id=186654
Reviewed by Xabier Rodriguez-Calvar.
Text track indexes should be relative to the total amount of
in-band text tracks. The previous code would induce the creation
of in-band text tracks with indexes relative to the total amount
of all in-band (audio, video, text) tracks.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2018-06-17 Zalan Bujtas <zalan@apple.com>
Anonymous block collapsing can destroy the renderer's parent.
https://bugs.webkit.org/show_bug.cgi?id=186655
<rdar://problem/41157554>
Reviewed by Antti Koivisto.
While destroying a chain of renderers (text renderer -> first letter renderer), we need to
check if the anonymous block collapsing destroyed the parent renderer (see webkit.org/b/186746).
Test: fast/text/first-letter-with-anon-wrapper-crash.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
2018-06-17 Wenson Hsieh <wenson_hsieh@apple.com>
[WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
https://bugs.webkit.org/show_bug.cgi?id=186442
<rdar://problem/40879364>
Reviewed by Darin Adler.
Rename references to "Extra zoom mode". No change in behavior.
* page/DisabledAdaptations.cpp:
(WebCore::watchAdaptationName):
(WebCore::extraZoomModeAdaptationName): Deleted.
* page/DisabledAdaptations.h:
* page/ViewportConfiguration.cpp:
(WebCore::needsUpdateAfterChangingDisabledAdaptations):
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
* testing/Internals.cpp:
(WebCore::Internals::extraZoomModeAdaptationName const): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-06-17 Youenn Fablet <youenn@apple.com>
Rename Document::hasHadActiveMediaStreamTrack to Document::hasHadCaptureMediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=186743
rdar://problem/41151193
Reviewed by Eric Carlson.
Covered by existing tests.
Rename setter and getter to be more accurate.
Move the place to call the setter to when creating a capture stream.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start):
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::statusDidChange):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::mediaStreamIsReady):
* dom/Document.h:
(WebCore::Document::setHasCaptureMediaStreamTrack):
(WebCore::Document::hasHadCaptureMediaStreamTrack const):
(WebCore::Document::setHasActiveMediaStreamTrack): Deleted.
(WebCore::Document::hasHadActiveMediaStreamTrack const): Deleted.
2018-06-17 Zalan Bujtas <zalan@apple.com>
[LFC] DisplayBox API should be more clear about height/width vs. contentBoxHeight/width
https://bugs.webkit.org/show_bug.cgi?id=186744
Reviewed by Antti Koivisto.
Display::Box::height/width -> border box size.
Display::Box::contentBoxHeight/width -> content box size.
Display::Box::top/left/bottom/right -> border box position in the containing box's coordinate system.
Display::Box::marginBox/borderBox/paddingBox/contentBox -> relative to border box (border box is { 0, 0 })
(This patch also removes the box-sizing logic from Display::Box. FormattingContext::Geometry should set the
correct contentBoxSize/borderBoxSize based on the CSS property.)
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(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.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin 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):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::top const):
(WebCore::Display::Box::left const):
(WebCore::Display::Box::bottom const):
(WebCore::Display::Box::right const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::bottomRight const):
(WebCore::Display::Box::size const):
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::rect const):
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::moveHorizontally):
(WebCore::Display::Box::moveVertically):
(WebCore::Display::Box::setHasValidContentHeight):
(WebCore::Display::Box::setHasValidContentWidth):
(WebCore::Display::Box::setContentBoxHeight):
(WebCore::Display::Box::setContentBoxWidth):
(WebCore::Display::Box::contentBoxHeight const):
(WebCore::Display::Box::contentBoxWidth const):
(WebCore::Display::Box::setWidth): Deleted.
(WebCore::Display::Box::setHeight): Deleted.
(WebCore::Display::Box::setSize): Deleted.
2018-06-17 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[GTK] Correct behavior for dark themes
https://bugs.webkit.org/show_bug.cgi?id=186219
Reviewed by Michael Catanzaro.
Override RenderThemeGtk::isControlStyled() to not style
text inputs if color is set different than default.
No new tests. Manual theme test and existing layout tests already cover it.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::isControlStyled const):
* rendering/RenderThemeGtk.h:
2018-06-12 Darin Adler <darin@apple.com>
[Cocoa] Make some RetainPtr refinements to get more ready for ARC
https://bugs.webkit.org/show_bug.cgi?id=186526
Reviewed by Anders Carlsson.
* platform/ios/UserAgentIOS.mm:
(WebCore::deviceNameForUserAgent): Drop unnecessary use of RetainPtr.
* platform/mac/URLMac.mm:
(WebCore::URL::operator NSURL * const): Use bridgingAutorelease.
2018-06-16 Chris Dumez <cdumez@apple.com>
Better pack ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=186718
Reviewed by Simon Fraser.
Better pack ResourceResponse to reduce its size on Mac from 632 to 616 bytes.
* platform/network/ResourceResponseBase.h:
2018-06-15 Chris Dumez <cdumez@apple.com>
Better pack MediaQuery
https://bugs.webkit.org/show_bug.cgi?id=186716
Reviewed by Simon Fraser.
Better pack MediaQuery to reduce its size from 48 bytes to 40 and save
some memory.
* css/MediaQuery.cpp:
(WebCore::MediaQuery::MediaQuery):
* css/MediaQuery.h:
2018-06-15 Chris Dumez <cdumez@apple.com>
StyleRuleMedia wastes 158KB of Vector capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=186705
<rdar://problem/41173637>
Reviewed by Simon Fraser.
Call shrinkToFit on RefPtr<StyleRuleBase> vectors in CSSParserImpl, after we're
done parsing and before constructing StyleRuleMedia, StyleRuleSupports and
deferred rules in StyleRuleGroup.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseDeferredRuleList):
(WebCore::CSSParserImpl::consumeMediaRule):
(WebCore::CSSParserImpl::consumeSupportsRule):
2018-06-15 Chris Dumez <cdumez@apple.com>
MediaQuerySet wastes a lot of vector capacity
https://bugs.webkit.org/show_bug.cgi?id=186696
<rdar://problem/41172850>
Reviewed by Simon Fraser.
Call shrinkToFit() on the MediaQuerySet after we're done parsing it
to avoid wasting memory.
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::parseInternal):
2018-06-15 Chris Dumez <cdumez@apple.com>
CachedRawResource wastes 57K of Vector capacity
https://bugs.webkit.org/show_bug.cgi?id=186703
<rdar://problem/41173515>
Reviewed by Simon Fraser.
Use 0 as minimum capacity for CachedRawResource::m_redirectChain, instead of the
default value of 16. m_redirectChain usually contains very few items so 16 is
wasteful, especially considering that m_redirectChain contains fairly large
objects (std::pair<ResourceRequest, ResourceResponse>). CachedRawResource are
stored in the memory cache so it is important to not use more memory than
necessary.
We are also not worried about the performance cost of allocations here since
this vector is only populated on HTTP redirects.
* loader/cache/CachedRawResource.h:
2018-06-15 Antti Koivisto <antti@apple.com>
Semantic colors should not be transformed by color-filter
https://bugs.webkit.org/show_bug.cgi?id=186566
<rdar://problem/40705739>
Reviewed by Simon Fraser.
Test: css3/color-filters/color-filter-ignore-semantic.html
* platform/graphics/Color.h:
(WebCore::Color::Color):
(WebCore::Color::isSemantic const):
(WebCore::Color::setIsSemantic):
Add a bit to Color to indicate it originated from a semantic color name.
Note that a color compares unequal to the semantic version of the same color.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
(WebCore::semanticColorFromNSColor):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
Set the bit for semantic system colors.
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
Fix up the output to avoid unneccary render tree dump changes.
2018-06-15 Chris Dumez <cdumez@apple.com>
Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
https://bugs.webkit.org/show_bug.cgi?id=186681
Reviewed by Brady Eidson.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::RegistrationDatabase):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationDatabase.h:
Rename m_session to m_sessionID for clarity.
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::~RegistrationStore):
Drop bad assertion now that the RegistrationDatabase is refcounted
and can outlive the RegistrationStore. The RegistrationDatabase will
take care of closing / destroying the SQLiteDatabase on the background
thread when destroyed.
2018-06-15 Timothy Hatcher <timothy@apple.com>
REGRESSION (r232799): Form controls are blank in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=186677
rdar://problem/41162899
Reviewed by Wenson Hsieh.
* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
Dark mode controls don't have borders, just a semi-transparent background of shadows.
In the dark mode case we can't disable borders, or we will not paint anything for the control.
2018-06-15 Zalan Bujtas <zalan@apple.com>
[LFC] Fix static position left/top
https://bugs.webkit.org/show_bug.cgi?id=186640
Reviewed by Antti Koivisto.
In visual formatting model, we normally go like [top, left] while LayoutPoint takes [x, y]. Let's make this less error prone.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2018-06-15 Chris Dumez <cdumez@apple.com>
Crash under WebCore::SWServer::registrationStoreImportComplete()
https://bugs.webkit.org/show_bug.cgi?id=186644
<rdar://problem/40982257>
Reviewed by Brady Eidson.
Fix lifetime management issues with RegistrationDatabase. RegistrationDatabase
was previously subclassing CrossThreadTaskHandler. CrossThreadTaskHandler
currently is not safe for objects that can get destroyed (such as
RegistrationDatabase). This is because it does not keep the object alive
when going to the background thread or back to the main thread. This would
cause crashes such as the one in the radar.
To address the issue, stop subclassing CrossThreadTaskHandler and use a
simple WorkQueue instead. RegistrationDatabase is now ThreadSafeRefCounted
and we take care of ref'ing it whenever we dispatch a task to the work queue
or back to the main thread. Because the RegistrationDatabase can now outlive
the RegistrationStore, m_store is now a WeakPtr.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::RegistrationDatabase):
(WebCore::RegistrationDatabase::~RegistrationDatabase):
(WebCore::RegistrationDatabase::postTaskToWorkQueue):
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::importRecordsIfNecessary):
(WebCore::RegistrationDatabase::pushChanges):
(WebCore::RegistrationDatabase::clearAll):
(WebCore::RegistrationDatabase::importRecords):
(WebCore::RegistrationDatabase::addRegistrationToStore):
(WebCore::RegistrationDatabase::databaseFailedToOpen):
(WebCore::RegistrationDatabase::databaseOpenedAndRecordsImported):
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::create):
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::RegistrationStore):
(WebCore::RegistrationStore::~RegistrationStore):
(WebCore::RegistrationStore::pushChangesToDatabase):
(WebCore::RegistrationStore::clearAll):
* workers/service/server/RegistrationStore.h:
2018-06-15 Zalan Bujtas <zalan@apple.com>
[LFC] Align compute functions styles.
https://bugs.webkit.org/show_bug.cgi?id=186649
Reviewed by Antti Koivisto.
Improve code readability.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
(WebCore::Layout::computedValueIfNotAuto): Deleted.
* 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):
2018-06-15 Zalan Bujtas <zalan@apple.com>
[LFC] Add FormattingContextLayout logging channel
https://bugs.webkit.org/show_bug.cgi?id=186637
Reviewed by Antti Koivisto.
Add some basic layout logging (-WebCoreLogging "FormattingContextLayout").
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::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::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
(WebCore::Layout::verifyAndOutputSubtree):
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* 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):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::TreeBuilder::showLayoutTree):
(WebCore::Layout::printLayoutTreeForLiveDocuments):
* layout/layouttree/LayoutTreeBuilder.h:
* platform/Logging.h:
2018-06-15 Antoine Quint <graouts@apple.com>
[Web Animations] CSS Animations should take precedence over CSS Transitions
https://bugs.webkit.org/show_bug.cgi?id=186651
Reviewed by Dean Jackson.
Ensure CSS Animations override CSS Transitions by modifying the order in which animations are returned by animationsForElement().
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationsForElement const):
2018-06-14 Youenn Fablet <youenn@apple.com>
Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
https://bugs.webkit.org/show_bug.cgi?id=186166
Reviewed by Alex Christensen.
Covered by existing tests.
* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::cacheStorageDirectory const): Deleted.
(WebCore::NetworkStorageSession::setCacheStorageDirectory): Deleted.
(WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const): Deleted.
(WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota): Deleted.
2018-06-14 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r232823.
This caused both test timeouts and api failures.
Reverted changeset:
"[Mail] Use the Mail Viewer width as the base for resolving
horizontal viewport units"
https://bugs.webkit.org/show_bug.cgi?id=186585
https://trac.webkit.org/changeset/232823
2018-06-14 Nan Wang <n_wang@apple.com>
AX: Crash in AccessibilityNodeObject::textUnderElement(WebCore::AccessibilityTextUnderElementMode) const + 536
https://bugs.webkit.org/show_bug.cgi?id=186629
Reviewed by Chris Fleizach.
This crashed when we passed a null node to ancestorsOfType. Fixed it
by adding a null check.
Test: accessibility/hidden-object-text-value-crash.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):
2018-06-14 Timothy Hatcher <timothy@apple.com>
Expose more semantic system colors.
https://bugs.webkit.org/show_bug.cgi?id=186609
rdar://problem/39287277
Reviewed by Tim Horton.
Add the following semantic colors:
-apple-system-control-accent
-apple-system-even-alternating-content-background
-apple-system-odd-alternating-content-background
-apple-system-selected-content-background
-apple-system-unemphasized-selected-content-background
-apple-system-selected-text
-apple-system-unemphasized-selected-text
-apple-system-selected-text-background
-apple-system-unemphasized-selected-text-background
-apple-system-placeholder-text
-apple-system-find-highlight-background
-apple-system-separator
* css/CSSValueKeywords.in:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
2018-06-14 Eric Carlson <eric.carlson@apple.com>
[iOS] WebAVPlayerController isPlayingOnSecondScreen should be declared read-write
https://bugs.webkit.org/show_bug.cgi?id=186621
<rdar://problem/40243303>
Reviewed by Jer Noble.
* platform/ios/WebAVPlayerController.h:
2018-06-13 Zalan Bujtas <zalan@apple.com>
[LFC] Miscellaneous fixes to be able to layout <div> with fixed width/height
https://bugs.webkit.org/show_bug.cgi?id=186616
Reviewed by Antti Koivisto.
1. Move box horizontally/vertically when relevant margin is computed.
2. Fix isStretchedToViewport() logic and make sure that the width/height is adjusted with the margin when the box is stretchy.
3. Fix isPaddingApplicable() and add "GenericElement" for elements that don't need special handling.
With this patch LFC produces the correct geometry for the following content:
<html><body><div style="width: 100px; height: 100px;"></div></body></html>
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::isStretchedToViewport):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::moveHorizontally):
(WebCore::Display::Box::moveVertically):
(WebCore::Display::Box::Rect::setWidth):
(WebCore::Display::Box::Rect::setHeight):
(WebCore::Display::Box::Rect::moveHorizontally):
(WebCore::Display::Box::Rect::moveVertically):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isPaddingApplicable const):
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-06-13 Chris Dumez <cdumez@apple.com>
Crash under SWServer::unregisterConnection(Connection&)
https://bugs.webkit.org/show_bug.cgi?id=186584
<rdar://problem/40931680>
Reviewed by Youenn Fablet.
The crash was due to SWServer::Connection objects outliving their SWServer, even
though SWServer::Connection::m_server is a C++ reference. This was possible because
SWServer does not own the connections, StorageToWebProcessConnection does. This
started crashing recently, after r232423, because SWServer can get destroyed now.
The SWServer might get destroyed before the StorageToWebProcessConnection, in which
case the SWServer::Connection objects will get destroyed later. We were crashing
because the SWServer::Connection destructor tries to unregister the connection from
the SWServer (which is dead).
To address the issue, the SWServer now owns the connections. StorageToWebProcessConnection
merely has weak pointers to the connections.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::Connection):
(WebCore::SWServer::addConnection):
(WebCore::SWServer::removeConnection):
(WebCore::SWServer::resolveRegistrationReadyRequests):
* workers/service/server/SWServer.h:
(WebCore::SWServer::Connection::~Connection):
(WebCore::SWServer::Connection::server):
(WebCore::SWServer::connection):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::forEachConnection):
(WebCore::SWServerRegistration::notifyClientsOfControllerChange):
(WebCore::SWServerRegistration::controlClient):
2018-06-13 Zalan Bujtas <zalan@apple.com>
[Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
https://bugs.webkit.org/show_bug.cgi?id=186585
<rdar://problem/30685325>
Reviewed by Tim Horton.
Use the existing "override viewport size for viewport units" mechanism to compute the preferred
viewport unit values for the Mail Viewer html content.
Test: fast/dynamic/mail-autosize-viewport-unit.html
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::enableAutoSizeMode):
(WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
(WebCore::FrameView::overrideViewportSizeForCSSViewportUnits):
(WebCore::FrameView::viewportSizeForCSSViewportUnits const):
* page/FrameView.h:
2018-06-13 Dean Jackson <dino@apple.com>
Disable AR support in WKWebView clients
https://bugs.webkit.org/show_bug.cgi?id=186611
<rdar://problem/39544684>
Reviewed by Jon Lee.
Since it hasn't been adequately tested, System Preview (AR) should
be disabled by default for WKWebViews.
Add a new RuntimeEnabledFeature to control this, and guard for
this case everywhere we use system previews.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isSystemPreviewImage const):
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::isSystemPreviewImage const):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled):
(WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
2018-06-13 Youenn Fablet <youenn@apple.com>
Supported plugin check should be based on plugin identifier
https://bugs.webkit.org/show_bug.cgi?id=186578
<rdar://problem/40523828>
Reviewed by Darin Adler.
Rename SupportedPluginName in SupportedPluginIdentifier.
Add cross-platform support for plug-in identifier.
Update built-in PDF plug-in to check its identifier instead of its name.
This is stronger as the name may change according localization.
* loader/EmptyClients.cpp:
* plugins/PluginData.cpp:
(WebCore::isBuiltInPDFPlugIn):
(WebCore::PluginData::initPlugins):
* plugins/PluginData.h:
(WebCore::operator==):
(WebCore::isSupportedPlugin):
(WebCore::SupportedPluginIdentifier::decode):
(WebCore::SupportedPluginIdentifier::encode const):
(WebCore::SupportedPluginName::decode): Deleted.
(WebCore::SupportedPluginName::encode const): Deleted.
* plugins/PluginInfoProvider.h:
2018-06-13 Chris Dumez <cdumez@apple.com>
PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
https://bugs.webkit.org/show_bug.cgi?id=186545
Reviewed by Brady Eidson.
Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
This information was previously logged in DocumentLoader::willSendRequest() and was getting
sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
DocumentLoader::willSendRequest()).
This is more efficient and will also be needed soon due to the way process swap on navigation
deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
the load and started a new load to the redirected to URL in the new WebProcess. As a result,
the new WebProcess is not aware that the load is a redirect, which is information that ITP
requires. By moving the ITP logging to the UIProcess, we still have access to this
information.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
Stop logging the navigation now that it is logged in the UIProcess.
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:
We now pass the full redirect request to the decidePolicyForNavigationAction
delegate instead of a simple isRedirect boolean, so that we have the redirect
response URL in the UIProcess for ITP logging.
* loader/ResourceLoadObserver.cpp:
(WebCore::areDomainsAssociated):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::areDomainsAssociated):
(WebCore::ResourceLoadStatistics::reduceTimeResolution):
* loader/ResourceLoadStatistics.h:
- Remove ResourceLoadObserver::logFrameNavigation() now that it is on the WebResourceLoadStatisticsStore.
- Move some code from ResourceLoadObserver to ResourceLoadStatistics so that it can
be called from the UIProcess and to avoid code duplication.
2018-06-13 Mark Lam <mark.lam@apple.com>
FloatingPointEnvironment is only needed for ARM CPUs.
https://bugs.webkit.org/show_bug.cgi?id=186567
<rdar://problem/40929441>
Reviewed by Michael Saboff.
No new tests. This behavior is already covered by existing tests.
* platform/ios/wak/FloatingPointEnvironment.cpp:
* platform/ios/wak/FloatingPointEnvironment.h:
(WebCore::FloatingPointEnvironment::enableDenormalSupport):
(WebCore::FloatingPointEnvironment::saveMainThreadEnvironment):
(WebCore::FloatingPointEnvironment::propagateMainThreadEnvironment):
(WebCore::FloatingPointEnvironment::singleton):
2018-06-13 Timothy Hatcher <timothy@apple.com>
Input form controls have a white background in dark mode, when they should not.
https://bugs.webkit.org/show_bug.cgi?id=186577
rdar://problem/39258325
Reviewed by Tim Horton.
* DerivedSources.make: Allow WTF_PLATFORM_MAC ifdefs to preprocess in html.css.
* css/CSSValueKeywords.in: Added -apple-system-control-background.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Allow dark mode media query in user agent stylesheets.
(WebCore::isFeatureValidWithoutValue): Ditto.
* css/MediaQueryParserContext.cpp:
(WebCore::MediaQueryParserContext::MediaQueryParserContext): Transfer the CSSParserMode from CSSParserContext.
* css/MediaQueryParserContext.h:
* css/html.css: Set color and background-color to semantic colors for input, textarea, and select.
Make input background-color transparent in dark mode to match AppKit.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Added -apple-system-control-background.
(WebCore::RenderThemeMac::paintTextField): Adjust the drawing rect to match new artwork in macOS 10.14.
2018-06-13 Said Abou-Hallawa <sabouhallawa@apple.com>
TileFirstPaint strategy for async image decoding should be disabled for non root RenderLayers
https://bugs.webkit.org/show_bug.cgi?id=186336
<rdar://problem/40808099>
Reviewed by Simon Fraser.
When showing a composited RenderLayer for the first time, the images in
this layer have to be decoded synchronously to avoid unwanted flashing.
To create a layout test for this patch, FrameDecodingDurationForTesting
needs to be generalized for large and animated images. The decoding thread
now forces the decoding time to be at least equal to
FrameDecodingDurationForTesting.
Test: fast/images/async-image-composited-show.html
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages const):
(WebCore::BitmapImage::internalStartAnimation):
(WebCore::BitmapImage::advanceAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::startAsyncDecodingQueue):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::setFrameDecodingDurationForTesting):
(WebCore::ImageSource::frameDecodingDurationForTesting const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
2018-06-13 Wenson Hsieh <wenson_hsieh@apple.com>
CSS "background-color" style no longer affects natively rendered text fields
https://bugs.webkit.org/show_bug.cgi?id=186597
<rdar://problem/41050528>
Reviewed by Tim Horton.
AppKit currently does not support rendering background color to the edges of a text field cell. This means that
in WebCore, when natively rendering text inputs with background color, we need to only draw the bezels of a text
field, such that the background color we paint behind the text field will be shown. Currently, the way we
accomplish this is by intercepting an internal NSTextField method that computes drawing options for CoreUI, and
inserting a `"borders only" => true` entry.
However, in a recent build of macOS Mojave, AppKit tweaked -_coreUIDrawOptionsWithFrame:inView:includeFocus: to
add an extra argument (such that it's now -_coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:), which
negates the above workaround. To fix this in the short term, augment the workaround to apply to the latest macOS
Mojave as well. A longer-term fix is already tracked in <rdar://problem/11385461>, which would allow WebKit to
simply specify a background color on the text field cell, and have AppKit render it properly to the edges of the
bezels.
Covered by a test that is currently failing on Mojave: fast/forms/hidpi-textfield-background-bleeding.html
* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
(-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
(-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:]):
2018-06-13 Thibault Saunier <tsaunier@igalia.com>
[WPE] Build getUserMedia support
https://bugs.webkit.org/show_bug.cgi?id=186547
Reviewed by Alejandro G. Castro.
Enable mediastream tests.
* PlatformWPE.cmake: Build MediaStream support.
* SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake.
* SourcesWPE.txt: Removed `platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp`
which is now in GStreamer.cmake.
* platform/GStreamer.cmake: Build more MediaStream/webrtc related files.
* platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is
now built directly into the Cairo backend and not GTK anymore.
* platform/graphics/cairo/ImageBufferCairo.cpp: Implement `toBGRAData`
* platform/graphics/gtk/ImageBufferGtk.cpp: Removed `toBGRAData` as it is
now implemented in the Cairo backend itself.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an
ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making
test fail when built in RELEASE mode.
(WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it
more accurate.
(WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element
before setting its chain function, making things clearer.
(WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line.
2018-06-13 Philippe Normand <pnormand@igalia.com>
[GStreamer] fast/canvas/webgl crashes
https://bugs.webkit.org/show_bug.cgi?id=186590
Reviewed by Carlos Alberto Lopez Perez.
After r232747 the sample managed by the player can be empty,
without buffer. So we need to check for this before mapping video
frames. Also use the GstVideoFrameHolder in more places to reduce
copy-paste churn.
* platform/graphics/gstreamer/ImageGStreamer.h:
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(ImageGStreamer::ImageGStreamer):
(ImageGStreamer::~ImageGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2018-06-13 Philippe Normand <pnormand@igalia.com>
Unreviewed GTK build fix for --cmakeargs=-DUSE_GSTREAMER_GL=OFF
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2018-06-12 Philippe Normand <pnormand@igalia.com>
[GStreamer] Video freezes when GStreamerGL is not installed
https://bugs.webkit.org/show_bug.cgi?id=184925
Reviewed by Žan Doberšek.
At runtime when the GStreamer opengl plugin isn't available the
player will fallback to the internal WebKit video sink. The
VideoFrameHolder was refactored to handle both cases (opengl,
non-opengl).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::~GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::frame const):
(WebCore::GstVideoFrameHolder::updateTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::GstVideoFrameHolder::isValid const): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2018-06-12 Zalan Bujtas <zalan@apple.com>
Complex text handling should opt out of bounded text layout.
https://bugs.webkit.org/show_bug.cgi?id=186571
<rdar://problem/41060908>
Reviewed by Tim Horton.
Test: fast/text/complex-long-text-crash.html
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-06-12 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r232774.
Breaks internal builds.
Reverted changeset:
"Complex text handling should opt out of bounded text layout."
https://bugs.webkit.org/show_bug.cgi?id=186571
https://trac.webkit.org/changeset/232774
2018-06-12 Ryosuke Niwa <rniwa@webkit.org>
iOS WK1: Occasional crash in FrameView::setScrollPosition
https://bugs.webkit.org/show_bug.cgi?id=186575
Reviewed by David Kilzer.
The bug was caused by ScrollView::platformSetScrollPosition releasing the web thread lock
and DumpRenderTree requesting a new page load thereby destroying FrameView.
Fixed the crash by keeping FrameView alive while scrollToFocusedElementTimerFired is getting called.
No new tests since the bug is caught by existing layout tests under guard malloc.
* page/FrameView.cpp:
(WebCore::FrameView::scrollToFocusedElementTimerFired):
2018-06-12 Zalan Bujtas <zalan@apple.com>
Complex text handling should opt out of bounded text layout.
https://bugs.webkit.org/show_bug.cgi?id=186571
<rdar://problem/40801429>
Reviewed by Tim Horton.
Test: fast/text/complex-long-text-crash.html
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-06-12 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the Windows build after r232757
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
2018-06-12 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION(r228724): Occasional crash when executing ReplaceSelectionCommand at the end of the document
https://bugs.webkit.org/show_bug.cgi?id=186555
<rdar://problem/39703004>
Reviewed by Ryosuke Niwa.
r228724 removed a null check for m_lastNodeInserted in InsertedNodes::pastLastLeaf(). This null check was
guarding against the case where m_firstNodeInserted might exist, but m_lastNodeInserted is null, which may
happen when inserting content at the end of the document, since InsertedNodes::willRemoveNodePreservingChildren
may cause m_lastNodeInserted to be null. This is because the removed node may be at the very end of the document
_and also_ not have any children, which means that both `node->lastChild()` as well as
`NodeTraversal::nextSkippingChildren(*node)` will be null.
After getting into this state, we subsequently crash when attempting to compute InsertedNodes::pastLastLeaf().
To fix this, avoid accidentally clearing out m_lastNodeInserted; if the last inserted node has neither a child
nor a next node, seek backwards to the previous node in the DOM instead, and clamp to the first inserted node,
such that the last inserted node's document position is at or after the first inserted node's position.
Test: editing/execCommand/insert-apple-style-span-at-document-end.html
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
2018-06-12 Jianjun Zhu <jianjun.zhu@intel.com>
Hash deviceId and groupId of MediaTrackCapabilities.
https://bugs.webkit.org/show_bug.cgi?id=186471
Reviewed by Eric Carlson.
This change makes the identifier for the source of the MediaStreamTrack
has the same value returned by enumerateDevices(). It also prevents real
device ID being leaked.
(WebCore::MediaStreamTrack::getCapabilities const):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
2018-06-12 Philippe Normand <pnormand@igalia.com>
Unreviewed WPE build fix after r232749.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2018-06-12 Zalan Bujtas <zalan@apple.com>
[LFC] Add vertical margin computation for inflow non-replaced box and for the (10.6.6) complicated cases.
https://bugs.webkit.org/show_bug.cgi?id=186469
Reviewed by Antti Koivisto.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-06-12 Philippe Normand <pnormand@igalia.com>
[GStreamer] Bump required version to 1.8.3
https://bugs.webkit.org/show_bug.cgi?id=186558
Reviewed by Xabier Rodriguez-Calvar.
* platform/GStreamer.cmake: Remove useless file.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcChangeState): Remove useless version check.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
Removed. createDecryptor() is dead code since the decryptors moved
to the MSE playback pipeline.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::GStreamerEMEUtilities::keySystemToUuid):
2018-06-11 Philippe Normand <philn@igalia.com>
[GStreamer] flush video sample upon DRAIN query
https://bugs.webkit.org/show_bug.cgi?id=186481
Reviewed by Xabier Rodriguez-Calvar.
Use the appsink sink pad pad probe for both event and drain query
management. This patch is partially based on
https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d3a336523d123119fe1dd53da5d9006c92cf078c
by Enrique Ocaña González <eocanha@igalia.com>.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2018-06-11 Zalan Bujtas <zalan@apple.com>
[LFC] Replace HorizontalGeometry::width and margin with WidthAndMargin (Vertical too)
https://bugs.webkit.org/show_bug.cgi?id=186556
Reviewed by Sam Weinig.
HorizontalGeometry::width and margin -> WidthAndMargin
VerticalGeometry::height and margin -> HeightAndMargin
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* 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::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2018-06-11 Youenn Fablet <youenn@apple.com>
Improve error messages in case FetchEvent.respondWith has a rejected promise
https://bugs.webkit.org/show_bug.cgi?id=186368
Reviewed by Chris Dumez.
Covered by rebased tests.
Introduce a new error domain for service worker ResourceError.
Used this domain to log in the console any such error.
Update FetchEvent implementation to get meaningful error messages for respondWith error cases.
In particular, convert the rejected promise JS value as a string to populate the error message.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
* platform/network/ResourceErrorBase.cpp:
* platform/network/ResourceErrorBase.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::~FetchEvent):
(WebCore::FetchEvent::createResponseError):
(WebCore::FetchEvent::onResponse):
(WebCore::FetchEvent::respondWithError):
(WebCore::FetchEvent::processResponse):
(WebCore::FetchEvent::promiseIsSettled):
* workers/service/FetchEvent.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
2018-06-11 Chris Dumez <cdumez@apple.com>
http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
https://bugs.webkit.org/show_bug.cgi?id=186546
Reviewed by Brady Eidson.
Add a hasOpenedFrames flag to NavigationAction, which we'll use in the UIProcess when deciding
to process swap on navigation or not.
Test: http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::hasOpenedFrames const):
(WebCore::NavigationAction::setHasOpenedFrames):
2018-06-11 Tim Horton <timothy_horton@apple.com>
Link drag image is inconsistently unreadable in dark mode
https://bugs.webkit.org/show_bug.cgi?id=186472
Reviewed by Timothy Hatcher.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
Use LocalDefaultSystemAppearance so that NSColors used inside
createDragImageForLink are interpreted correctly. This function
always follows the system appearance regardless of what the preference
is set to, because it's generating UI that isn't part of the page.
Use controlBackgroundColor to get a consistently contrasting background
for the link drag image.
2018-06-11 Chris Dumez <cdumez@apple.com>
http/tests/security/cors-post-redirect-307.html fails with PSON enabled
https://bugs.webkit.org/show_bug.cgi?id=186441
Reviewed by Brady Eidson.
When we are continuing a load in a new process, we currently bypass the navigation policy
check. We now also bypass the adding of headers such as the Origin one since the request
was already processed in the previous process. This is important because in the case of
a cross-origin redirect, the previous process has removed the Origin header from the
request and we do not want the new process to add it again.
Test: http/tests/security/cors-post-redirect-307-pson.html
* WebCore.xcodeproj/project.pbxproj:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setShouldTreatAsContinuingLoad):
(WebCore::FrameLoadRequest::shouldTreatAsContinuingLoad const):
(WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy): Deleted.
(WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::addHTTPOriginIfNeeded):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::loadItem):
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::setDefersLoading):
(WebCore::HistoryController::recursiveGoToItem):
* loader/HistoryController.h:
* loader/ShouldTreatAsContinuingLoad.h: Renamed from Source/WebCore/loader/NavigationPolicyCheck.h.
* page/Page.cpp:
(WebCore::Page::goToItem):
* page/Page.h:
2018-06-11 Youenn Fablet <youenn@apple.com>
Accept request header values should be more tightly checked after r232572 in case of CORS load
https://bugs.webkit.org/show_bug.cgi?id=186533
<rdar://problem/40933880>
Reviewed by Darin Adler.
Covered by updated test.
* platform/network/HTTPParsers.cpp:
(WebCore::isValidAcceptHeaderValue): Checking that Accept header value conforms with RFC7370.
If not, this will trigger preflighting for CORS cross origin loads.
Current checks for Accept-Language and Content-Language are sufficient to ensure values conform with RFC7370.
2018-06-11 Chris Dumez <cdumez@apple.com>
Crash under com.apple.WebKit.Networking at WebCore: WebCore::NetworkStorageSession::hasStorageAccess const
https://bugs.webkit.org/show_bug.cgi?id=186433
<rdar://problem/40750907>
Reviewed by Geoffrey Garen.
Do some hardening in NetworkStorageSession::hasStorageAccess() to make sure
we do not try and do a HashMap lookup with a null firstPartyDomain, as this
would crash.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccess const):
2018-06-11 Zalan Bujtas <zalan@apple.com>
[LFC] Remove redundant position functions for out-of-flow elements
https://bugs.webkit.org/show_bug.cgi?id=186525
Reviewed by Antti Koivisto.
Position is computed as part of the Horizontal/Vertical geometry computation.
(see outOfFlow(Non)ReplacedHorizontalGeometry/outOfFlow(Non)ReplacedVerticalGeometry functions)
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::outOfFlowNonReplacedPosition): Deleted.
(WebCore::Layout::outOfFlowReplacedPosition): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition): Deleted.
2018-06-11 Zalan Bujtas <zalan@apple.com>
[LFC] Merge top, bottom, height and vertical margin computation for out-of-flow replaced elements
https://bugs.webkit.org/show_bug.cgi?id=186524
Reviewed by Antti Koivisto.
Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-height
(10.6.5 Absolutely positioned, replaced elements)
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2018-06-11 Zalan Bujtas <zalan@apple.com>
[LFC] Merge left, right, width and horizontal margin computation for out-of-flow replaced elements
https://bugs.webkit.org/show_bug.cgi?id=186475
Reviewed by Antti Koivisto.
Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-width
(10.3.8 Absolutely positioned, replaced elements)
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::computedValueIfNotAuto):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.
2018-06-11 Zalan Bujtas <zalan@apple.com>
[LFC] Merge left, right, width and horizontal margin computation for out-of-flow non-replaced elements
https://bugs.webkit.org/show_bug.cgi?id=186474
Reviewed by Antti Koivisto.
Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-width
(10.3.7 Absolutely positioned, non-replaced elements)
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.
2018-06-10 Zalan Bujtas <zalan@apple.com>
[LFC] Merge top, bottom, height and vertical margin computation for out-of-flow non-replaced elements
https://bugs.webkit.org/show_bug.cgi?id=186476
Reviewed by Antti Koivisto.
Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-height
(10.6.4 Absolutely positioned, non-replaced elements)
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::computedValueIfNotAuto):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin): Deleted.
2018-06-10 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
https://bugs.webkit.org/show_bug.cgi?id=186192
Reviewed by Michael Catanzaro.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld): Add ExceptionDetails parameter.
* bindings/js/ScriptController.h:
2018-06-10 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] paypal.com requires user agent quirk
https://bugs.webkit.org/show_bug.cgi?id=186466
Reviewed by Carlos Garcia Campos.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2018-06-09 Dan Bernstein <mitz@apple.com>
[Xcode] Clean up and modernize some build setting definitions
https://bugs.webkit.org/show_bug.cgi?id=186463
Reviewed by Sam Weinig.
* Configurations/Base.xcconfig: Removed definition for macOS 10.11.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
* Configurations/Version.xcconfig: Removed definition for macOS 10.11.
* Configurations/WebCore.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
* Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.
2018-06-09 Dan Bernstein <mitz@apple.com>
Added missing file references to the Configuration group.
* WebCore.xcodeproj/project.pbxproj:
2018-06-09 Zalan Bujtas <zalan@apple.com>
REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page
https://bugs.webkit.org/show_bug.cgi?id=186464
<rdar://problem/40369448>
Reviewed by Simon Fraser.
The optimization logic for skipping image layout when we only need overflow computation should check if the image actually needs
simplified layout only. The needsSimplifiedNormalFlowLayout() flag means that the overflow information needs to be updated but
it does not mean that overflow is the only property that we need to recompute.
Test: fast/images/positioned-image-when-transform-is-present.html
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layout):
* rendering/RenderObject.h:
(WebCore::RenderObject::needsSimplifiedNormalFlowLayoutOnly const):
2018-06-09 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(macOS Mojave): move-by-word-visually-multi-line.html fails
https://bugs.webkit.org/show_bug.cgi?id=186454
Reviewed by Darin Adler.
Like r232635, this patch fixes a selection test failure caused by the change in ICU's behavior in macOS Mojave,
which caused isWordTextBreak to return true in more cases.
In this particular failing test case, previousTextOrLineBreakBox and nextTextOrLineBreakBox were failing to find
an inline text box when it found an inline box for a BR, which was mentioned by an existing FIXME comment.
Consequently, visualWordPosition were erroneously detecting the end of a word followed by a blank line created by
a BR as a valid word boundary to move when the Windows editing behavior is enacted.
Addressed the FIXME comment by finding the next inline text box skipping all inline boxes for BRs. Renamed
misleadingly named previousBoxInDifferentBlock and nextBoxInDifferentBlock to previousBoxInDifferentLine and
nextBoxInDifferentLine respectively, and set them to true as they're really indicating whether line boxes
belong to a distinct line or not; whether an inline box belong to two (render) blocks or not is irrelevant.
Finally, this patch fixes a bug in visualWordPosition that it was failing to skip blank lines when a word break is
found as we traversed past a line break. In those cases, we must skip all line breaks before stopping.
Tests: editing/selection/move-by-word-visually-mac.html
editing/selection/move-by-word-visually-multi-line.htm
* editing/VisibleUnits.cpp:
(WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
(WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox):
(WebCore::CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves const):
(WebCore::logicallyPreviousBox):
(WebCore::logicallyNextBox):
(WebCore::wordBreakIteratorForMinOffsetBoundary):
(WebCore::wordBreakIteratorForMaxOffsetBoundary):
(WebCore::visualWordPosition):
2018-06-09 Zalan Bujtas <zalan@apple.com>
[LFC] MarginCollapse functions should be able to resolve non-fixed margin values
https://bugs.webkit.org/show_bug.cgi?id=186461
Reviewed by Antti Koivisto.
We need the containing block's computed width to resolve vertical and horizontal margins.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
(WebCore::Layout::collapsedMarginTopFromFirstChild): Deleted.
(WebCore::Layout::nonCollapsedMarginTop): Deleted.
2018-06-08 Darin Adler <darin@apple.com>
[Cocoa] Remove all uses of NSAutoreleasePool as part of preparation for ARC
https://bugs.webkit.org/show_bug.cgi?id=186436
Reviewed by Anders Carlsson.
* bridge/objc/objc_class.mm: Use import instead of include.
* bridge/objc/objc_instance.h: Replaced _pool member to hold an object with
m_autoreleasePool member to hold a token from objc_autoreleasePoolPush. Also
initialize all data members here in the class definition.
* bridge/objc/objc_instance.mm:
(ObjcInstance::ObjcInstance): Moved most initialization to class definition.
(ObjcInstance::virtualBegin): Use objc_autoreleasePoolPush instead of
NSAutoreleasePool class.
(ObjcInstance::virtualEnd): Use objc_autoreleasePoolPop.
* bridge/objc/objc_runtime.mm: Use import instead of include.
* bridge/objc/objc_utility.mm: Ditto.
* platform/audio/mac/AudioBusMac.mm:
(WebCore::AudioBus::loadPlatformResource): Use @autoreleasepool.
* platform/ios/wak/WebCoreThread.mm: Re-sorted includes. Removed declaration of
autorelease pool SPI and use FoundationSPI.h instead.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformLazyInit): Use @autoreleasepool.
2018-06-08 Wenson Hsieh <wenson_hsieh@apple.com>
[WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=186442
<rdar://problem/40879364>
Reviewed by Tim Horton.
No change in behavior.
* Configurations/FeatureDefines.xcconfig:
* page/DisabledAdaptations.cpp:
(WebCore::extraZoomModeAdaptationName):
2018-06-08 Per Arne Vollan <pvollan@apple.com>
Only display refresh monitors having requested display refresh callback should get notified on screen updates.
https://bugs.webkit.org/show_bug.cgi?id=186397
<rdar://problem/40897835>
Reviewed by Brent Fulgham.
Since all display refresh monitors in the WebContent process share a single UI process display link,
we should make sure that only the monitors having requested callback are getting notified on screen
updates. I have not been able to reproduce a case where a monitor is being notified without having
requested updates, but we should safeguard the code for future code changes.
No new tests, since this is a safeguarding measure.
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::hasRequestedRefreshCallback const):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2018-06-07 Jer Noble <jer.noble@apple.com>
REGRESSION: Cannot listen to audio on Google Translate with side switch set to "vibrate"
https://bugs.webkit.org/show_bug.cgi?id=186415
<rdar://problem/40584651>
Reviewed by Eric Carlson.
Test: platform/mac/media/audio-session-category-audio-autoplay.html
Make sure that the PlatformMediaSession's state has already been set when calling updateSessionStates().
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::setState):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionStateChanged):
2018-06-08 Dean Jackson <dino@apple.com>
'setRenderPipelineState:' is unavailable: not available on iOS
https://bugs.webkit.org/show_bug.cgi?id=186449
<rdar://problem/40880602>
Reviewed by Simon Fraser.
Be more explicit about the protocol type to avoid
the compiler getting confused by a similar signature.
* platform/graphics/cocoa/GPURenderCommandEncoderMetal.mm:
(WebCore::GPURenderCommandEncoder::setRenderPipelineState):
2018-06-08 Darin Adler <darin@apple.com>
Fix iOS build.
* platform/ios/QuickLookSoftLink.mm: Removed QLPreviousScheme, which I said I did in the
change log but looks like it didn't happen.
2018-06-08 Darin Adler <darin@apple.com>
[Cocoa] Make more of our soft linking ARC-compatible
https://bugs.webkit.org/show_bug.cgi?id=186437
Reviewed by Daniel Bates.
* editing/cocoa/DataDetection.mm:
(WebCore::removeResultLinksFromAnchor): Fix comment referring to unused constant DDURLScheme.
* platform/cocoa/DataDetectorsCoreSoftLink.h: Removed unused DDURLScheme.
* platform/cocoa/DataDetectorsCoreSoftLink.mm: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
Use SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
SOFT_LINK_POINTER_OPTIONAL. Required moving iOS-specific items inside the
#if PLATFORM(IOS) section.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use the
canLoad functions instead of checking for null to handle possibly-missing string constants.
(WebCore::metadataType): Ditto.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Removed unused
AVMediaTypeVideo, AVMediaTypeAudio, and AVMediaTypeText soft linking.
* platform/ios/QuickLook.mm:
(WebCore::isQuickLookPreviewURL): Removed unneeded assertion.
* platform/ios/QuickLookSoftLink.h: Removed unneeded QLPreviousScheme, which was used only
for an assertion, one we can do without.
* platform/ios/QuickLookSoftLink.mm: Ditto.
* platform/mediastream/mac/AVVideoCaptureSource.mm: Removed unused soft linking of
AVCaptureVideoPreviewLayer class and AVCaptureSessionPresetLow string constant. Use
SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
SOFT_LINK_POINTER_OPTIONAL.
(WebCore::AVVideoCaptureSource::initializeCapabilities): Use the canLoad functions
instead of checking for null to handle possibly-missing string constants.
(WebCore::sizeForPreset): Ditto.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Ditto.
2018-06-08 Aditya Keerthi <akeerthi@apple.com>
[Datalist] Allow TextFieldInputType to show and hide suggestions
https://bugs.webkit.org/show_bug.cgi?id=186151
Reviewed by Tim Horton.
TextFieldInputTypes with a list attribute should be able to display suggestions as the user
interacts with the input field. In order to display suggestions for an input field with a list
attribute, we need provide certain information - including the items to suggest and the location
to present the suggestions. TextFieldInputType can now provide this information by conforming to
the DataListSuggestionsClient interface.
In this initial patch, the suggestions can be shown in two ways. The first is by clicking on the
input field. The other is by typing text in the field. In a later patch, we will add a third way
to display suggestions, using a button. These ways to activate the suggestions are enumerated in
DataListSuggestionInformation.
We hide the suggestions if there are no more to show, or if the input has blurred.
Tests to be added once work has been done in the UIProcess.
* WebCore.xcodeproj/project.pbxproj:
* html/DataListSuggestionInformation.h: Added. Contains the information necessary to display suggestions.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::~TextFieldInputType):
(WebCore::TextFieldInputType::handleClickEvent): Show suggestions when the element is clicked.
(WebCore::TextFieldInputType::handleKeydownEvent): Allow users to interact with the suggestions using the keyboard.
(WebCore::TextFieldInputType::elementDidBlur): Hide the suggestions.
(WebCore::TextFieldInputType::shouldRespectListAttribute):
(WebCore::TextFieldInputType::didSetValueByUserEdit): Update the suggestions if the text has changed.
(WebCore::TextFieldInputType::elementRectRelativeToRootView const): Provide the location where the suggestions should be shown.
(WebCore::TextFieldInputType::suggestions const): Provide the list of suggestions.
(WebCore::TextFieldInputType::didSelectDataListOption): Update the text once an suggestion has been selected.
(WebCore::TextFieldInputType::didCloseSuggestions):
(WebCore::TextFieldInputType::displaySuggestions):
(WebCore::TextFieldInputType::closeSuggestions):
* html/TextFieldInputType.h:
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::createDataListSuggestionPicker):
* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::createDataListSuggestionPicker):
* page/Chrome.h:
* page/ChromeClient.h:
* platform/DataListSuggestionPicker.h: Added.
(WebCore::DataListSuggestionPicker::close):
(WebCore::DataListSuggestionPicker::handleKeydownWithIdentifier):
(WebCore::DataListSuggestionPicker::displayWithActivationType):
* platform/DataListSuggestionsClient.h: Added.
2018-06-07 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(macOS Mojave): move-by-word-visually-inline-block-positioned-element.html fails
https://bugs.webkit.org/show_bug.cgi?id=186424
Reviewed by Wenson Hsieh.
The test failure is ultimately caused by the change in ICU's behavior. With the CPU in the latest macOS Mojave,
ubrk_getRuleStatus returns 200 / UBRK_WORD_LETTER at the end of a buffer given to UBreakIterator. This caused
isWordTextBreak to return true instead of false in isLogicalStartOfWord at the end of the buffer.
This ICU behavior shouldn't have caused a problem in theory. However, WebKit had a bug in visualWordPosition which
caused UBreakIterator to not include the succeeding word when traversing words to the left (backwards in LTR text)
at the beginning of the last block element with exactly one line box after an non-statically positioned element.
In this case, visualWordPosition invokes wordBreakIteratorForMaxOffsetBoundary (because adjacentCharacterPosition
is now at the end of the last word in the non-statically positioned element) to setup UBreakIterator. Because
there are no line boxes left in the current line (in the last block element with exactly one line box),
logicallyNextBox enters the while loop and invoke nextRootInlineBoxCandidatePosition to find the next root line box.
However, the visible position given to this function is at the beginning of the first word in the block element.
As a result, nextRootInlineBoxCandidatePosition skips over this entire line and finds no line box after the one
we had in the non-statically positioned element.
Let us consider the following concrete example in which a position: static div is followed by another div, and each
div contains text nodes "hello" and "world" respectively:
- div position: static (1)
- "hello"
- div (2)
- "world"
Suppose we're at the offset 0 of "world", and trying to move to the left. In this case, adjacentCharacterPosition is
at offset 5 of "world". The next line box should be that of "world". However, because we invoke logicallyNextBox via
wordBreakIteratorForMaxOffsetBoundary with the visible position at offset 0 of "world", it skips this line and return
nullptr.
This patch addresses this test failure by fixing visualWordPosition by passing adjacentCharacterPosition (at offset 5
of "hello") as the visible position to find the next text box so that nextRootInlineBoxCandidatePosition invoked in
logicallyNextBox would not skip the line ("world") from which we started the traversal to find the next line box.
Tests: editing/selection/move-by-word-visually-inline-block-positioned-element.html
* editing/VisibleUnits.cpp:
(WebCore::visualWordPosition):
2018-06-08 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r230930): Link drag image is very blurry
https://bugs.webkit.org/show_bug.cgi?id=186435
<rdar://problem/40797202>
Reviewed by Tim Horton.
Tell NSImage the proper display scale factor it needs when performing a 'lockFocus' by passing
the correct scaling transform as an NSImageHintCTM.
I reviewed the other drag operations (selection, image, and attachment) and confirmed through
manual testing that these operations already properly scale the images. It appears that links
were the only place where we relied on NSImage to determine and use the relevant device scale
factor.
* SourcesCocoa.txt: Add new WebKitNSImageExtras.mm file.
* WebCore.xcodeproj/project.pbxproj: Update for new files.
* platform/graphics/mac/WebKitNSImageExtras.h: Added.
* platform/graphics/mac/WebKitNSImageExtras.mm: Added.
(-[NSImage _web_lockFocusWithTransform:]): Helper method that takes a device scale factor, creates the
relevant scaling NSAffineTransform and passes it to the internal NSImage 'lockFocusWithRect' as the
NSImageHintCTM hint.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink): Use the new helper function.
2018-06-08 Zalan Bujtas <zalan@apple.com>
[LFC] Add vertical margin computation for inline, block-level, inline-block and floating replaced elements
https://bugs.webkit.org/show_bug.cgi?id=186432
Reviewed by Antti Koivisto.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Use the computed non-auto values when margin is not auto.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2018-06-07 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Add WorkerPool
https://bugs.webkit.org/show_bug.cgi?id=174569
Reviewed by Carlos Garcia Campos.
We start using WorkerPool for NicosiaPaintingEngineThreaded instead of glib thread pool.
This makes NicosiaPaintingEngineThreaded platform-independent and usable for WinCairo.
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
(Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
(Nicosia::PaintingEngineThreaded::paint):
(Nicosia::s_threadFunc): Deleted.
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
2018-06-08 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Wrong result when calling ImageBufferCairo's getImageData()
https://bugs.webkit.org/show_bug.cgi?id=186384
Reviewed by Michael Catanzaro.
Fix calculations so the result is the expected one.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):
2018-06-07 Fujii Hironori <Hironori.Fujii@sony.com>
Add base class to get WeakPtrFactory member and avoid some boilerplate code
https://bugs.webkit.org/show_bug.cgi?id=186407
<rdar://problem/40922716>
Unreviewed WinCairo build fix
MediaPlayerPrivateMediaFoundation.cpp(1726): error C2039: 'makeWeakPtr': is not a member of 'WebCore::MediaPlayerPrivateMediaFoundation'
No new tests (No behavior change).
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
2018-06-07 Chris Dumez <cdumez@apple.com>
Add base class to get WeakPtrFactory member and avoid some boilerplate code
https://bugs.webkit.org/show_bug.cgi?id=186407
Reviewed by Brent Fulgham.
Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
order to avoid some boilerplate code in every class needing a WeakPtrFactory.
This also gets rid of old-style createWeakPtr() methods in favor of the newer
makeWeakPtr().
* Modules/credentialmanagement/CredentialsMessenger.h:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
(WebCore::NavigatorCredentials::credentials):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::doSupportedConfigurationStep):
(WebCore::CDM::getConsentStatus):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/MediaKeys.h:
* Modules/gamepad/GamepadManager.cpp:
(WebCore::GamepadManager::platformGamepadDisconnected):
(WebCore::GamepadManager::makeGamepadVisible):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices):
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/webauthn/cocoa/LocalAuthenticator.h:
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticator::makeCredential):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySVGRoot.cpp:
(WebCore::AccessibilitySVGRoot::setParent):
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::digest):
(WebCore::SubtleCrypto::generateKey):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::exportKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/SubtleCrypto.h:
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::wrapper):
(WebCore::CSSFontFace::setWrapper):
* css/DeprecatedCSSOMValue.h:
* css/FontFace.cpp:
* css/FontFace.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
* css/StyleSheetContents.h:
* css/parser/CSSDeferredParser.cpp:
(WebCore::CSSDeferredParser::CSSDeferredParser):
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::add):
(WebCore::DataTransferItemList::ensureItems const):
(WebCore::DataTransferItemList::didSetStringData):
* dom/DataTransferItemList.h:
* dom/Document.cpp:
(WebCore::Document::postTask):
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
* dom/Document.h:
(WebCore::Document::setContextDocument):
* dom/MessagePort.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setPictureElement):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
* html/HTMLMediaElement.h:
* html/HTMLPictureElement.h:
* html/parser/HTMLResourcePreloader.h:
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::style const):
* loader/FormState.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preconnectIfNeeded):
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.cpp:
(WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
* loader/MediaResourceLoader.h:
* page/DOMWindow.h:
* page/EventHandler.cpp:
(WebCore::widgetForElement):
(WebCore::EventHandler::updateLastScrollbarUnderMouse):
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
* platform/GenericTaskQueue.h:
(WebCore::GenericTaskQueue::enqueueTask):
(WebCore::GenericTaskQueue::cancelAllTasks):
* platform/ScrollView.h:
* platform/ScrollableArea.h:
* platform/Scrollbar.h:
* platform/Widget.cpp:
(WebCore::Widget::setParent):
* platform/Widget.h:
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::decodeAudioForBusCreation):
* platform/audio/mac/AudioHardwareListenerMac.cpp:
(WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
* platform/audio/mac/AudioHardwareListenerMac.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceClearKey::requestLicense):
(WebCore::CDMInstanceClearKey::updateLicense):
(WebCore::CDMInstanceClearKey::loadSession):
(WebCore::CDMInstanceClearKey::closeSession):
(WebCore::CDMInstanceClearKey::removeSessionData):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/FontCascade.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
(WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
* platform/graphics/cv/TextureCacheCV.h:
* platform/graphics/cv/TextureCacheCV.mm:
(WebCore::TextureCacheCV::textureFromImage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
(WebCore::DisplayRefreshMonitorMac::displayLinkFired):
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setMaskLayer):
(WebCore::TextureMapperLayer::setReplicaLayer):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
* platform/mac/RemoteCommandListenerMac.h:
* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::scheduleDeferredTask):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::scheduleDeferredTask):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformManagerOpenVR.cpp:
(WebCore::VRPlatformManagerOpenVR::getVRDisplays):
* rendering/FloatingObjects.h:
(WebCore::FloatingObject::setOriginatingLine):
* rendering/RenderObject.h:
* rendering/RootInlineBox.cpp:
* rendering/RootInlineBox.h:
* svg/SVGPathElement.h:
* svg/SVGPathSegWithContext.h:
(WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
(WebCore::SVGPathSegWithContext::setContextAndRole):
* svg/SVGTransformList.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::baseVal):
(WebCore::SVGAnimatedListPropertyTearOff::animVal):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
* svg/properties/SVGMatrixTearOff.h:
* svg/properties/SVGPropertyTearOff.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::createCDM):
(WebCore::MockCDM::createInstance):
* testing/MockCDMFactory.h:
* workers/service/ExtendableEvent.h:
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::respondWith):
* workers/service/server/SWServer.h:
* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser):
2018-06-07 Chris Dumez <cdumez@apple.com>
PopStateEvent should not be cancelable by default
https://bugs.webkit.org/show_bug.cgi?id=186420
Reviewed by Darin Adler.
PopStateEvent should not be cancelable by default:
- https://github.com/web-platform-tests/wpt/pull/11355
- https://html.spec.whatwg.org/#history-traversal
All other browsers agree with the specification.
No new tests, updated existing tests.
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent):
2018-06-07 Simon Fraser <simon.fraser@apple.com>
Remove a log that was left in by mistake.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
2018-06-07 Antoine Quint <graouts@apple.com>
[ASan / StressGC] DumpRenderTree crashed in com.apple.WebCore: WebCore::EventTarget::ref + 16
https://bugs.webkit.org/show_bug.cgi?id=186207
<rdar://problem/40568747>
Reviewed by Dean Jackson.
Ensure that we clear the DOM event queue for declarative animations once an animation is cleared for
an element since the element can be deleted before events get dispatched asynchronouly for this animation.
We also only call AnimationTimeline::removeAnimationsForElement() from RenderTreeUpdater::tearDownRenderers()
in the case where we're tearing down the whole document as otherwise this would yield early clearing of the event
queue in the case where an element would get a "display: none" style.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimationsForElement):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::~DeclarativeAnimation):
(WebCore::DeclarativeAnimation::prepareAnimationForRemoval):
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::prepareAnimationForRemoval):
* animation/WebAnimation.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-06-07 Don Olmstead <don.olmstead@sony.com>
[CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
https://bugs.webkit.org/show_bug.cgi?id=186374
Reviewed by Žan Doberšek.
No new tests. No change in behavior.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp:
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp:
* platform/PlatformWheelEvent.h:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2018-06-07 Thibault Saunier <tsaunier@igalia.com> and Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Start implementing MediaStream API
https://bugs.webkit.org/show_bug.cgi?id=185787
Reviewed by Philippe Normand.
We are adding all the required classes to make the
MediaStream API work, that means our own RealtimeMediaSourceCenterLibWebRTC
for the platform, the GStreamerCaptureDeviceManager, the audio/video capturers
and their respective audio/video sources as well as a dedicated GStreamer Source
that adds support for using MediaStream stream inside playbin3.
We are using the GstDeviceMonitor to list devices on the devices.
Enable mediastream tests.
* platform/GStreamer.cmake: Added the new files to the compilation.
* platform/audio/AudioStreamDescription.h: Added new GStreamer type.
* platform/audio/PlatformAudioData.h: Added new GStreamer type for
the GStreamerAudioData class.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::simpleBusMessageCallback): This function and the next
one help us to connect a monitoring callback to a pipeline for
debugging.
(WebCore::connectSimpleBusMessageCallback): Ditto.
* platform/graphics/gstreamer/GStreamerCommon.h: Ditto
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Make use of the loadFull() method.
(WebCore::MediaPlayerPrivateGStreamer::loadFull): Very similar to load()
but allows specifying what pipeline type to use (null to let the function determine
which one should be used). This is required as we force to always use playbin3 for the
mediastream source as it relies on the GstStream API.
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Style fix.
(WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Added, use MediaStream specific information if available.
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Some style fixes.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Enhance dotfiles names.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Minor formatting fix.
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Set MediaStream on WebKitMediaStreamSource when setting it up.
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Advertise that we support MediaStream if support is built.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Make sure playbin3 is forced when loading a MediaStream.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add a reference to the MediaStream object and declare loadFull and naturalSize override.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::registerWebKitGStreamerElements): Register the new MediaStreamSrc element.
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): Make sure that MediaStream MAIN tracks are selected by default. We have no way to do it in MediaStreamSrc now as the GstStreamCollection is recreated by parsebin.
* platform/mediastream/RealtimeMediaSource.h: Make CaptureFailed a virtual method as in our mocks we require need to make
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton): Remove the code
used for compilation for the platform when we do not have a
RealtimeMediaSourceCenterLibWebRTC. Now we return the proper class
for the platform.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
Added class representing the RealtimeMediaSource for the Audio
with GStreamer.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: Added
this class that represents the GStreamer pipeline that captures
audio from the system devices, it inherits from GStreamerCapturer.
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h: Dito.
* platform/mediastream/gstreamer/GStreamerAudioData.h: Added this
class implementing PlatformAudioData for the GStreamer platform,
used to pass the samples information.
* platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
Added this class implementing AudioStreamDescription to export the
information about the audio stream to libwebrtc.
* platform/mediastream/gstreamer/GStreamerCaptureDevice.h: Added
this base class for the audio and video capturing devices, it
implements general WebKit CaptureDevice class.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
Added this class that implements the system monitor to get the
list of available devices in the system. It uses GstDeviceMonitor
to handle the operation. It uses two singleton device managers one
for audio and another one for video, as required by the
RealtimeMediaSourceCenter design.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: Ditto.
* platform/mediastream/gstreamer/GStreamerCapturer.cpp: Added this
base class representing how GStreamer captures the media from the
input devices in the system. Two classes inherit from this one to
capture audio and video. It setups the GStreamer pipeline and adds
functions to control it.
* platform/mediastream/gstreamer/GStreamerCapturer.h: Ditto.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Added.
Implements a subclass of GstBin as a source element that will contain several
GstAppSrc, basically one per MediaStreamTrackPrivate of the MediaStreamPrivate
passed in parameter. It adds Observers on the MediaStreamTracks and
pushes the data to the sources as required. The element implements the GstURIHandler
interface so it can be used in playbin. The MediaPlayerPrivateGStreamer is responsible
for passing the MediaStreamPrivate object to the source when required.
(WebCore::webkitMediaStreamSrcPadProbeCb): Event probe that fixes stream_start events (setting the ID etc)
and finally add src pads to the pipeline.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
Added this RealtimeMediaSource representing the source of the
video data for the GStreamer platform. It handles the settings and
capabilities of the source and creates the capturer used to
control the operation of the stream.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: Added
this class that inherits from the GStreamerCapturer and controls
the GStreamer pipelines of the video streams of the system.
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Added. Implementation of a Mock capturer for audio stream.
Subclasses GStreamerAudioCapturer and wraps a MockRealtimeAudioSource so that the behaviour is the same a MockRealtimeAudioSource
but still the GStreamer implementation code paths are tested.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Added. Implementation of a Mock capturer for video stream.
Subclasses GStreamerVideoCapturer and wraps a MockRealtimeVideoSource so that the behaviour is the same a MockRealtimeVideoSource
but still the GStreamer implementation code paths are tested.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Ditto.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
Added this class that implements the key RealtimeMediaSourceCenter
functions to configure the base class for the platform, using the
other GStreamer classes.
* platform/mock/MockRealtimeAudioSource.cpp: Do not build ::create if GStreamer implementation is built
* platform/mock/MockRealtimeVideoSource.cpp: Do not build ::create if GStreamer implementation is built
2018-06-07 Brent Fulgham <bfulgham@apple.com>
Handle Storage Access API calls in the absence of an attached frame
https://bugs.webkit.org/show_bug.cgi?id=186373
<rdar://problem/40028265>
Reviewed by Daniel Bates.
Tests: http/tests/storageAccess/has-storage-access-crash.html
http/tests/storageAccess/request-storage-access-crash.html
The new frame-specific storage access checks were done without confirming a
frame was present, although the frame state was validated in other parts of
the same method.
This patch checks for a non-null frame before making frame-specific calls.
* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
2018-06-07 Zalan Bujtas <zalan@apple.com>
[LFC] Merge height and vertical margin computation
https://bugs.webkit.org/show_bug.cgi?id=186394
Reviewed by Antti Koivisto.
To match the spec (and the width/horizontal margin computation). -currently with default values.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::outOfFlowNonReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
(WebCore::Layout::floatingNonReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight): Deleted.
2018-06-07 Antti Koivisto <antti@apple.com>
Don't start service worker fetch when there is substitute data
https://bugs.webkit.org/show_bug.cgi?id=186349
<rdar://problem/38881568>
Reviewed by Youenn Fablet.
Loading content via WKWebView.loadData may also end up starting a main resource service worker fetch.
This breaks DocumentWriter assumptions.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
(WebCore::DocumentLoader::tryLoadingSubstituteData):
Factor substitute resource loading out from tryLoadingRequestFromApplicationCache.
(WebCore::DocumentLoader::startLoadingMainResource):
If we have substitute data already (typically from WKWebView.loadData), allow service worker registration
but load the main resource using the substitute data.
(WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Deleted.
Merge to tryLoadingSubstituteData.
* loader/DocumentLoader.h:
2018-06-07 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix the way GstStreamCollection is handled
https://bugs.webkit.org/show_bug.cgi?id=184588
Reviewed by Philippe Normand.
The stream collection message replaces the collection of stream previously
advertised, this means that we should rebuild our set of Track from scratch
and not update previously exposed tracks.
In the end, this simplifies the code as we do not care about what
tracks existed previously, we just need to expose what GStreamer tells
us, deleting any previous state.
Handle the STREAM_COLLECTION message from the sync handler so that tracks
are updated before we mark the pipeline as READY for the live case (everything
happen synchronously with the call to the `load()` method in that case),
the update still always happens on the main thread.
No new tests is added as this is mostly refactoring, it is already tested and it
will fix MediaStream tests that are currently disabled as the support is being
implemented in #185787.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::clearTracks): Removes all tracks.
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Updates configured tracks from the new GstStreamColection track.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Stop handling GST_STREAM_COLLECTION event.
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Handle stream collection event synchronously.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add handleSyncMessage
2018-06-07 Michael Catanzaro <mcatanzaro@igalia.com>
Remove unused image encoders
https://bugs.webkit.org/show_bug.cgi?id=186365
Reviewed by Carlos Garcia Campos.
* platform/image-encoders/JPEGImageEncoder.cpp: Removed.
* platform/image-encoders/JPEGImageEncoder.h: Removed.
* platform/image-encoders/PNGImageEncoder.cpp: Removed.
* platform/image-encoders/PNGImageEncoder.h: Removed.
2018-06-06 Youenn Fablet <youenn@apple.com>
HTTP Header values validation is too strict
https://bugs.webkit.org/show_bug.cgi?id=167112
Reviewed by Alex Christensen.
Moving header values and names from DOMString to ByteString as per spec.
Updating WebCore::isValidHTTPHeaderValue as per https://fetch.spec.whatwg.org/#terminology-headers.
Covered by rebased and updated tests.
Updated test is now also passing in other browsers.
* platform/network/HTTPParsers.cpp:
(WebCore::isValidHTTPHeaderValue):
2018-06-06 Youenn Fablet <youenn@apple.com>
Add Accept-Encoding: identity to Range requests
https://bugs.webkit.org/show_bug.cgi?id=186335
<rdar://problem/40837190>
Reviewed by Eric Carlson.
Tests: imported/w3c/web-platform-tests/fetch/range/general.any.html
imported/w3c/web-platform-tests/fetch/range/general.any.worker.html
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
* loader/cache/CachedResourceRequest.h:
2018-06-06 Per Arne Vollan <pvollan@apple.com>
Display links are sometimes not notifying WebCore when fired.
https://bugs.webkit.org/show_bug.cgi?id=186367
<rdar://problem/40439109>
Reviewed by Brent Fulgham.
When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
before notifying it. This matches the original display link implementation used when the WebContent process has
WindowServer access, where the monitors are always notified.
No new tests, since I have not been able to reproduce this in a test case yet.
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2018-06-06 Antoine Quint <graouts@apple.com>
Rename color-filter to -apple-color-filter and do not expose it to Web content
https://bugs.webkit.org/show_bug.cgi?id=186306
<rdar://problem/39874167>
Reviewed by Simon Fraser.
Rename the color-filter CSS property to -apple-color-filter.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::computeStops):
(WebCore::CSSGradientValue::knownToBeOpaque const):
* css/CSSProperties.json:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint const):
(WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
(WebCore::RenderStyle::colorByApplyingColorFilter const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::mutableAppleColorFilter):
(WebCore::RenderStyle::appleColorFilter const):
(WebCore::RenderStyle::hasAppleColorFilter const):
(WebCore::RenderStyle::setAppleColorFilter):
(WebCore::RenderStyle::initialAppleColorFilter):
(WebCore::RenderStyle::mutableColorFilter): Deleted.
(WebCore::RenderStyle::colorFilter const): Deleted.
(WebCore::RenderStyle::hasColorFilter const): Deleted.
(WebCore::RenderStyle::setColorFilter): Deleted.
(WebCore::RenderStyle::initialColorFilter): Deleted.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
(WebCore::StyleRareInheritedData::hasColorFilters const):
* rendering/style/StyleRareInheritedData.h:
2018-06-06 Jer Noble <jer.noble@apple.com>
REGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=185889
<rdar://problem/40583180>
Reviewed by Eric Carlson.
Explicitly update the network and ready states when detaching the AVPlayerItem
from the AVPlayer.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
2018-06-06 Antoine Quint <graouts@apple.com>
Use the default label for snapshotted plug-ins if no mime-type is available
https://bugs.webkit.org/show_bug.cgi?id=186348
Reviewed by Jon Lee.
In case the mime-type is not available, use the default labels otherwise we'd crash trying to look up the empty string in the HashMap.
* html/HTMLPlugInImageElement.cpp:
(WebCore::titleText):
(WebCore::subtitleText):
2018-06-06 Timothy Hatcher <timothy@apple.com>
Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=186350
rdar://problem/39135535
Reviewed by Anders Carlsson.
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
(-[WebCoreFullScreenPlaceholderView initWithFrame:]):
Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
set an explicit NSAppearance.
2018-06-06 Jer Noble <jer.noble@apple.com>
Regions outside of the fullscreen window are exposed during zoom operations
https://bugs.webkit.org/show_bug.cgi?id=186330
<rdar://problem/34698009>
Reviewed by Simon Fraser.
Test: fullscreen/full-screen-layer-dump.html
Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
during pinch operations.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:
2018-06-06 Jer Noble <jer.noble@apple.com>
Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
https://bugs.webkit.org/show_bug.cgi?id=186328
<rdar://problem/40829228>
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2018-06-06 Zalan Bujtas <zalan@apple.com>
[LFC] Add margin computation for floating, replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=186337
Reviewed by Antti Koivisto.
If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2018-06-06 Zalan Bujtas <zalan@apple.com>
[LFC] Add margin computation for floating, no-replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=186334
Reviewed by Antti Koivisto.
If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2018-06-06 Antti Koivisto <antti@apple.com>
Use minimal coverage rect for tiled layers when under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=186185
<rdar://problem/40713608>
Reviewed by Darin Adler.
We do this for the main content layer already.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
2018-06-05 Antoine Quint <graouts@apple.com>
[Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
https://bugs.webkit.org/show_bug.cgi?id=186305
Reviewed by Dean Jackson.
* animation/CSSAnimation.idl:
* animation/CSSTransition.idl:
2018-06-05 Per Arne Vollan <pvollan@apple.com>
Move OpenGL display mask to screen data struct.
https://bugs.webkit.org/show_bug.cgi?id=186198
<rdar://problem/40724854>
Reviewed by Brent Fulgham.
Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
window is available, the OpenGL display mask of the main display is used.
No new tests, since testing this requires two Web views in the same WebContent process, displayed on
two different monitors.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::allowOfflineRenderers const):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
(WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext):
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenProperties):
(WebCore::collectScreenProperties):
(WebCore::setScreenProperties):
(WebCore::screenData):
(WebCore::primaryOpenGLDisplayMask):
(WebCore::displayMaskForDisplay):
(WebCore::getScreenProperties):
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):
2018-06-05 Jer Noble <jer.noble@apple.com>
REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
https://bugs.webkit.org/show_bug.cgi?id=186326
<rdar://problem/40778157>
Reviewed by Eric Carlson.
Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::visibilityChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2018-06-05 Zalan Bujtas <zalan@apple.com>
[LFC] Move inflow, replaced width and margin computation to a dedicated function.
https://bugs.webkit.org/show_bug.cgi?id=186327
Reviewed by Sam Weinig.
I was searching for the function inFlowReplacedWidthAndMargin() and there was none.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2018-06-05 Zalan Bujtas <zalan@apple.com>
[LFC] Add missing margins for inflow, non replaced block and replaced inline elements
https://bugs.webkit.org/show_bug.cgi?id=186332
Reviewed by Darin Adler.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2018-06-05 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Spelling errors in the middle of an inserted paragraph are not displayed
https://bugs.webkit.org/show_bug.cgi?id=185584
<rdar://problem/38676081>
Reviewed by Ryosuke Niwa.
Currently when typing, we only consider the range of adjacent words when determining where to place spelling
correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
include correctly spelled words that are misused in the context of the sentence. This means that while typing a
sentence, a different part of the sentence may gain or lose spelling markers as a result.
To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
a full word is typed (since the context of other words within the sentence may have changed, resulting in
different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
start of the typed word, and does not include any position that is under an element with `spellcheck=false`.
This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.
Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.
Tests: editing/spelling/retro-correction-spelling-markers.html
editing/spelling/spelling-markers-after-pasting-sentence.html
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* testing/Internals.h:
* testing/Internals.idl:
Add an internal testing helper to determine whether retro sentence corrections are enabled.
2018-06-05 Darin Adler <darin@apple.com>
[Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
https://bugs.webkit.org/show_bug.cgi?id=186324
Reviewed by Anders Carlsson.
* platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
* platform/cocoa/FileMonitorCocoa.mm:
(WebCore::FileMonitor::FileMonitor): Ditto.
2018-06-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, fix the macOS build with recent SDKs.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
2018-06-05 Brent Fulgham <bfulgham@apple.com>
Adjust compile and runtime flags to match shippable state of features
https://bugs.webkit.org/show_bug.cgi?id=186319
<rdar://problem/40352045>
Reviewed by Maciej Stachowiak, Jon Lee, and others.
* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
2018-06-05 Timothy Hatcher <timothy@apple.com>
Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query
https://bugs.webkit.org/show_bug.cgi?id=186323
rdar://problem/38382252
Reviewed by Tim Horton.
* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
(WebCore::defaultAppearanceEvaluate): Deleted.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2018-06-05 Darin Adler <darin@apple.com>
[Cocoa] Improve some soft linking compatibility with ARC
https://bugs.webkit.org/show_bug.cgi?id=186309
Reviewed by Anders Carlsson.
* platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
for NSString constants.
* platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
some bridging casts.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
* platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
* platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
* platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.
2018-06-05 Youenn Fablet <youenn@apple.com>
ServiceWorker registration should store any script fetched through importScripts
https://bugs.webkit.org/show_bug.cgi?id=182444
<rdar://problem/37164835>
Reviewed by Chris Dumez.
Covered by added test http/wpt/service-workers/persistent-importScripts.html.
Update importScripts implementation to look for/update the resource map in case of service worker scope.
This resource map is stored persistently and sent when running the service worker.
Add support to persistent storage of this resource map.
This requires updating the schema database.
The schema version is bumped to 2 and we delete any data related to old registrations.
When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.
Did some limited refactoring to put more loading handling in WorkerScriptLoader.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::script):
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
(WebCore::ServiceWorkerContextData::ImportedScript::encode const):
(WebCore::ServiceWorkerContextData::ImportedScript::decode):
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::scriptResource const):
(WebCore::ServiceWorkerGlobalScope::setScriptResource):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/context/SWContextManager.h:
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::setScriptResource):
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_scriptResourceMap):
(WebCore::SWServerWorker::contextData const):
(WebCore::SWServerWorker::setScriptResource):
* workers/service/server/SWServerWorker.h:
2018-06-05 Brent Fulgham <bfulgham@apple.com>
Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
https://bugs.webkit.org/show_bug.cgi?id=186286
<rdar://problem/40782992>
Reviewed by Dan Bernstein.
Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
change this flag when preparing for a production release.
* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.
2018-06-05 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r232511.
https://bugs.webkit.org/show_bug.cgi?id=186304
* platform/ios/WebItemProviderPasteboard.mm: Add missing include.
2018-06-05 Antoine Quint <graouts@apple.com>
Fix the iOS build after r232496
https://bugs.webkit.org/show_bug.cgi?id=186304
Reviewed by Brent Fulgham.
The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
to HTMLInputElement* and some call sites did not expect that.
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
(WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
(WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::setValueAsDate const):
(WebCore::BaseDateAndTimeInputType::valueAsDouble const):
(WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
(WebCore::BaseDateAndTimeInputType::typeMismatch const):
(WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
(WebCore::BaseDateAndTimeInputType::localizeValue const):
(WebCore::BaseDateAndTimeInputType::visibleValue const):
(WebCore::BaseDateAndTimeInputType::valueMissing const):
(WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
* html/DateInputType.cpp:
(WebCore::DateInputType::createStepRange const):
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::createStepRange const):
* html/MonthInputType.cpp:
(WebCore::MonthInputType::valueAsDate const):
(WebCore::MonthInputType::createStepRange const):
* html/TimeInputType.cpp:
(WebCore::TimeInputType::createStepRange const):
* html/WeekInputType.cpp:
(WebCore::WeekInputType::createStepRange const):
2018-06-03 Darin Adler <darin@apple.com>
Simplify and remove some unused video element code (helpful for ARC-compatibility)
https://bugs.webkit.org/show_bug.cgi?id=186258
Reviewed by Daniel Bates.
My main mission was to remove the PlatformMedia struct, which had a union
of Objective-C object pointers in it, which doesn't work in ARC. However, I
found some other unused code to remove and simple mistakes to fix.
* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
since IDL "unsigned long" really means unsigned.
(WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
* Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::platformMedia const): Deleted.
* html/HTMLMediaElement.h: Updated for the above.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
to the class definition.
(WebCore::MediaPlayer::load): Use nullptr instead of 0.
(WebCore::MediaPlayer::platformMedia const): Deleted.
(WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
(WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
platformMedia for the one case where it was being used.
* platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
Removed explicit constructor in MediaEngineSupportParameters. Renamed
PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
removed its constructor, and changed types from unsigned long to unsigned.
Un-nested #if statements. Removed some Chromium-specific comments.
* platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
forward declarations. Removed platformMedia. Updated return type for
videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
Removed platformMedia.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
Updated for the above.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
Added override of objCAVFoundationAVPlayer. Removed platformMedia.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
Updated return type, changed to use aggregate initialization instead of
calling a constructor, and added casts to unsigned.
* platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
unsigned long to unsigned for frame counts and from long to int for
quality of service tier.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Updated for the above.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
Removed videoPlaybackQualityMetrics since it was overriding a derived function
without changing its behavior, and the type has changed.
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::load): Pass two references.
(WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
Updated return type.
* platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
member initialization into the class definition. Take references.
(WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
(WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
reference.
(WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
(WebCore::MockMediaSourcePrivate::readyState): Ditto.
(WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
(WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
(WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
(WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
instead of find/remove pairs.
(WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
(WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
(WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
type, changed to use aggregate initialization instead of calling a constructor.
* platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
a reference.
(WebCore::MockSourceBufferPrivate::setReadyState): Ditto.
2018-06-04 Darin Adler <darin@apple.com>
[Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
https://bugs.webkit.org/show_bug.cgi?id=186300
Reviewed by Daniel Bates.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
include of OSObjectPtr.h.
* platform/ios/WebItemProviderPasteboard.mm: Ditto.
2018-06-05 Joanmarie Diggs <jdiggs@igalia.com>
AX: Implement support for new blockquote, caption, and paragraph ARIA roles
https://bugs.webkit.org/show_bug.cgi?id=186274
Reviewed by Chris Fleizach.
Add the three new ARIA roles to the internal rolemap so that they are treated in
the same fashion as their HTML element counterparts. Also ensure that an element
with an explicit caption role does not get pruned from the macOS accessibility tree.
No new tests. Instead add the roles to the existing role-exposure tests.
* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
2018-06-05 Zalan Bujtas <zalan@apple.com>
[LFC] Merge width and margin computation for block-level, replaced elements in normal flow
https://bugs.webkit.org/show_bug.cgi?id=186270
Reviewed by Sam Weinig.
https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
10.3.4 Block-level, replaced elements in normal flow
The used value of 'width' is determined as for inline replaced elements.
Then the rules for non-replaced block-level elements are applied to determine the margins.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2018-06-04 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
https://bugs.webkit.org/show_bug.cgi?id=186190
Reviewed by Xabier Rodriguez-Calvar.
This is just a compilation improvement.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2018-06-03 Darin Adler <darin@apple.com>
[Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
https://bugs.webkit.org/show_bug.cgi?id=186245
Reviewed by Daniel Bates.
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
for the CGPathRef return value instead of Objective-C autorelease. Another option
would be to use RetainPtr for the return type instead.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXObjectIsTextMarker): Use __bridge for bridging typecast.
(AXObjectIsTextMarkerRange): Ditto.
(AXTextMarkerRange): Ditto.
(AXTextMarkerRangeStart): Ditto.
(AXTextMarkerRangeEnd): Ditto.
(isTextMarkerIgnored): Ditto.
(accessibilityObjectForTextMarker): Ditto.
(-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
(-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
(visiblePositionForStartOfTextMarkerRange): Ditto.
(visiblePositionForEndOfTextMarkerRange): Ditto.
(AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
and @() to make NSNumber.
(AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
code so that the typecasts are on function arguments, not local variables,
which makes lifetimes clearer.
(AXAttributeStringSetElement): Use __bridge for bridging typecast.
(WebTransformCGPathToNSBezierPath):
(-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
typecast when passing an NSBezierPath through as a void* context argument;
silent conversion to void* is not compatible with ARC.
(createAccessibilityRoleMap): Use __unsafe_unretained for a table of
NSString constants.
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
for bridging typecast.
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
to convert a Class into a CFTypeRef.
(JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
typecast.
(JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeObjcMethod): Ditto.
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
(JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
to make it clearer to the compiler that the code is correct.
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey): Ditto.
(WebCore::findMasterKey): Ditto.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItemAtPositionWithRange): Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
* editing/cocoa/HTMLConverter.mm:
(_font): Ditto.
(fileWrapperForElement): Ditto.
* fileapi/FileCocoa.mm:
(WebCore::File::shouldReplaceFile): Ditto.
* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
(createContentCrossfadeAnimation): Ditto.
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::localizedString): Ditto.
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::create): Ditto.
(WebCore::SharedBuffer::append): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::toCTFont): Ditto.
(WebCore::toNSFont): Ditto.
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
(WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
(WebCore::bufferWasConsumedCallback): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::create): Ditto.
(PlatformCALayer::platformCALayer): Ditto.
(PlatformCALayerCocoa::superlayer const): Ditto.
(PlatformCALayerCocoa::contents const): Ditto.
(PlatformCALayerCocoa::setContents): Ditto.
* platform/graphics/cocoa/IOSurface.h: Ditto.
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(TextTrackRepresentationCocoa::update): Ditto.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
(WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]): Ditto.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::nsImage): Ditto.
(WebCore::BitmapImage::snapshotNSImage): Ditto.
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]): Ditto.
(-[WebSimpleLayer setNeedsDisplay]): Ditto.
(-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
(-[WebSimpleLayer display]): Ditto.
(-[WebSimpleLayer drawInContext:]): Ditto.
* platform/mac/CursorMac.mm:
(WebCore::cursor): Mark pointer __strong to match the globals it points to.
* platform/mac/FileSystemMac.mm:
(WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
typecast.
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
(WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.
* platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
and release for NSDictionary and NSSet.
* platform/mac/PluginBlacklist.mm:
(WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
(WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
(WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
explciit CFRetain/release pairs.
* platform/mac/PublicSuffixMac.mm:
(WebCore::isPublicSuffix): Use __bridge for bridging typecast.
* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext): Ditto.
* platform/mac/URLMac.mm:
(WebCore::URL::URL): Ditto.
(WebCore::URL::createCFURL const): Ditto.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
local variable it eventually points to.
(WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
(WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
CFBridgingRelease instead of autorelease, reducing typecasts.
(WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
(WebCore::userVisibleString): Use __bridge for bridging typecast.
(WebCore::isUserVisibleURL): Ditto.
* platform/mac/WebGLBlacklist.mm:
(WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setPreset): Ditto.
(WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
instead of NSNumber.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.
* platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
CFSTR for constant string array commonHeaderFields rather than using
NSString * and then relying on implicit bridging conversion.
* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
* platform/network/mac/FormDataStreamMac.mm:
(WebCore::createHTTPBodyNSInputStream): Ditto.
(WebCore::httpBodyFromStream): Ditto.
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError): Ditto.
(WebCore::ResourceError::cfError const): Ditto.
* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
(WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
(WebCore::AttachmentLayout::layOutSubtitle): Ditto.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
bridging typecast.
(WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
(WebCoreTestSupport::convertWebResourceDataToString): Use the
MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
and using CFArrayContainsValue. This is both much more direct and much more
efficient as well.
2018-06-04 Timothy Hatcher <timothy@apple.com>
[Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
https://bugs.webkit.org/show_bug.cgi?id=186296
Unreviewed build fix.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
2018-06-04 Chris Dumez <cdumez@apple.com>
Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
https://bugs.webkit.org/show_bug.cgi?id=186287
<rdar://problem/40783352>
Reviewed by Youenn Fablet.
Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
http/wpt/cross-origin-window-policy/allow-postmessage.html
http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html
* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::effectiveCrossOriginWindowPolicyForAccess):
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::addCrossOriginWindowPropertyNames):
(WebCore::addScopedChildrenIndexes):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GetCrossOriginsOptionsFromExtendedAttributeValue):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* dom/Document.cpp:
(WebCore::Document::canNavigate):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* page/AbstractDOMWindow.cpp:
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
* page/AbstractDOMWindow.h:
(WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
(WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
* page/DOMWindow.idl:
* page/Settings.yaml:
* platform/network/HTTPHeaderNames.in:
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginWindowPolicyHeader):
* platform/network/HTTPParsers.h:
2018-06-04 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=186096
<rdar://problem/40651015>
Reviewed by Ryosuke Niwa.
Now that the InputType may be kept alive as part of in-flight form submissions, we
shouldn't assume that the referenced HTMLInputElement is still valid before using it.
The only time we should be lacking a referencing element is in cases where the InputType
is changing, either through a change in the HTMLInputElement's type attribute. In those
cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.
* html/BaseButtonInputType.cpp:
(WebCore::BaseButtonInputType::createInputRenderer):
(WebCore::BaseButtonInputType::setValue):
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::saveFormControlState const):
(WebCore::BaseCheckableInputType::restoreFormControlState):
(WebCore::BaseCheckableInputType::appendFormData const):
(WebCore::BaseCheckableInputType::handleKeydownEvent):
(WebCore::BaseCheckableInputType::accessKeyAction):
(WebCore::BaseCheckableInputType::setValue):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
here, since this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
* html/BaseClickableWithKeyInputType.cpp:
(WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
(WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
(WebCore::BaseClickableWithKeyInputType::accessKeyAction):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
here, since this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
* html/BaseTextInputType.cpp:
(WebCore::BaseTextInputType::patternMismatch const):
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::valueMissing const):
(WebCore::CheckboxInputType::willDispatchClick):
(WebCore::CheckboxInputType::didDispatchClick):
(WebCore::CheckboxInputType::shouldAppearIndeterminate const):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::valueAsColor const):
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::handleDOMActivateEvent):
(WebCore::ColorInputType::didChooseColor):
(WebCore::ColorInputType::updateColorSwatch):
(WebCore::ColorInputType::shadowColorSwatch const):
(WebCore::ColorInputType::elementRectRelativeToRootView const):
(WebCore::ColorInputType::shouldShowSuggestions const):
(WebCore::ColorInputType::suggestions const):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::typeMismatchFor const):
(WebCore::EmailInputType::typeMismatch const):
(WebCore::EmailInputType::typeMismatchText const):
(WebCore::EmailInputType::sanitizeValue const):
* html/FileInputType.cpp:
(WebCore::FileInputType::appendFormData const):
(WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::FileInputType::valueMissing const):
(WebCore::FileInputType::valueMissingText const):
(WebCore::FileInputType::handleDOMActivateEvent):
(WebCore::FileInputType::createInputRenderer):
(WebCore::FileInputType::setValue):
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::disabledAttributeChanged):
(WebCore::FileInputType::multipleAttributeChanged):
(WebCore::FileInputType::allowsDirectories const):
(WebCore::FileInputType::setFiles):
(WebCore::FileInputType::iconLoaded):
(WebCore::FileInputType::receiveDroppedFiles):
(WebCore::FileInputType::defaultToolTip const):
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::weakPtrFactory const):
* html/HiddenInputType.cpp:
(WebCore::HiddenInputType::saveFormControlState const):
(WebCore::HiddenInputType::restoreFormControlState):
(WebCore::HiddenInputType::setValue):
(WebCore::HiddenInputType::appendFormData const):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::appendFormData const):
(WebCore::ImageInputType::handleDOMActivateEvent):
(WebCore::ImageInputType::createInputRenderer):
(WebCore::ImageInputType::altAttributeChanged):
(WebCore::ImageInputType::srcAttributeChanged):
(WebCore::ImageInputType::attach):
(WebCore::ImageInputType::height const):
(WebCore::ImageInputType::width const):
* html/InputType.cpp:
(WebCore::InputType::saveFormControlState const):
(WebCore::InputType::restoreFormControlState):
(WebCore::InputType::isFormDataAppendable const):
(WebCore::InputType::appendFormData const):
(WebCore::InputType::sizeShouldIncludeDecoration const):
(WebCore::InputType::validationMessage const):
(WebCore::InputType::createInputRenderer):
(WebCore::InputType::blur):
(WebCore::InputType::destroyShadowSubtree):
(WebCore::InputType::dispatchSimulatedClickIfActive const):
(WebCore::InputType::chrome const):
(WebCore::InputType::isKeyboardFocusable const):
(WebCore::InputType::isMouseFocusable const):
(WebCore::InputType::accessKeyAction):
(WebCore::InputType::setValue):
(WebCore::InputType::visibleValue const):
(WebCore::InputType::applyStep):
(WebCore::InputType::stepUpFromRenderer):
* html/InputType.h:
(WebCore::InputType::InputType):
(WebCore::InputType::element const):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::NumberInputType::setValue):
(WebCore::NumberInputType::valueAsDouble const):
(WebCore::NumberInputType::setValueAsDouble const):
(WebCore::NumberInputType::setValueAsDecimal const):
(WebCore::NumberInputType::typeMismatch const):
(WebCore::NumberInputType::createStepRange const):
(WebCore::NumberInputType::sizeShouldIncludeDecoration const):
(WebCore::NumberInputType::decorationWidth const):
(WebCore::NumberInputType::localizeValue const):
(WebCore::NumberInputType::visibleValue const):
(WebCore::NumberInputType::convertFromVisibleValue const):
(WebCore::NumberInputType::hasBadInput const):
(WebCore::NumberInputType::minOrMaxAttributeChanged):
(WebCore::NumberInputType::stepAttributeChanged):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::valueMissing const):
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::handleKeyupEvent):
(WebCore::RadioInputType::isKeyboardFocusable const):
(WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
(WebCore::RadioInputType::willDispatchClick):
(WebCore::RadioInputType::didDispatchClick):
(WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::RangeInputType::valueAsDouble const):
(WebCore::RangeInputType::setValueAsDecimal const):
(WebCore::RangeInputType::createStepRange const):
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::sliderTrackElement const):
(WebCore::RangeInputType::createInputRenderer):
(WebCore::RangeInputType::accessKeyAction):
(WebCore::RangeInputType::minOrMaxAttributeChanged):
(WebCore::RangeInputType::setValue):
(WebCore::RangeInputType::updateTickMarkValues):
* html/ResetInputType.cpp:
(WebCore::ResetInputType::handleDOMActivateEvent):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::addSearchResult):
(WebCore::SearchInputType::maxResultsAttributeChanged):
(WebCore::SearchInputType::createInputRenderer):
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::handleKeydownEvent):
(WebCore::SearchInputType::startSearchEventTimer):
(WebCore::SearchInputType::searchEventTimerFired):
(WebCore::SearchInputType::searchEventsShouldBeDispatched const):
(WebCore::SearchInputType::didSetValueByUserEdit):
(WebCore::SearchInputType::sizeShouldIncludeDecoration const):
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::appendFormData const):
(WebCore::SubmitInputType::handleDOMActivateEvent):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::attributeChanged): Add a nullptr check here, since
this is called directly by code that causes the old InputType to be removed,
which could leave us with a nullptr element().
(WebCore::TextFieldInputType::isKeyboardFocusable const):
(WebCore::TextFieldInputType::isMouseFocusable const):
(WebCore::TextFieldInputType::valueMissing const):
(WebCore::TextFieldInputType::setValue):
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
(WebCore::TextFieldInputType::forwardEvent):
(WebCore::TextFieldInputType::elementDidBlur):
(WebCore::TextFieldInputType::handleFocusEvent):
(WebCore::TextFieldInputType::handleBlurEvent):
(WebCore::TextFieldInputType::createInputRenderer):
(WebCore::TextFieldInputType::shouldHaveSpinButton const):
(WebCore::TextFieldInputType::shouldHaveCapsLockIndicator const):
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::appendFormData const):
(WebCore::TextFieldInputType::subtreeHasChanged):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
(WebCore::TextFieldInputType::updateInnerTextValue):
(WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
(WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
(WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
(WebCore::TextFieldInputType::shouldDrawAutoFillButton const):
(WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
(WebCore::TextFieldInputType::createContainer):
(WebCore::TextFieldInputType::createAutoFillButton):
(WebCore::TextFieldInputType::updateAutoFillButton):
* html/URLInputType.cpp:
(WebCore::URLInputType::typeMismatch const):
2018-06-04 Chris Dumez <cdumez@apple.com>
Unreviewed iOS build fix with recent SDKs.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-06-04 Dean Jackson <dino@apple.com>
AR Badging on transparent thumbnail images makes the glyph look really dark
https://bugs.webkit.org/show_bug.cgi?id=186289
<rdar://problem/40627111>
Reviewed by Anders Carlsson.
Clip out the shape for the drop shadow, so that it isn't visible if
there is transparent pixel data on top of it.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2018-06-04 Timothy Hatcher <timothy@apple.com>
Selection color is dark when using Safari in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=186288
rdar://problem/38438625
Reviewed by Simon Fraser.
Pass StyleColor::Options to all of the selection color functions.
Removed supportsSelectionForegroundColors() from RenderThemeMac,
to get the default of true, since the forground colors in dark mode
can be different now. Use new semantic color methods on NSColor.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeSelectionBackgroundColor const):
(WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
(WebCore::RenderTheme::activeSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveSelectionForegroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
(WebCore::RenderTheme::platformActiveSelectionForegroundColor const):
(WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderTheme::platformInactiveSelectionForegroundColor const):
(WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
* rendering/RenderThemeWin.h:
2018-06-04 Chris Dumez <cdumez@apple.com>
Update Fetch code to provide more useful exception messages
https://bugs.webkit.org/show_bug.cgi?id=186156
Reviewed by Youenn Fablet.
Provide more useful error messages in our Loading / Fetch code.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader):
(WebCore::FetchHeaders::get const):
(WebCore::FetchHeaders::has const):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::clone):
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
* workers/service/context/ServiceWorkerFetch.h:
2018-06-04 Daniel Bates <dabates@apple.com>
Update Strong Password appearance
https://bugs.webkit.org/show_bug.cgi?id=186239
<rdar://problem/38183795>
Reviewed by Brent Fulgham.
Fix up the gradient mask to start half-way through the visible text and size it to the
width of the visible text. Also change the color of the Strong Password label to 80% black.
We achieve sizing of the gradient to the width of the visible text by changing the CSS display
of the inner text element to be an inline-block and specifying "max-width: 100%" so that
its maximum width is less than or equal to the width of its containing block. Additionally,
only apply strong password-specific inner text element styles when the field is not disabled
or read-only and has a strong password appearance. Otherwise these styles, specifically the
display type, will adversely effect rendering of the text when the field is disabled or readonly.
* css/html.css:
(input::-webkit-strong-password-auto-fill-button):
* html/HTMLInputElement.cpp:
(WebCore::autoFillStrongPasswordMaskImage):
(WebCore::HTMLInputElement::createInnerTextStyle):
2018-06-04 Wenson Hsieh <wenson_hsieh@apple.com>
[WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
https://bugs.webkit.org/show_bug.cgi?id=186279
Reviewed by Tim Horton.
Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS). No change in behavior.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::compactMode const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState):
* page/Page.cpp:
(WebCore::relevantViewRect):
* page/SettingsBase.cpp:
(WebCore::SettingsBase::defaultMinimumZoomFontSize):
(WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
* page/ViewportConfiguration.cpp:
(WebCore::platformDeviceWidthOverride):
(WebCore::shouldOverrideShrinkToFitArgument):
(WebCore::needsUpdateAfterChangingDisabledAdaptations):
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
(-[WebMediaSessionHelper dealloc]):
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController MY_NO_RETURN]):
(-[WebAVPlayerViewController isPictureInPicturePossible]):
(-[WebAVPlayerViewController isPictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
(-[WebAVPlayerViewController showsPlaybackControls]):
(-[WebAVPlayerViewController setShowsPlaybackControls:]):
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
(-[WebAVPlayerViewController setDelegate:]):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(WebCore::supportsPictureInPicture):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::willExitFullscreen):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
2018-06-04 Youenn Fablet <youenn@apple.com>
[WK1] Add an option to restrict communication to localhost sockets
https://bugs.webkit.org/show_bug.cgi?id=186249
Reviewed by Eric Carlson.
Covered by existing tests.
Set explicitly webrtc socket IP address to 127.0.0.1 in testing mode.
For that purpose, we need WK1 to create a wrapper around a socket factory,
this wrapper being responsible of setting or not the IP address to 127.0.0.1.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::prepareSocketAddress):
(WebCore::BasicPacketSocketFactory::BasicPacketSocketFactory):
(WebCore::BasicPacketSocketFactory::setDisableNonLocalhostConnections):
(WebCore::BasicPacketSocketFactory::CreateClientTcpSocket):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2018-06-04 Zalan Bujtas <zalan@apple.com>
[LFC] Merge width and margin computation for block-level, non-replaced and inline,replaced element in normal flow
https://bugs.webkit.org/show_bug.cgi?id=186225
Reviewed by Antti Koivisto.
This patch merges the width and horizontal margin computation for
https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width and https://www.w3.org/TR/CSS22/visudet.html#blockwidth
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2018-06-01 Zalan Bujtas <zalan@apple.com>
[LFC] Merge width and horizontal margin computation
https://bugs.webkit.org/show_bug.cgi?id=186217
Reviewed by Antti Koivisto.
We could certainly compute width and maring separately, but to match each steps defined
at https://www.w3.org/TR/CSS22/visudet.html, we should just merge width and horizontal margin computations
(followed by height and vertical margins).
Use 0 computed marings for now.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): Deleted.
(WebCore::Layout::FormattingContext::computeFloatingWidth const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::outOfFlowNonReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
(WebCore::Layout::floatingNonReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth): Deleted.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeMargin const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidVerticalMargin):
(WebCore::Display::Box::setHasValidHorizontalMargin):
(WebCore::Display::Box::invalidateMargin):
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::Edges::Edges): Deleted.
(WebCore::Display::Box::setHasValidMargin): Deleted.
(WebCore::Display::Box::setMargin): Deleted.
2018-06-03 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r232338): [GTK] Broke a few layout tests
https://bugs.webkit.org/show_bug.cgi?id=186244
Unreviewed, also rollout r232392.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::adjustListboxStyle const): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustListboxStyle const): Deleted.
* rendering/RenderThemeGtk.h:
2018-06-03 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r232338): [GTK] Broke a few layout tests
https://bugs.webkit.org/show_bug.cgi?id=186244
Unreviewed, rollout r232338.
* platform/gtk/RenderThemeGadget.cpp:
(WebCore::RenderThemeGadget::RenderThemeGadget):
(WebCore::baseStyleContext): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustButtonStyle const):
(WebCore::RenderThemeGtk::adjustTextFieldStyle const):
(WebCore::RenderThemeGtk::adjustSearchFieldStyle const):
(WebCore::styleColor):
(WebCore::RenderThemeGtk::adjustTextAreaStyle const): Deleted.
* rendering/RenderThemeGtk.h:
2018-06-03 Eric Carlson <eric.carlson@apple.com>
[iOS] MediaPlayer.framework is not always available
https://bugs.webkit.org/show_bug.cgi?id=186220
<rdar://problem/40571286>
Reviewed by Tim Horton.
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListener::create):
2018-06-02 Darin Adler <darin@apple.com>
[Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
https://bugs.webkit.org/show_bug.cgi?id=186227
Reviewed by Dan Bernstein.
* bridge/objc/objc_instance.mm:
(ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
* platform/ios/wak/WAKView.mm:
(-[WAKView _appendDescriptionToString:atLevel:]): Ditto.
2018-06-03 Zan Dobersek <zdobersek@igalia.com>
[WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
https://bugs.webkit.org/show_bug.cgi?id=186187
Reviewed by Carlos Garcia Campos.
Don't utilize the GL_EXT_robustness extension for reading pixels from
the GPU if the underlying OpenGL context did not enable robust access
support upon creation. For EGL contexts, this would be done by passing
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
attribute list passed to eglCreateContext() (as specified in the
EGL_EXT_create_context_robustness extension), but at the moment this
capability is not utilized.
As such, on drivers that implement GL_EXT_robustness support, pixel
reads done in WebGLRenderingContextBase end up using glReadnPixels(),
but that fails to successfully read anything due to the context
rejecting such calls.
GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
Extensions3DOpenGLES overrides the isEnabled() method. That override
returns false immediately if the inherited isEnabled() implementation
returns false. Otherwise it returns true, unless the tested extension
is GL_EXT_robustness, in which case we now check that the context's
CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
created with robust access support enabled.
No new tests are possible because this is optional driver-provided
functionality that Web content cannot have effect on.
* platform/graphics/Extensions3D.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::isEnabled):
* platform/graphics/opengl/Extensions3DOpenGLES.h:
2018-06-01 Ryosuke Niwa <rniwa@webkit.org>
Editor can hold references to Documents after you navigate away
https://bugs.webkit.org/show_bug.cgi?id=186215
Reviewed by Simon Fraser.
Clear the various member variables that can hold onto a document in Editor::clear and FrameSelection::prepareForDestruction.
Test: editing/selection/navigation-clears-editor-state.html
* editing/Editor.cpp:
(WebCore::Editor::clear):
* editing/Editor.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::prepareForDestruction):
* editing/FrameSelection.h:
2018-06-01 Ryosuke Niwa <rniwa@webkit.org>
ResourceLoader::cancel() shouldn't synchronously fire load event on document
https://bugs.webkit.org/show_bug.cgi?id=185284
Revert the erroneous change to SSFontSelector::beginLoadTimerFired(), which broke CancelLoading.CancelFontSubresource.
FrameLoader::loadDone calls checkCompleted, not checkLoadComplete so we still need to call checkLoadComplete here.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::beginLoadTimerFired):
2018-06-01 Jeremy Jones <jeremyj@apple.com>
Keyboard focus should exit fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=185617
rdar://problem/34697938
Reviewed by Ryosuke Niwa.
No opensource test because feature is not enabled.
While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
Improve fullscreen testability by exposing isAnimatingFullScreen.
* dom/Document.h:
* testing/Internals.cpp:
(WebCore::Internals::isAnimatingFullScreen const):
* testing/Internals.h:
* testing/Internals.idl:
2018-06-01 Jeremy Jones <jeremyj@apple.com>
Don't continue playing in background when auto-picture-in-picture is disabled.
https://bugs.webkit.org/show_bug.cgi?id=186089
rdar://problem/40314314
Reviewed by Eric Carlson.
No new tests because we don't have a way to test auto-pip.
With the refactoring work done in VideoFullscreenInterfaceAVKit, HTMLMediaElement no longer has to anticipate
auto-pip when if it should pause on suspend. Instead VideoFullscreenInterfaceAVKit proactively updates
videoFullscreenMode, so checking for PIP is sufficient.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
2018-06-01 Chris Dumez <cdumez@apple.com>
REGRESSION (r231456): Colloquy is broken
https://bugs.webkit.org/show_bug.cgi?id=186197
<rdar://problem/40722960>
Reviewed by Timothy Hatcher.
Restore pre-r231456 behavior for Colloquy app so that it works again.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::openURL):
* page/Settings.yaml:
2018-06-01 Chris Dumez <cdumez@apple.com>
Regression(r230567): Unable to log into twitter.com in private sessions
https://bugs.webkit.org/show_bug.cgi?id=186205
<rdar://problem/40670799>
Reviewed by Youenn Fablet.
We were using the same SWServer for all private sessions and the SWServer's sessionID would
be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
as well and would not match the sessionID of its client pages. This sessionID mismatch was
causing the breakage.
Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
per private session. However, we now make sure that the SWServer gets destroyed whenever its
corresponding session gets destroyed.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
2018-06-01 Youenn Fablet <youenn@apple.com>
Add an option to restrict communication to localhost sockets
https://bugs.webkit.org/show_bug.cgi?id=186208
Reviewed by Eric Carlson.
Covered by existing tests.
Add an option in LibWebRTCProvider to restrict to localhost sockets.
Use that option when Internals is used.
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2018-06-01 Ryosuke Niwa <rniwa@webkit.org>
ResourceLoader::cancel() shouldn't synchronously fire load event on document
https://bugs.webkit.org/show_bug.cgi?id=185284
Reviewed by Antti Koivisto.
Because a resource loading can be canceled as a node is removed a document or CachedResource is destructed,
it's not safe to synchronously fire load event on document upon cancelation. This patch makes the cancellation
of a resource load schedule m_checkTimer in FrameLoader to fire a load event asynchronously instead.
Specifically, this patch makes FrameLoader::loadDone call FrameLoader::scheduleCheckCompleted when the load
had failed or cancled instead of calling FrameLoader::checkCompleted which can synchronously fire load event.
To differentiate the two cases, new enum LoadCompletionType has been added to FrameLoader::loadDone and related
functions. To avoid calling the navigation delegate too early, the same abstraction for checkLoadComplete()
has been added in the form of FrameLoader::subresourceLoadDone.
Unfortunately, delaying calls to checkCompleted() and checkLoadComplete() by a timer can result in client
callbacks such as didFinishLoadForFrame and didFailLoadWithError to never get called when the frame gets
detached from the parent after the last resource had stopped loading but before the timer fires. To preserve
these deleagte callbacks, this patch expedites the timer in FrameLoader::frameDetached and Page::goToItem by
by invoking newly added stopAllLoadersAndCheckCompleteness, which stops all loading and then immediately invokes
checkCompleted() and checkLoadComplete() synchronously if m_checkTimer had been started.
Tests: http/tests/preload/dynamic_removing_preload.html
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::beginLoadTimerFired): Removed superfluous call to checkLoadComplete since
cachedResourceLoader's loadDone would call checkLoadComplete anyway.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::disconnectContentFrame): Removed the misleading comment added in r140090.
Firefox DOES indeed fire unload event in the content document of a removed frame. While this comment made
it sound like this function isn't called when a frame is removed from the tree when in reality we simply
remove a frame prior to removing the node via disconnectSubframesIfNeeded.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::removeSubresourceLoader):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader):
(WebCore::FrameLoader::loadDone):
(WebCore::FrameLoader::subresourceLoadDone):
(WebCore::FrameLoader::checkCompleted): Added a release assert that this function is only called when it's safe
to execute scripts.
(WebCore::FrameLoader::checkTimerFired):
(WebCore::FrameLoader::checkCompletenessNow):Extracted from checkTimerFired.
(WebCore::FrameLoader::stopAllLoaders): Removed the code to stop m_checkTimer introduced in r53655.
Stopping the timer here would prevent FrameLoader::frameDetached to detect the case when stopping the loader
scheduled a load completion check. Also stopping this timer without clearing the corresponding booleans:
m_checkingLoadCompleteForDetachment and m_checkingLoadCompleteForDetachment is problematic. The assertion
r53655 addressed is now addressed by explicitly checking & clearing the timer in frameDetached.
(WebCore::FrameLoader::stopAllLoadersAndCheckCompleteness): Added.
(WebCore::FrameLoader::checkLoadCompleteForThisFrame): Avoid an early exit when the newly added boolean
m_checkingLoadCompleteForDetachment is set since m_isStopping is no longer set in frameDetached in order
to invoke didFailLoadWithError when detaching a frame.
(WebCore::FrameLoader::frameDetached): Call checkCompletenessNow in the case the frame had already been
completed loading. Also call stopAllLoadersAndCheckCompleteness in the case stopping loading would complete
the loading before stopping active DOM objects.
* loader/FrameLoader.h:
(WebCore::FrameLoader::m_checkingLoadCompleteForDetachment): Added.
* loader/FrameLoaderTypes.h:
(WebCore::LoadCompletionType): Added.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::didCancel):
(WebCore::SubresourceLoader::notifyDone):
* loader/SubresourceLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::loadDone):
* loader/cache/CachedResourceLoader.h:
* page/Page.cpp:
(WebCore::Page::goToItem): Call stopAllLoadersAndCheckCompleteness instead of stopAllLoaders since stopping
loading here may complete loading.
2018-06-01 Sihui Liu <sihui_liu@apple.com>
Stop using StorageTracker.db in LocalStorageDatabaseTracker
https://bugs.webkit.org/show_bug.cgi?id=186104
Reviewed by Geoffrey Garen.
No behavior change.
* platform/sql/SQLiteFileSystem.h:
2018-06-01 Zalan Bujtas <zalan@apple.com>
[LFC] Simplify the formatting class implementation by pushing down some of the logic to the Geometry class
https://bugs.webkit.org/show_bug.cgi?id=186179
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::outOfFlowNonReplacedHeight):
(WebCore::Layout::outOfFlowNonReplacedWidth):
(WebCore::Layout::outOfFlowReplacedHeight):
(WebCore::Layout::outOfFlowReplacedWidth):
(WebCore::Layout::floatingNonReplacedHeight):
(WebCore::Layout::floatingNonReplacedWidth):
(WebCore::Layout::floatingReplacedHeight):
(WebCore::Layout::floatingReplacedWidth):
(WebCore::Layout::outOfFlowNonReplacedPosition):
(WebCore::Layout::outOfFlowReplacedPosition):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth):
(WebCore::Layout::FormattingContext::Geometry::floatingHeight):
(WebCore::Layout::FormattingContext::Geometry::floatingWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedPosition): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedPosition): Deleted.
(WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::inFlowNonReplacedHeight):
(WebCore::Layout::inFlowNonReplacedWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
2018-06-01 Zalan Bujtas <zalan@apple.com>
[LFC] Push FormattingContext::computeWidth/computeHeight logic from the base to the subclasses.
https://bugs.webkit.org/show_bug.cgi?id=186172
Reviewed by Antti Koivisto.
FormattingContext::computeWidth/computeHeight virtual functions have very little benefit and in the long run
it's better if we keep the number of virtual functions to the minimum necessary.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeStaticPosition const): Deleted.
(WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const): Deleted.
(WebCore::Layout::FormattingContext::computeWidth const): Deleted.
(WebCore::Layout::FormattingContext::computeHeight const): Deleted.
(WebCore::Layout::FormattingContext::computeMargin const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
(WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidth const):
(WebCore::Layout::BlockFormattingContext::computeHeight const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeInFlowHeight const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-06-01 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[GTK] Difficult to read combo box text in dark theme
https://bugs.webkit.org/show_bug.cgi?id=165072
Reviewed by Carlos Garcia Campos.
Set listbox foreground color to theme color to fix hard-to-read
text color in combo box while using dark theme.
No new tests required. ManualTests/gtk/theme.html already covers it.
See the "Option Lists" section.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
Adjust style for ListboxPart as well.
* rendering/RenderTheme.h: Add adjustListboxStyle()
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustListboxStyle const):
Set color to the theme foreground color.
* rendering/RenderThemeGtk.h: adjustListboxStyle() overriden.
2018-06-01 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
https://bugs.webkit.org/show_bug.cgi?id=186146
Reviewed by Michael Catanzaro.
Make it possible to use GUniquePtr with GtkTreePath.
* platform/gtk/GUniquePtrGtk.h:
2018-05-31 Per Arne Vollan <pvollan@apple.com>
Add OpenGL display mask to WebPage creation parameters.
https://bugs.webkit.org/show_bug.cgi?id=186163
<rdar://problem/40634504>
Reviewed by Brent Fulgham.
To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
on some hardware configurations.
No new tests, since it is not trivial to test whether OpenGL rendering is hardware accelerated.
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID):
2018-05-31 Megan Gardner <megan_gardner@apple.com>
Add setting to allow override screen size to be disabled.
https://bugs.webkit.org/show_bug.cgi?id=186109
Reviewed by Andy Estes.
Not Testable, and for debug only.
Pipe settings and use them to ignore override screen size if setting is set.
* page/DeprecatedGlobalSettings.cpp:
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setDisableScreenSizeOverride):
(WebCore::DeprecatedGlobalSettings::disableScreenSizeOverride):
* page/Settings.yaml:
* platform/ios/PlatformScreenIOS.mm:
2018-05-31 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r216119): DocumentLoader::detachFromFrame still encounters nullptr frame
https://bugs.webkit.org/show_bug.cgi?id=186081
<rdar://problem/34918109>
Reviewed by David Kilzer.
The nullptr check that was removed in r216119 was still needed because when the DocumentLoader
is in 'm_waitingForNavigationPolicy' or in 'm_waitingForContentPolicy', a call to the policy checker
to stopCheck we will clear the frame as part of the cleanup phase.
If m_frame is nullptr after cancelPolicyCheckIfNeeded, our work is already done so just return.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):
2018-05-31 Dean Jackson <dino@apple.com>
Don't paint the System Preview badge if the image isn't fully decoded
https://bugs.webkit.org/show_bug.cgi?id=186158
<rdar://problem/40454866>
Reviewed by Antoine Quint.
Only paint the system preview badge if the image itself said
that it succeeded in drawing.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): Check the ImageDrawResult.
2018-05-31 David Kilzer <ddkilzer@apple.com>
Implement checked cast for DDResultRef once DDResultGetCFTypeID() is available
<https://webkit.org/b/184554>
<rdar://problem/36241894>
Reviewed by Brent Fulgham.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItemAtPositionWithRange): Implement checked cast
for DDResultRef.
2018-05-31 Alex Christensen <achristensen@webkit.org>
Fix Windows build after r232246.
https://bugs.webkit.org/show_bug.cgi?id=186024
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
2018-05-31 Chris Dumez <cdumez@apple.com>
Fix memory leak under NetworkStateNotifier::updateStateWithoutNotifying()
https://bugs.webkit.org/show_bug.cgi?id=186149
<rdar://problem/40674537>
Reviewed by Geoffrey Garen.
* platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2018-05-31 Zalan Bujtas <zalan@apple.com>
[LFC] Layout code needs to know the type of the Element associated with a Layout::Box
https://bugs.webkit.org/show_bug.cgi?id=186117
Reviewed by Antti Koivisto.
Since these attributes don't change during layout, we could just pass them in to Layout::Box instead
of keep querying the Element.
* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::BlockContainer):
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
(WebCore::Layout::Box::isPaddingApplicable const):
(WebCore::Layout::Box::isDocumentBox const): Deleted.
(WebCore::Layout::Box::isBodyBox const): Deleted.
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isAnonymous const):
(WebCore::Layout::Box::isDocumentBox const):
(WebCore::Layout::Box::isBodyBox const):
(WebCore::Layout::Box::ElementAttributes::ElementAttributes):
(WebCore::Layout::Box::setPreviousSibling):
(WebCore::Layout::Box::setIsAnonymous): Deleted.
* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::Container):
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
* layout/layouttree/LayoutInlineContainer.cpp:
(WebCore::Layout::InlineContainer::InlineContainer):
* layout/layouttree/LayoutInlineContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutTree):
(WebCore::Layout::TreeBuilder::createSubTree):
2018-05-31 Chris Dumez <cdumez@apple.com>
Unreviewed iOS build fix after r232335.
* html/BaseChooserOnlyDateAndTimeInputType.h:
* html/BaseDateAndTimeInputType.h:
2018-05-31 Chris Dumez <cdumez@apple.com>
Unreviewed, apply review comments from Darin after r232310.
* platform/ReferrerPolicy.cpp:
(WebCore::parseReferrerPolicy):
2018-05-31 Zalan Bujtas <zalan@apple.com>
[LFC] Margin box is border box + margins.
https://bugs.webkit.org/show_bug.cgi?id=186124
Reviewed by Antti Koivisto.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
2018-05-31 Zalan Bujtas <zalan@apple.com>
[LFC] Add quirks mode setter/getting to LayoutContext
https://bugs.webkit.org/show_bug.cgi?id=186122
Reviewed by Antti Koivisto.
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::setInQuirksMode):
(WebCore::Layout::LayoutContext::inQuirksMode const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2018-05-30 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[GTK] Hardcoded text color in input fields
https://bugs.webkit.org/show_bug.cgi?id=126907
Reviewed by Carlos Garcia Campos.
Set text color in input fields to foreground theme color.
Also, set "window.background" as base GtkStyleContext to mimic
GTK applications and fix some theme bugs.
No new tests required. ManualTests/gtk/theme.html already covers it.
* platform/gtk/RenderThemeGadget.cpp:
(WebCore::baseStyleContext): Added.
(WebCore::RenderThemeGadget::RenderThemeGadget):
Use "window.background" GtkStyleContext instead of
null parent for RenderThemeGadgets.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustButtonStyle const):
Set color as foreground theme color.
(WebCore::RenderThemeGtk::adjustTextFieldStyle const): Ditto.
(WebCore::RenderThemeGtk::adjustTextAreaStyle const): Ditto.
(WebCore::RenderThemeGtk::adjustSearchFieldStyle const): Ditto.
* rendering/RenderThemeGtk.h: adjustTextAreaStyle() overriden.
2018-05-30 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Pass VM& parameter as much as possible
https://bugs.webkit.org/show_bug.cgi?id=186085
Reviewed by Saam Barati.
No behavior change.
* bindings/js/JSCSSRuleListCustom.cpp:
(WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBuiltinConstructorBase.cpp:
(WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::forwardFunctionCallToBackingMap):
(WebCore::forwardForEachCallToBackingMap):
* bindings/js/JSDOMPromise.cpp:
(WebCore::callFunction):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::DeferredPromise::callFunction):
(WebCore::createRejectedPromiseWithTypeError):
* bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementCustomPut):
(WebCore::callPlugin):
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::setWindow):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStreamInternal::callFunction):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::callFunction):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::getProperty):
(WebCore::CloneSerializer::serialize):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBufferView):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
* bridge/NP_jsobject.cpp:
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):
2018-05-28 Darin Adler <darin@apple.com>
Straighten out HTMLInputElement attribute handling
https://bugs.webkit.org/show_bug.cgi?id=186043
Reviewed by Daniel Bates.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::requiredStateChanged): Renamed from requiredAttributeChanged,
and changed to take a reference.
(WebCore::RadioButtonGroups::requiredStateChanged): Ditto.
* dom/RadioButtonGroups.h: Updated for changes above.
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): Call
updateInnerTextValue by its new name.
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): Renamed
from updateAppearance.
(WebCore::BaseChooserOnlyDateAndTimeInputType::setValue): Call
updateInnerTextValue by its new name.
(WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Override this
instead of valueAttributeChanged.
* html/BaseChooserOnlyDateAndTimeInputType.h: Tighten up inheritance a bit.
Also use final a bit more and update for changes above.
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::attributeChanged): Replaced
minOrMaxAttributeChanged with this override, checking for the attribute names.
* html/BaseDateAndTimeInputType.h: Updated for changes above.
* html/FileInputType.cpp:
(WebCore::FileInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
(WebCore::FileInputType::attributeChanged): Replaced
multipleAttributeChanged with this override, checking for the attribute names.
* html/FileInputType.h: Updated for changes above.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::parseAttribute): Updated function names to say
"state changed" rather than "attribute changed" if they are called only when the
computed value is changed, not the raw attribute value.
(WebCore::HTMLFormControlElement::readOnlyStateChanged): Updated name.
(WebCore::HTMLFormControlElement::requiredStateChanged): Ditto.
* html/HTMLFormControlElement.h: Updated for changes above.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute): Removed the code to call lots of specific
attribute changed functions that have now been deleted. Also removed empty code for a
couple of attributes.
(WebCore::HTMLInputElement::disabledStateChanged): Added. Forward call to input type.
(WebCore::HTMLInputElement::readOnlyStateChanged): Ditto.
(WebCore::HTMLInputElement::requiredStateChanged): Renamed from requiredAttributeChanged.
* html/HTMLInputElement.h: Updated for changes above.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::readOnlyStateChanged): Renamed from
readOnlyAttributeChanged. Also fixed incorrect call to base class. This may have
fixed a bug: With some work we could probably create a test case to demonstrate that.
* html/HTMLTextFormControlElement.h: Updated for changes above.
* html/ImageInputType.cpp:
(WebCore::ImageInputType::attributeChanged): Replaced
altAttributeChanged and srcAttributeChanged with this override, checking for the
attribute names.
* html/ImageInputType.h: Updated for changes above.
* html/InputType.cpp:
(WebCore::InputType::altAttributeChanged): Deleted.
(WebCore::InputType::srcAttributeChanged): Deleted.
(WebCore::InputType::maxResultsAttributeChanged): Deleted.
(WebCore::InputType::minOrMaxAttributeChanged): Deleted.
(WebCore::InputType::stepAttributeChanged): Deleted.
(WebCore::InputType::valueAttributeChanged): Deleted.
(WebCore::InputType::attributeChanged): Moved to header as an inline so derived
classes can call through to the base class with the empty function inlined.
(WebCore::InputType::multipleAttributeChanged): Deleted.
(WebCore::InputType::disabledAttributeChanged): Moved to header as an inline.
(WebCore::InputType::readonlyAttributeChanged): Ditto.
(WebCore::InputType::requiredAttributeChanged): Ditto.
* html/InputType.h: Updated for changes above.
* html/NumberInputType.cpp:
(WebCore::NumberInputType::attributeChanged): Replaced
minOrMaxAttributeChanged and stepAttributeChanged with this override, checking
for the attribute names.
* html/NumberInputType.h: Updated for changes above.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::disabledStateChanged): Renamed from
disabledAttributeChanged.
(WebCore::RangeInputType::attributeChanged): Replaced
minOrMaxAttributeChanged with this override, checking for the attribute names.
* html/RangeInputType.h: Updated for changes above.
* html/SearchInputType.cpp:
(WebCore::SearchInputType::SearchInputType): Removed unneeded initialization of
RefPtr data members to nullptr.
(WebCore::updateResultButtonPseudoType): Removed unneeded if statement; the two
cases above cover 0, and less than 0, so there is no need to check for greater
than 0 for the third case.
(WebCore::SearchInputType::attributeChanged): Replaced
maxResultsAttributeChanged with this override, checking for the attribute name.
* html/SearchInputType.h: Updated for changes above and marked more
member functions final.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::attributeChanged): Added a call through to the
base class to match the style of other overrides of this function.
(WebCore::TextFieldInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
(WebCore::TextFieldInputType::readOnlyStateChanged): Renamed from readonlyAttributeChanged.
* html/TextFieldInputType.h: Updated for changes above. Also made attributeChanged no
longer be marked final since derived classes now override it.
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::SliderThumbElement): Moved some data member initialization
from this constructor to the class definition.
(WebCore::SliderThumbElement::hostDisabledStateChanged): Renamed from disabledAttributeChanged.
* html/shadow/SliderThumbElement.h: Updated for changes above and marked more
member functions final.
2018-05-30 Nan Wang <n_wang@apple.com>
AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
https://bugs.webkit.org/show_bug.cgi?id=185246
<rdar://problem/39939028>
Reviewed by Chris Fleizach.
Exposed the fieldset's description to its form control children.
Test: accessibility/mac/aria-describedby-fieldset.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::helpText const):
2018-05-30 Chris Fleizach <cfleizach@apple.com>
AX: Expose link rel type to voiceover
https://bugs.webkit.org/show_bug.cgi?id=186084
<rdar://problem/40640871>
Reviewed by Sam Weinig.
Make the link rel attribute available to accessibility clients.
Test: accessibility/mac/linkrel.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::linkRelValue const):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityLinkRelationshipType]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2018-05-30 Brady Eidson <beidson@apple.com>
REGRESSION (r224684): User-agent seen by page does not change when modified by the develop menu options after reloading.
<rdar://problem/34918109> and https://bugs.webkit.org/show_bug.cgi?id=186111
Reviewed by Andy Estes.
Test: http/tests/navigation/useragent-reload.php
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeRequest const): Use setUserAgent() for consistency.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Clear the user agent from the original DocumentLoader request
before adding additional fields, as reloads should pick up user agent changes.
2018-05-30 Dean Jackson <dino@apple.com>
WebContent crashes with system preview content
https://bugs.webkit.org/show_bug.cgi?id=186118
Reviewed by Myles Maxfield.
We were receiving crash reports on iOS devices when getting
platformContext() from a GraphicsContext. This usually
occurred when the page was invisible. Debugging showed that
it was trying to draw with a disabled context.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge): Early
return if the context has painting disabled.
2018-05-30 Daniel Bates <dabates@apple.com>
Web Inspector: Annotate Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=184897
<rdar://problem/35178209>
Reviewed by Brian Burg.
Store and retrieve the Same-Site cookie policy from CFNetwork.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::cookieSameSitePolicyJSON): Added.
(WebCore::buildObjectForCookie): Modified to include cookie Same-Site policy.
* platform/Cookie.h:
(WebCore::Cookie::encode const): Encode Same-Site policy.
(WebCore::Cookie::decode): Decode Same-Site policy.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::portStringFromVector):
(WebCore::coreSameSitePolicy):
(WebCore::nsSameSitePolicy):
(WebCore::Cookie::operator NSHTTPCookie * _Nullable const):
(WebCore::Cookie::operator NSHTTPCookie * const): Deleted.
2018-05-30 Daniel Bates <dabates@apple.com>
NavigationAction does not need to hold initiating DOM Event
https://bugs.webkit.org/show_bug.cgi?id=185958
<rdar://problem/40531539>
Reviewed by Simon Fraser.
Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
and have NavigationAction hold only as many details of the initiating DOM Event as
necessary to support WebKit functionality. Retaining a DOM Event effectively retains
the document that associated with the event. And DocumentLoader always keeps around
the NavigationAction of the last navigation for the "benefit of the various policy handlers".
Therefore, having NavigationAction hold only the relevant details of the DOM Event
instead of the DOM Event itself we avoid keeping the document we navigated from alive
longer than necessary.
* dom/MouseRelatedEvent.h:
* dom/UIEventWithKeyState.h:
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
(WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
(WebCore::keyStateDataForFirstEventWithKeyState): Added.
(WebCore::mouseEventDataForFirstMouseEvent): Added.
* loader/NavigationAction.h:
(WebCore::NavigationAction::keyStateEventData const): Added.
(WebCore::NavigationAction::mouseEventData const): Added
(WebCore::NavigationAction::event const): Deleted.
2018-05-30 Youenn Fablet <youenn@apple.com>
Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
https://bugs.webkit.org/show_bug.cgi?id=186108
<rdar://problem/40663065>
Reviewed by Alex Christensen.
Covered by existing API tests.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithUserTypedString):
Return early if WebCore::URL is not able to create a CFURL.
Use CFURL otherwise to keep the existing behavior as much as possible.
2018-05-30 Youenn Fablet <youenn@apple.com>
Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
https://bugs.webkit.org/show_bug.cgi?id=186082
Reviewed by Chris Dumez.
No change of behavior.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled):
(WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const):
(WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const): Deleted.
2018-05-30 Chris Dumez <cdumez@apple.com>
Referrer-Policy response header is ignored
https://bugs.webkit.org/show_bug.cgi?id=186037
<rdar://problem/40600335>
Reviewed by Youenn Fablet.
Add support for Referrer-Policy HTTP response header:
- https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header
Tests: http/tests/security/referrer-policy-header-and-meta-tag-emptyString.html
http/tests/security/referrer-policy-header-and-meta-tag.html
http/tests/security/referrer-policy-header.html
* dom/Document.cpp:
(WebCore::Document::setReferrerPolicy):
(WebCore::Document::processReferrerPolicy):
* dom/Document.h:
(WebCore::Document::referrerPolicy const):
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::updateReferrerPolicy):
* platform/ReferrerPolicy.cpp:
(WebCore::parseReferrerPolicyToken):
(WebCore::parseReferrerPolicy):
* platform/ReferrerPolicy.h:
2018-05-30 Youenn Fablet <youenn@apple.com>
Rename CrossOriginResourcePolicy same to same-origin
https://bugs.webkit.org/show_bug.cgi?id=186080
Reviewed by Chris Dumez.
Covered by updated tests.
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginResourcePolicyHeader):
* platform/network/HTTPParsers.h:
2018-05-30 Aditya Keerthi <akeerthi@apple.com>
Fix the ENABLE(DATALIST_ELEMENT) build
https://bugs.webkit.org/show_bug.cgi?id=186105
Reviewed by Wenson Hsieh.
* WebCore.xcodeproj/project.pbxproj:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestions const):
* html/HTMLInputElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::ownerDataListElement const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):
2018-05-30 Alex Christensen <achristensen@webkit.org>
Reduce String allocations
https://bugs.webkit.org/show_bug.cgi?id=186059
Reviewed by Darin Adler.
Don't allocate Strings just to convert it to another form.
Based mostly on Darin's feedback on bug 185986.
No change in behavior.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::hostName):
(WebCore::WebSocketHandshake::host const):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeANPlusB):
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::wildcardMatches):
(WebCore::ContentSecurityPolicySource::hostMatches const):
* platform/URL.cpp:
(WebCore::URL::hostAndPort const):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::createStreams):
2018-05-30 Jer Noble <jer.noble@apple.com>
Media elements outside fullscreen should not be considered main content.
https://bugs.webkit.org/show_bug.cgi?id=186063
<rdar://problem/40630437>
Reviewed by Eric Carlson.
Test: platform/mac/media/video-best-element-for-playback-controls-purpose.html
Media elements outside the current fullscreen element are not visible, and thus should not be considered
main content.
Drive-by fix: set the m_hasEverNotifiedAboutPlaying before dispatching the 'playing' event, so that
tests can check bestMediaElementForShowingPlaybackControlsManager() in the 'playing' handler.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::notifyAboutPlaying):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:
* testing/Internals.idl:
2018-05-30 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence a -Wreturn-type warning
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::glyphOrientationToCSSPrimitiveValue):
2018-05-30 Alexey Proskuryakov <ap@apple.com>
Build fix attempt after https://trac.webkit.org/r232198
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection): Added some toString() calls.
2018-05-30 Zalan Bujtas <zalan@apple.com>
[LFC] Miscellaneous fixes to get closer to geometry correctness
https://bugs.webkit.org/show_bug.cgi?id=186083
Reviewed by Antti Koivisto.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::isStretchedToViewport):
(WebCore::Layout::initialContainingBlock):
(WebCore::Layout::computedInFlowNonReplacedComputedHeight):
(WebCore::Layout::inFlowNonReplacedComputedWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): lambda should capture the specification part.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isDocumentBox const):
(WebCore::Layout::Box::isBodyBox const):
* layout/layouttree/LayoutBox.h:
* rendering/style/BorderValue.h: ignore border-width when type is hidden or none.
(WebCore::BorderValue::boxModelWidth const):
2018-05-30 Stephen McGruer <smcgruer@chromium.org>
iOS: setting 'defaultValue' of input type=date from script should cause a UI update
https://bugs.webkit.org/show_bug.cgi?id=185982
Reviewed by Darin Adler.
Test: fast/forms/date/date-appearance-defaultValue.html
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged):
* html/BaseChooserOnlyDateAndTimeInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
* html/InputType.cpp:
(WebCore::InputType::valueAttributeChanged):
* html/InputType.h:
2018-05-29 Nan Wang <n_wang@apple.com>
Unreviewed, follow-up after r232285
https://bugs.webkit.org/show_bug.cgi?id=180871
Removed redundant null check.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isExpanded const):
2018-05-29 Nan Wang <n_wang@apple.com>
AX: macOS VoiceOver doesn't announce when details element is expanded when using role group
https://bugs.webkit.org/show_bug.cgi?id=180866
<rdar://problem/36074338>
Reviewed by Chris Fleizach.
We should use is<HTMLDetailsElement> to check for the details parent instead
of using the role.
Added test cases to the existing test.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isExpanded const):
2018-05-29 Youenn Fablet <youenn@apple.com>
Add a consistency check between URL and CFURL
https://bugs.webkit.org/show_bug.cgi?id=186057
<rdar://problem/40258457>
Reviewed by Geoff Garen.
It is important that WebCore::URL used in WebCore and CFURL that gets serialized in the network pipe remain consistent.
Otherwise, we will end-up with odd bugs.
We add such a check when creating a CFURL from an URL.
To make things more consistent, we also rely now more on WebCore::URL instead of directly creating a CFURL.
* platform/URL.h:
* platform/cf/CFURLExtras.cpp:
(WebCore::isCFURLSameOrigin):
* platform/cf/CFURLExtras.h:
* platform/cf/URLCF.cpp:
(WebCore::URL::createCFURL const):
* platform/mac/URLMac.mm:
(WebCore::URL::createCFURL const):
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithUserTypedString):
2018-05-29 Timothy Hatcher <timothy@apple.com>
Printing does not apply the right colors in all cases.
https://bugs.webkit.org/show_bug.cgi?id=186066
rdar://problem/40274975
Reviewed by Tim Horton.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia): Call RenderTheme::platformColorsDidChange
to invalidate the color cache.
* page/FrameView.cpp:
(WebCore::FrameView::adjustMediaTypeForPrinting): Ditto.
* page/Page.cpp:
(WebCore::Page::defaultAppearance const): Added. Use default when not screen.
* page/Page.h:
(WebCore::Page::defaultAppearance const): Deleted.
2018-05-29 Per Arne Vollan <pvollan@apple.com>
Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
https://bugs.webkit.org/show_bug.cgi?id=186056
Reviewed by Brent Fulgham.
No new tests, no change in behavior.
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenProperties):
(WebCore::getScreenProperties):
(WebCore::setScreenProperties):
2018-05-29 Ryosuke Niwa <rniwa@webkit.org>
iOS WK1: Occasional crash in sanitizedMarkupForFragmentInDocument
https://bugs.webkit.org/show_bug.cgi?id=186011
Reviewed by David Kilzer.
The crash was caused by the HTML parser in sanitizedMarkupForFragmentInDocument yielding in the web thread
when _WebThreadLock() sets webThreadShouldYield to true in the main thread.
No new tests. This is occasionally caught by existing tests.
* editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent): Fixed the bug by making the HTML parser never yield.
Also release-assert that the body is never null here.
(WebCore::sanitizedMarkupForFragmentInDocument): Removed superflous call to WTFMove since appendChild
takes a reference, not a Ref.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage): Deployed the same fix.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::insertDataSynchronously): Added.
* loader/DocumentWriter.h:
2018-05-29 Chris Dumez <cdumez@apple.com>
Avoid unnecessary String allocation in isPublicSuffix(const String&)
https://bugs.webkit.org/show_bug.cgi?id=186054
Reviewed by Sam Weinig.
Avoid unnecessary String allocation in isPublicSuffix(const String&) by calling directly
the decodeHostName() overload taking in a NSString*. This overload returns a NSString*,
which is what we need. We would previously call the overloading taking in a String, which
would return a String, which we would have to convert back to a NSString*.
* platform/mac/PublicSuffixMac.mm:
(WebCore::isPublicSuffix):
2018-05-29 Alex Christensen <achristensen@webkit.org>
Do even fewer allocations in URL host operations
https://bugs.webkit.org/show_bug.cgi?id=186003
Reviewed by Geoffrey Garen.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::primaryDomain):
* loader/ResourceLoadStatistics.h:
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress):
* platform/URL.h:
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress):
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress):
2018-05-29 Tadeu Zagallo <tzagallo@apple.com>
Don't assert on m_actionsStart when setting actions on DFA nodes
https://bugs.webkit.org/show_bug.cgi?id=185979
<rdar://problem/39669458>
Reviewed by Geoffrey Garen.
DFANode::setActions is called immediately after the node is created, and once again to set
the actions of catch-all regular expressions (.*) on the root node. That works because
m_actionsStart is initially 0, since the root was the first node to be created, but may fail
after minimizing the DFA, when the root may no longer be the first node, and therefore
m_actionsStart would not be 0, even if there are no actions attached to that node.
Test: http/tests/contentextensions/root-actions.html
* contentextensions/DFANode.h:
2018-05-29 Nan Wang <n_wang@apple.com>
AX: setValue on contenteditable should preserve whitespace
https://bugs.webkit.org/show_bug.cgi?id=185897
Reviewed by Ryosuke Niwa.
We should mimic typing when setting value to a contenteditable from accessibility
instead of mutating the DOM by using setInnerText.
Updated tests to cover this change.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):
2018-05-29 Zalan Bujtas <zalan@apple.com>
[LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
https://bugs.webkit.org/show_bug.cgi?id=186052
Reviewed by Antti Koivisto.
With this patch, LayoutContext::layout() does not assert on <html><body><div></div></body></html> anymore.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot): New context root is always a layout root.
* layout/LayoutContext.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const): we need computed margin/border/padding for width computation
* layout/displaytree/DisplayBox.cpp: Add clone() method to be able to carry over the 'hasValid*' bits.
(WebCore::Display::Box::Style::Style):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::Rect::operator LayoutRect const):
(WebCore::Display::Box::setSize):
(WebCore::Display::Box::setHasValidMargin):
(WebCore::Display::Box::setHasValidBorder):
(WebCore::Display::Box::setHasValidPadding):
(WebCore::Display::Box::Rect::setHasValidPosition):
(WebCore::Display::Box::Rect::setHasValidSize):
(WebCore::Display::Box::Rect::setSize):
(WebCore::Display::Box::Rect::clone const):
(WebCore::Display::Box::setMargin):
(WebCore::Display::Box::setBorder):
(WebCore::Display::Box::setPadding):
(WebCore::Display::Box::Rect::Rect): Deleted.
2018-05-29 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] "Significant area painted" rendering progress event is rarely fired
https://bugs.webkit.org/show_bug.cgi?id=186042
<rdar://problem/40604182>
Reviewed by Tim Horton.
Makes a minor tweak to the size of the relevant view rect in extra zoom mode, such that it's no wider than the
visible content rect. Previously, the width of this rect has hard-coded to a value optimized for macOS (980),
which makes it difficult for content laid out at device width in extra zoom mode to cover a significant portion
of the relevant view rect.
Test: RenderingProgressTests.FirstPaintWithSignificantArea
* page/Page.cpp:
(WebCore::relevantViewRect):
2018-05-29 Antoine Quint <graouts@apple.com>
[Web Animations] Handle relative length units
https://bugs.webkit.org/show_bug.cgi?id=186047
Reviewed by Dean Jackson.
In order to correctly handle relative units, such as "em", "vw" and "vh", we need to do two things.
First, because we need to apply the cascade to correctly compute relative lengths, we need to delay the computation of
"blending keyframes" to when we have both keyframes data and a valid target. This also means that we need to reset blending
keyframes when the target changes. As a result, old call sites of updateBlendingKeyframes() have been replaced by a call to
m_blendingKeyframes.clear() and the method now gets called as part of apply() with the RenderStyle of the targeted element
as a parameter.
Second, and as a result of the first change, we need to update the accelerated animation state based on animation
progress rather than when calling specific methods, such as Animation.play() and Animation.pause(), since blending
keyframes may not be available at those more specific call sites. We now have a new updateAcceleratedAnimationState()
method that gets called as part of apply(). We also rename animationPlayStateDidChange() to animationSuspensionStateDidChange()
since this method was specific to suspension and had a confusing name.
* animation/AnimationEffectReadOnly.h: Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Fix a crash that revealed itself after other changes in this patch. We would later
call into ComputedStyleExtractor::animationSuspensionStateDidChange() and this would yield an assertion because we'd call potentially
call it with a custom CSS property.
(WebCore::KeyframeEffectReadOnly::processKeyframes): Reset blending keyframes instead of calling updateBlendingKeyframes() since
blending keyframes is now performed asynchronously upon style resolution.
(WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes): Take the target's RenderStyle as a parameter and use it to reset the
associated StyleResolver's state, just like we do in StyleResolver::keyframeStylesForAnimation(), so that the CSS cascade is correctly
accounted for when computing values using relative length units. Since blending keyframes can now be computed several times for a
given set of keyframes, since the effect's target may change, we also need to create a copy of the MutableStyleProperties to pass
to StyleRuleKeyframe::create().
(WebCore::KeyframeEffectReadOnly::setTarget): Reset blending keyframes instead of calling updateBlendingKeyframes() since
blending keyframes is now performed asynchronously upon style resolution.
(WebCore::KeyframeEffectReadOnly::apply): Update blending keyframes and the accelerated animation state.
(WebCore::KeyframeEffectReadOnly::getAnimatedStyle): Make sure we have blending keyframes with a call to updateBlendingKeyframes()
in case the animation hasn't naturally progressed when this method is called.
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Make sure we have blending keyframes with a call to
updateBlendingKeyframes() in case the animation hasn't naturally progressed when this method is called.
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): Account for the animation's local time and play state to update
the accelerated animation state.
(WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Record the last accelerated action in a member variable which we can
use to determine if we're running accelerated accounting for uncommited changes.
(WebCore::KeyframeEffectReadOnly::animationDidSeek): Only record an AcceleratedAction::Seek action if we're already running accelerated.
(WebCore::KeyframeEffectReadOnly::animationSuspensionStateDidChange): Only record an AcceleratedAction::Pause or AcceleratedAction::Play
action if we're already running accelerated.
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Ensure we clone and clear the list of accelerated actions and check that
we have any cloned actions before proceeding any further. Then we can stop accounting for m_startedAccelerated since the list of accelerated
actions already account for animation state changes.
(WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Deleted.
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::isRunningAccelerated const): Account for the m_lastRecordedAcceleratedAction to identify whether we're running.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::play): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
the animation's effect is applied.
(WebCore::WebAnimation::pause): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
the animation's effect is applied.
(WebCore::WebAnimation::resolve): Make sure we update the finished state prior to applying the animation's effect since the play state can
change when updating the finished state and KeyframeEffectReadOnly::updateAcceleratedAnimationState(), which is called when calling into
KeyframeEffectReadOnly::apply(), relies on it to correctly update the accelerated animation state.
(WebCore::WebAnimation::setSuspended): Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
* css/StyleResolver.cpp:
(WebCore::StyleResolver::setNewStateWithElement): Add a new public method to reset a StyleResolver's state such that we can call it when creating
blending keyframes for JS-originated animations just like we do when creating blending keyframes for CSS Animations in keyframeStylesForAnimation().
(WebCore::StyleResolver::keyframeStylesForAnimation): Use the new setNewStateWithElement() method.
* css/StyleResolver.h:
2018-05-29 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Update "qtdemux: Clarify field name about stream-encryption-system" patch
https://bugs.webkit.org/show_bug.cgi?id=186040
Reviewed by Xabier Rodriguez-Calvar.
s/avalaible-stream-encryption-systems/available-stream-encryption-systems/g
Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::extractEventsAndSystemsFromMessage):
2018-05-28 Zalan Bujtas <zalan@apple.com>
Unreviewed build fix.
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::Rect::operator LayoutRect const):
2018-05-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add Rect interface to Display::Box
https://bugs.webkit.org/show_bug.cgi?id=186019
Reviewed by Antti Koivisto.
Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
displayBox.contentBox().left() even when the widht/height are not computed yet.
Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::Rect::invalidateTop):
(WebCore::Display::Box::Rect::invalidateLeft):
(WebCore::Display::Box::Rect::invalidateWidth):
(WebCore::Display::Box::Rect::invalidateHeight):
(WebCore::Display::Box::Rect::hasValidPosition const):
(WebCore::Display::Box::Rect::hasValidSize const):
(WebCore::Display::Box::Rect::hasValidGeometry const):
(WebCore::Display::Box::rect const):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::left const):
(WebCore::Display::Box::bottom const):
(WebCore::Display::Box::right const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::bottomRight const):
(WebCore::Display::Box::size const):
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::setWidth):
(WebCore::Display::Box::setHeight):
(WebCore::Display::Box::Rect::invalidatePosition):
(WebCore::Display::Box::Rect::setHasValidPosition):
(WebCore::Display::Box::Rect::Rect):
(WebCore::Display::Box::Rect::top const):
(WebCore::Display::Box::Rect::left const):
(WebCore::Display::Box::Rect::bottom const):
(WebCore::Display::Box::Rect::right const):
(WebCore::Display::Box::Rect::topLeft const):
(WebCore::Display::Box::Rect::bottomRight const):
(WebCore::Display::Box::Rect::size const):
(WebCore::Display::Box::Rect::width const):
(WebCore::Display::Box::Rect::height const):
(WebCore::Display::Box::Rect::setTopLeft):
(WebCore::Display::Box::Rect::setTop):
(WebCore::Display::Box::Rect::setLeft):
(WebCore::Display::Box::Rect::setWidth):
(WebCore::Display::Box::Rect::setHeight):
(WebCore::Display::Box::Rect::shiftLeftTo):
(WebCore::Display::Box::Rect::shiftRightTo):
(WebCore::Display::Box::Rect::shiftTopTo):
(WebCore::Display::Box::Rect::shiftBottomTo):
(WebCore::Display::Box::Rect::expand):
(WebCore::Display::Box::invalidateTop): Deleted.
(WebCore::Display::Box::invalidateLeft): Deleted.
(WebCore::Display::Box::invalidateWidth): Deleted.
(WebCore::Display::Box::invalidateHeight): Deleted.
(WebCore::Display::Box::hasValidPosition const): Deleted.
(WebCore::Display::Box::hasValidSize const): Deleted.
(WebCore::Display::Box::hasValidGeometry const): Deleted.
(WebCore::Display::Box::invalidatePosition): Deleted.
(WebCore::Display::Box::setHasValidPosition): Deleted.
2018-05-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add formatting context testing codepath in FrameViewLayoutContext
https://bugs.webkit.org/show_bug.cgi?id=186036
Reviewed by Antti Koivisto.
This is to verify the formatting context layout correctness.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::LayoutContext):
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
(WebCore::FrameViewLayoutContext::layout):
2018-05-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add layout tree verification.
https://bugs.webkit.org/show_bug.cgi?id=186018
Reviewed by Antti Koivisto.
Compare layout and render tree geometry and output the mismtaching rectangles.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
* layout/LayoutContext.h:
* layout/Verification.cpp: Added.
(WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
(WebCore::Layout::verifySubtree):
(WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
2018-05-28 Sam Weinig <sam@webkit.org>
Modernize SVGRenderStyleDefs.h
https://bugs.webkit.org/show_bug.cgi?id=186024
Reviewed by Daniel Bates.
Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
- Converting them to enum classes
- Renaming them to remove unnecessary prefix 'E's
- Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
- Renaming to match modern conventions (e.g BNONE -> None)
Modernizes the following enums:
SVGPaintType
BaselineShift (renamed from EBaselineShift)
TextAnchor (renamed from ETextAnchor)
ColorInterpolation (renamed from EColorInterpolation)
ColorRendering (renamed from EColorRendering)
ShapeRendering (renamed from EShapeRendering)
GlyphOrientation (renamed from EGlyphOrientation)
AlignmentBaseline (renamed from EAlignmentBaseline)
DominantBaseline (renamed from EDominantBaseline)
VectorEffect (renamed from EVectorEffect)
BufferedRendering (renamed from EBufferedRendering)
MaskType (renamed from EMaskType)
WindRule
* css/CSSBasicShapes.cpp:
(WebCore::buildPathString):
(WebCore::buildPolygonString):
* css/CSSBasicShapes.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WindRule const):
(WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
(WebCore::CSSPrimitiveValue::operator BufferedRendering const):
(WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
(WebCore::CSSPrimitiveValue::operator ColorRendering const):
(WebCore::CSSPrimitiveValue::operator DominantBaseline const):
(WebCore::CSSPrimitiveValue::operator ShapeRendering const):
(WebCore::CSSPrimitiveValue::operator TextAnchor const):
(WebCore::CSSPrimitiveValue::operator VectorEffect const):
(WebCore::CSSPrimitiveValue::operator MaskType const):
(WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
(WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
(WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
(WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
(WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::glyphOrientationToCSSPrimitiveValue):
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGlyphOrientation):
(WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueBaselineShift):
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapePolygon):
(WebCore::consumeBasicShapePath):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::toWindRule):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
* platform/graphics/FloatPolygon.cpp:
(WebCore::FloatPolygon::contains const):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::shapeLayerWindRule const):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsTypes.cpp:
(WebCore::operator<<):
* platform/graphics/Path.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::drawInsetShadow):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
* platform/graphics/WindRule.h:
(): Deleted.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::shapeWindRule const):
(PlatformCALayerCocoa::setShapeWindRule):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::calculateDrawingMode):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clipPath):
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::contains const):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawAnimation):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::clipBorderSidePolygon):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeClipPath const):
* rendering/style/BasicShapes.h:
(WebCore::BasicShape::windRule const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillPaintType const):
(WebCore::RenderStyle::setFillPaintColor):
(WebCore::RenderStyle::strokePaintType const):
(WebCore::RenderStyle::setStrokePaintColor):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialAlignmentBaseline):
(WebCore::SVGRenderStyle::initialDominantBaseline):
(WebCore::SVGRenderStyle::initialBaselineShift):
(WebCore::SVGRenderStyle::initialVectorEffect):
(WebCore::SVGRenderStyle::initialBufferedRendering):
(WebCore::SVGRenderStyle::initialClipRule):
(WebCore::SVGRenderStyle::initialColorInterpolation):
(WebCore::SVGRenderStyle::initialColorInterpolationFilters):
(WebCore::SVGRenderStyle::initialColorRendering):
(WebCore::SVGRenderStyle::initialFillRule):
(WebCore::SVGRenderStyle::initialShapeRendering):
(WebCore::SVGRenderStyle::initialTextAnchor):
(WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
(WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
(WebCore::SVGRenderStyle::initialFillPaintType):
(WebCore::SVGRenderStyle::initialStrokePaintType):
(WebCore::SVGRenderStyle::initialMaskType):
(WebCore::SVGRenderStyle::setAlignmentBaseline):
(WebCore::SVGRenderStyle::setDominantBaseline):
(WebCore::SVGRenderStyle::setBaselineShift):
(WebCore::SVGRenderStyle::setVectorEffect):
(WebCore::SVGRenderStyle::setBufferedRendering):
(WebCore::SVGRenderStyle::setClipRule):
(WebCore::SVGRenderStyle::setColorInterpolation):
(WebCore::SVGRenderStyle::setColorInterpolationFilters):
(WebCore::SVGRenderStyle::setColorRendering):
(WebCore::SVGRenderStyle::setFillRule):
(WebCore::SVGRenderStyle::setShapeRendering):
(WebCore::SVGRenderStyle::setTextAnchor):
(WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
(WebCore::SVGRenderStyle::setGlyphOrientationVertical):
(WebCore::SVGRenderStyle::setMaskType):
(WebCore::SVGRenderStyle::alignmentBaseline const):
(WebCore::SVGRenderStyle::dominantBaseline const):
(WebCore::SVGRenderStyle::baselineShift const):
(WebCore::SVGRenderStyle::vectorEffect const):
(WebCore::SVGRenderStyle::bufferedRendering const):
(WebCore::SVGRenderStyle::clipRule const):
(WebCore::SVGRenderStyle::colorInterpolation const):
(WebCore::SVGRenderStyle::colorInterpolationFilters const):
(WebCore::SVGRenderStyle::colorRendering const):
(WebCore::SVGRenderStyle::fillRule const):
(WebCore::SVGRenderStyle::shapeRendering const):
(WebCore::SVGRenderStyle::textAnchor const):
(WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
(WebCore::SVGRenderStyle::glyphOrientationVertical const):
(WebCore::SVGRenderStyle::fillPaintType const):
(WebCore::SVGRenderStyle::strokePaintType const):
(WebCore::SVGRenderStyle::maskType const):
(WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
(WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
(WebCore::SVGRenderStyle::hasStroke const):
(WebCore::SVGRenderStyle::hasFill const):
(WebCore::SVGRenderStyle::setBitDefaults):
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::StyleFillData::create):
(WebCore::StyleFillData::operator!= const):
(WebCore::StyleStrokeData::create):
(WebCore::StyleStrokeData::operator!= const):
(WebCore::StyleStopData::create):
(WebCore::StyleStopData::operator!= const):
(WebCore::StyleTextData::create):
(WebCore::StyleTextData::operator!= const):
(WebCore::StyleMiscData::create):
(WebCore::StyleMiscData::operator!= const):
(WebCore::StyleShadowSVGData::create):
(WebCore::StyleShadowSVGData::operator!= const):
(WebCore::StyleResourceData::create):
(WebCore::StyleResourceData::operator!= const):
(WebCore::StyleInheritedResourceData::create):
(WebCore::StyleInheritedResourceData::operator!= const):
(WebCore::StyleLayoutData::create):
(WebCore::StyleLayoutData::operator!= const):
(): Deleted.
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
(WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::applyResource):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::paint):
* rendering/svg/RenderSVGShape.h:
(WebCore::RenderSVGShape::hasNonScalingStroke const):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
(WebCore::writeSVGInlineTextBox):
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
(WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
(WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
* rendering/svg/SVGTextLayoutEngineBaseline.h:
2018-05-28 Carlos Garcia Campos <cgarcia@igalia.com>
[Web Animations] Test webanimations/css-animations.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=186031
Reviewed by Antoine Quint.
This is another case of std::optional value being used while it's nullopt, I guess this started to fail when we
stopped using the WTF implementation of std::optional. The problem is that we try to get the current iteration
of a declarative animation when the active time is unresolved.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::invalidateDOMEvents): Use value_or(0) instead of value() to get the current
iteration of the effect.
2018-05-28 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message.
https://bugs.webkit.org/show_bug.cgi?id=185948
Reviewed by Xabier Rodriguez-Calvar.
- The "stream-encryption-systems" field of the "drm-preferred-decryption-system-id" query was renamed to
"avalaible-stream-encryption-systems"
- It can now be NULL, meaning there is no decryptor avalaible.
Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::extractEventsAndSystemsFromMessage): Handle NULL value for "avalaible-stream-encryption-systems",
moved some code to make the order of the Arrays in the pair clearer.
2018-05-27 Dan Bernstein <mitz@apple.com>
Reverted the changes made for https://webkit.org/b/186016
They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
2018-05-27 David Kilzer <ddkilzer@apple.com>
[iOS] Fix warnings about leaks found by clang static analyzer
<https://webkit.org/b/186009>
<rdar://problem/40574267>
Reviewed by Daniel Bates.
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticator::makeCredential):
(WebCore::LocalAuthenticator::getAssertion):
(WebCore::LocalAuthenticator::issueClientCertificate const):
- Don't leak CF objects in early return paths, and get rid of
`retained*` variables, by making original variables use
RetainPtr<>.
* bridge/objc/WebScriptObject.mm:
(+[WebUndefined allocWithZone:]): Modernize WebUndefined by
using NeverDestroyed<RetainPr<WebUndefined>> type. Explicitly
retain the object returned on each call.
(+[WebUndefined undefined]): Explicitly autorelease the object
returned. Note that neither of these changes fixes the static
analyzer warnings in this source file.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to
stop leaking NSString objects in a loop.
* platform/ios/wak/WAKWindow.h:
(-[WAKWindow _newFirstResponderAfterResigning]): Mark as
NS_RETURNS_NOT_RETAINED like the corresponding AppKit method
since this doesn't return a new object. This fixes some
false-positive leaks warnings.
2018-05-27 Dan Bernstein <mitz@apple.com>
[Cocoa] Avoid importing directly from subumbrella frameworks
https://bugs.webkit.org/show_bug.cgi?id=186016
Reviewed by Sam Weinig.
* Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS.
* editing/mac/DictionaryLookup.mm: Import Quartz.h instead of a PDFKit header.
* html/HTMLKeygenElement.cpp: Removed "using namespace WebCore" from this WebCore
implementation file.
* platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
* platform/mac/PlatformScreenMac.mm: Import ApplicationServices.h instead of ColorSync.h
when using SDKs earlier than 10.13.
* platform/mediastream/CaptureDeviceManager.cpp: Enclosed the definitions in the WebCore
namespace and removed "using namespace WebCore" from this WebCore implementation file.
* platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2018-05-27 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r232198) [WinCairo] cannot convert from 'WTF::StringView' to 'const WTF::String'
https://bugs.webkit.org/show_bug.cgi?id=186027
Unreviewed build fix
No new tests (No behavior change).
* platform/network/curl/AuthenticationChallengeCurl.cpp:
(WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::willSetupSslCtx):
2018-05-27 Sam Weinig <sam@webkit.org>
Modernize RenderStyleConstants.h - Part 3
https://bugs.webkit.org/show_bug.cgi?id=186015
Reviewed by Yusuke Suzuki.
Modernized the third and final set of enums in RenderStyleConstants.h by:
- Converting them to enum classes
- Renaming them to remove unnecessary prefix 'E's
- Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
Modernizes the following enums:
TextDecoration
TextDecorationSkip (renamed from TextDecorationSkipItems)
TextUnderlinePosition
HangingPunctuation
SpeakAs (renamed from ESpeakAs)
TextEmphasisPosition (renamed from TextEmphasisPositions)
This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
so this change also converts their uses to use OptionSet.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::speakAsProperty const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::speakAsProperty const):
(WebCore::AccessibilityRenderObject::hasPlainText const):
(WebCore::AccessibilityRenderObject::hasUnderline const):
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(AXAttributeStringSetStyle):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetStyle):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderTextDecorationFlagsToCSSValue):
(WebCore::renderTextDecorationSkipFlagsToCSSValue):
(WebCore::renderEmphasisPositionFlagsToCSSValue):
(WebCore::speakAsToCSSValue):
(WebCore::hangingPunctuationToCSSValue):
* css/CSSLineBoxContainValue.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
(WebCore::CSSPrimitiveValue::operator TextDecoration const):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
(WebCore::CSSPrimitiveValue::operator SpeakAs const):
(WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextDecoration):
(WebCore::StyleBuilderConverter::valueToEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::valueToDecorationSkip):
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
(WebCore::StyleBuilderConverter::convertSpeakAs):
(WebCore::StyleBuilderConverter::convertHangingPunctuation):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedStringFromRange):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
(WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
* rendering/InlineFlowBox.h:
* rendering/InlineTextBox.cpp:
(WebCore::emphasisPositionHasNeitherLeftNorRight):
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::enclosingRendererWithTextDecoration const):
* rendering/RenderElement.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addCell):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::TextDecorationPainter):
(WebCore::TextDecorationPainter::paintTextDecoration):
(WebCore::collectStylesForRenderer):
(WebCore::TextDecorationPainter::stylesForRenderer):
* rendering/TextDecorationPainter.h:
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::textDecorationsInEffect const):
(WebCore::RenderStyle::textDecoration const):
(WebCore::RenderStyle::textDecorationSkip const):
(WebCore::RenderStyle::hangingPunctuation const):
(WebCore::RenderStyle::textEmphasisPosition const):
(WebCore::RenderStyle::speakAs const):
(WebCore::RenderStyle::addToTextDecorationsInEffect):
(WebCore::RenderStyle::setTextDecorationsInEffect):
(WebCore::RenderStyle::setTextDecoration):
(WebCore::RenderStyle::setTextDecorationSkip):
(WebCore::RenderStyle::setSpeakAs):
(WebCore::RenderStyle::setTextEmphasisPosition):
(WebCore::RenderStyle::setHangingPunctuation):
(WebCore::RenderStyle::initialHangingPunctuation):
(WebCore::RenderStyle::initialTextDecoration):
(WebCore::RenderStyle::initialTextDecorationSkip):
(WebCore::RenderStyle::initialTextUnderlinePosition):
(WebCore::RenderStyle::initialSpeakAs):
(WebCore::RenderStyle::initialTextEmphasisPosition):
* rendering/style/RenderStyleConstants.h:
(WebCore::operator|): Deleted.
(WebCore::operator|=): Deleted.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/style/StyleVisualData.cpp:
(WebCore::StyleVisualData::StyleVisualData):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint):
(WebCore::positionOffsetForDecoration):
(WebCore::thicknessForDecoration):
(WebCore::findRendererDefininingTextDecoration):
(WebCore::SVGInlineTextBox::paintDecoration):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
* rendering/svg/SVGInlineTextBox.h:
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
(WebCore::visualOverflowForDecorations):
2018-05-26 Zalan Bujtas <zalan@apple.com>
[LFC] Implement margin computation
https://bugs.webkit.org/show_bug.cgi?id=186008
Reviewed by Antti Koivisto.
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeMargin const):
(WebCore::Layout::FormattingContext::marginTop const): Deleted.
(WebCore::Layout::FormattingContext::marginLeft const): Deleted.
(WebCore::Layout::FormattingContext::marginBottom const): Deleted.
(WebCore::Layout::FormattingContext::marginRight const): Deleted.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeMargin const):
(WebCore::Layout::BlockFormattingContext::marginTop const): Deleted.
(WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight):
(WebCore::Layout::BlockFormattingContext::Geometry::computedMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::_isMarginBottomCollapsedWithParent):
(WebCore::Layout::collapsedMarginBottomFromLastChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
(WebCore::Layout::BlockMarginCollapse::marginTop): Deleted.
(WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
* layout/blockformatting/BlockMarginCollapse.h: Removed.
2018-05-25 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Delete unnecessary WebCascadeList in ComplexTextController
https://bugs.webkit.org/show_bug.cgi?id=186007
Reviewed by Zalan Bujtas.
Inside ComplexTextController::collectComplexTextRuns(), we chop up text based on which fonts should be
used to render which grapheme clusters. For each grapheme cluster, we run through the font-family list
in FontCascade::fontForCombiningCharacterSequence() and find the first font that can render the cluster.
If no items can render the cluster, we construct a WebCascadeList and let CoreText try to figure out
which fonts can render which clusters.
Except there's no point, because we just determined that no font in the list can be used to render the
cluster. CoreText isn't magic; it isn't going to somehow disagree with us. WebCascadeList is just
useless code.
No new tests because there is no behavior change.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
(-[WebCascadeList initWithFont:character:]): Deleted.
(-[WebCascadeList count]): Deleted.
(-[WebCascadeList objectAtIndex:]): Deleted.
2018-05-25 Myles C. Maxfield <mmaxfield@apple.com>
Improve the performance of Font::canRenderCombiningCharacterSequence()
https://bugs.webkit.org/show_bug.cgi?id=185933
Reviewed by Ryosuke Niwa.
We don't need to create a whole CTLine just to determine whether or not a font supports rendering a grapheme cluster.
Instead, the right way to do it is just see if the font's cmap table supports every code point in the cluster.
This patch reports a 2% progression on the attached PerformanceTest.
Test: Layout/ComplexLongUnique.html
* platform/graphics/Font.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const):
* platform/graphics/Font.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::provideStringAndAttributes): Deleted.
(WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
2018-05-25 Eric Carlson <eric.carlson@apple.com>
Captions are sized incorrectly in PiP mode
https://bugs.webkit.org/show_bug.cgi?id=186005
<rdar://problem/39729718>
Reviewed by Dean Jackson.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds
when the size actually changes.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
(WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.
2018-05-25 Timothy Hatcher <timothy@apple.com>
Setting drawsBackground to YES on a WKView doesn't take effect immediately
https://bugs.webkit.org/show_bug.cgi?id=185885
rdar://problem/39706506
Reviewed by Simon Fraser.
* page/Frame.cpp:
(WebCore::Frame::createView): Always call updateBackgroundRecursively, it handles
invalid colors correctly already.
* page/FrameView.cpp:
(WebCore::FrameView::setTransparent): Call setNeedsLayout() since base background color
and transparent is used to update layers.
(WebCore::FrameView::setBaseBackgroundColor): Ditto.
(WebCore::FrameView::updateBackgroundRecursively): Schedule layout if needed.
* page/FrameView.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::viewHasTransparentBackground const): Use baseBackgroundColor
instead of hardcoding white.
(WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Fixed incorrect changed logging.
2018-05-25 Youenn Fablet <youenn@apple.com>
Migrate From-Origin to Cross-Origin-Resource-Policy
https://bugs.webkit.org/show_bug.cgi?id=185840
Reviewed by Chris Dumez.
Tests: http/wpt/cross-origin-resource-policy/fetch-in-iframe.html
http/wpt/cross-origin-resource-policy/fetch.html
http/wpt/cross-origin-resource-policy/iframe-loads.html
http/wpt/cross-origin-resource-policy/image-loads.html
http/wpt/cross-origin-resource-policy/script-loads.html
* platform/network/HTTPHeaderNames.in:
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginResourcePolicyHeader):
* platform/network/HTTPParsers.h:
2018-05-25 Daniel Bates <dabates@apple.com>
NavigationAction should not hold a strong reference to a Document
https://bugs.webkit.org/show_bug.cgi?id=185712
<rdar://problem/40320916>
Reviewed by Brent Fulgham.
Have NavigationAction store all the relevant details callers need to know about the document
that initiated the navigation in an independent data structure, called NavigationAction::Requester,
as opposed to holding a RefPtr to the document itself. The benefit of this approach is that it
is a step towards ensuring that NavigationAction does not keep the document alive after navigating
to a new document given that DocumentLoader stores the NavigationAction for the last navigation.
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::Requester::Requester): Track all relevant details of the document that
requested this navigation that are needed to support WebKit API/SPI. We hold the SecurityOrigin in
a RefPtr to avoid the need to explicitly define a copy constructor and copy-assignment constructor
because Requester needs to be copyable as NavigationAction, which owns a Requester, is copyable.
(WebCore::shouldTreatAsSameOriginNavigation): Fix some style nits.
(WebCore::NavigationAction::NavigationAction): Instantiate a Requester from the specified document.
* loader/NavigationAction.h:
(WebCore::NavigationAction::Requester::url const): Added.
(WebCore::NavigationAction::Requester::securityOrigin const): Added.
(WebCore::NavigationAction::Requester::pageID const): Added.
(WebCore::NavigationAction::Requester::frameID const): Added.
(WebCore::NavigationAction::requester const): Returns details about the document that requested
this navigation, if applicable.
(WebCore::NavigationAction::isEmpty const): Update criterion for being empty to consider the
requester.
(WebCore::NavigationAction::setOpener): Extracted out the datatype of the parameter into a
type alias to avoid duplication and updated this code to use the alias.
(WebCore::NavigationAction::opener const): Ditto.
(WebCore::NavigationAction::sourceDocument const): Deleted.
2018-05-25 Jeremy Jones <jeremyj@apple.com>
Fullscreen element can be clipped by ancestor.
https://bugs.webkit.org/show_bug.cgi?id=185980
rdar://problem/40320006
Reviewed by Jer Noble.
Adds style to fullscreen css to prevent the fullscreen element from being clipped by an ancestor element.
* css/fullscreen.css:
(:-webkit-full-screen-ancestor:not(iframe)):
2018-05-25 Jeremy Jones <jeremyj@apple.com>
Use correct AVKit delegate for picture in picture failure.
https://bugs.webkit.org/show_bug.cgi?id=185981
rdar://problem/40549652
Reviewed by Eric Carlson.
No new tests since we don't have a way to simulate picture-in-picture failure.
Use the new name for this delegate callback.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
2018-05-25 Zalan Bujtas <zalan@apple.com>
iBooks: text can disappear/flash during finger drag highlight
https://bugs.webkit.org/show_bug.cgi?id=185993
<rdar://problem/34026943>
Reviewed by Simon Fraser.
Reuse existing tiles when override rect is fully covered by the active grid.
Also, recover dropped tiles if override rect forces us to create new ones.
Unable to create a reproducible test case.
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::setOverrideVisibleRect):
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileHostLayer renderInContext:]):
2018-05-25 Eric Carlson <eric.carlson@apple.com>
Encode ISOWebVTTCue "strings" when logging
https://bugs.webkit.org/show_bug.cgi?id=185991
<rdar://problem/40563902>
Reviewed by Jer Noble.
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::toJSONString const): Use encodeWithURLEscapeSequences for all Strings
taken from ISO boxes.
2018-05-25 Alex Christensen <achristensen@webkit.org>
URL::host should return a StringView to reduce allocations
https://bugs.webkit.org/show_bug.cgi?id=185986
Reviewed by Geoff Garen.
No change in behaviour. Just fewer allocations.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::isYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::hostName):
(WebCore::WebSocketHandshake::host const):
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
(WebCore::needsSeekingSupportQuirk):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::finishedParsing):
* html/URLUtils.h:
(WebCore::URLUtils<T>::hostname const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::primaryDomain):
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
* page/Chrome.cpp:
(WebCore::Chrome::mouseDidMoveOverElement):
* page/Location.cpp:
(WebCore::Location::hostname const):
* page/Page.cpp:
(WebCore::Page::mainFrameLoadStarted):
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadResourceThreshold):
* page/SecurityOrigin.cpp:
(WebCore::isLoopbackIPAddress):
(WebCore::shouldTreatAsPotentiallyTrustworthy):
(WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
* page/SecurityOrigin.h:
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::matchesHost const):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::hostMatches const):
* platform/PublicSuffix.h:
* platform/URL.cpp:
(WebCore::URL::host const):
(WebCore::URL::hostAndPort const):
(WebCore::URL::isMatchingDomain const):
* platform/URL.h:
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString):
* platform/network/ResourceRequestBase.h:
(WebCore::registrableDomainsAreEqual):
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::getPartitioningDomain):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::createStreams):
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::hostname const):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
2018-05-24 Dean Jackson <dino@apple.com>
Need to provide a way to feature detect support for system preview
https://bugs.webkit.org/show_bug.cgi?id=185970
<rdar://problem/40538321>
Reviewed by Sam Weinig.
Update the supports function in the DOMTokenList that HTMLAnchorElement
produces for relList to return true for the system preview token.
Tested internally.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList const):
2018-05-25 Chris Dumez <cdumez@apple.com>
Minor ApplicationCacheStorage clean up
https://bugs.webkit.org/show_bug.cgi?id=185984
Reviewed by Youenn Fablet.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::getManifestURLs):
(WebCore::ApplicationCacheStorage::deleteCacheGroup):
(WebCore::ApplicationCacheStorage::originsWithCache):
(WebCore::ApplicationCacheStorage::deleteAllCaches):
(WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
(WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
(WebCore::ApplicationCacheStorage::cacheDirectory const): Deleted.
(WebCore::ApplicationCacheStorage::cacheGroupSize): Deleted.
(WebCore::ApplicationCacheStorage::getOriginsWithCache): Deleted.
(WebCore::ApplicationCacheStorage::create): Deleted.
* loader/appcache/ApplicationCacheStorage.h:
(WebCore::ApplicationCacheStorage::create):
2018-05-25 Sihui Liu <sihui_liu@apple.com>
[WKHTTPCookieStore getAllCookies] returns inconsistent creation time
https://bugs.webkit.org/show_bug.cgi?id=185041
<rdar://problem/34684214>
Reviewed by Geoffrey Garen.
Set creationtime property when creating Cookie object to keep consistency after conversion.
New API test: WebKit.WKHTTPCookieStoreCreationTime.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
2018-05-25 Zalan Bujtas <zalan@apple.com>
[LFC] Implement border and padding computation
https://bugs.webkit.org/show_bug.cgi?id=185972
Reviewed by Antti Koivisto.
This patch also removes redundant Display::Box methods and adds a lightweight Edge struct.
(Since padding is optional, if during layout we mistakenly try to access paddingTop/Left/Bottom/Right, Display::Box will assert!)
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::Edges::Edges):
(WebCore::Display::Box::setHasValidPosition):
(WebCore::Display::Box::setWidth):
(WebCore::Display::Box::setHeight):
(WebCore::Display::Box::setMargin):
(WebCore::Display::Box::setBorder):
(WebCore::Display::Box::setPadding):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::paddingTop const):
(WebCore::Display::Box::paddingLeft const):
(WebCore::Display::Box::paddingBottom const):
(WebCore::Display::Box::paddingRight const):
(WebCore::Display::Box::borderTop const):
(WebCore::Display::Box::borderLeft const):
(WebCore::Display::Box::borderBottom const):
(WebCore::Display::Box::borderRight const):
(WebCore::Display::Box::invalidateSize): Deleted.
(WebCore::Display::Box::setHasValidSize): Deleted.
(WebCore::Display::Box::setHasValidGeometry): Deleted.
(WebCore::Display::Box::setRect): Deleted.
(WebCore::Display::Box::setSize): Deleted.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isPaddingEnabled const):
* layout/layouttree/LayoutBox.h:
2018-05-25 David Kilzer <ddkilzer@apple.com>
Fix issues with -dealloc methods found by clang static analyzer
<https://webkit.org/b/185887>
Reviewed by Joseph Pecoraro.
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController dealloc]): Release `_minTiming` and
`_maxTiming` to fix leaks.
* platform/ios/WebBackgroundTaskController.mm:
(-[WebBackgroundTaskController dealloc]): Release
`_backgroundTaskStartBlock` and `_backgroundTaskEndBlock` to fix
leaks.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList dealloc]): Release
`_teamData` to fix leak.
2018-05-25 Antoine Quint <graouts@apple.com>
[Web Animations] WebAnimation objects never get destroyed
https://bugs.webkit.org/show_bug.cgi?id=185917
<rdar://problem/39539371>
Reviewed by Dean Jackson and Antti Koivisto.
The AnimationTimeline class keeps references to WebAnimation objects organized in various ways. First, there
are three main maps across which all animations are stored, one for non-subclass WebAnimation objects
(m_elementToAnimationsMap), one for CSSSAnimation objects (m_elementToCSSAnimationsMap) and one for CSSTranstion
objects (m_elementToCSSTransitionsMap). On top of that, we also keep a map to access CSSAnimation objects for
a given element by CSS animation name (m_elementToCSSAnimationByName) and another map to access CSSTransition
objects for a given element by CSS property (m_elementToCSSTransitionByCSSPropertyID).
None of the RefPtr<WebAnimation> stored in these maps would get cleared when the document would get torn down,
which would also prevent the AnimationTimeline (and its DocumentTimeline subclass) from being destroyed.
We now ensure that element and document tear-down correctly removes animations and clears those maps, which
in turn allows the DocumentTimeline to be destroyed, fixing the significant memory leak introduced by Web Animations
so far.
Finally, we change the collection type for those maps to be ListHashRef instead of Vector to guarantee we only
add an animation once per collection due to changes in how setEffect() and setTimeline() operate.
Test: animations/leak-document-with-css-animation.html
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::~AnimationTimeline): There is no need to clear those tables as they'll need to be empty
for the AnimationTimeline to even be destroyed.
(WebCore::AnimationTimeline::relevantMapForAnimation): Change to use ListHashRef instead of Vector.
(WebCore::AnimationTimeline::animationWasAddedToElement): Change to use ListHashRef instead of Vector.
(WebCore::AnimationTimeline::animationWasRemovedFromElement): When an animation is removed from an element, ensure that
references to this animation stored in the m_elementToCSSAnimationByName and m_elementToCSSTransitionByCSSPropertyID maps
are cleared.
(WebCore::AnimationTimeline::animationsForElement const): Change to use ListHashRef instead of Vector.
(WebCore::AnimationTimeline::removeAnimationsForElement): Instead of just calling cancel() on all known declarative animations
(this method used to be called cancelDeclarativeAnimationsForElement()), we now set the effect of known animations, declarative
or not, for the provided element which will in turn call animationWasRemovedFromElement() and remove the animation from all
maps that might keep a reference to it.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Replace call to removeDeclarativeAnimation() with a simple call
to removeAnimation() which will remove references for this animation from the relevant maps.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Ditto.
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Deleted.
(WebCore::AnimationTimeline::removeDeclarativeAnimation): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::elementToAnimationsMap): Change to use ListHashRef instead of Vector.
(WebCore::AnimationTimeline::elementToCSSAnimationsMap): Change to use ListHashRef instead of Vector.
(WebCore::AnimationTimeline::elementToCSSTransitionsMap): Change to use ListHashRef instead of Vector.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect): In the case of a declarative animation, we don't want to remove the animation from the relevant
maps because while the effect was set via the API, the element still has a transition or animation set up and we must not break the
timeline-to-animation relationship.
(WebCore::WebAnimation::setEffectInternal): Factor parts of setEffect() out into a new method that can be called from
AnimationTimeline::removeAnimationsForElement() to reset the m_effect member and correctly call animationWasRemovedFromElement()
without all the Web Animations machinery of setEffect(), which is a public API that has unwanted side effects (such as rejecting
promises).
(WebCore::WebAnimation::setTimeline): In the case of a declarative animation, we don't want to remove the animation from the
relevant maps because, while the timeline was set via the API, the element still has a transition or animation set up and we must
not break the relationship.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::~DocumentTimeline):
(WebCore::DocumentTimeline::detachFromDocument): Close the GenericTaskQueues when detaching from the document as it's too late to
perform this work in the destructor. We also cancel the schedule timer which we had forgotten to do before.
* animation/WebAnimation.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-05-24 Chris Dumez <cdumez@apple.com>
Avoid doing unnecessary work in Document::shouldEnforceContentDispositionAttachmentSandbox() when setting is disabled
https://bugs.webkit.org/show_bug.cgi?id=185964
Reviewed by Geoffrey Garen.
* dom/Document.cpp:
(WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox const):
2018-05-24 Chris Dumez <cdumez@apple.com>
[iOS] Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
https://bugs.webkit.org/show_bug.cgi?id=185966
Reviewed by Geoffrey Garen.
Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
for performance reasons.
* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::shouldCreateForMIMEType):
2018-05-24 Sam Weinig <sam@webkit.org>
Modernize RenderStyleConstants.h - Part 2
https://bugs.webkit.org/show_bug.cgi?id=185901
Reviewed by Simon Fraser.
Modernized the second set of enums in RenderStyleConstants.h by:
- Converting them to enum classes
- Renaming them to remove unnecessary prefix 'E's
- Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
- Renaming to match modern conventions (e.g BNONE -> None)
- Reformatting them so that each value is on its own line.
Modernizes the following enums:
PseudoId
ListStyleType (renamed from EListStyleType)
BorderFit (renamed from EBorderFit)
AnimationFillMode (renamed from EAnimationFillMode)
AnimationPlayState (renamed from EAnimPlayState)
WhiteSpace (renamed from EWhiteSpace)
TextAlignMode (renamed from ETextAlign)
TextTransform (renamed from ETextTransform)
TextDecorationStyle
TextAlignLast
TextJustify
TextZoom
BreakBetween
BreakInside
EmptyCell (renamed from EEmptyCell)
CaptionSide (renamed from ECaptionSide)
ListStylePosition (renamed from EListStylePosition)
Visibility (renamed from EVisibility)
CursorType (renamed from ECursor)
CursorVisibility
DisplayType (renamed from EDisplay)
InsideLink (renamed from EInsideLink)
PointerEvents (renamed from EPointerEvents)
Hyphens
TextEmphasisFill
TextEmphasisMark
ImageResolutionSource
ImageResolutionSnap
Order
ColumnAxis
ColumnProgression
LineSnap
LineAlign
RubyPosition
AutoRepeatType
CSSBoxType
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isNodeVisible const):
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::determineAccessibilityRole):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isDOMHidden const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::isUnvisited const):
(WebCore::AccessibilityRenderObject::isVisited const):
(WebCore::AccessibilityRenderObject::setValue):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable const):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement):
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize):
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderTextDecorationStyleFlagsToCSSValue):
(WebCore::convertToPageBreak):
(WebCore::convertToColumnBreak):
(WebCore::ComputedStyleExtractor::styledElement const):
(WebCore::ComputedStyleExtractor::styledRenderer const):
(WebCore::computeRenderStyleForProperty):
(WebCore::shapePropertyValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSComputedStyleDeclaration.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CaptionSide const):
(WebCore::CSSPrimitiveValue::operator CursorType const):
(WebCore::CSSPrimitiveValue::operator CursorVisibility const):
(WebCore::CSSPrimitiveValue::operator DisplayType const):
(WebCore::CSSPrimitiveValue::operator EmptyCell const):
(WebCore::CSSPrimitiveValue::operator ListStylePosition const):
(WebCore::CSSPrimitiveValue::operator ListStyleType const):
(WebCore::CSSPrimitiveValue::operator BreakBetween const):
(WebCore::CSSPrimitiveValue::operator BreakInside const):
(WebCore::CSSPrimitiveValue::operator TextAlignMode const):
(WebCore::CSSPrimitiveValue::operator TextAlignLast const):
(WebCore::CSSPrimitiveValue::operator TextJustify const):
(WebCore::CSSPrimitiveValue::operator TextDecorationStyle const):
(WebCore::CSSPrimitiveValue::operator TextTransform const):
(WebCore::CSSPrimitiveValue::operator Visibility const):
(WebCore::CSSPrimitiveValue::operator WhiteSpace const):
(WebCore::CSSPrimitiveValue::operator RubyPosition const):
(WebCore::CSSPrimitiveValue::operator TextEmphasisFill const):
(WebCore::CSSPrimitiveValue::operator TextEmphasisMark const):
(WebCore::CSSPrimitiveValue::operator PointerEvents const):
(WebCore::CSSPrimitiveValue::operator Hyphens const):
(WebCore::CSSPrimitiveValue::operator LineSnap const):
(WebCore::CSSPrimitiveValue::operator LineAlign const):
(WebCore::CSSPrimitiveValue::operator Order const):
(WebCore::CSSPrimitiveValue::operator BorderFit const):
(WebCore::CSSPrimitiveValue::operator ColumnAxis const):
(WebCore::CSSPrimitiveValue::operator ColumnProgression const):
(WebCore::CSSPrimitiveValue::operator CSSBoxType const):
(WebCore::CSSPrimitiveValue::operator TextZoom const):
(WebCore::CSSPrimitiveValue::operator ECaptionSide const): Deleted.
(WebCore::CSSPrimitiveValue::operator ECursor const): Deleted.
(WebCore::CSSPrimitiveValue::operator EDisplay const): Deleted.
(WebCore::CSSPrimitiveValue::operator EEmptyCell const): Deleted.
(WebCore::CSSPrimitiveValue::operator EListStylePosition const): Deleted.
(WebCore::CSSPrimitiveValue::operator EListStyleType const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETextAlign const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETextTransform const): Deleted.
(WebCore::CSSPrimitiveValue::operator EVisibility const): Deleted.
(WebCore::CSSPrimitiveValue::operator EWhiteSpace const): Deleted.
(WebCore::CSSPrimitiveValue::operator EPointerEvents const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBorderFit const): Deleted.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationFillMode):
(WebCore::CSSToStyleMap::mapAnimationPlayState):
* css/CSSValueKeywords.in:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::ruleMatches):
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
* css/ElementRuleCollector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match const):
(WebCore::SelectorChecker::matchHostPseudoClass const):
(WebCore::hasScrollbarPseudoElement):
(WebCore::SelectorChecker::matchRecursively const):
* css/SelectorChecker.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextAlign):
(WebCore::StyleBuilderConverter::convertClipPath):
(WebCore::StyleBuilderConverter::convertShapeValue):
(WebCore::StyleBuilderConverter::createGridTrackList):
(WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
(WebCore::StyleBuilderConverter::convertPageBreakBetween):
(WebCore::StyleBuilderConverter::convertPageBreakInside):
(WebCore::StyleBuilderConverter::convertColumnBreakBetween):
(WebCore::StyleBuilderConverter::convertColumnBreakInside):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueImageResolution):
(WebCore::computeBaseSpecifiedFontSize):
(WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
(WebCore::StyleBuilderCustom::isValidDisplayValue):
(WebCore::StyleBuilderCustom::applyInheritDisplay):
(WebCore::StyleBuilderCustom::applyValueDisplay):
(WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
(WebCore::StyleBuilderCustom::applyValueCursor):
(WebCore::StyleBuilderCustom::applyValueContent):
(WebCore::StyleBuilderCustom::determineRubyTextSizeMultiplier):
(WebCore::StyleBuilderCustom::applyValueAlt):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
(WebCore::equivalentBlockDisplay):
(WebCore::doesNotInheritTextDecoration):
(WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
(WebCore::adjustDisplayContentsStyle):
(WebCore::StyleResolver::adjustSVGElementStyle):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::styleRulesForElement):
(WebCore::isCacheableInMatchedPropertiesCache):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::elementLinkState const):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::setVisuallyOrdered):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::isFocusable const):
(WebCore::Element::hasDisplayContents const):
(WebCore::Element::storeDisplayContentsStyle):
(WebCore::Element::rendererIsNeeded):
(WebCore::beforeOrAfterPseudoElement):
(WebCore::Element::computedStyle):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
* dom/Node.h:
(WebCore::Node::isPseudoElement const):
(WebCore::Node::isBeforePseudoElement const):
(WebCore::Node::isAfterPseudoElement const):
(WebCore::Node::pseudoId const):
(WebCore::Node::customPseudoId const):
* dom/Position.cpp:
(WebCore::Position::upstream const):
(WebCore::Position::downstream const):
(WebCore::Position::isCandidate const):
(WebCore::Position::rendersInDifferentPosition const):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate const):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::pseudoElementNameForEvents):
(WebCore::PseudoElement::PseudoElement):
* dom/VisitedLinkState.cpp:
(WebCore::VisitedLinkState::determineLinkStateSlowCase):
* dom/VisitedLinkState.h:
(WebCore::VisitedLinkState::determineLinkState):
* editing/Editing.cpp:
(WebCore::isSpecialHTMLElement):
(WebCore::isNodeRendered):
* editing/TextIterator.cpp:
(WebCore::hasVisibleTextNode):
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::TextIterator::handleTextNodeFirstLetter):
(WebCore::TextIterator::handleReplacedElement):
(WebCore::TextIterator::shouldRepresentNodeOffsetZero):
(WebCore::SimplifiedBackwardsTextIterator::advance):
* editing/VisibleUnits.cpp:
(WebCore::findStartOfParagraph):
(WebCore::findEndOfParagraph):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isFocusable const):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::rendererIsNeeded):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::rendererIsNeeded):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createInnerTextStyle):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::isFocusable const):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::isFocusable const):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted const):
(WebCore::isMainContentForPurposesOfAutoplay):
* html/RubyElement.cpp:
(WebCore::RubyElement::createElementRenderer):
* html/RubyTextElement.cpp:
(WebCore::RubyTextElement::createElementRenderer):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementData):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::pseudoElementType):
(WebCore::InspectorDOMAgent::buildObjectForNode):
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isInlineBlockBox const):
(WebCore::Layout::Box::isBlockLevelBox const):
(WebCore::Layout::Box::isInlineLevelBox const):
(WebCore::Layout::Box::isBlockContainerBox const):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* page/Frame.cpp:
(WebCore::Frame::searchForLabelsAboveCell):
(WebCore::Frame::searchForLabelsBeforeElement):
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
(WebCore::FrameView::adjustScrollStepForFixedContent):
(WebCore::FrameView::updateScrollCorner):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::playStatePlaying const):
(WebCore::AnimationBase::updatePlayState):
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
(WebCore::CompositeAnimation::updateKeyframeAnimations):
(WebCore::CompositeAnimation::suspendAnimations):
(WebCore::CompositeAnimation::resumeAnimations):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToClickEvents):
* platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
* platform/animation/Animation.h:
(WebCore::Animation::clearPlayState):
(WebCore::Animation::fillMode const):
(WebCore::Animation::playState const):
(WebCore::Animation::setFillMode):
(WebCore::Animation::setPlayState):
(WebCore::Animation::fillsBackwards const):
(WebCore::Animation::fillsForwards const):
(WebCore::Animation::initialFillMode):
(WebCore::Animation::initialPlayState):
* platform/graphics/GraphicsTypes.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow dumpTiles]):
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
* rendering/ClipPathOperation.h:
* rendering/InlineBox.h:
(WebCore::InlineBox::visibleToHitTesting const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::paint):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
(WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::createTextRun const):
* rendering/PointerEventsHitRules.cpp:
(WebCore::PointerEventsHitRules::PointerEventsHitRules):
* rendering/PointerEventsHitRules.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::paintObject):
(WebCore::RenderBlock::shouldPaintSelectionGaps const):
(WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
(WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
(WebCore::isChildHitTestCandidate):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
(WebCore::RenderBlock::firstLineBlock const):
(WebCore::findFirstLetterBlock):
(WebCore::RenderBlock::getFirstLetter):
(WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
(WebCore::RenderBlock::constructTextRun):
(WebCore::RenderBlock::layoutExcludedChildren):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
(WebCore::RenderBlock::createAnonymousBlock const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):
(WebCore::RenderBlockFlow::updateStylesForColumnChildren):
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
(WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
(WebCore::RenderBlockFlow::adjustForBorderFit const):
(WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
(WebCore::RenderBlockFlow::lineAtIndex const):
(WebCore::RenderBlockFlow::lineCount const):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::clearTruncation):
(WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
(WebCore::RenderBlockFlow::lineCountForTextAutosizing):
(WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
(WebCore::RenderBlockFlow::updateColumnProgressionFromStyle):
(WebCore::RenderBlockFlow::isTopLayoutOverflowAllowed const):
(WebCore::RenderBlockFlow::isLeftLayoutOverflowAllowed const):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::constructLine):
(WebCore::RenderBlockFlow::textAlignmentForLine const):
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
(WebCore::expansionBehaviorForInlineTextBox):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::checkFloatInCleanLine):
(WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
(WebCore::RenderBlockFlow::checkLinesForTextOverflow):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
(WebCore::isCandidateForOpaquenessTest):
(WebCore::RenderBox::paintMask):
(WebCore::RenderBox::paintClippingMask):
(WebCore::RenderBox::positionLineBox):
(WebCore::RenderBox::clippedOverflowRectForRepaint const):
(WebCore::RenderBox::computeLogicalWidthInFragment const):
(WebCore::RenderBox::computeInlineDirectionMargins const):
(WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const):
(WebCore::RenderBox::positionForPoint):
(WebCore::RenderBox::isUnsplittableForPagination const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
* rendering/RenderBoxModelObject.h:
* rendering/RenderCounter.cpp:
(WebCore::planCounter):
(WebCore::RenderCounter::originalText const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::childDoesNotAffectWidthOrFlexing):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
(WebCore::RenderElement::computeFirstLineStyle const):
(WebCore::RenderElement::propagateStyleToAnonymousChildren):
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::insertedIntoTree):
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::RenderElement::repaintAfterLayoutIfNeeded):
(WebCore::RenderElement::isVisibleInDocumentRect const):
(WebCore::RenderElement::getCachedPseudoStyle const):
(WebCore::RenderElement::getUncachedPseudoStyle const):
(WebCore::RenderElement::selectionPseudoStyle const):
* rendering/RenderElement.h:
(WebCore::RenderElement::visibleToHitTesting const):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFullScreen.cpp:
(WebCore::createFullScreenStyle):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::repaintOrMarkForLayout):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::addAnnotatedRegions):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateDescendantDependentFlags):
(WebCore::RenderLayer::createScrollbar):
(WebCore::styleRequiresScrollbar):
(WebCore::styleDefinesAutomaticScrollbar):
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):
* rendering/RenderLayerCompositor.cpp:
(WebCore::scrollbarHasDisplayNone):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
(WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintObject):
(WebCore::itemOffsetForAlignment):
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::computeMarkerStyle const):
* rendering/RenderListMarker.cpp:
(WebCore::effectiveListMarkerType):
(WebCore::listMarkerSuffix):
(WebCore::listMarkerText):
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::updateContent):
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
(WebCore::RenderListMarker::suffix const):
(WebCore::RenderListMarker::isInside const):
(WebCore::RenderListMarker::getRelativeMarkerRect):
* rendering/RenderListMarker.h:
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
(WebCore::RenderTextTrackContainerElement::layout):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle):
(WebCore::if):
(RenderMenuList::itemStyle const):
(RenderMenuList::menuStyle const):
(RenderMenuList::createScrollbar):
* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addAnnotatedRegions):
* rendering/RenderObject.h:
(WebCore::RenderObject::isAnonymousBlock const):
(WebCore::RenderObject::isBeforeContent const):
(WebCore::RenderObject::isAfterContent const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::shouldPaint):
(WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::textAlignmentForLine const):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::createRubyBase const):
(WebCore::RenderRubyRun::staticCreateRubyRun):
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::textAlignmentForLine const):
(WebCore::RenderRubyText::adjustInlineDirectionLineBounds const):
* rendering/RenderRubyText.h:
* rendering/RenderScrollbar.cpp:
(WebCore::pseudoForScrollbarPart):
(WebCore::RenderScrollbar::updateScrollbarPart):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::updateCancelButtonVisibility const):
(WebCore::RenderSearchField::visibilityForCancelButton const):
(WebCore::RenderSearchField::menuStyle const):
(WebCore::RenderSearchField::createScrollbar):
* rendering/RenderSearchField.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::willInsertTableSection):
(WebCore::RenderTable::layoutCaptions):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::paintObject):
(WebCore::RenderTable::adjustBorderBoxRectForPainting):
(WebCore::RenderTable::paintMask):
(WebCore::RenderTable::recalcSections const):
(WebCore::RenderTable::createTableWithStyle):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::styleDidChange):
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
(WebCore::RenderTableCell::paintBoxDecorations):
(WebCore::RenderTableCell::paintMask):
(WebCore::RenderTableCell::createTableCellWithStyle):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::updateFromElement):
(WebCore::RenderTableCol::isChildAllowed const):
* rendering/RenderTableCol.h:
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::styleDidChange):
(WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
(WebCore::RenderTableRow::createTableRowWithStyle):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addCell):
(WebCore::RenderTableSection::paint):
(WebCore::RenderTableSection::createTableSectionWithStyle):
* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::applyTextTransform):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::styleDidChange):
(WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustMenuListStyle const):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
* rendering/RenderView.cpp:
(WebCore::rendererObscuresBackground):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidget):
(WebCore::RenderWidget::styleDidChange):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::paintEllipsisBox const):
(WebCore::RootInlineBox::lineSnapAdjustment const):
(WebCore::RootInlineBox::lineSelectionGap):
(WebCore::RootInlineBox::computeCaretRect const):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::computeLineLeft):
(WebCore::SimpleLineLayout::updateLineConstrains):
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::textAlignForLine):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::hitTestFlow):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
* rendering/TextDecorationPainter.cpp:
(WebCore::textDecorationStyleToStrokeStyle):
(WebCore::TextDecorationPainter::paintTextDecoration):
(WebCore::collectStylesForRenderer):
* rendering/TextDecorationPainter.h:
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
(WebCore::BreakingContext::handleBR):
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::handleEndOfLine):
* rendering/line/LineInlineHeaders.h:
(WebCore::shouldCollapseWhiteSpace):
* rendering/line/LineWidth.cpp:
(WebCore::newFloatShrinksLine):
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMath.cpp:
(WebCore::RenderMathMLMath::layoutBlock):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
* rendering/shapes/BoxShape.cpp:
(WebCore::computeRoundedRectForBoxShape):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::referenceBox):
(WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
(WebCore::ShapeOutsideInfo::logicalTopOffset const):
(WebCore::ShapeOutsideInfo::logicalLeftOffset const):
* rendering/style/CounterContent.h:
(WebCore::CounterContent::CounterContent):
(WebCore::CounterContent::listStyle const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::createAnonymousStyleWithDisplay):
(WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::hasUniquePseudoStyle const):
(WebCore::RenderStyle::getCachedPseudoStyle const):
(WebCore::RenderStyle::addCachedPseudoStyle):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::requiresPainting):
(WebCore::RenderStyle::hyphenString const):
(WebCore::RenderStyle::textEmphasisMarkString const):
(WebCore::RenderStyle::visitedDependentColor const):
(WebCore::RenderStyle::textEmphasisMark const):
(WebCore::RenderStyle::setColumnStylesFromPaginationMode):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setStyleType):
(WebCore::RenderStyle::setRTLOrdering):
(WebCore::RenderStyle::display const):
(WebCore::RenderStyle::visibility const):
(WebCore::RenderStyle::textAlign const):
(WebCore::RenderStyle::textTransform const):
(WebCore::RenderStyle::whiteSpace const):
(WebCore::RenderStyle::emptyCells const):
(WebCore::RenderStyle::captionSide const):
(WebCore::RenderStyle::listStyleType const):
(WebCore::RenderStyle::listStylePosition const):
(WebCore::RenderStyle::cursor const):
(WebCore::RenderStyle::insideLink const):
(WebCore::RenderStyle::borderFit const):
(WebCore::RenderStyle::pointerEvents const):
(WebCore::RenderStyle::setDisplay):
(WebCore::RenderStyle::setOriginalDisplay):
(WebCore::RenderStyle::setVisibility):
(WebCore::RenderStyle::setTextAlign):
(WebCore::RenderStyle::setTextTransform):
(WebCore::RenderStyle::setTextDecorationStyle):
(WebCore::RenderStyle::setTextDecorationSkip):
(WebCore::RenderStyle::setTextUnderlinePosition):
(WebCore::RenderStyle::setDirection):
(WebCore::RenderStyle::setTextZoom):
(WebCore::RenderStyle::setWhiteSpace):
(WebCore::RenderStyle::setEmptyCells):
(WebCore::RenderStyle::setCaptionSide):
(WebCore::RenderStyle::setListStyleType):
(WebCore::RenderStyle::setListStylePosition):
(WebCore::RenderStyle::setCursor):
(WebCore::RenderStyle::setCursorVisibility):
(WebCore::RenderStyle::setInsideLink):
(WebCore::RenderStyle::setHyphens):
(WebCore::RenderStyle::setBorderFit):
(WebCore::RenderStyle::setColumnAxis):
(WebCore::RenderStyle::setColumnProgression):
(WebCore::RenderStyle::setTextEmphasisFill):
(WebCore::RenderStyle::setTextEmphasisMark):
(WebCore::RenderStyle::setRubyPosition):
(WebCore::RenderStyle::setBreakBefore):
(WebCore::RenderStyle::setBreakAfter):
(WebCore::RenderStyle::setBreakInside):
(WebCore::RenderStyle::setHangingPunctuation):
(WebCore::RenderStyle::setLineSnap):
(WebCore::RenderStyle::setLineAlign):
(WebCore::RenderStyle::setPointerEvents):
(WebCore::RenderStyle::initialDisplay):
(WebCore::RenderStyle::initialBreakBetween):
(WebCore::RenderStyle::initialBreakInside):
(WebCore::RenderStyle::initialCaptionSide):
(WebCore::RenderStyle::initialColumnAxis):
(WebCore::RenderStyle::initialColumnProgression):
(WebCore::RenderStyle::initialEmptyCells):
(WebCore::RenderStyle::initialListStylePosition):
(WebCore::RenderStyle::initialListStyleType):
(WebCore::RenderStyle::initialTextTransform):
(WebCore::RenderStyle::initialVisibility):
(WebCore::RenderStyle::initialWhiteSpace):
(WebCore::RenderStyle::initialCursor):
(WebCore::RenderStyle::initialTextAlign):
(WebCore::RenderStyle::initialTextDecorationStyle):
(WebCore::RenderStyle::initialTextZoom):
(WebCore::RenderStyle::initialHyphens):
(WebCore::RenderStyle::initialBorderFit):
(WebCore::RenderStyle::initialRTLOrdering):
(WebCore::RenderStyle::initialPointerEvents):
(WebCore::RenderStyle::initialTextEmphasisColor):
(WebCore::RenderStyle::initialTextEmphasisFill):
(WebCore::RenderStyle::initialTextEmphasisMark):
(WebCore::RenderStyle::initialRubyPosition):
(WebCore::RenderStyle::initialImageResolutionSource):
(WebCore::RenderStyle::initialImageResolutionSnap):
(WebCore::RenderStyle::initialTextAlignLast):
(WebCore::RenderStyle::initialTextJustify):
(WebCore::RenderStyle::initialCursorVisibility):
(WebCore::RenderStyle::initialGridAutoRepeatType):
(WebCore::RenderStyle::initialLineSnap):
(WebCore::RenderStyle::initialLineAlign):
(WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
(WebCore::RenderStyle::originalDisplay const):
(WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
(WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
(WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles):
(WebCore::RenderStyle::autoWrap):
(WebCore::RenderStyle::preserveNewline):
(WebCore::RenderStyle::collapseWhiteSpace):
(WebCore::RenderStyle::breakOnlyAfterWhiteSpace const):
(WebCore::RenderStyle::hasInlineColumnAxis const):
(WebCore::RenderStyle::isDisplayRegionType const):
(WebCore::RenderStyle::isDisplayReplacedType):
(WebCore::RenderStyle::isDisplayInlineType):
(WebCore::RenderStyle::isDisplayFlexibleBox):
(WebCore::RenderStyle::isDisplayGridBox):
(WebCore::RenderStyle::isDisplayFlexibleOrGridBox):
(WebCore::pseudoElementRendererIsNeeded):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
(WebCore::alwaysPageBreak):
* rendering/style/RenderStyleConstants.h:
(WebCore::PseudoIdSet::has const):
(WebCore::PseudoIdSet::add):
* rendering/style/ShapeValue.h:
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::paint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::styleDidChange):
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::checkIntersection):
(WebCore::RenderSVGModelObject::checkEnclosure):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
(WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
(WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::clippedOverflowRectForRepaint const):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::paint):
(WebCore::RenderSVGShape::nodeAtFloatPoint):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::paint):
(WebCore::SVGInlineTextBox::constructTextRun const):
(WebCore::SVGInlineTextBox::paintDecoration):
(WebCore::SVGInlineTextBox::nodeAtPoint):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::processRenderSVGInlineText):
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::measureTextRenderer):
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::detach):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::styleForFirstLetter):
(WebCore::RenderTreeBuilder::FirstLetter::updateAfterDescendants):
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::newChildIsInline):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::createMathMLOperator):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::isAnonymousRubyInlineBlock):
(WebCore::isRubyBeforeBlock):
(WebCore::isRubyAfterBlock):
(WebCore::createAnonymousRubyInlineBlock):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateBeforeDescendants):
(WebCore::RenderTreeUpdater::updateAfterDescendants):
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::elementImplicitVisibility):
(WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):
* style/StyleChange.cpp:
(WebCore::Style::determineChange):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* style/StyleSharingResolver.cpp:
* style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::resolvePseudoStyle):
(WebCore::Style::TreeResolver::parentBoxStyle const):
(WebCore::Style::createInheritedDisplayContentsStyleIfNeeded):
(WebCore::Style::TreeResolver::resolveComposedTree):
* svg/SVGElement.h:
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::createElementRenderer):
2018-05-24 Chris Dumez <cdumez@apple.com>
Enable subsampling for progressive JPEG images
https://bugs.webkit.org/show_bug.cgi?id=185956
Reviewed by Said Abou-Hallawa.
Enable subsampling for progressive JPEG images now that it is supposed (rdar://problem/5191418).
I verified locally that such images are still loading and do not cause any hang on iOS.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
2018-05-24 Chris Dumez <cdumez@apple.com>
Reduce copying of FontCascadeDescription objects by moving them around
https://bugs.webkit.org/show_bug.cgi?id=185963
Reviewed by Simon Fraser.
Reduce copying of FontCascadeDescription objects by moving them around when possible.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLocale):
(WebCore::StyleBuilderCustom::applyInitialFontFamily):
(WebCore::StyleBuilderCustom::applyInheritFontFamily):
(WebCore::StyleBuilderCustom::applyValueFontFamily):
(WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
(WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
(WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
(WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
(WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
(WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
(WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
(WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
(WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
(WebCore::StyleBuilderCustom::applyInitialFontSize):
(WebCore::StyleBuilderCustom::applyInheritFontSize):
(WebCore::StyleBuilderCustom::applyInitialFontStyle):
(WebCore::StyleBuilderCustom::applyInheritFontStyle):
(WebCore::StyleBuilderCustom::applyValueFontStyle):
(WebCore::StyleBuilderCustom::applyValueFontSize):
* css/StyleResolver.cpp:
(WebCore::checkForOrientationChange):
(WebCore::StyleResolver::checkForTextSizeAdjust):
(WebCore::StyleResolver::checkForZoomChange):
(WebCore::StyleResolver::checkForGenericFamilyChange):
(WebCore::StyleResolver::initializeFontStyle):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::setFontDescription):
(WebCore::StyleResolver::setFontDescription):
* css/makeprop.pl:
(generateInitialValueSetter):
(generateInheritValueSetter):
(generateValueSetter):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::drawRect):
* page/linux/ResourceUsageOverlayLinux.cpp:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::FontCascade):
* platform/graphics/FontCascade.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::drawTextAtPoint const):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* platform/win/DragImageWin.cpp:
(WebCore::dragLabelFont):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::calculatePositionAndSize):
(WebCore::PopupMenuWin::paint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
* rendering/RenderListBox.cpp:
(WebCore::bolder):
(WebCore::RenderListBox::paintItemForeground):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::computeMarkerStyle const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::setFontFromControlSize const):
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustTextNodeSizes):
(WebCore::TextAutoSizingValue::reset):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontDescription):
(WebCore::RenderStyle::setFontSize):
(WebCore::RenderStyle::setFontVariationSettings):
(WebCore::RenderStyle::setFontWeight):
(WebCore::RenderStyle::setFontStretch):
(WebCore::RenderStyle::setFontItalic):
* rendering/style/RenderStyle.h:
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::styleForFirstLetter):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2018-05-24 Chris Dumez <cdumez@apple.com>
Avoid constructing the string "all" repeatedly in MediaQueryParser
https://bugs.webkit.org/show_bug.cgi?id=185961
Reviewed by Simon Fraser.
Avoid constructing the string "all" repeatedly in MediaQueryParser by:
- Having MediaQueryData use an std::optional<String> instead of a String
- Updating MediaQueryParser to use a static to store the default media type
and use it when the MediaQueryData's media type is std::nullopt.
Also do some cleanup.
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::commitMediaQuery):
(WebCore::MediaQueryParser::MediaQueryData::MediaQueryData):
(WebCore::MediaQueryParser::MediaQueryData::clear):
(WebCore::MediaQueryParser::MediaQueryData::addExpression):
(WebCore::MediaQueryParser::MediaQueryData::lastExpressionValid):
(WebCore::MediaQueryParser::MediaQueryData::removeLastExpression):
* css/parser/MediaQueryParser.h:
(WebCore::MediaQueryParser::MediaQueryData::setMediaType):
(WebCore::MediaQueryParser::MediaQueryData::restrictor const):
(WebCore::MediaQueryParser::MediaQueryData::expressions):
(WebCore::MediaQueryParser::MediaQueryData::mediaType const):
(WebCore::MediaQueryParser::MediaQueryData::currentMediaQueryChanged const):
(WebCore::MediaQueryParser::MediaQueryData::restrictor):
(WebCore::MediaQueryParser::MediaQueryData::setRestrictor):
(WebCore::MediaQueryParser::MediaQueryData::setMediaFeature):
(WebCore::MediaQueryParser::MediaQueryData::setMediaQueryParserContext):
2018-05-24 Joseph Pecoraro <pecoraro@apple.com>
[iOS] Hard link AppSupport instead of soft linking
https://bugs.webkit.org/show_bug.cgi?id=185959
<rdar://problem/40506538>
Reviewed by Timothy Horton.
* Configurations/WebCore.xcconfig:
* platform/network/ios/NetworkStateNotifierIOS.mm:
(-[WebNetworkStateObserver initWithBlock:]):
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2018-05-24 Chris Dumez <cdumez@apple.com>
Cache navigator.userAgent for performance
https://bugs.webkit.org/show_bug.cgi?id=185952
Reviewed by Geoffrey Garen.
Cache navigator.userAgent for performance. Previously, we would ask the client 5 times
while loading apple.com.
* page/Navigator.cpp:
(WebCore::Navigator::userAgent const):
* page/Navigator.h:
* page/NavigatorBase.h:
* page/NavigatorID.idl:
* page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::userAgent const):
* page/WorkerNavigator.h:
2018-05-24 Chris Dumez <cdumez@apple.com>
Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
https://bugs.webkit.org/show_bug.cgi?id=185951
Reviewed by Geoffrey Garen.
Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
should be enabled.
* platform/mac/LoggingMac.mm:
(WebCore::logLevelString):
* platform/unix/LoggingUnix.cpp:
(WebCore::logLevelString):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
2018-05-24 Chris Dumez <cdumez@apple.com>
[iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=181499
<rdar://problem/36443428>
Reviewed by Youenn Fablet.
After resolving a registration promise, we send an IPC back to the StorageProcess
for synchronization purposes, to make sure the registration does not get updated
before the promise's JS code has been executed. However, resolving a promise
schedules a microtask to run the JS and we would therefore send the IPC back too
early, thus causing flakiness. We now only send the IPC back back only after that
microtask has run and the JS has been executed.
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::DeferredPromise::callFunction):
(WebCore::DeferredPromise::whenSettled):
* bindings/js/JSDOMPromiseDeferred.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2018-05-24 Jinho Bang <zino@chromium.org>
[PaymentRequest] Remove currencySystem member
https://bugs.webkit.org/show_bug.cgi?id=185860
Reviewed by Andy Estes.
After a long discussion, Web Payment Working Group decided to remove
the `currencySystem` member[1]. The currency code should be well-formed
3-letter alphabetic code and is allowed even if that is not part of
the official ISO 4217 list.
[1] https://github.com/w3c/payment-request/pull/694
Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
* Modules/paymentrequest/PaymentCurrencyAmount.h:
* Modules/paymentrequest/PaymentCurrencyAmount.idl:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::checkAndCanonicalizeAmount):
(WebCore::checkAndCanonicalizeTotal):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::objectForPaymentCurrencyAmount):
2018-05-24 Zalan Bujtas <zalan@apple.com>
[LFC] Implement position computation for inflow positioned elements
https://bugs.webkit.org/show_bug.cgi?id=185936
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2018-05-24 Zalan Bujtas <zalan@apple.com>
[LFC] Implement FormattingContext::placeInFlowPositionedChildren
https://bugs.webkit.org/show_bug.cgi?id=185934
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
2018-05-23 Joseph Pecoraro <pecoraro@apple.com>
Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa
https://bugs.webkit.org/show_bug.cgi?id=185935
Reviewed by Yusuke Suzuki.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::MacApplication::isSafari):
(WebCore::MacApplication::isAppleMail):
(WebCore::MacApplication::isIBooks):
(WebCore::MacApplication::isITunes):
(WebCore::MacApplication::isMicrosoftMessenger):
(WebCore::MacApplication::isAdobeInstaller):
(WebCore::MacApplication::isAOLInstantMessenger):
(WebCore::MacApplication::isMicrosoftMyDay):
(WebCore::MacApplication::isMicrosoftOutlook):
(WebCore::MacApplication::isQuickenEssentials):
(WebCore::MacApplication::isAperture):
(WebCore::MacApplication::isVersions):
(WebCore::MacApplication::isHRBlock):
(WebCore::MacApplication::isIAdProducer):
(WebCore::MacApplication::isSolidStateNetworksDownloader):
(WebCore::IOSApplication::isMobileMail):
(WebCore::IOSApplication::isMobileSafari):
(WebCore::IOSApplication::isWebBookmarksD):
(WebCore::IOSApplication::isDumpRenderTree):
(WebCore::IOSApplication::isMobileStore):
(WebCore::IOSApplication::isSpringBoard):
(WebCore::IOSApplication::isWebApp):
(WebCore::IOSApplication::isIBooks):
(WebCore::IOSApplication::isIBooksStorytime):
(WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
(WebCore::IOSApplication::isCardiogram):
(WebCore::IOSApplication::isNike):
2018-05-23 Brent Fulgham <bfulgham@apple.com>
Avoid keeping FormState alive longer than necessary
https://bugs.webkit.org/show_bug.cgi?id=185877
<rdar://problem/39329219>
Reviewed by Ryosuke Niwa.
A number of crash fixes were done to prevent FormState objects from being
accessed after their relevant Frames had been destroyed. Unfortunately, this
could cause the FormState to persist after the owning Frame had been
destroyed, resulting in nullptr dereferences.
This patch does the following:
1. Uses WeakPtr's for FormState objects passed to completion handlers, rather
than RefPtr, since those completion handlers might fire as part of the
clean-up process during Frame destruction. This allows us to use the FormState
if they are still valid, but gracefully handle cases where a form submission
is cancelled in-flight.
2. Moves FormState object as they pass through the loader.
3. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
4. Changes FormSubmission to hold a RefPtr so we can move the FormState to the
loader in the code path that uses it (the FormSubmission is always destroyed
shortly afterwards).
5. Changes the trap from Bug 183704 so that it only fires if the FormState object
is being retained more than once.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
signature.
* loader/FormState.cpp:
(WebCore::FormState::willDetachPage): Revise trap to check for retain counts
above one.
* loader/FormState.h:
(WebCore::FormState::weakPtrFactory const): Added.
* loader/FormSubmission.h:
(WebCore::FormSubmission::state const): Revised for change to RefPtr.
(WebCore::FormSubmission::takeState): Added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Update for new CompletionHandler signature.
(WebCore::FrameLoader::loadURLIntoChildFrame): Ditto.
(WebCore::FrameLoader::loadFrameRequest): Ditto.
(WebCore::FrameLoader::loadURL): Ditto.
(WebCore::FrameLoader::load): Ditto.
(WebCore::FrameLoader::loadWithNavigationAction): Ditto.
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::reloadWithOverrideEncoding): Ditto.
(WebCore::FrameLoader::reload): Ditto.
(WebCore::FrameLoader::loadPostRequest): Ditto.
(WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
* loader/FrameLoader.h:
* loader/NavigationScheduler.cpp:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):Revise to use WeakPtr for
FormState passed to the completion handler. Remove some extraneous WTFMove()
calls on bare pointers.
(WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
* loader/PolicyChecker.h:
* page/ContextMenuController.cpp:
(WebCore::openNewWindow): Revise for new signatures.
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
2018-05-23 Keith Miller <keith_miller@apple.com>
Expose $vm if window.internals is exposed
https://bugs.webkit.org/show_bug.cgi?id=185900
Reviewed by Mark Lam.
This is useful for testing vm internals when running LayoutTests.
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):
2018-05-23 David Kilzer <ddkilzer@apple.com>
Don't create the SubimageCache just to clear an image from it
<https://webkit.org/b/185757>
Reviewed by Said Abou-Hallawa.
To fix this we make SubimageCacheWithTimer::clearImage() a
static class method that checks whether the cache exists before
removing it. We also make SubimageCacheWithTimer::getImage() a
static class method, and move more methods into the
SubimageCacheWithTimer class and make them private to reduce API
footprint.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage): Switch to use new
SubimageCacheWithTimer::getSubimage() static class method.
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::clearNativeImageSubimages): Switch to use new
SubimageCacheWithTimer::clearImage() static class method which
returns early if the subimage cache has not been created yet.
This fixes the bug.
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
(WebCore::SubimageCacheWithTimer::s_cache): Allocate space for
static class variable.
(WebCore::SubimageCacheWithTimer::getSubimage): Replace instance
method with new static class method that gets the subimage cache
singleton and calls the subimage() instance method.
(WebCore::SubimageCacheWithTimer::clearImage): Replace instance
methdod with new static class method that returns early if the
static cache singleton doesn't exist (fixes the bug), otherwise
calls the clearImageAndSubimages() instance method.
(WebCore::SubimageCacheWithTimer::subimage): Rename from
getSubimage(). Use `auto` after renaming SubimageCache typedef
to SubimageCacheHashSet.
(WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
Rename from clearImage(). Modernize loops.
(WebCore::SubimageCacheWithTimer::subimageCache): Change
WebCore::subimageCache() to a static class method that creates
the subimage cache singleton if it doesn't exist yet, and
returns it.
(WebCore::SubimageCacheWithTimer::subimageCacheExists): Add.
Returns false if the subimage cache singleton has not been
created yet.
* platform/graphics/cg/SubimageCacheWithTimer.h:
- Rename typedef SubimageCache to SubimageCacheHashSet to avoid
general confusion.
(WebCore::SubimageCacheWithTimer::getSubimage):
(WebCore::SubimageCacheWithTimer::clearImage):
- Change to static class methods.
(WebCore::SubimageCacheWithTimer::SubimageCacheWithTimer):
- Make private.
(WebCore::SubimageCacheWithTimer::subimage):
- Rename from getSubimage() and make private.
(WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
- Rename from clearImage() and make private.
(WebCore::SubimageCacheWithTimer::subimageCache):
- Rename from WebCore::subimageCache() and make a private static
class method.
(WebCore::SubimageCacheWithTimer::subimageCacheExists):
- Add private static class method.
(WebCore::SubimageCacheWithTimer::s_cache):
- Declare private static variable to hold singleton.
2018-05-23 Eric Carlson <eric.carlson@apple.com>
Avoid loading AVFoundation to check supported MIME types if possible
https://bugs.webkit.org/show_bug.cgi?id=185839
<rdar://problem/40182010>
Reviewed by Jer Noble.
Avoid loading AVFoundation to call +[AVURLAssetClass audiovisualMIMETypes] as long as possible,
and when they are loaded send the list to the UI process so it can pass it to all extant
and all new web processes so they can won't have call it at all.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create): Don't call ImageDecoderAVFObjC::canDecodeType if
ImageDecoderCG can decode the type so we don't have to load AVFoundation.
(WebCore::ImageDecoder::supportsMediaType): Return as soon as a decoder class says
it supports a media type to avoid calling more than one. Call ImageDecoderAVFObjC last.
* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h:
(WebCore::AVFoundationMIMETypeCache::setCacheMIMETypesCallback):
* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
(WebCore::AVFoundationMIMETypeCache::singleton): Simplify.
(WebCore::AVFoundationMIMETypeCache::setSupportedTypes): Cache the supplied list of types
so we won't have to load AVFoundation when asked for types later.
(WebCore::AVFoundationMIMETypeCache::types):
(WebCore::AVFoundationMIMETypeCache::supportsContentType): New convenience routine.
(WebCore::AVFoundationMIMETypeCache::canDecodeType): Ditto.
(WebCore::AVFoundationMIMETypeCache::isAvailable const): New, check to see if AVFoundation.framework
is available without actually loading it.
(WebCore::AVFoundationMIMETypeCache::loadMIMETypes): Load types if possible.
(WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache): Deleted.
(WebCore::AVFoundationMIMETypeCache::loadTypes): Deleted.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::create): Use AVFoundationMIMETypeCache::isAvailable instead
of loading the frameworks.
(WebCore::ImageDecoderAVFObjC::supportsMediaType): Ditto.
(WebCore::ImageDecoderAVFObjC::supportsContentType): Use AVFoundationMIMETypeCache::supportsContentType.
(WebCore::ImageDecoderAVFObjC::canDecodeType): Use AVFoundationMIMETypeCache::canDecodeType.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): ASSERT if the
AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Use AVFoundationMIMETypeCache::supportsContentType.
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Use AVFoundationMIMETypeCache::canDecodeType.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): ASSERT if the
AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Use AVFoundationMIMETypeCache::canDecodeType.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::canDecodeType): New.
* platform/graphics/cg/ImageDecoderCG.h:
2018-05-23 Chris Dumez <cdumez@apple.com>
RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
https://bugs.webkit.org/show_bug.cgi?id=185664
<rdar://problem/36185260>
Reviewed by Simon Fraser.
RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
ancestor frame when scrollRectToVisible() is called synchronously. However,
scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
of the post layout tasks.
To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
and this is a lot more robust than relying on a flag which gets temporarily set.
Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
* dom/Document.cpp:
* dom/Document.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::safeToPropagateScrollToParent const):
* page/FrameView.h:
2018-05-23 Youenn Fablet <youenn@apple.com>
NetworkLoadChecker should check cached redirections
https://bugs.webkit.org/show_bug.cgi?id=185849
Reviewed by Chris Dumez.
Covered by rebased tests.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
Log the case of a redirection with fetch error mode.
2018-05-23 Nan Wang <n_wang@apple.com>
AX: setValue on contenteditable should preserve whitespace
https://bugs.webkit.org/show_bug.cgi?id=185897
Reviewed by Chris Fleizach.
RenderText is using its parent renderer's style to determine if
whitespace collapsing is necessary. So when setting the innerText
of the element in setValue, let's also set its style in order to
preserve whitespaces.
Modified an existing test to cover this change.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):
2018-05-23 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Silence GCC 8 warnings
https://bugs.webkit.org/show_bug.cgi?id=185556
Reviewed by Žan Doberšek.
Silence remaining -Wcast-function-type warnings by casting through void (*)(void), aka
GCallback.
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(webkitAccessibleHyperlinkSetProperty):
(webkitAccessibleHyperlinkGetType):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetType):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2018-05-23 Zalan Bujtas <zalan@apple.com>
[LFC] Move sizing/positioning logic to helper classes
https://bugs.webkit.org/show_bug.cgi?id=185898
Reviewed by Antti Koivisto.
The idea here is to move all the sizing and positioning logic to helper classes so that
the formatting context code stays lean.
This is similar to the dedicated BlockMarginCollapse class for the collapsing logic.
The helper classes have only static functions. These static functions do not mutate the associated DisplayBoxes,
but instead they simply retun the computed values.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const): Deleted.
(WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const): Deleted.
(WebCore::Layout::FormattingContext::computeReplacedHeight const): Deleted.
(WebCore::Layout::FormattingContext::computeReplacedWidth const): Deleted.
(WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const): Deleted.
(WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const): Deleted.
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const): Deleted.
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const): Deleted.
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const): Deleted.
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const): Deleted.
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const): Deleted.
(WebCore::Layout::FormattingContext::shrinkToFitWidth const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp: Copied from Source/WebCore/layout/FormattingContext.cpp.
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::shrinkToFitWidth):
(WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedHeight):
(WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedWidth):
(WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedHeight):
(WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedWidth):
(WebCore::Layout::FormattingContextGeometry::floatingNonReplacedHeight):
(WebCore::Layout::FormattingContextGeometry::floatingNonReplacedWidth):
(WebCore::Layout::FormattingContextGeometry::floatingReplacedHeight):
(WebCore::Layout::FormattingContextGeometry::floatingReplacedWidth):
(WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedPosition):
(WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedPosition):
(WebCore::Layout::FormattingContextGeometry::replacedHeight):
(WebCore::Layout::FormattingContextGeometry::replacedWidth):
* layout/FormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp: Added.
(WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedHeight):
(WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedWidth):
(WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedHeight):
(WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedWidth):
(WebCore::Layout::BlockFormattingContextGeometry::staticPosition):
* layout/blockformatting/BlockFormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
* layout/displaytree/DisplayBox.h:
2018-05-23 Antti Koivisto <antti@apple.com>
Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
https://bugs.webkit.org/show_bug.cgi?id=185903
<rdar://problem/38420562>
Reviewed by Simon Fraser.
The canvas memory usage limits don't work on iOS since the current 2GB minimum limit is
larger than the maximum process size.
* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
Always base this on the reported ramSize() on iOS. Make it still fairly large to not risk breaking
any currently working content. In practice the limit computes to 448MB on device at the moment.
2018-05-23 Zalan Bujtas <zalan@apple.com>
[LFC] Implement positioning for replaced out-of-flow elements
https://bugs.webkit.org/show_bug.cgi?id=185902
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
2018-05-22 Myles C. Maxfield <mmaxfield@apple.com>
Text can wrap between hyphens and commas
https://bugs.webkit.org/show_bug.cgi?id=185899
<rdar://problem/40118983>
Reviewed by Zalan Bujtas.
Chrome, Firefox, and ICU all agree that text shouldn't wrap there.
Test: fast/text/line-break-hyphen-comma.html
* rendering/BreakLines.cpp:
2018-05-22 Simon Fraser <simon.fraser@apple.com>
Add notifyutil callbacks to dump the memory cache, and the list of live Pages and Documents
https://bugs.webkit.org/show_bug.cgi?id=185853
Reviewed by Keith Miller.
Add a notifyutil callback to dump the PageCache, which dumps the stats, and the list of live pages.
This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showPageCache".
Add a notifyutil callback that dumps the list of all Pages, and the list of all Documents, with
Document pointer address and URL.
This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showAllDocuments".
* history/PageCache.cpp:
(WebCore::PageCache::PageCache):
(WebCore::PageCache::dump const):
* history/PageCache.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::numberOfClients const):
(WebCore::CachedResource::count const): Deleted.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::MemoryCache):
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::dumpStats):
(WebCore::MemoryCache::dumpLRULists const):
* loader/cache/MemoryCache.h:
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
2018-05-22 Dean Jackson <dino@apple.com>
Optimized path zoom animation needs a valid UIImage and CGRect
https://bugs.webkit.org/show_bug.cgi?id=185883
<rdar://problem/40306056>
Build fix.
* loader/FrameLoadRequest.h:
2018-05-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r232081.
https://bugs.webkit.org/show_bug.cgi?id=185895
Broke two API tests (Requested by bfulgham_ on #webkit).
Reverted changeset:
"Avoid keeping FormState alive longer than necessary"
https://bugs.webkit.org/show_bug.cgi?id=185877
https://trac.webkit.org/changeset/232081
2018-05-22 Dean Jackson <dino@apple.com>
Optimized path zoom animation needs a valid UIImage and CGRect
https://bugs.webkit.org/show_bug.cgi?id=185883
<rdar://problem/40306056>
Reviewed by Jon Lee.
Pass the bounding box of the element that was clicked onto
the UI process, so it can perform an animation from that spot.
This involved adding an IntRect to the ResourceRequest, and passing
that info into it from the HTMLAnchorElement, using a new struct
called SystemPreviewInfo.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::isSystemPreview const):
(WebCore::FrameLoadRequest::systemPreviewRect const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
(WebCore::FrameLoader::urlSelected):
* loader/FrameLoaderTypes.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::systemPreviewRect const):
(WebCore::ResourceRequestBase::setSystemPreviewRect):
* platform/network/ResourceRequestBase.h:
2018-05-22 Chris Dumez <cdumez@apple.com>
[POSIX] Use access() instead of stat() in FileSystem::fileExists()
https://bugs.webkit.org/show_bug.cgi?id=185882
Reviewed by Geoffrey Garen.
Use access() instead of stat() in FileSystem::fileExists(). stat() returns a lot of information we
do not leverage and local benchmarking on macOS shows access() being > 80% faster than stat():
stat: 0.31567 (lower is better)
access: 0.16074 (lower is better)
stat: 0.303665 (lower is better)
access: 0.165468 (lower is better)
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::fileExists):
2018-05-22 Brent Fulgham <bfulgham@apple.com>
Avoid keeping FormState alive longer than necessary
https://bugs.webkit.org/show_bug.cgi?id=185877
<rdar://problem/39329219>
Reviewed by Ryosuke Niwa.
A number of crash fixes were done to prevent FormState objects from being
accessed after their relevant Frames had been destroyed. Unfortunately, this
could cause the FormState to persist after the owning Frame had been
destroyed, resulting in nullptr dereferences.
This patch does the following:
1. Changes to use WeakPtr's for FormState objects passed to completion handlers,
rather than RefPtr, since those completion handlers might fire as part of
the clean-up process during Frame destruction. This allows us to use the FormState
if they are still valid, but gracefully handle cases where a form submission
is cancelled in-flight.
2. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
3. Changes the trap from Bug 183704 so that it only fires if the FormState object
is being retained more than once.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
signature.
* loader/FormState.cpp:
(WebCore::FormState::willDetachPage): Revise trap to check for retain counts
above one.
* loader/FormState.h:
(WebCore::FormState::weakPtrFactory const): Added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest): Revise to use WeakPtr for FormState
passed to the completion handler.
(WebCore::FrameLoader::loadURL): Update for new CompletionHandler signature.
(WebCore::FrameLoader::load): Ditto.
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::loadPostRequest): Ditto.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): Revise to use WeakPtr for
FormState passed to the completion handler. Remove some extraneous WTFMove()
calls on bare pointers.
(WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
* loader/PolicyChecker.h:
2018-05-22 Sihui Liu <sihui_liu@apple.com>
Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
https://bugs.webkit.org/show_bug.cgi?id=185715
Reviewed by Geoffrey Garen.
Fixed the issue of null port when converting between SecurityOriginData and DatabaseIdentifier.
Test: WKWebView.LocalStorageFetchDataRecords.
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
2018-05-22 Keith Miller <keith_miller@apple.com>
We should have a CoW storage for NewArrayBuffer arrays.
https://bugs.webkit.org/show_bug.cgi?id=185003
Reviewed by Filip Pizlo.
* bindings/js/JSDOMConvertSequences.h:
(WebCore::Detail::NumericSequenceConverter::convertArray):
(WebCore::Detail::SequenceConverter::convertArray):
2018-05-22 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r232052.
Breaks internal builds.
Reverted changeset:
"Use more C++17"
https://bugs.webkit.org/show_bug.cgi?id=185176
https://trac.webkit.org/changeset/232052
2018-05-22 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
https://bugs.webkit.org/show_bug.cgi?id=185867
Reviewed by Michael Catanzaro.
We need to null check the value returned by URL::createSoupURI() before passing it to soup.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM):
(WebCore::cookiesForSession):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getCookies):
2018-05-22 Zalan Bujtas <zalan@apple.com>
[LFC] Implement positioning for non-replaced out-of-flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185858
Reviewed by Antti Koivisto.
In certain cases, the out-of-flow element's final position depends on the element's size.
Call computeOutOfFlowPosition() after width/height are resolved.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const):
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
* layout/FormattingContext.h:
2018-05-22 Olivier Blin <olivier.blin@softathome.com>
Fix build without MathML
https://bugs.webkit.org/show_bug.cgi?id=185865
Reviewed by Frédéric Wang.
Regression(r226654): [RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181443
Regression(r229694): Put the DOM in IsoHeaps
https://bugs.webkit.org/show_bug.cgi?id=183546
No new tests, build fix.
* mathml/MathMLUnknownElement.cpp:
* mathml/MathMLUnknownElement.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::attach):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMathML.cpp:
* rendering/updating/RenderTreeBuilderMathML.h:
2018-05-22 Yacine Bandou <yacine.bandou_ext@softathome.com>
[GStreamer] Don't set the ReadyState to HaveNothing when an error occurs in playback pipeline
https://bugs.webkit.org/show_bug.cgi?id=185725
Reviewed by Philippe Normand.
The ReadyState should not be set to HaveNothing when an error occurs in playback pipeline, because
at least we should have the metadata in order to have an error in pipeline.
Here is the definition of HaveNothing state in W3C spec https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states
"HAVE_NOTHING (numeric value 0): No information regarding the media resource is available. No data for the current
playback position is available. Media elements whose networkState attribute is NETWORK_EMPTY are always in the HAVE_NOTHING state."
In MSE case, this patch fixes the crashes of the followings WPT encrypted-media tests:
- clearkey-mp4-playback-temporary-clear-encrypted.https.html
- clearkey-mp4-playback-temporary-multikey-sequential.https.html
- clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html
Here is the cause of the crashes: When an error occurs in playback pipeline like no decipher key, in case of encrypted content,
the MediaPlayerPrivateGstreamer sets NetworkState to FormatError which causes the detachment of MediaElement from MediaSource,
then MediaPlayerPrivateGstreamer sets the ReadyState to HaveNothing which causes a trying again to play the same URI,
thus the crash occurs because the MediaElement is detached from MediaSource, see bugzilla for more details.
Note: these crashes should be fixed in 185242 but unfortunately it isn't the case. See bug 185242 for more details.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2018-05-22 Yacine Bandou <yacine.bandou_ext@softathome.com>
[MSE][GStreamer] Fix the deadlock caused by bug 185242 (r231351)
https://bugs.webkit.org/show_bug.cgi?id=185723
Reviewed by Xabier Rodriguez-Calvar.
After a detailed investigation, we found that, the patch r231351 doesn't fix the crash that expected to fix,
it just replaces it by a deadlock. Now the crash is fixed in the bug 185725.
This Patch will remove a part of r231351 that causes the deadlock.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcFreeStream):
2018-05-21 Yusuke Suzuki <utatane.tea@gmail.com>
Use more C++17
https://bugs.webkit.org/show_bug.cgi?id=185176
Reviewed by JF Bastien.
* Configurations/Base.xcconfig:
* DerivedSources.make:
* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::dropDistantTiles):
2018-05-21 Zalan Bujtas <zalan@apple.com>
[LFC] Box::isDescendantOf() should work with out-of-flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185812
Reviewed by Antti Koivisto.
Use the containing block chain instead of the parent chain to check for isDescendantOf().
(containing block is not always the direct parent)
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isDescendantOf const):
2018-05-21 Chris Nardi <cnardi@chromium.org>
Remove dead exception in MediaList.appendMedium
https://bugs.webkit.org/show_bug.cgi?id=185278
Reviewed by Chris Dumez.
MediaList.appendMedium was able to throw an exception, but MediaQuerySet::add() always
returned true, making it impossible for that exception to be thrown. This matched the
spec, as |appendMedium| is not specified to throw an exception. Remove the dead code
surrounding the exception, and make MediaQuerySet::add() return false if the medium is
not added.
No new/modified tests as there should be no functional changes.
* css/MediaList.cpp:
(WebCore::MediaQuerySet::add):
(WebCore::MediaList::appendMedium):
* css/MediaList.h:
* css/MediaList.idl:
2018-05-21 Chris Dumez <cdumez@apple.com>
File's structured serialization should serialize lastModified attribute
https://bugs.webkit.org/show_bug.cgi?id=185773
Reviewed by Youenn Fablet.
Update our implementation for the stuctured serialization of a File to include
its lastModified attribute, as per:
- https://w3c.github.io/FileAPI/#file-section
No new tests, rebaselined existing test.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::readFile):
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:
2018-05-21 Zalan Bujtas <zalan@apple.com>
[LFC] Add FormattingContext::validateGeometryConstraintsAfterLayout
https://bugs.webkit.org/show_bug.cgi?id=185811
Reviewed by Antti Koivisto.
Also implement LayoutDescendantIterator and fix LayoutIterator.
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/layouttree/LayoutDescendantIterator.h: Added.
(WebCore::Layout::LayoutDescendantIterator<T>::LayoutDescendantIterator):
(WebCore::Layout::LayoutDescendantIterator<T>::operator):
(WebCore::Layout::LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter):
(WebCore::Layout::LayoutDescendantIteratorAdapter<T>::begin):
(WebCore::Layout::LayoutDescendantIteratorAdapter<T>::end):
(WebCore::Layout::LayoutDescendantIteratorAdapter<T>::at):
(WebCore::Layout::descendantsOfType):
* layout/layouttree/LayoutIterator.h:
(WebCore::Layout::LayoutBoxTraversal::firstChild):
(WebCore::Layout::LayoutBoxTraversal::nextAncestorSibling):
(WebCore::Layout::LayoutBoxTraversal::next):
(WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren):
(WebCore::Layout::Traversal::firstChild):
(WebCore::Layout::Traversal::nextSibling):
(WebCore::Layout::Traversal::previousSibling):
(WebCore::Layout::Traversal::findAncestorOfType):
(WebCore::Layout::Traversal::firstWithin):
(WebCore::Layout::Traversal::next):
(WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
(WebCore::Layout::LayoutIterator<T>::traverseAncestor):
(WebCore::Layout::Traversal::nextAncestorSibling): Deleted.
(WebCore::Layout::Traversal::nextWithin): Deleted.
2018-05-21 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Bugfix for r231968, Suspend/Resume with WK2
https://bugs.webkit.org/show_bug.cgi?id=185830
The flags are needed to be updated even if it is cancelled or finished to cleanup correctly.
Also fixed trivial bug for very rare case (hard to produce the situation).
Reviewed by Youenn Fablet.
No new tests because WK2 is not ready for WinCairo yet in public., tested internaly.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::suspend):
(WebCore::CurlRequest::resume):
(WebCore::CurlRequest::pausedStatusChanged):
2018-05-21 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r232030.
https://bugs.webkit.org/show_bug.cgi?id=185850
"Caused
TestWebKitAPI.IndexedDB.StructuredCloneBackwardCompatibility
API test to fail" (Requested by cdumez on #webkit).
Reverted changeset:
"File's structured serialization should serialize lastModified
attribute"
https://bugs.webkit.org/show_bug.cgi?id=185773
https://trac.webkit.org/changeset/232030
2018-05-21 Daniel Bates <dabates@apple.com>
REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
https://bugs.webkit.org/show_bug.cgi?id=185789
<rdar://problem/40380175>
Reviewed by Andy Estes.
Fixes an issue where CSP report-only policies were ignored for DocumentThreadableLoader and
PingLoad initiated loads as a result of moving CSP processing to NetworkProcess.
Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
console messages, sending CSP reports, and dispatching SecurityPolicyViolation events. To support
the latter we introduce a new WebPage message, EnqueueSecurityPolicyViolationEvent, to enqueue
a SecurityPolicyViolationEvent created from an event init dictionary on the document's event
dispatch queue.
Additionally, shorten the description for a ResourceError caused by CSP to "Blocked by Content Security Policy"
because the CSP code run in NetworkProcess can now log its more detailed error description to
Web Inspector.
Tests: http/tests/security/contentSecurityPolicy/connect-src-beacon-allowed.html
http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked.html
http/tests/security/contentSecurityPolicy/report-only-connect-src-beacon-redirect-blocked.php
http/tests/security/contentSecurityPolicy/report-only-connect-src-xmlhttprequest-redirect-to-blocked.php
* WebCore.xcodeproj/project.pbxproj: Change SecurityPolicyViolationEvent.h from a project header to
a private header so that we can include it in WebKit code.
* dom/Document.cpp:
(WebCore::Document::enqueueSecurityPolicyViolationEvent): Added.
* dom/Document.h:
* dom/EventInit.h:
(WebCore::EventInit::encode const):
(WebCore::EventInit::decode
* dom/SecurityPolicyViolationEvent.h:
(WebCore::SecurityPolicyViolationEvent::Init::encode const):
(WebCore::SecurityPolicyViolationEvent::Init::decode):
Support encoding and decoding for the event.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::enqueueSecurityPolicyViolationEvent): Formerly named "dispatchSecurityPolicyViolationEvent".
(WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Deleted; renamed to "enqueueSecurityPolicyViolationEvent".
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived): While I am here, move the check for whether the loader
strategy took responsibility for performing security checks to be before we perform the CSP check to avoid doing
such CSP checks twice in the case that the loader strategy already did them.
(WebCore::DocumentThreadableLoader::didFail): Remove code that checked the CSP policy if the load failed. When
the loader strategy (NetworkProcess) is responsible for performing security checks then this code would never
be executed for a violation of a CSP report-only policy because the loader does not and should not fail the load
for a report-only violations. As the name implies, a report-only violation is only reported. That is, it is not
enforced such that the load is blocked; => fail the load.
(WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError): Update the error description to more
accurately describe the error and be consistent with the error message used in NetworkProcess. This error
message is shown for a redirect blocked by CSP regardless of whether the redirect was to a same-origin or
cross-origin resource. I chose to make the error message more vague than necessary for simplicity because
the CSP code will log a more detailed message for this error than could ever be captured by error message
for the ResourceError. Also use ASCIILiteral to efficiently construct the String object for the error
message.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const): Build up a SecurityPolicyViolationEvent::Init and
pass that to the delegate to dispatch.
* page/csp/ContentSecurityPolicy.h: Export allowScriptFromSource() and allowChildContextFromSource() so that
we can call them from WebKit.
* page/csp/ContentSecurityPolicyClient.h: Update for renaming.
* platform/network/ResourceRequestBase.h: Define a new requester type to be able to differentiate a request
initiated by importScripts() from other requests. We use this to perform the appropriate CSP checks in NetworkProcess.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously): Set the requester on the ResourceRequest to ResourceRequest::Requester::ImportScripts
so that we can differentiate this request from other requests. See remark for file ResourceRequestBase.h for
more details.
2018-05-21 Chris Dumez <cdumez@apple.com>
File's structured serialization should serialize lastModified attribute
https://bugs.webkit.org/show_bug.cgi?id=185773
Reviewed by Youenn Fablet.
Update our implementation for the stuctured serialization of a File to include
its lastModified attribute, as per:
- https://w3c.github.io/FileAPI/#file-section
No new tests, rebaselined existing test.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::readFile):
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:
2018-05-21 Jer Noble <jer.noble@apple.com>
Complete fix for enabling modern EME by default
https://bugs.webkit.org/show_bug.cgi?id=185770
<rdar://problem/40368220>
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig:
2018-05-21 Olivier Blin <olivier.blin@softathome.com>
[CMake][WebCore] fix sqlite include dir variable
https://bugs.webkit.org/show_bug.cgi?id=185825
Reviewed by Konstantin Tokarev.
WebCore's CMakeLists.txt used SQLITE_INCLUDE_DIRS, but only SQLITE_INCLUDE_DIR is defined.
No new tests, build fix only.
* CMakeLists.txt: Use SQLITE_INCLUDE_DIR instead of SQLITE_INCLUDE_DIRS.
2018-05-21 Olivier Blin <olivier.blin@softathome.com>
Propagate WebCore system include dirs in WebCoreHeaderInterface
https://bugs.webkit.org/show_bug.cgi?id=185822
Reviewed by Michael Catanzaro.
System include directories from WebCore are not propagated anymore to its users.
For example gcrypt, sqlite and ICU system headers defined in PAL are not properly passed to WebKit build.
This may have been caused partly by the fix in r230385:
[CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
https://bugs.webkit.org/show_bug.cgi?id=184127
No new tests, build fix.
* CMakeLists.txt:
2018-05-21 Olivier Blin <olivier.blin@softathome.com>
Fix FrameLoader build without video
https://bugs.webkit.org/show_bug.cgi?id=185821
Reviewed by Michael Catanzaro.
Regression(r231392): Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
https://bugs.webkit.org/show_bug.cgi?id=185288
No new tests, build fix only.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkCompleted): Flag HTMLMediaElement::isRunningDestructor() usage.
2018-05-21 Sam Weinig <sam@webkit.org>
Modernize RenderStyleConstants.h - Part 1
https://bugs.webkit.org/show_bug.cgi?id=185809
Reviewed by Yusuke Suzuki.
Modernized the first set of enums in RenderStyleConstants.h by:
- Converting them to enum classes
- Renaming them to remove unnecessary prefix 'E's
- Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
- Renaming to match modern conventions (e.g BNONE -> None)
- Reformatting them so that each value is on its own line.
Modernizes the following enums:
PrintColorAdjust
StyleDifference
StyleDifferenceContextSensitiveProperty
ColumnFill
ColumnSpan
BorderCollapse (renamed from EBorderCollapse)
BorderStyle (renamed from EBorderStyle)
BorderPrecedence (renamed from EBorderPrecedence)
OutlineIsAuto
PositionType (renamed from EPosition)
Float (renamed from EFloat)
MarginCollapse (renamed from EMarginCollapse)
BoxDecorationBreak (renamed from EBoxDecorationBreak)
BoxSizing (renamed from EBoxSizing)
Overflow (renamed from EOverflow)
VerticalAlign (renamed from EVerticalAlign)
Clear (renamed from EClear)
TableLayoutType (renamed from ETableLayout)
TextCombine
FillAttachment (renamed from EFillAttachment)
FillBox (renamed from EFillBox)
FillRepeat (renamed from EFillRepeat)
FillLayerType (renamed from EFillLayerType)
FillSizeType (renamed from EFillSizeType)
MaskSourceType (renamed from EMaskSourceType)
BoxPack (renamed from EBoxPack)
BoxAlignment (renamed from EBoxAlignment)
BoxOrient (renamed from EBoxOrient)
BoxLines (renamed from EBoxLines)
BoxDirection (renamed from EBoxDirection)
AlignContent (renamed from EAlignContent)
FlexDirection (renamed from EFlexDirection)
FlexWrap (renamed from EFlexWrap)
ItemPosition
OverflowAlignment
ItemPositionType
ContentPosition
ContentDistribution (renamed from ContentDistributionType)
TextSecurity (renamed from ETextSecurity)
UserModify (renamed from EUserModify)
UserDrag (renamed from EUserDrag)
UserSelect (renamed from EUserSelect)
ObjectFit
AspectRatioType
WordBreak (renamed from EWordBreak)
OverflowWrap (renamed from EOverflowWrap)
NBSPMode (renamed from ENBSPMode)
LineBreak
Resize (renamed from EResize)
QuoteType
TransformStyle3D (renamed from ETransformStyle3D)
BackfaceVisibility (renamed from EBackfaceVisibility)
LineClamp (renamed from ELineClamp)
TextOverflow
ImageRendering (renamed from EImageRendering)
TextIndentLine
TextIndentType
Isolation
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetStyle):
* css/BasicShapeFunctions.cpp:
(WebCore::valueForCenterCoordinate):
(WebCore::valueForBasicShape):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::sizingBox):
(WebCore::fillRepeatToCSSValue):
(WebCore::fillSourceTypeToCSSValue):
(WebCore::fillSizeToCSSValue):
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator LineClampValue const):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ColumnFill const):
(WebCore::CSSPrimitiveValue::operator ColumnSpan const):
(WebCore::CSSPrimitiveValue::operator PrintColorAdjust const):
(WebCore::CSSPrimitiveValue::operator BorderStyle const):
(WebCore::CSSPrimitiveValue::operator OutlineIsAuto const):
(WebCore::CSSPrimitiveValue::operator BackfaceVisibility const):
(WebCore::CSSPrimitiveValue::operator FillAttachment const):
(WebCore::CSSPrimitiveValue::operator FillBox const):
(WebCore::CSSPrimitiveValue::operator FillRepeat const):
(WebCore::CSSPrimitiveValue::operator BoxPack const):
(WebCore::CSSPrimitiveValue::operator BoxAlignment const):
(WebCore::CSSPrimitiveValue::operator BoxDecorationBreak const):
(WebCore::CSSPrimitiveValue::operator BoxSizing const):
(WebCore::CSSPrimitiveValue::operator BoxDirection const):
(WebCore::CSSPrimitiveValue::operator BoxLines const):
(WebCore::CSSPrimitiveValue::operator BoxOrient const):
(WebCore::CSSPrimitiveValue::operator Clear const):
(WebCore::CSSPrimitiveValue::operator FlexDirection const):
(WebCore::CSSPrimitiveValue::operator AlignContent const):
(WebCore::CSSPrimitiveValue::operator FlexWrap const):
(WebCore::CSSPrimitiveValue::operator Float const):
(WebCore::CSSPrimitiveValue::operator LineBreak const):
(WebCore::CSSPrimitiveValue::operator MarginCollapse const):
(WebCore::CSSPrimitiveValue::operator NBSPMode const):
(WebCore::CSSPrimitiveValue::operator Overflow const):
(WebCore::CSSPrimitiveValue::operator PositionType const):
(WebCore::CSSPrimitiveValue::operator Resize const):
(WebCore::CSSPrimitiveValue::operator TableLayoutType const):
(WebCore::CSSPrimitiveValue::operator TextSecurity const):
(WebCore::CSSPrimitiveValue::operator UserDrag const):
(WebCore::CSSPrimitiveValue::operator UserModify const):
(WebCore::CSSPrimitiveValue::operator UserSelect const):
(WebCore::CSSPrimitiveValue::operator VerticalAlign const):
(WebCore::CSSPrimitiveValue::operator WordBreak const):
(WebCore::CSSPrimitiveValue::operator OverflowWrap const):
(WebCore::CSSPrimitiveValue::operator TextCombine const):
(WebCore::CSSPrimitiveValue::operator TextOverflow const):
(WebCore::CSSPrimitiveValue::operator ObjectFit const):
(WebCore::CSSPrimitiveValue::operator Isolation const):
(WebCore::CSSPrimitiveValue::operator BorderCollapse const):
(WebCore::CSSPrimitiveValue::operator ImageRendering const):
(WebCore::CSSPrimitiveValue::operator TransformStyle3D const):
(WebCore::CSSPrimitiveValue::operator ItemPosition const):
(WebCore::CSSPrimitiveValue::operator OverflowAlignment const):
(WebCore::CSSPrimitiveValue::operator ContentPosition const):
(WebCore::CSSPrimitiveValue::operator ContentDistribution const):
(WebCore::CSSPrimitiveValue::operator EBorderStyle const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBackfaceVisibility const): Deleted.
(WebCore::CSSPrimitiveValue::operator EFillAttachment const): Deleted.
(WebCore::CSSPrimitiveValue::operator EFillBox const): Deleted.
(WebCore::CSSPrimitiveValue::operator EFillRepeat const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxPack const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxAlignment const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxDecorationBreak const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxSizing const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxDirection const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxLines const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBoxOrient const): Deleted.
(WebCore::CSSPrimitiveValue::operator EClear const): Deleted.
(WebCore::CSSPrimitiveValue::operator EFlexDirection const): Deleted.
(WebCore::CSSPrimitiveValue::operator EAlignContent const): Deleted.
(WebCore::CSSPrimitiveValue::operator EFlexWrap const): Deleted.
(WebCore::CSSPrimitiveValue::operator EFloat const): Deleted.
(WebCore::CSSPrimitiveValue::operator EMarginCollapse const): Deleted.
(WebCore::CSSPrimitiveValue::operator ENBSPMode const): Deleted.
(WebCore::CSSPrimitiveValue::operator EOverflow const): Deleted.
(WebCore::CSSPrimitiveValue::operator EPosition const): Deleted.
(WebCore::CSSPrimitiveValue::operator EResize const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETableLayout const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETextSecurity const): Deleted.
(WebCore::CSSPrimitiveValue::operator EUserDrag const): Deleted.
(WebCore::CSSPrimitiveValue::operator EUserModify const): Deleted.
(WebCore::CSSPrimitiveValue::operator EUserSelect const): Deleted.
(WebCore::CSSPrimitiveValue::operator EVerticalAlign const): Deleted.
(WebCore::CSSPrimitiveValue::operator EWordBreak const): Deleted.
(WebCore::CSSPrimitiveValue::operator EOverflowWrap const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBorderCollapse const): Deleted.
(WebCore::CSSPrimitiveValue::operator EImageRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETransformStyle3D const): Deleted.
(WebCore::CSSPrimitiveValue::operator ContentDistributionType const): Deleted.
* css/CSSProperties.json:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillAttachment):
(WebCore::CSSToStyleMap::mapFillSize):
(WebCore::CSSToStyleMap::mapFillMaskSourceType):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertResize):
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueTextIndent):
(WebCore::StyleBuilderCustom::applyInheritWebkitAspectRatio):
(WebCore::StyleBuilderCustom::applyValueWebkitAspectRatio):
(WebCore::StyleBuilderCustom::applyValueContent):
* css/StyleResolver.cpp:
(WebCore::isScrollableOverflow):
(WebCore::StyleResolver::adjustRenderStyle):
* css/StyleResolver.h:
* css/makeprop.pl:
(getFillLayerType):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::canStartSelection const):
* dom/Position.cpp:
(WebCore::Position::nodeIsUserSelectNone):
(WebCore::Position::nodeIsUserSelectAll):
* dom/Range.cpp:
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::doApply):
* editing/Editing.cpp:
(WebCore::isSpecialHTMLElement):
* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SimplifyMarkupCommand.cpp:
(WebCore::SimplifyMarkupCommand::doApply):
* editing/VisibleUnits.cpp:
(WebCore::backwardSearchForBoundaryWithTextIterator):
(WebCore::forwardSearchForBoundaryWithTextIterator):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::fontAttributesForSelectionStart const):
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedStringFromRange):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::shouldTruncateText const):
(WebCore::HTMLInputElement::createInnerTextStyle):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::layout):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::resolveCustomStyle):
(WebCore::TextControlInnerElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isRelativelyPositioned const):
(WebCore::Layout::Box::isStickyPositioned const):
(WebCore::Layout::Box::isAbsolutelyPositioned const):
(WebCore::Layout::Box::isFixedPositioned const):
(WebCore::Layout::Box::isFloatingPositioned const):
(WebCore::Layout::Box::isOverflowVisible const):
* page/DragController.cpp:
(WebCore::DragController::draggableElement const):
* page/Frame.cpp:
(WebCore::Frame::rangeForPoint):
* page/FrameView.cpp:
(WebCore::paginationModeForRenderStyle):
(WebCore::FrameView::applyOverflowToViewport):
(WebCore::FrameView::applyPaginationToViewport):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::calculateExtendedBackgroundMode const):
(WebCore::FrameView::adjustScrollStepForFixedContent):
* page/SpatialNavigation.cpp:
(WebCore::canScrollInDirection):
(WebCore::canBeScrolledIntoView):
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToScrollWheelEvents):
* page/mac/EventHandlerMac.mm:
(WebCore::scrolledToEdgeInDominantDirection):
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::BorderEdge):
(WebCore::BorderEdge::obscuresBackgroundEdge const):
(WebCore::BorderEdge::obscuresBackground const):
* rendering/BorderEdge.h:
(WebCore::BorderEdge::style const):
(WebCore::BorderEdge::hasVisibleColorAndStyle const):
* rendering/FlexibleBoxAlgorithm.h:
(WebCore::FlexLayoutAlgorithm::isMultiline const):
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::FloatingObject):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::innerTextIfTruncated const):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::interpolationQualityFromStyle):
* rendering/InlineBox.h:
(WebCore::InlineBox::verticalAlign const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
(WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
(WebCore::InlineFlowBox::computeLogicalBoxHeights):
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::paintFillLayer):
* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::LogicalSelectionOffsetCaches::containingBlockInfo const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removePositionedObjectsIfNeeded):
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::isSelfCollapsingBlock const):
(WebCore::RenderBlock::addOverflowFromPositionedObjects):
(WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
(WebCore::RenderBlock::isSelectionRoot const):
(WebCore::RenderBlock::selectionGaps):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
(WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing const):
(WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
(WebCore::RenderBlockFlow::willCreateColumns const):
(WebCore::RenderBlockFlow::marginOffsetForSelfCollapsingBlock):
(WebCore::RenderBlockFlow::clearFloatsIfNeeded):
(WebCore::RenderBlockFlow::marginBeforeEstimateForChild const):
(WebCore::RenderBlockFlow::setMustDiscardMarginBefore):
(WebCore::RenderBlockFlow::setMustDiscardMarginAfter):
(WebCore::RenderBlockFlow::mustDiscardMarginBefore const):
(WebCore::RenderBlockFlow::mustDiscardMarginAfter const):
(WebCore::RenderBlockFlow::mustDiscardMarginBeforeForChild const):
(WebCore::RenderBlockFlow::mustDiscardMarginAfterForChild const):
(WebCore::RenderBlockFlow::mustSeparateMarginBeforeForChild const):
(WebCore::RenderBlockFlow::mustSeparateMarginAfterForChild const):
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::styleWillChange):
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::clearFloats):
(WebCore::RenderBlockFlow::getClearDelta):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::expansionBehaviorForInlineTextBox):
(WebCore::isCollapsibleSpace):
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutLineBoxes):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::updateFromStyle):
(WebCore::RenderBox::includeVerticalScrollbarSize const):
(WebCore::RenderBox::includeHorizontalScrollbarSize const):
(WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::adjustBorderBoxLogicalWidthForBoxSizing const):
(WebCore::RenderBox::adjustBorderBoxLogicalHeightForBoxSizing const):
(WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const):
(WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing const):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
(WebCore::isCandidateForOpaquenessTest):
(WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
(WebCore::RenderBox::computeRectForRepaint const):
(WebCore::RenderBox::computeLogicalWidthInFragment const):
(WebCore::RenderBox::columnFlexItemHasStretchAlignment const):
(WebCore::RenderBox::isStretchingColumnFlexItem const):
(WebCore::RenderBox::hasStretchedLogicalWidth const):
(WebCore::RenderBox::sizesLogicalWidthToFitContent const):
(WebCore::RenderBox::computeLogicalHeight const):
(WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing const):
(WebCore::RenderBox::createsNewFormattingContext const):
* rendering/RenderBox.h:
(WebCore::RenderBox::scrollsOverflowX const):
(WebCore::RenderBox::scrollsOverflowY const):
(WebCore::RenderBox::selfAlignmentNormalBehavior const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateFillTileSize const):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
(WebCore::styleRequiresClipPolygon):
(WebCore::borderStyleFillsBorderArea):
(WebCore::borderStyleHasInnerDetail):
(WebCore::borderStyleIsDottedOrDashed):
(WebCore::borderStyleHasUnmatchedColorsAtCorner):
(WebCore::borderStylesRequireMitre):
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::drawBoxSideFromPath):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
* rendering/RenderBoxModelObject.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::FlexBoxIterator::FlexBoxIterator):
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustStyleDifference const):
(WebCore::RenderElement::shouldRepaintForStyleDifference const):
(WebCore::RenderElement::initializeStyle):
(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::didAttachChild):
(WebCore::RenderElement::propagateStyleToAnonymousChildren):
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
(WebCore::mustRepaintFillLayers):
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::drawLineForBoxSide const):
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::paintOutline):
(WebCore::RenderElement::updateOutlineAutoAncestor):
(WebCore::includeNonFixedHeight):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasHiddenBackface const):
(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::firstLineBaseline const):
(WebCore::contentAlignmentNormalBehavior):
(WebCore::RenderFlexibleBox::styleDidChange):
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
(WebCore::RenderFlexibleBox::isLeftToRightFlow const):
(WebCore::RenderFlexibleBox::isMultiline const):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
(WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
(WebCore::initialJustifyContentOffset):
(WebCore::justifyContentSpaceBetweenChildren):
(WebCore::alignmentOffset):
(WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
(WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
(WebCore::RenderFlexibleBox::alignmentForChild const):
(WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight const):
(WebCore::RenderFlexibleBox::mainAxisOverflowForChild const):
(WebCore::RenderFlexibleBox::crossAxisOverflowForChild const):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::initialAlignContentOffset):
(WebCore::alignContentSpaceBetweenChildren):
(WebCore::RenderFlexibleBox::alignFlexLines):
(WebCore::RenderFlexibleBox::alignChildren):
* rendering/RenderFlexibleBox.h:
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::overflowRectForFragmentedFlowPortion):
* rendering/RenderFullScreen.cpp:
(WebCore::createFullScreenStyle):
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::selfAlignmentChangedToStretch const):
(WebCore::RenderGrid::selfAlignmentChangedFromStretch const):
(WebCore::RenderGrid::styleDidChange):
(WebCore::contentAlignmentNormalBehaviorGrid):
(WebCore::computeOverflowAlignmentOffset):
(WebCore::RenderGrid::isInlineBaselineAlignedChild const):
(WebCore::RenderGrid::columnAxisPositionForChild const):
(WebCore::RenderGrid::rowAxisPositionForChild const):
(WebCore::RenderGrid::resolveAutoStartGridPosition const):
(WebCore::RenderGrid::resolveAutoEndGridPosition const):
(WebCore::resolveContentDistributionFallback):
(WebCore::contentDistributionOffset):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset const):
* rendering/RenderGrid.h:
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::requiresLayer const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::styleDidChange):
(WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::styleWillChange):
(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
(WebCore::RenderInline::paintOutline):
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderLayer.cpp:
(WebCore::isContainerForPositioned):
(WebCore::RenderLayer::enclosingAncestorForPosition const):
(WebCore::accumulateOffsetTowardsAncestor):
(WebCore::RenderLayer::canResize const):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::scrollCornerRect const):
(WebCore::resizerCornerRect):
(WebCore::RenderLayer::hasOverflowControls const):
(WebCore::styleRequiresScrollbar):
(WebCore::styleDefinesAutomaticScrollbar):
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
(WebCore::backgroundRectForBox):
* rendering/RenderLayerCompositor.cpp:
(WebCore::isScrollableOverflow):
(WebCore::styleChangeRequiresLayerRebuild):
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::layerHas3DContent const):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleWillChange):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::requiresBalancing const):
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
(WebCore::containerForElement):
(WebCore::RenderObject::calculateBorderStyleColor):
* rendering/RenderObject.h:
(WebCore::RenderObject::isFixedPositioned const):
(WebCore::RenderObject::isAbsolutelyPositioned const):
(WebCore::RenderObject::setPositionState):
(WebCore::RenderObject::RenderObjectBitfields::setPositionedState):
(WebCore::RenderObject::RenderObjectBitfields::clearPositionedState):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::styleDidChange):
(WebCore::RenderQuote::computeText const):
(WebCore::RenderQuote::isOpen const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::layout):
(WebCore::RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange):
(WebCore::RenderReplaced::replacedContentRect const):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::styleDidChange):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::styleDidChange):
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
(WebCore::RenderTable::calcBorderStart const):
(WebCore::RenderTable::calcBorderEnd const):
(WebCore::RenderTable::outerBorderBefore const):
(WebCore::RenderTable::outerBorderAfter const):
(WebCore::RenderTable::outerBorderStart const):
(WebCore::RenderTable::outerBorderEnd const):
* rendering/RenderTable.h:
(WebCore::RenderTable::collapseBorders const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeIntrinsicPadding):
(WebCore::RenderTableCell::styleDidChange):
(WebCore::compareBorders):
(WebCore::chooseBorder):
(WebCore::emptyBorder):
(WebCore::RenderTableCell::computeCollapsedStartBorder const):
(WebCore::RenderTableCell::computeCollapsedEndBorder const):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
(WebCore::RenderTableCell::computeCollapsedAfterBorder const):
(WebCore::CollapsedBorders::addBorder):
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::scrollbarsChanged):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::logicalHeightForRowSizing const):
(WebCore::RenderTableCell::isBaselineAligned const):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::styleDidChange):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcOuterBorderBefore const):
(WebCore::RenderTableSection::calcOuterBorderAfter const):
(WebCore::RenderTableSection::calcOuterBorderStart const):
(WebCore::RenderTableSection::calcOuterBorderEnd const):
(WebCore::RenderTableSection::paintRowGroupBorder):
(WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
(WebCore::RenderTableSection::cachedCollapsedBorder):
* rendering/RenderTableSection.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):
(WebCore::RenderText::absoluteQuadsClippedToEllipsis const):
(WebCore::isSpaceAccordingToStyle):
(WebCore::mapLineBreakToIteratorMode):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::setRenderedText):
(WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):
(WebCore::RenderText::momentarilyRevealLastTypedCharacter):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight const):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::styleDidChange):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::extractControlStatesForRenderer const):
* rendering/RenderThemeIOS.mm:
(WebCore::adjustInputElementButtonStyle):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::updateFocusedState):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::adjustSearchFieldStyle const):
* rendering/RenderTreeAsText.cpp:
(WebCore::printBorderStyle):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updatePlayer):
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
(WebCore::rendererObscuresBackground):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::verticalPositionForBox):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleBR):
(WebCore::shouldAddBorderPaddingMargin):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::reset):
* rendering/line/LineBreaker.h:
(WebCore::LineBreaker::clear):
* rendering/line/LineInlineHeaders.h:
(WebCore::skipNonBreakingSpace):
* rendering/line/LineWidth.cpp:
(WebCore::requiresIndent):
* rendering/style/BorderData.h:
(WebCore::BorderData::borderLeftWidth const):
(WebCore::BorderData::borderRightWidth const):
(WebCore::BorderData::borderTopWidth const):
(WebCore::BorderData::borderBottomWidth const):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::BorderValue):
(WebCore::BorderValue::nonZero const):
(WebCore::BorderValue::isVisible const):
(WebCore::BorderValue::style const):
* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::CollapsedBorderValue):
(WebCore::CollapsedBorderValue::width const):
(WebCore::CollapsedBorderValue::style const):
(WebCore::CollapsedBorderValue::exists const):
(WebCore::CollapsedBorderValue::precedence const):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
(WebCore::clipMax):
(WebCore::FillLayer::computeClipMax const):
(WebCore::FillLayer::hasRepeatXY const):
(WebCore::FillLayer::hasFixedImage const):
* rendering/style/FillLayer.h:
(WebCore::FillSize::FillSize):
(WebCore::FillLayer::attachment const):
(WebCore::FillLayer::clip const):
(WebCore::FillLayer::origin const):
(WebCore::FillLayer::repeatX const):
(WebCore::FillLayer::repeatY const):
(WebCore::FillLayer::sizeType const):
(WebCore::FillLayer::size const):
(WebCore::FillLayer::maskSourceType const):
(WebCore::FillLayer::isSizeSet const):
(WebCore::FillLayer::setAttachment):
(WebCore::FillLayer::setClip):
(WebCore::FillLayer::setOrigin):
(WebCore::FillLayer::setRepeatX):
(WebCore::FillLayer::setRepeatY):
(WebCore::FillLayer::setComposite):
(WebCore::FillLayer::setBlendMode):
(WebCore::FillLayer::setSizeType):
(WebCore::FillLayer::setSize):
(WebCore::FillLayer::setMaskSourceType):
(WebCore::FillLayer::clearSize):
(WebCore::FillLayer::type const):
(WebCore::FillLayer::initialFillAttachment):
(WebCore::FillLayer::initialFillClip):
(WebCore::FillLayer::initialFillOrigin):
(WebCore::FillLayer::initialFillRepeatX):
(WebCore::FillLayer::initialFillRepeatY):
(WebCore::FillLayer::initialFillComposite):
(WebCore::FillLayer::initialFillBlendMode):
(WebCore::FillLayer::initialFillSize):
(WebCore::FillLayer::initialFillXPosition):
(WebCore::FillLayer::initialFillYPosition):
(WebCore::FillLayer::initialFillImage):
(WebCore::FillLayer::initialFillMaskSourceType):
* rendering/style/LineClampValue.h:
(WebCore::LineClampValue::LineClampValue):
(WebCore::LineClampValue::isPercentage const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::resolvedSelfAlignment):
(WebCore::RenderStyle::resolvedAlignSelf const):
(WebCore::RenderStyle::resolvedJustifySelf const):
(WebCore::resolvedContentAlignment):
(WebCore::resolvedContentAlignmentPosition):
(WebCore::resolvedContentAlignmentDistribution):
(WebCore::RenderStyle::resolvedJustifyContentDistribution const):
(WebCore::RenderStyle::resolvedAlignContentDistribution const):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::RenderStyle::changeRequiresPositionedLayoutOnly const):
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
(WebCore::RenderStyle::changeRequiresRepaint const):
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const):
(WebCore::RenderStyle::changeRequiresRecompositeLayer const):
(WebCore::RenderStyle::diff const):
(WebCore::RenderStyle::diffRequiresLayerRepaint const):
(WebCore::allLayersAreFixed):
(WebCore::RenderStyle::colorIncludingFallback const):
(WebCore::RenderStyle::setColumnStylesFromPaginationMode):
(WebCore::RenderStyle::outlineWidth const):
(WebCore::RenderStyle::outlineOffset const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isFloating const):
(WebCore::RenderStyle::position const):
(WebCore::RenderStyle::hasOutOfFlowPosition const):
(WebCore::RenderStyle::hasInFlowPosition const):
(WebCore::RenderStyle::hasViewportConstrainedPosition const):
(WebCore::RenderStyle::floating const):
(WebCore::RenderStyle::borderLeftStyle const):
(WebCore::RenderStyle::borderRightStyle const):
(WebCore::RenderStyle::borderTopStyle const):
(WebCore::RenderStyle::borderBottomStyle const):
(WebCore::RenderStyle::hasOutline const):
(WebCore::RenderStyle::outlineStyle const):
(WebCore::RenderStyle::overflowX const):
(WebCore::RenderStyle::overflowY const):
(WebCore::RenderStyle::overflowInlineDirection const):
(WebCore::RenderStyle::overflowBlockDirection const):
(WebCore::RenderStyle::verticalAlign const):
(WebCore::RenderStyle::clear const):
(WebCore::RenderStyle::tableLayout const):
(WebCore::RenderStyle::backgroundRepeatX const):
(WebCore::RenderStyle::backgroundRepeatY const):
(WebCore::RenderStyle::backgroundAttachment const):
(WebCore::RenderStyle::backgroundClip const):
(WebCore::RenderStyle::backgroundOrigin const):
(WebCore::RenderStyle::backgroundSizeType const):
(WebCore::RenderStyle::maskRepeatX const):
(WebCore::RenderStyle::maskRepeatY const):
(WebCore::RenderStyle::maskClip const):
(WebCore::RenderStyle::maskOrigin const):
(WebCore::RenderStyle::maskSizeType const):
(WebCore::RenderStyle::borderCollapse const):
(WebCore::RenderStyle::boxAlign const):
(WebCore::RenderStyle::boxDirection const):
(WebCore::RenderStyle::boxLines const):
(WebCore::RenderStyle::boxOrient const):
(WebCore::RenderStyle::boxPack const):
(WebCore::RenderStyle::flexDirection const):
(WebCore::RenderStyle::isColumnFlexDirection const):
(WebCore::RenderStyle::isReverseFlexDirection const):
(WebCore::RenderStyle::flexWrap const):
(WebCore::RenderStyle::boxDecorationBreak const):
(WebCore::RenderStyle::boxSizing const):
(WebCore::RenderStyle::userModify const):
(WebCore::RenderStyle::userDrag const):
(WebCore::RenderStyle::userSelect const):
(WebCore::RenderStyle::marginBeforeCollapse const):
(WebCore::RenderStyle::marginAfterCollapse const):
(WebCore::RenderStyle::wordBreak const):
(WebCore::RenderStyle::overflowWrap const):
(WebCore::RenderStyle::nbspMode const):
(WebCore::RenderStyle::resize const):
(WebCore::RenderStyle::columnRuleStyle const):
(WebCore::RenderStyle::hasTextCombine const):
(WebCore::RenderStyle::transformStyle3D const):
(WebCore::RenderStyle::preserves3D const):
(WebCore::RenderStyle::backfaceVisibility const):
(WebCore::RenderStyle::textSecurity const):
(WebCore::RenderStyle::imageRendering const):
(WebCore::RenderStyle::setIsolation):
(WebCore::RenderStyle::hasIsolation const):
(WebCore::RenderStyle::isolation const):
(WebCore::RenderStyle::setPosition):
(WebCore::RenderStyle::setFloating):
(WebCore::RenderStyle::setBackgroundSize):
(WebCore::RenderStyle::setBorderLeftStyle):
(WebCore::RenderStyle::setBorderRightStyle):
(WebCore::RenderStyle::setBorderTopStyle):
(WebCore::RenderStyle::setBorderBottomStyle):
(WebCore::RenderStyle::setOutlineStyleIsAuto):
(WebCore::RenderStyle::setOutlineStyle):
(WebCore::RenderStyle::setOverflowX):
(WebCore::RenderStyle::setOverflowY):
(WebCore::RenderStyle::setVerticalAlign):
(WebCore::RenderStyle::setVerticalAlignLength):
(WebCore::RenderStyle::setClear):
(WebCore::RenderStyle::setTableLayout):
(WebCore::RenderStyle::setImageRendering):
(WebCore::RenderStyle::clearBackgroundLayers):
(WebCore::RenderStyle::clearMaskLayers):
(WebCore::RenderStyle::setBorderCollapse):
(WebCore::RenderStyle::setAspectRatioType):
(WebCore::RenderStyle::setPrintColorAdjust):
(WebCore::RenderStyle::setBoxAlign):
(WebCore::RenderStyle::setBoxDirection):
(WebCore::RenderStyle::setBoxLines):
(WebCore::RenderStyle::setBoxOrient):
(WebCore::RenderStyle::setBoxPack):
(WebCore::RenderStyle::setBoxSizing):
(WebCore::RenderStyle::setFlexDirection):
(WebCore::RenderStyle::setFlexWrap):
(WebCore::RenderStyle::setBoxDecorationBreak):
(WebCore::RenderStyle::setUserModify):
(WebCore::RenderStyle::setUserDrag):
(WebCore::RenderStyle::setUserSelect):
(WebCore::RenderStyle::setTextOverflow):
(WebCore::RenderStyle::setMarginBeforeCollapse):
(WebCore::RenderStyle::setMarginAfterCollapse):
(WebCore::RenderStyle::setWordBreak):
(WebCore::RenderStyle::setOverflowWrap):
(WebCore::RenderStyle::setNBSPMode):
(WebCore::RenderStyle::setLineBreak):
(WebCore::RenderStyle::setResize):
(WebCore::RenderStyle::setColumnFill):
(WebCore::RenderStyle::setColumnRuleStyle):
(WebCore::RenderStyle::setColumnSpan):
(WebCore::RenderStyle::setTextCombine):
(WebCore::RenderStyle::setObjectFit):
(WebCore::RenderStyle::setTransformStyle3D):
(WebCore::RenderStyle::setBackfaceVisibility):
(WebCore::RenderStyle::setTextSecurity):
(WebCore::RenderStyle::initialOverflowX):
(WebCore::RenderStyle::initialOverflowY):
(WebCore::RenderStyle::initialClear):
(WebCore::RenderStyle::initialPosition):
(WebCore::RenderStyle::initialVerticalAlign):
(WebCore::RenderStyle::initialFloating):
(WebCore::RenderStyle::initialTableLayout):
(WebCore::RenderStyle::initialBorderCollapse):
(WebCore::RenderStyle::initialBorderStyle):
(WebCore::RenderStyle::initialOutlineStyleIsAuto):
(WebCore::RenderStyle::initialTextCombine):
(WebCore::RenderStyle::initialObjectFit):
(WebCore::RenderStyle::initialBoxAlign):
(WebCore::RenderStyle::initialBoxDecorationBreak):
(WebCore::RenderStyle::initialBoxDirection):
(WebCore::RenderStyle::initialBoxLines):
(WebCore::RenderStyle::initialBoxOrient):
(WebCore::RenderStyle::initialBoxPack):
(WebCore::RenderStyle::initialBoxSizing):
(WebCore::RenderStyle::initialJustifyItems):
(WebCore::RenderStyle::initialSelfAlignment):
(WebCore::RenderStyle::initialDefaultAlignment):
(WebCore::RenderStyle::initialContentAlignment):
(WebCore::RenderStyle::initialFlexDirection):
(WebCore::RenderStyle::initialFlexWrap):
(WebCore::RenderStyle::initialUserModify):
(WebCore::RenderStyle::initialUserDrag):
(WebCore::RenderStyle::initialUserSelect):
(WebCore::RenderStyle::initialTextOverflow):
(WebCore::RenderStyle::initialMarginBeforeCollapse):
(WebCore::RenderStyle::initialMarginAfterCollapse):
(WebCore::RenderStyle::initialWordBreak):
(WebCore::RenderStyle::initialOverflowWrap):
(WebCore::RenderStyle::initialNBSPMode):
(WebCore::RenderStyle::initialLineBreak):
(WebCore::RenderStyle::initialResize):
(WebCore::RenderStyle::initialAspectRatioType):
(WebCore::RenderStyle::initialColumnFill):
(WebCore::RenderStyle::initialColumnSpan):
(WebCore::RenderStyle::initialTransformStyle3D):
(WebCore::RenderStyle::initialBackfaceVisibility):
(WebCore::RenderStyle::initialImageRendering):
(WebCore::RenderStyle::initialPrintColorAdjust):
(WebCore::RenderStyle::initialTextIndentLine):
(WebCore::RenderStyle::initialTextIndentType):
(WebCore::RenderStyle::initialTextSecurity):
(WebCore::RenderStyle::initialIsolation):
(WebCore::collapsedBorderStyle):
(WebCore::RenderStyle::breakOnlyAfterWhiteSpace const):
(WebCore::RenderStyle::breakWords const):
(WebCore::RenderStyle::setTextOrientation):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
(WebCore::operator|):
(WebCore::operator|=):
(WebCore::operator| ): Deleted.
(WebCore::operator|= ): Deleted.
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff const):
* rendering/style/StyleBackgroundData.cpp:
(WebCore::StyleBackgroundData::StyleBackgroundData):
* rendering/style/StyleBoxData.cpp:
(WebCore::StyleBoxData::StyleBoxData):
* rendering/style/StyleBoxData.h:
(WebCore::StyleBoxData::boxSizing const):
(WebCore::StyleBoxData::boxDecorationBreak const):
* rendering/style/StyleContentAlignmentData.h:
(WebCore::StyleContentAlignmentData::StyleContentAlignmentData):
(WebCore::StyleContentAlignmentData::setPosition):
(WebCore::StyleContentAlignmentData::setDistribution):
(WebCore::StyleContentAlignmentData::setOverflow):
(WebCore::StyleContentAlignmentData::distribution const):
* rendering/style/StyleDeprecatedFlexibleBoxData.cpp:
(WebCore::StyleDeprecatedFlexibleBoxData::StyleDeprecatedFlexibleBoxData):
* rendering/style/StyleDeprecatedFlexibleBoxData.h:
* rendering/style/StyleFlexibleBoxData.cpp:
(WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData):
* rendering/style/StyleFlexibleBoxData.h:
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
* rendering/style/StyleMultiColData.h:
(WebCore::StyleMultiColData::ruleWidth const):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/style/StyleSelfAlignmentData.h:
(WebCore::StyleSelfAlignmentData::StyleSelfAlignmentData):
(WebCore::StyleSelfAlignmentData::setPosition):
(WebCore::StyleSelfAlignmentData::setPositionType):
(WebCore::StyleSelfAlignmentData::setOverflow):
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::styleDidChange):
* rendering/svg/RenderSVGGradientStop.cpp:
(WebCore::RenderSVGGradientStop::styleDidChange):
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::styleDidChange):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::styleDidChange):
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::styleDidChange):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::registerResource):
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
(WebCore::RenderSVGResourceFilterPrimitive::styleDidChange):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::shouldApplyViewportClip const):
(WebCore::RenderSVGRoot::styleDidChange):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintText):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::isOverflowHidden):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::attachToRenderElementInternal):
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::styleForFirstLetter):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::isValidColumnSpanner):
(WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
(WebCore::RenderTreeBuilder::MultiColumn::multiColumnRelativeWillBeRemoved):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2018-05-21 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Stream::decodebinSinkPad is read but never assigned
https://bugs.webkit.org/show_bug.cgi?id=185724
Reviewed by Xabier Rodriguez-Calvar.
This is a dead code removal patch; except when a Stream instance
happens to be instantiated in such a place that the non-initialized
decodeSinkPad is != 0, then it is a crash bug fix.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcLinkStreamToSrcPad):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
2018-05-21 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Force segment.start = 0 after matroskademux
https://bugs.webkit.org/show_bug.cgi?id=185740
Reviewed by Xabier Rodriguez-Calvar.
This patch ensures that when WebM MSE media segments are appended in
an out of order fashion their frames are not discarded by opusparse or
any other potential elements downstream in the AppendPipeline that
perform segment clipping.
This patch fixes the following YTTV 2018 tests:
38. OpusAudioWithOverlap
39. OpusAudioWithSmallGap
40. OpusAudioWithLargeGap
70. VP9VideoWithOverlap
71. VP9VideoWithSmallGap
This patch is necessary, but not sufficient for fixing the following
YTTV 2018 tests:
36. AppendOpusAudioOutOfOrder
67. AppendVP9VideoOutOfOrder
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::matroskademuxForceSegmentStartToEqualZero):
2018-05-19 Eric Carlson <eric.carlson@apple.com>
Improve NowPlaying "title"
https://bugs.webkit.org/show_bug.cgi?id=185680
<rdar://problem/40296700>
Reviewed by Dean Jackson.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const): Use decodeHostName and
topPrivatelyControlledDomain when possible to make the host name more readable.
* platform/PublicSuffix.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::decodeHostName): Expose topPrivatelyControlledDomain method to .cpp functions.
2018-05-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231996.
https://bugs.webkit.org/show_bug.cgi?id=185799
Broke the GTK build (Requested by eric_carlson on #webkit).
Reverted changeset:
"Improve NowPlaying "title""
https://bugs.webkit.org/show_bug.cgi?id=185680
https://trac.webkit.org/changeset/231996
2018-05-18 Eric Carlson <eric.carlson@apple.com>
Improve NowPlaying "title"
https://bugs.webkit.org/show_bug.cgi?id=185680
<rdar://problem/40296700>
Reviewed by Dean Jackson.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const): Use decodeHostName and
topPrivatelyControlledDomain when possible to make the host name more readable.
* platform/PublicSuffix.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::decodeHostName): Expose topPrivatelyControlledDomain method to .cpp functions.
2018-05-18 Rob Buis <rbuis@igalia.com>
Cannot unset transition with important
https://bugs.webkit.org/show_bug.cgi?id=177684
Reviewed by Chris Dumez.
Make removeProperty remove the property regardless
if it was set using !important [1].
The new behavior is consistent with Firefox, Chrome and Edge.
[1] https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty
Test: web-platform-tests/cssom/cssom-setProperty-shorthand.html
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::removePropertiesInSet):
2018-05-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231982.
https://bugs.webkit.org/show_bug.cgi?id=185793
Caused layout test failures (Requested by realdawei on
#webkit).
Reverted changeset:
"Complete fix for enabling modern EME by default"
https://bugs.webkit.org/show_bug.cgi?id=185770
https://trac.webkit.org/changeset/231982
2018-05-18 Jer Noble <jer.noble@apple.com>
Complete fix for enabling modern EME by default
https://bugs.webkit.org/show_bug.cgi?id=185770
<rdar://problem/40368220>
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig:
2018-05-18 Brent Fulgham <bfulgham@apple.com>
Convert ProcessPrivilege assertions to regular debug-only assertions
https://bugs.webkit.org/show_bug.cgi?id=185775
<rdar://problem/40372286>
Reviewed by Geoffrey Garen.
In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
UI-only calls were not being made in the WebContent process.
Measurements have shown that these RELEASE_ASSERTs have regressed performance
by around 1% on some benchmarks, so we should convert them to normal asserts.
This patch changes the RELEASE_ASSERTs into ASSERTs.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID):
(WebCore::firstScreen):
(WebCore::window):
(WebCore::screen):
(WebCore::getScreenProperties):
(WebCore::screenIsMonochrome):
2018-05-18 Eric Carlson <eric.carlson@apple.com>
Handle failure to extend sandbox gracefully
https://bugs.webkit.org/show_bug.cgi?id=185779
<rdar://problem/40316349>
Reviewed by Brent Fulgham.
Test: TestWebKitAPI/Tests/WebKitCocoa/UserMediaSimulateFailedSandbox.mm
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::deny): Include the error string in the promise rejection.
* Modules/mediastream/UserMediaRequest.h:
2018-05-18 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations with CSS integration on for test runners
https://bugs.webkit.org/show_bug.cgi?id=184819
<rdar://problem/39597337>
Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests.
Tests: animations/animation-internals-api-multiple-keyframes.html
animations/animation-internals-api.html
transitions/transition-drt-api-delay.html
transitions/transition-drt-api.html
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* page/RuntimeEnabledFeatures.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-05-18 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Bug fix on suspend/resume behavior.
https://bugs.webkit.org/show_bug.cgi?id=183089
The flag was not set correctly. Also wrong method was called.
Reviewed by Youenn Fablet.
Enable loader tests to cover this case.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::cancel): Remove unnecessary cleanup. Use runXXX method.
(WebCore::CurlRequest::suspend): Added cancel check.
(WebCore::CurlRequest::resume): Ditto.
(WebCore::CurlRequest::callClient): Use runXXX method. Change to move semantics.
(WebCore::runOnMainThread): Added.
(WebCore::CurlRequest::runOnWorkerThreadIfRequired): Added.
(WebCore::CurlRequest::setupTransfer): Bug fix. Call setRequestPaused directly.
(WebCore::CurlRequest::didReceiveData): Add state flag update.
(WebCore::CurlRequest::invokeDidReceiveResponseForFile): Use runXXX to simplify.
(WebCore::CurlRequest::completeDidReceiveResponse): Ditto.
(WebCore::CurlRequest::setRequestPaused): Protect state change by mutex.
(WebCore::CurlRequest::setCallbackPaused): Ditto.
(WebCore::CurlRequest::invokeCancel): Added.
(WebCore::CurlRequest::pausedStatusChanged): Use runXXX to simplify.
(WebCore::CurlRequest::updateHandlePauseState): Accessor for m_isHandlePaused.
(WebCore::CurlRequest::isHandlePaused const): Ditto.
* platform/network/curl/CurlRequest.h: Add mutex and paused state.
(WebCore::CurlRequest::shouldBePaused const): Rename from isPaused.
(WebCore::CurlRequest::isPaused const): Deleted.
2018-05-18 Chris Dumez <cdumez@apple.com>
Avoid keeping the frame alive when ref'ing a WindowProxy
https://bugs.webkit.org/show_bug.cgi?id=185737
<rdar://problem/40004666>
Reviewed by Sam Weinig.
Avoid keeping the frame alive when ref'ing a WindowProxy by making WindowProxy
manage its own refcount (instead of proxying refcounting to the Frame). As a
result, a WindowProxy can now be detached from its Frame. When detached, it
return null when asked for a JSWindowProxy.
It is important to not extend the lifetime of the Frame because we want script
to stop running when the Page gets destroyed.
* bindings/js/JSWindowProxy.cpp:
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/JSWindowProxy.h:
(WebCore::toJSWindowProxy):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::jsWindowProxy):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::globalObject):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::windowScriptObject):
* bindings/js/ScriptState.cpp:
(WebCore::mainWorldExecState):
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::WindowProxy):
(WebCore::WindowProxy::~WindowProxy):
(WebCore::WindowProxy::detachFromFrame):
(WebCore::WindowProxy::createJSWindowProxy):
(WebCore::WindowProxy::globalObject):
(WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
(WebCore::WindowProxy::setDOMWindow):
(WebCore::WindowProxy::window const):
(WebCore::WindowProxy::ref): Deleted.
(WebCore::WindowProxy::deref): Deleted.
* bindings/js/WindowProxy.h:
(WebCore::WindowProxy::create):
(WebCore::WindowProxy::frame const):
(WebCore::WindowProxy::jsWindowProxy):
* dom/DocumentTouch.cpp:
(WebCore::DocumentTouch::createTouch):
* page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
(WebCore::AbstractFrame::~AbstractFrame):
* page/AbstractFrame.h:
2018-05-18 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Password fields obscure the text with rectangles instead of circles
https://bugs.webkit.org/show_bug.cgi?id=185760
<rdar://problem/38644697>
Reviewed by Zalan Bujtas.
Password fields are obscured by drawing U+25CF BLACK CIRCLE. On iOS, we have custom handling
for this character. However, this custom handling is unnecessary and isn't present on macOS.
Instead, we should simply unify the password obscuring codepath between iOS and macOS.
Test: fast/text/black-circle.html
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::requiresCustomFallbackFont):
(WebCore::FontCache::getCustomFallbackFont):
2018-05-18 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r231935.
Caused an accessibility test to fail
Reverted changeset:
"RenderLayer::scrollRectToVisible() should not propagate a
subframe's scroll to its cross-origin parent"
https://bugs.webkit.org/show_bug.cgi?id=185664
https://trac.webkit.org/changeset/231935
2018-05-18 Zalan Bujtas <zalan@apple.com>
[LFC] Implement height computation for non-replaced floating elements.
https://bugs.webkit.org/show_bug.cgi?id=185767
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
(WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const):
(WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const):
* layout/FormattingContext.h:
2018-05-18 Dirk Schulze <krit@webkit.org>
Make all SVG shape interfaces inherit from SVGGeometryElement
https://bugs.webkit.org/show_bug.cgi?id=185600
Reviewed by Antti Koivisto.
Make all SVG shape interfaces inherit from SVGGeometryElement
as defined by SVG2:
https://svgwg.org/svg2-draft/shapes.html#DOMInterfaces
Tests: svg/dom/SVGGeometry-circle.xhtml
svg/dom/SVGGeometry-ellipse.xhtml
svg/dom/SVGGeometry-line.xhtml
svg/dom/SVGGeometry-polygon.xhtml
svg/dom/SVGGeometry-polyline.xhtml
svg/dom/SVGGeometry-rect.xhtml
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::getTotalLength const): Added shape
independent implementation for all methods defined
by SVGGeometryElement interface. Calculations are
based on the Path object created and referenced by
RenderSVGShape.
(WebCore::RenderSVGShape::getPointAtLength const):
* rendering/svg/RenderSVGShape.h:
* svg/SVGCircleElement.cpp:
Repeating pattern: Change inheritance from
SVGGraphicsElement to SVGGeometryElement.
(WebCore::SVGCircleElement::SVGCircleElement):
* svg/SVGCircleElement.h:
* svg/SVGCircleElement.idl:
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::SVGEllipseElement):
* svg/SVGEllipseElement.h:
* svg/SVGEllipseElement.idl:
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::getTotalLength const):
(WebCore::SVGGeometryElement::getPointAtLength const):
* svg/SVGGeometryElement.h:
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::SVGLineElement):
* svg/SVGLineElement.h:
* svg/SVGLineElement.idl:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::SVGPolyElement):
* svg/SVGPolyElement.h:
* svg/SVGPolygonElement.idl:
* svg/SVGPolylineElement.idl:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::SVGRectElement):
* svg/SVGRectElement.h:
* svg/SVGRectElement.idl:
2018-05-18 Zalan Bujtas <zalan@apple.com>
[LFC] Implement height computation for replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=185756
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
(WebCore::Layout::FormattingContext::computeReplacedHeight const):
(WebCore::Layout::FormattingContext::computeReplacedWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const):
* layout/FormattingContext.h:
2018-05-18 Zalan Bujtas <zalan@apple.com>
[LFC] Implement width computation for non-replaced floating elements.
https://bugs.webkit.org/show_bug.cgi?id=185759
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const):
* layout/FormattingContext.h:
2018-05-18 Antoine Quint <graouts@apple.com>
[modern-media-controls] AirPlaySupport should be disabled by default
https://bugs.webkit.org/show_bug.cgi?id=185658
<rdar://problem/40272213>
Reviewed by Simon Fraser.
We now only enable AirplaySupport if the controls are visible to the user _and_ media has played.
Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-until-play.html
* Modules/modern-media-controls/media/airplay-support.js:
(AirplaySupport.prototype.enable):
(AirplaySupport.prototype.controlsUserVisibilityDidChange):
(AirplaySupport.prototype._shouldBeEnabled):
(AirplaySupport):
2018-05-18 Tim Horton <timothy_horton@apple.com>
Stop softlinking QuickLook when loading from client-registered schemes
https://bugs.webkit.org/show_bug.cgi?id=185716
<rdar://problem/40303227>
Reviewed by Dan Bernstein.
No new tests, just a performance improvement.
* dom/Document.cpp:
* platform/SchemeRegistry.cpp:
* platform/ios/QuickLook.h:
* platform/ios/QuickLook.mm:
(WebCore::isQuickLookPreviewURL):
(WebCore::QLPreviewProtocol): Deleted.
Hard-code the QuickLook preview URL scheme, instead of loading the QuickLook
framework to retrieve it. It will never change, and just in case it does,
add an ASSERT (which does load QuickLook) so that we'll find out.
2018-05-18 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations with CSS integration on for test runners
https://bugs.webkit.org/show_bug.cgi?id=184819
<rdar://problem/39597337>
Reviewed by Jon Lee.
We ensure we always call into both CSSAnimationController::cancelAnimations() and
AnimationTimeline::cancelDeclarativeAnimationsForElement() since we want teardown of animations
to be performed no matter which animation code path is used. What that in mind, we don't
conditionalize the CSSAnimationController-related ASSERT() in FrameView::didDestroyRenderTree().
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* page/RuntimeEnabledFeatures.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-05-17 David Kilzer <ddkilzer@apple.com>
Lazily create WebCore::Timer for WebCore::Image
<https://webkit.org/b/185752>
Reviewed by Simon Fraser.
Not every image is an animated image, so lazily creating
m_animationStartTimer saves 64 bytes per instance of
WebCore::Image.
* platform/graphics/Image.cpp:
(WebCore::Image::Image): Remove default initializer for
m_animationStartTimer.
(WebCore::Image::startAnimationAsynchronously): Initialize
m_animationStartTimer if it's not already created.
* platform/graphics/Image.h:
(WebCore::Image::animationPending const): Update to check if
m_animationStartTimer has been set before dereferencing it.
(WebCore::Image::m_animationStartTimer): Change type to
std::unique_ptr<Timer>.
2018-05-17 Nan Wang <n_wang@apple.com>
AX: [macOS] Expose the primary screen height through AX API
https://bugs.webkit.org/show_bug.cgi?id=185742
Reviewed by Chris Fleizach.
Added a new attribute to expose the primary screen size on both
WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
Test: accessibility/mac/primary-screen-height.html
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper primaryScreenHeight]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenRectForPrimaryScreen):
2018-05-17 Chris Dumez <cdumez@apple.com>
RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
https://bugs.webkit.org/show_bug.cgi?id=185664
<rdar://problem/36185260>
Reviewed by Simon Fraser.
RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
ancestor frame when scrollRectToVisible() is called synchronously. However,
scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
of the post layout tasks.
To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
and this is a lot more robust than relying on a flag which gets temporarily set.
Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
* dom/Document.cpp:
* dom/Document.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::safeToPropagateScrollToParent const):
* page/FrameView.h:
2018-05-17 Don Olmstead <don.olmstead@sony.com>
[Curl] Enable HTTP/2 Multiplexing
https://bugs.webkit.org/show_bug.cgi?id=185746
Reviewed by Youenn Fablet.
Covered by existing tests.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlMultiHandle::CurlMultiHandle):
2018-05-17 Jeremy Jones <jeremyj@apple.com>
Remove unnecessary exit fullscreen call on application resume
https://bugs.webkit.org/show_bug.cgi?id=185747
rdar://problem/40345725
Reviewed by Jer Noble.
No new tests because no behavior change.
Auto-PiP doesn't automatically return to fullscreen on app resume,
so we don't need to keep this vestigial code for handling a corner case of that feature.
Also, this can cause an unnecessary exit fullscreen that could cause debug asserts.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
2018-05-17 Jeremy Jones <jeremyj@apple.com>
Fullscreen to PiP results in exit fullscreen call failure
https://bugs.webkit.org/show_bug.cgi?id=185699
rdar://problem/40310291
Reviewed by Eric Carlson.
No new tests because no behavior change.
Prevent multiple exit fullscreen calls when transitioning from fullscreen to picture-in-picture.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:]):
Implement this to prevent AVKit from automatically initiating exit fullscreen on pip.
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
Set the return to fullscreen flag here, since this is where exit fullscreen happens.
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
Don't exit fullscreen here since it is already initiated in didStartPictureInPicture.
2018-05-17 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r231899.
Caused flakiness in two existing modern-media-controls tests.
Reverted changeset:
"[modern-media-controls] AirPlaySupport should be disabled by
default"
https://bugs.webkit.org/show_bug.cgi?id=185658
https://trac.webkit.org/changeset/231899
2018-05-17 Eric Carlson <eric.carlson@apple.com>
[iOS] Update AirPlay route monitoring
https://bugs.webkit.org/show_bug.cgi?id=185706
<rdar://problem/40230677>
Unreviewed, fix extra zoom mode build after r231913.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper dealloc]):
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
2018-05-17 Jer Noble <jer.noble@apple.com>
CRASH in ImageDecoderAVFObjC::sampleAtIndex()
https://bugs.webkit.org/show_bug.cgi?id=185734
<rdar://problem/40295094>
Reviewed by Eric Carlson.
Test: fast/images/animated-image-mp4-crash.html
Test the correct size value before iterating over the SampleMap in presentationOrder()
* Modules/mediasource/SampleMap.h:
(WebCore::PresentationOrderSampleMap::size const):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
2018-05-17 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Disabled adaptations are not reset upon mainframe navigation
https://bugs.webkit.org/show_bug.cgi?id=185735
<rdar://problem/40335311>
Reviewed by Tim Horton.
When performing mainframe navigation, we currently don't update the Page's ViewportConfiguration's disabled
adaptations. This causes disabled adaptations from the previous main document to persist. To fix this, propagate
the new document's disabled adaptations to the client when it becomes the main document in the page.
Test: fast/viewport/extrazoom/viewport-adaptations-after-navigation.html
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::processDisabledAdaptations):
(WebCore::Document::dispatchDisabledAdaptationsDidChangeForMainFrame):
* dom/Document.h:
2018-05-17 Eric Carlson <eric.carlson@apple.com>
[iOS] Update AirPlay route monitoring
https://bugs.webkit.org/show_bug.cgi?id=185706
<rdar://problem/40230677>
Reviewed by Jer Noble.
Use an AVRouteDetector instead of an MPVolumeView and an MPAVRoutingController for AirPlay
route detection and availability monitoring.
No new tests, tested manually.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::hasWirelessPlaybackTargets): No need to update m_hasPlaybackTargets
manually, it is always updated by the session manager when route availability changes.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper dealloc]): Pull the logic from safelyTearDown inline.
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Use the AVRouteDetector.
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Ditto. Simplify logic, there is no
need to dispatch twice.
(-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Don't release the route detector
completely, just disable route detection, because AVRouteDetector is a lightweight object so
it is not worth the overhead of dealloc/realloc to disable/enable route detection.
(-[WebMediaSessionHelper interruption:]): Use callOnWebThreadOrDispatchAsyncOnMainThread
instead of WebThreadRun so it works correctly in WK2 as well as in WK1.
(-[WebMediaSessionHelper applicationWillEnterForeground:]): Ditto.
(-[WebMediaSessionHelper applicationDidBecomeActive:]): Ditto.
(-[WebMediaSessionHelper applicationWillResignActive:]): Ditto.
(-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Ditto.
(-[WebMediaSessionHelper applicationDidEnterBackground:]): Ditto.
(safelyTearDown): Deleted.
2018-05-17 Chris Dumez <cdumez@apple.com>
Cross-Origin-Options: deny/allow-postmessage should prevent getting navigated by cross-origin scripts
https://bugs.webkit.org/show_bug.cgi?id=185681
<rdar://problem/40296313>
Reviewed by Geoffrey Garen.
Update our canNavigate() implementation [1] to take into account the Cross-Origin-Options header.
If the window being navigated or the window trigerring the navigation have a Cross-Origin-Options
header value different than 'allow', then the attempt to navigate will be blocked.
Note that it was already not possible to navigate via setting window.location since trying to set
it would throw a SecurityError with 'Cross-Origin-Options: deny/allow-postmessage'. However, it was
possible to trigger a "targeted" navigation via <a target="foo"> or open(url, "foo").
[1] https://html.spec.whatwg.org/#allowed-to-navigate
Tests: http/wpt/cross-origin-options/navigation-from-opener-via-open-target.html
http/wpt/cross-origin-options/navigation-from-subframe-via-anchor-target.html
* dom/Document.cpp:
(WebCore::Document::canNavigate):
2018-05-17 Brent Fulgham <bfulgham@apple.com>
Storage Access API: Allow documents that have been granted storage access to also do a popup
https://bugs.webkit.org/show_bug.cgi?id=185615
<rdar://problem/39105791>
Reviewed by Chris Dumez.
* dom/Document.cpp:
(WebCore::Document::consumeTemporaryUserGesture): Added. Clear the document's active one-time user
activity (for window opening) state.
(WebCore::Document::enableTemporaryUserGesture): Added. Establish a new active one-time user
activity (for window opening) state.
(WebCore::Document::requestStorageAccess): If the user approves Storage Access, establish a new
UserInteraction scope, then resolve the promise. Also post a task to clear the one-time user
gesture state.
2018-05-17 Zalan Bujtas <zalan@apple.com>
[LFC] Introduce DisplayBox::Style
https://bugs.webkit.org/show_bug.cgi?id=185733
Reviewed by Antti Koivisto.
This is the collection of computed style data needed to paint/hittest the display boxtree.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createDisplayBox):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::Style::Style):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
2018-05-17 Antoine Quint <graouts@apple.com>
[modern-media-controls] AirPlaySupport should be disabled by default
https://bugs.webkit.org/show_bug.cgi?id=185658
<rdar://problem/40272213>
Reviewed by Simon Fraser.
We now only enable AirplaySupport if the controls are visible to the user _and_ media has played.
Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-until-play.html
* Modules/modern-media-controls/media/airplay-support.js:
(AirplaySupport.prototype.enable):
(AirplaySupport.prototype.controlsUserVisibilityDidChange):
(AirplaySupport.prototype._shouldBeEnabled):
(AirplaySupport):
2018-05-17 Zalan Bujtas <zalan@apple.com>
[LFC] Replace ASSERT_NOT_REACHED with ASSERT_NOT_IMPLEMENTED_YET where applicable.
https://bugs.webkit.org/show_bug.cgi?id=185728
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): leftover from previous patch.
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
(WebCore::Layout::FormattingContext::computeReplacedWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::styleChanged):
(WebCore::Layout::LayoutContext::formattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-05-17 Zalan Bujtas <zalan@apple.com>
[LFC] Move replaced logic from Layout::Box to Layout::Replaced class
https://bugs.webkit.org/show_bug.cgi?id=185711
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isReplaced const): Deleted.
(WebCore::Layout::Box::hasIntrinsicWidth const): Deleted.
(WebCore::Layout::Box::hasIntrinsicHeight const): Deleted.
(WebCore::Layout::Box::hasIntrinsicRatio const): Deleted.
(WebCore::Layout::Box::intrinsicWidth const): Deleted.
(WebCore::Layout::Box::intrinsicHeight const): Deleted.
(WebCore::Layout::Box::intrinsicRatio const): Deleted.
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::replaced const):
2018-05-17 Zalan Bujtas <zalan@apple.com>
[LFC] Implement width computation for replaced out if flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185701
Reviewed by Antti Koivisto.
The used value of 'width' is determined as for inline replaced elements.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const):
* layout/FormattingContext.h:
2018-05-17 Thibault Saunier <tsaunier@igalia.com>
[GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned
https://bugs.webkit.org/show_bug.cgi?id=185657
Reviewed by Philippe Normand.
Starting with GStreamer 1.14[1] the reference is sunk at object creation time, making it a normal
GObject in practice, in our GRefPtr template implementation we should just consider GstStream
as if it was a normal GObject and not care about its floating reference state as
the ref is never sunk by anyone before 1.14 though that floating ref is considered
as a hard reference by the GstStreamCollection (leading to assertions/)
The exact same issue happens with GstStreamCollection, so fix it at the same time.
Also do not adoptRef() on the result of gst_stream_collection_get_stream() as this function
is transfer-none.
[1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent`
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef):
(WTF::refGPtr<GstStream>):
(WTF::refGPtr<GstStreamCollection>):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2018-05-16 Devin Rousso <webkit@devinrousso.com>
Web Inspector: create a navigation item for toggling the overlay rulers/guides
https://bugs.webkit.org/show_bug.cgi?id=185644
Reviewed by Matt Baker.
This patch is purely a visual change for WebInspector, and doesn't affect anything else.
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setShowRulers): Added.
* inspector/InspectorOverlay.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::shouldShowOverlay):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::setShowRulers): Added.
(WebCore::InspectorOverlay::drawRulers): Added.
(WebCore::InspectorOverlay::reset):
* inspector/InspectorOverlayPage.js:
(drawNodeHighlight):
(drawQuadHighlight):
(drawRulers): Added.
(_drawBounds): Added.
(reset):
(_drawRulers): Deleted.
2018-05-16 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] SoupNetworkSession.h:68:62: error: unknown type name 'URL'
https://bugs.webkit.org/show_bug.cgi?id=185378
Unreviewed, just replace unneeded #include with a forward declaration
* platform/network/soup/SoupNetworkSession.h:
2018-05-16 Jer Noble <jer.noble@apple.com>
CRASH: Exception thrown from -[AVContentKeySession processContentKeyRequestWithIdentifier:initializationData:options:] after -expire called
https://bugs.webkit.org/show_bug.cgi?id=185690
<rdar://problem/38297768>
Reviewed by Eric Carlson.
Reject all calls to update() after close() has been called on the session.
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
2018-05-16 Andy VanWagoner <andy@vanwagoner.family>
Add support for Intl NumberFormat formatToParts
https://bugs.webkit.org/show_bug.cgi?id=185375
Reviewed by Yusuke Suzuki.
Test: js/intl-numberformat-format-to-parts.html
Add flag & tests for NumberFormat formatToParts.
* Configurations/FeatureDefines.xcconfig:
2018-05-16 Eric Carlson <eric.carlson@apple.com>
Improve NowPlaying "title"
https://bugs.webkit.org/show_bug.cgi?id=185680
<rdar://problem/40296700>
Reviewed by Jer Noble.
We send NowPlaying the element's title attribute if not empty, else the element's current url.
Title should be preferred because it is the most specific, but we should use the document
title if non-empty next, and if falling back to the element's url use just the domain instead
of the full url because it isn't likely to be useful to the user given the small amount of
space control center uses to display the title. Further, don't use any title at all when
in private browsing mode.
Tests: http/tests/media/now-playing-info-private-browsing.html
http/tests/media/now-playing-info.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): Update NowPlaying when the title attribute changes.
(WebCore::HTMLMediaElement::finishSeek): Update NowPlaying when a seek completes.
(WebCore::HTMLMediaElement::mediaSessionTitle const): Update logic.
(WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): Use the hash of the current
url as the unique identifier.
* html/HTMLMediaElement.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::uniqueIdentifier const): New.
(WebCore::PlatformMediaSessionClient::mediaSessionUniqueIdentifier const): Ditto.
* platform/audio/PlatformMediaSession.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Update m_lastUpdatedNowPlayingInfoUniqueIdentifier.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Update.
* testing/Internals.cpp:
(WebCore::Internals::nowPlayingState const): Expose NowPlaying state.
* testing/Internals.h:
* testing/Internals.idl:
2018-05-16 Daniel Bates <dabates@apple.com>
Attempt to fix the WinCairo build following r231859
(https://bugs.webkit.org/show_bug.cgi?id=185654)
Instantiate Cookie as a struct and set applicable fields.
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies):
2018-05-16 Daniel Bates <dabates@apple.com>
Cleanup platform Cookie
https://bugs.webkit.org/show_bug.cgi?id=185654
Reviewed by Per Arne Vollan.
Remove unnecessary constructor and use =default for default constructor.
Simplify Cookie::decode() by having it decode directly into a stack-allocated
cookie. Remove some unnecessary local variables. Fix style nits.
* platform/Cookie.h:
(WebCore::Cookie::Cookie):
(WebCore::Cookie::isNull const):
(WebCore::Cookie::encode const):
(WebCore::Cookie::decode):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::getRawCookies):
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::cookieCreated):
(WebCore::Cookie::Cookie):
(WebCore::Cookie::operator== const):
(WebCore::Cookie::hash const):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::getRawCookies):
2018-05-14 Yusuke Suzuki <utatane.tea@gmail.com>
[Win] Use C++17 in MSVC
https://bugs.webkit.org/show_bug.cgi?id=185232
Reviewed by Alex Christensen.
Workaround for MSVC + /std:c++17.
* Modules/geolocation/Coordinates.h:
(WebCore::Coordinates::isolatedCopy const):
2018-05-16 Chris Nardi <cnardi@chromium.org>
Remove Document#selectedStylesheetSet/preferredStylesheetSet
https://bugs.webkit.org/show_bug.cgi?id=185381
Reviewed by Darin Adler.
Document#selectedStylesheetSet/preferredStylesheetSet are non-standard methods that
are only implemented WebKit. Blink removed these methods in https://crbug.com/690609.
The standard versions of these methods are are no longer in the spec. Remove them
entirely from our implementation.
Updated existing tests and imported/w3c/web-platform-tests/cssom/historical.html.
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* dom/Document.h:
* dom/Document.idl:
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* style/StyleScope.h:
(WebCore::Style::Scope::preferredStylesheetSetName const):
2018-05-16 Zalan Bujtas <zalan@apple.com>
[LFC] Implement width computation for replaced inflow elements.
https://bugs.webkit.org/show_bug.cgi?id=185672
Reviewed by Antti Koivisto.
Replaced width for block, inline and float elements compute the same way.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::hasIntrinsicWidth const):
(WebCore::Layout::Box::hasIntrinsicHeight const):
(WebCore::Layout::Box::hasIntrinsicRatio const):
(WebCore::Layout::Box::intrinsicWidth const):
(WebCore::Layout::Box::intrinsicHeight const):
(WebCore::Layout::Box::intrinsicRatio const):
* layout/layouttree/LayoutBox.h:
2018-05-16 Zalan Bujtas <zalan@apple.com>
[LFC] Make Display::Box box sizing aware
https://bugs.webkit.org/show_bug.cgi?id=185649
Reviewed by Antti Koivisto.
Display::Box::width() == Display::Box::contentBox().width() <= box-sizing: content-box; (initial and default value)
Display::Box::width() == Display::Box::borderBox().width() <= box-sizing: border-box;
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createDisplayBox):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
2018-05-16 Antoine Quint <graouts@apple.com>
REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
https://bugs.webkit.org/show_bug.cgi?id=185299
<rdar://problem/39630230>
Reviewed by Simon Fraser.
In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
newly-uncommitted animation.
Test: transitions/interrupted-transition-hardware.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2018-05-15 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
https://bugs.webkit.org/show_bug.cgi?id=185601
Reviewed by Saam Barati.
No behavior change.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
* bindings/js/JSDOMConstructorBase.h:
* bindings/js/JSDOMConvertCallbacks.h:
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenSettled):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::tee):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateOverloadDispatcher):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bridge/objc/objc_runtime.h:
* bridge/runtime_method.h:
* bridge/runtime_object.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::cloneArrayBuffer):
2018-05-15 Matt Baker <mattbaker@apple.com>
Web Inspector: element details hanger in inspector overlay should have better placement logic
https://bugs.webkit.org/show_bug.cgi?id=128482
<rdar://problem/16020709>
Reviewed by Timothy Hatcher.
When determining the best position for the hovered element details "tooltip",
perform placement tests in view space, not canvas space, and account for the
top content inset.
* inspector/InspectorOverlayPage.js:
(reset): Drive by fix: added missing `.height`.
(_drawElementTitle):
2018-05-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231765.
https://bugs.webkit.org/show_bug.cgi?id=185668
the layout test added with this change is very flaky
(Requested by realdawei on #webkit).
Reverted changeset:
"REGRESSION (r230574): Interrupted hardware transitions don't
behave correctly"
https://bugs.webkit.org/show_bug.cgi?id=185299
https://trac.webkit.org/changeset/231765
2018-05-15 Devin Rousso <webkit@devinrousso.com>
Web Inspector: Add rulers and guides
https://bugs.webkit.org/show_bug.cgi?id=32263
<rdar://problem/19281564>
Reviewed by Matt Baker.
This patch is purely a visual change for WebInspector, and doesn't affect anything else.
* inspector/InspectorOverlay.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::reset):
(WebCore::InspectorOverlay::drawGutter): Deleted.
* inspector/InspectorOverlayPage.html:
* inspector/InspectorOverlayPage.js:
(Bounds): Added.
(Bounds.prototype.get minX): Added.
(Bounds.prototype.get minY): Added.
(Bounds.prototype.get maxX): Added.
(Bounds.prototype.get maxY): Added.
(Bounds.prototype.update): Added.
(drawNodeHighlight):
(drawQuadHighlight):
(reset):
(_isolateActions): Added.
(_quadToPath): Added.
(_quadToPath.parseQuadPoint): Added.
(_drawOutlinedQuad): Added.
(_drawPath): Added.
(_drawPath.parsePoints): Added.
(_drawOutlinedQuadWithClip): Added.
(_drawElementTitle):
(_drawShapeHighlight):
(_drawFragmentHighlight):
(_drawRulers): Added.
(quadToPath): Deleted.
(drawOutlinedQuad): Deleted.
(pathCommand): Deleted.
(drawPath): Deleted.
(drawOutlinedQuadWithClip): Deleted.
(drawGutter): Deleted.
* inspector/InspectorOverlayPage.css:
(#log): Added.
(#right-gutter): Deleted.
(#bottom-gutter): Deleted.
2018-05-15 Jer Noble <jer.noble@apple.com>
Media continues loading after rendered invisible (removed from DOM; scrolled off screen)
https://bugs.webkit.org/show_bug.cgi?id=185487
Reviewed by Eric Carlson.
Test: media/video-buffering-allowed.html
When a media element is removed from the dom (e.g. through innerHTML=""), it doesn't
necessarily stop loading media data; it will continue to do so until its destructor is
called through garbage collection. Similarly, when a media element is rendered not-visible
by being scrolled off-screen or being made display:none, media loading continues. There
are legitimate use cases for out-of-DOM media loading, so only temporarily block loading
when the element transitions out of the document. Similarly, only block loading for non-visible
media elements when returning from the "page is hidden" state, and only until the media
element is asked to play or is otherwise made visible.
Note: this refactors a lot of code out of PlatformMediaSession and into MediaElementSession,
since this code is specific to "media elements".
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::insertedIntoAncestor):
(WebCore::HTMLMediaElement::removedFromAncestor):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::visibilityStateChanged):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::setShouldBufferData):
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
(WebCore::HTMLMediaElement::isVisibleInViewportChanged):
(WebCore::HTMLMediaElement::fullscreenModeChanged):
(WebCore::HTMLMediaElement::setInActiveDocument):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::shouldBufferData const):
(WebCore::HTMLMediaElement::elementIsHidden const):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::clientWillBeginAutoplaying):
(WebCore::MediaElementSession::clientWillBeginPlayback):
(WebCore::MediaElementSession::clientWillPausePlayback):
(WebCore::MediaElementSession::visibilityChanged):
(WebCore::MediaElementSession::isVisibleInViewportChanged):
(WebCore::MediaElementSession::inActiveDocumentChanged):
(WebCore::MediaElementSession::scheduleClientDataBufferingCheck):
(WebCore::MediaElementSession::clientDataBufferingTimerFired):
(WebCore::MediaElementSession::updateClientDataBuffering):
(WebCore::MediaElementSession::dataBufferingPermitted const):
(WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay const):
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::PlatformMediaSession):
(WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
(WebCore::PlatformMediaSession::clientWillPausePlayback):
(): Deleted.
(WebCore::PlatformMediaSession::visibilityChanged): Deleted.
(WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck): Deleted.
(WebCore::PlatformMediaSession::clientDataBufferingTimerFired): Deleted.
(WebCore::PlatformMediaSession::updateClientDataBuffering): Deleted.
(WebCore::PlatformMediaSession::isHidden const): Deleted.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSessionClient::setShouldBufferData): Deleted.
(WebCore::PlatformMediaSessionClient::elementIsHidden const): Deleted.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionCanLoadMedia const): Deleted.
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::sessionCanLoadMedia const): Deleted.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
* testing/Internals.cpp:
(WebCore::Internals::elementShouldBufferData):
* testing/Internals.h:
* testing/Internals.idl:
2018-05-15 Charles Vazac <cvazac@gmail.com>
Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to JavaScript running in the browser.
https://bugs.webkit.org/show_bug.cgi?id=175569
Reviewed by Youenn Fablet.
Tests were imported from web-platform-tests: WebKit/LayoutTests/imported/w3c/web-platform-tests/server-timing/*
* Sources.txt: Added references to HeaderFieldTokenizer.cpp, ServerTiming.cpp, and ServerTimingParser.cpp.
* WebCore.xcodeproj/project.pbxproj: Added various files.
* loader/HeaderFieldTokenizer.cpp: Added.
(WebCore::HeaderFieldTokenizer::HeaderFieldTokenizer): Added class for tokenizing header values.
(WebCore::HeaderFieldTokenizer::consume): Added method to consume a specified character.
(WebCore::HeaderFieldTokenizer::consumeQuotedString): Added method to consume a quote-string.
(WebCore::HeaderFieldTokenizer::consumeToken): Added a method to consume a token.
(WebCore::HeaderFieldTokenizer::consumeTokenOrQuotedString): Added method to consume a quote-string or quote-string, depending on net character.
(WebCore::HeaderFieldTokenizer::skipSpaces): Added method to skip whitespace.
(WebCore::HeaderFieldTokenizer::consumeBeforeAnyCharMatch): Added method to advance the cursor up until any of a list of characters.
* loader/HeaderFieldTokenizer.h: Added.
* loader/HTTPHeaderField.cpp: Expose isTokenCharacter and isWhitespace.
* loader/HTTPHeaderField.h: Expose isTokenCharacter and isWhitespace.
* loader/PolicyChecker.cpp: Added #include so source compiled on my machine.
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming): Added call to initServerTiming to parse the header.
(WebCore::ResourceTiming::initServerTiming): Added method to parse the header.
(WebCore::ResourceTiming::populateServerTiming): Added method to populate the server timing entries on a PerformanceResourceTiming object.
(WebCore::ResourceTiming::isolatedCopy const): Added code to copy over the server timing entries.
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::ResourceTiming): Accept collection of server timing entries in c'tor.
* loader/ServerTiming.cpp: Added.
(WebCore::ServerTiming::setParameter): Set named parameters, ignoring unrecognized or duplicates.
(WebCore::ServerTiming::isolatedCopy const): Return a new pointer to the object.
* loader/ServerTiming.h: Added.
(WebCore::ServerTiming::ServerTiming): Added struct for the data needed by a server timing entry.
(WebCore::ServerTiming::name const): Added name field of a server timing entry.
(WebCore::ServerTiming::duration const): Added duration field of a server timing entry.
(WebCore::ServerTiming::description const): Added description field of a server timing entry.
* loader/ServerTimingParser.cpp: Added.
(WebCore::ServerTimingParser::parseServerTiming): Parses the header generating a collection of server timing structs.
* loader/ServerTimingParser.h: Added.
* loader/WorkerThreadableLoader.h: Fix build.
* page/Performance.cpp:
(WebCore::Performance::addResourceTiming): Fixed a typo.
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming): Given a ResourceTiming object, populate our collection of PerformanceServerTiming objects.
* page/PerformanceResourceTiming.h: Added serverTiming member and getter.
* page/PerformanceResourceTiming.idl: Added serverTiming member to interface.
* platform/network/HTTPHeaderNames.in: Added "Server-Timing" to the header enum.
* platform/network/ResourceResponseBase.cpp: Added "Server-Timing" to isSafeCrossOriginResponseHeader whitelist.
2018-05-15 Brady Eidson <beidson@apple.com>
Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it.
<rdar://problem/33744241> and https://bugs.webkit.org/show_bug.cgi?id=185653
Reviewed by Andy Estes.
Test: storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): It's okay to not be able to find a pending TX
that the server has started. e.g. When it was a WebWorker that asked for the TX but it has since terminated.
2018-05-15 Thomas Klausner <tk@giga.or.at>
Add missing header to fix build.
https://bugs.webkit.org/show_bug.cgi?id=185378
Reviewed by Michael Catanzaro.
* platform/network/soup/SoupNetworkSession.h:
2018-05-15 Carlos Alberto Lopez Perez <clopez@igalia.com>
[WPE] Build failure with RPi userland drivers and gstreamer-gl
https://bugs.webkit.org/show_bug.cgi?id=185639
Reviewed by Philippe Normand.
When building for the RPi with userland drivers (dispmanx) override the
value of GST_GL_HAVE_GLSYNC to 1 to avoid that the gstreamer-gl headers
try to redefine the GLsync type that is already defined in libepoxy.
Defining __gl2_h_ is also needed to avoid other conflicting type
definitions that happen between libepoxy and RPi GLES2 userland
headers when the gstreamer-gl headers are included.
The issue doesn't happen with 1.14.0, so a check for that is added
as well.
No new tests, no behavior change. It is a build fix.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2018-05-15 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r230749
This did not work as desired.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2018-05-15 Dirk Schulze <krit@webkit.org>
Add new SVGDOM SVGFEBLEND constants
https://bugs.webkit.org/show_bug.cgi?id=185581
Reviewed by Simon Fraser.
Provide new SVG DOM constants for the new blend modes added to feBlend.
https://drafts.fxtf.org/filter-effects-1/#InterfaceSVGFEBlendElement
* platform/graphics/GraphicsTypes.cpp:
(WebCore::blendModeName):
* platform/graphics/GraphicsTypes.h:
* svg/SVGFEBlendElement.h:
(WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
(WebCore::SVGPropertyTraits<BlendMode>::toString):
* svg/SVGFEBlendElement.idl:
2018-05-15 Antoine Quint <graouts@apple.com>
[Web Animations] Expose Web Animations CSS integration as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=185647
Reviewed by Dean Jackson.
Make the Web Animations CSS integration flag an experimental feature, and only indicate that it is on if the Web Animations
experimental feature is also enabled.
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled):
(WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const):
(WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled):
(WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::numberOfActiveAnimations const):
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::animationsInterval const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):
2018-05-15 David Kilzer <ddkilzer@apple.com>
Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
<https://webkit.org/b/185621>
Reviewed by Youenn Fablet.
Fix warnings like the following:
In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
return sdp;
^~~
./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
return sdp;
^~~
std::move(sdp)
1 error generated.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::filterSDP const):
* accessibility/AccessibilityObject.cpp:
(WebCore::rangeClosestToRange):
* bindings/js/JSDOMConvertSequences.h:
(WebCore::Detail::GenericSequenceConverter::convert):
(WebCore::Detail::NumericSequenceConverter::convertArray):
* bindings/js/JSDOMConvertStrings.cpp:
(WebCore::stringToByteString):
(WebCore::stringToUSVString):
- Use WTFMove() in return statements to fix the warnings.
2018-05-14 Dean Jackson <dino@apple.com>
Download and present System Preview
https://bugs.webkit.org/show_bug.cgi?id=185459
<rdar://problem/40079228>
Reviewed by Tim Horton.
If an <a> is a system preview, tell the resource request about it.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2018-05-15 Antti Koivisto <antti@apple.com>
animation-play-state: paused causes very high cpu load because of style invalidation loop
https://bugs.webkit.org/show_bug.cgi?id=182436
<rdar://problem/37182562>
Reviewed by Dean Jackson.
Test: animations/animation-playstate-paused-style-resolution.html
If the style of an element with 'animation-play-state: paused' is recomputed so it stays
paused we would enter zero-duration animation timer loop.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine):
Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
(matching the comments). Otherwise just stay in the existing paused state.
Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.
2018-05-14 Youenn Fablet <youenn@apple.com>
readableStreamDefaultControllerError should return early if stream is not readable
https://bugs.webkit.org/show_bug.cgi?id=185602
Reviewed by Chris Dumez.
Return early if stream is not readable in @readableStreamDefaultControllerError.
Update call sites to no longer check for ReadableStream state.
Covered by unflaked and rebased tests.
* Modules/streams/ReadableStreamDefaultController.js:
(error):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamDefaultControllerError):
(readableStreamDefaultControllerCallPullIfNeeded):
2018-05-14 Zalan Bujtas <zalan@apple.com>
[LFC] Implement width computation for non-replaced block level inflow elements.
https://bugs.webkit.org/show_bug.cgi?id=185641
Reviewed by Sam Weinig.
Block level inflow elements participate in block formatting context.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-05-14 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the iOS build after r231779
Also address a minor in-person review comment by returning "extrazoom" instead of the empty string.
* page/DisabledAdaptations.cpp:
(WebCore::extraZoomModeAdaptationName):
2018-05-14 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
https://bugs.webkit.org/show_bug.cgi?id=185633
Reviewed by Sam Weinig.
By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::paddingTop const):
(WebCore::Display::Box::paddingLeft const):
(WebCore::Display::Box::paddingBottom const):
(WebCore::Display::Box::paddingRight const):
(WebCore::Display::Box::borderTop const):
(WebCore::Display::Box::borderLeft const):
(WebCore::Display::Box::borderBottom const):
(WebCore::Display::Box::borderRight const):
2018-05-14 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Google search results are excessively zoomed in
https://bugs.webkit.org/show_bug.cgi?id=185347
<rdar://problem/39999778>
Reviewed by Tim Horton.
It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport
argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default
viewport shrinking behaviors in 1/3 multitasking mode on iPad.
One way to resolve this is to introduce a new viewport meta content attribute to disable viewport heuristics in
extra zoom mode. However, combined shrink-to-fit and minimum device width behaviors are difficult to describe
using a single backwards-compatible viewport meta content attribute, and the need to suppress the default
behavior of `shrink-to-fit=no` if such an attribute is not disabled further muddles our viewport story.
After some internal deliberation, weve decided to experiment with a new meta tag named "disabled-adaptations".
The content of this meta tag is a comma-separated list of adaptation names; if an adaptation name matches a
known adaptation type (for instance, extra zoom mode), we disable the class of behaviors used to adapt web
content. The first and only known adaptation type is extra zoom mode, which affects `shrink-to-fit` and layout
size adjustments.
See per-method changes below for more details.
Test: fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::processDisabledAdaptations):
* dom/Document.h:
(WebCore::Document::disabledAdaptations const):
Add disabled adaptations to Document. Changes to disabled adaptations are not propagated if the parsed disabled
adaptation types don't change; upon changing adaptation types, notify the client to adjust for the new disabled
adaptations (currently, this only affects the viewport configuration).
* dom/ViewportArguments.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
Restore the set of disabled adaptations when restoring a page from the cache.
* page/Chrome.cpp:
(WebCore::Chrome::dispatchDisabledAdaptationsDidChange const):
* page/Chrome.h:
* page/ChromeClient.h:
Add plumbing for changes to the set of disabled adaptations.
* page/DisabledAdaptations.cpp: Added.
(WebCore::extraZoomModeAdaptationName):
* page/DisabledAdaptations.h: Added.
Introduce a header containing a new enum for the extra zoom mode adaptation, as well as a helper function to
return the extra zoom mode adaptation name.
* page/Page.cpp:
(WebCore::Page::disabledAdaptations const):
Returns the mainframe's set of adaptations to disable.
* page/Page.h:
* page/RemoteFrame.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled):
(WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const):
Add a new runtime feature to gate handling the "disabled-adaptations" meta tag.
* page/ViewportConfiguration.cpp:
(WebCore::shouldOverrideShrinkToFitArgument):
(WebCore::needsUpdateAfterChangingDisabledAdaptations):
(WebCore::ViewportConfiguration::setDisabledAdaptations):
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
Consult whether or not extra zoom mode adaptations are disabled, instead of the shrink-to-fit attribute value.
(WebCore::ViewportConfiguration::updateConfiguration):
* page/ViewportConfiguration.h:
Add an OptionSet of disabled adaptation types to ViewportConfiguration. Updates to the adaptation type are
propagated to the ViewportConfiguration from Document, through the ChromeClient and the client layer (refer to
changes in WebKit). Once the OptionSet is changed, we recompute the viewport configuration only if needed by the
platform.
(WebCore::ViewportConfiguration::viewLayoutSize const):
(WebCore::ViewportConfiguration::disabledAdaptations const):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
* page/WindowFeatures.h:
Add a new helper to parse the meta content of a "disabled-adaptations" tag as an OptionSet of disabled
adaptation types. The string is parsed by first splitting on the comma character, and then iterating over lower
case, whitespace-stripped tokens to look for known adaptation names. So far, only extra zoom mode is supported.
* testing/Internals.cpp:
(WebCore::Internals::extraZoomModeAdaptationName const):
* testing/Internals.h:
* testing/Internals.idl:
Expose the extra zoom mode adaptation name to the DOM, only when running layout tests.
2018-05-14 Joanmarie Diggs <jdiggs@igalia.com>
AX: Listbox and Combobox roles embedded in labels should participate in name calculation
https://bugs.webkit.org/show_bug.cgi?id=185521
Reviewed by Chris Fleizach.
Take selected children into account when computing the name in accessibleNameForNode.
Add ListBox to the roles for which accessibleNameDerivesFromContent returns false so
that native select elements with size > 1 are treated the same way as ARIA listbox.
Also add ListBox to the roles which are treated as controls when used in ARIA. Finally,
prevent labels which contain unrelated controls from being used as an AXTitleUIElement.
This causes us to build a string from the label and its descendants, ensuring the latter
participate in the name calculation.
Test: accessibility/text-alternative-calculation-from-listbox.html
* accessibility/AccessibilityLabel.cpp:
(WebCore::childrenContainUnrelatedControls):
(WebCore::AccessibilityLabel::containsUnrelatedControls const):
* accessibility/AccessibilityLabel.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::accessibleNameForNode):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
(WebCore::AccessibilityObject::isARIAControl):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
2018-05-14 Antoine Quint <graouts@apple.com>
[Web Animations] Tests using the new animation engine may crash under WebCore::FrameView::didDestroyRenderTree when using internals methods
https://bugs.webkit.org/show_bug.cgi?id=185612
<rdar://problem/39579344>
Reviewed by Dean Jackson.
Add a new internals.pseudoElement() method to obtain a pseudo element matching a given pseudo-id. This is necessary to be able to move off
internals.pauseTransitionAtTimeOnPseudoElement() and internals.pauseAnimationAtTimeOnPseudoElement() for Web Animations testing.
* testing/Internals.cpp:
(WebCore::Internals::pseudoElement):
* testing/Internals.h:
* testing/Internals.idl:
2018-05-14 Antoine Quint <graouts@apple.com>
REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
https://bugs.webkit.org/show_bug.cgi?id=185299
<rdar://problem/39630230>
Reviewed by Simon Fraser.
In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
newly-uncommitted animation.
Test: transitions/interrupted-transition-hardware.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2018-05-14 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
https://bugs.webkit.org/show_bug.cgi?id=185510
Reviewed by Philippe Normand.
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:629: More than one command on the same line [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:684: More than one command on the same line [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:807: More than one command on the same line [whitespace/newline] [4]
Indentation and style issue fixed only.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2018-05-14 Zalan Bujtas <zalan@apple.com>
[LFC] Implement height computation for non-replaced out of flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185585
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
(WebCore::Layout::FormattingContext::computeHeightForBlockFormattingContextRootWithAutoHeight const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.h:
* layout/displaytree/DisplayBox.h:
2018-05-14 Manuel Rego Casasnovas <rego@igalia.com>
Renaming of overrides in LayoutBox
https://bugs.webkit.org/show_bug.cgi?id=185609
Reviewed by Javier Fernandez.
The names of the methods for the overrides were not consistent,
this patch fixes it by using the same structure in all the cases.
No new tests, no change of behavior.
* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeChildPreferredLogicalWidths const):
(WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateRubyForJustifiedText):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::hasOverrideContentLogicalHeight const):
(WebCore::RenderBox::hasOverrideContentLogicalWidth const):
(WebCore::RenderBox::setOverrideContentLogicalHeight):
(WebCore::RenderBox::setOverrideContentLogicalWidth):
(WebCore::RenderBox::clearOverrideContentLogicalHeight):
(WebCore::RenderBox::clearOverrideContentLogicalWidth):
(WebCore::RenderBox::clearOverrideContentSize):
(WebCore::RenderBox::overrideContentLogicalWidth const):
(WebCore::RenderBox::overrideContentLogicalHeight const):
(WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const):
(WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const):
(WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const):
(WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::clearOverrideContainingBlockContentSize):
(WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::containingBlockLogicalWidthForContent const):
(WebCore::RenderBox::containingBlockLogicalHeightForContent const):
(WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const):
(WebCore::RenderBox::computeLogicalWidthInFragment const):
(WebCore::RenderBox::computeLogicalHeight const):
(WebCore::RenderBox::computePercentageLogicalHeight const):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
(WebCore::RenderBox::availableLogicalHeightUsing const):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::contentWidthForChild):
(WebCore::contentHeightForChild):
(WebCore::gatherFlexChildrenInfo):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
(WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
(WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
(WebCore::RenderFlexibleBox::constructFlexItem):
(WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight):
* rendering/RenderTableCell.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::relayoutCellIfFlexed):
2018-05-14 Zalan Bujtas <zalan@apple.com>
[LFC] Implement width computation for non-replaced out of flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185598
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
(WebCore::Layout::FormattingContext::shrinkToFitWidth const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/displaytree/DisplayBox.h:
2018-05-14 Zan Dobersek <zdobersek@igalia.com>
Drop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
It's not used at all inside the class or outside it.
Rubber-stamped by Michael Catanzaro.
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2018-05-14 Zan Dobersek <zdobersek@igalia.com>
[GTK] REGRESSION(r231170) Build broken with Clang 5.0
https://bugs.webkit.org/show_bug.cgi?id=185198
Reviewed by Michael Catanzaro.
Avoid gperf files using the register keyword which has been made
reserved and as such unusable in C++17.
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* css/makeprop.pl:
* css/makevalues.pl:
* platform/ColorData.gperf:
* platform/ReferrerPolicy.h: With std::optional forward declaration
gone, explicitly include the WTF Optional.h header.
* platform/Theme.h: Ditto.
* platform/network/create-http-header-name-table:
2018-05-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r219515.
https://bugs.webkit.org/show_bug.cgi?id=185603
It sometimes makes AudioUnitInitialize call to fail in
CoreAudioCaptureSource (Requested by youenn on #webkit).
Reverted changeset:
"Remove CoreAudioCaptureSource speaker configuration"
https://bugs.webkit.org/show_bug.cgi?id=174512
https://trac.webkit.org/changeset/219515
2018-05-13 Dirk Schulze <krit@webkit.org>
Implement SVGGeometryElement's isPointInFill and isPointInStroke
https://bugs.webkit.org/show_bug.cgi?id=185580
Reviewed by Antti Koivisto.
Implement isPointInFill and isPointInStroke methods for
SVGGeometryElement interface from SVG2.
https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
Tests: svg/dom/SVGGeometry-isPointInFill.xhtml
svg/dom/SVGGeometry-isPointInStroke.xhtml
* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::shapeDependentStrokeContains): Flag
to switch between local and "global" coordinate space for hit testing.
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::shapeDependentStrokeContains): Flag
to switch between local and "global" coordinate space for hit testing.
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::shapeDependentStrokeContains): Flag
to switch between local and "global" coordinate space for hit testing.
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::shapeDependentStrokeContains): Flag
to switch between local and "global" coordinate space for hit testing.
(WebCore::RenderSVGShape::isPointInFill): Take the winding rule given by
`fill-rule` to test if a given point is in the fill area of a path.
(WebCore::RenderSVGShape::isPointInStroke): Take stroke properties into
account to check if a point is on top of the stroke area.
* rendering/svg/RenderSVGShape.h:
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::isPointInFill):
(WebCore::SVGGeometryElement::isPointInStroke):
(WebCore::SVGGeometryElement::createElementRenderer): Deleted. This is getting implemented
by inheriting classes. No need to create RenderSVGPath here.
* svg/SVGGeometryElement.h:
* svg/SVGGeometryElement.idl:
2018-05-12 Zalan Bujtas <zalan@apple.com>
Use WeakPtr for m_enclosingPaginationLayer in RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=185566
<rdar://problem/36486052>
Reviewed by Simon Fraser.
Since RenderLayer does not own the enclosing pagination layout, it should
construct a weak pointer instead of holding on to a raw pointer.
Unable to create a reliably reproducible test case.
* page/mac/EventHandlerMac.mm:
(WebCore::scrollableAreaForEventTarget):
(WebCore::scrollableAreaForContainerNode):
(WebCore::EventHandler::platformPrepareForWheelEvents):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::weakPtrFactory const):
(WebCore::ScrollableArea::createWeakPtr): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updatePagination):
* rendering/RenderLayer.h:
2018-05-11 Daniel Bates <dabates@apple.com>
X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
https://bugs.webkit.org/show_bug.cgi?id=185567
<rdar://problem/40175008>
Reviewed by Brent Fulgham.
Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
are same-origin with the document that delivered this header. This prevents an intermediary
malicious frame from clickjacking a child frame whose document is same-origin with the top-
level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
with the top-level frame's document in order to be displayed. This prevents clickjacking by
a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
document same origin with the victim page. We should protect against such attacks.
Tests: http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html
http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
2018-05-11 Daniel Bates <dabates@apple.com>
[iOS] Text decoration of dragged content does not paint with opacity
https://bugs.webkit.org/show_bug.cgi?id=185551
<rdar://problem/40166867>
Reviewed by Wenson Hsieh.
Respect alpha when painting the text decoration for dragged content.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
(WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.
2018-05-11 Nan Wang <n_wang@apple.com>
AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
https://bugs.webkit.org/show_bug.cgi?id=185219
<rdar://problem/39920009>
Reviewed by Chris Fleizach.
The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's
node() to determine if it's the descendant of the modal dialog node.
Test: accessibility/aria-modal-text-descendants.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isModalDescendant const):
2018-05-11 Ryosuke Niwa <rniwa@webkit.org>
Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
https://bugs.webkit.org/show_bug.cgi?id=185465
<rdar://problem/35263057>
Reviewed by Antti Koivisto.
The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
with `display: table-cell`.
For example, for a tree structure like:
table-row (R)
table-cell (C)
"text" (1)
" " (2)
Getting out of (C) would result in moving onto (2) without generating a line break for (R).
When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
immediately before the last word in the last table cell when it traverses words backwards.
This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
a line break when exiting a block while walking up ancestors in TextIterator::advance().
Tests: editing/selection/tapping-in-table-at-end-of-document.html
editing/text-iterator/table-at-end-of-document.html
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance): Fixed the bug.
(WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
last cell of a table at the end of a document hits this condition.
(WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
a blank line between p's and h1/h2/...'s).
(WebCore::TextIterator::exitNode):
2018-05-11 Dean Jackson <dino@apple.com>
System preview badge doesn't show on <picture> elements
https://bugs.webkit.org/show_bug.cgi?id=185559
<rdar://problem/40150066>
Reviewed by Tim Horton.
We should also identify <img>s that are the child of a <picture>
contained inside the appropriate <a> element.
Tested internally, since the badge is platform specific.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isSystemPreviewImage const): Add logic
to look for <picture> parents.
2018-05-11 Chris Dumez <cdumez@apple.com>
REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
https://bugs.webkit.org/show_bug.cgi?id=185531
<rdar://problem/39909589>
Reviewed by Geoffrey Garen.
Whenever we start an asynchronous navigation policy decision for a blob URL, create a temporary
blob URL pointing to the same data, and update the request's URL. This way, if the page's JS revokes
the URL during the policy decision, the load will still succeed.
Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadPostRequest):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
* loader/PolicyChecker.h:
2018-05-11 Antti Koivisto <antti@apple.com>
LinkLoader fails to remove CachedResourceClient in some cases
https://bugs.webkit.org/show_bug.cgi?id=185553
<rdar://problem/36879656>
Reviewed by Geoffrey Garen.
Test: http/tests/preload/link-preload-client-remove.html
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
If there is a link preload already in progress, we fail to clear the client for the ongoing load.
This may leave the CachedResource client map in a bad state.
2018-05-11 Charles Vazac <cvazac@gmail.com>
Runtime feature flag for Server-Timing
https://bugs.webkit.org/show_bug.cgi?id=184758
Reviewed by Youenn Fablet.
* Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
* Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
* Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
* Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
* Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
* Source/WebCore/page/PerformanceServerTiming.cpp: Added.
* Source/WebCore/page/PerformanceServerTiming.h: Added.
* Source/WebCore/page/PerformanceServerTiming.idl: Added.
2018-05-11 Brady Eidson <beidson@apple.com>
Make sure history navigations reuse the existing process when necessary.
<rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
Reviewed by Ryosuke Niwa.
Covered by new API tests.
In WebCore-land, make sure *all* NavigationActions to a back/forward item are tagged with
the item identifier.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::logString const):
* history/HistoryItem.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::setTargetBackForwardItem):
* loader/NavigationAction.h:
(WebCore::NavigationAction::targetBackForwardItemIdentifier const):
2018-05-11 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Handle the protection event in MediaPlayerPrivate
https://bugs.webkit.org/show_bug.cgi?id=185535
Reviewed by Xabier Rodriguez-Calvar.
This patch is based on this calvaris's commit
https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d966168b0d2b65f9ca9415426e26d3752c78b03e
It adds a handler for the protection event in MediaPalyerPrivateGStreamerBase, it extracts the InitData from the event
and sends the encrypted event to JS via HTMLMediaElement.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Add a new type InitData.
2018-05-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
https://bugs.webkit.org/show_bug.cgi?id=185139
Add interface to configure the cipher suites, the signing algorithms and the curve lists
used by OpenSSL and libcurl to exchange, to sign or to verify keys.
Reviewed by Youenn Fablet.
No new tests in public. Have tested internally.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setSslCipherList):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::willSetupSslCtx):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::getCACertPathEnv):
* platform/network/curl/CurlSSLHandle.h:
(WebCore::CurlSSLHandle::getCipherList const):
(WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
(WebCore::CurlSSLHandle::getCurvesList const):
(WebCore::CurlSSLHandle::setCipherList):
(WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
(WebCore::CurlSSLHandle::setCurvesList):
(WebCore::CurlSSLHandle::getCACertPath const):
(WebCore::CurlSSLHandle::setCACertPath):
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
2018-05-10 Daniel Bates <dabates@apple.com>
Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
https://bugs.webkit.org/show_bug.cgi?id=185412
Reviewed by Ryosuke Niwa.
Consolidate the knowledge on how to determine whether security checks were performed on a ResourceResponse
into LoaderStrategy::havePerformedSecurityChecks() (default implementation returns false) and query it
to determine whether CSP frame-ancestors and X-Frame-Options need to be checked for a ResourceResponse.
Additionally, rename LoaderStrategy::isDoingLoadingSecurityChecks() to shouldPerformSecurityChecks()
for consistency with havePerformedSecurityChecks(). Querying shouldPerformSecurityChecks() answers the
question of whether the loader strategy is responsible for performing security checks when building up
a ResourceRequest to have the loader strategy load. And LoaderStrategy::havePerformedSecurityChecks()
is used to determine whether the loader strategy performed these security checks for a given ResourceResponse.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
(WebCore::isResponseProbablyComingFromNetworkProcess): Deleted.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/DocumentThreadableLoader.cpp:
(WebCore::shouldPerformSecurityChecks):
(WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::redirectReceived):
(WebCore::DocumentThreadableLoader::didFail):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::isDoingSecurityChecksInNetworkProcess): Deleted.
(WebCore::isResponseComingFromNetworkProcess): Deleted.
* loader/LoaderStrategy.cpp:
* loader/LoaderStrategy.h:
* page/Settings.yaml: Remove setting networkProcessCSPFrameAncestorsCheckingEnabled as we now make
use of the loader strategy to determine whether to perform CSP frame-ancestors and X-Frame-Options
checking in DocumentLoader.
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::setSource): Added an ASSERT to catch the programming error of setting
source to ResourceResponse::Source::Unknown. This source type represents an uninitialized ResourceResponse.
2018-05-10 Tim Horton <timothy_horton@apple.com>
Lookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
https://bugs.webkit.org/show_bug.cgi?id=185538
<rdar://problem/38817825>
Reviewed by Sam Weinig.
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
Options can be nil, in which case we can't mutableCopy it and add
LUTermOptionDisableSearchTermIndicator. Instead, create a new dictionary,
and add the items from options, if it's not nil.
2018-05-10 Matt Baker <mattbaker@apple.com>
Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener
https://bugs.webkit.org/show_bug.cgi?id=181580
<rdar://problem/36461309>
Reviewed by Brian Burg.
EventTarget should pass newly added EventListeners to InspectorInstrumentation,
instead of PageDebuggerAgent assuming the last item in the EventListenerVector
is the most recently added listener. This assumption does not hold when
the new listener replaces an existing listener.
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::setAttributeEventListener):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didAddEventListenerImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didAddEventListener):
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didAddEventListener):
* inspector/agents/page/PageDebuggerAgent.h:
2018-05-10 Chris Dumez <cdumez@apple.com>
'Cross-Origin-Options header implementation follow-up
https://bugs.webkit.org/show_bug.cgi?id=185520
Reviewed by Ryosuke Niwa.
* dom/Document.cpp:
* dom/Document.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
Using isNull() check is sufficient here as the header parsing
function will do the right thing when passed the empty string.
Also set the options directly on the window instead of the
document. The window is guaranteed to have been constructed
by then because didBeginDocument() is called DocumentWriter::begin()
which calls Document::createDOMWindow() or Document::takeDOMWindowFrom().
* page/AbstractDOMWindow.cpp:
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
* page/AbstractDOMWindow.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
(WebCore::DOMWindow::didSecureTransitionTo):
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::RemoteDOMWindow):
* page/RemoteDOMWindow.h:
CrossOriginOptions are now stored only on the Window, not the Document.
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginOptionsHeader):
Drop strippedHeader local variable as it is not strictly needed.
2018-05-10 Tim Horton <timothy_horton@apple.com>
Fix the build after r231393
https://bugs.webkit.org/show_bug.cgi?id=185519
<rdar://problem/40131741>
Reviewed by Simon Fraser.
* Configurations/WebCore.xcconfig:
2018-05-10 Eric Carlson <eric.carlson@apple.com>
Log missing cues correctly
https://bugs.webkit.org/show_bug.cgi?id=185499
<rdar://problem/40113821>
Reviewed by Daniel Bates.
No new tests, tested manually.
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::removeGenericCue): Log the cue we searched for, not
the NULL cue.
2018-05-10 Zalan Bujtas <zalan@apple.com>
[LFC] Implement height computation for non-replaced inflow elements.
https://bugs.webkit.org/show_bug.cgi?id=185474
Reviewed by Antti Koivisto.
Initial implementation. Does not cover all the cases.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeHeight const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::collapsedMarginBottomFromLastChild):
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
(WebCore::Layout::isMarginBottomCollapsedWithParent): Deleted.
* layout/blockformatting/BlockMarginCollapse.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isReplaced const):
* layout/layouttree/LayoutBox.h:
2018-05-10 Thibault Saunier <tsaunier@igalia.com>
[GTK] Implement ImageBuffer::toBGRAData
https://bugs.webkit.org/show_bug.cgi?id=185511
Reviewed by Michael Catanzaro.
This was never implemented but will be required for the MediaStream API
tests.
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::toBGRAData const):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::toBGRAData const):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toBGRAData const):
2018-05-10 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add a handler for GStreamer protection event
https://bugs.webkit.org/show_bug.cgi?id=185245
Reviewed by Xabier Rodriguez-Calvar.
Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).
The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.
AppendPipeline: httpsrc-->qtdemux-->appsink
PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink
This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
catch and manage the protection event.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::appendPipelineAppsinkPadEventProbe):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
(WebCore::AppendPipeline::playerPrivate):
2018-05-10 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
https://bugs.webkit.org/show_bug.cgi?id=181855
Reviewed by Xabier Rodriguez-Calvar.
The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
the decrypted GstBuffers that are in SVP memory.
This behavior cause an out-of-memory error, because we are limited in SVP memory size.
By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
This new architecture also allows to start the buffering before obtaining the DRM license
and it makes easier to manage dynamic change of the license or Key.
The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
protected by a hardware access control engine, it is not accessible to other unauthorised
software or hardware components.
Tests:
media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::dumpAppendState):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleNeedContextSyncMessage):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
(WebCore::AppendPipeline::setAppendState):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineElementMessageCallback): Deleted.
(WebCore::AppendPipeline::handleElementMessage): Deleted.
(WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
(WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2018-05-09 Nan Wang <n_wang@apple.com>
AX: VoiceOver iframe scrolling focus jumping bug
https://bugs.webkit.org/show_bug.cgi?id=176615
<rdar://problem/34333067>
Reviewed by Chris Fleizach.
Scrolling to make elements visible is not working correctly for elements inside an
offscreen iframe. Fixed it by using RenderLayer::scrollRectToVisible() to handle
scrolling more properly.
Test: accessibility/scroll-to-make-visible-iframe-offscreen.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::scrollToMakeVisible const):
2018-05-09 Joanmarie Diggs <jdiggs@igalia.com>
AX: accessibleNameForNode should simplify whitespace when using innerText
https://bugs.webkit.org/show_bug.cgi?id=185498
Reviewed by Chris Fleizach.
Test: accessibility/text-alternative-calculation-from-unrendered-table.html
Call simplifyWhiteSpace() before returning the innerText value.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::accessibleNameForNode):
2018-05-09 Chris Dumez <cdumez@apple.com>
Add initial support for 'Cross-Origin-Options' HTTP response header
https://bugs.webkit.org/show_bug.cgi?id=184996
<rdar://problem/39664620>
Reviewed by Geoff Garen.
Add initial support for 'Cross-Origin-Options' HTTP response header behind an experimental
feature flag, on by default. When the HTTP server services this HTTP response header for a
main resource, we'll set these options on the corresponding Document. This will impact the
behavior of the Document's associated Window API when cross-origin.
The HTTP header has 3 possible values:
- allow: This is the default. Regular cross-origin Window API is available.
- allow-postmessage: Only postMessage() is available on a cross-origin window, trying to
access anything else will throw a SecurityError.
- deny: Trying to do anything with a cross-origin window will throw a SecurityError.
The header has no effect when accessing same origin windows.
Note that on cross-origin access from Window A to Window B, we check the cross-origin
options for both Window A and Window B and use the lowest common denominator as effective
cross-origin options for the access. So if Window A has 'Cross-Origin-Options: deny' and
tries to call postMessage() on Window B which has 'Cross-Origin-Options: allow-postmessage',
we will throw a SecurityError. This is because Window A's more restrictive options (deny)
apply.
Tests: http/wpt/cross-origin-options/allow-postmessage-from-deny.html
http/wpt/cross-origin-options/allow-postmessage.html
http/wpt/cross-origin-options/cross-origin-options-header.html
* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginOptions):
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::effectiveCrossOriginOptionsForAccess):
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::addCrossOriginWindowPropertyNames):
(WebCore::addScopedChildrenIndexes):
(WebCore::addCrossOriginWindowOwnPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSDOMWindowCustom.h:
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
(WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GetCrossOriginsOptionsFromExtendedAttributeValue):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* dom/Document.cpp:
(WebCore::Document::setCrossOriginOptions):
* dom/Document.h:
(WebCore::Document::crossOriginOptions const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* page/AbstractDOMWindow.cpp:
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
* page/AbstractDOMWindow.h:
(WebCore::AbstractDOMWindow::crossOriginOptions):
(WebCore::AbstractDOMWindow::setCrossOriginOptions):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
(WebCore::DOMWindow::didSecureTransitionTo):
* page/DOMWindow.idl:
* page/Frame.h:
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::RemoteDOMWindow):
* page/RemoteDOMWindow.h:
* page/Settings.yaml:
* platform/network/HTTPHeaderNames.in:
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginOptionsHeader):
* platform/network/HTTPParsers.h:
2018-05-09 Ryosuke Niwa <rniwa@webkit.org>
Release assert in TreeScopeOrderedMap::remove via HTMLImageElement::removedFromAncestor
https://bugs.webkit.org/show_bug.cgi?id=185493
Reviewed by Brent Fulgham.
Fixed the bug that HTMLImageElement::removedFromAncestor and HTMLMapElement::removedFromAncestor
were calling removeImageElementByUsemap on the document instead of the shadow tree from which it was removed.
Test: fast/images/imagemap-in-shadow-tree-removed.html
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::removedFromAncestor):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::removedFromAncestor):
2018-05-09 Joanmarie Diggs <jdiggs@igalia.com>
AX: Hidden nodes which are not directly referenced should not participate name/description from content
https://bugs.webkit.org/show_bug.cgi?id=185478
Reviewed by Chris Fleizach.
Add a check to AccessibilityNodeObject::textUnderElement() and return early
if the node is hidden, not referenced by aria-labelledby or aria-describedby,
not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement.
Test: accessibility/text-alternative-calculation-hidden-nodes.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):
2018-05-09 Eric Carlson <eric.carlson@apple.com>
Update MediaSession to use release logging
https://bugs.webkit.org/show_bug.cgi?id=185376
<rdar://problem/40022203>
Reviewed by Youenn Fablet.
No new tests, tested manually.
* Modules/mediastream/MediaStream.h: hostingDocument() doesn't need to return a const Document.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::hostingDocument const): Ditto.
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.h: Ditto.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::addBehaviorRestriction):
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::dataLoadingPermitted const):
(WebCore::MediaElementSession::fullscreenPermitted const):
(WebCore::MediaElementSession::pageAllowsDataLoading const):
(WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
(WebCore::MediaElementSession::canShowControlsManager const):
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
(WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
(WebCore::MediaElementSession::mediaEngineUpdated):
(WebCore::MediaElementSession::willLog const): Deleted.
(WebCore::MediaElementSession::logger const): Deleted.
(WebCore::MediaElementSession::logIdentifier const): Deleted.
(WebCore::MediaElementSession::logChannel const): Deleted.
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::nextLogIdentifier):
(WebCore::convertEnumerationToString):
(WebCore::PlatformMediaSession::PlatformMediaSession):
(WebCore::PlatformMediaSession::setState):
(WebCore::PlatformMediaSession::beginInterruption):
(WebCore::PlatformMediaSession::endInterruption):
(WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
(WebCore::PlatformMediaSession::clientWillPausePlayback):
(WebCore::PlatformMediaSession::pauseSession):
(WebCore::PlatformMediaSession::stopSession):
(WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
(WebCore::PlatformMediaSession::logChannel const):
(WebCore::stateName): Deleted.
(WebCore::interruptionName): Deleted.
* platform/audio/PlatformMediaSession.h:
(WTF::LogArgument<WebCore::PlatformMediaSession::State>::toString):
(WTF::LogArgument<WebCore::PlatformMediaSession::InterruptionType>::toString):
2018-05-09 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Never call updateTracks if running on legacy pipeline
https://bugs.webkit.org/show_bug.cgi?id=184581
This makes sure failling code path is never reached in the conditions where it should not have been reached.
Reviewed by Philippe Normand.
Re enables all tests that were disabled after fixing.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2018-05-09 Daniel Bates <dabates@apple.com>
REGRESSION (r231479): http/tests/appcache/x-frame-options-prevents-framing.php is timing out
https://bugs.webkit.org/show_bug.cgi?id=185443
<rdar://problem/40100660>
Reviewed by Andy Estes.
Following r231479 when using WebKit2 and Restricted HTTP Response Access is enabled (enabled in
WebKitTestRunner) we only check the CSP frame-ancestors directive and X-Frame-Options in
NetworkProcess. We need to check these security requirements in WebContent process whenever
we are performing a substitute data load, such as for app cache, as these loads do not go
through NetworkProcess.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
2018-05-09 Justin Fan <justin_fan@apple.com>
Hooked up ASTC support in WebGL; requires OpenGL ES 3 context to work.
https://bugs.webkit.org/show_bug.cgi?id=185272
<rdar://problem/15745737>
Reviewed by Dean Jackson.
Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
Test: fast/canvas/webgl/webgl-compressed-texture-astc.html
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
* html/canvas/WebGLCompressedTextureASTC.cpp: Added.
(WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
(WebCore::WebGLCompressedTextureASTC::getName const):
(WebCore::WebGLCompressedTextureASTC::supported):
(WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
* html/canvas/WebGLCompressedTextureASTC.h: Added.
* html/canvas/WebGLCompressedTextureASTC.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
(WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/Extensions3D.h:
2018-05-09 Youenn Fablet <youenn@apple.com>
Allow WebResourceLoader to cancel a load served from a service worker
https://bugs.webkit.org/show_bug.cgi?id=185274
Reviewed by Chris Dumez.
Add support for cancelling a fetch from WebProcess to service worker process.
Use FetchIdentifier instead of uint64_t.
* Modules/fetch/FetchIdentifier.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::startFetch):
(WebCore::ServiceWorkerThreadProxy::cancelFetch):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-05-09 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
https://bugs.webkit.org/show_bug.cgi?id=185479
Reviewed by Philippe Normand.
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:114: Multi line control clauses should use braces. [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:194: Multi line control clauses should use braces. [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:398: One line control clauses should not use braces. [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:440: One line control clauses should not use braces. [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:806: More than one command on the same line [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:869: More than one command on the same line [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:880: More than one command on the same line [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:940: More than one command on the same line [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1102: Multi line control clauses should use braces. [whitespace/braces] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1109: Multi line control clauses should use braces. [whitespace/braces] [4]
Indentation and style issue fixed only.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
(WebCore::MediaPlayerPrivateGStreamer::buffered const):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2018-05-09 Daniel Bates <dabates@apple.com>
REGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied()
https://bugs.webkit.org/show_bug.cgi?id=185475
<rdar://problem/40093853>
Reviewed by Andy Estes.
DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() must extends its lifetime
until completion as dispatching a DOM load event at the associated frame can cause JavaScript execution
that can do anything, including destroying the loader that dispatched the event.
Following r231479 DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() is now
invoked by both DocumentLoader::responseReceived() and WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
The latter only can happen when using WebKit2 and the experimental feature Restricted HTTP Response Access
is enabled (RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()). Unlike DocumentLoader::responseReceived()
WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() does not take out a ref
on the DocumentLoader before invoking DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
Therefore, DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() can cause its
own destruction as a result of dispatching a DOM load event at the frame. We should take out a ref on
the DocumentLoader when executing DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2018-05-09 Tim Horton <timothy_horton@apple.com>
Fix the build by ignoring some deprecation warnings
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
2018-05-09 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE] Build cleanly with GCC 8 and ICU 60
https://bugs.webkit.org/show_bug.cgi?id=185462
Reviewed by Carlos Alberto Lopez Perez.
* PlatformGTK.cmake: Include directories are in the wrong place.
* accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
(WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
(WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
* css/CSSFontFace.cpp: Silence -Wfallthrough
(WebCore::CSSFontFace::fontLoadTiming const):
* css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
(WebCore::CSSSelectorList::adoptSelectorVector):
* editing/TextIterator.cpp: Silence ICU deprecation warnings.
* platform/Length.h:
(WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
* platform/graphics/Gradient.cpp:
(WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
* platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
* platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
(gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
(WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
(WebCore::findHLSQueue): Fix -Wcast-function-type.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
* platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
(WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
* platform/text/TextEncoding.cpp: Silence ICU deprecration.
2018-05-08 Simon Fraser <simon.fraser@apple.com>
SVG lighting colors need to be converted into linearSRGB
https://bugs.webkit.org/show_bug.cgi?id=181196
Reviewed by Darin Adler.
Address post-commit comments. Don't make a Color that contains linearRGB components,
but use FloatComponents instead. Since these FloatComponents are in the 0-1 range,
FELighting::setPixelInternal() needs to multiply by 255 since the output pixels are
8-bit 0-255.
Change linearToSRGBColorComponent() and sRGBToLinearColorComponent() to do math in
floats without promoting to doubles.
* platform/graphics/ColorUtilities.cpp:
(WebCore::FloatComponents::FloatComponents):
(WebCore::linearToSRGBColorComponent):
(WebCore::sRGBToLinearColorComponent):
(WebCore::sRGBColorToLinearComponents):
(WebCore::linearToSRGBColor): Deleted.
(WebCore::sRGBToLinearColor): Deleted.
* platform/graphics/ColorUtilities.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::setPixelInternal):
(WebCore::FELighting::drawLighting):
2018-05-09 Timothy Hatcher <timothy@apple.com>
Use StyleColor::Options in more places.
https://bugs.webkit.org/show_bug.cgi?id=185458
rdar://problem/39853798
Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another
boolean on some of these functions.
Reviewed by Tim Horton.
* css/MediaQueryEvaluator.cpp:
* css/StyleColor.h:
* dom/Document.cpp:
(WebCore::Document::useDefaultAppearance const):
(WebCore::Document::styleColorOptions const):
* dom/Document.h:
* platform/Theme.cpp:
(WebCore::Theme::paint):
* platform/Theme.h:
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::ThemeMac::ensuredView):
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
(WebCore::ThemeMac::paint):
(-[WebCoreThemeView initWithUseSystemAppearance:]): Deleted.
* platform/wpe/ThemeWPE.cpp:
(WebCore::ThemeWPE::paint):
* platform/wpe/ThemeWPE.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::systemColor const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
2018-05-09 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
https://bugs.webkit.org/show_bug.cgi?id=185244
Reviewed by Xabier Rodriguez-Calvar.
The function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" is expected to be called once,
so there is an ASSERT(!m_cdmInstance).
But when the MediaKeys are created before loading the media, the cdminstance is created and attached
to the MediaPlayerPrivate via "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" before loading
the media, then when the media is loading, the function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached"
will be called several times via the function "mediaEngineWasUpdated" wich is called for each change
in the MediaElement state, thus the WebProcess crashes in the ASSERT(!m_cdmInstance).
This commit avoid the crash by replacing the assert with a simple check.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
2018-05-09 Antti Koivisto <antti@apple.com>
Add OptionSet::operator& and operator bool
https://bugs.webkit.org/show_bug.cgi?id=185306
Reviewed by Anders Carlsson.
Use it in a few places.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::reload):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logReasonsForCompositing):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2018-05-08 Dean Jackson <dino@apple.com>
Disable system preview link fetching
https://bugs.webkit.org/show_bug.cgi?id=185463
Reviewed by Jon Lee.
Temporarily disable system preview detection when a link
is clicked.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
2018-05-08 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the internal iOS build
Add a missing import statement in an implementation file.
* editing/cocoa/WebContentReaderCocoa.mm:
2018-05-08 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r231486.
Caused service worker LayoutTest failures on macOS Debug WK2.
Reverted changeset:
"Allow WebResourceLoader to cancel a load served from a
service worker"
https://bugs.webkit.org/show_bug.cgi?id=185274
https://trac.webkit.org/changeset/231486
2018-05-08 Wenson Hsieh <wenson_hsieh@apple.com>
Consolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa
https://bugs.webkit.org/show_bug.cgi?id=185340
Reviewed by Tim Horton.
WebContentReader::readURL is currently the only method implemented separately in iOS and macOS platform
WebContentReader files. The implementation across macOS and iOS is nearly identical (with some exceptions with
the way iOS handles file URLs and plain text editing), so we can merge these into a single method
WebContentReaderCocoa and delete WebContentReaderIOS and WebContentReaderMac.
This also has the added bonus of fixing a latent bug in WebContentReaderMac, wherein URLs written to the
pasteboard using -[NSPasteboard writeObjects:] are currently pasted as empty anchor elements. In this case, the
link title isn't made explicit, so the `title` passed in to WebContentReader::readURL is empty. On iOS, we have
code to fall back to pasting the absolute string of the URL if the title is empty, but on macOS, we'll just use
this empty string as the title of the anchor.
Test: PasteMixedContent.PasteURLWrittenToPasteboardUsingWriteObjects
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readURL):
* editing/ios/WebContentReaderIOS.mm: Removed.
* editing/mac/WebContentReaderMac.mm: Removed.
2018-05-08 Zalan Bujtas <zalan@apple.com>
[Simple line layout] Cache run resolver.
https://bugs.webkit.org/show_bug.cgi?id=185411
Reviewed by Antti Koivisto.
This patch caches the run resolver on the [SimpleLine]Layout object.
In certain cases, when the block container has thousands of elements (foobar1<br>foobar2<br>.....foobar9999<br>),
constructing the resolver (and its dependencies) in a repeating fashion could hang the WebProcess.
Covered by existing tests.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
(WebCore::SimpleLineLayout::Layout::Layout):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Layout::runResolver const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::hitTestFlow):
(WebCore::SimpleLineLayout::collectFlowOverflow):
(WebCore::SimpleLineLayout::computeBoundingBox):
(WebCore::SimpleLineLayout::computeFirstRunLocation):
(WebCore::SimpleLineLayout::collectAbsoluteRects):
(WebCore::SimpleLineLayout::collectAbsoluteQuads):
(WebCore::SimpleLineLayout::textOffsetForPoint):
(WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
(WebCore::SimpleLineLayout::generateLineBoxTree):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::LineResolver::LineResolver):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::lineResolver):
2018-05-08 Brent Fulgham <bfulgham@apple.com>
Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
https://bugs.webkit.org/show_bug.cgi?id=185451
<rdar://problem/39620348>
Reviewed by Zalan Bujtas.
Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
PlatformScreenMac implementation to less expensive Debug ASSERTS.
No change in behavior.
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):
2018-05-08 Daniel Bates <dabates@apple.com>
Resign Strong Password appearance when text field value changes
https://bugs.webkit.org/show_bug.cgi?id=185433
<rdar://problem/39958508>
Reviewed by Ryosuke Niwa.
Remove the Strong Password decoration when the text field's value changes to avoid interfering
with web sites that allow a person to clear the password field.
Tests: fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html
fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html
fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::resignStrongPasswordAppearance): Extracted from HTMLInputElement::updateType().
(WebCore::HTMLInputElement::updateType): Extract out logic to resign the Strong Password appearance
into a function that can be shared by this function and HTMLInputElement::setValue().
(WebCore::HTMLInputElement::setValue): Resign the Strong Password appearance if this field was
changed programmatically (i.e. no DOM change event was dispatched).
* html/HTMLInputElement.h:
2018-05-08 Jer Noble <jer.noble@apple.com>
Unreviewed build fix; add missing function definition.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::didPassCORSAccessCheck const):
2018-05-08 Jer Noble <jer.noble@apple.com>
Mute MediaElementSourceNode when tainted.
https://bugs.webkit.org/show_bug.cgi?id=184866
Reviewed by Eric Carlson.
Test: http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::wouldTaintOrigin const):
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::setFormat):
(WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
(WebCore::MediaElementAudioSourceNode::process):
* Modules/webaudio/MediaElementAudioSourceNode.h:
2018-05-08 Eric Carlson <eric.carlson@apple.com>
Log rtcstats as JSON
https://bugs.webkit.org/show_bug.cgi?id=185437
<rdar://problem/40065332>
Reviewed by Youenn Fablet.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a
toJSONString method to libwebrtc.
(WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON.
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because
it doesn't work well inside of a lambda.
(WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only
used here.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file.
2018-05-08 Dean Jackson <dino@apple.com>
System Preview links should trigger a download
https://bugs.webkit.org/show_bug.cgi?id=185439
<rdar://problem/40065545>
Reviewed by Jon Lee.
Add a new field to FrameLoadRequest, which then is copied
into ResourceRequest, identifying if the link clicked
is a system preview.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): Look for isSystemPreviewLink().
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h: New property.
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::isSystemPreview const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::isSystemPreview const):
(WebCore::ResourceRequestBase::setSystemPreview):
* platform/network/ResourceRequestBase.h:
2018-05-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231491.
https://bugs.webkit.org/show_bug.cgi?id=185434
Setting the Created key on a cookie does not work yet, due a
bug in CFNetwork (Requested by ggaren on #webkit).
Reverted changeset:
"[WKHTTPCookieStore getAllCookies] returns inconsistent
creation time"
https://bugs.webkit.org/show_bug.cgi?id=185041
https://trac.webkit.org/changeset/231491
2018-05-08 Sihui Liu <sihui_liu@apple.com>
[WKHTTPCookieStore getAllCookies] returns inconsistent creation time
https://bugs.webkit.org/show_bug.cgi?id=185041
<rdar://problem/34684214>
Reviewed by Geoffrey Garen.
Set creationtime property when creating Cookie object to keep consistency after conversion.
New API test: WebKit.WKHTTPCookieStoreCreationTime.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
2018-05-08 Eric Carlson <eric.carlson@apple.com>
Text track cue logging should include cue text
https://bugs.webkit.org/show_bug.cgi?id=185353
<rdar://problem/40003565>
Reviewed by Brent Fulgham.
No new tests, tested manually.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::toJSON const):
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::toJSONString const):
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::toJSONString const):
2018-05-08 Sam Weinig <sam@webkit.org>
More cleanup of XMLHttpRequestUpload
https://bugs.webkit.org/show_bug.cgi?id=185409
Reviewed by Alex Christensen.
- Remove unneeded #includes
- Rename m_xmlHttpRequest to m_request
- Make some overloaded some methods private, and mark them as final rather
than override.
* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
* xml/XMLHttpRequestUpload.h:
2018-05-08 Zalan Bujtas <zalan@apple.com>
[LFC] Start using BlockMarginCollapse
https://bugs.webkit.org/show_bug.cgi?id=185424
Reviewed by Antti Koivisto.
BlockMarginCollapse could be all static.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::marginTop const):
(WebCore::Layout::BlockFormattingContext::marginBottom const):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithSibling):
(WebCore::Layout::isMarginBottomCollapsedWithSibling):
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::isMarginBottomCollapsedWithParent):
(WebCore::Layout::collapsedMarginTopFromFirstChild):
(WebCore::Layout::collapsedMarginBottomFromLastChild):
(WebCore::Layout::nonCollapsedMarginTop):
(WebCore::Layout::nonCollapsedMarginBottom):
(WebCore::Layout::BlockMarginCollapse::marginTop):
(WebCore::Layout::BlockMarginCollapse::marginBottom):
(WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse): Deleted.
(WebCore::Layout::BlockMarginCollapse::marginTop const): Deleted.
(WebCore::Layout::BlockMarginCollapse::marginBottom const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const): Deleted.
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const): Deleted.
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const): Deleted.
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const): Deleted.
(WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const): Deleted.
(WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const): Deleted.
(WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const): Deleted.
* layout/blockformatting/BlockMarginCollapse.h:
2018-05-08 Youenn Fablet <youenn@apple.com>
Allow WebResourceLoader to cancel a load served from a service worker
https://bugs.webkit.org/show_bug.cgi?id=185274
Reviewed by Chris Dumez.
Add support for cancelling a fetch from WebProcess to service worker process.
Use FetchIdentifier instead of uint64_t.
* Modules/fetch/FetchIdentifier.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::startFetch):
(WebCore::ServiceWorkerThreadProxy::cancelFetch):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-05-08 Said Abou-Hallawa <sabouhallawa@apple.com>
feTurbulence is not rendered correctly on Retina display
https://bugs.webkit.org/show_bug.cgi?id=183798
Reviewed by Simon Fraser.
On 2x display the feTurbulence filter creates a scaled ImageBuffer but
processes only the unscaled size. This is a remaining work of r168577 and
is very similar to what was done for the feMorphology filter in r188271.
Test: fast/hidpi/filters-turbulence.html
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
(WebCore::FETurbulence::platformApplySoftware):
2018-05-07 Zalan Bujtas <zalan@apple.com>
[LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
https://bugs.webkit.org/show_bug.cgi?id=185377
Reviewed by Antti Koivisto.
Also, remove FormattingContext's m_layoutContext member and pass it in to ::layout() instead.
In theory LayoutContext is needed only during ::layout() call.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::layoutContext const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-05-07 Daniel Bates <dabates@apple.com>
Check X-Frame-Options and CSP frame-ancestors in network process
https://bugs.webkit.org/show_bug.cgi?id=185410
<rdar://problem/37733934>
Reviewed by Ryosuke Niwa.
* WebCore.xcodeproj/project.pbxproj: Make PingLoader.h a private header so that we can include it in WebKit.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Only check CSP frame-ancestors and X-Frame-Options here if
we are not checking them in the NetworkProcess and HTTP response access is restricted. I code is otherwise kept
unchanged. There may be opportunities to clean this code up more and share more of it. We should look into this
in subsequent bugs.
* loader/DocumentLoader.h: Change visibility of stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() from
private to public and export it so that we can call it from the WebKit.
* loader/PingLoader.h:
* page/Settings.yaml: Add a new setting called networkProcessCSPFrameAncestorsCheckingEnabled (defaults: false)
and is hardcoded in WebPage.cpp to be enabled. This setting is used to determine if we will be using the NetworkProcess.
Ideally we wouldn't have this setting and just key off RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
However RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess() is always enabled in WebKit Legacy
at the time of writing (why?). And, strangely, RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
is conditionally enabled in WebKit. For now, we add a new setting, networkProcessCSPFrameAncestorsCheckingEnabled,
to determine if CSP checking should be performed in NetworkProcess. For checking to actually happen in NetworkProcess
and not in DocumentLoader::responseReceived() RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
will also need to be enabled.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowFrameAncestors const): Added a variant that takes a vector of ancestor origins.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const): Ditto.
* page/csp/ContentSecurityPolicyDirectiveList.h: Export constructor so that we can invoke it from NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions().
* page/csp/ContentSecurityPolicyResponseHeaders.h:
* platform/network/HTTPParsers.h: Export XFrameOptionsDisposition() so that we can use in WebKit.
2018-05-07 Daniel Bates <dabates@apple.com>
Abstract logic to log console messages and send CSP violation reports into a client
https://bugs.webkit.org/show_bug.cgi?id=185393
<rdar://problem/40036053>
Reviewed by Brent Fulgham.
First pass at adding infrastructure to supporting CSP reporting from NetworkProcess and workers.
Replaces the existing ContentSecurityPolicy constructor that takes a Frame with one that
takes a ContentSecurityPolicyClient to delegate to for logging and sending reports. We will look
to remove ContentSecurityPolicy constructor that takes a ScriptExecutionContext in a follow up.
Standardize on instantiating a ContentSecurityPolicy with the full URL to resource that it protects
instead of taking only the SecurityOrigin of this URL. By taking the full URL the ContentSecurityPolicy
object is now capable of resolving a relative report URL without needing a Document/ScriptExecutionContext.
We are underutilizing the CSPInfo struct and ContentSecurityPolicyClient::willSendCSPViolationReport()
delegate callback in this patch. We will make use of this functionality in a subsequent patch to
support collecting script state (e.g. source line number) when reporting CSP violations in worker
threads. We also no longer go through the unnecessary motions to try to collect script state for a
frame-ancestors violation (since DocumentLoader extends ContentSecurityPolicyClient and does not
implement ContentSecurityPolicyClient::willSendCSPViolationReport()). The frame-ancestors directive
is checked before a document is parsed and executes script; => there will never be any script state
to collect; => it is not necessary to try to collect it as we currently do.
* Sources.txt: Add file ContentSecurityPolicyClient.cpp. See the remarks for ContentSecurityPolicyClient.cpp
below on why we have this file.
* WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyClient.{h, cpp}.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Pass the URL of the protected document.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Ditto.
(WebCore::DocumentLoader::addConsoleMessage): Added.
(WebCore::DocumentLoader::sendCSPViolationReport): Added.
(WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Added.
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h: Fix typo in comment.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass the URL of the worker script.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Added overload that takes a URL&& and an optional
ContentSecurityPolicyClient*.
(WebCore::ContentSecurityPolicy::deprecatedURLForReporting const): Extracted and simplified stripURLForUseInReport()
into this member function.
(WebCore::ContentSecurityPolicy::reportViolation const): Modified to make use of the client, if we have
one and removed code for handling a ContentSecurityPolicy that was instantiated with a Frame.
(WebCore::ContentSecurityPolicy::logToConsole const): Ditto.
(WebCore::stripURLForUseInReport): Deleted; incorporated into ContentSecurityPolicy::deprecatedURLForReporting().
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyClient.cpp: Added. This file exists so that we can define the virtual
destructor out-of-line and export this abstract class so as to avoid the need for the vtable to be
defined in the translation unit of each derived class.
* page/csp/ContentSecurityPolicyClient.h: Added.
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::operator SecurityOriginData const): Added.
* page/csp/ContentSecurityPolicySource.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate the ContentSecurityPolicy object with the
URL of the worker script.
2018-05-07 Simon Fraser <simon.fraser@apple.com>
CSS filters which reference SVG filters fail to respect the "color-interpolation-filters" of the filter
https://bugs.webkit.org/show_bug.cgi?id=185343
Reviewed by Dean Jackson.
Test: css3/filters/color-interpolation-filters.html
When applying CSS reference filters, apply the value of "color-interpolation-filters" for the
referenced filter effect element, just as we do for SVG filters.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
2018-05-07 Daniel Bates <dabates@apple.com>
CSP status-code incorrect for document blocked due to violation of its frame-ancestors directive
https://bugs.webkit.org/show_bug.cgi?id=185366
<rdar://problem/40035116>
Reviewed by Brent Fulgham.
Fixes an issue where the status-code in the sent CSP report for an HTTP document blocked because
its frame-ancestors directive was violated would be the status code of the previously loaded
document in the frame. If the previously loaded document was about:blank then this would be 0.
Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for the
HTTP status code for the last response. Document::loader() returns the loader for the last committed
document its frame. For a frame-ancestors violation, a CSP report is sent before the document
that had the frame-ancestors directive has been committed and after it has been associate with a frame.
As a result we are in are in a transient transition state for the frame and hence the last response
for new document's loader (Document::loader()) is actually the last response of the previously loaded
document in the frame. Instead we need to take care to tell CSP about the HTTP status code for the
response associated with the document the CSP came from.
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
(WebCore::Document::initSecurityContext):
Pass the HTTP status code to CSP.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom):
(WebCore::ContentSecurityPolicy::responseHeaders const):
(WebCore::ContentSecurityPolicy::didReceiveHeaders):
(WebCore::ContentSecurityPolicy::didReceiveHeader):
(WebCore::ContentSecurityPolicy::reportViolation const):
* page/csp/ContentSecurityPolicy.h:
Modify existing functions to take the HTTP status code, store it in a instance variable,
and reference this variable when reporting a violation.
* page/csp/ContentSecurityPolicyResponseHeaders.cpp:
(WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders):
(WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy const):
* page/csp/ContentSecurityPolicyResponseHeaders.h:
(WebCore::ContentSecurityPolicyResponseHeaders::encode const):
(WebCore::ContentSecurityPolicyResponseHeaders::decode):
Store the HTTP status code along with the response headers.
2018-05-07 Daniel Bates <dabates@apple.com>
CSP referrer incorrect for document blocked due to violation of its frame-ancestors directive
https://bugs.webkit.org/show_bug.cgi?id=185380
Reviewed by Brent Fulgham.
Similar to <https://bugs.webkit.org/show_bug.cgi?id=185366>, fixes an issue where the referrer
in the sent CSP report for an HTTP document blocked because its frame-ancestors directive was
violated would be the referrer of the previously loaded document in the frame.
Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for
the referrer for the last request. Document::loader() returns the loader for the last committed
document in its frame. For a frame-ancestors violation, a CSP report is sent before the document
that had the frame-ancestors directive has been committed and after it has been associate with a
frame. As a result we are in a transient transition state for the frame and hence the last request
for the new document's loader (Document::loader()) is actually the last request of the previously
loaded document in the frame. Instead we need to take care to tell CSP about the referrer for the
request associated with the document the CSP came from.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
2018-05-07 Brent Fulgham <bfulgham@apple.com>
Add experimental feature to prompt for Storage Access API use
https://bugs.webkit.org/show_bug.cgi?id=185335
<rdar://problem/39994649>
Reviewed by Alex Christensen and Youenn Fablet.
Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
Storage Access API is invoked.
Currently this feature doesn't have any user-visible impact.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled):
(WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setStorageAccessPromptsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2018-05-07 Chris Dumez <cdumez@apple.com>
Stop using an iframe's id as fallback if its name attribute is not set
https://bugs.webkit.org/show_bug.cgi?id=11388
Reviewed by Geoff Garen.
WebKit had logic to use an iframe's id as fallback name when its name
content attribute is not set. This behavior was not standard and did not
match other browsers:
- https://html.spec.whatwg.org/#attr-iframe-name
Gecko / Trident never behaved this way. Blink was aligned with us until
they started to match the specification in:
- https://bugs.chromium.org/p/chromium/issues/detail?id=347169
This WebKit quirk was causing some Web-compatibility issues because it
would affect the behavior of Window's name property getter when trying
to look up an iframe by id. Because of Window's named property getter
behavior [1], we would return the frame's contentWindow instead of the
iframe element itself.
[1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
Test: fast/dom/Window/named-getter-frame-id.html
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::parseAttribute):
(WebCore::HTMLFrameElementBase::didFinishInsertingNode):
* html/HTMLFrameElementBase.h:
2018-05-07 Chris Dumez <cdumez@apple.com>
ASSERT(!childItemWithTarget(child->target())) is hit in HistoryItem::addChildItem()
https://bugs.webkit.org/show_bug.cgi?id=185322
Reviewed by Geoff Garen.
We generate unique names for Frame to be used in HistoryItem. Those names not only
need to be unique, they also need to be repeatable to avoid layout tests flakiness
and for things like restoring form state from a HistoryItem.
The previously generated frame names were relying on the Frame's index among a
parent Frame's children. The issue was that we could end up with duplicate names
because one could insert a Frame *before* an existing one. This is because the code
would not take care of updating existing Frames' unique name on frame tree mutation.
Updating frame tree names on mutation would be inefficient and is also not necessary.
The approach chosen in this patch is to stop using the Frame's index and instead rely
on an increasing counter stored on the top-frame's FrameTree. To make the names
repeatable, we reset the counter on page navigation.
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* page/FrameTree.cpp:
(WebCore::FrameTree::uniqueChildName const):
(WebCore::FrameTree::generateUniqueName const):
* page/FrameTree.h:
(WebCore::FrameTree::resetFrameIdentifiers):
2018-05-07 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Fix wrong subsample parsing on r227067
https://bugs.webkit.org/show_bug.cgi?id=185382
Reviewed by Philippe Normand.
The initialization of sampleIndex should be moved outside of the loop.
Without this patch we will have a bad log and the check of the subsample
count will be useless.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt):
2018-05-07 Daniel Bates <dabates@apple.com>
CSP should be passed the referrer
https://bugs.webkit.org/show_bug.cgi?id=185367
Reviewed by Per Arne Vollan.
As a step towards formalizing a CSP delegate object and removing the dependencies
on ScriptExecutionContext and Frame, we should pass the document's referrer directly
instead of indirectly obtaining it from the ScriptExecutionContext or Frame used
to instantiate the ContentSecurityPolicy object.
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Pass the document's referrer.
(WebCore::Document::initSecurityContext): Ditto.
(WebCore::Document::applyQuickLookSandbox): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument): Ditto.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom): We pass a null string for the referrer
to didReceiveHeader() as a placeholder since it requires the referrer be given to it. We
fix up the referrer (m_referrer) after copying all the policy headers.
(WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
(WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take a referrer and WTFMove()s
it into an instance variable (m_referrer).
(WebCore::ContentSecurityPolicy::reportViolation const): Modified to use the stored referrer.
* page/csp/ContentSecurityPolicy.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Pass a null string
for the referrer as a worker does not have a referrer.
2018-05-07 Daniel Bates <dabates@apple.com>
CSP should only notify Inspector to pause the debugger on the first policy to violate a directive
https://bugs.webkit.org/show_bug.cgi?id=185364
Reviewed by Brent Fulgham.
Notify Web Inspector that a script was blocked on the first enforced CSP policy that it
violates.
A page can have more than one enforced Content Security Policy. Currently for inline
scripts, inline event handlers, JavaScript URLs, and eval() that are blocked by CSP
we notify Web Inspector that it was blocked for each CSP policy that blocked it. When
Web Inspector is notified it pauses script execution. It does not seem very meaningful
to pause script execution on the same script for each CSP policy that blocked it.
Therefore, only tell Web Inspector that a script was blocked for the first enforced CSP
policy that blocked it.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowJavaScriptURLs const):
(WebCore::ContentSecurityPolicy::allowInlineEventHandlers const):
(WebCore::ContentSecurityPolicy::allowInlineScript const):
(WebCore::ContentSecurityPolicy::allowEval const):
2018-05-07 Daniel Bates <dabates@apple.com>
Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
https://bugs.webkit.org/show_bug.cgi?id=185170
Reviewed by Per Arne Vollan.
Rename CrossOriginPreflightResultCache::empty() to CrossOriginPreflightResultCache::clear() make
it consistent with the terminology we use in WebKit to signify a function that clears a collection.
A member function named "empty" is expected to return an instance of a class in its "empty state".
For example, StringImpl::empty() returns a StringImpl instance that represents the empty string.
However CrossOriginPreflightResultCache::empty() clears out the cache in-place. We should rename
this function to better describe its purpose.
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCache::clear):
(WebCore::CrossOriginPreflightResultCache::empty): Deleted.
* loader/CrossOriginPreflightResultCache.h:
2018-05-06 Dean Jackson <dino@apple.com>
WebGL: Reset simulated values after validation fails
https://bugs.webkit.org/show_bug.cgi?id=185363
<rdar://problem/39733417>
Reviewed by Anders Carlsson.
While fixing a previous bug, I forgot to reset some values
when validation fails. This caused a bug where a subsequent
invalid call might use those values and escape detection.
Test: fast/canvas/webgl/index-validation-with-subsequent-draws.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Reset the
sizes when validation fails.
* html/canvas/WebGLRenderingContextBase.h:
2018-05-07 Ms2ger <Ms2ger@igalia.com>
Support negative sw/sh values in createImageBitmap().
https://bugs.webkit.org/show_bug.cgi?id=184449
Reviewed by Dean Jackson.
Tests: LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
LayoutTests/http/wpt/2dcontext/imagebitmap/createImageBitmap.html
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise): handle negative values per spec.
2018-05-07 Brian Burg <bburg@apple.com>
Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
https://bugs.webkit.org/show_bug.cgi?id=184861
<rdar://problem/39153768>
Reviewed by Timothy Hatcher.
Notify the client of the current connection count whenever a frontend connects or disconnects.
Covered by new API test.
* inspector/InspectorClient.h:
(WebCore::InspectorClient::frontendCountChanged):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
* inspector/InspectorController.h:
2018-05-07 Eric Carlson <eric.carlson@apple.com>
Text track cue logging should include cue text
https://bugs.webkit.org/show_bug.cgi?id=185353
<rdar://problem/40003565>
Reviewed by Youenn Fablet.
No new tests, tested manually.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::toJSONString const): Use toJSON.
(WebCore::VTTCue::toJSON const): New.
* html/track/VTTCue.h:
* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::toJSONString const): Log m_content.
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.
2018-05-06 Zalan Bujtas <zalan@apple.com>
[LFC] Add assertions for stale Display::Box geometry
https://bugs.webkit.org/show_bug.cgi?id=185357
Reviewed by Antti Koivisto.
Ensure that we don't access stale geometry of other boxes during layout.
For example, in order to layout a block child we need the containing block's content box top/left and width (but not the height)
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::invalidateTop):
(WebCore::Display::Box::invalidateLeft):
(WebCore::Display::Box::invalidateWidth):
(WebCore::Display::Box::invalidateHeight):
(WebCore::Display::Box::hasValidPosition const):
(WebCore::Display::Box::hasValidSize const):
(WebCore::Display::Box::hasValidGeometry const):
(WebCore::Display::Box::invalidatePosition):
(WebCore::Display::Box::invalidateSize):
(WebCore::Display::Box::setHasValidPosition):
(WebCore::Display::Box::setHasValidSize):
(WebCore::Display::Box::setHasValidGeometry):
(WebCore::Display::Box::rect const):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::left const):
(WebCore::Display::Box::bottom const):
(WebCore::Display::Box::right const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::bottomRight const):
(WebCore::Display::Box::size const):
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::setRect):
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::setSize):
(WebCore::Display::Box::setWidth):
(WebCore::Display::Box::setHeight):
2018-05-06 Zalan Bujtas <zalan@apple.com>
[LFC] Add BlockFormattingContext::computeStaticPosition
https://bugs.webkit.org/show_bug.cgi?id=185352
Reviewed by Antti Koivisto.
This is the core logic for positioning inflow boxes in a block formatting context (very naive though).
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
* layout/displaytree/DisplayBox.h:
2018-05-05 Sam Weinig <sam@webkit.org>
Cleanup XMLHttpRequestUpload a little
https://bugs.webkit.org/show_bug.cgi?id=185344
Reviewed by Yusuke Suzuki.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitAdditionalChildren):
Use auto to reduce redundancy.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::upload):
* xml/XMLHttpRequest.h:
Switch upload() to return a reference.
* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
(WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
* xml/XMLHttpRequestUpload.h:
Cleanup formatting, modernize and switch XMLHttpRequest member from a pointer
to a reference.
2018-05-05 Dean Jackson <dino@apple.com>
Draw a drop-shadow behind the system preview badge
https://bugs.webkit.org/show_bug.cgi?id=185356
<rdar://problem/40004936>
Reviewed by Wenson Hsieh.
Draw a very subtle drop-shadow under the system
preview badge so that it is more visible on a pure
white background.
I also moved some code around to make it more clear
and improved comments.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2018-05-04 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
https://bugs.webkit.org/show_bug.cgi?id=185289
<rdar://problem/35756912>
Reviewed by Tim Horton and Darin Adler.
When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space
(see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight
tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't
the first item to be inserted in the resulting document fragment.
Augments existing API tests in DataInteractionTests.
* editing/ios/WebContentReaderIOS.mm:
Additionally remove some extraneous header imports from this implementation file.
(WebCore::WebContentReader::readURL):
2018-05-02 Dean Jackson <dino@apple.com>
Use IOSurfaces for CoreImage operations where possible
https://bugs.webkit.org/show_bug.cgi?id=185230
<rdar://problem/39926929>
Reviewed by Jon Lee.
On iOS hardware, we can use IOSurfaces as a rendering destination
for CoreImage, which means we're keeping data on the GPU
for rendering.
As a drive-by fix, I used a convenience method for Gaussian blurs.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2018-05-04 Tim Horton <timothy_horton@apple.com>
Shift to a lower-level framework for simplifying URLs
https://bugs.webkit.org/show_bug.cgi?id=185334
Reviewed by Dan Bernstein.
* Configurations/WebCore.xcconfig:
* platform/mac/DragImageMac.mm:
(WebCore::LinkImageLayout::LinkImageLayout):
2018-05-03 Ryosuke Niwa <rniwa@webkit.org>
Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
https://bugs.webkit.org/show_bug.cgi?id=185288
Reviewed by Jer Noble.
The crash is caused by HTMLMediaElement::~HTMLMediaElement canceling the resource load via CachedResource
which ends up calling FrameLoader::checkCompleted() and fire load event on the document synchronously.
Speculatively fix the crash by scheduling the check instead.
In long term, ResourceLoader::cancel should never fire load event synchronously: webkit.org/b/185284.
Unfortunately, no new tests since I can't get MediaResource to get destructed at the right time.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isRunningDestructor): Added to detect this specific case.
(WebCore::HTMLMediaElementDestructorScope): Added.
(WebCore::HTMLMediaElementDestructorScope::HTMLMediaElementDestructorScope): Added.
(WebCore::HTMLMediaElementDestructorScope::~HTMLMediaElementDestructorScope): Added.
(WebCore::HTMLMediaElement::~HTMLMediaElement): Instantiate HTMLMediaElement.
* html/HTMLMediaElement.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkCompleted): Call scheduleCheckCompleted instead of synchronously calling
checkCompleted if we're in the middle of destructing a HTMLMediaElement.
2018-05-04 Ryosuke Niwa <rniwa@webkit.org>
Rename DocumentOrderedMap to TreeScopeOrderedMap
https://bugs.webkit.org/show_bug.cgi?id=185290
Reviewed by Zalan Bujtas.
Renamed the class since it's almost always a mistake to use this class as a member variable of Document.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/MouseRelatedEvent.cpp: Include the forgotten DOMWindow.h. Unified build files bit us here.
* dom/TreeScope.cpp:
(WebCore::TreeScope::addElementById):
(WebCore::TreeScope::addElementByName):
(WebCore::TreeScope::addImageMap):
(WebCore::TreeScope::addImageElementByUsemap):
(WebCore::TreeScope::labelElementForId):
* dom/TreeScope.h:
* dom/TreeScopeOrderedMap.cpp: Renamed from DocumentOrderedMap.cpp
* dom/TreeScopeOrderedMap.h: Renamed from DocumentOrderedMap.h
* html/HTMLDocument.h:
2018-05-04 Don Olmstead <don.olmstead@sony.com>
[Win][WebKit] Fix forwarding headers for Windows build
https://bugs.webkit.org/show_bug.cgi?id=184412
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* PlatformWin.cmake:
2018-05-04 Zalan Bujtas <zalan@apple.com>
[Simple line layout] Add support for line layout box generation with multiple text renderers.
https://bugs.webkit.org/show_bug.cgi?id=185276
Reviewed by Antti Koivisto.
Covered by existing tests.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::canUseForLineBoxTree):
(WebCore::SimpleLineLayout::generateLineBoxTree):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::renderer const):
(WebCore::SimpleLineLayout::RunResolver::Run::localStart const):
(WebCore::SimpleLineLayout::RunResolver::Run::localEnd const):
* rendering/SimpleLineLayoutResolver.h:
2018-05-04 Timothy Hatcher <timothy@apple.com>
Deprecate legacy WebView and friends
https://bugs.webkit.org/show_bug.cgi?id=185279
rdar://problem/33268700
Reviewed by Tim Horton.
* Configurations/WebCore.xcconfig:
Added BUILDING_WEBKIT define to disable the deprecation macros.
* bridge/objc/WebScriptObject.h:
Added deprecation macros to WebScriptObject and WebUndefined.
* platform/cocoa/WebKitAvailability.h:
Added more macros and a way to disable deprecation warnings for
WebKit build and in clients like Safari.
2018-05-04 Eric Carlson <eric.carlson@apple.com>
Log media time range as JSON
https://bugs.webkit.org/show_bug.cgi?id=185321
<rdar://problem/39986746>
Reviewed by Youenn Fablet.
No new tests, tested manually.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addPlayedRange): Log as time range.
(WebCore::HTMLMediaElement::visibilityStateChanged): Cleanup.
* platform/graphics/MediaPlayer.h:
(WTF::LogArgument<MediaTime>::toString):
(WTF::LogArgument<MediaTimeRange>::toString):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Log error as time range.
2018-05-04 Zalan Bujtas <zalan@apple.com>
Use the containing block to compute the pagination gap when the container is inline.
https://bugs.webkit.org/show_bug.cgi?id=184724
<rdar://problem/39521800>
Reviewed by Simon Fraser.
Test: fast/overflow/page-overflow-with-inline-body-crash.html
* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):
2018-05-04 Tim Horton <timothy_horton@apple.com>
Don't use GSFont* in minimal simulator mode
https://bugs.webkit.org/show_bug.cgi?id=185320
<rdar://problem/39734478>
Reviewed by Beth Dakin.
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
2018-05-04 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r231331.
Caused a few tests to assert
Reverted changeset:
"Stop using an iframe's id as fallback if its name attribute
is not set"
https://bugs.webkit.org/show_bug.cgi?id=11388
https://trac.webkit.org/changeset/231331
2018-05-04 Youenn Fablet <youenn@apple.com>
Use more references in updateTracksOfType
https://bugs.webkit.org/show_bug.cgi?id=185305
Reviewed by Eric Carlson.
No change of behavior.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfType):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
2018-05-04 Myles C. Maxfield <mmaxfield@apple.com>
Text shaping in the simple path is flipped in the y direction
https://bugs.webkit.org/show_bug.cgi?id=185062
<rdar://problem/39778678>
Reviewed by Simon Fraser.
Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
neither of which move glyphs vertically in the common case.
Test: fast/text/vertical-displacement-simple-codepath.html
* platform/graphics/Font.cpp:
(WebCore::Font::applyTransforms const):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyFontTransforms):
2018-05-04 Chris Nardi <cnardi@chromium.org>
Serialize all URLs with double-quotes per CSSOM spec
https://bugs.webkit.org/show_bug.cgi?id=184935
Reviewed by Antti Koivisto.
According to https://drafts.csswg.org/cssom/#serialize-a-url, all URLs should be serialized as strings,
which means they should have double quotes around the text of the URL. Update our implementation to match
this (and Firefox/Chrome). Also remove isCSSTokenizerURL() as this method is no longer needed.
Tests: Many LayoutTests updated to use double quotes.
* css/CSSMarkup.cpp:
(WebCore::serializeString): Remove FIXME as this was already fixed in a previous patch.
(WebCore::serializeURL): Remove FIXME and update implementation.
2018-05-04 Youenn Fablet <youenn@apple.com>
LayoutTests/fast/mediastream/change-tracks-media-stream-being-played.html is crashing after r231304
https://bugs.webkit.org/show_bug.cgi?id=185303
Reviewed by Eric Carlson.
We need to stop observing the audio track like we do for video track once we are no longer interested in it.
Covered by test no longer crashing.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
2018-05-04 Zalan Bujtas <zalan@apple.com>
[LFC] Set the invalidation root as the result of style change.
https://bugs.webkit.org/show_bug.cgi?id=185301
Reviewed by Antti Koivisto.
Compute/propagate the update type on the ancestor chain and return the invalidation root
so that LayoutContext could use it as the entry point for the next layout frame.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::styleChanged):
* layout/LayoutContext.h: order is not important.
* layout/blockformatting/BlockInvalidation.cpp:
(WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
(WebCore::Layout::computeUpdateType):
(WebCore::Layout::computeUpdateTypeForAncestor):
(WebCore::Layout::BlockInvalidation::invalidate):
* layout/blockformatting/BlockInvalidation.h:
* layout/inlineformatting/InlineInvalidation.cpp:
(WebCore::Layout::InlineInvalidation::invalidate):
* layout/inlineformatting/InlineInvalidation.h:
2018-05-04 Youenn Fablet <youenn@apple.com>
PeerConnection should have its connectionState closed even if doing gathering
https://bugs.webkit.org/show_bug.cgi?id=185267
Reviewed by Darin Adler.
Test: webrtc/addICECandidate-closed.html
In case m_iceConnectionState is closed, m_connectionState should also be set to closed
and RTCPeerConnection should be closed so as to reject any other call.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::close):
(WebCore::RTCPeerConnection::updateConnectionState):
2018-05-04 Yacine Bandou <yacine.bandou_ext@softathome.com>
[MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
https://bugs.webkit.org/show_bug.cgi?id=185242
Reviewed by Xabier Rodriguez-Calvar.
When the sourceBuffer is removed from mediasource, the appropriate stream is not
properly deleted from WebKitMediaSource, because the appsrc and parser elements
of the stream are not removed from the WebKitMediaSource bin.
This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcFreeStream):
2018-05-04 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
https://bugs.webkit.org/show_bug.cgi?id=174730
Reviewed by Michael Catanzaro.
Export ResourceRequestBase::hasHTTPHeaderField().
* platform/network/ResourceRequestBase.h:
2018-05-03 Yusuke Suzuki <utatane.tea@gmail.com>
Use subprocess.call instead of os.system to handle path with spaces
https://bugs.webkit.org/show_bug.cgi?id=185291
Reviewed by Darin Adler.
If gperf path includes spaces, these python scripts fail to execute gperf.
We use subprocess module instead of os.system to invoke gperf.
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* platform/network/create-http-header-name-table:
2018-05-03 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, attempt to fix WinCairo build failure
https://bugs.webkit.org/show_bug.cgi?id=185218
* platform/text/win/LocaleWin.cpp:
(WebCore::LocaleWin::getLocaleInfoString):
2018-05-03 Filip Pizlo <fpizlo@apple.com>
Strings should not be allocated in a gigacage
https://bugs.webkit.org/show_bug.cgi?id=185218
Reviewed by Saam Barati.
No new tests because no new behavior.
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::decodeKey):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readString):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::normalizeSpaces):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
* platform/URLParser.cpp:
(WebCore::percentEncodeByte):
(WebCore::serializeURLEncodedForm):
(WebCore::URLParser::serialize):
* platform/URLParser.h:
* platform/graphics/FourCC.cpp:
(WebCore::FourCC::toString const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ReplicaState::cloneID const):
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::decimalSymbol):
(WebCore::LocaleICU::decimalTextAttribute):
(WebCore::getDateFormatPattern):
(WebCore::LocaleICU::createLabelVector):
(WebCore::getFormatForSkeleton):
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::getFinalPathName):
(WebCore::FileSystem::pathByAppendingComponent):
(WebCore::FileSystem::storageDirectory):
2018-05-02 Brent Fulgham <bfulgham@apple.com>
Widgets should hold a WeakPtr to their parents
https://bugs.webkit.org/show_bug.cgi?id=185239
<rdar://problem/39741250>
Reviewed by Zalan Bujtas.
* platform/ScrollView.h:
(WebCore::ScrollView::weakPtrFactory): Added.
* platform/Widget.cpp:
(WebCore::Widget::init): Don't perform an unnecessary assignment.
(WebCore::Widget::setParent): Grab a WeakPtr to the parent ScrollView.
* platform/Widget.h:
(WebCore::Widget::parent const): Change type to a WeakPtr.
2018-05-03 Yusuke Suzuki <utatane.tea@gmail.com>
Use pointer instead of std::optional<T&>
https://bugs.webkit.org/show_bug.cgi?id=185186
Reviewed by Alex Christensen.
std::optional<T&> is not accepted in C++17 spec.
In this patch, we replace it with T*, which is well-aligned to
WebKit's convention.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::item const):
(WebCore::DatasetDOMStringMap::namedItem const):
(WebCore:: const): Deleted.
* dom/DatasetDOMStringMap.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentHTML):
* dom/Element.h:
* html/canvas/CanvasStyle.cpp:
(WebCore::parseColor):
* inspector/DOMEditor.cpp:
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::getPostData):
(): Deleted.
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupPOST):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::keysForSessionWithID const):
(WebCore::MockCDMInstance::updateLicense):
(WebCore:: const): Deleted.
* testing/MockCDMFactory.h:
2018-05-03 Chris Dumez <cdumez@apple.com>
Stop using an iframe's id as fallback if its name attribute is not set
https://bugs.webkit.org/show_bug.cgi?id=11388
Reviewed by Geoff Garen.
WebKit had logic to use an iframe's id as fallback name when its name
content attribute is not set. This behavior was not standard and did not
match other browsers:
- https://html.spec.whatwg.org/#attr-iframe-name
Gecko / Trident never behaved this way. Blink was aligned with us until
they started to match the specification in:
- https://bugs.chromium.org/p/chromium/issues/detail?id=347169
This WebKit quirk was causing some Web-compatibility issues because it
would affect the behavior of Window's name property getter when trying
to look up an iframe by id. Because of Window's named property getter
behavior [1], we would return the frame's contentWindow instead of the
iframe element itself.
[1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
Test: fast/dom/Window/named-getter-frame-id.html
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::parseAttribute):
(WebCore::HTMLFrameElementBase::didFinishInsertingNode):
* html/HTMLFrameElementBase.h:
2018-05-03 Eric Carlson <eric.carlson@apple.com>
[iOS] Internal text and audio tracks not in fullscreen menu
https://bugs.webkit.org/show_bug.cgi?id=185268
<rdar://problem/38673440>
Reviewed by Jer Noble.
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::setMediaElement): 'addtrack' and 'removetrack'
events are fired at the track lists, not the media element.
2018-05-03 Ryosuke Niwa <rniwa@webkit.org>
Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add
https://bugs.webkit.org/show_bug.cgi?id=185238
Reviewed by Antti Koivisto.
The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document
even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope.
Test: fast/images/imagemap-in-nested-shadow-tree.html
fast/images/imagemap-in-shadow-tree.html
* dom/Document.cpp:
(WebCore::Document::addImageElementByUsemap): Moved to TreeScope.
(WebCore::Document::removeImageElementByUsemap): Ditto.
(WebCore::Document::imageElementByUsemap const): Ditto.
* dom/Document.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName.
(WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap()
which used to call this function with the raw value of the usemap content attribute now calls it
via HTMLImageElement::associatedMapElement(), which uses the parsed usemap.
(WebCore::TreeScope::addImageElementByUsemap): Moved from Document.
(WebCore::TreeScope::removeImageElementByUsemap): Ditto.
(WebCore::TreeScope::imageElementByUsemap const): Ditto.
* dom/TreeScope.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element
if it's connected to a document.
(WebCore::HTMLImageElement::removedFromAncestor):
(WebCore::HTMLImageElement::associatedMapElement const):
* html/HTMLImageElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageMap const):
2018-05-03 Justin Fan <justin_fan@apple.com>
[WebGL] Add runtime flag for enabling ASTC support in WebGL
https://bugs.webkit.org/show_bug.cgi?id=184840
Reviewed by Myles C. Maxfield.
Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGLCompressedTextureASTCSupportEnabled):
(WebCore::RuntimeEnabledFeatures::webGLCompressedTextureASTCSupportEnabled const):
2018-05-03 Chris Nardi <cnardi@chromium.org>
Remove [NoInterfaceObject] from DOMRectList
https://bugs.webkit.org/show_bug.cgi?id=185255
Reviewed by Chris Dumez.
In https://github.com/w3c/fxtf-drafts/issues/233, [NoInterfaceObject] was removed
from DOMRectList. Remove it from our implementation to match the spec, as well as
Chrome and Firefox.
Updated web platform tests IDL test for the Geometry spec.
* dom/DOMRectList.idl:
2018-05-03 Chris Dumez <cdumez@apple.com>
REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
https://bugs.webkit.org/show_bug.cgi?id=185073
<rdar://problem/39821223>
Reviewed by Alexey Proskuryakov.
The following changes were made:
- Make sure SocketStream callbacks are always scheduled on the right runloop:
WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and
main runloop otherwise.
- When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait()
before calling methods on the SocketStream client. Previously, this code path
was specific to Windows but there is no reason to have platform-specific code here.
callOnMainThreadAndWait() calls the function right away if we're already on the main
thread, which will be the case on other platform than Windows.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::callbacksRunLoop):
(WebCore::callbacksRunLoopMode):
(WebCore::SocketStreamHandleImpl::scheduleStreams):
(WebCore::SocketStreamHandleImpl::pacExecutionCallback):
(WebCore::SocketStreamHandleImpl::executePACFileURL):
(WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
(WebCore::SocketStreamHandleImpl::readStreamCallback):
(WebCore::SocketStreamHandleImpl::writeStreamCallback):
(WebCore::SocketStreamHandleImpl::platformClose):
2018-05-03 Zalan Bujtas <zalan@apple.com>
[LFC] Enable multiple layout roots for incremental layout.
https://bugs.webkit.org/show_bug.cgi?id=185185
Reviewed by Antti Koivisto.
With certain type of style changes, we can stop the box invalidation at the formatting context boundary.
When multiple boxes need updating in different formatting contexts, instead of marking the parent containing block chain all
the way up to a common ancestor, we could just work with a list of layout entry points per layout frame.
* layout/FormattingState.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::addLayoutEntryPoint):
* layout/LayoutContext.h:
2018-05-03 Zalan Bujtas <zalan@apple.com>
[LFC] Box invalidation logic should go to dedicated classes.
https://bugs.webkit.org/show_bug.cgi?id=185249
Reviewed by Antti Koivisto.
Each formatting context can initiate a different type of invalidation when
style attribute changes in a box.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::isBlockFormattingState const):
(WebCore::Layout::FormattingState::isInlineFormattingState const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::styleChanged):
(WebCore::Layout::LayoutContext::markNeedsUpdate):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
(WebCore::Layout::BlockInvalidation::invalidate):
* layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
(WebCore::Layout::InlineInvalidation::invalidate):
* layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
2018-05-03 Michael Catanzaro <mcatanzaro@igalia.com>
WebKit should send fake macOS user agent to docs.google.com
https://bugs.webkit.org/show_bug.cgi?id=185165
Reviewed by Carlos Garcia Campos.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::urlRequiresLinuxDesktopPlatform):
2018-05-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231223 and r231288.
https://bugs.webkit.org/show_bug.cgi?id=185256
The change in r231223 breaks internal builds, and r231288 is a
dependent change. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"Use default std::optional if it is provided"
https://bugs.webkit.org/show_bug.cgi?id=185159
https://trac.webkit.org/changeset/231223
"Use pointer instead of
std::optional<std::reference_wrapper<>>"
https://bugs.webkit.org/show_bug.cgi?id=185186
https://trac.webkit.org/changeset/231288
2018-05-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r231253.
The API test added with this change is crashing on the bots.
Reverted changeset:
"Web Inspector: opt out of process swap on navigation if a Web
Inspector frontend is connected"
https://bugs.webkit.org/show_bug.cgi?id=184861
https://trac.webkit.org/changeset/231253
2018-05-03 Youenn Fablet <youenn@apple.com>
A MediaStream being played should allow removing some of its tracks
https://bugs.webkit.org/show_bug.cgi?id=185233
Reviewed by Eric Carlson.
Update the tracks out of the for loop.
Test: fast/mediastream/change-tracks-media-stream-being-played.html
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfType):
2018-05-03 Miguel Gomez <magomez@igalia.com>
WebCore::TextureMapperLayer object used after freed
https://bugs.webkit.org/show_bug.cgi?id=184729
Reviewed by Michael Catanzaro.
Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
inside TextureMapperLayer.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::~TextureMapperLayer):
(WebCore::TextureMapperLayer::setMaskLayer):
(WebCore::TextureMapperLayer::setReplicaLayer):
* platform/graphics/texmap/TextureMapperLayer.h:
2018-05-03 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Add OpenSSL/LibreSSL multi-threading support
https://bugs.webkit.org/show_bug.cgi?id=185138
The older OpenSSL manual says the locking_function and threadid_function should
be set when use it in multi-threading environment. This applies to LibreSSL also.
https://www.openssl.org/docs/man1.0.2/crypto/threads.html
For unix and other similar os, the default threadId_function implementation is
good enough. We'll set custom callback only for Windows OS.
Note it's not required for OpenSSL 1.1.0 and after.
https://www.openssl.org/blog/blog/2017/02/21/threads/
Reviewed by Per Arne Vollan.
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
(WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
(WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
* platform/network/curl/CurlSSLHandle.h:
(WebCore::CurlSSLHandle::ThreadSupport::setup):
(WebCore::CurlSSLHandle::ThreadSupport::singleton):
(WebCore::CurlSSLHandle::ThreadSupport::lock):
(WebCore::CurlSSLHandle::ThreadSupport::unlock):
2018-05-02 Ryosuke Niwa <rniwa@webkit.org>
Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
https://bugs.webkit.org/show_bug.cgi?id=185227
Reviewed by Chris Dumez.
Removed the check. The attribute value string can never be null.
* dom/Element.cpp:
(WebCore::Element::removeAttributeInternal):
2018-05-02 Zalan Bujtas <zalan@apple.com>
[LFC] Implement LayoutContext::createDisplayBox
https://bugs.webkit.org/show_bug.cgi?id=185158
Reviewed by Antti Koivisto.
Now compute*() functions take both the const layout and the corresponding non-const display boxes.
Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
(This might need to change in the future if we decide to arrange them in some sort of painting order)
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::computePosition):
* layout/FloatingContext.h:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeStaticPosition const):
(WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createDisplayBox):
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::parent const): Deleted.
(WebCore::Display::Box::nextSibling const): Deleted.
(WebCore::Display::Box::previousSibling const): Deleted.
(WebCore::Display::Box::firstChild const): Deleted.
(WebCore::Display::Box::lastChild const): Deleted.
(WebCore::Display::Box::setParent): Deleted.
(WebCore::Display::Box::setNextSibling): Deleted.
(WebCore::Display::Box::setPreviousSibling): Deleted.
(WebCore::Display::Box::setFirstChild): Deleted.
(WebCore::Display::Box::setLastChild): Deleted.
(): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
(WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-05-02 Said Abou-Hallawa <sabouhallawa@apple.com>
Hiding then showing an <object> of type image makes the underlaying image disappear
https://bugs.webkit.org/show_bug.cgi?id=185216
<rdar://problem/39055630>
Reviewed by Youenn Fablet.
Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
RenderImage with the CachedImage of its ImageLoader when the RenderImage
is recreated.
Test: fast/images/object-image-hide-show.html
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAttachRenderers):
This is very similar to what we do in HTMLImageElement::didAttachRenderers().
2018-05-02 Brent Fulgham <bfulgham@apple.com>
Use RetainPtr for form input type
https://bugs.webkit.org/show_bug.cgi?id=185210
<rdar://problem/39734040>
Reviewed by Ryosuke Niwa.
Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
Test: fast/forms/access-key-mutation-2.html.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
(WebCore::HTMLInputElement::accessKeyAction):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::appendFormData):
* html/HTMLInputElement.h:
* html/InputType.cpp:
(WebCore::createInputType):
(WebCore::InputType::create):
(WebCore::InputType::createText):
* html/InputType.h:
2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
Use pointer instead of std::optional<std::reference_wrapper<>>
https://bugs.webkit.org/show_bug.cgi?id=185186
Reviewed by Alex Christensen.
std::optional<T&> is not accepted in C++17 spec. So we replaced it
with std::optional<std::reference_wrapper<T>>.
In this patch, we replace it with T*, which is well-aligned to
WebKit's convention.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::item const):
(WebCore::DatasetDOMStringMap::namedItem const):
* dom/DatasetDOMStringMap.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentHTML):
* dom/Element.h:
* html/canvas/CanvasStyle.cpp:
(WebCore::parseColor):
* inspector/DOMEditor.cpp:
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::getPostData):
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupPOST):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::keysForSessionWithID const):
(WebCore::MockCDMInstance::updateLicense):
* testing/MockCDMFactory.h:
2018-05-02 Keith Rollin <krollin@apple.com>
Add facility for tracking times and results of page and resource loading
https://bugs.webkit.org/show_bug.cgi?id=184838
<rdar://problem/36548974>
Reviewed by Brent Fulgham.
Update FrameProgressTracker to send the necessary page load start/stop
signals so that we can track the entire page load at a network level.
Add an empty override of the pure virtual
LoaderStrategy::pageLoadCompleted method.
No new tests. There is no testable effect from these changes. On
Cocoa, measurable changes take place in another (non-WebKit) process.
On non-Cocoa systems, this facility is currently disabled.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
* loader/LoaderStrategy.h:
2018-05-02 Aditya Keerthi <akeerthi@apple.com>
Can't copy and paste URLs that have no title into Mail (macOS)
https://bugs.webkit.org/show_bug.cgi?id=185205
<rdar://problem/36352406>
Reviewed by Tim Horton.
The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
To fix the error, we check whether the title is empty and instead save the lastPathComponent to the pasteboard. This matches current behavior as the fallback title.
Augmented WebKitLegacy.ContextMenuCanCopyURL test
* platform/mac/PasteboardMac.mm:
(WebCore::writeURLForTypes):
2018-05-01 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
https://bugs.webkit.org/show_bug.cgi?id=182188
<rdar://problem/36689240>
Reviewed by Antti Koivisto.
Fixed the crash by removing up the release assert.
The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.
There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.
This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
and there is no evidence that r225868 has led to new UAFs even after five months.
No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.
* dom/Document.cpp:
(WebCore::Document::removeSVGUseElement):
2018-05-02 Dirk Schulze <dschulze@chromium.org>
getCharNumAtPosition should take DOMPointInit as argument
https://bugs.webkit.org/show_bug.cgi?id=184695
Reviewed by Antti Koivisto.
Extend existing tests for getCharNumAtPosition.
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::getCharNumAtPosition):
* svg/SVGTextContentElement.h:
* svg/SVGTextContentElement.idl: Use DOMPointInit argument.
2018-05-02 Youenn Fablet <youenn@apple.com>
Use NetworkLoadChecker for navigation loads
https://bugs.webkit.org/show_bug.cgi?id=184892
<rdar://problem/39652686>
Reviewed by Chris Dumez.
Sanitize headers according response tainting.
If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
If tainting is Opaque, we filter all uncommon headers.
If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
Covered by updated test.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:
2018-05-02 Myles C. Maxfield <mmaxfield@apple.com>
Collection fragment identifiers don't use PostScript names
https://bugs.webkit.org/show_bug.cgi?id=184624
<rdar://problem/39432089>
Reviewed by Simon Fraser.
In a previous version of the CSS Fonts spec, there was text saying that items in font collections
should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
inserting an item into the middle of a collection would throw off all content that uses the file.
Instead, the spec has since changed to use PostScript names (so the content instead would say
MyFonts.ttc#MyFont-Regular).
Test: fast/text/font-collection.html
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateItemInCollection const):
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createCustomFontData):
(WebCore::CachedFont::calculateIndex const): Deleted.
* loader/cache/CachedFont.h:
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:
2018-05-02 Brian Burg <bburg@apple.com>
Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
https://bugs.webkit.org/show_bug.cgi?id=184861
<rdar://problem/39153768>
Reviewed by Ryosuke Niwa.
Notify the client of the current connection count whenever a frontend connects or disconnects.
Covered by new API test.
* inspector/InspectorClient.h:
(WebCore::InspectorClient::frontendCountChanged):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
* inspector/InspectorController.h:
2018-05-02 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
https://bugs.webkit.org/show_bug.cgi?id=185207
Reviewed by Michael Catanzaro.
Remove unneeded include of gstgldisplay_wayland.h
No new tests, no change in behaviour.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2018-05-02 Chris Dumez <cdumez@apple.com>
document.open() event listener removal is not immediate
https://bugs.webkit.org/show_bug.cgi?id=185191
Reviewed by Darin Adler.
We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
whenever they get removed from the EventListenerMap. We were doing so correctly
in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
updates clear() accordingly.
The reason we need to set this flag is that RegisteredEventListeners is RefCounted
and EventTarget::fireEventListeners() may be currently running and calling
each listener one by one, holding a reference to all listener of a given event.
Test: fast/dom/Document/document-open-removes-all-listeners.html
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
2018-05-02 Zalan Bujtas <zalan@apple.com>
Use WeakPtr in GridCell
https://bugs.webkit.org/show_bug.cgi?id=185180
<rdar://problem/39432165>
Reviewed by Antti Koivisto.
Since GridCell does not own the renderers, it should
construct weak pointers.
Unable to create a reliably reproducible test case.
* rendering/Grid.cpp:
(WebCore::Grid::insert):
(WebCore::GridIterator::nextGridItem):
* rendering/Grid.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::firstLineBaseline const):
2018-05-02 Eric Carlson <eric.carlson@apple.com>
[iOS] Provide audio route information when invoking AirPlay picker
https://bugs.webkit.org/show_bug.cgi?id=185199
<rdar://problem/39853103>
Reviewed by Jer Noble.
No new tests, this requires a specific hardware setup.
* dom/Document.cpp:
(WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::showPlaybackTargetPicker): Ditto.
* page/Page.h:
* platform/audio/AudioSession.cpp:
(WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
(WebCore::routingContextUID const): Ditto.
* platform/audio/AudioSession.h:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
(WebCore::AudioSession::routingContextUID const): Return the route context UID.
2018-05-02 Dean Jackson <dino@apple.com>
Draw SystemPreview badge to specification on iOS
https://bugs.webkit.org/show_bug.cgi?id=185203
<rdar://problem/39908855>
Reviewed by Tim Horton.
Use CoreImage to render a badge with a blurred background,
at particular sizes.
This will be tested internally while we're getting artwork
from WebKitAdditions.
* Configurations/WebCore.xcconfig: Link against CoreImage.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
in the iOS platform RenderTheme that draws the system preview.
2018-05-01 Brent Fulgham <bfulgham@apple.com>
Prevent Debug ASSERT when changing forms
https://bugs.webkit.org/show_bug.cgi?id=185173
<rdar://problem/39738669>
Reviewed by Ryosuke Niwa.
Form submission could trigger a debug assertion during validation when
a form is changed during an input submission. Fix this by cleaning up
the event handling logic and make it more consistent with modern WebKit
coding style.
Test: fast/forms/form-submission-crash-3.html
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
attempting to perform event handling.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::reportValidity): Ditto.
(WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
since we expect this to happen earlier in the layout pass. Add an assertion that the
tree is not dirty.
* html/ImageInputType.cpp:
(WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
attempting to perform event handling.
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.
2018-05-02 Jer Noble <jer.noble@apple.com>
Unreviewed; address review comments made before landing r231231.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::volume const):
2018-05-02 Jer Noble <jer.noble@apple.com>
Pipe volume through PlaybackSessionManager/Proxy.
https://bugs.webkit.org/show_bug.cgi?id=185182
Reviewed by Eric Carlson.
Add support for the volume property to PlaybackSessionModel, and all its clients.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::volumeChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::setVolume):
(WebCore::PlaybackSessionModelMediaElement::volume const):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController volume]):
(-[WebAVPlayerController setVolume:]):
(-[WebAVPlayerController volumeChanged:]):
(-[WebAVPlayerController resetMediaState]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::volumeChanged):
(VideoFullscreenControllerContext::volume const):
(VideoFullscreenControllerContext::setVolume):
2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, fix build in WinCairo
https://bugs.webkit.org/show_bug.cgi?id=185169
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::instantiateStreaming):
* bindings/js/JSDOMWindowBase.h:
2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
Use default std::optional if it is provided
https://bugs.webkit.org/show_bug.cgi?id=185159
Reviewed by JF Bastien.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::item const):
(WebCore::DatasetDOMStringMap::namedItem const):
(WebCore:: const): Deleted.
* dom/DatasetDOMStringMap.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentHTML):
* dom/Element.h:
* inspector/DOMEditor.cpp:
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::getPostData):
(): Deleted.
* platform/network/curl/CurlFormDataStream.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::keysForSessionWithID const):
(WebCore::MockCDMInstance::updateLicense):
(WebCore:: const): Deleted.
* testing/MockCDMFactory.h:
2018-05-01 Chris Dumez <cdumez@apple.com>
Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
https://bugs.webkit.org/show_bug.cgi?id=185181
Reviewed by Geoffrey Garen.
Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
the UIthread instead of the WebThread on iOS WebKitLegacy.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::scheduleStreams):
(WebCore::SocketStreamHandleImpl::readStreamCallback):
2018-05-01 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h
* page/RuntimeEnabledFeatures.h:
2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com>
Fix build error after r231194
https://bugs.webkit.org/show_bug.cgi?id=185169
Reviewed by JF Bastien.
Prevent compile error in iOS Simulator debug build
by tagging function
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):
2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com>
WebAssembly: add support for stream APIs - JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=183442
Reviewed by Yusuke Suzuki and JF Bastien.
Add WebAssembly streaming API to WebCore.
* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::tryAllocate):
(WebCore::isResponseCorrect):
(WebCore::handleResponseOnStreamingAction):
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSRemoteDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
2018-04-30 Myles C. Maxfield <mmaxfield@apple.com>
Improve the performance of FontCascadeDescription's effectiveFamilies
https://bugs.webkit.org/show_bug.cgi?id=184720
<rdar://problem/38970927>
Reviewed by Simon Fraser.
The page that had the performance problem renders many different Chinese characters in system-ui
with only a small number of individual fonts. It turns out we were calling into the system-ui
machinery for each character in order to opportunistically start loading data URLs (see also:
https://bugs.webkit.org/show_bug.cgi?id=175845). These data URLS will never represent the system
font, so we don't need to invoke the system-ui machinery at all.
This patch makes a 92x performance improvement on the associated performance test. This test is
designed to test Chinese text rendered with system-ui.
Performance test: Layout/system-ui.html
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::opportunisticallyStartFontDataURLLoading):
2018-04-30 Jer Noble <jer.noble@apple.com>
<img src=mp4> does not display on ios despite Accept: video/* advertisement
https://bugs.webkit.org/show_bug.cgi?id=185029
<rdar://problem/39771989>
Reviewed by Eric Carlson.
Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
even if the resource request is successfully fulfilled prior to the return. Always return YES in
the case that loading succeeded.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2018-04-30 Zalan Bujtas <zalan@apple.com>
REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
https://bugs.webkit.org/show_bug.cgi?id=185142
<rdar://problem/39821446>
Reviewed by Simon Fraser.
Set the overflow rect on the inline textbox when needed.
Test: fast/text/simple-line-layout-selection-with-overflow.html
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::initializeInlineTextBox):
(WebCore::SimpleLineLayout::generateLineBoxTree):
(WebCore::SimpleLineLayout::initializeInlineBox): Deleted.
2018-04-30 JF Bastien <jfbastien@apple.com>
Use some C++17 features
https://bugs.webkit.org/show_bug.cgi?id=185135
Reviewed by Alex Christensen.
As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):
- New auto rules for direct-list-initialization
- static_assert with no message
- typename in a template template parameter
- Nested namespace definition
- Attributes for namespaces and enumerators
- u8 character literals
- Allow constant evaluation for all non-type template arguments
- Fold Expressions
- Unary fold expressions and empty parameter packs
- __has_include in preprocessor conditional
- Differing begin and end types in range-based for
- Improving std::pair and std::tuple
Consult the Tony Tables [3] to see before / after examples.
Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).
[0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
[1]: https://trac.webkit.org/changeset/231152/webkit
[2]: https://en.cppreference.com/w/cpp/compiler_support
[3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
* DerivedSources.make:
* platform/URLParser.cpp: work around an odd GCC 6 bug with class
static value as a template parameter.
(WebCore::URLParser::percentDecode):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::hasForbiddenHostCodePoint):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:
2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
https://bugs.webkit.org/show_bug.cgi?id=185132
<rdar://problem/39834562>
Reviewed by Tim Horton.
Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
`shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.
Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
(WebCore::operator<<):
* dom/ViewportArguments.h:
Removes the `minDeviceWidth` viewport argument.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.
Removes the runtime switch for `min-device-width`.
* page/ViewportConfiguration.cpp:
(WebCore::platformDeviceWidthOverride):
Hard-code the override device width in extra zoom mode.
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
device width is less than the override device width.
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):
Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
device width is greater than the override device width.
(WebCore::computedMinDeviceWidth): Deleted.
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
* page/ViewportConfiguration.h:
2018-04-30 Chris Nardi <cnardi@chromium.org>
Serialize font-variation-settings with double-quotes per spec
https://bugs.webkit.org/show_bug.cgi?id=182542
Reviewed by Myles C. Maxfield.
According to the CSSOM spec [1], all strings should be serialized with double-quotes.
The axis name in font-variation-settings was previously serialized with single-quotes;
change this to double-quotes to match the spec and non-WebKit browsers.
[1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
Updated fast/text/variations/getComputedStyle.html to test the change.
* css/CSSFontVariationValue.cpp:
(WebCore::CSSFontVariationValue::customCSSText const):
2018-04-30 Chris Dumez <cdumez@apple.com>
Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
https://bugs.webkit.org/show_bug.cgi?id=185134
Reviewed by Geoffrey Garen.
Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
the WebThread.
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
2018-04-30 Simon Fraser <simon.fraser@apple.com>
Make color-filter affect caret-color
https://bugs.webkit.org/show_bug.cgi?id=185129
rdar://problem/39829066
Reviewed by Tim Horton.
Transform the colors used to compare the caret color with the background through
color-filter (since we want contrasting colors after filters are applied), and
transform caret-color itself.
Test: css3/color-filters/color-filter-caret-color.html
* editing/FrameSelection.cpp:
(WebCore::CaretBase::paintCaret const):
2018-04-30 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Webkit should spoof as Safari on a Mac when on Chase.com
https://bugs.webkit.org/show_bug.cgi?id=185103
Reviewed by Carlos Garcia Campos.
Send a fake user agent to chase.com to make it work.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.
2018-04-29 Simon Fraser <simon.fraser@apple.com>
Make color-filter affect <attachment>
https://bugs.webkit.org/show_bug.cgi?id=185122
rdar://problem/39818763
Reviewed by Tim Horton.
Convert the colors used to render <attachment> through color-filter, except
for those parts that render over the icon (like the progress bar).
Not easily testable.
* rendering/RenderThemeMac.mm:
(WebCore::titleTextColorForAttachment):
(WebCore::AttachmentLayout::layOutTitle):
(WebCore::AttachmentLayout::layOutSubtitle):
(WebCore::paintAttachmentIconBackground):
(WebCore::paintAttachmentTitleBackground):
(WebCore::paintAttachmentPlaceholderBorder):
2018-04-28 Simon Fraser <simon.fraser@apple.com>
Fix color-filter to apply to SVG colors
https://bugs.webkit.org/show_bug.cgi?id=185113
rdar://problem/39665082
Reviewed by Dean Jackson.
Convert SVG colors through color-filter operations for the places in SVG
that use color, namely fill and stroke, gradients, lighting colors and
drop-shadow.
Test: css3/color-filters/svg/color-filter-inline-svg.html
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceLinearGradient.cpp:
(WebCore::RenderSVGResourceLinearGradient::buildGradient const):
* rendering/svg/RenderSVGResourceLinearGradient.h:
* rendering/svg/RenderSVGResourceRadialGradient.cpp:
(WebCore::RenderSVGResourceRadialGradient::buildGradient const):
* rendering/svg/RenderSVGResourceRadialGradient.h:
* rendering/svg/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::applyResource):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
(WebCore::SVGFESpecularLightingElement::build):
2018-04-29 Michael Catanzaro <mcatanzaro@igalia.com>
[CMake] Require GCC 6
https://bugs.webkit.org/show_bug.cgi?id=184985
Reviewed by Alex Christensen.
Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.
* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):
2018-04-29 Zalan Bujtas <zalan@apple.com>
[LFC] Implement Display::Box functions
https://bugs.webkit.org/show_bug.cgi?id=185116
Reviewed by Antti Koivisto.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::~Box):
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rect const):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::left const):
(WebCore::Display::Box::bottom const):
(WebCore::Display::Box::right const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::bottomRight const):
(WebCore::Display::Box::size const):
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::parent const):
(WebCore::Display::Box::nextSibling const):
(WebCore::Display::Box::previousSibling const):
(WebCore::Display::Box::firstChild const):
(WebCore::Display::Box::lastChild const):
(WebCore::Display::Box::setRect):
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::setSize):
(WebCore::Display::Box::setWidth):
(WebCore::Display::Box::setHeight):
(WebCore::Display::Box::setMarginTop):
(WebCore::Display::Box::setMarginLeft):
(WebCore::Display::Box::setMarginBottom):
(WebCore::Display::Box::setMarginRight):
(WebCore::Display::Box::setBorderTop):
(WebCore::Display::Box::setBorderLeft):
(WebCore::Display::Box::setBorderBottom):
(WebCore::Display::Box::setBorderRight):
(WebCore::Display::Box::setPaddingTop):
(WebCore::Display::Box::setPaddingLeft):
(WebCore::Display::Box::setPaddingBottom):
(WebCore::Display::Box::setPaddingRight):
(WebCore::Display::Box::setParent):
(WebCore::Display::Box::setNextSibling):
(WebCore::Display::Box::setPreviousSibling):
(WebCore::Display::Box::setFirstChild):
(WebCore::Display::Box::setLastChild):
2018-04-29 Youenn Fablet <youenn@apple.com>
Make RestrictedHTTPResponseAccess flag true by default
https://bugs.webkit.org/show_bug.cgi?id=185089
Reviewed by Geoffrey Garen.
* page/RuntimeEnabledFeatures.h:
2018-04-28 Sihui Liu <sihui_liu@apple.com>
[Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
https://bugs.webkit.org/show_bug.cgi?id=185052
Reviewed by Geoffrey Garen.
Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could
create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
its equal function.
Modified API test: WebKit.WKHTTPCookieStoreHttpOnly
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
(WebCore::Cookie::operator== const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookie):
2018-04-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add LayoutTreeBuilder class to generate the layout tree
https://bugs.webkit.org/show_bug.cgi?id=185108
Reviewed by Antti Koivisto.
This is for testing purposes.
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::~FormattingState):
* layout/FormattingState.h:
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::~BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::~InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp: Added.
(WebCore::Layout::TreeBuilder::createLayoutTree):
(WebCore::Layout::TreeBuilder::createSubTree):
(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::TreeBuilder::showLayoutTree):
(WebCore::Layout::printLayoutTreeForLiveDocuments):
* layout/layouttree/LayoutTreeBuilder.h: Copied from Source/WebCore/layout/layouttree/LayoutBlockContainer.h.
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
2018-04-28 Zalan Bujtas <zalan@apple.com>
[LFC] Implement BlockMarginCollapse functions.
https://bugs.webkit.org/show_bug.cgi?id=185036
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::marginValue):
(WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse):
(WebCore::Layout::BlockMarginCollapse::marginTop const):
(WebCore::Layout::BlockMarginCollapse::marginBottom const):
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const):
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const):
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const):
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const):
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const):
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const):
(WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const):
(WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const):
(WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const):
* layout/blockformatting/BlockMarginCollapse.h:
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::style const):
2018-04-27 David Kilzer <ddkilzer@apple.com>
Add logging when SpringBoard enables WebThread
<https://webkit.org/b/185100>
<rdar://problem/39746542>
Reviewed by Daniel Bates.
* platform/RuntimeApplicationChecks.h:
(WebCore::IOSApplication::isSpringBoard): Add declaration.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSpringBoard): Add implementation.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
SpringBoard.
2018-04-27 Keith Rollin <krollin@apple.com>
Fix crash in DocumentLoader::startLoadingMainResource
https://bugs.webkit.org/show_bug.cgi?id=185088
rdar://problem/39689263
Reviewed by Chris Dumez.
Add a "protectedThis" to address a case where a deleted "this" was
accessed in a RELEASE_LOG statement.
No new tests -- covered by existing tests, which now pass.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
2018-04-27 Simon Fraser <simon.fraser@apple.com>
Implement color-filter for text stroke
https://bugs.webkit.org/show_bug.cgi?id=185098
Reviewed by Alan Bujtas.
Transform the text stroke color through color-filter.
Test: css3/color-filters/color-filter-text-stroke.html
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
2018-04-27 Simon Fraser <simon.fraser@apple.com>
Implement animation for color-filter
https://bugs.webkit.org/show_bug.cgi?id=185092
rdar://problem/39773810
Reviewed by Tim Horton.
Implement animation of color-filter.
This requires tracking whether the color-filter function lists match for both old and new
animation code paths.
The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
which has to pass the propertyID to the blend function so we know which "lists match" to check.
This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.
Test: css3/color-filters/color-filter-animation.html
* animation/CSSPropertyBlendingClient.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
* animation/KeyframeEffectReadOnly.h:
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::reset):
(WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/KeyframeAnimation.h:
2018-04-27 Zalan Bujtas <zalan@apple.com>
[LFC] Add FormattingContext::computeWidth/computeHeight logic.
https://bugs.webkit.org/show_bug.cgi?id=185091
Reviewed by Antti Koivisto.
Inflow width and height can't really be computed without knowing the exact context.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
(WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-04-27 Chris Dumez <cdumez@apple.com>
Use WindowProxy instead of DOMWindow in our IDL
https://bugs.webkit.org/show_bug.cgi?id=185022
Reviewed by Sam Weinig.
Stop using DOMWindow in all of our IDL files and use WindowProxy as
per their respective specifications. As a result, the implementation
as also updated to use WindowProxy type instead of DOMWindow.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMConvertWindowProxy.h: Removed.
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::windowProxy const):
(WebCore::JSWindowProxy::toWrapped):
* bindings/js/JSWindowProxy.h:
(WebCore::window):
Use static_cast<>() instead of jsCast<>() because jsCast<>()
relies on classInfo() which is not allowed to be called during
JS sweep due to an assertion inside classInfo(). The JSWindowProxy
objects are held strongly by the WindowProxy so we know the JSWindowProxy
object is not getting destroyed here.
(WebCore::toJS):
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::globalObject):
* bindings/js/WindowProxy.h:
(WebCore::WindowProxy::frame const):
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
(ComputeIsCallbackInterface):
(ComputeIsCallbackFunction):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GetBaseIDLType):
(NativeToJSValueDOMConvertNeedsState):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
* bindings/scripts/test/TestObj.idl:
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::CompositionEvent):
(WebCore::CompositionEvent::initCompositionEvent):
* dom/CompositionEvent.h:
* dom/CompositionEvent.idl:
* dom/Document.cpp:
(WebCore::Document::defaultView const):
* dom/Document.h:
* dom/Document.idl:
* dom/DocumentTouch.cpp:
(WebCore::DocumentTouch::createTouch):
* dom/DocumentTouch.h:
* dom/DocumentTouch.idl:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::FocusEvent):
* dom/FocusEvent.h:
* dom/InputEvent.cpp:
(WebCore::InputEvent::create):
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::create):
(WebCore::KeyboardEvent::initKeyboardEvent):
(WebCore::KeyboardEvent::charCode const):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::initMouseEvent):
(WebCore::MouseEvent::initMouseEventQuirk):
* dom/MouseEvent.h:
* dom/MouseEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
(WebCore::MouseRelatedEvent::init):
(WebCore::MouseRelatedEvent::frameViewFromWindowProxy):
(WebCore::MouseRelatedEvent::initCoordinates):
(WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor const):
(WebCore::MouseRelatedEvent::computePageLocation):
(WebCore::MouseRelatedEvent::locationInRootViewCoordinates const):
* dom/MouseRelatedEvent.h:
* dom/Node.cpp:
* dom/SimulatedClick.cpp:
* dom/TextEvent.cpp:
(WebCore::TextEvent::create):
(WebCore::TextEvent::createForPlainTextPaste):
(WebCore::TextEvent::createForFragmentPaste):
(WebCore::TextEvent::createForDrop):
(WebCore::TextEvent::createForDictation):
(WebCore::TextEvent::TextEvent):
(WebCore::TextEvent::initTextEvent):
* dom/TextEvent.h:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
(WebCore::UIEvent::initUIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create):
(WebCore::UIEvent::view const):
* dom/UIEvent.idl:
* dom/UIEventInit.h:
* dom/UIEventInit.idl:
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::create):
(WebCore::WheelEvent::initWebKitWheelEvent):
* dom/WheelEvent.h:
* dom/WheelEvent.idl:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::insertDictatedText):
* editing/Editor.cpp:
(WebCore::Editor::pasteAsPlainText):
(WebCore::Editor::pasteAsFragment):
(WebCore::Editor::setComposition):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::namedItem):
* html/HTMLDocument.h:
* html/HTMLDocument.idl:
* html/HTMLFrameElement.idl:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::contentWindow const):
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::namedItem):
* html/HTMLFrameSetElement.h:
* html/HTMLFrameSetElement.idl:
* html/HTMLIFrameElement.idl:
* html/ImageDocument.cpp:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer):
(WebCore::PostMessageTimer::event):
(WebCore::DOMWindow::postMessage):
* page/DragController.cpp:
(WebCore::DragController::dispatchTextInputEventFor):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleTextInputEvent):
2018-04-27 Nan Wang <n_wang@apple.com>
AX: Accessibility needs to know which part of the content view is visible on iOS
https://bugs.webkit.org/show_bug.cgi?id=185085
<rdar://problem/39801363>
Reviewed by Chris Fleizach.
Exposed unobscuredContentRect() to iOS accessibility object wrapper.
Test: accessibility/ios-simulator/unobscured-content-rect.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
2018-04-27 Simon Fraser <simon.fraser@apple.com>
Refactor filter list checking code
https://bugs.webkit.org/show_bug.cgi?id=185087
Reviewed by Alan Bujtas.
Deduplicate code between filter and backdrop-filter for checking whether function lists
match, by making a shared function that takes a std::function.
The call sites have to declare the return type (-> const FilterOperations&) to avoid std::function
converting the return type into a value.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists const):
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
* animation/KeyframeEffectReadOnly.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists const):
(WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists):
* page/animation/KeyframeAnimation.h:
2018-04-27 Chris Dumez <cdumez@apple.com>
Regression(r222392?): Events can have a negative timestamp which causes app breakage
https://bugs.webkit.org/show_bug.cgi?id=185040
<rdar://problem/39638051>
Reviewed by Wenson Hsieh.
The real fix is in UIKit when generating the touch timestamps. However, this patch
does some hardening to make sure that Event.timestamp can never return a negative
value even if something goes wrong.
* dom/Event.cpp:
(WebCore::Event::timeStampForBindings const):
2018-04-27 Christopher Reid <chris.reid@sony.com>
URL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
https://bugs.webkit.org/show_bug.cgi?id=184836
Reviewed by Alex Christensen.
Update URL::appendEncodedHostName to use uidna_nameToASCII as done in r208902.
Test: LayoutTests\fast\url\url-hostname-encoding.html
* platform/URL.cpp:
2018-04-27 Youenn Fablet <youenn@apple.com>
CachedRawResource is not handling incremental data computation correctly
https://bugs.webkit.org/show_bug.cgi?id=184936
<rdar://problem/38798141>
Reviewed by Darin Adler.
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer): Fixing style.
2018-04-27 Zalan Bujtas <zalan@apple.com>
[LFC] Implement BlockFormattingContext::layout logic and its dependencies
https://bugs.webkit.org/show_bug.cgi?id=185024
Reviewed by Antti Koivisto.
This patch implements the logic for block formatting context according to
https://www.w3.org/TR/CSS22/visuren.html#block-formatting
1. Traverse the tree iteratively (in post-order fashion) and compute the width/static position for the containers as
we visit the descendant nodes until we hit a leaf node.
2. Compute the position/geometry of the leaf node and move over to its sibling(s).
3. Finalize the container's height/final position as we climb back on the tree.
4. Run layout on the out-of-flow descendants.
Note that subtrees with a formatting context root need to be laid out completely before moving on to the next box.
The formatting root box is laid out in the formatting context it lives in, however its descendants get laid out
in a separate formatting context (excluding out-of-flow boxes that don't belong to the root).
* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::computePosition):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layout): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::layout): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-04-27 Youenn Fablet <youenn@apple.com>
Use NetworkLoadChecker for XHR/fetch loads
https://bugs.webkit.org/show_bug.cgi?id=184741
Reviewed by Chris Dumez.
Covered by existing tests.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
We need to set this option for CORS done in NetworkProcess.
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
Set httpHeadersTokeep when needed (service worker or CORS loads).
Remove the synchronous disabling of preflight since this is now also done for asynchronous loads.
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
Helper routine to make the same check for both simple and preflight case.
This allows more consistent error logging between WK1 and WK2.
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
Skip preflight in case this is done in NetworkProcess.
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
(WebCore::isResponseComingFromNetworkProcess):
(WebCore::DocumentThreadableLoader::redirectReceived):
Bypass security checks when they are already done in NetworkProcess.
(WebCore::DocumentThreadableLoader::didFail):
In case of AccessControl error, it might be due to a CSP check done in NetworkProcess.
Check it again to enable specific CSP console logging and error reporting.
(WebCore::DocumentThreadableLoader::loadRequest):
Recreating the error in case of synchronous loads to be able to log it adequately.
(WebCore::DocumentThreadableLoader::isDoingSecurityChecksInNetworkProcess const):
* loader/DocumentThreadableLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
Specific handling of SameOrigin credential mode for which cross-origin load will not use any credential.
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
We keep the application headers so that DocumentThreadableLoader does not have to restart a brand new load.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
DocumentThreadableLoader is setting referrer and origin directly. Until we fix that, we remove them from the original requests
as applications are not supposed to set these headers.
2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
Add an experimental feature flag for viewport "min-device-width"
https://bugs.webkit.org/show_bug.cgi?id=185050
<rdar://problem/39624038>
Reviewed by Tim Horton.
Add MinDeviceWidthEnabled as a new runtime-enabled feature.
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
Gate the parsing of "min-device-width" on the runtime-enabled feature being flipped on.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled):
(WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const):
2018-04-27 Simon Fraser <simon.fraser@apple.com>
Make color-filter transform gradient colors
https://bugs.webkit.org/show_bug.cgi?id=185080
Reviewed by Zalan Bujtas.
In CSSGradientValue::computeStops(), transform the color of each gradient color
stop through the color filter. Having a color filter makes the gradient uncacheable.
Color filters can add alpha, so we also have to fix up CSSGradientValue::knownToBeOpaque()
to take a RenderStyle and convert the colors before testing opaqueness. Clean up some related
functions to take const RenderStyle&.
Test: css3/color-filters/color-filter-gradients.html
* css/CSSCrossfadeValue.cpp:
(WebCore::subimageKnownToBeOpaque):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::knownToBeOpaque const):
* css/CSSFilterImageValue.h:
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::computeStops):
(WebCore::CSSGradientValue::knownToBeOpaque const):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
* css/CSSGradientValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::knownToBeOpaque const):
* css/CSSImageValue.h:
2018-04-26 Simon Fraser <simon.fraser@apple.com>
Fix color-filter to apply to text decorations
https://bugs.webkit.org/show_bug.cgi?id=185068
<rdar://problem/39782136>
Reviewed by Alan Bujtas.
Transform the colors of text shadows, and the shadows of text-decorations through
the color-filter.
Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
(which would have awkward ownership implications) we pass the color filters through
and just map the color through it before painting.
Re-order the members of TextPainter a little to optimize padding.
Also fix a bug where FilterOperations::transformColor() could transform an invalid
color to a valid one; we never want this.
Tests: css3/color-filters/color-filter-text-decoration-shadow.html
css3/color-filters/color-filter-text-shadow.html
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextDecorationPainter.h:
(WebCore::TextDecorationPainter::setTextShadow):
(WebCore::TextDecorationPainter::setShadowColorFilter):
(WebCore::TextDecorationPainter::addTextShadow): Deleted.
* rendering/TextPainter.cpp:
(WebCore::ShadowApplier::ShadowApplier):
(WebCore::TextPainter::paintTextWithShadows):
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
on the first iteration.
(WebCore::TextPainter::paintRange):
* rendering/TextPainter.h:
(WebCore::TextPainter::setShadowColorFilter):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintTextWithShadows):
2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
Rename minimumLayoutSize to viewLayoutSize
https://bugs.webkit.org/show_bug.cgi?id=185050
<rdar://problem/39624038>
Reviewed by Tim Horton.
See WebKit/ChangeLog for more information. No change in behavior.
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setViewLayoutSize):
Remove a FIXME comment that is addressed by this refactoring.
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
(WebCore::ViewportConfiguration::initialScaleFromSize const):
(WebCore::ViewportConfiguration::minimumScale const):
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):
(WebCore::ViewportConfiguration::setMinimumLayoutSize): Deleted.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::viewLayoutSize const):
(WebCore::ViewportConfiguration::viewSize const): Deleted.
2018-04-27 Zalan Bujtas <zalan@apple.com>
[LFC] Formatting contexts should create floating states.
https://bugs.webkit.org/show_bug.cgi?id=185032
Reviewed by Antti Koivisto.
This patch implements the logic for sharing floating states across multiple formatting contexts.
At this point this is mostly about inline formatting contexts. They either create a new floating state
or inherit it from the parent formatting context.
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::create):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::layoutContext const):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::floatingState const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::formattingStateForBox const):
(WebCore::Layout::LayoutContext::establishedFormattingState):
(WebCore::Layout::LayoutContext::formattingContext):
(WebCore::Layout::LayoutContext::formattingState): Deleted.
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::createFormattingState const):
(WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const):
(WebCore::Layout::BlockFormattingContext::formattingState const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::createFormattingState const):
(WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const):
(WebCore::Layout::InlineFormattingContext::formattingState const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::formattingContextRoot const):
* layout/layouttree/LayoutBox.h:
2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=185050
<rdar://problem/39624038>
Reviewed by Tim Horton.
Currently, in extra zoom mode, there's no way for web pages to opt out of the default viewport behaviors
(namely, laying out at a larger width and shrinking to fit) when the web view is very tall and narrow. This
patch adds a new experimental viewport attribute, "min-device-width", that can be used to prevent WebKit from
automatically clamping the web view width to a greater value for the device width in this scenario.
Note that after this patch, logic that plumbs a minimumLayoutSize from WKWebView to the viewport configuration
will need to be renamed to reflect that this size is no longer the minimum layout size, but rather, the view
size that is used for viewport device dimensions by default. This refactoring will be done in a followup part.
See per-method comments below for more detail.
Test: fast/viewport/extrazoom/viewport-change-min-device-width.html
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
(WebCore::operator<<):
* dom/ViewportArguments.h:
Removes `m_forceHorizontalShrinkToFit` (more detail below).
* page/ViewportConfiguration.cpp:
(WebCore::computedMinDeviceWidth):
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setMinimumLayoutSize):
Instead of directly setting the minimum layout size, setMinimumLayoutSize now first sets the view size (i.e. the
size we use for `device-width` in the viewport meta tag), and then updates the minimum layout size.
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
Replaces `m_forceHorizontalShrinkToFit`. Whether or not we shrink to fit is now determined by whether the
min-device-width attribute is actively clamping the width of the view.
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):
Computes and sets the minimum layout size using the view size, taking the minimum device width into account if
needed.
(WebCore::ViewportConfiguration::description const):
(WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): Deleted.
* page/ViewportConfiguration.h:
2018-04-27 Zalan Bujtas <zalan@apple.com>
[LFC] Formatting contexts should take const Box&
https://bugs.webkit.org/show_bug.cgi?id=185031
Reviewed by Sam Weinig.
The formatting root boxes are supposed to be all const. The only reason why
they are not is because WeakPtr<> does not support const objects yet.
Use const_cast instead (remove it when WeakPtr<> gains const support).
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::LayoutContext):
(WebCore::Layout::LayoutContext::formattingContext):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
* layout/inlineformatting/InlineFormattingContext.h:
2018-04-27 Zalan Bujtas <zalan@apple.com>
[LFC] Add layout tree iterators.
https://bugs.webkit.org/show_bug.cgi?id=185058
Reviewed by Antti Koivisto.
They work exactly like the renderer tree iterators.
* WebCore.xcodeproj/project.pbxproj:
* layout/layouttree/LayoutAncestorIterator.h: Added.
(WebCore::Layout::LayoutAncestorIterator<T>::LayoutAncestorIterator):
(WebCore::Layout::LayoutAncestorIterator<T>::operator):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::begin const):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::end const):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::first const):
(WebCore::Layout::ancestorsOfType):
(WebCore::Layout::lineageOfType):
* layout/layouttree/LayoutBox.cpp:
* layout/layouttree/LayoutChildIterator.h: Added.
(WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator):
(WebCore::Layout::LayoutChildtIterator<T>::operator):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const):
(WebCore::Layout::childrenOfType):
* layout/layouttree/LayoutIterator.h: Added.
(WebCore::Layout::isLayoutBoxOfType):
(WebCore::Layout::Traversal::firstChild):
(WebCore::Layout::Traversal::lastChild):
(WebCore::Layout::Traversal::nextSibling):
(WebCore::Layout::Traversal::previousSibling):
(WebCore::Layout::Traversal::findAncestorOfType):
(WebCore::Layout::Traversal::nextAncestorSibling):
(WebCore::Layout::Traversal::nextWithin):
(WebCore::Layout::Traversal::firstWithin):
(WebCore::Layout::Traversal::next):
(WebCore::Layout::LayoutIterator<T>::LayoutIterator):
(WebCore::Layout::LayoutIterator<T>::traverseNextSibling):
(WebCore::Layout::LayoutIterator<T>::traverseNext):
(WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
(WebCore::Layout::LayoutIterator<T>::traverseAncestor):
(WebCore::Layout::LayoutIterator<T>::operator const):
(WebCore::Layout:: const):
(WebCore::Layout::= const):
2018-04-27 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231089.
https://bugs.webkit.org/show_bug.cgi?id=185071
Broke and made crash some WPE EME tests (Requested by calvaris
on #webkit).
Reverted changeset:
"[EME][GStreamer] Move the decryptor from AppendPipeline to
PlaybackPipeline."
https://bugs.webkit.org/show_bug.cgi?id=181855
https://trac.webkit.org/changeset/231089
2018-04-27 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
https://bugs.webkit.org/show_bug.cgi?id=181855
Reviewed by Xabier Rodriguez-Calvar.
The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
the decrypted GstBuffers that are in SVP memory.
This behavior cause an out-of-memory error, because we are limited in SVP memory size.
By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
This new architecture also allows to start the buffering before obtaining the DRM license
and it makes easier to manage dynamic change of the license or Key.
The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
protected by a hardware access control engine, it is not accessible to other unauthorised
software or hardware components.
Tests:
media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::dumpAppendState):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleNeedContextSyncMessage):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
(WebCore::AppendPipeline::setAppendState):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineElementMessageCallback): Deleted.
(WebCore::AppendPipeline::handleElementMessage): Deleted.
(WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
(WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2018-04-27 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
https://bugs.webkit.org/show_bug.cgi?id=181858
Reviewed by Xabier Rodriguez-Calvar.
Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
This message should be handled by the application in order to dispatch or send the key to the decryptor.
This patch is a preparation for the patch 181855.
With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
the DRM license or key by using this new message "decrypt-key-needed".
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
2018-04-26 Justin Fan <justin_fan@apple.com>
tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
https://bugs.webkit.org/show_bug.cgi?id=184843
<rdar://problem/34898868>
Reviewed by Simon Fraser.
On certain test pages passing 2d canvas objects to gl.texSubImage2D, we spend significant time doing an alpha unpremultiplication in FormatConverter::convert on a single thread.
For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8.
This improves this rendering path by a factor of ~4. The rest of FormatConverter could use similar improvements; filed https://bugs.webkit.org/show_bug.cgi?id=185064 for these.
* platform/graphics/FormatConverter.cpp:
(WebCore::FormatConverter::convert):
2018-04-26 Simon Fraser <simon.fraser@apple.com>
Implement rendering support for the color-filter CSS property
https://bugs.webkit.org/show_bug.cgi?id=185047
rdar://problem/39664967
Reviewed by Tim Horton.
The color-filter property transforms CSS colors just before painting. To support this,
add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
At most calls sites that transform colors for rendering, replace calls to
visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().
Color transformation is implemented via a new virtual function on FilterOperation;
BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
transfer operations. The math in both cases matches that for SVG filters, with the exception
that color components are stored as floats through multiple filters and then mapped to
normal 0-255 color components at the end.
Tests: css3/color-filters/color-filter-backgrounds-borders.html
css3/color-filters/color-filter-box-shadow.html
css3/color-filters/color-filter-brightness.html
css3/color-filters/color-filter-color-property-list-item.html
css3/color-filters/color-filter-color-property.html
css3/color-filters/color-filter-color-text-decorations.html
css3/color-filters/color-filter-column-rule.html
css3/color-filters/color-filter-contrast.html
css3/color-filters/color-filter-current-color.html
css3/color-filters/color-filter-filter-list.html
css3/color-filters/color-filter-grayscale.html
css3/color-filters/color-filter-hue-rotate.html
css3/color-filters/color-filter-inherits.html
css3/color-filters/color-filter-invert.html
css3/color-filters/color-filter-opacity.html
css3/color-filters/color-filter-outline.html
css3/color-filters/color-filter-saturate.html
css3/color-filters/color-filter-sepia.html
css3/color-filters/color-filter-text-emphasis.html
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* page/FrameView.cpp:
(WebCore::FrameView::documentBackgroundColor const):
* platform/graphics/ColorUtilities.cpp:
(WebCore::ColorMatrix::ColorMatrix):
(WebCore::ColorMatrix::makeIdentity):
(WebCore::ColorMatrix::grayscaleMatrix):
(WebCore::ColorMatrix::saturationMatrix):
(WebCore::ColorMatrix::hueRotateMatrix):
(WebCore::ColorMatrix::sepiaMatrix):
(WebCore::ColorMatrix::transformColorComponents const):
* platform/graphics/ColorUtilities.h:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::BasicColorMatrixFilterOperation::transformColor const):
(WebCore::BasicComponentTransferFilterOperation::transformColor const):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::transformColor const):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* platform/graphics/filters/FilterOperations.h:
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::getBorderEdgeInfo):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::paintSelection):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
(WebCore::RenderBox::paintBackground):
(WebCore::RenderBox::getBackgroundPaintedExtent const):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::applyBoxShadowForBackground):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::paintOutline):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
(WebCore::RenderLayerBacking::rendererBackgroundColor const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemStyle const):
(RenderMenuList::getItemBackgroundColor const):
(RenderMenuList::menuStyle const):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::menuStyle const):
* rendering/RenderTable.h:
(WebCore::RenderTable::bgColor const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder const):
(WebCore::RenderTableCell::computeCollapsedEndBorder const):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
(WebCore::RenderTableCell::computeCollapsedAfterBorder const):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintRowGroupBorder):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
(WebCore::RenderStyle::colorByApplyingColorFilter const):
* rendering/style/RenderStyle.h:
2018-04-26 Mark Lam <mark.lam@apple.com>
Gardening: Speculative build fix for Windows.
https://bugs.webkit.org/show_bug.cgi?id=184976
<rdar://problem/39723901>
Not reviewed.
* cssjit/CSSPtrTag.h:
2018-04-26 Brent Fulgham <bfulgham@apple.com>
Show punycode if URL contains Latin small letter o with dot below character
https://bugs.webkit.org/show_bug.cgi?id=185051
<rdar://problem/39459297>
Reviewed by David Kilzer.
Revise our "lookalike character" logic to include the small Latin o
with dot below character.
Test: fast/url/host.html
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
2018-04-26 Daniel Bates <dabates@apple.com>
Fix the build following r231068
(https://bugs.webkit.org/show_bug.cgi?id=185002)
Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
latter does not exist.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
2018-04-26 Daniel Bates <dabates@apple.com>
DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=185002
Reviewed by Youenn Fablet and Alex Christensen.
In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
Instead we should WTFMove() the passed request into the CachedResourceRequest.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
2018-04-26 Sihui Liu <sihui_liu@apple.com>
-[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
https://bugs.webkit.org/show_bug.cgi?id=184938
<rdar://problem/34737395>
Reviewed by Geoffrey Garen.
When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
was lost so the delete function cannot find the proper cookie to delete.
This patch implements a workaround that compares Cookie object instead of NSHTTPCookie
object. We might want to add the ability to set HTTPOnly header during conversion if there
is an easy way to do it later.
New API test: WebKit.WKHTTPCookieStoreHttpOnly
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator== const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookie):
2018-04-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r231052.
https://bugs.webkit.org/show_bug.cgi?id=185044
Broke test http/tests/security/credentials-main-resource.html
(Requested by dydz on #webkit).
Reverted changeset:
"DocumentLoader::loadMainResource() should WTFMove() the
passed ResourceRequest"
https://bugs.webkit.org/show_bug.cgi?id=185002
https://trac.webkit.org/changeset/231052
2018-04-26 Jer Noble <jer.noble@apple.com>
WK_COCOA_TOUCH all the things.
https://bugs.webkit.org/show_bug.cgi?id=185006
Reviewed by Tim Horton.
* Configurations/WebCore.xcconfig:
2018-04-26 David Kilzer <ddkilzer@apple.com>
Make WAKScrollView delegate a weak property
<https://webkit.org/b/184799>
<rdar://problem/39469669>
Reviewed by Simon Fraser.
* platform/ios/wak/WAKScrollView.h:
- Remove `delegate` instance variable declaration.
- Declare `delegate` property as weak.
(-[WAKScrollView setDelegate:]): Delete declaration.
(-[WAKScrollView delegate]): Ditto.
* platform/ios/wak/WAKScrollView.mm:
- Synthesize getter/setter methods for `delegate` property.
(-[WAKScrollView setDelegate:]): Delete implementation.
(-[WAKScrollView delegate]): Ditto.
2018-04-26 Youenn Fablet <youenn@apple.com>
CORS preflight checker should add a console message when preflight load is blocked
https://bugs.webkit.org/show_bug.cgi?id=185021
Reviewed by Chris Dumez.
No change of behavior, adding a JS console message when preflight load is blocked.
This mirrors what is being done in preflighting done from NetworkProcess.
Covered by existing tests.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
(WebCore::CrossOriginPreflightChecker::doPreflight):
2018-04-26 Daniel Bates <dabates@apple.com>
DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=185002
Reviewed by Youenn Fablet and Alex Christensen.
In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
Instead we should WTFMove() the passed request into the CachedResourceRequest.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
2018-04-26 Per Arne Vollan <pvollan@apple.com>
Disable content filtering in minimal simulator mode
https://bugs.webkit.org/show_bug.cgi?id=185027
<rdar://problem/39736091>
Reviewed by Jer Noble.
* Configurations/FeatureDefines.xcconfig:
2018-04-25 Brent Fulgham <bfulgham@apple.com>
Add port 548 (afpovertcp) to port blacklist
https://bugs.webkit.org/show_bug.cgi?id=185000
<rdar://problem/39540481>
Reviewed by David Kilzer.
Tested by security/block-test.html.
* platform/URL.cpp:
(WebCore::portAllowed):Also block port 548.
2018-04-26 Andy VanWagoner <thetalecrafter@gmail.com>
[INTL] Implement Intl.PluralRules
https://bugs.webkit.org/show_bug.cgi?id=184312
Reviewed by JF Bastien.
Added Intl.PluralRules feature flag.
Test: js/intl-pluralrules.html
* Configurations/FeatureDefines.xcconfig:
2018-04-15 Darin Adler <darin@apple.com>
[Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
https://bugs.webkit.org/show_bug.cgi?id=184637
Reviewed by Alexey Proskuryakov.
* crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
HAVE(CCRSAGetCRTComponents) is true.
* crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
enough versions of iOS and macOS that have it and add declarations of the
function for the non-Apple-internal-SDK case. Also don't define the
WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.
2018-04-26 Per Arne Vollan <pvollan@apple.com>
Add lazy initialization of caption display mode for videos.
https://bugs.webkit.org/show_bug.cgi?id=184993
The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
is showing up in samples when called from HTMLMediaElement::finishInitialization().
Reviewed by Eric Carlson.
No new tests, covered by existing tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishInitialization):
(WebCore::HTMLMediaElement::setSelectedTextTrack):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::captionPreferencesChanged):
(WebCore::HTMLMediaElement::captionDisplayMode):
* html/HTMLMediaElement.h:
2018-04-26 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Initial ASYNC_SCROLLING support
https://bugs.webkit.org/show_bug.cgi?id=184961
Reviewed by Carlos Garcia Campos.
Add CoordinatedGraphics-specific code that will be required for async
scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
ScrollingTreeCoordinatedGraphics classes are mostly complete already,
but the new ScrollingTreeNode-inheriting classes will need further
work that will have to be done in parallel with other improvements
planned for the CoordinatedGraphics subsystem.
While the build-time flag is enabled, the feature is still not enabled
at runtime due to being marked as unsupported by the DrawingArea
implementation in the WebKit layer. It would also not work yet if it
were enabled due to the before-mentioned pending changes.
Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
code are included.
* Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
* SourcesCocoa.txt:
* SourcesGTK.txt: Add new files to build.
* SourcesWPE.txt: Ditto.
* page/scrolling/AsyncScrollingCoordinator.cpp:
Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
* page/scrolling/ThreadedScrollingTree.h:
currentSnapPointIndicesDidChange() method is only invoked in
Cocoa-specific code, and its implementation calls Cocoa-specific method
on the AsyncScrollingCoordinator class.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinator::create):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
(WebCore::ScrollingTreeCoordinatedGraphics::create):
(WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
(WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
* page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
(WebCore::ScrollingTreeFixedNode::create):
(WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
(WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
(WebCore::ScrollingTreeStickyNode::create):
(WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
(WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
* platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
* platform/TextureMapper.cmake: Two build targets have been moved to
SourcesGTK.txt and SourcesWPE.txt.
2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE] Build and link against latest WPEBackend and WPEBackend-fdo
https://bugs.webkit.org/show_bug.cgi?id=184643
Reviewed by Žan Doberšek.
Adapt to single-header WPE includes.
* platform/graphics/egl/GLContextEGLWPE.cpp:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:
* platform/wpe/PlatformPasteboardWPE.cpp:
2018-04-25 Youenn Fablet <youenn@apple.com>
Use NetworkLoadChecker for all subresource loads except fetch/XHR
https://bugs.webkit.org/show_bug.cgi?id=184870
<rdar://problem/39370034>
Reviewed by Chris Dumez.
No change of behavior.
Update CachedResourceLoader error messages to match NetworkProcess error messages.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::printAccessDeniedMessage const):
2018-04-25 Zalan Bujtas <zalan@apple.com>
[LFC] Add support for is<> and downcast<>
https://bugs.webkit.org/show_bug.cgi?id=185016
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::BlockContainer):
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isContainer const):
(WebCore::Layout::Box::isBlockContainer const):
(WebCore::Layout::Box::isInlineBox const):
(WebCore::Layout::Box::isInlineContainer const):
* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::Container):
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
* layout/layouttree/LayoutInlineContainer.cpp:
(WebCore::Layout::InlineContainer::InlineContainer):
* layout/layouttree/LayoutInlineContainer.h:
2018-04-25 Chris Dumez <cdumez@apple.com>
window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
https://bugs.webkit.org/show_bug.cgi?id=184981
Reviewed by Sam Weinig.
window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
complaining that |this| is not a Window. This was caused by a copy & paste mistake in
JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
ones.
No new tests, updated existing tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::postMessage):
* page/RemoteDOMWindow.h:
* page/RemoteDOMWindow.idl:
2018-04-25 Simon Fraser <simon.fraser@apple.com>
brightness() filter should default to 1, and not allow negative values
https://bugs.webkit.org/show_bug.cgi?id=184937
Reviewed by Dean Jackson.
Remove the special-casing for brightness() in consumeFilterFunction(), so it now
follows the same logic as the other color-related filters in not allowing negative
values.
Removed the special-casing for brightness() in createFilterOperations() so its default
value is now 1.
Modified existing tests.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2018-04-25 Wenson Hsieh <wenson_hsieh@apple.com>
Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=184999
Reviewed by Tim Horton.
Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.
* Configurations/WebCore.xcconfig:
2018-04-25 Zalan Bujtas <zalan@apple.com>
[LFC] Implement LayoutContexet::layout() and its dependencies.
https://bugs.webkit.org/show_bug.cgi?id=184951
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::~FormattingContext):
(WebCore::Layout::FormattingContext::computeStaticPosition):
(WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
(WebCore::Layout::FormattingContext::computeWidth):
(WebCore::Layout::FormattingContext::computeHeight):
(WebCore::Layout::FormattingContext::marginTop):
(WebCore::Layout::FormattingContext::marginLeft):
(WebCore::Layout::FormattingContext::marginBottom):
(WebCore::Layout::FormattingContext::marginRight):
* layout/FormattingContext.h:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::LayoutContext):
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::formattingState):
(WebCore::Layout::LayoutContext::formattingContext):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::layout):
(WebCore::Layout::BlockFormattingContext::formattingState const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition):
(WebCore::Layout::BlockFormattingContext::computeWidth):
(WebCore::Layout::BlockFormattingContext::computeHeight):
(WebCore::Layout::BlockFormattingContext::marginTop):
(WebCore::Layout::BlockFormattingContext::marginBottom):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::formattingState const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
2018-04-25 Mark Lam <mark.lam@apple.com>
Push the definition of PtrTag down to the WTF layer.
https://bugs.webkit.org/show_bug.cgi?id=184976
<rdar://problem/39723901>
Reviewed by Saam Barati.
No new tests needed. This is covered by existing tests.
* cssjit/CSSPtrTag.h:
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
2018-04-25 Eric Carlson <eric.carlson@apple.com>
[iOS] remove media element parameter from MediaElementSession methods
https://bugs.webkit.org/show_bug.cgi?id=184992
<rdar://problem/39731624>
Reviewed by Jon Lee.
No new tests, no behavior change.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
(WebCore::MediaControlsHost::userGestureRequired const):
* accessibility/AccessibilityMediaObject.cpp:
(WebCore::AccessibilityMediaObject::isPlayingInline const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::pause):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
(WebCore::HTMLMediaElement::addEventListener):
(WebCore::HTMLMediaElement::removeEventListener):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::configureMediaControls):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
(WebCore::HTMLMediaElement::updateMediaState):
(WebCore::HTMLMediaElement::mediaState const):
(WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
(WebCore::HTMLMediaElement::updateShouldPlay):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
(WebCore::HTMLVideoElement::supportsFullscreen const):
(WebCore::HTMLVideoElement::webkitEnterFullscreen):
(WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
(WebCore::HTMLVideoElement::setFullscreenMode):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
(WebCore::MediaElementSession::dataLoadingPermitted const):
(WebCore::MediaElementSession::fullscreenPermitted const):
(WebCore::MediaElementSession::pageAllowsDataLoading const):
(WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
(WebCore::MediaElementSession::canShowControlsManager const):
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaElementSession::mediaStateDidChange):
(WebCore::MediaElementSession::effectivePreloadForElement const):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
(WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):
(WebCore::MediaElementSession::mediaEngineUpdated):
(WebCore::MediaElementSession::allowsPictureInPicture const):
* html/MediaElementSession.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled const):
2018-04-25 Jiewen Tan <jiewen_tan@apple.com>
Remove access to keychain from the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=184428
<rdar://problem/13150903>
Reviewed by Brent Fulgham.
Part 2.
This patch move the operation of HTMLKeygenElement from WebContent Process to UI Process.
Function signedPublicKeyAndChallengeString is therefore marked as WEBCORE_EXPORT. Also, a
localized string is marked WEBCORE_EXPORT as well to support the API test.
Covered by existing tests and api tests.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::signedPublicKeyAndChallengeString):
* dom/Document.h:
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::appendFormData):
* page/ChromeClient.h:
* platform/LocalizedStrings.h:
* platform/SSLKeyGenerator.h:
2018-04-25 Ryosuke Niwa <rniwa@webkit.org>
PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
https://bugs.webkit.org/show_bug.cgi?id=184962
Reviewed by Youenn Fablet.
Added NavigationAction::treatAsSameOriginNavigation, which signifies WebKit code to avoid creating
a new WebContent process when navigating to a blob URL, data URL, and about:blank.
Tests: ProcessSwap.SameOriginBlobNavigation
ProcessSwap.CrossOriginBlobNavigation
ProcessSwap.NavigateToAboutBlank
ProcessSwap.NavigateToDataURL
* loader/NavigationAction.cpp:
(WebCore::treatAsSameOriginNavigation):
* loader/NavigationAction.h:
(WebCore::NavigationAction::treatAsSameOriginNavigation const):
2018-04-25 Zalan Bujtas <zalan@apple.com>
[LFC] Implement Layout::BlockContainer functions.
https://bugs.webkit.org/show_bug.cgi?id=184994
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::BlockContainer):
(WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
2018-04-25 Zalan Bujtas <zalan@apple.com>
[LFC] Implement Layout::Container functions.
https://bugs.webkit.org/show_bug.cgi?id=184988
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::Container):
(WebCore::Layout::Container::firstInFlowChild const):
(WebCore::Layout::Container::firstInFlowOrFloatingChild const):
(WebCore::Layout::Container::lastInFlowChild const):
(WebCore::Layout::Container::lastInFlowOrFloatingChild const):
(WebCore::Layout::Container::setFirstChild):
(WebCore::Layout::Container::setLastChild):
(WebCore::Layout::Container::setOutOfFlowDescendants):
* layout/layouttree/LayoutContainer.h:
(WebCore::Layout::Container::firstChild const):
(WebCore::Layout::Container::lastChild const):
(WebCore::Layout::Container::hasChild const):
(WebCore::Layout::Container::hasInFlowChild const):
(WebCore::Layout::Container::hasInFlowOrFloatingChild const):
(WebCore::Layout::Container::outOfFlowDescendants):
2018-04-25 Brent Fulgham <bfulgham@apple.com>
Don't Block First Party Cookies on Redirects
https://bugs.webkit.org/show_bug.cgi?id=184948
<rdar://problem/39534099>
Reviewed by Youenn Fablet.
The Navigation scheduler looses the 'requester' value when performing a ScheduledRedirect.
Test: http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html
* loader/NavigationScheduler.cpp:
2018-04-25 Youenn Fablet <youenn@apple.com>
CachedRawResource is not handling incremental data computation correctly
https://bugs.webkit.org/show_bug.cgi?id=184936
Reviewed by Chris Dumez.
Covered by updated test.
The previous logic was handling the case of only one additional segment being added to the SharedBuffer.
In service worker case, a SharedBuffer may contain more than one segment.
This is fixed by iterating until all new data is sent to clients.
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):
2018-04-25 Andy Estes <aestes@apple.com>
[Mac] Number of drop items is always 0 when performing a DHTML drag
https://bugs.webkit.org/show_bug.cgi?id=184943
Reviewed by Ryosuke Niwa.
New API test: DragAndDropPasteboardTests.NumberOfValidItemsForDrop
DragController tracks the number of items to be accepted by a file input element, taking
into account whether the control is disabled or accepts multiple files. When this number
changes, WebKit informs the NSDraggingInfo-conforming object passed to -draggingUpdated by
calling -setNumberOfValidItemsForDrop:. This number is presented to the user in a badge
rendered next to the dragging item thumbnails.
When performing a DHTML drag, we don't know how many items the page will accept, so prior
to this patch we would render a "0" in the badge. This is misleading, because the page is
more likely to accept all the items (or at least one of them) rather than none of them.
Let's do the straightforward thing and set numberOfValidItemsForDrop to equal the number of
files in the drag operation when performing a DHTML file drag.
* page/DragController.cpp:
(WebCore::DragController::tryDocumentDrag):
2018-04-25 Eric Carlson <eric.carlson@apple.com>
[iOS] Set route sharing policy when setting audio session category
https://bugs.webkit.org/show_bug.cgi?id=184979
<rdar://problem/39709577>
Reviewed by Jer Noble.
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
2018-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix wrong schema checking on r230973
https://bugs.webkit.org/show_bug.cgi?id=184977
Did write a wrong condition when making a string.
Reviewed by Alex Christensen.
No new tests because test interface is not ready.
* platform/network/curl/CurlProxySettings.cpp:
(WebCore::createProxyUrl):
2018-04-25 Youenn Fablet <youenn@apple.com>
Make DocumentThreadableLoader error logging more consistent
https://bugs.webkit.org/show_bug.cgi?id=184853
Reviewed by Chris Dumez.
Covered by rebased tests.
Make EventSource, XHR and Fetch log error messages consistently.
This patch also prepares consistent error logging between WK1 and WK2 as WK2 NetworkProcess
will issue more and more errors in places different from WK1.
This is the reason for SubresourceLoader changes in this patch and DTL/didFail/preflightFailure changes.
Update ImageLoader error message to be more general than CORS.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::doPreflight): Add some more logging for consistency between WK1 and WK2.
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Ditto.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didFail):
(WebCore::DocumentThreadableLoader::preflightFailure):
(WebCore::DocumentThreadableLoader::logErrorAndFail):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::logError):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResourceRequestInitiators.cpp:
(WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
* loader/cache/CachedResourceRequestInitiators.h:
* page/EventSource.cpp:
(WebCore::EventSource::connect):
(WebCore::EventSource::didFail):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFail):
2018-04-25 Zalan Bujtas <zalan@apple.com>
[LFC] Implement Layout::Box functions.
https://bugs.webkit.org/show_bug.cgi?id=184974
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
(WebCore::Layout::Box::~Box):
(WebCore::Layout::Box::establishesFormattingContext const):
(WebCore::Layout::Box::establishesBlockFormattingContext const):
(WebCore::Layout::Box::isRelativelyPositioned const):
(WebCore::Layout::Box::isStickyPositioned const):
(WebCore::Layout::Box::isAbsolutelyPositioned const):
(WebCore::Layout::Box::isFixedPositioned const):
(WebCore::Layout::Box::isFloatingPositioned const):
(WebCore::Layout::Box::containingBlock const):
(WebCore::Layout::Box::isDescendantOf const):
(WebCore::Layout::Box::isAnonymous const):
(WebCore::Layout::Box::isInlineBlockBox const):
(WebCore::Layout::Box::isBlockLevelBox const):
(WebCore::Layout::Box::isInlineLevelBox const):
(WebCore::Layout::Box::isBlockContainerBox const):
(WebCore::Layout::Box::isInitialContainingBlock const):
(WebCore::Layout::Box::nextInFlowSibling const):
(WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
(WebCore::Layout::Box::previousInFlowSibling const):
(WebCore::Layout::Box::previousInFlowOrFloatingSibling const):
(WebCore::Layout::Box::setParent):
(WebCore::Layout::Box::setNextSibling):
(WebCore::Layout::Box::setPreviousSibling):
(WebCore::Layout::Box::isOverflowVisible const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::establishesInlineFormattingContext const):
(WebCore::Layout::Box::isInFlow const):
(WebCore::Layout::Box::isPositioned const):
(WebCore::Layout::Box::isInFlowPositioned const):
(WebCore::Layout::Box::isOutOfFlowPositioned const):
(WebCore::Layout::Box::isFloatingOrOutOfFlowPositioned const):
(WebCore::Layout::Box::parent const):
(WebCore::Layout::Box::nextSibling const):
(WebCore::Layout::Box::previousSibling const):
(WebCore::Layout::Box::weakPtrFactory const):
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineBox.h:
* layout/layouttree/LayoutInlineContainer.h:
2018-04-25 Per Arne Vollan <pvollan@apple.com>
[Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
https://bugs.webkit.org/show_bug.cgi?id=184953
This is possibly a MSVC compiler bug, since a simple rearrangement of the code fixes the crash.
The crash is only happening in release builds, which also is an indication of this being a
compiler issue.
Reviewed by Zalan Bujtas.
No new tests, covered by existing tests.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::generateLineBoxTree):
2018-04-25 Dean Jackson <dino@apple.com>
Make a better flag for system preview, and disable it where necessary
https://bugs.webkit.org/show_bug.cgi?id=184968
<rdar://problem/39686506>
Reviewed by Eric Carlson.
Use USE(SYSTEM_PREVIEW).
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
* html/HTMLAnchorElement.h:
* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLPictureElement.cpp:
* html/HTMLPictureElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderTheme.cpp:
* rendering/RenderTheme.h:
* testing/Internals.cpp:
(WebCore::Internals::systemPreviewRelType):
(WebCore::Internals::isSystemPreviewLink const):
(WebCore::Internals::isSystemPreviewImage const):
2018-04-25 Zalan Bujtas <zalan@apple.com>
Fix project file after r230931.
* WebCore.xcodeproj/project.pbxproj:
2018-04-25 Miguel Gomez <magomez@igalia.com>
[GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform"
https://bugs.webkit.org/show_bug.cgi?id=184780
Reviewed by Žan Doberšek.
Initialize the anchorPoint to (0.5, 0.5, 0) in TextureMapperLayer::State.
Covered by existent tests.
* platform/graphics/texmap/TextureMapperLayer.h:
2018-04-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Implement MouseEvent.buttons
https://bugs.webkit.org/show_bug.cgi?id=184913
Reviewed by Žan Doberšek.
Add helper function to get the state modifier of a GDK button.
* platform/gtk/GtkUtilities.cpp:
(WebCore::stateModifierForGdkButton):
* platform/gtk/GtkUtilities.h:
2018-04-24 Ryosuke Niwa <rniwa@webkit.org>
Release assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustomFontData during
Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=184950
Reviewed by Zalan Bujtas.
Convert an existing ScriptDisallowedScope::EventAllowedScope which only disables the debug assertions
by ScriptDisallowedScope::DisableAssertionsInScope which also disables the release assertion.
Because SVG font is loaded in a document isolated from the rest of the page (m_externalSVGDocument),
there is no security implication to execute scripts in this isolated document.
Unfortunately, no new tests. I could never make CachedSVGFont::ensureCustomFontData to get called inside
style resolution with m_externalSVGDocument set to nullptr after many attempts. Even EventAllowedScope
I added 13 months ago in r211965, which this patch replaces by DisableAssertionsInScope, is not utilized
by the existing layout tests since removing the assertion doesn't cause any layout test to hit an assertion.
* dom/ScriptDisallowedScope.h: Updated the comment.
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData): Replaced the asssertion.
2018-04-24 Simon Fraser <simon.fraser@apple.com>
visitedDependentColor() should take a CSSPropertyID
https://bugs.webkit.org/show_bug.cgi?id=184949
Reviewed by Sam Weinig.
Change RenderStyle::colorIncludingFallback(), RenderStyle::visitedDependentColor()
and RenderElement::selectionColor() to take CSSPropertyID rather than int.
No behavior change.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
* rendering/RenderElement.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder const):
(WebCore::RenderTableCell::computeCollapsedEndBorder const):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
(WebCore::RenderTableCell::computeCollapsedAfterBorder const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback const):
(WebCore::RenderStyle::visitedDependentColor const):
* rendering/style/RenderStyle.h:
2018-04-24 Simon Fraser <simon.fraser@apple.com>
Add a new "color-filter" CSS property as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=184940
rdar://problem/39664904
Reviewed by Jon Lee.
Add a new CSS property called "color-filter" as an experimental feature (off by default).
This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions)
to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility.
Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property.
Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped.
This patch adds support for parsing color-filter.
Test: css3/color-filters/color-filter-parsing.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserMode.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilter):
* css/parser/CSSPropertyParserHelpers.h:
* page/Settings.yaml:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::mutableColorFilter):
(WebCore::RenderStyle::colorFilter const):
(WebCore::RenderStyle::hasColorFilter const):
(WebCore::RenderStyle::setColorFilter):
(WebCore::RenderStyle::initialColorFilter):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
(WebCore::StyleRareInheritedData::hasColorFilters const):
* rendering/style/StyleRareInheritedData.h:
2018-04-24 Simon Fraser <simon.fraser@apple.com>
shape-outside and filter styles occur twice in the result of getComputedStyle
https://bugs.webkit.org/show_bug.cgi?id=184931
Reviewed by Antti Koivisto.
CSSPropertyShapeOutside and CSSPropertyFilter were duplicated in the list of computedProperties[]
used by getComputedStyle. Remove the duplication.
Tested by existing tests.
* css/CSSComputedStyleDeclaration.cpp:
2018-04-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Extract proxy settings into a separate class to hold advanced information.
https://bugs.webkit.org/show_bug.cgi?id=184714
It was simplely structure to hold proxy setting. To support advanced feature of proxy
such as authentication, more inteligent object is required to store intermediate state
or errors. That's why we've introduced new class for that purpose.
Reviewed by Youenn Fablet.
No new tests because there's no new behavior.
* platform/Curl.cmake:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableProxyIfExists):
(WebCore::CurlContext::ProxyInfo::url const): Deleted.
(WebCore::CurlContext::setProxyInfo): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::proxySettings const):
(WebCore::CurlContext::setProxySettings):
(WebCore::CurlContext::setProxyUserPass):
(WebCore::CurlContext::proxyInfo const): Deleted.
(WebCore::CurlContext::setProxyInfo): Deleted.
* platform/network/curl/CurlProxySettings.cpp: Added.
(WebCore::CurlProxySettings::CurlProxySettings):
(WebCore::CurlProxySettings::rebuildUrl):
(WebCore::CurlProxySettings::setUserPass):
(WebCore::protocolIsInSocksFamily):
(WebCore::getProxyPort):
(WebCore::createProxyUrl):
* platform/network/curl/CurlProxySettings.h: Added.
(WebCore::CurlProxySettings::CurlProxySettings):
(WebCore::CurlProxySettings::isEmpty const):
(WebCore::CurlProxySettings::mode const):
(WebCore::CurlProxySettings::url const):
(WebCore::CurlProxySettings::ignoreHosts const):
(WebCore::CurlProxySettings::user const):
(WebCore::CurlProxySettings::password const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
2018-04-24 Youenn Fablet <youenn@apple.com>
Throw in case of PeerConnection created for detached documents
https://bugs.webkit.org/show_bug.cgi?id=184921
<rdar://problem/39629216>
Reviewed by Eric Carlson.
Add a check to ensure that page is not null when creating a peer connection backend.
In that case, the peer connection constructor will later on throw.
The same for setConfiguration is done.
Behavior is consistent with Chrome.
Test: webrtc/pc-detached-document.html
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
(WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
(WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
(WebCore::libWebRTCProvider): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2018-04-24 John Wilander <wilander@apple.com>
From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
https://bugs.webkit.org/show_bug.cgi?id=184560
<rdar://problem/38901344>
Reviewed by Youenn Fablet and Daniel Bates.
Tests: http/tests/from-origin/document-from-origin-same-accepted.html
http/tests/from-origin/document-from-origin-same-blocked.html
http/tests/from-origin/document-from-origin-same-site-accepted.html
http/tests/from-origin/document-from-origin-same-site-blocked.html
http/tests/from-origin/document-nested-from-origin-same-accepted.html
http/tests/from-origin/document-nested-from-origin-same-blocked.html
http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html
http/tests/from-origin/fetch-from-origin-same-accepted.html
http/tests/from-origin/fetch-from-origin-same-blocked.html
http/tests/from-origin/fetch-from-origin-same-site-accepted.html
http/tests/from-origin/fetch-from-origin-same-site-blocked.html
http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html
http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html
http/tests/from-origin/image-about-blank-from-origin-same-blocked.html
http/tests/from-origin/image-from-origin-same-accepted.html
http/tests/from-origin/image-from-origin-same-blocked.html
http/tests/from-origin/image-from-origin-same-site-accepted.html
http/tests/from-origin/image-from-origin-same-site-blocked.html
http/tests/from-origin/redirect-document-from-origin-same-blocked.html
http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html
http/tests/from-origin/redirect-image-from-origin-same-blocked.html
http/tests/from-origin/redirect-script-from-origin-same-blocked.html
http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html
http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html
http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html
http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html
http/tests/from-origin/script-from-origin-same-accepted.html
http/tests/from-origin/script-from-origin-same-blocked.html
http/tests/from-origin/script-from-origin-same-site-accepted.html
http/tests/from-origin/script-from-origin-same-site-blocked.html
http/tests/from-origin/top-frame-document-from-origin-same-accepted.php
http/tests/from-origin/xhr-from-origin-same-accepted.html
http/tests/from-origin/xhr-from-origin-same-blocked.html
http/tests/from-origin/xhr-from-origin-same-site-accepted.html
http/tests/from-origin/xhr-from-origin-same-site-blocked.html
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
Outputs the error's localized description in a console message except when the destination
is FetchOptions::Destination::Serviceworker or FetchOptions::Destination::EmptyString.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled):
(WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const):
Added From-Origin support as an experimental feature.
* platform/network/HTTPHeaderNames.in:
Added From-Origin.
* platform/network/HTTPParsers.cpp:
(WebCore::parseFromOriginHeader):
Parses the From-Origin header, currently supporting 'Same' and 'Same-Site.'
* platform/network/HTTPParsers.h:
2018-04-24 Antti Koivisto <antti@apple.com>
Rename LayoutCtx.h/cpp to LayoutContext.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=184922
Reviewed by Zalan Bujtas.
To achieve this the existing LayoutContext class is renamed to FrameViewLayoutContext.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.cpp: Copied from Source/WebCore/layout/LayoutCtx.cpp.
* layout/LayoutContext.h: Copied from Source/WebCore/layout/LayoutCtx.h.
* layout/LayoutCtx.cpp: Removed.
* layout/LayoutCtx.h: Removed.
* page/FrameView.cpp:
(WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::updateLayerPositionsAfterScrolling):
(WebCore::FrameView::updateCompositingLayersAfterScrolling):
(WebCore::FrameView::availableContentSizeChanged):
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp: Copied from Source/WebCore/page/LayoutContext.cpp.
(WebCore::LayoutScope::LayoutScope):
(WebCore::FrameViewLayoutContext::FrameViewLayoutContext):
(WebCore::FrameViewLayoutContext::~FrameViewLayoutContext):
(WebCore::FrameViewLayoutContext::layout):
(WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks):
(WebCore::FrameViewLayoutContext::runAsynchronousTasks):
(WebCore::FrameViewLayoutContext::flushAsynchronousTasks):
(WebCore::FrameViewLayoutContext::reset):
(WebCore::FrameViewLayoutContext::needsLayout const):
(WebCore::FrameViewLayoutContext::setNeedsLayout):
(WebCore::FrameViewLayoutContext::enableSetNeedsLayout):
(WebCore::FrameViewLayoutContext::disableSetNeedsLayout):
(WebCore::FrameViewLayoutContext::scheduleLayout):
(WebCore::FrameViewLayoutContext::unscheduleLayout):
(WebCore::FrameViewLayoutContext::scheduleSubtreeLayout):
(WebCore::FrameViewLayoutContext::layoutTimerFired):
(WebCore::FrameViewLayoutContext::convertSubtreeLayoutToFullLayout):
(WebCore::FrameViewLayoutContext::setSubtreeLayoutRoot):
(WebCore::FrameViewLayoutContext::canPerformLayout const):
(WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
(WebCore::FrameViewLayoutContext::updateStyleForLayout):
(WebCore::FrameViewLayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameViewLayoutContext::startLayoutAtMainFrameViewIfNeeded):
(WebCore::FrameViewLayoutContext::layoutDelta const):
(WebCore::FrameViewLayoutContext::addLayoutDelta):
(WebCore::FrameViewLayoutContext::layoutDeltaMatches):
(WebCore::FrameViewLayoutContext::layoutState const):
(WebCore::FrameViewLayoutContext::pushLayoutState):
(WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::FrameViewLayoutContext::popLayoutState):
(WebCore::FrameViewLayoutContext::checkLayoutState):
(WebCore::FrameViewLayoutContext::frame const):
(WebCore::FrameViewLayoutContext::view const):
(WebCore::FrameViewLayoutContext::renderView const):
(WebCore::FrameViewLayoutContext::document const):
(WebCore::LayoutContext::LayoutContext): Deleted.
(WebCore::LayoutContext::~LayoutContext): Deleted.
(WebCore::LayoutContext::layout): Deleted.
(WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Deleted.
(WebCore::LayoutContext::runAsynchronousTasks): Deleted.
(WebCore::LayoutContext::flushAsynchronousTasks): Deleted.
(WebCore::LayoutContext::reset): Deleted.
(WebCore::LayoutContext::needsLayout const): Deleted.
(WebCore::LayoutContext::setNeedsLayout): Deleted.
(WebCore::LayoutContext::enableSetNeedsLayout): Deleted.
(WebCore::LayoutContext::disableSetNeedsLayout): Deleted.
(WebCore::LayoutContext::scheduleLayout): Deleted.
(WebCore::LayoutContext::unscheduleLayout): Deleted.
(WebCore::LayoutContext::scheduleSubtreeLayout): Deleted.
(WebCore::LayoutContext::layoutTimerFired): Deleted.
(WebCore::LayoutContext::convertSubtreeLayoutToFullLayout): Deleted.
(WebCore::LayoutContext::setSubtreeLayoutRoot): Deleted.
(WebCore::LayoutContext::canPerformLayout const): Deleted.
(WebCore::LayoutContext::applyTextSizingIfNeeded): Deleted.
(WebCore::LayoutContext::updateStyleForLayout): Deleted.
(WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
(WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded): Deleted.
(WebCore::LayoutContext::layoutDelta const): Deleted.
(WebCore::LayoutContext::addLayoutDelta): Deleted.
(WebCore::LayoutContext::layoutDeltaMatches): Deleted.
(WebCore::LayoutContext::layoutState const): Deleted.
(WebCore::LayoutContext::pushLayoutState): Deleted.
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): Deleted.
(WebCore::LayoutContext::popLayoutState): Deleted.
(WebCore::LayoutContext::checkLayoutState): Deleted.
(WebCore::LayoutContext::frame const): Deleted.
(WebCore::LayoutContext::view const): Deleted.
(WebCore::LayoutContext::renderView const): Deleted.
(WebCore::LayoutContext::document const): Deleted.
* page/FrameViewLayoutContext.h: Copied from Source/WebCore/page/LayoutContext.h.
(WebCore::LayoutContext::startDisallowingLayout): Deleted.
(WebCore::LayoutContext::endDisallowingLayout): Deleted.
(WebCore::LayoutContext::layoutPhase const): Deleted.
(WebCore::LayoutContext::isLayoutNested const): Deleted.
(WebCore::LayoutContext::isLayoutPending const): Deleted.
(WebCore::LayoutContext::isInLayout const): Deleted.
(WebCore::LayoutContext::isInRenderTreeLayout const): Deleted.
(WebCore::LayoutContext::inPaintableState const): Deleted.
(WebCore::LayoutContext::layoutCount const): Deleted.
(WebCore::LayoutContext::subtreeLayoutRoot const): Deleted.
(WebCore::LayoutContext::clearSubtreeLayoutRoot): Deleted.
(WebCore::LayoutContext::resetFirstLayoutFlag): Deleted.
(WebCore::LayoutContext::didFirstLayout const): Deleted.
(WebCore::LayoutContext::setNeedsFullRepaint): Deleted.
(WebCore::LayoutContext::needsFullRepaint const): Deleted.
(WebCore::LayoutContext::isPaintOffsetCacheEnabled const): Deleted.
(WebCore::LayoutContext::layoutDisallowed const): Deleted.
(WebCore::LayoutContext::isLayoutSchedulingEnabled const): Deleted.
(WebCore::LayoutContext::inAsynchronousTasks const): Deleted.
(WebCore::LayoutContext::disablePaintOffsetCache): Deleted.
(WebCore::LayoutContext::enablePaintOffsetCache): Deleted.
* page/LayoutContext.cpp: Removed.
* page/LayoutContext.h: Removed.
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computePaginationInformation):
(WebCore::LayoutState::establishLineGrid):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
* rendering/LayoutState.h:
2018-04-24 Mark Lam <mark.lam@apple.com>
Need to acquire the VM lock before calling toNumber on a JSValue.
https://bugs.webkit.org/show_bug.cgi?id=184924
<rdar://problem/39690679>
Reviewed by Saam Barati.
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertValueToObjcValue):
2018-04-24 Tadeu Zagallo <tzagallo@apple.com>
REGRESSION(r221839): Fix requests with FormData containing empty files
https://bugs.webkit.org/show_bug.cgi?id=184490
<rdar://problem/39385169>
Reviewed by Geoffrey Garen.
We should not append the blob to the FormData when it is a file but has no path. It broke
the submission since the request was failing to read the file in FormDataStreamCFNet.h:156
Test: http/tests/local/formdata/send-form-data-with-empty-file.html
* platform/network/FormData.cpp:
(WebCore::FormData::appendMultiPartFileValue):
2018-04-24 Zalan Bujtas <zalan@apple.com>
Fix project file after r230931.
* WebCore.xcodeproj/project.pbxproj:
2018-04-24 Jer Noble <jer.noble@apple.com>
Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
https://bugs.webkit.org/show_bug.cgi?id=184786
Reviewed by Tim Horton.
* Configurations/WebCore.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
2018-04-24 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Remove dead fixed layer code
https://bugs.webkit.org/show_bug.cgi?id=184912
Reviewed by Michael Catanzaro.
Remove CoordinatedGraphicsLayer::setFixedToViewport() and the
corresponding attribute on the CoordinatedGraphicsLayerState struct.
The method is not called anywhere since r230952.
CoordinatedGraphicsState struct also loses the scrollPosition attribute
that also isn't used anymore.
Changes to GraphicsLayerTextureMapper class mirror those made to
CoordinatedGraphicsLayer, removing support for the fixed-to-viewport
attribute. This too was not called from anywhere.
All that enables us removing fixed-to-viewport handling in the
TextureMapperLayer class. Along with related changes in the
CoordinatedGraphicsScene class, we're able to remove a bunch of methods
and member variables that are not used or needed anymore.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::setFixedToViewport): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeTransformsRecursive):
(WebCore::TextureMapperLayer::setFixedToViewport): Deleted.
(WebCore::TextureMapperLayer::isAncestorFixedToViewport const): Deleted.
(WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::setFixedToViewport): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
2018-04-24 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Remove unused fixed layout functionality
https://bugs.webkit.org/show_bug.cgi?id=184908
Reviewed by Carlos Garcia Campos.
Ports using the CoordinatedGraphics subsystem don't expose fixed layout
support. As such, we're able to remove a lot of unused code and
unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
in both WebCore and WebKit.
With fixed layout not available for use to users of the GTK+ and WPE
ports, we can remove the ScrollingCoordinatorCoordinatedGraphics
implementation, making room for an implementation that inherits from
AsyncScrollingCoordinator in the future. For that purpose the
ScrollingCoordinator::create() function is moved into the
ScrollingCoordinatorCoordinatedGraphics.cpp file already.
This also enables removing delegatedScrollRequested() method from
HostWindow and the inheriting ChromeClient interface.
* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::delegatedScrollRequested): Deleted.
* page/Chrome.h:
* page/ChromeClient.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::create):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinator::create):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate): Deleted.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Removed.
* platform/HostWindow.h:
2018-04-24 Daniel Bates <dabates@apple.com>
Attempt to fix the Apple Internal build following r230922
(https://bugs.webkit.org/show_bug.cgi?id=184737)
Cast the return value of std::map::size() to a size_t before logging it with format specifier
"%zu". std::map::size() returns a size_type. According to <http://en.cppreference.com/w/cpp/container/map>
size_type is "usually a size_t", but it may not be. An Apple Internal debug builder reports
that size_type = unsigned int != unsigned long = size_t.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
2018-04-24 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Avoid painting backing stores for zero-opacity layers
https://bugs.webkit.org/show_bug.cgi?id=184143
Reviewed by Carlos Garcia Campos.
Skip generating backing stores for layers that have zero opacity and do
not animate the opacity value. In the current CoordinatedGraphics system
this can end up saving loads of memory on Web content that deploys a
large number of such elements.
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::shouldHaveBackingStore const):
2018-04-24 Daniel Bates <dabates@apple.com>
Attempt to fix the Apple Internal build following r230944
(https://bugs.webkit.org/show_bug.cgi?id=159464)
* platform/network/mac/CookieJarMac.mm:
2018-04-24 Daniel Bates <dabates@apple.com>
Another attempt to fix the Mac and iOS build following r230944
(https://bugs.webkit.org/show_bug.cgi?id=159464)
* platform/network/mac/CookieJarMac.mm:
(WebCore::policyProperties):
2018-04-24 Daniel Bates <dabates@apple.com>
Attempt to fix the Mac and iOS build following r230944
(https://bugs.webkit.org/show_bug.cgi?id=159464)
* platform/network/mac/CookieJarMac.mm:
(WebCore::policyProperties):
2018-04-23 Daniel Bates <dabates@apple.com>
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>
Reviewed by Brent Fulgham.
Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
The implementation is materially consistent with the spec. though implements the computation
for a document's "site for cookies" indirectly as part of loading its frame. This is done to
avoid traversing the frame tree on each subresource request initiated by the document or one
of its workers. We take advantage of the fact that Web Workers and Service Workers use their
host document's loader to load resources on their behalf to use the correct "site for cookies"
for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
host document's "site for cookies" in the worker's script execution context.
The implementation differs from the spec. in the handling of about: URLs and the empty URL
and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
(16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
are treated as same-site because these URLs inherit their origin from their owner.
Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
http/tests/cookies/same-site/fetch-in-about-blank-page.html
http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
http/tests/cookies/same-site/fetch-in-cross-origin-page.html
http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
http/tests/cookies/same-site/fetch-in-same-origin-page.html
http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
http/tests/cookies/same-site/fetch-in-same-origin-worker.html
http/tests/cookies/same-site/popup-cross-site-post.html
http/tests/cookies/same-site/popup-cross-site.html
http/tests/cookies/same-site/popup-same-site-post.html
http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
http/tests/cookies/same-site/popup-same-site.html
* Sources.txt: Add source file SameSiteInfo.cpp.
* WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
(WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
(WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
* dom/Document.h:
(WebCore::Document::firstPartyForSameSiteCookies const): Added.
(WebCore::Document::setFirstPartyForSameSiteCookies): Added.
* loader/CookieJar.cpp:
(WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
(WebCore::cookies): Pass the same-site info down to the platform.
(WebCore::cookieRequestHeaderFieldProxy): Ditto.
(WebCore::setCookies): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
(WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
here. Specifically, we would not need to differentiate between a request with an unspecified
same-site state (default state of a new request) from a request whose same-site state has
been explicitly set if we can assume that the same-site state of a request is set exactly
once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
same-site information computed with a null initiating document (the case of a new address bar
initiated load) from a load initiated by the document associated with this loader.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
same-site cookies ("site for cookies").
(WebCore::FrameLoader::load): Add same-site info to the request.
(WebCore::FrameLoader::reload): Ditto.
(WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
(WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
same-site info then compute it and add it to the request. Mark main frame main resource
requests as a "top-site".
(WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
(WebCore::createWindow): Add same-site info to the request.
* loader/FrameLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Ditto.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
* page/SecurityPolicy.h:
* platform/CookiesStrategy.h:
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary): Pass the same-site info down to the platform.
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
(WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
* platform/network/PlatformCookieJar.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
(WebCore::ResourceRequestBase::isSameSite const): Added.
(WebCore::ResourceRequestBase::setIsSameSite): Added.
(WebCore::ResourceRequestBase::isTopSite const): Added.
(WebCore::ResourceRequestBase::setIsTopSite): Added.
(WebCore::equalIgnoringHeaderFields):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
for more details.
(WebCore::registrableDomainsAreEqual): Added.
(WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
(WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
* platform/network/SameSiteInfo.cpp: Added.
(WebCore::SameSiteInfo::create):
* platform/network/SameSiteInfo.h: Added.
(WebCore::SameSiteInfo::encode const):
(WebCore::SameSiteInfo::decode):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::setCookiesFromDOM): Pass Same-Site info down.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookiesForDOM): Pass Same-Site info down.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
(WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
* platform/network/curl/CookieJarCurlDatabase.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest): Ditto.
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion.
(WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
CFNetwork helper functions. Modified to support fetching same-site cookies.
(WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
case-insensitively matches "https".
(WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
(WebCore::cookiesForSession): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::getRawCookies): Ditto.
(WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
attribute when fetching cookies to delete.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
the script URL.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
new document.
2018-04-23 Youenn Fablet <youenn@apple.com>
Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184763
Reviewed by Chris Dumez.
No change of behavior yet since we do not use these parameters in NetworkProcess yet.
Add PreflightPolicy and CSP response headers as ResourceLoaderOptions.
This allows passing them from DocumentThreadableLoader to WebLoaderStrategy.
Allow getting the original headers from a SubresourceLoader.
This allows passing them from DocumentThreadableLoader down to WebLoaderStrategy.
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::originalHeaders const):
* loader/SubresourceLoader.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
(WebCore::ThreadableLoaderOptions::isolatedCopy const):
* loader/ThreadableLoader.h:
* page/EventSource.cpp:
(WebCore::EventSource::connect):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
2018-04-23 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Remove WlUniquePtr<wl_display> footgun
https://bugs.webkit.org/show_bug.cgi?id=184405
Reviewed by Carlos Garcia Campos.
WlUniquePtr<wl_display> is a pretty big footgun because there are two different destruction
functions -- wl_display_disconnect() and wl_display_destroy() -- and which one you need to
use depends on how the wl_display() was created, and WebKit uses both in different places.
So WlUniquePtr<wl_display> is pretty unsafe. See bug #176490 for an example of fun caused
by using it incorrectly.
Let's use std::unique_ptr with custom deleter functors instead.
* platform/graphics/wayland/WlUniquePtr.h:
2018-04-23 Antti Koivisto <antti@apple.com>
REGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In or Sign Up
https://bugs.webkit.org/show_bug.cgi?id=182859
<rdar://problem/37595065>
Reviewed by Zalan Bujtas.
Roll out this change from the trunk as the issue it fixed no longer occurs.
* css/MediaQueryEvaluator.cpp:
(WebCore::orientationEvaluate):
(WebCore::aspectRatioEvaluate):
(WebCore::heightEvaluate):
(WebCore::widthEvaluate):
* page/FrameView.cpp:
(WebCore::FrameView::layoutSizeForMediaQuery const): Deleted.
* page/FrameView.h:
* page/LayoutContext.cpp:
(WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
2018-04-23 Daniel Bates <dabates@apple.com>
Another attempt to fix the Windows build following r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)
Pass dictionary key name using a string instead of a constant and pass CFURL* to
siteForCookies().
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
2018-04-23 Zalan Bujtas <zalan@apple.com>
[LayoutFormattingContext] Initial commit.
https://bugs.webkit.org/show_bug.cgi?id=184896
Reviewed by Antti Koivisto.
This is the initial commit of the new layout component -class definitions only (and mostly public functions).
See the header files (and Tools/LayoutReloaded project) for more information.
// Top level layout.
rootContainer = TreeBuilder::createLayoutTree(document);
rootDisplayBox = new Display::Box();
rootDisplayBox->setSize(viewportSize);
layoutContext = new LayoutContext(rootContainer, rootDisplayBox);
layoutContext->layout(rootContainer);
Driven by build time flag (currently off). Not testable yet.
* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/BlockFormatting/BlockFormattingContext.cpp: Added.
* layout/BlockFormatting/BlockFormattingContext.h: Added.
* layout/BlockFormatting/BlockFormattingState.cpp: Added.
* layout/BlockFormatting/BlockFormattingState.h: Added.
* layout/BlockFormatting/BlockMarginCollapse.cpp: Added.
* layout/BlockFormatting/BlockMarginCollapse.h: Added.
* layout/DisplayTree/DisplayBox.cpp: Added.
* layout/DisplayTree/DisplayBox.h: Added.
* layout/FloatingContext.cpp: Added.
* layout/FloatingContext.h: Added.
* layout/FloatingState.cpp: Added.
* layout/FloatingState.h: Added.
* layout/FormattingContext.cpp: Added.
* layout/FormattingContext.h: Added.
* layout/FormattingState.cpp: Added.
* layout/FormattingState.h: Added.
* layout/InlineFormatting/InlineFormattingContext.cpp: Added.
* layout/InlineFormatting/InlineFormattingContext.h: Added.
* layout/InlineFormatting/InlineFormattingState.cpp: Added.
* layout/InlineFormatting/InlineFormattingState.h: Added.
* layout/LayoutCtx.cpp: Added.
* layout/LayoutCtx.h: Added.
* layout/LayoutTree/LayoutBlockContainer.cpp: Added.
* layout/LayoutTree/LayoutBlockContainer.h: Added.
* layout/LayoutTree/LayoutBox.cpp: Added.
* layout/LayoutTree/LayoutBox.h: Added.
* layout/LayoutTree/LayoutContainer.cpp: Added.
* layout/LayoutTree/LayoutContainer.h: Added.
* layout/LayoutTree/LayoutCtx.h: Added.
* layout/LayoutTree/LayoutInlineBox.cpp: Added.
* layout/LayoutTree/LayoutInlineBox.h: Added.
* layout/LayoutTree/LayoutInlineContainer.cpp: Added.
* layout/LayoutTree/LayoutInlineContainer.h: Added.
2018-04-23 Daniel Bates <dabates@apple.com>
Attempt to fix the Mac and iOS build after r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)
Pass strings for the dictionary key names instead of using an extern constant as the
latter may not be available on all systems.
* platform/network/mac/CookieJarMac.mm:
(WebCore::setHTTPCookiesForURL):
2018-04-23 Daniel Bates <dabates@apple.com>
Attempt to fix the build after r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)
Pass Same-Site info through.
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):
2018-04-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, speculative macOS build fix attempt.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
2018-04-23 Daniel Bates <dabates@apple.com>
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>
Reviewed by Brent Fulgham.
Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
The implementation is materially consistent with the spec. though implements the computation
for a document's "site for cookies" indirectly as part of loading its frame. This is done to
avoid traversing the frame tree on each subresource request initiated by the document or one
of its workers. We take advantage of the fact that Web Workers and Service Workers use their
host document's loader to load resources on their behalf to use the correct "site for cookies"
for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
host document's "site for cookies" in the worker's script execution context.
The implementation differs from the spec. in the handling of about: URLs and the empty URL
and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
(16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
are treated as same-site because these URLs inherit their origin from their owner.
Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
http/tests/cookies/same-site/fetch-in-about-blank-page.html
http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
http/tests/cookies/same-site/fetch-in-cross-origin-page.html
http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
http/tests/cookies/same-site/fetch-in-same-origin-page.html
http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
http/tests/cookies/same-site/fetch-in-same-origin-worker.html
http/tests/cookies/same-site/popup-cross-site-post.html
http/tests/cookies/same-site/popup-cross-site.html
http/tests/cookies/same-site/popup-same-site-post.html
http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
http/tests/cookies/same-site/popup-same-site.html
* Sources.txt: Add source file SameSiteInfo.cpp.
* WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
(WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
(WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
* dom/Document.h:
(WebCore::Document::firstPartyForSameSiteCookies const): Added.
(WebCore::Document::setFirstPartyForSameSiteCookies): Added.
* loader/CookieJar.cpp:
(WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
(WebCore::cookies): Pass the same-site info down to the platform.
(WebCore::cookieRequestHeaderFieldProxy): Ditto.
(WebCore::setCookies): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
(WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
here. Specifically, we would not need to differentiate between a request with an unspecified
same-site state (default state of a new request) from a request whose same-site state has
been explicitly set if we can assume that the same-site state of a request is set exactly
once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
same-site information computed with a null initiating document (the case of a new address bar
initiated load) from a load initiated by the document associated with this loader.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
same-site cookies ("site for cookies").
(WebCore::FrameLoader::load): Add same-site info to the request.
(WebCore::FrameLoader::reload): Ditto.
(WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
(WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
same-site info then compute it and add it to the request. Mark main frame main resource
requests as a "top-site".
(WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
(WebCore::createWindow): Add same-site info to the request.
* loader/FrameLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Ditto.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
* page/SecurityPolicy.h:
* platform/CookiesStrategy.h:
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary): Pass the same-site info down to the platform.
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
(WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
* platform/network/PlatformCookieJar.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
(WebCore::ResourceRequestBase::isSameSite const): Added.
(WebCore::ResourceRequestBase::setIsSameSite): Added.
(WebCore::ResourceRequestBase::isTopSite const): Added.
(WebCore::ResourceRequestBase::setIsTopSite): Added.
(WebCore::equalIgnoringHeaderFields):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
for more details.
(WebCore::registrableDomainsAreEqual): Added.
(WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
(WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
* platform/network/SameSiteInfo.cpp: Added.
(WebCore::SameSiteInfo::create):
* platform/network/SameSiteInfo.h: Added.
(WebCore::SameSiteInfo::encode const):
(WebCore::SameSiteInfo::decode):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::setCookiesFromDOM): Pass Same-Site info down.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookiesForDOM): Pass Same-Site info down.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
(WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
* platform/network/curl/CookieJarCurlDatabase.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest): Ditto.
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion.
(WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
CFNetwork helper functions. Modified to support fetching same-site cookies.
(WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
case-insensitively matches "https".
(WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
(WebCore::cookiesForSession): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::getRawCookies): Ditto.
(WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
attribute when fetching cookies to delete.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
the script URL.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
new document.
2018-04-23 Chris Dumez <cdumez@apple.com>
HTML String load cannot be prevented by responding 'Cancel' asynchronously in decidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=184848
<rdar://problem/39145306>
Reviewed by Brady Eidson.
When calling loadHTMLString on a WebView, we end up doing a load for 'about:blank'
with substitute data. In such case, we want to do a regular asynchronous policy
delegate check, there is no reason we need it to be synchronous. Update our check
to make sure we only do a synchronous policy check for initial 'about:blank' loads
that do not have substitute data.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2018-04-23 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184871
<rdar://problem/39477595>
Reviewed by Andy Estes.
Currently, when computing CSS viewport units, we use ViewportConfiguration::initialScaleIgnoringContentSize().
This method computes an initial scale from the layout width and height without relying on any information
derived from the current content size. This is done to ensure that the content size and viewport dimensions for
CSS viewport units should not be simultaneously dependent on each other.
Since shrink-to-fit heuristics depend on content size, we currently assume that shrink-to-fit is disabled when
computing initialScaleIgnoringContentSize, by always passing in `false` for `shouldIgnoreScalingConstraints`.
However, in extra zoom mode, the opposite is true: since we force both `m_canIgnoreScalingConstraints` and
`m_forceHorizontalShrinkToFit` to be `true` in this mode, we will always try to shrink-to-fit regardless of
content size.
Because of this shrink-to-fit disparity between `initialScale` and `initialScaleIgnoringContentSize`, viewport
units in extra zoom mode are currently computed assuming an initial scale set by the page, whereas the real
viewport is scaled to fit, which causes any lengths computed in terms of vw and vh to be incorrect. To fix this,
we introduce a version of shouldIgnoreScalingConstraints() that returns `true` iff scaling constraints are
always ignored, regardless of content size. We then use this in initialScaleIgnoringContentSize, instead of
always passing in `false` for `shouldIgnoreScalingConstraints`.
Test: fast/css/extrazoom/viewport-units-shrink-to-fit.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::initialScaleIgnoringContentSize const):
* page/ViewportConfiguration.h:
2018-04-23 Zalan Bujtas <zalan@apple.com>
[Simple line layout] Generate inline boxtree using simple line layout runs.
https://bugs.webkit.org/show_bug.cgi?id=184833
Reviewed by Antti Koivisto.
RenderBlockFlow::ensureLineBoxes triggers line layout on the block content to replace
the simple line layout runs with an inline boxtree. The runs generated by the fast path
should always match the inline tree boxes.
In this patch instead of triggering layout, we just convert the simple line runs to
inline boxes.
Currently, it works with only one, non-paginated text renderer, but we should be
able to extend it to all the simple line layout content.
Covered by existing tests.
* rendering/InlineBox.h:
(WebCore::InlineBox::setHasHyphen):
(WebCore::InlineBox::setCanHaveLeadingExpansion):
(WebCore::InlineBox::setCanHaveTrailingExpansion):
(WebCore::InlineBox::setForceTrailingExpansion):
(WebCore::InlineBox::setForceLeadingExpansion):
(WebCore::InlineBox::hasHyphen const):
(WebCore::InlineBox::canHaveLeadingExpansion const):
(WebCore::InlineBox::canHaveTrailingExpansion const):
(WebCore::InlineBox::forceTrailingExpansion const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderBlockFlow.h:
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::segmentForRun const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::canUseForLineBoxTree):
(WebCore::SimpleLineLayout::initializeInlineBox):
(WebCore::SimpleLineLayout::generateLineBoxTree):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForLine const):
* rendering/SimpleLineLayoutResolver.h:
2018-04-23 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=184881
Reviewed by Michael Catanzaro.
Remove the redundant findFirstDescendantWithContentsRecursively() and
setVisibleContentRectTrajectoryVector() methods on the
CoordinatedGraphicsLayer class.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively): Deleted.
(WebCore::CoordinatedGraphicsLayer::setVisibleContentRectTrajectoryVector): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2018-04-23 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
https://bugs.webkit.org/show_bug.cgi?id=184880
Reviewed by Michael Catanzaro.
Drop the m_supportsAlpha member from the TiledBackingStore class. The
member value was unused. TiledBackingStore::setSupportsAlpha() method
is removed.
TiledBackingStore::setSupportsAlpha() invalidated the backing store,
so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
behavior by manually updating the m_needsDisplay struct. This means
that during the following layer flush the backing store is repainted
in its entirety.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
2018-04-23 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
https://bugs.webkit.org/show_bug.cgi?id=184650
Reviewed by Philippe Normand.
In the playbin3 case we can assume that if the GstStream is selected by default,
it is the Main track of that kind.
No new tests are added as:
* It relies on playbin3 case which support might be compiled out
* we already have a few test that are currently disabled in the mediastream
testsuite. This patch is part of the work to enable them.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2018-04-23 Alicia Boya García <aboya@igalia.com>
[MSE] Add allSamplesInTrackEnqueued event
https://bugs.webkit.org/show_bug.cgi?id=184737
MediaSource has a .endOfStream() method to signal when there are no more frames
after the ones currently buffered.
This bit of data is important for some multimedia frameworks. For instance, in
GStreamer a stream of frames being decoded should be terminated by a
'end-of-stream' (EOS) event that has a similar meaning. Some GStreamer elements
will expect this event in order to work properly under some circumstances.
Unfortunately currently WebKit provides no mechanism for this: an event of
sorts should be emitted after no more frames are going to be enqueued to signal
the end of the stream. The closest mechanism WebKit has for this is
`markEndOfStream()`, but it's not exactly the same: markEndOfStream() informs
that -- as far as network buffering is concerned -- we are done; but at that
point there may still be (and often are) many frames waiting in the
decodeQueue, so it would be wrong to signal the decoder that there are no more
frames.
This patch introduces a new optional method in SourceBufferPrivate,
`allSamplesInTrackEnqueued(const AtomicString& trackID)` that is called
whenever the MediaSource is in "ended" state (the user has called
`MediaSource.endOfStream()`) and the decodeQueue is empty. Media framework
implementations can use this method to send a EOS event to a decoder that needs
it.
Reviewed by Xabier Rodriguez-Calvar.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::streamEndedWithError):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2018-04-23 Ms2ger <Ms2ger@igalia.com>
Avoid uninitialized memory read.
https://bugs.webkit.org/show_bug.cgi?id=184505
<rdar://problem/39348325>
Reviewed by Dean Jackson.
Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html
* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):
2018-04-23 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
https://bugs.webkit.org/show_bug.cgi?id=184810
Reviewed by Carlos Garcia Campos.
Turn TextureMapperBackingStore into a simple interface that doesn't
inherit from RefCounted<>. Instead, push that inheritance off to the
classes that implement the TextureMapperBackingStore interface. This
narrows down the purpose of TextureMapperBackingStore towards a simple
interface that TextureMapper algorithms can work with.
TextureMapperLayer has its m_backingStore member variable turn into
a simple pointer instead of a RefPtr<>. Setter method and call sites of
that method are updated to reflect that.
TextureMapperTiledBackingStore now inherits from RefCounted<> directly,
instead of through TextureMapperBackingStore.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setBackingStore):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2018-04-22 Zan Dobersek <zdobersek@igalia.com>
[AsyncScrolling] Add generic ScrollingThread implementation
https://bugs.webkit.org/show_bug.cgi?id=184809
Reviewed by Yusuke Suzuki.
Add a generic ScrollingThread implementation that internally uses
RunLoop facilities to run the scrolling thread and dispatch
callbacks on that thread.
ScrollingThread::initializeRunLoop() retrieves address of the
thread-specific RunLoop and signals the Condition object.
ScrollingThread::wakeUpRunLoop() uses RunLoop::dispatch() to schedule
callback dispatches on the scrolling thread.
ScrollingThread::createThreadIfNeeded() mimics Cocoa implementation and
waits for the RunLoop address to be retrieved before continuing.
* SourcesGTK.txt: Add to build.
* SourcesWPE.txt: Ditto.
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded):
* page/scrolling/ScrollingThread.h:
* page/scrolling/generic/ScrollingThreadGeneric.cpp: Added.
(WebCore::ScrollingThread::initializeRunLoop):
(WebCore::ScrollingThread::wakeUpRunLoop):
2018-04-22 Zan Dobersek <zdobersek@igalia.com>
[CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
https://bugs.webkit.org/show_bug.cgi?id=184811
Reviewed by Carlos Garcia Campos.
Remove the unused contentsSize and coveredRect attributes on the
CoordinatedGraphicsState struct. CoordinatedGraphicsLayer::coverRect()
method is now unused and can also be removed.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2018-04-21 Daniel Bates <dabates@apple.com>
Cleanup CookieRequestHeaderFieldProxy
https://bugs.webkit.org/show_bug.cgi?id=184868
Remove extraneous whitespace that I inadvertently added.
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::decode):
2018-04-21 Daniel Bates <dabates@apple.com>
Cleanup CookieRequestHeaderFieldProxy
https://bugs.webkit.org/show_bug.cgi?id=184868
Reviewed by Youenn Fablet.
Simplify the struct CookieRequestHeaderFieldProxy and make it consistent with other structs.
Among other changes, remove constructors for CookieRequestHeaderFieldProxy as they are
unnecessary as all supported compilers support non-static data member initializers (NSDMI)
for aggregates, remove prefix "m_" from the name of fields as this is struct exists for
convenience and offers no encapsulation and simplify decoding logic of this struct.
No functionality changed. So, no new tests.
* loader/CookieJar.cpp:
(WebCore::cookieRequestHeaderFieldProxy):
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):
(WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy): Deleted.
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):
2018-04-21 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Show a loading indicator after pressing the play button in compact mode
https://bugs.webkit.org/show_bug.cgi?id=184863
<rdar://problem/38939468>
Reviewed by Dean Jackson.
We now display a loading indicator after pressing the play button when in compact mode. We also update the
behavior to use assets provided through WebKitAdditions (see webkit.org/b/184862) for the play button and
the invalid icon. Additionally, we always show a 20% opaque black overlay in the background while any piece
of user interface is up.
* Modules/modern-media-controls/controls/compact-activity-indicator.css: Added.
(button.compact-activity-indicator > picture): The loading indicator asset is a sprite made of 23 frames, so
we specify the mask size (since all buttons are rendered via a mask) to be 23 * 100% the rendered size. The
display of the loading indicator is performed with a first intro animation which runs once through the first
8 frames and then a continuously looping animation going through the remaining frames. We use a frames()
timing function to achieve the frame-by-frame effect while using only from/to keyframe animations. When we
fade out, we use a simply opacity fade, which is combined with the spinning animation. We use CSS variables
to encode both animations so they can be used combined or one at a time without redefining the whole animation
property.
(button.compact-activity-indicator.spins > picture): Use the "spins" animation variable when spinning.
(button.compact-activity-indicator.spins.fades-out > picture): Combine the "spins" and "fades-out" animation
variables when fading out.
(@keyframes compact-activity-indicator-intro): Animation going through the first 8 frames of the loading indicator.
(@keyframes compact-activity-indicator-loop): Animation going through the remaining frames of the loading indicator.
(@keyframes compact-activity-indicator-fades-out): Animation fading opacity from 1 to 0.
* Modules/modern-media-controls/controls/compact-activity-indicator.js: Added.
(CompactActivityIndicator):
(CompactActivityIndicator.prototype.show): Add the "spins" CSS class to show the control spinning with the intro animation.
(CompactActivityIndicator.prototype.hide): Add the "fades-out" CSS class to hide the control, removing both this class and
the "spins" class when the fade-out animation completes.
* Modules/modern-media-controls/controls/compact-media-controls.css: Added.
(.media-controls.compact:before): Add a 20% black overlay over the video frame to provide contrast for controls.
(.media-controls.compact button): Ensure buttons are sized to use the entire video frame so that their hit region
comprises the whole video frame.
(.media-controls.compact button > picture): Override default blending styles for a simple solid white mask.
(.media-controls.compact button:active > picture): Turn off the scale down effect when pressing a button.
* Modules/modern-media-controls/controls/compact-media-controls.js: Expose a "state" property for the compact media controls,
which can be exlusively one of three: "paused", "pending" and "invalid".
(CompactMediaControls.):
(CompactMediaControls.prototype.get state):
(CompactMediaControls.prototype.set state):
(CompactMediaControls.prototype.layout): In the "paused" state, show the play button. In the "pending" state show
the loading indicator. In the "invalid" state show the invalid button.
(CompactMediaControls.prototype.get placard): Deleted.
(CompactMediaControls.prototype.set placard): Deleted.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/compact-media-controls-support.js: Added.
(CompactMediaControlsSupport.prototype.get mediaEvents):
(CompactMediaControlsSupport.prototype.handleEvent): Make the controls enter the "paused" state when receiving a "pause"
event. Make the controls enter the "invalid" state when receiving an "error" event.
(CompactMediaControlsSupport.prototype.enable):
(CompactMediaControlsSupport.prototype.disable):
(CompactMediaControlsSupport.prototype.buttonWasPressed): Play the media when pressing the play button and make the controls
enter the "pending" state. When pressing the loading indicator, pause the media and make the controls enter the "paused" state.
(CompactMediaControlsSupport.prototype._buttons):
(CompactMediaControlsSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._supportingObjectClasses): Only use CompactMediaControlsSupport as a media controller supporting object
in the compact mode.
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents): This media controller support object no longer needs to deal with compact mode.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): This media controller support object no longer needs to deal with compact mode.
(PlaybackSupport):
2018-04-21 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Obtain compact mode icons through WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=184862
<rdar://problem/39621645>
Reviewed by Jon Lee.
* Modules/modern-media-controls/controls/button.js:
(Button.prototype._updateImageMetrics): Handle PDF assets where the image source's intrinsic size needs
to be adjusted for the device pixel density.
(Button):
* Modules/modern-media-controls/controls/icon-service.js: Expect three additional icons provided through
WebKitAdditions, including two in the PDF format, so we add support for this format.
* WebCore.xcodeproj/project.pbxproj: Copy additional assets from the WebKitAdditions build directory should
any be present.
2018-04-21 Dean Jackson <dino@apple.com>
Expose whether you've build with the Apple Internal SDK
https://bugs.webkit.org/show_bug.cgi?id=184864
Reviewed by Wenson Hsieh.
Internals API to let a test know if it is running with the
Apple internal SDK.
* testing/Internals.cpp:
(WebCore::usingAppleInternalSDK const):
* testing/Internals.h:
* testing/Internals.idl:
2018-04-20 Nan Wang <n_wang@apple.com>
AX: AOM does not work with DOM Level 1 events
https://bugs.webkit.org/show_bug.cgi?id=184847
Reviewed by Chris Fleizach.
Added the accessibility events to the HTML attribute names.
Test cases are added to the existing layout tests.
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
2018-04-20 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept-certificate
https://bugs.webkit.org/show_bug.cgi?id=184804
Reviewed by Michael Catanzaro.
* platform/network/soup/SocketStreamHandleImpl.h: Add a public url getter.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::acceptCertificateCallback): Call SoupNetworkSession::checkTLSErrors() to decide whether to accept the
certificate or not.
(WebCore::connectProgressCallback): Receive the SocketStreamHandle and pass it to acceptCertificateCallback callback.
(WebCore::socketClientEventCallback): Ditto.
(WebCore::SocketStreamHandleImpl::create): Always connect to network events.
(WebCore::wssConnectionAcceptCertificateCallback): Deleted.
(WebCore::wssSocketClientEventCallback): Deleted.
2018-04-20 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Do TLS error checking on GTlsConnection::accept-certificate
https://bugs.webkit.org/show_bug.cgi?id=184480
Reviewed by Michael Catanzaro.
* platform/network/soup/ResourceError.h: Change tlsError to recieve a failing URL instead of a SoupRequest,
since the request was only used to get the failing URL.
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::ResourceError::tlsError): Use the given failing URL.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Use ssl-strict when creating the SoupSession to handle the
certificates ourselves by connecting to GTlsConnection::accept-certificate.
(WebCore::SoupNetworkSession::checkTLSErrors): Updated to receive a URL, certificate and errors instead of
receiving a SoupRequest and SoupMessage and extract the url, certirficate and errors from them. Also return the
optional error directly instead of using a completion handler since the function is always synchronous.
* platform/network/soup/SoupNetworkSession.h:
2018-04-20 Tim Horton <timothy_horton@apple.com>
Adjust geolocation feature flag
https://bugs.webkit.org/show_bug.cgi?id=184856
Reviewed by Wenson Hsieh.
* Configurations/FeatureDefines.xcconfig:
2018-04-20 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix Windows build after r230875.
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:
2018-04-20 Chris Dumez <cdumez@apple.com>
REGRESSION (r229828): web view doesnt update or respond to resizing until client calls policy decision handler
https://bugs.webkit.org/show_bug.cgi?id=184210
<rdar://problem/39072354>
Reviewed by Wenson Hsieh.
r229828 tried to have some API tests happy on iOS by freezing the layer tree
during the navigation policy decision. However, this is observable by the client
application and a regression from when the policy delegate was synchronous.
To address the issue, this patch reverts r229828 and instead updates the iOS
API tests to wait for the next presentation update after navigating
before interacting with the view.
* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2018-04-20 Brent Fulgham <bfulgham@apple.com>
Limit cookie header access to Network process
https://bugs.webkit.org/show_bug.cgi?id=184764
<rdar://problem/36785285>
Reviewed by Youenn Fablet.
Revise the handling of cookie request headers so that we don't interact with them in the
WebContent process. They are only needed for interaction with the server and the network
process, so we should limit their scope to just the Network process.
Instead, we should handle a token that represents the cookie headers in the WebContent
process, which can be converted to the relevant cookie data in the network process when
needed.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeMessage const):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
(WebCore::WebSocketHandshake::clientHandshakeMessage): Deleted.
(WebCore::WebSocketHandshake::clientHandshakeRequest): Deleted.
* Modules/websockets/WebSocketHandshake.h:
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::cookieRequestHeaderFieldProxy):
* loader/CookieJar.h:
* platform/network/CookieRequestHeaderFieldProxy.h: Added.
(WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy):
(WebCore::CookieRequestHeaderFieldProxy::isolatedCopy const):
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):
* platform/network/PlatformCookieJar.h:
* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::sendHandshake):
* platform/network/SocketStreamHandle.h:
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::SocketStreamHandleImpl::platformSendHandshake):
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/SocketStreamHandleImpl.h:
2018-04-20 Daniel Bates <dabates@apple.com>
Hide Strong Password label when text field is too narrow
https://bugs.webkit.org/show_bug.cgi?id=184785
<rdar://problem/38183939>
Reviewed by Zalan Bujtas.
We accomplish this illusion by allowing the text field's decorations to wrap, specifying flex
shrink factors, a flex basis and hiding overflow. Hiding overflow is accomplished by a
combination of setting "overflow: hidden", "text-overflow: clip", and patching RenderTextControlSingleLine::layout()
to ensure that the height of the container element is equal to the intrinsic height of the
inner elements. Because the container is a flex box and we want to vertically center its
contents we also need to fix up the y-position of the container element as it may have flexed
as a result of forcing its height to match the intrinsic height of the inner elements.
* css/html.css:
(input::-webkit-strong-password-auto-fill-button): Specify a flex-shrink factor and prevent
wrapping of the "Strong Password" text when flexed.
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::TextControlInnerContainer): Register for a custom style
resolution callback so that we can style the container if it is a Strong Password or Strong
Confirmation Password text field. Ideally we could accomplish this effect with a user agent-
specific pseudo class together with a selector definition in the user agent style sheet,
html.css. Unfortunately the style resolver does not seem to apply pseudo classes to
shadow DOM pseudo elements (why?). Therefore we use a custom style resolution callback to
achieve the same effect.
(WebCore::isStrongPasswordTextField): Returns whether the specified DOM element is a Strong
Password text field.
(WebCore::TextControlInnerContainer::resolveCustomStyle): Conditionally apply CSS properties
"flex-wrap: wrap" and overflow: hidden" if the shadow host of this container is a Strong
Password text field.
(WebCore::TextControlInnerElement::resolveCustomStyle): Conditionally style the inner text
if the shadow host of this container is a Strong Password text field. We need to apply these
styles here as opposed to in html.css for the same reason we need to apply the styles to
the container in a custom style resolution callback. See the comments for TextControlInnerContainer()
above for more details
* html/shadow/TextControlInnerElements.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::resetOverriddenHeight): Added. Incorporates the logic from setNeedsLayoutOnAncestors().
(WebCore::RenderTextControlSingleLine::layout): Override the height of the container element to
match the height of the inner elements when this text field is a Strong Password field. We cache
the container's logical top before adjusting its height so that we can restore it after performing
a second layout of this renderer. This is needed because we vertically center the elements in this
renderer and adjusting the height of the container may cause it to flex and re-position along its
cross axis when the container's height is taller than the inner element's height (e.g. the "Strong
Password" label wraps to the next line). This re-positioning causes a noticeable jitter when
transitioning from a field that has a visible "Strong Password" label to one that does not. Caching
and restoring the logical top of the container element avoids this jitter.
(WebCore::setNeedsLayoutOnAncestors): Deleted. Moved its implementation into resetOverriddenHeight().
2018-04-20 Dean Jackson <dino@apple.com>
Render a badge on system preview images
https://bugs.webkit.org/show_bug.cgi?id=184854
<rdar://problem/39615154>
Reviewed by Tim Horton.
At paint time, if a RenderImage is an image element
which is identified as a system preview, then draw
a little badge in the top right corner.
It is expected that platforms will override the
default rendering with something that identifies
how a system preview will operate. e.g. QuickLook
on Apple systems.
Test: system-preview/badge.html
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): If we are
a system preview, call RenderTheme to draw a badge.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSystemPreviewBadge): A default
implementation that draws a red circle.
* rendering/RenderTheme.h:
2018-04-20 Brian Burg <bburg@apple.com>
Web Inspector: remove some dead code in IdentifiersFactory
https://bugs.webkit.org/show_bug.cgi?id=184839
Reviewed by Timothy Hatcher.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::setProcessId): Deleted.
* inspector/InspectorController.h:
2018-04-20 Chris Dumez <cdumez@apple.com>
Use WindowProxy in DOMWindow.idl
https://bugs.webkit.org/show_bug.cgi?id=184820
Reviewed by Sam Weinig.
Use WindowProxy in DOMWindow.idl to match the specification more closely.
* bindings/js/JSWindowProxy.h:
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::window const):
* bindings/js/WindowProxy.h:
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValueDOMConvertNeedsState):
* dom/Document.cpp:
* dom/Document.h:
* dom/Document.idl:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus):
(WebCore::DOMWindow::self const):
(WebCore::DOMWindow::opener const):
(WebCore::DOMWindow::parent const):
(WebCore::DOMWindow::top const):
(WebCore::DOMWindow::open):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend):
* testing/Internals.h:
* testing/Internals.idl:
2018-04-20 Chris Dumez <cdumez@apple.com>
Update cross-origin SecurityError messages to not include the target origin
https://bugs.webkit.org/show_bug.cgi?id=184803
<rdar://problem/39547724>
Reviewed by Sam Weinig.
No new tests, rebaselined existing tests.
* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::canAccessDocument):
(WebCore::BindingSecurity::shouldAllowAccessToFrame):
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::crossDomainAccessErrorMessage):
(WebCore::DOMWindow::isInsecureScriptAccess):
* page/DOMWindow.h:
* page/Location.cpp:
(WebCore::Location::reload):
2018-04-20 Chris Nardi <cnardi@chromium.org>
Update HSL/HSLA parsing to match CSS Color 4
https://bugs.webkit.org/show_bug.cgi?id=180528
<rdar://problem/35926675>
CSS Color 4 specifies a comma optional syntax for HSL/HSLA, as well as allowing angle values for the
hue and percent alpha values. Update our parsing to match this.
Reviewed by Simon Fraser.
This change also updates the import of WPT css-color to test the changes.
Tests: LayoutTests/imported/w3c/web-platform-tests/css/css-color/hsl{a}-{001-008}.html
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseHSLParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
(WebCore::CSSPropertyParserHelpers::consumeColor):
* platform/graphics/Color.cpp:
(WebCore::calcHue):
(WebCore::makeRGBAFromHSLA):
2018-04-20 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Injected bundle form client should be notified when editing text fields
https://bugs.webkit.org/show_bug.cgi?id=184822
<rdar://problem/38807319>
Reviewed by Tim Horton.
Export the constructor and destructor of UserTypingGestureIndicator for use in WebKit (see WebPage.cpp).
Test: fast/forms/extrazoom/edit-text-field-calls-injected-bundle.html
* dom/UserTypingGestureIndicator.h:
2018-04-18 Jer Noble <jer.noble@apple.com>
Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
https://bugs.webkit.org/show_bug.cgi?id=184762
Reviewed by Dan Bernstein.
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2018-04-20 Daniel Bates <dabates@apple.com>
Remove code for compilers that did not support NSDMI for aggregates
https://bugs.webkit.org/show_bug.cgi?id=184599
Reviewed by Per Arne Vollan.
Remove workaround for earlier Visual Studio versions that did not support non-static data
member initializers (NSDMI) for aggregates. We have since updated all the build.webkit.org
and EWS bots to a newer version that supports this feature.
* Modules/cache/CacheQueryOptions.h:
(WebCore::CacheQueryOptions::CacheQueryOptions): Deleted.
* dom/Node.h:
(WebCore::Node::InsertionType::InsertionType): Deleted.
(WebCore::Node::RemovalType::RemovalType): Deleted.
* html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::CMYKAColor::CMYKAColor): Deleted.
* page/EventHandler.h:
(WebCore::EventHandler::DragTargetResponse::DragTargetResponse): Deleted.
* page/animation/CSSAnimationController.h:
(WebCore::AnimationUpdate::AnimationUpdate): Deleted.
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::FontSelectionRequest::tied const):
(WebCore::FontSelectionRequest::FontSelectionRequest): Deleted.
(WebCore::FontSelectionCapabilities::FontSelectionCapabilities): Deleted.
* platform/mediastream/IceCandidate.h:
(WebCore::IceCandidate::IceCandidate): Deleted.
* platform/text/StringWithDirection.h:
(WebCore::StringWithDirection::StringWithDirection): Deleted.
* rendering/MarkedText.h:
(WebCore::MarkedText::MarkedText): Deleted.
* style/StyleUpdate.h:
(WebCore::Style::ElementUpdate::ElementUpdate): Deleted.
(WebCore::Style::ElementUpdates::ElementUpdates): Deleted.
(WebCore::Style::TextUpdate::TextUpdate): Deleted.
2018-04-20 Youenn Fablet <youenn@apple.com>
WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
https://bugs.webkit.org/show_bug.cgi?id=184369
Reviewed by Chris Dumez.
WebPage does need to check for plugins at reception of the response.
In that case, the page URL is the URL from which we are navigating out.
Add plugin API to check for plugin availability with an extra URL parameter to cover that case.
Covered by API test.
* plugins/PluginData.cpp:
(WebCore::PluginData::supportsWebVisibleMimeTypeForURL const):
(WebCore::PluginData::supportsWebVisibleMimeType const):
* plugins/PluginData.h:
2018-04-20 Daniel Bates <dabates@apple.com>
Remove Strong Password decoration when text field type changes
https://bugs.webkit.org/show_bug.cgi?id=184795
<rdar://problem/38325108>
Reviewed by Antti Koivisto.
Remove the Strong Password decoration when the text field's type changes to avoid interfering
with web sites that allow a person to show/hide their password.
Test: fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
2018-04-20 Javier Fernandez <jfernandez@igalia.com>
Update Alignment shorthands to the spec now that they are not ambiguous
https://bugs.webkit.org/show_bug.cgi?id=184812
Reviewed by Antti Koivisto.
Now that the issue [1] about the syntax ambiguity has been resolved we
don't need to use the custom syntax anymore. The Alignment shorthands
use now the simple syntax, defined based on the longhands' syntax.
Since we allow all the values valid for each longhand, we'll update
in this CL the corresponding web platform tests. Additionally, this CL
updates also the shorthand serialization tests [2], which didn't
consider the new value 'legacy' for justify-items (and place-items) due
to the bug [3] Firefox still has pending to be fixed.
[1] https://github.com/w3c/csswg-drafts/issues/1001
[2] css/css-align/default-alignment/shorthand-serialization-001.html
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1363875
Tests: imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html
imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html
imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html
imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumePlaceContentShorthand): Using the justify-content and align-content parsing logic to parse the shorthand.
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand): Using the justify-items and align-items parsing logic to parse the shorthand.
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand): Using the justify-self and align-self parsing logic to parse the shorthand.
2018-04-20 Daniel Bates <dabates@apple.com>
Unreviewed, rolling out r230117.
Broke find-in-page for PDFs
Reverted changeset:
"ASSERTION FAILED: ASSERT(!containsImage ||
MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
MIMEType])) in -[NSPasteboard(WebExtras)
_web_writePromisedRTFDFromArchive:containsImage:]"
https://bugs.webkit.org/show_bug.cgi?id=184161
https://trac.webkit.org/changeset/230117
2018-04-20 Eric Carlson <eric.carlson@apple.com>
Pausing should clear m_waitingToEnterFullscreen
https://bugs.webkit.org/show_bug.cgi?id=184831
<rdar://problem/39602852>
Reviewed by Jer Noble.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pause): Clear m_waitingToEnterFullscreen
2018-04-20 Eric Carlson <eric.carlson@apple.com>
[Extra zoom mode] Disable CA transactions while setting up for fullscreen
https://bugs.webkit.org/show_bug.cgi?id=184817
<rdar://problem/39596075>
Reviewed by Jer Noble.
This was tested manually as it is not possible to write an automated test for this.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::doSetup): Move the call to disable CA transactions outside
of the EXTRA_ZOOM_MODE check, the [CATransaction commit] was already unguarded.
2018-04-20 Youenn Fablet <youenn@apple.com>
Make PluginData cache its web visible plugins
https://bugs.webkit.org/show_bug.cgi?id=184421
Reviewed by Chris Dumez.
Buffer visible plugins until the page URL changes.
For that purpose, we now cache the visible plugins and the URL it was computed from in PluginData.
Update plugin info provider API to pass the URL used to check for plugin visibility.
No observable change of behavior.
* loader/EmptyClients.cpp:
* plugins/PluginData.cpp:
(WebCore::PluginData::webVisiblePlugins const):
(WebCore::PluginData::publiclyVisiblePlugins const):
(WebCore::PluginData::supportsMimeType const):
* plugins/PluginData.h:
* plugins/PluginInfoProvider.h:
2018-04-20 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r230840.
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::attachDebugger):
2018-04-20 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix the Windows build after r230831.
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::create):
(WebCore::JSWindowProxy::attachDebugger):
2018-04-20 Chris Nardi <cnardi@chromium.org>
Omit default value when serializing font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=182382
Reviewed by Myles C. Maxfield.
According to the shortest-serialization principle [1], values should be omitted if their omission
wouldn't change the value of reparsing. As "1"/"on" is the default value for font-feature-settings,
omit this when serializing, matching the behavior of Firefox and Chrome.
[1]: https://github.com/w3c/csswg-drafts/issues/1564
Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
and fast/text/font-face-javascript.html.
* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::customCSSText const):
2018-04-19 Alexey Proskuryakov <ap@apple.com>
More WK_ALTERNATE_FRAMEWORKS_DIR adoption in WebCore
https://bugs.webkit.org/show_bug.cgi?id=184805
Reviewed by Dan Bernstein.
* Configurations/WebCoreTestShim.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
2018-04-19 Brady Eidson <beidson@apple.com>
Make back forward cache work with process swapping.
<rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793
Reviewed by Chris Dumez.
Covered by API tests.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
2018-04-19 Chris Dumez <cdumez@apple.com>
Rename JSDOMWindowProxy to JSWindowProxy
https://bugs.webkit.org/show_bug.cgi?id=184797
Reviewed by Sam Weinig.
Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/IDLTypes.h:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMConvertWindowProxy.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::proxy const):
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
* bindings/js/JSRemoteDOMWindowBase.cpp:
(WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
(WebCore::toJSRemoteDOMWindow):
* bindings/js/JSRemoteDOMWindowBase.h:
* bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
(WebCore::JSWindowProxy::JSWindowProxy):
(WebCore::JSWindowProxy::finishCreation):
(WebCore::JSWindowProxy::create):
(WebCore::JSWindowProxy::destroy):
(WebCore::JSWindowProxy::setWindow):
(WebCore::JSWindowProxy::attachDebugger):
(WebCore::JSWindowProxy::wrapped const):
(WebCore::JSWindowProxy::toWrapped):
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initScriptForWindowProxy):
* bindings/js/ScriptController.h:
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::createJSWindowProxy):
(WebCore::WindowProxy::jsWindowProxiesAsVector const):
(WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
* bindings/js/WindowProxy.h:
(WebCore::WindowProxy::jsWindowProxy):
(WebCore::WindowProxy::existingJSWindowProxy const):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GenerateHeader):
(GenerateOverloadDispatcher):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
* page/Frame.cpp:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
* page/csp/ContentSecurityPolicy.h:
2018-04-19 Dirk Schulze <krit@webbkit.org>
Introduce SVGGeometryElement interface
https://bugs.webkit.org/show_bug.cgi?id=184768
Reviewed by Antti Koivisto.
Start implementing SVGGeometryElement interface from SVG2.
https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
Start with SVGPathElement only for now. Also, just inferface gets implemented
by this patch. No new functionality like isPointInFill yet.
Fix getPointAtLength and make it more restrictive. This follows the spec and
all other implementations.
Added additional test scenarios to existing tests.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GetGnuVTableOffsetForType):
* svg/SVGAllInOne.cpp:
* svg/SVGGeometryElement.cpp: Added.
(WebCore::SVGGeometryElement::SVGGeometryElement):
(WebCore::SVGGeometryElement::isSupportedAttribute):
(WebCore::SVGGeometryElement::parseAttribute):
(WebCore::SVGGeometryElement::svgAttributeChanged):
(WebCore::SVGGeometryElement::createElementRenderer):
* svg/SVGGeometryElement.h: Added.
* svg/SVGGeometryElement.idl: Added.
* svg/SVGGradientElement.cpp:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::insertedIntoAncestor):
(WebCore::SVGPathElement::removedFromAncestor):
* svg/SVGPathElement.h:
* svg/SVGPathElement.idl:
2018-04-19 Tadeu Zagallo <tzagallo@apple.com>
REGRESSION(r227340): ArrayBuffers were not being serialized when sent via MessagePorts
https://bugs.webkit.org/show_bug.cgi?id=184254
<rdar://problem/39140200>
Reviewed by Daniel Bates.
Add a new encoding method to SerializedScriptValue that includes ArrayBuffers.
Test: workers/message-port.html
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::encode const):
(WebCore::SerializedScriptValue::decode):
* dom/messageports/MessageWithMessagePorts.h:
(WebCore::MessageWithMessagePorts::encode const):
(WebCore::MessageWithMessagePorts::decode):
2018-04-19 David Kilzer <ddkilzer@apple.com>
Enable Objective-C weak references
<https://webkit.org/b/184789>
<rdar://problem/39571716>
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
(CLANG_ENABLE_OBJC_WEAK): Enable.
2018-04-19 Antti Koivisto <antti@apple.com>
Don't use RenderTreeBuilder::current() in RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=184794
Reviewed by Zalan Bujtas.
Pass the builder as a parameter where needed.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownRenderer):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):
(WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
(WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
* rendering/updating/RenderTreeUpdater.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::removeAfterPseudoElement):
* rendering/updating/RenderTreeUpdaterGeneratedContent.h:
2018-04-19 Eric Carlson <eric.carlson@apple.com>
Runtime logging during GC can cause crash
https://bugs.webkit.org/show_bug.cgi?id=184792
<rdar://problem/39567927>
Reviewed by Jer Noble.
Test: media/destructor-logging-crash.html
* dom/Document.cpp:
(WebCore::Document::~Document): Clear the logger observer immediately so anything logged
as a side effect of the destructor won't cause a problem.
(WebCore::Document::didLogMessage): Create the ConsoleMessage in a task.
* dom/Document.h:
2018-04-19 Youenn Fablet <youenn@apple.com>
Web Inspector backend should get headers & cookies from network process separately from resource requests
https://bugs.webkit.org/show_bug.cgi?id=184396
<rdar://problem/38877384>
Reviewed by Brian Burg.
Add two new loader strategies to get response and network metrics directly from
NetworkProcess based on resource loader identifier.
Use these methods in InspectorNetworkAgent when response/metrics might be filtered.
Covered by existing tests, in particular http/tests/inspector/network/fetch-network-data.html which would fail
without this since we are now setting the sourceOrigin for NetworkResourceLoader, which is used to sanitize response headers.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::responseFromResourceLoaIdentifier):
(WebCore::LoaderStrategy::networkMetricsFromResourceLoaIdentifier):
* loader/LoaderStrategy.h:
2018-04-19 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184782
<rdar://problem/38346712>
Reviewed by Tim Horton.
Add a new helper on FrameView to compute an expanded layout viewport size, as well as a new setting for the
height expansion factor when computing visual viewport dimensions. See WebKit/ChangeLog for more detail.
Test: fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html
* page/FrameView.cpp:
(WebCore::FrameView::expandedLayoutViewportSize):
* page/FrameView.h:
* page/Settings.yaml:
2018-04-19 Chris Dumez <cdumez@apple.com>
REGRESSION (r229133): decidePolicyForNavigationAction not called for loading an HTML string
https://bugs.webkit.org/show_bug.cgi?id=184209
<rdar://problem/39145306>
Reviewed by Ryosuke Niwa.
In r229133, we stopped doing navigation policy checks for about:blank because about:blank
loads need to happen synchronously for Web-compatibility. However, this regressed loading
an HTML string in a WebView because in such cases, the URL is also about:blank with
substitute data.
In this patch, we take a more conservative approach and restore policy checking for
'about:blank' but using synchronous IPC.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2018-04-19 Chris Nardi <cnardi@chromium.org>
Support calc() in webkit-gradient and cross-fade
https://bugs.webkit.org/show_bug.cgi?id=182225
Reviewed by Simon Fraser.
calc() was previously unsupported in webkit-gradient and webkit-cross-fade, but both should take calc() values.
Update the code to support calc() values.
Tests: LayoutTests/css3/calc/cross-fade-calc.html
LayoutTests/css3/calc/webkit-gradient-calc.html
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
2018-04-17 Filip Pizlo <fpizlo@apple.com>
The InternalFunction hierarchy should be in IsoSubspaces
https://bugs.webkit.org/show_bug.cgi?id=184721
Reviewed by Saam Barati.
No new tests because no new behavior.
* bindings/js/WebCoreJSClientData.cpp:
(WebCore::JSVMClientData::JSVMClientData):
* bindings/js/WebCoreJSClientData.h:
(WebCore::JSVMClientData::runtimeMethodSpace):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::subspaceForImpl):
* bridge/runtime_method.h:
2018-04-19 Brady Eidson <beidson@apple.com>
Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them).
<rdar://problem/39533949> and https://bugs.webkit.org/show_bug.cgi?id=184750
Reviewed by Ryosuke Niwa.
No new tests (Refactor, no behavior change).
In WebCore, we:
- Add a process-unique "BackForwardItemIdentifier"
- Make all HistoryItems have such an identifier as a member
* WebCore.xcodeproj/project.pbxproj:
* history/BackForwardItemIdentifier.h: Added.
(WebCore::BackForwardItemIdentifier::logString const):
(WebCore::operator==):
(WebCore::BackForwardItemIdentifier::encode const):
(WebCore::BackForwardItemIdentifier::decode):
(WebCore::BackForwardItemIdentifier::hash const):
(WTF::BackForwardItemIdentifierHash::hash):
(WTF::BackForwardItemIdentifierHash::equal):
(WTF::HashTraits<WebCore::BackForwardItemIdentifier>::emptyValue):
(WTF::HashTraits<WebCore::BackForwardItemIdentifier>::constructDeletedValue):
(WTF::HashTraits<WebCore::BackForwardItemIdentifier>::isDeletedValue):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::generateSequenceNumber):
(WebCore::HistoryItem::HistoryItem):
(WebCore::generateSequenceNumber): Deleted.
* history/HistoryItem.h:
(WebCore::HistoryItem::create):
(WebCore::HistoryItem::identifier const):
2018-04-19 Nan Wang <n_wang@apple.com>
AX: AOM: respect the accessibility setting for dispatching the accessible events
https://bugs.webkit.org/show_bug.cgi?id=184619
Reviewed by Ryosuke Niwa.
Added accessibilityEventsEnabled as a setting on the page.
Test: accessibility/ios-simulator/accessibility-events-setting.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
* page/Settings.yaml:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setAccessibilityEventsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2018-04-18 Jer Noble <jer.noble@apple.com>
Fix build when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
https://bugs.webkit.org/show_bug.cgi?id=184693
<rdar://problem/39491884>
Reviewed by Tim Horton.
* Configurations/WebCore.xcconfig:
2018-04-19 Eric Stobbart <ericstobbart@gmail.com>
Change MediaSource WebCore to return NewObject for SourceBuffers
https://bugs.webkit.org/show_bug.cgi?id=184642
Reviewed by Chris Dumez.
Minor change inline with IDL documentation
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer):
(): Deleted.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/MediaSource.idl:
2018-04-19 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, build fix for Ubuntu LTS GCC
https://bugs.webkit.org/show_bug.cgi?id=184756
The variable name "windowProxy" (with auto&) conflicts with the function name "windowProxy".
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::updateDocument):
(WebCore::ScriptController::collectIsolatedContexts):
2018-04-19 Manuel Rego Casasnovas <rego@igalia.com>
Caret rendered at incorrect location inside empty table cell
https://bugs.webkit.org/show_bug.cgi?id=85385
Reviewed by Zalan Bujtas.
This is based on a previous patch by Shezan Baig <shezbaig.wk@gmail.com>.
This fixes the position of the caret in empty cells,
that was painted lower than expected
(and then modified when you start to edit the cell).
Ensures that editable table cells have at least one line when
they are laid out. This ensures that the cell's intrinsic before/after
padding is calculated correctly, which results in the caret location
being calculated correctly.
Test: editing/caret/caret-in-empty-cell.html
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::hasLineIfEmpty): Override method to consider
that it has an an empty line if the table cell is editable.
* rendering/RenderTableCell.h:
2018-04-18 Daniel Bates <dabates@apple.com>
Cleanup TextControlInnerElements
https://bugs.webkit.org/show_bug.cgi?id=184475
Reviewed by Antti Koivisto.
Clean up TextControlInnerElement::resolveCustomStyle(), move the implementation of
TextControlPlaceholderElement::create() from the header to the cpp file, replace
fancy comments to demarcate classes with MARK: so that they show up in Xcode's
function menu.
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
(WebCore::TextControlPlaceholderElement::create):
* html/shadow/TextControlInnerElements.h:
2018-04-18 Chris Dumez <cdumez@apple.com>
Rename WindowProxyController to WindowProxy
https://bugs.webkit.org/show_bug.cgi?id=184756
Reviewed by Sam Weinig.
Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
needed use WindowProxyController type, which was a bit confusing.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::didCreateWindowProxy):
(WebCore::DOMWrapperWorld::didDestroyWindowProxy):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJS):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/JSDOMWindowProxy.h:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::windowProxy):
(WebCore::ScriptController::enableEval):
(WebCore::ScriptController::enableWebAssembly):
(WebCore::ScriptController::disableEval):
(WebCore::ScriptController::disableWebAssembly):
(WebCore::ScriptController::updateDocument):
(WebCore::ScriptController::collectIsolatedContexts):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::globalObject):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::windowScriptObject):
* bindings/js/ScriptState.cpp:
(WebCore::mainWorldExecState):
* bindings/js/WindowProxy.cpp: Renamed from Source/WebCore/bindings/js/WindowProxyController.cpp.
(WebCore::WindowProxy::WindowProxy):
(WebCore::WindowProxy::~WindowProxy):
(WebCore::WindowProxy::destroyJSWindowProxy):
(WebCore::WindowProxy::createJSWindowProxy):
(WebCore::WindowProxy::jsWindowProxiesAsVector const):
(WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
(WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
(WebCore::WindowProxy::setDOMWindow):
(WebCore::WindowProxy::attachDebugger):
* bindings/js/WindowProxy.h: Renamed from Source/WebCore/bindings/js/WindowProxyController.h.
(WebCore::WindowProxy::jsWindowProxies const):
(WebCore::WindowProxy::releaseJSWindowProxies):
(WebCore::WindowProxy::setJSWindowProxies):
(WebCore::WindowProxy::jsWindowProxy):
(WebCore::WindowProxy::existingJSWindowProxy const):
(WebCore::WindowProxy::globalObject):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
* page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
* page/AbstractFrame.h:
(WebCore::AbstractFrame::windowProxy):
(WebCore::AbstractFrame::windowProxy const):
* page/Page.cpp:
(WebCore::Page::setDebugger):
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::self const):
(WebCore::RemoteDOMWindow::top const):
(WebCore::RemoteDOMWindow::opener const):
(WebCore::RemoteDOMWindow::parent const):
* page/RemoteDOMWindow.h:
2018-04-18 Chris Dumez <cdumez@apple.com>
Set RemoteDOMWindow's initial opener
https://bugs.webkit.org/show_bug.cgi?id=184716
Reviewed by Sam Weinig.
Add support for WindowProxy type in the IDL. The implementation should
return a WindowProxyController and toJS() will take care of converting
this into a JSValue via JSDOMWindowProxy.
No new tests, rebaselined existing test.
* WebCore.xcodeproj/project.pbxproj:
* bindings/IDLTypes.h:
* bindings/js/JSDOMConvertWindowProxy.h: Added.
(WebCore::JSConverter<IDLWindowProxy>::convert):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJS):
* bindings/js/JSDOMWindowBase.h:
(WebCore::toJS):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/JSDOMWindowProxy.h:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/JSRemoteDOMWindowBase.cpp:
* bindings/js/JSRemoteDOMWindowBase.h:
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GetBaseIDLType):
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::self const):
(WebCore::RemoteDOMWindow::top const):
(WebCore::RemoteDOMWindow::opener const):
(WebCore::RemoteDOMWindow::parent const):
* page/RemoteDOMWindow.h:
* page/RemoteDOMWindow.idl:
* page/RemoteFrame.h:
2018-04-18 Dean Jackson <dino@apple.com>
Detect system preview links
https://bugs.webkit.org/show_bug.cgi?id=184753
<rdar://problem/39500514>
Reviewed by Antoine Quint.
Detect a special type of link anchor, which we're calling System Previews.
Ultimately this will allow WebKit to present such links in a special
way.
A System Preview link is an <a> element, with a rel attribute that
includes "system-preview". It has a single element child, which is
either an <img> or a <picture>.
Test: system-preview/detection.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList): Add braces.
(WebCore::HTMLAnchorElement::isSystemPreviewLink const): New
function.
* html/HTMLAnchorElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isSystemPreviewImage const): Ask the
parent if it is a system preview link.
* html/HTMLImageElement.h:
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::isSystemPreviewImage const): Ditto.
* html/HTMLPictureElement.h:
* testing/Internals.cpp: Testing helpers.
(WebCore::Internals::systemPreviewRelType):
(WebCore::Internals::isSystemPreviewLink const):
(WebCore::Internals::isSystemPreviewImage const):
* testing/Internals.h:
* testing/Internals.idl:
2018-04-18 Antti Koivisto <antti@apple.com>
:active pseudo class doesn't deactivate when using pressure sensitive trackpad
https://bugs.webkit.org/show_bug.cgi?id=181680
Reviewed by Beth Dakin.
Trackpad sends a mouse force event with force of zero after mouse up event. This causes the element under cursor
activate again.
Even a fake event test doesn't appear to be currently possible as TestRunner crashes if you try to send mouseForceChanged.
All the tests using it are skipped.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseForceEvent):
Don't add HitTestRequest::Active if the force of the force event is zero.
2018-04-18 Megan Gardner <megan_gardner@apple.com>
Ensure correct screen sizes
https://bugs.webkit.org/show_bug.cgi?id=184757
Reviewed by Wenson Hsieh.
Make sure that the screen sizes are actually correct.
Not currently testable, will add tests when it is.
* platform/ios/PlatformScreenIOS.mm:
2018-04-18 Nan Wang <n_wang@apple.com>
AX: [macOS] WebKit hangs when triggering an alert from an AOM increment event
https://bugs.webkit.org/show_bug.cgi?id=184742
Reviewed by Chris Fleizach.
Made increment and decrement actions on the macOS to be async. So that VoiceOver
won't hang indefinitely if performing the actions causes an alert or other modal
behaviors.
Test: accessibility/mac/async-increment-decrement-action.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformIncrementAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
(-[WebAccessibilityObjectWrapper accessibilityPerformDecrementAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
(-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
2018-04-18 Youenn Fablet <youenn@apple.com>
MediaResourceLoader should set its fetch destination
https://bugs.webkit.org/show_bug.cgi?id=184746
Reviewed by Eric Carlson.
Covered by updated test.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
2018-04-18 Jer Noble <jer.noble@apple.com>
Fix runtime errors in simulator while playing media
https://bugs.webkit.org/show_bug.cgi?id=184751
Reviewed by Eric Carlson.
AVURLAssetHTTPCookiesKey may not be present, and AVPlayer may not respond to certain methods.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
2018-04-18 Jer Noble <jer.noble@apple.com>
Ignore ASSERT when setting AVAudioSessionCategory returns an error on simulator.
https://bugs.webkit.org/show_bug.cgi?id=184698
Reviewed by Eric Carlson.
* platform/audio/ios/AudioSessionIOS.mm:
* platform/audio/mac/AudioSessionMac.cpp:
2018-04-18 Sihui Liu <sihui_liu@apple.com>
REGRESSION: Using the reload button while offline pushes identical pages onto the back/forward list
https://bugs.webkit.org/show_bug.cgi?id=184570
<rdar://problem/34807323>
Reviewed by Chris Dumez.
Set FrameLoadType properly when error occurs in reload.
tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
2018-04-18 Chris Dumez <cdumez@apple.com>
Add support for converting a local window to a remote window
https://bugs.webkit.org/show_bug.cgi?id=184515
<rdar://problem/39011318>
Reviewed by Ryosuke Niwa.
Add initial support for process-swapping when navigating cross-origin as a result
of a window.open(). The window object returned by window.open() is initially same
origin and is for about:blank. The navigation cross-origin then happens and the
JS wrappers for the window then point to a cross-origin window which is remote (i.e.
hosted in another WebProcess).
The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
exceptions due to our incomplete implementation (e.g. w.location returns null) and
most of its API is currently not functional. The RemoteDOMWindow API will be implemented
in a follow-up by relying on IPC.
Test: http/tests/navigation/process-swap-window-open.html
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::scriptExecutionContext const):
* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::JSDOMWindowProperties::getOwnPropertySlot):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::JSDOMWindowProxy::finishCreation):
(WebCore::JSDOMWindowProxy::create):
* bindings/js/JSDOMWindowProxy.h:
* bindings/js/JSDOMWrapper.cpp:
(WebCore::JSDOMObject::JSDOMObject):
* bindings/js/JSDOMWrapper.h:
* bindings/js/WindowProxyController.cpp:
(WebCore::WindowProxyController::createWindowProxy):
(WebCore::WindowProxyController::setDOMWindowForWindowProxy):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
Teach more of our bindings code about RemoteDOMWindows.
* dom/Document.cpp:
(WebCore::Document::createDOMWindow):
* loader/FrameLoaderClient.h:
Add FrameLoaderClient function to notify the client when a DOMWindow is constructed in
the frame. This is needed for WebKit2 to link the old window to its new representation
in the new WebProcess.
2018-04-17 Zan Dobersek <zdobersek@igalia.com>
[CMake] Add and enable the ENABLE_CSS_ANIMATIONS_LEVEL_2 feature define
https://bugs.webkit.org/show_bug.cgi?id=184681
Reviewed by Carlos Garcia Campos.
* Sources.txt: Include CSSAnimationTriggerScrollValue.cpp in the build.
* WebCore.xcodeproj/project.pbxproj: Remove CSSAnimationTriggerScrollValue.cpp
build target now that it's built via Sources.txt.
2018-04-17 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] CoordinatedImageBacking can simplify image drawing
https://bugs.webkit.org/show_bug.cgi?id=183986
Reviewed by Michael Catanzaro.
In CoordinatedImageBacking::update(), when drawing the image into a
freshly-created image backing, we can avoid save-and-restoring the
painting context. We also don't have to clip it, since the clipping area
is the same as the image (and buffer) bounds. Since the buffer is
initialized to transparent color, we can use the CompositeCopy operator
to just copy image data into the destination since there's nothing to
paint the source over.
No new tests -- no change in functionality.
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
(WebCore::CoordinatedImageBacking::update):
2018-04-17 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Webkit should spoof as Safari on a Mac for Outlook.com
https://bugs.webkit.org/show_bug.cgi?id=184573
Reviewed by Carlos Alberto Lopez Perez.
Add quirk for outlook.live.com.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2018-04-17 Mark Lam <mark.lam@apple.com>
Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
https://bugs.webkit.org/show_bug.cgi?id=184702
<rdar://problem/35391681>
Reviewed by Filip Pizlo and Saam Barati.
No new tests. This is covered by existing tests.
* WebCore.xcodeproj/project.pbxproj:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* cssjit/CSSPtrTag.h: Added.
* cssjit/CompiledSelector.h:
* cssjit/FunctionCall.h:
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::prepareAndCall):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::compileSelector):
(WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
(WebCore::SelectorDataList::execute const):
* dom/SelectorQuery.h:
2018-04-17 Tadeu Zagallo <tzagallo@apple.com>
Retain MessagePortChannel for transfer when disentangling ports
https://bugs.webkit.org/show_bug.cgi?id=184502
<rdar://problem/39372771>
Reviewed by Geoffrey Garen.
MessagePortChannels should be retained while ports are being transferred, but that was only
happening when sending a port through another port, but not when sending it through a worker.
Test: workers/worker-to-worker.html
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
2018-04-17 Tadeu Zagallo <tzagallo@apple.com>
References from CSSStyleDeclaration to CSSValues should be weak
https://bugs.webkit.org/show_bug.cgi?id=180280
<rdar://problem/35804869>
Reviewed by Geoffrey Garen.
No new tests - used the existing test to verify the leak
* css/DeprecatedCSSOMValue.h:
(WebCore::DeprecatedCSSOMValue::weakPtrFactory):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
* css/PropertySetCSSStyleDeclaration.h:
2018-04-17 Jonathan Bedard <jbedard@apple.com>
Unreviewed rollout of r230632. Regression in memory usage.
That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569.
Tests: animations/animation-internals-api-multiple-keyframes.html
animations/animation-internals-api.html
transitions/transition-drt-api-delay.html
transitions/transition-drt-api.html
* page/RuntimeEnabledFeatures.h:
* testing/Internals.cpp:
(WebCore::Internals::pseudoElement): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-04-17 Tadeu Zagallo <tzagallo@apple.com>
Do not unregister MessagePorts on deallocation if it has been disentangled
https://bugs.webkit.org/show_bug.cgi?id=184285
<rdar://problem/39256714>
Reviewed by Darin Adler.
Test: workers/message-port-gc.html
* dom/MessagePort.cpp:
(WebCore::MessagePort::deref const):
2018-04-17 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix timing of reporting error to the client
https://bugs.webkit.org/show_bug.cgi?id=184707
Before checking the result code, check the status of callback invocation and
do the right thing.
Reviewed by Youenn Fablet.
No new tests because there's no new behavior.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
2018-04-17 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Export authentication information to be used by the client.
https://bugs.webkit.org/show_bug.cgi?id=184709
Just added getters for username and password member variables.
Reviewed by Alex Christensen.
No new tests because there's no new behavior.
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::user const):
(WebCore::CurlRequest::password const):
2018-04-17 Chris Dumez <cdumez@apple.com>
REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab
https://bugs.webkit.org/show_bug.cgi?id=184678
<rdar://problem/39422122>
Reviewed by Alex Christensen.
Frament navigations need to happen synchronously for Web-compatibility. Because of this,
r225657 added code to make sure that if the client does not make the navigation policy
decision synchronously for frament navigations, then we'll stop waiting for the client
and proceed with the navigation. However, r229831 make the navigation policy decision
IPC decision, meaning that even if the client responds synchronously, it would be
asynchronously from WebCore's point of view. As a result, we would always ignore the
client's policy decision when doing a fragment navigation.
This is an issue on iclould.com because the web-app links are fragment URLs. When you
CMD+click one of these link, we do the navigation policy check. As a result of this
check, Safari responds IGNORE to the policy decision and instead decides to load the
link in a new tab (because CMD key is pressed). Due to the bug mentioned above, we
would not obey the IGNORE policy decision from Safari and load the link in the current
tab, even though Safari would already be loading it in a new tab.
To address the issue, I reintroduced a synchronous code path for navigation policy
decision making, backed by synchronous IPC. This synchronous code path is now used for
fragment navigations to restore pre-r229831 behavior. If the client does not answer
synchronously, we'll proceed with the navigation anyway, as was happening pre-r229831.
Test: http/tests/navigation/fragment-navigation-policy-ignore.html
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:
2018-04-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r230713.
This caused internal build failures.
Reverted changeset:
"Implement checked cast for DDResultRef once
DDResultGetTypeID() is available"
https://bugs.webkit.org/show_bug.cgi?id=184554
https://trac.webkit.org/changeset/230713
2018-04-17 Chris Dumez <cdumez@apple.com>
Add bindings code for RemoteDOMWindow
https://bugs.webkit.org/show_bug.cgi?id=184653
Reviewed by Ryosuke Niwa.
Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin
DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since
a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings
code is identical to the DOMWindow code paths from cross-origin handling.
No new tests, this code will be used and tested via Bug 184515.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::addCrossOriginWindowOwnPropertyNames):
* bindings/js/JSDOMWindowCustom.h:
* bindings/js/JSRemoteDOMWindowBase.cpp: Added.
(WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
(WebCore::JSRemoteDOMWindowBase::destroy):
(WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags):
(WebCore::toJS):
(WebCore::toJSRemoteDOMWindow):
* bindings/js/JSRemoteDOMWindowBase.h: Added.
JSRemoteDOMWindow unfortunately currently needs to be a global object because of:
1. a JSProxy's target needs to be a JSGlobalObject currently
2. The 'structure()->setGlobalObject(vm, &window);' call in
JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject.
Ideally, this wouldn't be the case in the future but this would require some code refactoring.
Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject,
which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is
problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all
our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the
m_wrapped implementation pointer. I followed the same pattern here.
(WebCore::toJS):
* bindings/js/JSRemoteDOMWindowCustom.cpp: Added.
(WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
(WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSRemoteDOMWindow::put):
(WebCore::JSRemoteDOMWindow::putByIndex):
(WebCore::JSRemoteDOMWindow::deleteProperty):
(WebCore::JSRemoteDOMWindow::deletePropertyByIndex):
(WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
(WebCore::JSRemoteDOMWindow::defineOwnProperty):
(WebCore::JSRemoteDOMWindow::getPrototype):
(WebCore::JSRemoteDOMWindow::preventExtensions):
(WebCore::JSRemoteDOMWindow::toStringName):
* bindings/scripts/CodeGeneratorJS.pm:
(IsDOMGlobalObject):
(GenerateHeader):
(GenerateOverloadDispatcher):
(GenerateImplementation):
* page/RemoteDOMWindow.idl: Added.
2018-04-17 David Kilzer <ddkilzer@apple.com>
Implement checked cast for DDResultRef once DDResultGetTypeID() is available
<https://webkit.org/b/184554>
<rdar://problem/36241894>
Reviewed by Brent Fulgham.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItemAtPositionWithRange): Implement checked cast
for DDResultRef.
2018-04-17 Said Abou-Hallawa <sabouhallawa@apple.com>
Animated GIF imagery with finite looping are falling one loop short
https://bugs.webkit.org/show_bug.cgi?id=183153
Reviewed by Simon Fraser.
The Netscape Looping Application Extension is a block which may be added
to a GIF file to tell the viewer to loop through the entire GIF frames.
This is communicated through two bytes designated for the "loopCount" in
this block.
The entire block may not be found in the GIF, in which case the GIF is
supposed to animate its entire frames only once.
If the block exists and loopCount = 0, this means the image has to loop
through its frames indefinitely.
If the block exist and loopCount > 0, this should mean the image has to
loop through its frames loopCount + 1 times. The extra loop seems to be
the consensus among most of the GIF generators and viewers. For example,
if the image designer wants the image to loop through its frames n times:
-- The GIF generator (e.g. Adobe Photoshop and https://ezgif.com/maker)
will write n - 1 for loopCount. However http://gifmaker.me and
http://gifmaker.org write n for loopCount.
-- The browser (e.g. Chrome 65.0.3325 181 and FireFox Quantum 59.0.2) will
translate loopCount = n - 1 to: animate GIF once + loop n - 1, which
means loop the GIF n times.
Because the specs are not really clear about this, we are going to consider
the agreed-upon behavior among most of the web browsers the specs here.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::repetitionCount const):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::repetitionCount const):
2018-04-17 Saam Barati <sbarati@apple.com>
Add system trace points for process launch and for initializeWebProcess
https://bugs.webkit.org/show_bug.cgi?id=184669
Reviewed by Simon Fraser.
No testing needed because there is no new functionality here.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::didCancel):
2018-04-17 Eric Carlson <eric.carlson@apple.com>
[iOS] AirPlay device name is sometimes wrong
https://bugs.webkit.org/show_bug.cgi?id=184543
<rdar://problem/39105498>
Reviewed by Jer Noble.
No new tests, this can only be tested with a specific hardware setup.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
when possible.
2018-04-17 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
https://bugs.webkit.org/show_bug.cgi?id=184406
Rubber-stamped by Michael Catanzaro.
Fix build with clang 3.8
No new tests, it is a build fix.
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):
2018-04-16 Antoine Quint <graouts@apple.com>
Layout Test animations/needs-layout.html is a flaky Image Failure.
https://bugs.webkit.org/show_bug.cgi?id=172397
Reviewed by Dean Jackson.
Animations that animate a transform and uses a relative value for either the x or y components
require a layout before starting, which CSSAnimationController would perform in the call to
CSSAnimationControllerPrivate::animationTimerFired() made immediately after a CSS animation was
created.
We now perform a similar task where upon setting new blending keyframes we compute a flag indicating
if the keyframe effect is animating a transform with relative x or y components. Then, when we perform
the first invalidation task, which runs in the next run loop after a change to the timing model has
been made, such as a call to play() on a CSSAnimation made in the TreeResolver::createAnimatedElementUpdate()
where the CSSAnimation was created, we call forceLayout() on this element's FrameView. We also ensure
we commit animations on the compositor immediately after that too, instead of waiting until the next
DisplayRefreshMonitor callback.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::performInvalidationTask):
(WebCore::DocumentTimeline::updateAnimations):
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::forceLayoutIfNeeded):
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computedNeedsForcedLayout):
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
* animation/KeyframeEffectReadOnly.h:
2018-04-16 Pablo Saavedra <psaavedra@igalia.com>
Inconsistent EGL defines in ImageBufferCairo
https://bugs.webkit.org/show_bug.cgi?id=184661
Reviewed by Žan Doberšek.
On revision r219391 libepoxy is added. The headers in
ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
(-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
the Webkit build:
...
/usr/include/GLES2/gl2.h:503:82: error: 'voi
epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
of symbol
GL_APICALL void GL_APIENTRY glAttachShader (GLuint
program, GLuint shader);
No new tests.
* platform/graphics/cairo/ImageBufferCairo.cpp:
2018-04-16 Filip Pizlo <fpizlo@apple.com>
MutationObserver should be in an IsoHeap
https://bugs.webkit.org/show_bug.cgi?id=184671
<rdar://problem/36081981>
Reviewed by Sam Weinig.
No new tests because no new behavior.
* dom/MutationObserver.cpp:
* dom/MutationObserver.h:
2018-04-16 Youenn Fablet <youenn@apple.com>
Use NetworkLoadChecker to handle synchronous HTTP loads
https://bugs.webkit.org/show_bug.cgi?id=184240
Reviewed by Chris Dumez.
Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
Add an option to disable security checks if NetworkProcess does it for WebProcess.
This option will be also used for regular asynchronous loads in future patches.
Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.
Covered by existing and rebased tests.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::doPreflight):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/FrameLoader.h:
* loader/LoaderStrategy.h:
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::openFunc):
2018-04-16 Christopher Reid <chris.reid@sony.com>
[WinCairo] Media elements should be enabled by default
https://bugs.webkit.org/show_bug.cgi?id=184597
Reviewed by Per Arne Vollan.
Enabling media elements by default with media foundation.
* page/SettingsDefaultValues.h:
2018-04-16 Christopher Reid <chris.reid@sony.com>
[Curl] Add the Accept-Language field to curl request headers
https://bugs.webkit.org/show_bug.cgi?id=184605
Reviewed by Alex Christensen.
Add Accept-Language field to curl request headers
* platform/network/curl/CurlRequest.cpp:
* platform/network/curl/CurlRequest.h:
2018-04-16 Chris Dumez <cdumez@apple.com>
Move more WindowProxy-related logic from ScriptController to WindowProxyController
https://bugs.webkit.org/show_bug.cgi?id=184640
Reviewed by Ryosuke Niwa.
Move more WindowProxy-related logic from ScriptController to WindowProxyController,
for clarity.
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::JSDOMWindowProxy::attachDebugger):
* bindings/js/JSDOMWindowProxy.h:
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::initScriptForWindowProxy):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::existingCacheableBindingRootObject const):
* bindings/js/WindowProxyController.cpp:
(WebCore::collectGarbageAfterWindowProxyDestruction):
(WebCore::WindowProxyController::~WindowProxyController):
(WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
(WebCore::WindowProxyController::setDOMWindowForWindowProxy):
(WebCore::WindowProxyController::attachDebugger):
* bindings/js/WindowProxyController.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/Page.cpp:
(WebCore::Page::setDebugger):
2018-04-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
https://bugs.webkit.org/show_bug.cgi?id=184652
Reviewed by Philippe Normand.
In the constructor we should mark selected streams based on the default values from GstStream,
if the user changes them, they will be updated as required later on.
No new tests are added as we already have a few ones that are currently disabled in
the mediastream testsuite. This patch is part of the work to enable them.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2018-04-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
https://bugs.webkit.org/show_bug.cgi?id=184651
Reviewed by Philippe Normand.
We can't notify the client if none is connected, but still we need to fill our metadatas from
the provided GstTagList, especially in the case of playbin3 where the client is not set yet
at construct time but the metadata might already be preset (and won't be updated later on).
No new tests are added as we already have a few ones that are currently disabled in
the mediastream testsuite. This patch is part of the work to enable them.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
2018-04-16 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure we never return -0 through the API
https://bugs.webkit.org/show_bug.cgi?id=184644
Reviewed by Dean Jackson.
We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
This would happen when playbackRate < 0.
* animation/WebAnimationUtilities.h:
(WebCore::secondsToWebAnimationsAPITime):
2018-04-15 Antoine Quint <graouts@apple.com>
[Web Animations] Animations do not naturally get a finish event
https://bugs.webkit.org/show_bug.cgi?id=184639
<rdar://problem/39397649>
Reviewed by Jon Lee.
We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
they will keep being scheduled in a loop.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const):
(WebCore::WebAnimation::resolve):
2018-04-15 Chris Dumez <cdumez@apple.com>
Change Event's returnValue so it doesn't expose a new primitive
https://bugs.webkit.org/show_bug.cgi?id=184415
Reviewed by Darin Adler.
Update Event.returnValue setter to match the latest DOM specification after:
- https://github.com/whatwg/dom/pull/626
In particular, the returnValue setter is now a no-op if the new flag value
is true. If the input flag value is false, it only sets the 'canceled' flag
if the event is cancelable and the events in passive listener flag is unset.
Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html
* dom/Event.cpp:
(WebCore::Event::setLegacyReturnValue):
(WebCore::Event::setCanceledFlagIfPossible):
(WebCore::Event::preventDefault):
* dom/Event.h:
2018-04-14 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
https://bugs.webkit.org/show_bug.cgi?id=184620
Reviewed by Philippe Normand.
This is a minor change, a dedicated test doesn't really make sense here.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
(WebCore::TrackPrivateBaseGStreamer::stream):
2018-04-13 Ryosuke Niwa <rniwa@webkit.org>
WebKit crashes when libwebrtc.dylib is missing
https://bugs.webkit.org/show_bug.cgi?id=184607
Rubber-stamped by Jer Noble.
Don't call LibWebRTC related code when libwebrtc is not available.
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::suspend):
2018-04-13 Chris Dumez <cdumez@apple.com>
Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
https://bugs.webkit.org/show_bug.cgi?id=184591
Reviewed by Sam Weinig.
Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
This is work towards fixing Bug 184515.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::didCreateWindowProxy):
(WebCore::DOMWrapperWorld::didDestroyWindowProxy):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
(WebCore::ScriptController::setDOMWindowForWindowProxy):
(WebCore::ScriptController::initScriptForWindowProxy):
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::windowProxyController):
(WebCore::ScriptController::enableEval):
(WebCore::ScriptController::enableWebAssembly):
(WebCore::ScriptController::disableEval):
(WebCore::ScriptController::disableWebAssembly):
(WebCore::ScriptController::attachDebugger):
(WebCore::ScriptController::updateDocument):
(WebCore::ScriptController::collectIsolatedContexts):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::globalObject):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::windowScriptObject):
* bindings/js/ScriptState.cpp:
(WebCore::mainWorldExecState):
* bindings/js/WindowProxyController.cpp: Added.
(WebCore::WindowProxyController::WindowProxyController):
(WebCore::WindowProxyController::destroyWindowProxy):
(WebCore::WindowProxyController::createWindowProxy):
(WebCore::WindowProxyController::windowProxies):
(WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
* bindings/js/WindowProxyController.h: Added.
(WebCore::WindowProxyController::releaseWindowProxies):
(WebCore::WindowProxyController::setWindowProxies):
(WebCore::WindowProxyController::windowProxy):
(WebCore::WindowProxyController::existingWindowProxy const):
(WebCore::WindowProxyController::globalObject):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
* page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
* page/AbstractFrame.h:
(WebCore::AbstractFrame::windowProxyController):
(WebCore::AbstractFrame::windowProxyController const):
2018-04-13 Brady Eidson <beidson@apple.com>
Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
https://bugs.webkit.org/show_bug.cgi?id=184559
Reviewed by Alex Christensen.
Covered by new API test.
WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2018-04-13 Chris Dumez <cdumez@apple.com>
input.webkitEntries does not work as expected when folder contains accented chars
https://bugs.webkit.org/show_bug.cgi?id=184517
<rdar://problem/39265537>
Reviewed by Alex Christensen.
Use String::fromUTF8() to construct a WTF String from the char* returned by
dirname() in FileSystem::directoryName(). Previously, we were just calling
the String constructor, which would treat the input as latin 1 instead of
UTF-8.
Change is covered by an API test rather than a layout test due to file versioning
limitations.
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::directoryName):
2018-04-13 Yusuke Suzuki <utatane.tea@gmail.com>
[WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
https://bugs.webkit.org/show_bug.cgi?id=184401
Rubber stamped by Saam Barati.
Apply bug 183970 changes to WebCore JS too. This offers solid type checking
with @getByIdDirectPrivate().
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
(getLocalStreams):
(getStreamById):
(addStream):
* Modules/mediastream/RTCPeerConnectionInternals.js:
(isRTCPeerConnection):
* Modules/streams/ReadableByteStreamController.js:
(enqueue):
(error):
(close):
(getter.byobRequest):
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableStreamBYOBReader):
(privateInitializeReadableByteStreamController):
(privateInitializeReadableStreamBYOBRequest):
(isReadableByteStreamController):
(isReadableStreamBYOBRequest):
(isReadableStreamBYOBReader):
(readableByteStreamControllerCancel):
(readableByteStreamControllerError):
(readableByteStreamControllerClose):
(readableByteStreamControllerClearPendingPullIntos):
(readableByteStreamControllerGetDesiredSize):
(readableStreamHasBYOBReader):
(readableStreamHasDefaultReader):
(readableByteStreamControllerHandleQueueDrain):
(readableByteStreamControllerPull):
(readableByteStreamControllerShouldCallPull):
(readableByteStreamControllerCallPullIfNeeded):
(readableByteStreamControllerEnqueue):
(readableByteStreamControllerEnqueueChunk):
(readableByteStreamControllerRespondWithNewView):
(readableByteStreamControllerRespond):
(readableByteStreamControllerRespondInternal):
(readableByteStreamControllerRespondInReadableState):
(readableByteStreamControllerRespondInClosedState):
(readableByteStreamControllerProcessPullDescriptors):
(readableByteStreamControllerFillDescriptorFromQueue):
(readableByteStreamControllerShiftPendingDescriptor):
(readableByteStreamControllerInvalidateBYOBRequest):
(readableByteStreamControllerCommitDescriptor):
(readableStreamFulfillReadIntoRequest):
(readableByteStreamControllerPullInto):
(readableStreamAddReadIntoRequest):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
(pipeThrough):
* Modules/streams/ReadableStreamBYOBReader.js:
(cancel):
(read):
(releaseLock):
(getter.closed):
* Modules/streams/ReadableStreamBYOBRequest.js:
(respond):
(respondWithNewView):
(getter.view):
* Modules/streams/ReadableStreamDefaultController.js:
(error):
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel):
(read):
(releaseLock):
(getter.closed):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader):
(readableStreamReaderGenericInitialize):
(readableStreamDefaultControllerError):
(readableStreamPipeTo):
(readableStreamTee):
(isReadableStream):
(isReadableStreamDefaultReader):
(isReadableStreamDefaultController):
(readableStreamError):
(readableStreamDefaultControllerCallPullIfNeeded):
(readableStreamDefaultControllerGetDesiredSize):
(readableStreamReaderGenericCancel):
(readableStreamCancel):
(readableStreamDefaultControllerCancel):
(readableStreamDefaultControllerPull):
(readableStreamDefaultControllerClose):
(readableStreamClose):
(readableStreamFulfillReadRequest):
(readableStreamDefaultReaderRead):
(readableStreamAddReadRequest):
(isReadableStreamDisturbed):
(readableStreamReaderGenericRelease):
(readableStreamDefaultControllerCanCloseOrEnqueue):
(privateInitializeReadableStreamDefaultController): Deleted.
* Modules/streams/StreamInternals.js:
(validateAndNormalizeQueuingStrategy):
* Modules/streams/WritableStream.js:
(initializeWritableStream):
(abort):
(close):
(write):
(getter.closed):
(getter.ready):
(getter.state):
* Modules/streams/WritableStreamInternals.js:
(isWritableStream):
(syncWritableStreamStateWithQueue):
(errorWritableStream):
(callOrScheduleWritableStreamAdvanceQueue):
* bindings/js/JSDOMBindingInternals.js:
(mapLikeForEach):
2018-04-12 Antoine Quint <graouts@apple.com>
[Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
https://bugs.webkit.org/show_bug.cgi?id=184569
<rdar://problem/38671301>
Reviewed by Jon Lee.
We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
to now work with the Web Animations API.
* page/RuntimeEnabledFeatures.h:
* testing/Internals.cpp:
(WebCore::Internals::pseudoElement):
* testing/Internals.h:
* testing/Internals.idl:
2018-04-13 Sergio Villar Senin <svillar@igalia.com>
[WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
https://bugs.webkit.org/show_bug.cgi?id=184530
Reviewed by Žan Doberšek.
WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
(right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
presenting we could access the presenting layers (right now just one) with getLayers().
Note that we are not presenting anything to the HMD yet, that will be done later in a follow
up patch.
I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
that should be called maxLayers instead of maxLayer.
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::requestPresent):
(WebCore::VRDisplay::stopPresenting):
(WebCore::VRDisplay::exitPresent):
(WebCore::VRDisplay::getLayers const):
(WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
* Modules/webvr/VRDisplay.h:
(WebCore::VRDisplay::isPresenting const):
* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
(WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
* Modules/webvr/VRDisplayCapabilities.idl:
2018-04-13 Miguel Gomez <magomez@igalia.com>
REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
https://bugs.webkit.org/show_bug.cgi?id=184583
Reviewed by Carlos Garcia Campos.
In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2018-04-13 Miguel Gomez <magomez@igalia.com>
[GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
https://bugs.webkit.org/show_bug.cgi?id=183362
Reviewed by Carlos Garcia Campos.
Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
has only effect when not in AC mode.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2018-04-13 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
https://bugs.webkit.org/show_bug.cgi?id=184533
Reviewed by Philippe Normand.
Renamed GStreamerUtilities* files into GStreamerCommon* and
modified files including them accordingly. Include
GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
to avoid problems destroying objects when those files are
forgotten to be included.
* Modules/webaudio/AudioContext.cpp:
* platform/GStreamer.cmake:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
* platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
* platform/graphics/gstreamer/ImageGStreamer.h:
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
* platform/graphics/gstreamer/MediaSampleGStreamer.h:
* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
2018-04-12 Christopher Reid <chris.reid@sony.com>
[Curl] Fix clang build error in CurlContext.cpp
https://bugs.webkit.org/show_bug.cgi?id=184561
Reviewed by Darin Adler.
MSVC allows explicit template specialization in classes but gcc/clang do not.
* platform/network/curl/CurlContext.cpp:
2018-04-12 Christopher Reid <chris.reid@sony.com>
[Curl] Cookie Database on memory path should be :memory:
https://bugs.webkit.org/show_bug.cgi?id=184572
Reviewed by Alex Christensen.
CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
For reference, see: https://www.sqlite.org/inmemorydb.html
* platform/network/curl/CookieJarDB.h:
2018-04-12 Daniel Bates <dabates@apple.com>
Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
(https://bugs.webkit.org/show_bug.cgi?id=184386)
Visual Studio cannot prove that all cases in the switch are covered :(
So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::destinationForType):
2018-04-12 Chris Dumez <cdumez@apple.com>
Introduce remote variants of Frame / DOMWindow classes
https://bugs.webkit.org/show_bug.cgi?id=184467
<rdar://problem/39011267>
Reviewed by Ryosuke Niwa.
Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
are hosted on another WebProcess. Those will be used in a follow-up patch.
The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
patch size):
- AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
- Frame: A local frame
- RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
- AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
- DOMWindow: A local DOMWindow
- RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
remote. A RemoteDOMWindow is always cross-origin.
This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
RemoteDOMWindow is pointing to.
Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).
Other things we'll need to implement in follow-ups:
- RemoteDOMWindow will need to know about its opener in order to support the window.opener
API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
returns the current window in the opener frame (which changes upon navigation).
- Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
A frameless window behaves very differently (e.g. very little API is exposed to the Web).
This happens when either the newly opened window is either closed or navigated.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::didDecide):
* page/AbstractDOMWindow.cpp: Added.
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
(WebCore::AbstractDOMWindow::~AbstractDOMWindow):
* page/AbstractDOMWindow.h: Added.
(WebCore::AbstractDOMWindow::identifier const):
* page/AbstractFrame.cpp: Added.
(WebCore::AbstractFrame::AbstractFrame):
(WebCore::AbstractFrame::~AbstractFrame):
* page/AbstractFrame.h: Added.
(WebCore::AbstractFrame::window const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
* page/DOMWindow.h:
(isType):
* page/Frame.cpp:
(WebCore::Frame::window const):
(WebCore::Frame::virtualWindow const):
* page/Frame.h:
(isType):
* page/GlobalFrameIdentifier.h: Added.
(WebCore::GlobalFrameIdentifier::encode const):
(WebCore::GlobalFrameIdentifier::decode):
* page/GlobalWindowIdentifier.h: Added.
(WebCore::operator==):
(WebCore::GlobalWindowIdentifier::hash const):
(WebCore::GlobalWindowIdentifier::encode const):
(WebCore::GlobalWindowIdentifier::decode):
(WTF::GlobalWindowIdentifierHash::hash):
(WTF::GlobalWindowIdentifierHash::equal):
(WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
(WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
(WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):
* page/RemoteDOMWindow.cpp: Added.
(WebCore::RemoteDOMWindow::RemoteDOMWindow):
(WebCore::RemoteDOMWindow::~RemoteDOMWindow):
(WebCore::RemoteDOMWindow::self const):
(WebCore::RemoteDOMWindow::location const):
(WebCore::RemoteDOMWindow::close):
(WebCore::RemoteDOMWindow::closed const):
(WebCore::RemoteDOMWindow::focus):
(WebCore::RemoteDOMWindow::blur):
(WebCore::RemoteDOMWindow::length const):
(WebCore::RemoteDOMWindow::top const):
(WebCore::RemoteDOMWindow::opener const):
(WebCore::RemoteDOMWindow::parent const):
(WebCore::RemoteDOMWindow::postMessage):
The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.
* page/RemoteDOMWindow.h: Added.
(isType):
* page/RemoteFrame.cpp: Added.
(WebCore::RemoteFrame::RemoteFrame):
(WebCore::RemoteFrame::~RemoteFrame):
(WebCore::RemoteFrame::virtualWindow const):
* page/RemoteFrame.h: Added.
(isType):
2018-04-12 Daniel Bates <dabates@apple.com>
Content-Type not enforced for <script> allows for XSS
https://bugs.webkit.org/show_bug.cgi?id=184386
<rdar://problem/39112268>
Reviewed by Brady Eidson.
As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
that begins with "audio/", "image/" or "video/".
As a side benefit of this change we now set the destination property [1] on preload requests.
[1] <https://fetch.spec.whatwg.org/#concept-request-destination>
Tests: http/tests/security/script-with-banned-mimetype.html
http/tests/workers/worker-importScripts-banned-mimetype.html
* Sources.txt: Add file FetchIdioms.cpp.
* WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
block the script if applicable.
* dom/LoadableScript.h: Add error type MIMEType.
* loader/FetchIdioms.cpp: Added.
(WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
due to its MIME type?" algorithm from the Fetch standard.
* loader/FetchIdioms.h: Added.
* loader/FetchOptions.h:
(WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
CachedResourceLoader::requestResource() is now responsible for doing this.
(WebCore::CachedResourceLoader::requestFont): Ditto.
(WebCore::CachedResourceLoader::requestTextTrack): Ditto.
(WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
(WebCore::CachedResourceLoader::requestScript): Ditto.
(WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
(WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
that the destination property is either video or audio.
(WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
CachedResourceLoader::requestResource() is now responsible for doing this.
(WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
load many kinds of requests that have different destination properties. The caller is responsible
for setting the appropriate destintion property.
(WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
as CachedResourceLoader::requestResource() is now responsible for doing this.
(WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
(WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
already set.
* loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
and add a comment to explain what it is used for.
* workers/Worker.cpp:
(WebCore::Worker::create):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
and store it in an instance variable as we will need to reference it once we receive the HTTP response.
Note that this function is only used to support the Web API importScripts().
(WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
instance as we will need to reference it once we receive the HTTP response.
(WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
block the script if applicable.
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.
2018-04-12 Antoine Quint <graouts@apple.com>
[Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
https://bugs.webkit.org/show_bug.cgi?id=184555
Reviewed by Dean Jackson.
A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
tests to fail when expressed as Web Animations.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
to create them.
(WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
for this property already running, use that animation's original unanimated style as the from value.
* animation/AnimationTimeline.h:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
(WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
get it when a CSS Transition is created and takes precedence over this CSS Animation.
(WebCore::CSSAnimation::initialize): Deleted.
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::initialize):
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
before timing properties are set based on the backing animation.
* animation/DeclarativeAnimation.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
(WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
instead of a default RenderStyle which would not use the right values for implicit keyframes.
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
"transition: all".
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
last keyframes to always have the property listed since the underlying style was provided and should be captured.
* animation/KeyframeEffectReadOnly.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.
2018-04-12 Antoine Quint <graouts@apple.com>
[Web Animations] Only cancel declarative animations upon element removal
https://bugs.webkit.org/show_bug.cgi?id=184553
Reviewed by Dean Jackson.
Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
the ready promise and produce spurious logging from WPT tests.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
(WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
* animation/AnimationTimeline.h:
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-04-12 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r230554.
The non-ASCII character in the filename causes issues with SVN
Reverted changeset:
"input.webkitEntries does not work as expected when folder
contains accented chars"
https://bugs.webkit.org/show_bug.cgi?id=184517
https://trac.webkit.org/changeset/230554
2018-04-12 Alicia Boya García <aboya@igalia.com>
[MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
https://bugs.webkit.org/show_bug.cgi?id=180253
Right now it's checked that start <= end but it's not checked that
neither of them is undefined.
When this happens, the bug can be hard to track down.
The assertion is not enabled for Mac because there is currently a test
that is hitting it.
Reviewed by Jer Noble.
* platform/graphics/PlatformTimeRanges.cpp:
(WebCore::PlatformTimeRanges::add):
2018-04-12 Chris Dumez <cdumez@apple.com>
Process::setIdentifier() / Process::identifier() do not need a lock
https://bugs.webkit.org/show_bug.cgi?id=184544
Reviewed by Brady Eidson.
Process::setIdentifier() / Process::identifier() do not need a lock.
Process::setIdentifier() gets called in ChildProcess::initialize(),
before we start any background threads. It is then safe to query
this process identifier later on from background threads without
locks.
* platform/Process.cpp:
(WebCore::Process::setIdentifier):
(WebCore::Process::identifier):
2018-04-12 Antoine Quint <graouts@apple.com>
Unreviewed, fix the Windows build.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::computeExtentOfAnimation const):
2018-04-12 Antoine Quint <graouts@apple.com>
[Web Animations] Suspend animations when required
https://bugs.webkit.org/show_bug.cgi?id=184541
Reviewed by Jon Lee.
Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
invalidation tasks and updates all of the animations it manages, including those running on the compositor.
(WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
it manages and rewinds its invalidation timer.
(WebCore::DocumentTimeline::animationsAreSuspended):
(WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
this returns the number of animations managed by this timeline that are not suspended.
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
is suspended.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
(WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
the suspension state of an animation changes.
* animation/WebAnimation.h:
(WebCore::WebAnimation::isSuspended const):
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* dom/Document.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* testing/Internals.cpp:
(WebCore::Internals::numberOfActiveAnimations const):
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):
2018-04-12 Antoine Quint <graouts@apple.com>
[Web Animations] Throttle animations when lowPowerMode is on
https://bugs.webkit.org/show_bug.cgi?id=184540
Reviewed by Jon Lee.
Ensure animations are sampled at a lower frequency when lowPowerMode is on.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::animationInterval const):
(WebCore::DocumentTimeline::updateAnimationSchedule):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
* animation/DocumentTimeline.h:
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
* testing/Internals.cpp:
(WebCore::Internals::animationsInterval const):
2018-04-12 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure elements overlapping with elements animating also get composited
https://bugs.webkit.org/show_bug.cgi?id=184539
Reviewed by Jon Lee.
A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
should be callable by other const method.
(WebCore::AnimationTimeline::animationsForElement): Deleted.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
(WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
(WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
(WebCore::containsRotation): Bring this method over from KeyframeAnimation.
(WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
(WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
of all animated properties to see if a transform is animated, so we now expose such a list.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
and CSS Transitions as Web Animations flag is on.
(WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
and CSS Transitions as Web Animations flag is on.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
and CSS Transitions as Web Animations flag is on.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
if the CSS Animations and CSS Transitions as Web Animations flag is on.
* rendering/RenderObject.h:
(WebCore::RenderObject::documentTimeline const):
2018-04-11 Antoine Quint <graouts@apple.com>
[Web Animations] Enable seeking for hardware animations
https://bugs.webkit.org/show_bug.cgi?id=184518
Reviewed by Dean Jackson.
Hardware animations had lagged behind software animations in support and this patch bring their respective level
of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
since many tests pause and seek animations to test their state. Animations may also have their playback state changed
along with their current time in the same run loop, so we now maintain a list of pending processing actions for
hardware animations.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
state we can schedule animation resolution immediately since we've already established we'll have work to do.
(WebCore::DocumentTimeline::updateAnimations): Factor the updates of pending accelerated animations out in a dedicated
method.
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): Go through all pending accelerated animations and update
their state.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes): Update the m_shouldRunAccelerated flag when setting blending keyframes.
(WebCore::KeyframeEffectReadOnly::apply): Ensure we finish accelerated animations if the progress is 1 or null (no longer active).
start accelerated animations if the animation is starting and always resolve styles in software as well to ensure that
hit testing will work as expected.
(WebCore::KeyframeEffectReadOnly::computeShouldRunAccelerated):
(WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Called by WebAnimation when play() or pause() is called
with the appropriate flag.
(WebCore::KeyframeEffectReadOnly::animationDidSeek): Called by WebAnimation when the currentTime property is set.
(WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Add the provided action to the list of pending accelerated
actions and notify the animation that the accelerated state needs changing.
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Called by DocumentTimeline, through WebAnimation, to apply
all pending accelerated actions.
(WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const): If we're dealing with a declarative animation,
we already have a backing Animation object, so use it directly. Otherwise, create one and ensure it reflects all timing properties
for the animation.
(WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): Deleted.
(WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): Deleted.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setCurrentTime): Call animationDidSeek() on the effect to ensure its accelerated animation gets seeked.
(WebCore::WebAnimation::play): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation is started or resumed.
(WebCore::WebAnimation::pause): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation gets paused.
(WebCore::WebAnimation::acceleratedStateDidChange):
(WebCore::WebAnimation::applyPendingAcceleratedActions):
(WebCore::WebAnimation::acceleratedRunningStateDidChange): Deleted.
(WebCore::WebAnimation::startOrStopAccelerated): Deleted.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::seekAnimation):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Add an AnimationProcessingAction to the list of such actions for a
given animation name. In case we already have a Remove action, we ignore the action since the hardware animation will have been
removed by the time we try to apply this processing action.
(WebCore::GraphicsLayerCA::pauseAnimation): Add a Pause processing action.
(WebCore::GraphicsLayerCA::seekAnimation): Add a Seek processing action.
(WebCore::GraphicsLayerCA::removeAnimation): Add a Remove processing action.
(WebCore::GraphicsLayerCA::updateAnimations): First ensure that all animations pending commit are committed and then update
all animations based on the actions added through addProcessingActionForAnimation().
(WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Generate a new animation based on the new seek time provided.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::animationSeeked):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::animationSeeked):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Fix an issue where we would run the CSSAnimationController
logic even when the legacy animation engine was disabled.
2018-04-12 Xabier Rodriguez Calvar <calvaris@igalia.com>
Unreviewed, fix GStreamer builds
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): We were
passing a String to a GST_WARNING call.
2018-04-11 Chris Dumez <cdumez@apple.com>
input.webkitEntries does not work as expected when folder contains accented chars
https://bugs.webkit.org/show_bug.cgi?id=184517
<rdar://problem/39265537>
Reviewed by Ryosuke Niwa.
Use String::fromUTF8() to construct a WTF String from the char* returned by
dirname() in FileSystem::directoryName(). Previously, we were just calling
the String constructor, which would treat the input as latin 1 instead of
UTF-8.
Test: fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::directoryName):
2018-04-11 Youenn Fablet <youenn@apple.com>
Preventively expect UTF8 strings from libwebrtc SDP and error messages
https://bugs.webkit.org/show_bug.cgi?id=184509
Reviewed by Eric Carlson.
Make WebCore code expect any libwebrtc string to contain UTF-8.
Currently SDPs do not contain any UTF-8 specific character
but https://tools.ietf.org/html/rfc4566 allows it.
Add Internals API to set track id so that we can inject UTF-8 inside some WebRTC tests.
Test: webrtc/utf8-sdp.html
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::setIdForTesting):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fromStdString):
(WebCore::fromSessionDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
(WebCore::trackId): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::fromStdString):
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::createReceiverForSource):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::setIdForTesting):
* testing/Internals.cpp:
(WebCore::Internals::setMediaStreamTrackIdentifier):
* testing/Internals.h:
* testing/Internals.idl:
2018-04-11 Said Abou-Hallawa <sabouhallawa@apple.com>
Cache glyphs (using display lists) when painting at high frequency
https://bugs.webkit.org/show_bug.cgi?id=178750
<rdar://problem/35201729>
Reviewed by Antti Koivisto.
This patch adds support for caching of glyph drawing commands when painting
at high frequency. Caching the glyph drawing will be done using DisplayLists.
GlyphDisplayListCache is basically a hash map which maps InlineTextBox
or SimpleLineLayout::Run to DisplayList. Before adding a new entry to it
we have to check whether the conditions for caching the glyph DisplayList
are met or not. If no entry is found for a given run, a new DisplayList
is created and a new entry is add to the cache.
* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory): Make GlyphDisplayListCache respond
to memory pressure.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::displayListForTextRun const):
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::displayListForTextRun):
Record the drawing of a glyph run into a DisplayList.
* rendering/GlyphDisplayListCache.h: Added.
(WebCore::GlyphDisplayListCache::singleton):
(WebCore::GlyphDisplayListCache::get):
(WebCore::GlyphDisplayListCache::remove):
(WebCore::GlyphDisplayListCache::clear):
(WebCore::GlyphDisplayListCache::size const):
(WebCore::GlyphDisplayListCache::sizeInBytes const):
A simple cache for the TextRun DisplayList. Adding a new entry in the
cache happens under restricted conditions. So this cache is not expected
to grow much.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::~InlineTextBox):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintMarkedTexts):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::paintCompositionUnderlines const):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::paintMarkedTexts):
InlineTextBox::paintMarkedTextForeground() now requires PaintInfo to know
whether the entry in the GlyphDisplayListCache should be removed or not.
Change all the GraphicsContext arguments to be PaintInfo.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::Layout::~Layout):
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::simpleLineLayoutWillBeDeleted):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::simpleRun const):
Implement the glyph caching for SimpleLineLayout::Run.
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks): If the DisplayList is
available, replay it back into the GraphicsContext. Make sure to reset to
the DisplayList pointer to nullptr after painting.
(WebCore::TextPainter::clearGlyphDisplayLists):
(WebCore::TextPainter::shouldUseGlyphDisplayList): Check whether we should
use DisplayList to the draw glyph run.
* rendering/TextPainter.h:
(WebCore::TextPainter::setGlyphDisplayListIfNeeded): Check whether we should
should use DisplayList to the draw glyph run and if we should, ensure first
the DisplayList is cached and set it in the TextPainter so it uses it when
the run is painted.
(WebCore::TextPainter::removeGlyphDisplayList): Remove the cached DisplayList
entry for a glyph layout run.
2018-04-11 Brent Fulgham <bfulgham@apple.com>
GraphicsLayerCA::createPlatformCALayer always disables extended color in its backing store
https://bugs.webkit.org/show_bug.cgi?id=184367
<rdar://problem/39249074>
Reviewed by Simon Fraser.
'createPlatformCALayer' always passes a nil widget, which early returns from 'screenSupportsExtendedColor'
with false. Instead, we should just pass the widget (nil or not) to the screen properties methods,
which will use the primary screen if no screen is specified. I.e., we shouldn't do an early return
here if the passed widget is nil.
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor):
2018-04-11 Youenn Fablet <youenn@apple.com>
Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184374
Reviewed by Chris Dumez.
Add support for SecurityOrigin encode/decode routines.
* page/SecurityOrigin.h:
2018-04-11 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
https://bugs.webkit.org/show_bug.cgi?id=184498
Reviewed by Philippe Normand.
[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
This is the same behaviour as with playbin itself.
Make sure to keep using "playbin" for MediaSource.
No test added as this is basically a small rework of the way we expose a feature.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2018-04-10 Alex Christensen <achristensen@webkit.org>
IDN spoofing with Hebrew combining characters
https://bugs.webkit.org/show_bug.cgi?id=184472
<rdar://problem/39148687>
Reviewed by Brent Fulgham.
Covered by new API tests.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
Punycode-encode hosts with Hebrew combining marks that look like dots
and Vav with a combining dot above like we do with dotless i and j.
2018-04-11 Brent Fulgham <bfulgham@apple.com>
Show punycode if URL contains Latin dum character
https://bugs.webkit.org/show_bug.cgi?id=184477
<rdar://problem/39121999>
Reviewed by David Kilzer.
Revise our "lookalike character" logic to include the small
Latin dum character.
Test: fast/url/host.html
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
2018-04-11 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] WaylandCompositorDisplay leaks its wl_display
https://bugs.webkit.org/show_bug.cgi?id=184406
Reviewed by Carlos Garcia Campos.
Well, this was harder than expected. We really just want to fix a small leak in the WebKit
layer, but that requires a change in how WaylandCompositorDisplay calls the
PlatformDisplayWayland constructor, to pass NativeDisplayOwned::Yes. That means
WaylandCompositorDisplay can no longer use PlatformDisplayWayland's protected default
constructor. Problem is that the normal PlatformDisplayWayland constructor calls
PlatformDisplayWayland::initialize, which calls PlatformDisplayWayland::registryGlobal,
which is a virtual function. The WaylandCompositorDisplay portion of the object is not
constructed yet at this point, so WaylandCompositorDisplay::registryGlobal will never be
called if we do that. I had to revert the previous version of this fix due to this problem.
It had broken accelerated compositing.
I'm reminded of Effective C++ item #9: Never call virtual functions during construction or
destruction ("because such calls will never go to a more derived class than that of the
currently executing constructor or destructor"). This code is fragile and likely to break
again in the future, so let's refactor it a bit. Instead of calling initialize in the
constructor, we'll call it from create functions. We'll have to add a couple create
functions, and make the constructor protected to ensure it's not possible to create a
PlatformDisplayWayland without initializing it. For good parallelism, do the same for the
other PlatformDisplay classes.
This commit additionally removes PlatformDisplayWayland's protected default constructor,
since it's not needed anymore.
The NativeDisplayOwned arguments to the PlatformDisplay constructors are now mandatory,
instead of using NativeDisplayOwned::No as the default value, since that was dangerously
close to being the cause of this leak, and the constructors are now accessed from private
create functions anyway. Some more caution when using default parameter values is warranted
in the future.
Lastly, since we have to change PlatformDisplay::createPlatformDisplay to use the new create
functions, take the opportunity to move things around a bit for clarity. There should be no
change in behavior. I was just disappointed that the PlatformDisplayWPE creation was at the
bottom of the function, after a comment indicating that normal display creation has failed,
which is not the case for WPE.
This all might have been a bit overkill, since the leak could probably have been fixed by
passing nullptr to the PlatformDisplayWayland constructor for the wl_display and not
removing WaylandCompositorDisplay's call to PlatformDisplayWayland::initialize. But the
correctness of that code would then rely on implementation details of initialize, so this
refactor seems better.
No new tests since there *should* be no behavior change. Then again, I'm touching
PlatformDisplay, and history shows we don't have the greatest track record of touching this
code without introducing problems.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
* platform/graphics/PlatformDisplay.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):
(WebCore::PlatformDisplayWayland::create):
(WebCore::PlatformDisplayWayland::createHeadless):
(WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/wayland/PlatformDisplayWayland.h:
* platform/graphics/win/PlatformDisplayWin.h:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:
(WebCore::create):
* platform/graphics/wpe/PlatformDisplayWPE.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
(WebCore::PlatformDisplayX11::create):
(WebCore::PlatformDisplayX11::createHeadless):
* platform/graphics/x11/PlatformDisplayX11.h:
2018-04-11 Jianjun Zhu <jianjun.zhu@intel.com>
Fix a WebRTC data channel issue for non-ASCII characters.
At the sender side, buffer size are calulcated after UTF8 encoding. At the
receiver side, strings are constructed with UTF8 data.
https://bugs.webkit.org/show_bug.cgi?id=184481
Reviewed by Youenn Fablet.
Updated test:
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
(WebCore::LibWebRTCDataChannelHandler::sendStringData):
(WebCore::LibWebRTCDataChannelHandler::OnMessage):
2018-04-11 Antti Koivisto <antti@apple.com>
ImageFrame type used by non-Cocoa image decoder should not be the same as that used by ImageSource
https://bugs.webkit.org/show_bug.cgi?id=184418
Reviewed by Said Abou-Hallawa.
ScalableImageDecoder uses ImageFrame class which is meant to be an implementation detail of ImageSource.
There are bunch of fields and methods in the type that are only used by one or the other client. For hackability
there should be an unrelated frame type for ScalableImageDecoder.
This patch adds ScalableImageDecoderFrame type used in ScalableImageDecoder only. It then cleans up
unneeded things from both ImageFrame and ScalableImageDecoderFrame.
* platform/ImageDecoders.cmake:
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::operator=):
(WebCore::ImageFrame::clearImage):
(WebCore::ImageFrame::size const):
(WebCore::ImageFrame::initialize): Deleted.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDisposalMethod): Deleted.
(WebCore::ImageFrame::disposalMethod const): Deleted.
(WebCore::ImageFrame::backingStore const): Deleted.
(WebCore::ImageFrame::hasBackingStore const): Deleted.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
(WebCore::ScalableImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ScalableImageDecoder.h:
* platform/image-decoders/ScalableImageDecoderFrame.cpp: Copied from Source/WebCore/platform/graphics/ImageFrame.cpp.
(WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
(WebCore::ScalableImageDecoderFrame::~ScalableImageDecoderFrame):
(WebCore::ScalableImageDecoderFrame::operator=):
(WebCore::ScalableImageDecoderFrame::setDecodingStatus):
(WebCore::ScalableImageDecoderFrame::decodingStatus const):
(WebCore::ScalableImageDecoderFrame::clearImage):
(WebCore::ScalableImageDecoderFrame::clear):
(WebCore::ScalableImageDecoderFrame::initialize):
(WebCore::ScalableImageDecoderFrame::size const):
(WebCore::ImageFrame::ImageFrame): Deleted.
(WebCore::ImageFrame::~ImageFrame): Deleted.
(WebCore::ImageFrame::defaultFrame): Deleted.
(WebCore::ImageFrame::operator=): Deleted.
(WebCore::ImageFrame::setDecodingStatus): Deleted.
(WebCore::ImageFrame::decodingStatus const): Deleted.
(WebCore::ImageFrame::clearImage): Deleted.
(WebCore::ImageFrame::clear): Deleted.
(WebCore::ImageFrame::initialize): Deleted.
(WebCore::ImageFrame::size const): Deleted.
(WebCore::ImageFrame::hasNativeImage const): Deleted.
(WebCore::ImageFrame::hasFullSizeNativeImage const): Deleted.
(WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions const): Deleted.
(WebCore::ImageFrame::singlePixelSolidColor const): Deleted.
* platform/image-decoders/ScalableImageDecoderFrame.h: Copied from Source/WebCore/platform/graphics/ImageFrame.h.
(WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
(WebCore::ScalableImageDecoderFrame::disposalMethod const):
(WebCore::ScalableImageDecoderFrame::hasAlpha const):
(WebCore::ScalableImageDecoderFrame::hasBackingStore const):
(WebCore::ImageFrame::ImageFrame): Deleted.
(WebCore::ImageFrame::isInvalid const): Deleted.
(WebCore::ImageFrame::isPartial const): Deleted.
(WebCore::ImageFrame::isComplete const): Deleted.
(WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
(WebCore::ImageFrame::frameBytes const): Deleted.
(WebCore::ImageFrame::subsamplingLevel const): Deleted.
(WebCore::ImageFrame::setDisposalMethod): Deleted.
(WebCore::ImageFrame::disposalMethod const): Deleted.
(WebCore::ImageFrame::nativeImage const): Deleted.
(WebCore::ImageFrame::setOrientation): Deleted.
(WebCore::ImageFrame::orientation const): Deleted.
(WebCore::ImageFrame::setDuration): Deleted.
(WebCore::ImageFrame::duration const): Deleted.
(WebCore::ImageFrame::setHasAlpha): Deleted.
(WebCore::ImageFrame::hasAlpha const): Deleted.
(WebCore::ImageFrame::hasNativeImage): Deleted.
(WebCore::ImageFrame::hasFullSizeNativeImage): Deleted.
(WebCore::ImageFrame::hasMetadata const): Deleted.
(WebCore::ImageFrame::backingStore const): Deleted.
(WebCore::ImageFrame::hasBackingStore const): Deleted.
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::frameBufferAtIndex):
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/bmp/BMPImageReader.h:
(WebCore::BMPImageReader::setBuffer):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::GIFImageDecoder::frameBufferAtIndex):
(WebCore::GIFImageDecoder::clearFrameBufferCache):
(WebCore::GIFImageDecoder::haveDecodedRow):
(WebCore::GIFImageDecoder::frameComplete):
(WebCore::GIFImageDecoder::initFrameBuffer):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
(GIFImageReader::parse):
* platform/image-decoders/gif/GIFImageReader.h:
(GIFFrameContext::GIFFrameContext):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::frameBufferAtIndex):
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::frameBufferAtIndex):
(WebCore::setPixel):
(WebCore::JPEGImageDecoder::outputScanlines):
(WebCore::JPEGImageDecoder::jpegComplete):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::PNGImageDecoder::readChunks):
(WebCore::PNGImageDecoder::clearFrameBufferCache):
(WebCore::PNGImageDecoder::initFrameBuffer):
(WebCore::PNGImageDecoder::frameComplete):
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::frameBufferAtIndex):
(WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::WEBPImageDecoder::decodeFrame):
(WebCore::WEBPImageDecoder::initFrameBuffer):
(WebCore::WEBPImageDecoder::applyPostProcessing):
(WebCore::WEBPImageDecoder::clearFrameBufferCache):
* platform/image-decoders/webp/WEBPImageDecoder.h:
2018-04-11 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations on by default
https://bugs.webkit.org/show_bug.cgi?id=184491
Reviewed by Simon Fraser.
* page/RuntimeEnabledFeatures.h:
2018-04-11 Ryosuke Niwa <rniwa@webkit.org>
Fix warning in HashTools.h for newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=184489
Reviewed by Alexey Proskuryakov.
Removed "register" storage class specififer as it has been deprecated in C++11.
* platform/HashTools.h:
2018-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
https://bugs.webkit.org/show_bug.cgi?id=183395
<rdar://problem/38055732>
Reviewed by Zalan Bujtas.
In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
mitigation by wrapping the Frame in a Ref when firing the appearance update timer.
Test: editing/selection/iframe-update-selection-appearance.html
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::appearanceUpdateTimerFired):
2018-04-10 Brent Fulgham <bfulgham@apple.com>
Unreviewed follow-up to r230468.
Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.
* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):
2018-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the iOS build
I accidentally exported an inline function in r230506.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::viewSize const):
2018-04-10 Nan Wang <n_wang@apple.com>
AX: Expose strong password fields on iOS
https://bugs.webkit.org/show_bug.cgi?id=184465
<rdar://problem/39325104>
Reviewed by Chris Fleizach.
Exposed the strong password field on iOS. And made sure
we are returning its actual value in accessibilityValue.
Test: accessibility/ios-simulator/strong-password-field.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
(-[WebAccessibilityObjectWrapper accessibilityValue]):
2018-04-10 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Add UserAgentWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=184438
Reviewed by Michael Catanzaro.
No new tests (No behavior change).
* PlatformWin.cmake:
* platform/win/UserAgentWin.cpp: Added.
(WebCore::standardUserAgent):
(WebCore::standardUserAgentForURL):
2018-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184435
<rdar://problem/38726260>
Reviewed by Dean Jackson.
Expose the size of the platform view. By default, in extra zoom mode, this *not* the same as the minimum layout
size, since we lay out at a large width and then shrink down to real device dimensions when computing the
initial scale (see r229063).
ViewGestureGeometryCollector uses this in the process of computing a target zoom scale when double tapping.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::viewSize const):
2018-04-10 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][WebKit] LibWebRTCProvider::webRTCAvailable is an undefined symbol
https://bugs.webkit.org/show_bug.cgi?id=184437
Reviewed by Michael Catanzaro.
No new tests (No behavior change).
* PlatformWin.cmake: Added LibWebRTCProviderWin.cpp.
* platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Added.
(WebCore::LibWebRTCProvider::webRTCAvailable):
2018-04-10 Chris Dumez <cdumez@apple.com>
Unreviewed build fix.
Those enum value names were too generic and would cause conflicts.
* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::hasPosition const):
(WebCore::VRDisplayCapabilities::hasOrientation const):
(WebCore::VRDisplayCapabilities::hasExternalDisplay const):
(WebCore::VRDisplayCapabilities::canPresent const):
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2018-04-10 Chris Dumez <cdumez@apple.com>
Avoid constructing a service worker RegistrationStore for private sessions
https://bugs.webkit.org/show_bug.cgi?id=184463
<rdar://problem/36613948>
Reviewed by Youenn Fablet.
Avoid constructing a service worker RegistrationStore for private sessions since there
is no need for persistence and the registrationDatabaseDirectory is the empty string in
such cases.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::didFinishActivation):
* workers/service/server/SWServer.h:
2018-04-10 Chris Dumez <cdumez@apple.com>
Unreviewed build fix.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::~LayoutContext):
* page/LayoutContext.h:
2018-04-10 Jeremy Jones <jeremyj@apple.com>
MediaSessionManageriOS should defer creation of MPVolumeView until it needs to monitor AirPlay routes
https://bugs.webkit.org/show_bug.cgi?id=184373
<rdar://problem/35177606>
Reviewed by Eric Carlson.
No change of behavior.
This delays the creation of MPVolumeView until airplay routes are monitored.
MPVolumeView is now also released when monitoring ends.
This makes sure the MP* objects are only accessed from a UI safe thread. WebCore's "MainThread" may be different that the UI thread.
Since this state change is necessarily asynchronous, starting and stopping must prevent races to keep state coherent.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):
(-[WebMediaSessionHelper dealloc]):
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
(-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
(-[WebMediaSessionHelper allocateVolumeView]): Deleted.
(-[WebMediaSessionHelper setVolumeView:]): Deleted.
2018-04-10 Sihui Liu <sihui_liu@apple.com>
Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
https://bugs.webkit.org/show_bug.cgi?id=184268
<rdar://problem/39144446>
Reviewed by Chris Dumez.
The assertion is no longer true after the change, because multiple resources could have same
url. Used if condition here to make sure we only delete specified resource.
No new tests. Updated an existing test to test the stop loading case by not using injected
bundle policy: http/tests/multipart/multipart-html.php.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::removeCachedResource):
2018-04-10 Zalan Bujtas <zalan@apple.com>
Do not layout images when we only need the overflow information.
https://bugs.webkit.org/show_bug.cgi?id=175331
Reviewed by Simon Fraser.
This improves MotionMark's Simple Leaves by ~10%.
Covered by existing tests.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layout):
2018-04-10 Zan Dobersek <zdobersek@igalia.com>
[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform
https://bugs.webkit.org/show_bug.cgi?id=183868
Reviewed by Carlos Garcia Campos.
Drop the GraphicsLayerTransform member variable from TextureMapperLayer
and instead compute all the required transform information in the
computeTransformsRecursive() method. These computations are not too
expensive, and in turn we can drop an object from this class' state that
was only duplicating a bunch of state variables.
No new tests -- no change in functionality.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeTransformsRecursive):
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::paintSelfAndChildren):
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::replicaTransform):
(WebCore::TextureMapperLayer::computeOverlapRegions):
(WebCore::TextureMapperLayer::setPosition):
(WebCore::TextureMapperLayer::setSize):
(WebCore::TextureMapperLayer::setAnchorPoint):
(WebCore::TextureMapperLayer::setPreserves3D):
(WebCore::TextureMapperLayer::setTransform):
(WebCore::TextureMapperLayer::setChildrenTransform):
(WebCore::TextureMapperLayer::syncAnimations):
(WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded):
* platform/graphics/texmap/TextureMapperLayer.h:
2018-04-09 Brent Fulgham <bfulgham@apple.com>
Add ProcessPrivilege assertions to places that access NSApp
https://bugs.webkit.org/show_bug.cgi?id=184322
<rdar://problem/39194560>
Reviewed by Per Arne Vollan.
Add ProcessPrivilege assertions to places where we interact with NSApp so
that we can prevent accidentally using them in the WebContent process.
* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
2018-04-09 John Wilander <wilander@apple.com>
Refactor Ignore HSTS code
https://bugs.webkit.org/show_bug.cgi?id=184433
<rdar://problem/39298238>
Reviewed by Darin Adler.
This patch refactors our ignore HSTS code. The convenience functions are moved
out of CFNetwork SPI in PAL, and into where they are used. It also switches
from performSelector: calls to straight function calls, after checking that
there is a responder.
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::schemeWasUpgradedDueToDynamicHSTS):
Add convenience function here since it was moved out of
CFNetworkSPI.h.
2018-04-09 Brady Eidson <beidson@apple.com>
Expand WebCore policy concept of "shouldContinue" to allow for more than true/false
https://bugs.webkit.org/show_bug.cgi?id=184424
Reviewed by Alex Christensen.
No new tests (No behavior change, refactor only)
Specifically this expands the "shouldContinue" bool to be an enum class with:
-Yes
-No
-ForSuspension
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
* loader/FrameLoader.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
* loader/PolicyChecker.h:
2018-04-09 Sihui Liu <sihui_liu@apple.com>
REGRESSION(r229929): localStorage is broken for WebInspector
https://bugs.webkit.org/show_bug.cgi?id=184382
<rdar://problem/39257355>
Reviewed by Chris Dumez.
Removed an if condition that caused false positive cases of database error. As per
https://www.sqlite.org/c3ref/errcode.html, return value of sqlite3_errcode() is undefined
on successful API call, so we should not use the code to check if there is an error. We
should only use it when there is an error.
After moving this condition, LocalStorage might return empty string instead of NULL on
sqlite3_column_blob() error.
Modified a test to cover this case:
TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm.
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnBlobAsString):
2018-04-09 Brent Fulgham <bfulgham@apple.com>
WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
https://bugs.webkit.org/show_bug.cgi?id=184344
<rdar://problem/39224969>
Reviewed by Per Arne Vollan.
The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
we do not want to allow in the WebContent process.
Instead, we should just use the cached screen information the WebContent process already possesses.
This patch makes the following changes:
1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
the WindowServer directly.
2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
the user space version of the coordinates. A nil Window just means we want to get coordinates in
terms of the primary display.
3. Keep track of the primary display so we can refer to it later.
4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
than whichever screen happened to hash to the lowest value.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const): Use new methods that
don't require WindowServer access.
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID): Assert if we hit this code in the WebContent process.
(WebCore::firstScreen): Ditto.
(WebCore::window): Ditto.
(WebCore::screen): Ditto.
(WebCore::primaryScreenID): Added.
(WebCore::getScreenProperties): Modify to return a pair consisting of the primary display ID and
the HashSet of screen settings.
(WebCore::setScreenProperties): Update to also track the primary display ID.
(WebCore::screenProperties): Update to use the primary display ID.
(WebCore::screenHasInvertedColors): Ditto.
(WebCore::toUserSpaceForPrimaryScreen): Added.
2018-04-09 Said Abou-Hallawa <sabouhallawa@apple.com>
Make InlineTextBox::createTextRun() take a const lvalue reference String
https://bugs.webkit.org/show_bug.cgi?id=184182
Reviewed by Zalan Bujtas.
InlineTextBox::createTextRun() takes a non-const lvalue reference String.
It is tempting to change the signature of this method to take a const lvalue
reference. But this was done intentionally. TextRun is effectively a StringView:
it does not own the passed string. Having the argument a non-const lvalue
reference makes the compiler prevent calls like createTextRun("abc").
To have a better way to express the lifetime of TextRun, this patch does
the following:
-- It makes TextRun::m_text of type String instead of StringView.
-- It adds a new constructor which takes const String&. This constructor
will addRef the underlying StringImpl when assigning it to m_text.
-- It keeps the constructor which takes a StringView. The caller of this
constructor still has to make sure the underlying String outlives the
TextRun. To avoid copying the underlying buffer of the StringView, we
will not use StringView::toString(). Instead we will use
StringView::toStringWithoutCopying() which makes the returned String
accesses the same buffer the StringView uses. In this case, the returned
String is effectively a StringView.
* page/DebugPageOverlays.cpp:
(WebCore::drawRightAlignedText):
* platform/graphics/TextRun.cpp:
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
(WebCore::TextRun::subRun const):
(WebCore::TextRun::length const):
(WebCore::TextRun::setText):
(WebCore::TextRun::string const): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::offsetForPosition const):
(WebCore::InlineTextBox::positionForOffset const):
(WebCore::InlineTextBox::createTextRun const):
There is no need for this function to take a String argument anymore. The
reason for passing the String was to guarantee its lifetime by keeping
a copy of it in the caller side. Now there is no need for that. The TextRun
itself will keep this copy.
* rendering/InlineTextBox.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
RenderText::text() returns StringImpl. The compiler wants us to be more
explicit about which constructor of TextRun to call.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
RenderStyle::hyphenString() returns an AtomicString.
2018-04-09 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r230390.
Broke accelerated compositing
Reverted changeset:
"[GTK] WaylandCompositorDisplay leaks its wl_display"
https://bugs.webkit.org/show_bug.cgi?id=184406
https://trac.webkit.org/changeset/230390
2018-04-03 Sergio Villar Senin <svillar@igalia.com>
[OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
https://bugs.webkit.org/show_bug.cgi?id=184265
Reviewed by Žan Doberšek.
VRFrameData contains all the required information to properly render a VR scene like view
and projection matrices, pose data (position & orientation) and linear & angular velocity
among others. The getFrameData() call must be issued inside a WebVR's own
requestAnimationFrame.
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::getFrameData const):
(WebCore::VRDisplay::getPose const):
(WebCore::VRDisplay::requestAnimationFrame):
(WebCore::VRDisplay::cancelAnimationFrame):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VREyeParameters.h:
(WebCore::VREyeParameters::rawOffset const): Required to compute view matrices.
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
(WebCore::VRFrameData::leftProjectionMatrix const):
(WebCore::VRFrameData::leftViewMatrix const):
(WebCore::VRFrameData::rightProjectionMatrix const):
(WebCore::VRFrameData::rightViewMatrix const):
(WebCore::projectionMatrixFromFieldOfView):
(WebCore::rotationMatrixFromQuaternion):
(WebCore::applyHeadToEyeTransform):
(WebCore::VRFrameData::update):
(WebCore::VRFrameData::timestamp const): Deleted.
* Modules/webvr/VRFrameData.h:
(WebCore::VRFrameData::timestamp const):
* Modules/webvr/VRPose.cpp:
(WebCore::optionalFloat3ToJSCArray):
(WebCore::VRPose::position const):
(WebCore::VRPose::linearVelocity const):
(WebCore::VRPose::linearAcceleration const):
(WebCore::VRPose::orientation const):
(WebCore::VRPose::angularVelocity const):
(WebCore::VRPose::angularAcceleration const):
* Modules/webvr/VRPose.h:
(WebCore::VRPose::create):
(WebCore::VRPose::update):
(WebCore::VRPose::VRPose):
* platform/vr/VRPlatformDisplay.h:
(WebCore::VRPlatformTrackingInfo::Quaternion::Quaternion):
(WebCore::VRPlatformTrackingInfo::Quaternion::conjugate):
(WebCore::VRPlatformTrackingInfo::Quaternion::operator*):
(WebCore::VRPlatformTrackingInfo::Float3::Float3): Just a group of 3 floats used to store
both velocity and acceleration in a format which is very convenient to later generate JSC
arrays.
(WebCore::VRPlatformTrackingInfo::clear):
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::rotationMatrixToQuaternion):
(WebCore::VRPlatformDisplayOpenVR::getTrackingInfo):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2018-04-09 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] WaylandCompositorDisplay leaks its wl_display
https://bugs.webkit.org/show_bug.cgi?id=184406
Reviewed by Carlos Garcia Campos.
Remove the protected default constructor, for good measure.
* platform/graphics/wayland/PlatformDisplayWayland.h:
2018-04-08 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
https://bugs.webkit.org/show_bug.cgi?id=184127
Reviewed by Konstantin Tokarev.
No new tests (No behaviour changes).
* CMakeLists.txt: Added a interface library WebCoreHeaderInterface.
2018-04-08 Yusuke Suzuki <utatane.tea@gmail.com>
Use alignas instead of compiler-specific attributes
https://bugs.webkit.org/show_bug.cgi?id=183508
Reviewed by Mark Lam.
Use alignas instead of aligned.
* platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
(WebCore::FELighting::platformApplyNeon):
2018-04-08 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
https://bugs.webkit.org/show_bug.cgi?id=184381
Reviewed by Carlos Garcia Campos.
These are unused.
* platform/FileSystem.h:
* platform/glib/FileSystemGlib.cpp:
(WebCore::FileSystem::applicationDirectoryPath): Deleted.
(WebCore::FileSystem::sharedResourcesPath): Deleted.
2018-04-07 Daniel Bates <dabates@apple.com>
Have WorkerScriptLoader::loadAsynchronously() take a FetchOptions
https://bugs.webkit.org/show_bug.cgi?id=184385
Reviewed by Youenn Fablet.
Currently we pass various FetchOptions to WorkerScriptLoader::loadAsynchronously()
so that it can build up a ThreadableLoaderOptions structure to pass to the loader.
Each time we want to set another FetchOptions option we need to add a new parameter.
Instead we should have WorkerScriptLoader::loadAsynchronously() take a FetchOptions.
This will make it straightforward for a caller to set new loader options as needed.
In particular, this will make it straightforward to support setting the request's
destination flag (i.e. FetchOptions::destination) to support blocking scripts with
a non-JavaScript MIME type in a subsequent commit.
No functionality changed. So, no new tests.
* loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Modified to take a FetchOptions
by value so as to support both move and copy semantics.
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added helper constructor
that takes a FetchOptions.
* loader/ThreadableLoader.h:
* workers/Worker.cpp:
(WebCore::Worker::create): Instantiate and pass a FetchOptions to the loader for the mode,
cache policy, and redirect policy.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously): Modified to take a FetchOptions and
instantiate a ThreadableLoaderOptions from it.
* workers/WorkerScriptLoader.h:
* workers/WorkerScriptLoaderClient.h:
(WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const): Deleted. This function
is no longer needed because the Service Worker client now passes the service worker mode
directly to the loader.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext): Instantiate and pass a FetchOptions
to the loader.
* workers/service/ServiceWorkerJob.h:
2018-04-07 Timothy Hatcher <timothy@apple.com>
Use the system's link color when system appearance is desired for a WebView.
https://bugs.webkit.org/show_bug.cgi?id=184353
rdar://problem/9420053
Reviewed by Wenson Hsieh.
Have Document consult RenderTheme via StyleColor for the various link colors.
This allows the system to have different colors than the standard hardcoded ones.
This adds StyleColor::Options, to avoid multiple booleans being passed around,
since the "for visited link" state is now needed in RenderTheme.
* WebCore.xcodeproj/project.pbxproj: Made StyleColor.h private, since RenderTheme.h includes it.
* css/StyleColor.cpp:
(WebCore::StyleColor::colorFromKeyword): Use options instead of a bool.
(WebCore::StyleColor::isSystemColor): Consider CSSValueWebkitLink the start of system colors.
* css/StyleColor.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const): Use StyleColor::Options.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor): Use StyleColor::Options.
* dom/Document.cpp:
(WebCore::Document::resetLinkColor): Ask StyleColor for the link color instead of hardcoding it.
(WebCore::Document::resetVisitedLinkColor): Ditto.
(WebCore::Document::resetActiveLinkColor): Ditto.
(WebCore::Document::styleColorOptions const): Added. Helper to get the options used.
* dom/Document.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Use StyleColor::Options.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::systemColor const): Add default values here, moved from Document.
(WebCore::RenderTheme::focusRingColor): Use StyleColor::Options.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformFocusRingColor const): Use StyleColor::Options.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemColor const): Use StyleColor::Options.
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor const): Use StyleColor::Options.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformFocusRingColor const): Use StyleColor::Options.
(WebCore::RenderThemeMac::platformColorsDidChange): Clear m_systemVisitedLinkColor.
(WebCore::RenderThemeMac::systemColor const): Use StyleColor::Options.
(WebCore::RenderThemeMac::adjustMenuListStyle const): Ditto.
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::systemColor const): Use StyleColor::Options.
* rendering/RenderThemeWin.h:
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle): Use StyleColor::Options.
2018-04-06 Youenn Fablet <youenn@apple.com>
Response headers should be filtered when sent from NetworkProcess to WebProcess
https://bugs.webkit.org/show_bug.cgi?id=184310
Reviewed by Ryosuke Niwa.
Did some refactoring to allow ResourceResponse to use header value parsing routines.
We add sanitization levels for regular responses in case responses might be exposed to scripts or not.
If not exposed to scripts, additional filtering is done.
Add internal API to get unfiltered response headers from a fetch response.
Test: http/wpt/service-workers/header-filtering.https.html
* Modules/fetch/FetchResponse.h:
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::parse):
* platform/network/HTTPParsers.h:
(WebCore::addToAccessControlAllowList):
(WebCore::parseAccessControlAllowList):
* platform/network/ResourceResponseBase.cpp:
(WebCore::isSafeToKeepRedirectionResponseHeader):
(WebCore::isCrossOriginSafeToKeepResponseHeader):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::fetchResponseHeaderList):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
2018-04-06 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused parameter warning when credential storage is disabled
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2018-04-06 Eric Carlson <eric.carlson@apple.com>
[Extra zoom mode] Block playback until fullscreen begins
https://bugs.webkit.org/show_bug.cgi?id=184371
<rdar://problem/39250891>
Reviewed by Youenn Fablet.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Return early when waiting to enter fullscreen.
(WebCore::HTMLMediaElement::enterFullscreen): Set m_waitingToEnterFullscreen.
(WebCore::HTMLMediaElement::exitFullscreen): Clear m_waitingToEnterFullscreen.
(WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto.
* html/HTMLMediaElement.h:
2018-04-06 Brent Fulgham <bfulgham@apple.com>
WebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=184364
<rdar://problem/39246314>
Reviewed by Per Arne Vollan.
The WebContent process is interacting directly with NSScreen to determine if the current screen
has extended color support. This should be brokered from the UIProcess.
Tested by fast/media/mq-color-gamut.html.
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const): Add screenSupportsExtendedColor.
(WebCore::ScreenProperties::decode): Ditto.
* platform/mac/PlatformScreenMac.mm:
(WebCore::getScreenProperties): Retrieve extended color support.
(WebCore::screenSupportsExtendedColor): Retrieve cached version when in the WebContent
process. Assert that NSScreen is not accessed in the WebContent process.
2018-04-06 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
https://bugs.webkit.org/show_bug.cgi?id=184296
Reviewed by Alex Christensen.
No new tests (No behavior changes).
* platform/PlatformWheelEvent.h: Placed cScrollbarPixelsPerLine definition.
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Removed cScrollbarPixelsPerLine definition.
2018-04-06 Brent Fulgham <bfulgham@apple.com>
Unreviewed test fix after r230323
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor): Remove assertion hit during test runs.
2018-04-06 Brent Fulgham <bfulgham@apple.com>
WebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
https://bugs.webkit.org/show_bug.cgi?id=184343
<rdar://problem/39224881>
Reviewed by Per Arne Vollan.
Revise ScreenProperties to serialize the screen's color space, and later
retrieve that in the WebContent process. This allows us to close off
the CGSWindowServer connection.
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const): Add CGColorSpaceRef support.
(WebCore::ScreenProperties::decode): Ditto.
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID): Add assertion to prevent use in WebContent process.
(WebCore::firstScreen): Ditto.
(WebCore::getScreenProperties): Add support for CGColorSpaceRef.
(WebCore::screenColorSpace): Retrieve cached version when in WebContent process.
Assert that NSScreen is not accessed in WebContent process.
2018-04-06 Ms2ger <Ms2ger@igalia.com>
Implement createImageBitmap(Blob)
https://bugs.webkit.org/show_bug.cgi?id=183247
Reviewed by Dean Jackson.
Tests:
- imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
- imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
* fileapi/FileReaderLoader.h:
(WebCore::FileReaderLoader::url): expose the Blob's URL.
* html/ImageBitmap.cpp: implement createImageBitmap(Blob).
* html/ImageBitmap.h: allow the BlobImageObserver class access to the creation function.
* loader/cache/CachedImage.cpp: reuse extracted code.
(WebCore::CachedImage::isPDFResource const):
(WebCore::CachedImage::isPostScriptResource const):
(WebCore::CachedImage::createImage):
* platform/graphics/Image.cpp: extract some code from CachedImage to reuse.
(WebCore::Image::create):
(WebCore::Image::isPDFResource):
(WebCore::Image::isPostScriptResource):
* platform/graphics/Image.h: add declarations.
2018-04-06 Zalan Bujtas <zalan@apple.com>
Flex child does not get repainted when it is inserted back to the render tree.
https://bugs.webkit.org/show_bug.cgi?id=184361
<rdar://problem/34528716>
Reviewed by Antti Koivisto.
As with any regular block children, we should issue full repaint for flexbox items on their
first layout (see RenderBlockFlow::layoutBlockChild()).
Test: fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2018-04-06 Ms2ger <Ms2ger@igalia.com>
Support transferring ImageBitmap objects
https://bugs.webkit.org/show_bug.cgi?id=183131
Reviewed by Dean Jackson.
Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize): thread through ImageBitmaps.
(WebCore::CloneSerializer::CloneSerializer): thread through ImageBitmaps.
(WebCore::CloneSerializer::fillTransferMap): don't require a mutable reference.
(WebCore::CloneSerializer::dumpImageBitmap): add.
(WebCore::CloneSerializer::dumpIfTerminal): check for ImageBitmap.
(WebCore::CloneDeserializer::deserialize): thread through ImageBitmaps.
(WebCore::CloneDeserializer::CloneDeserializer): thread through ImageBitmaps.
(WebCore::CloneDeserializer::readImageBitmap): add.
(WebCore::CloneDeserializer::readTerminal): check for ImageBitmap.
(WebCore::SerializedScriptValue::SerializedScriptValue): thread through ImageBitmaps.
(WebCore::SerializedScriptValue::create): thread through ImageBitmaps.
(WebCore::containsDuplicates): add.
(WebCore::SerializedScriptValue::deserialize): handle ImageBitmap arguments.
* bindings/js/SerializedScriptValue.h: update signatures, add member.
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::create): add.
(WebCore::ImageBitmap::detachBitmaps): add.
* html/ImageBitmap.h: add signatures.
2018-04-06 Said Abou-Hallawa <sabouhallawa@apple.com>
When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=184336
Reviewed by Antti Koivisto.
The state of the drawing context has to be transfered to the recording
DisplayList before recording. Many recording GraphicsContext functions
will behave wrongly if it gets the default state.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
(WebCore::CanvasRenderingContext2DBase::drawingContext const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::ContextState::ContextState):
(WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::Replayer::replay):
* platform/graphics/displaylists/DisplayListReplayer.h:
(WebCore::DisplayList::Replayer::replay): If we do not have a clipping
rectangle and we want to record all the drawing, we need a default value
for the clipping rectangle and we want no clipping to happen.
2018-04-06 Daniel Bates <dabates@apple.com>
Emit a more informative message when a script is blocked due to "X-Content-Type: nosniff"
https://bugs.webkit.org/show_bug.cgi?id=184359
Reviewed by Per Arne Vollan.
Emphasize in the message that the script was blocked from executing.
Test: http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didReceiveResponse):
2018-04-06 Daniel Bates <dabates@apple.com>
importScripts() should throw exception with a reason when it fails to load a script from the network
https://bugs.webkit.org/show_bug.cgi?id=184345
Reviewed by Alexey Proskuryakov.
Currently importScripts() throws a NetworkError exception without a reason when
it fails to load a script from the network. It is ambiguous whether the load failed
due to an access control failure or some other error. Instead we should include
the reason the load failed in the thrown exception.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
2018-04-06 Daniel Bates <dabates@apple.com>
Attempt to fix the build after <https://trac.webkit.org/changeset/230338>
(https://bugs.webkit.org/show_bug.cgi?id=184360)
Make lambdas mutable so that we can WTFMove() their captured arguments.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
2018-04-06 Daniel Bates <dabates@apple.com>
Have class Exception take String by value instead of a String&&
https://bugs.webkit.org/show_bug.cgi?id=184360
Reviewed by Alexey Proskuryakov.
For convenience support instantiating an Exception with either an lvalue String or
rvalue String.
Although it can be argued that having Exception take a String by value instead of String&&
can lead to missed opportunities to WTFMove() a String object into Exception such mistakes
are just that, missed opportunities. That is, correctness is not affected and we may perform
an unnecessary ref/deref of the underlying StringImpl when instantiating an Exception. If
such missed opportunities show up in profiles and such mistakes happen often then we can
re-evaluate the decision to have Exception take a String by value.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put): Simplify code now that Exception takes a String by value.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail): Ditto.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): Move String into Exception to avoid an
unnecessary ref/de-ref.
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): Ditto.
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): Ditto.
* dom/Exception.h:
(WebCore::Exception::Exception): Take String by value. Also use uniform initializer syntax.
2018-04-06 Antti Koivisto <antti@apple.com>
Tighten ImageSource to have BitmapImage pointer instead of Image
https://bugs.webkit.org/show_bug.cgi?id=184356
Reviewed by Said Abou-Hallawa.
ImageSource is an implementation detail of BitmapImage, not a generic type.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::decode):
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::decode): Deleted.
(WebCore::Image::imageFrameAvailableAtIndex): Deleted.
Also make some BitmapImage specific functions non-virtual and remove them from Image.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::create):
Make constructors private.
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2018-04-06 Brent Fulgham <bfulgham@apple.com>
Unreviewed test fix after r230323
* platform/mac/PlatformScreenMac.mm:
(WebCore::screen): Remove assertion we still hit due to event handling code.
2018-04-05 Youenn Fablet <youenn@apple.com>
REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=184306
Reviewed by Ryosuke Niwa.
Add an option to not compile CSS rules since they are not useful in NetworkProcess.
Covered by tests no longer crashing in Debug WK2 bots.
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::create):
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
* contentextensions/ContentExtensionsBackend.h:
2018-04-05 Brent Fulgham <bfulgham@apple.com>
WebContent process is calling CGDisplayUsesInvertedPolarity
https://bugs.webkit.org/show_bug.cgi?id=184337
<rdar://problem/39215702>
Reviewed by Zalan Bujtas.
The PlatformScreenMac code is still calling display-related routines directly, specifically
CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
the UIProcess.
There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
the compile guards so all macOS builds use this behavior.
Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
routines in the future.
Tested by existing regression tests.
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const): Add new values.
(WebCore::ScreenProperties::decode):
* platform/mac/PlatformScreenMac.mm:
(WebCore::displayID): Add assertion that this is not calling display-related routines in
the WebContent process.
(WebCore::firstScreen): Ditto.
(WebCore::screenProperties): Moved higher in the file so it can be reused. Add calls to
CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray.
(WebCore::getScreenProperties): Moved higher in the file so it can be reused. Stop
double-hashing displayID.
(WebCore::screenIsMonochrome): Use cached values in WebContent process. Assert if this
code attempts a display-related routine in the WebContent process.
(WebCore::screenHasInvertedColors): Ditto.
(WebCore::screenDepth): Add assertion that this is not calling display-related routines in
the WebContent process.
(WebCore::screenDepthPerComponent): Ditto.
(WebCore::screenRect): Ditto.
(WebCore::screenAvailableRect): Ditto.
(WebCore::screen): Ditto.
(WebCore::screenColorSpace): Ditto.
(WebCore::screenSupportsExtendedColor): Ditto.
2018-04-05 John Wilander <wilander@apple.com>
Resource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
https://bugs.webkit.org/show_bug.cgi?id=184346
<rdar://problem/39226036>
Reviewed by Brent Fulgham.
Since these cookies can't be seen and are not sent in requests, I
can't write an automated test for them. This really should have been
done as part of: https://bugs.webkit.org/show_bug.cgi?id=180682.
That said, I have tested this manually.
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
2018-04-05 Zalan Bujtas <zalan@apple.com>
Folding anonymous blocks should not result in deleting content.
https://bugs.webkit.org/show_bug.cgi?id=184339
<rdar://problem/37327428>
Reviewed by Antti Koivisto.
While folding multiple anonymous blocks (moving the children from next sibling over to previous sibling)
we should ensure that the block we are about to destroy does not gain new descendants.
In case of 4 sibling anonymous blocks (A B C D), while destroying B
1. we move C's children to A and destroy C.
2. While destroying C, we notice B and C as sibling anonymous blocks and we move
D's children over to B (even though B is going to be destroyed as we climb back on the stack).
In this patch, B is detached from the tree before we start moving renderers around so that a subsequent folding won't
find B anymore as a candidate.
Test: fast/block/crash-while-folding-anonymous-blocks.html
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::detach):
2018-04-05 Andy Estes <aestes@apple.com>
Mark Payment Request as "Supported" in features.json
https://bugs.webkit.org/show_bug.cgi?id=184338
Reviewed by Anders Carlsson.
* features.json:
2018-04-05 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r230042.
It is no longer needed now that it is safe to construct a
SecurityOrigin from an on-main thread
Reverted changeset:
"WebSocket::didReceiveMessage() may construct a SecurityOrigin
object on a non-main thread"
https://bugs.webkit.org/show_bug.cgi?id=184068
https://trac.webkit.org/changeset/230042
2018-04-05 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Remove StaticLock
https://bugs.webkit.org/show_bug.cgi?id=184332
Reviewed by Mark Lam.
No behavior change.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::performOpenAndVerify):
(WebCore::Database::closeDatabase):
(WebCore::Database::getCachedVersion const):
(WebCore::Database::setCachedVersion):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::openDatabaseMutex):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::allActiveWebSocketsMutex):
* Modules/websockets/WebSocket.h:
* bridge/objc/WebScriptObject.mm:
* crypto/CryptoAlgorithmRegistry.cpp:
(WebCore::CryptoAlgorithmRegistry::identifier):
(WebCore::CryptoAlgorithmRegistry::name):
(WebCore::CryptoAlgorithmRegistry::create):
(WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
* dom/Node.cpp:
* platform/URL.cpp:
* platform/graphics/FontCache.cpp:
* platform/graphics/MediaPlayer.cpp:
* platform/ios/QuickLook.mm:
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
* platform/ios/wak/WebCoreThread.mm:
* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/network/cf/LoaderRunLoopCF.cpp:
(WebCore::loaderRunLoop):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlShareHandle::mutexFor):
* platform/network/curl/CurlContext.h:
* platform/sql/SQLiteDatabaseTracker.cpp:
(WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::buildBaseTextCodecMaps):
(WebCore::newTextCodec):
(WebCore::atomicCanonicalTextEncodingName):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThreadCount):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::~WorkerThread):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
2018-04-04 Youenn Fablet <youenn@apple.com>
WebRTC data channel only applications require capture permissions for direct connections
https://bugs.webkit.org/show_bug.cgi?id=174500
<rdar://problem/34134281>
Reviewed by Eric Carlson.
Test: webrtc/datachannel/mdns-ice-candidates.html
Add support at PeerConnectionBackend to obfuscate any gathered host candidate
by replacing the IP address with an opaque name that can be resolved by MDNS.
An opaque name is generated for each IP address and is scoped by the document owning the peer connection object.
Add support to resolve any such MDNS ICE candidate.
A limit of 250 ms is fixed for the resolution to happen.
After 250 ms, the candidate is discarded.
Add an experimental flag around this feature, off by default.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::extractIPAddres):
(WebCore::PeerConnectionBackend::addIceCandidate):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::newICECandidate):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::registerMDNSName):
(WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCIceCandidate.h:
(WebCore::RTCIceCandidate::setCandidate):
* Modules/mediastream/RTCPeerConnection.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::suspend):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const):
(WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2018-04-04 Brian Burg <bburg@apple.com>
[Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
https://bugs.webkit.org/show_bug.cgi?id=184314
<rdar://problem/39186578>
Reviewed by Timothy Hatcher.
Covered by several tests in add_cookie.py per the bug title.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
the truncated value and actual value are the same.
2018-04-04 Alex Christensen <achristensen@webkit.org>
Move PingHandle to WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=184145
Reviewed by Youenn Fablet.
* WebCore.xcodeproj/project.pbxproj:
* platform/network/PingHandle.h: Removed.
2018-04-04 Per Arne Vollan <pvollan@apple.com>
The layout test fast/canvas/canvas-blending-global-alpha.html is failing when the WebContent process does not have WindowServer access.
https://bugs.webkit.org/show_bug.cgi?id=183752
<rdar://problem/38635731>
The test is failing because the system is only providing software rendering when there is no access
to the WindowServer, and software rendering is producing slightly different results than hardware
rendering. To enable accelerated rendering, the GPU to be used for IOSurface rendering needs to be
selected by handing over the OpenGL display mask to the IOSurface CGContext.
Reviewed by Brent Fulgham.
No new tests, covered by existing tests.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::getOpenGLDisplayMask):
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext):
2018-04-04 Said Abou-Hallawa <sabouhallawa@apple.com>
Track the paint frequency through a new class named PaintFrequencyTracker
https://bugs.webkit.org/show_bug.cgi?id=184311
Reviewed by Antti Koivisto.
PaintFrequencyTracker is a class which detects when a layer is painted
frequently. SinglePaintFrequencyTracking is used in conjunction with
PaintFrequencyTracker to recored a single paint timing.
* rendering/PaintFrequencyTracker.h: Added.
(WebCore::PaintFrequencyTracker::begin):
(WebCore::PaintFrequencyTracker::end):
(WebCore::PaintFrequencyTracker::paintingFrequently const):
Simplify the logic for tracking the paint frequency and move it from
RenderLayer.cpp.
(WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
(WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking):
A convenient way to bracket the begin() and the end() methods of
PaintFrequencyTracker.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::PaintFrequencyInfo::PaintFrequencyInfo): Deleted.
(WebCore::PaintFrequencyInfo::setPaintedCacheableResource): Deleted.
(WebCore::PaintFrequencyInfo::paintingFrequently const): Deleted.
(WebCore::PaintFrequencyInfo::updatePaintFrequency): Deleted.
(WebCore::PaintFrequencyInfo::paintingCacheableResource): Deleted.
* rendering/RenderLayer.h:
Rename PaintFrequencyInfo to PaintFrequencyTracker and move it a separate
header file.
2018-04-04 Jer Noble <jer.noble@apple.com>
RELEASE_ASSERT in CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF() when MediaToolbox.framework missing
https://bugs.webkit.org/show_bug.cgi?id=184247
<rdar://problem/39007591>
Rubber-stamped by Eric Carlson.
Use SOFT_LINK_FRAMEWORK_OPTIONAL for frameworks which are not guaranteed to be present.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF):
2018-04-04 Brent Fulgham <bfulgham@apple.com>
Failures from mach port reference handling should be fatal
https://bugs.webkit.org/show_bug.cgi?id=184202
<rdar://problem/37771114>
Reviewed by Anders Carlsson.
We may corrupt the Mach port space by improperly matching the equivalent of reference counting
retains (mach_port_mod_refs) with releases (mach_port_deallocate).
Our current implementation of MachSendRights::create does not grab a reference if the passed
port is MACH_PORT_DEAD, but we unconditionally call mach_port_deallocate on the port, which
could lead to a reference count mismatch.
Likewise, our MachSendRight destructor does not release the port if it has changed to MACH_PORT_DEAD
(e.g., if a child process dies), again leading to a mismatch in retain/releases.
Finally, failures in mach_port_deallocate should be fatal because they indicate that the
application was attempting to remove an unowned right. This is a fatal condition for Mach, and
should lead to an abort.
This patch does the following:
1. It creates a helper function that does the right thing for safely deallocating a mach port.
2. It uses it in multiple places.
3. It revises 'MachSendRight::create" so that it properly handles the condition of a dead port.
4. It revises the MachSendRight destructor to properly handle the condition of a dead port.
No new tests, no change in behavior expected.
* SourcesCocoa.txt: Update for move of MachSendRight files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::getMachThreads): Added.
(WebCore::cpuUsage): Use the new cleanup helper function.
* platform/cocoa/MachSendRight.cpp: Removed.
* platform/cocoa/MachSendRight.h: Removed.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
2018-04-04 Youenn Fablet <youenn@apple.com>
Remove unused HTTP header names
https://bugs.webkit.org/show_bug.cgi?id=184272
Reviewed by Alex Christensen.
No change of behavior.
Removed some names that are not used in the code base.
This allows to strengthen filtering of responses sent to WebProcess.
Added two headers used by web inspector.
Updated existing code to use indexed HTTP header names.
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::sourceMapURLForResource):
* platform/network/HTTPHeaderNames.in:
2018-04-04 Beth Dakin <bdakin@apple.com>
Fix the !HAVE(AVFOUNDATION_VIDEO_OUTPUT) build
https://bugs.webkit.org/show_bug.cgi?id=184309
-and corresponding-
rdar://problem/39179126
Reviewed by Jer Noble.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2018-04-04 Youenn Fablet <youenn@apple.com>
MockRealtimeVideoSourceMac should produce kCVPixelFormatType_420YpCbCr8Planar buffers
https://bugs.webkit.org/show_bug.cgi?id=184304
Reviewed by Eric Carlson.
Allows covering RealtimeOutgoingVideoSourceMac code path handling native buffers produced by capture video sources.
ARGB buffer coverage is done through canvas capture streams.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
2018-04-04 Youenn Fablet <youenn@apple.com>
Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=183988
Reviewed by Darin Adler.
No change of behavior, TrackPrivate remains destroyed on the main thread.
* platform/graphics/TrackPrivateBase.h:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2018-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the build with libsoup < 2.49.91 after r230251.
Stop using ResourceHandle in SoupNetworkSession.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::authenticateCallback): Deleted.
(WebCore::requestStartedCallback): Deleted.
2018-04-03 Alex Christensen <achristensen@webkit.org>
Remove unused libsoup ResourceHandle implementation
https://bugs.webkit.org/show_bug.cgi?id=184048
Reviewed by Michael Catanzaro.
This code is unused since r228901 so let's remove it!
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::~ResourceHandle):
(WebCore::ResourceHandleInternal::soupSession):
(WebCore::ResourceHandle::cancelledOrClientless):
(WebCore::ResourceHandle::ensureReadBuffer):
(WebCore::ResourceHandle::currentStreamPosition const):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::releaseForDownload):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedCancellation):
(WebCore::ResourceHandle::receivedChallengeRejection):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::sessionFromContext): Deleted.
(WebCore::ResourceHandle::create): Deleted.
(WebCore::ResourceHandle::ResourceHandle): Deleted.
(WebCore::isAuthenticationFailureStatusCode): Deleted.
(WebCore::tlsErrorsChangedCallback): Deleted.
(WebCore::gotHeadersCallback): Deleted.
(WebCore::applyAuthenticationToRequest): Deleted.
(WebCore::restartedCallback): Deleted.
(WebCore::shouldRedirect): Deleted.
(WebCore::shouldRedirectAsGET): Deleted.
(WebCore::continueAfterWillSendRequest): Deleted.
(WebCore::doRedirect): Deleted.
(WebCore::redirectSkipCallback): Deleted.
(WebCore::wroteBodyDataCallback): Deleted.
(WebCore::cleanupSoupRequestOperation): Deleted.
(WebCore::nextMultipartResponsePartCallback): Deleted.
(WebCore::sendRequestCallback): Deleted.
(WebCore::continueAfterDidReceiveResponse): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::createSoupMessageForHandleAndRequest): Deleted.
(WebCore::createSoupRequestAndMessageForHandle): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
(WebCore::waitingToSendRequest): Deleted.
(WebCore::readCallback): Deleted.
2018-04-03 Ross Kirsling <ross.kirsling@sony.com>
Add missing WEBCORE_EXPORTs (for Windows shared library build)
https://bugs.webkit.org/show_bug.cgi?id=184279
Reviewed by Alex Christensen.
* dom/Element.h:
* dom/Node.h:
* editing/FrameSelection.h:
* html/DOMURL.h:
* html/HTMLFormElement.h:
* html/canvas/CanvasRenderingContext.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/network/HTTPHeaderMap.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* platform/network/curl/AuthenticationChallenge.h:
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceResponse.h:
2018-04-03 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
https://bugs.webkit.org/show_bug.cgi?id=184281
rdar://problem/39153262
Reviewed by Jer Noble.
Covered by manual testing by going to WebRTC web sites.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2018-04-03 Filip Pizlo <fpizlo@apple.com>
GC shouldn't do object distancing
https://bugs.webkit.org/show_bug.cgi?id=184195
Reviewed by Saam Barati.
No new tests because no change in behavior.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
* dom/Document.cpp:
(WebCore::Document::threadLocalCache): Deleted.
* dom/Document.h:
* page/OriginThreadLocalCache.cpp: Removed.
* page/OriginThreadLocalCache.h: Removed.
2018-04-03 Brent Fulgham <bfulgham@apple.com>
Guard against keychain/certificate access outside the network process
https://bugs.webkit.org/show_bug.cgi?id=184214
<rdar://problem/38734795>
Reviewed by Youenn Fablet.
Use the ProcessPrivilege assertions to guard against accessing the Keychain from
a non-Networking process.
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticator::makeCredential): Assert if we access the keychain from
a proces other than the Network or UI process.
(WebCore::LocalAuthenticator::getAssertion): Ditto.
(WebCore::LocalAuthenticator::issueClientCertificate const): Ditto.
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey): Ditto.
(WebCore::findMasterKey): Ditto.
(WebCore::deleteDefaultWebCryptoMasterKey): Ditto.
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::createPrivateStorageSession): Ditto.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
2018-04-03 Youenn Fablet <youenn@apple.com>
NetworkResourceLoader does not need to expose all redirect response headers
https://bugs.webkit.org/show_bug.cgi?id=184114
<rdar://problem/39010557>
Reviewed by Ryosuke Niwa.
No JS observable change of behavior.
Behavior change is observable for injected bundles since they will no longer get access to the full response.
List of response headers correspond to the one currently being used/exposed for redirections.
Test: http/wpt/loading/redirect-headers.html
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setRestrictedHTTPResponseAccess):
(WebCore::RuntimeEnabledFeatures::restrictedHTTPResponseAccess const):
* platform/network/ResourceResponseBase.cpp:
(WebCore::isSafeToKeepRedirectionHeader):
(WebCore::ResourceResponseBase::sanitizeRedirectionHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:
2018-04-03 Andy Estes <aestes@apple.com>
[Mac] Prioritize file promises over filenames during drag and drop
https://bugs.webkit.org/show_bug.cgi?id=184237
<rdar://problem/38278076>
Reviewed by Wenson Hsieh.
When performing a drag operation where the pasteboard contains both a file path and a file
promise, we have historically preferred to accept the file path. Some versions of Photos.app
will provide both a low-resolution thumbnail as a file path and its high-resolution
counterpart as a file promise when dragging a photo, and our current logic leads us to
choose the low-quality thumbnail.
This patch changes our logic to prefer file promises over file paths. This matches the
behavior of Finder and ensures we accept high-resolution assets from Photos.app.
Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
write a bogus file path to the pasteboard along with the legitimate file promise.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::asFilenames const):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readFilePaths):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::numberOfFiles const):
2018-04-03 Mark Lam <mark.lam@apple.com>
Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
https://bugs.webkit.org/show_bug.cgi?id=184276
<rdar://problem/39109543>
Rubber-stamped by Michael Saboff.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
2018-04-03 Yousuke Kimoto <yousuke.kimoto@sony.com>
[CMake] gperf path should be given when WebCore/css/makevalues.pl is executed
https://bugs.webkit.org/show_bug.cgi?id=184224
Reviewed by Konstantin Tokarev.
When a building evironment doens't include a path to gperf,
WebCore/css/makevalue.pl failes due to failing to execute gperf,
so the full path to gperf should be given like WebCore/css/makeprop.pl.
No new tests, no Web-facing behavior change.
* CMakeLists.txt: gperf path is given to css/makevalues.pl.
* css/makevalues.pl: Add an argument to handle a given gperf path.
2018-04-03 Chris Dumez <cdumez@apple.com>
Drop MainFrame class
https://bugs.webkit.org/show_bug.cgi?id=184191
Reviewed by Darin Adler.
Drop MainFrame class and move contents into Page / Frame since there is a 1:1
relationship between the Page and the MainFrame.
This is ground work for introducing LocalFrame / RemoteFrame concepts.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::paymentCoordinator const):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::paymentCoordinator):
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
* Modules/mediastream/UserMediaRequest.cpp:
* Modules/plugins/QuickTimePluginReplacement.mm:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::mainFrame const):
(WebCore::AccessibilityObject::visiblePositionForBounds const):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptState.cpp:
* contentextensions/ContentExtensionsBackend.cpp:
* css/MediaQueryEvaluator.cpp:
(WebCore::displayModeEvaluate):
* dom/DOMImplementation.cpp:
* dom/Document.cpp:
* dom/DocumentMarkerController.cpp:
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/EventDispatcher.cpp:
* dom/ScriptedAnimationController.cpp:
* editing/Editor.cpp:
(WebCore::Editor::scanSelectionForTelephoneNumbers):
* editing/EditorCommand.cpp:
* editing/SelectionRectGatherer.cpp:
(WebCore::SelectionRectGatherer::Notifier::~Notifier):
* editing/cocoa/WebContentReaderCocoa.mm:
* editing/markup.cpp:
* history/CachedFrame.cpp:
* history/CachedPage.cpp:
* history/PageCache.cpp:
(WebCore::destroyRenderTree):
* html/HTMLMediaElement.cpp:
* html/HTMLPlugInImageElement.cpp:
* html/ImageDocument.cpp:
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay):
* html/canvas/WebGLRenderingContextBase.cpp:
* inspector/InspectorClient.cpp:
* inspector/InspectorController.cpp:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorOverlay.cpp:
* inspector/PageScriptDebugServer.cpp:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorCanvasAgent.cpp:
* inspector/agents/InspectorDOMAgent.cpp:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::mainFrame):
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
* inspector/agents/page/PageRuntimeAgent.cpp:
* loader/DocumentLoader.cpp:
* loader/DocumentWriter.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::setState):
* loader/HistoryController.cpp:
* loader/NavigationDisabler.h:
* loader/ProgressTracker.cpp:
* loader/ResourceLoadObserver.cpp:
* loader/ResourceLoader.cpp:
* loader/SubframeLoader.cpp:
* loader/SubresourceLoader.cpp:
* loader/appcache/ApplicationCacheHost.cpp:
* loader/archive/mhtml/MHTMLArchive.cpp:
* loader/cache/CachedResource.cpp:
* loader/cache/CachedResourceLoader.cpp:
* page/AutoscrollController.cpp:
* page/Chrome.cpp:
* page/ContextMenuController.cpp:
* page/DOMWindow.cpp:
* page/DebugPageOverlays.cpp:
(WebCore::MouseWheelRegionOverlay::updateRegion):
(WebCore::NonFastScrollableRegionOverlay::updateRegion):
(WebCore::RegionOverlay::create):
(WebCore::RegionOverlay::RegionOverlay):
(WebCore::RegionOverlay::~RegionOverlay):
(WebCore::DebugPageOverlays::ensureRegionOverlayForPage):
(WebCore::DebugPageOverlays::showRegionOverlay):
(WebCore::DebugPageOverlays::hideRegionOverlay):
(WebCore::DebugPageOverlays::regionChanged):
(WebCore::DebugPageOverlays::regionOverlayForPage const):
(WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
(WebCore::DebugPageOverlays::settingsChanged):
* page/DebugPageOverlays.h:
(WebCore::DebugPageOverlays::hasOverlaysForPage const):
(WebCore::DebugPageOverlays::hasOverlays):
(WebCore::DebugPageOverlays::didLayout):
(WebCore::DebugPageOverlays::didChangeEventHandlers):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
(WebCore::DragController::tryDHTMLDrag):
(WebCore::DragController::beginDrag):
(WebCore::DragController::doSystemDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::clearLatchedState):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/FocusController.cpp:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::dropChildren):
(WebCore::Frame::selfOnlyRef):
(WebCore::Frame::selfOnlyDeref):
* page/Frame.h:
(WebCore::Frame::mainFrame const):
* page/FrameTree.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::setContentsSize):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::setViewExposedRect):
* page/History.cpp:
* page/MainFrame.cpp: Removed.
* page/MainFrame.h: Removed.
* page/MemoryRelease.cpp:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::m_applicationManifest):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::latchingState):
(WebCore::Page::pushNewLatchingState):
(WebCore::Page::resetLatchingState):
(WebCore::Page::popLatchingState):
(WebCore::Page::removeLatchingStateForTarget):
(WebCore::Page::setPaymentCoordinator):
* page/Page.h:
(WebCore::Page::mainFrame):
(WebCore::Page::mainFrame const):
(WebCore::Page::wheelEventDeltaFilter):
(WebCore::Page::pageOverlayController):
(WebCore::Page::servicesOverlayController):
(WebCore::Page::paymentCoordinator const):
(WebCore::Page::applicationManifest const):
(WebCore::Page::performanceLogging const):
* page/PageConsoleClient.cpp:
* page/PageDebuggable.cpp:
* page/PageGroup.cpp:
* page/PageGroupLoadDeferrer.cpp:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::controller const):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::updateSettingsForLayer):
(WebCore::PageOverlayController::deviceScaleFactor const):
(WebCore::PageOverlayController::notifyFlushRequired):
(WebCore::PageOverlayController::tiledBackingUsageChanged):
* page/PageOverlayController.h:
* page/PageSerializer.cpp:
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::PerformanceLogging):
(WebCore::PerformanceLogging::didReachPointOfInterest):
* page/PerformanceLogging.h:
* page/PerformanceMonitor.cpp:
* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::~ResourceUsageOverlay):
(WebCore::ResourceUsageOverlay::initialize):
* page/SettingsBase.cpp:
* page/SpatialNavigation.cpp:
* page/UserContentProvider.cpp:
* page/ios/FrameIOS.mm:
* page/mac/DragControllerMac.mm:
* page/mac/EventHandlerMac.mm:
(WebCore::latchingIsLockedToPlatformFrame):
(WebCore::latchingIsLockedToAncestorOfThisFrame):
(WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
(WebCore::EventHandler::platformPrepareForWheelEvents):
(WebCore::EventHandler::platformRecordWheelEvent):
(WebCore::EventHandler::platformCompleteWheelEvent):
(WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
* page/mac/PageMac.mm:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::page const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
(WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const):
(WebCore::ServicesOverlayController::ServicesOverlayController):
(WebCore::ServicesOverlayController::invalidateHighlightsOfType):
(WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
(WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const):
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
(WebCore::ServicesOverlayController::buildSelectionHighlight):
(WebCore::ServicesOverlayController::hasRelevantSelectionServices):
(WebCore::ServicesOverlayController::createOverlayIfNeeded):
(WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
(WebCore::ServicesOverlayController::mouseEvent):
(WebCore::ServicesOverlayController::handleClick):
(WebCore::ServicesOverlayController::mainFrame const):
* page/scrolling/AsyncScrollingCoordinator.cpp:
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* plugins/DOMMimeType.cpp:
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
* rendering/RenderBox.cpp:
* rendering/RenderLayer.cpp:
* rendering/RenderLayerBacking.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderObject.cpp:
* replay/UserInputBridge.cpp:
* storage/StorageEventDispatcher.cpp:
* style/StyleTreeResolver.cpp:
(WebCore::Style::suspendMemoryCacheClientCalls):
* svg/SVGSVGElement.cpp:
* svg/graphics/SVGImage.cpp:
* testing/InternalSettings.cpp:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::installMockPageOverlay):
(WebCore::Internals::pageOverlayLayerTreeAsText const):
* testing/MockPageOverlay.cpp:
* testing/MockPageOverlay.h:
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::installOverlay):
(WebCore::MockPageOverlayClient::layerTreeAsText):
* testing/MockPageOverlayClient.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
(WebCore::MockPaymentCoordinator::changeShippingOption):
(WebCore::MockPaymentCoordinator::changePaymentMethod):
(WebCore::MockPaymentCoordinator::acceptPayment):
(WebCore::MockPaymentCoordinator::cancelPayment):
* testing/MockPaymentCoordinator.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
2018-04-03 Sihui Liu <sihui_liu@apple.com>
The referer header is not set after redirect
https://bugs.webkit.org/show_bug.cgi?id=182644
<rdar://problem/37479048>
Reviewed by Youenn Fablet.
Update referrer policy and recompute referrer in redirection check, so Referer header would be set after it's removed from cross-origin request.
Add support for Referrer-Policy header, so referrer policy would be changed based on redirect response.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::processReferrerPolicy):
* loader/CrossOriginAccessControl.cpp:
(WebCore::updateRequestReferrer):
* loader/CrossOriginAccessControl.h:
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::setReferrerPolicy):
(WebCore::ResourceLoader::referrerPolicy const):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
(WebCore::SubresourceLoader::updateReferrerPolicy):
* loader/SubresourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
(WebCore::CachedResourceRequest::updateForAccessControl):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
* platform/ReferrerPolicy.cpp: Added.
(WebCore::parseReferrerPolicy):
* platform/ReferrerPolicy.h:
* platform/network/HTTPHeaderNames.in:
2018-04-03 Chris Dumez <cdumez@apple.com>
Make SecurityOrigin safe to create and use from any thread
https://bugs.webkit.org/show_bug.cgi?id=184216
Reviewed by Youenn Fablet.
We found that we have a decent amount of code constructing and using SecurityOrigin
objects from non-main threads. Unfortunately, this was not safe, mostly due to
SecurityOrigin's reliance on the SchemeRegistry.
This patch makes it safe to construct a SecurityOrigin on any thread A and use
it later on the same thread A. However, developers still need to call isolatedCopy()
if they want to pass such object to another thread B.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay const):
* page/SecurityOrigin.h:
* page/SecurityPolicy.cpp:
(WebCore::originAccessMapLock):
(WebCore::originAccessMap):
(WebCore::SecurityPolicy::isAccessWhiteListed):
(WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
(WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
(WebCore::SecurityPolicy::resetOriginAccessWhitelists):
* platform/SchemeRegistry.cpp:
(WebCore::schemeRegistryLock):
(WebCore::allBuiltinSchemes):
(WebCore::builtinLocalURLSchemes):
(WebCore::localURLSchemes):
(WebCore::displayIsolatedURLSchemes):
(WebCore::builtinSecureSchemes):
(WebCore::secureSchemes):
(WebCore::builtinSchemesWithUniqueOrigins):
(WebCore::schemesWithUniqueOrigins):
(WebCore::builtinEmptyDocumentSchemes):
(WebCore::emptyDocumentSchemes):
(WebCore::schemesForbiddenFromDomainRelaxation):
(WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
(WebCore::canDisplayOnlyIfCanRequestSchemes):
(WebCore::notAllowingJavascriptURLsSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsLocal):
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
(WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing):
(WebCore::schemesAllowingDatabaseAccessInPrivateBrowsing):
(WebCore::builtinCORSEnabledSchemes):
(WebCore::CORSEnabledSchemes):
(WebCore::ContentSecurityPolicyBypassingSchemes):
(WebCore::cachePartitioningSchemes):
(WebCore::serviceWorkerSchemes):
(WebCore::alwaysRevalidatedSchemes):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
(WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
(WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
(WebCore::SchemeRegistry::registerURLSchemeAsSecure):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
(WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
(WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
(WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
(WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
(WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
(WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
(WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
(WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
(WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
* platform/SchemeRegistry.h:
2018-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Stop using ResourceHandle to load GResources
https://bugs.webkit.org/show_bug.cgi?id=184259
Reviewed by Sergio Villar Senin.
GResources are loaded in the WebProcess using ResourceHandle because soup handles them transparently. But now
that we no longer use ResourceHandle, we can add a simple loader for GResources, similar to the one used for
data URLS, since loading a GResource is a matter of calling g_resources_lookup_data() in the end.
* SourcesGTK.txt:
* SourcesWPE.txt:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start): Check if resource to load is a GResource and call loadGResource().
* loader/ResourceLoader.h:
* loader/soup/ResourceLoaderSoup.cpp: Added.
(WebCore::ResourceLoader::loadGResource): Load the GResource in a GTask thread.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::size const):
* platform/SharedBuffer.h:
* platform/glib/SharedBufferGlib.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::create):
2018-04-02 Carlos Garcia Campos <cgarcia@igalia.com>
[Enchant] Clean up TextCheckerEnchant
https://bugs.webkit.org/show_bug.cgi?id=184233
Reviewed by Michael Catanzaro.
Several cleanups and improvements:
* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::singleton): Make TextCheckerEnchant a singleton since it's always used as a
singleton.
(WebCore::TextCheckerEnchant::EnchantDictDeleter::operator() const):
(WebCore::TextCheckerEnchant::TextCheckerEnchant):
(WebCore::TextCheckerEnchant::ignoreWord): Convert to utf8 once instead of on every loop iteration.
(WebCore::TextCheckerEnchant::learnWord): Ditton.
(WebCore::TextCheckerEnchant::checkSpellingOfWord): m_enchantDictionaries is now a Vector of std::unique_ptr.
(WebCore::TextCheckerEnchant::getGuessesForWord): Convert to utf8 once instead of on every loop iteration.
(WebCore::TextCheckerEnchant::updateSpellCheckingLanguages): Get only the first language instead of building a
vector to get its first item. Use WTFMove to replace m_enchantDictionaries with the new Vector.
(WebCore::TextCheckerEnchant::loadedSpellCheckingLanguages const): Use a lambda to get the list of languages
already converted to String and iterate only once.
(WebCore::TextCheckerEnchant::availableSpellCheckingLanguages const): Ditto.
(WebCore::enchantDictDescribeCallback): Deleted.
(WebCore::TextCheckerEnchant::~TextCheckerEnchant): Deleted.
(WebCore::TextCheckerEnchant::freeEnchantBrokerDictionaries): Deleted.
* platform/text/enchant/TextCheckerEnchant.h:
2018-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Segfaults in enchant_broker_free_dict()
https://bugs.webkit.org/show_bug.cgi?id=183738
Reviewed by Michael Catanzaro.
Check enchant_broker_request_dict() didn't return nullptr before adding it to the m_enchantDictionaries vector.
* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::updateSpellCheckingLanguages):
2018-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
https://bugs.webkit.org/show_bug.cgi?id=183346
Reviewed by Michael Catanzaro.
This might happen if a request is cancelled right after the password request starts and before it finishes. We
should cancel the password search when the network request is cancelled, not only when the NetworkStorageSession
is destroyed.
* platform/network/NetworkStorageSession.h:
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::SecretServiceSearchData::SecretServiceSearchData): Helper struct to keep the request cancellable and
completion handler.
(WebCore::NetworkStorageSession::getCredentialFromPersistentStorage): Create a SecretServiceSearchData for the
request.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Pass the request cancellable to
NetworkStorageSession::getCredentialFromPersistentStorage().
2018-04-02 Eric Carlson <eric.carlson@apple.com>
[Extra zoom mode] Replace video with a placeholder image during fullscreen transition
https://bugs.webkit.org/show_bug.cgi?id=184188
<rdar://problem/38940307>
Reviewed by Youenn Fablet.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::willExitFullscreen):
* html/HTMLMediaElement.h:
* platform/cocoa/VideoFullscreenChangeObserver.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::willExitFullscreen):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::updateVideoFullscreenInlineImage):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::updateVideoFullscreenInlineImage):
* platform/graphics/VideoFullscreenLayerManager.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
(WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage):
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::willExitFullscreen):
2018-04-02 Eric Carlson <eric.carlson@apple.com>
Define AVKit softlink macro
https://bugs.webkit.org/show_bug.cgi?id=184241
Reviewed by Jer Noble.
No new tests, no functional change.
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
* platform/ios/WebAVPlayerController.mm:
* platform/mac/PlaybackSessionInterfaceMac.mm:
* platform/mac/VideoFullscreenInterfaceMac.mm:
2018-04-02 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Update date picker UI to latest specifications
https://bugs.webkit.org/show_bug.cgi?id=184234
<rdar://problem/38804760>
Reviewed by Timothy Hatcher.
Tweak localizable strings. Day, month and year labels should be fully capitalized, and there needs to be a
string for the "Set" button title.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::datePickerSetButtonTitle):
(WebCore::datePickerDayLabelTitle):
(WebCore::datePickerMonthLabelTitle):
(WebCore::datePickerYearLabelTitle):
* platform/LocalizedStrings.h:
2018-04-02 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r228260):WebHTMLView beeps at every keydown for Chinese/Japanese/Korean Input Method
https://bugs.webkit.org/show_bug.cgi?id=184231
Reviewed by Alexey Proskuryakov.
The bug was caused by EventHandler::internalKeyEvent calling setDefaultHandled and expecting it to stay true
after dispatching the event even though m_defaultHandled is always cleared after r228260. This results in
EventHandler::internalKeyEvent returning false, and resulting in a beep.
Unfortunately, no new tests since there is no facility to detect this case in layout tests, and we can't
easily emulate or trigger a real input method in API tests.
* page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):
2018-04-02 Jer Noble <jer.noble@apple.com>
AudioBufferSourceNode start method causes OfflineAudioContext to start running
https://bugs.webkit.org/show_bug.cgi?id=181939
<rdar://problem/36755393>
Reviewed by Eric Carlson.
Test: webaudio/offlineaudiocontext-restriction.html
Don't respect playback restrictions for offline AudioContexts.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon):
* Modules/webaudio/AudioContext.h:
(WebCore::AudioContext::isOfflineContext const):
(WebCore::AudioContext::userGestureRequiredForAudioStart const):
(WebCore::AudioContext::pageConsentRequiredForAudioStart const):
(WebCore::AudioContext::isOfflineContext): Deleted.
2018-04-02 Alejandro G. Castro <alex@igalia.com>
[GTK] Make libwebrtc backend buildable for GTK port
https://bugs.webkit.org/show_bug.cgi?id=178860
Reviewed by Youenn Fablet.
This is the first step to add webrtc support to the GTK port using
the libwebrtc backend.
No new tests, no new feature added, it should be tested by current
tests.
* CMakeLists.txt: Add the new files to the compilation and set the
new includes in the libwebrtc library.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
Reorder the includes alphabetically and add some that are missing.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
Ditto.
* Sources.txt: Add new file to the compilation.
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
Added. Initial implementation for GTK and WPE.
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h:
Added. Ditto.
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
Added. Ditto.
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h:
Added. Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
Added. Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
Added. Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
Added. Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
Added. Ditto.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Added includes
for the compilation.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Added, inherit from
the LibWebRTCProvider to adapt for glib.
2018-04-01 Yusuke Suzuki <utatane.tea@gmail.com>
Use WTF::Lock instead of GMutex
https://bugs.webkit.org/show_bug.cgi?id=184227
Reviewed by Saam Barati.
Prefer WTF::Lock over GMutex since these locks are just protecting WebKit C++ fields.
No behavior change.
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::provideInput):
(WebCore::AudioSourceProviderGStreamer::handleAudioBuffer):
(WebCore::AudioSourceProviderGStreamer::clearAdapters):
* platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2018-03-31 Brent Fulgham <bfulgham@apple.com>
Show punycode if URL contains hyphen character
https://bugs.webkit.org/show_bug.cgi?id=184221
<rdar://problem/38044633>
Reviewed by Darin Adler.
Revise our "lookalike character" logic to include the hyphen,
non-breaking hyphen, and minus sign.
Test: fast/url/host.html
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
2018-03-31 Filip Pizlo <fpizlo@apple.com>
JSObject shouldn't do index masking
https://bugs.webkit.org/show_bug.cgi?id=184194
Reviewed by Yusuke Suzuki.
No new tests because no new behavior.
* bindings/js/JSDOMConvertSequences.h:
(WebCore::Detail::NumericSequenceConverter::convertArray):
(WebCore::Detail::SequenceConverter::convertArray):
2018-03-30 Chris Dumez <cdumez@apple.com>
REGRESSION (r229828): Facebook login popup is blank
https://bugs.webkit.org/show_bug.cgi?id=184206
<rdar://problem/39057006>
Reviewed by Wenson Hsieh.
Since r229828, we freeze the layer tree during the navigation policy check.
We freeze in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
and unfreeze in WebFrameLoaderClient::didDecidePolicyForNavigationAction().
WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() gets called
from PolicyChecker::checkNavigationPolicy() which has 3 call sites in
FrameLoader and one in DocumentLoader for redirects. The call sites in
FrameLoader were taking care of calling didDecidePolicyForNavigationAction()
on the FrameLoaderClient in their completion handler, but the DocumentLoader
call site was failing to do so. As a result, the layer tree would stay frozen.
To make this a lot less error prone, I moved the call to
WebFrameLoaderClient::didDecidePolicyForNavigationAction() to
PolicyChecker::checkNavigationPolicy(), inside the completion handler passed
to WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(). This way,
even if new code starts calling PolicyChecker::checkNavigationPolicy(), we
do not need to worry about letting the client know when the policy decision
is made.
No new tests, covered by existing redirection tests with the
new assertion I added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2018-03-30 Devin Rousso <webkit@devinrousso.com>
Web Inspector: tint all pixels drawn by shader program when hovering ShaderProgramTreeElement
https://bugs.webkit.org/show_bug.cgi?id=175223
Reviewed by Matt Baker.
Test: inspector/canvas/setShaderProgramHighlighted.html
* html/canvas/InspectorShaderProgram.h:
(WebCore::InspectorShaderProgram::highlighted):
(WebCore::InspectorShaderProgram::setHighlighted):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::InspectorScopedShaderProgramHighlight::InspectorScopedShaderProgramHighlight):
(WebCore::InspectorScopedShaderProgramHighlight::~InspectorScopedShaderProgramHighlight):
(WebCore::InspectorScopedShaderProgramHighlight::showHighlight):
(WebCore::InspectorScopedShaderProgramHighlight::hideHighlight):
(WebCore::InspectorScopedShaderProgramHighlight::saveBlendValue):
(WebCore::InspectorScopedShaderProgramHighlight::hasBufferBinding):
(WebCore::InspectorScopedShaderProgramHighlight::hasFramebufferParameterAttachment):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
If the current shader program has been marked as highlighted, apply a blend right before
`drawArrays` and `drawElements` is called, tinting the resulting pixels so that they are
visually distinguished from pixels drawn by other shader programs.
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
* inspector/InspectorInstrumentation.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::isShaderProgramHighlighted):
(WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl):
2018-03-30 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Adopt list view controller UI for numeric input types
https://bugs.webkit.org/show_bug.cgi?id=184184
<rdar://problem/37238916>
Reviewed by Timothy Hatcher.
Add a localized string for the OK button shown on number pads in extra zoomed form controls.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::numberPadOKButtonTitle):
* platform/LocalizedStrings.h:
2018-03-30 Ryosuke Niwa <rniwa@webkit.org>
Copying a list from Microsoft Word to TinyMCE fails when mso-list is the first property
https://bugs.webkit.org/show_bug.cgi?id=182938
<rdar://problem/37683007>
Reviewed by Wenson Hsieh.
Made the logic to detect Microsoft Word's mso-list CSS property more generic by detecting
inline styles which start with "mso-list:" and one which line-break right before it: "\nmso-list:"
Tests: PasteHTML.PreservesMSOList
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
2018-03-30 Youenn Fablet <youenn@apple.com>
NetworkLoadChecker should upgrade redirects if needed
https://bugs.webkit.org/show_bug.cgi?id=184098
Reviewed by Chris Dumez.
Test: imported/w3c/web-platform-tests/beacon/upgrade-beacon.https.html
* page/csp/ContentSecurityPolicy.h:
2018-03-30 Daniel Bates <dabates@apple.com>
ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
https://bugs.webkit.org/show_bug.cgi?id=184161
Reviewed by Per Arne Vollan.
Fixes an assertion failure when quiting an app that uses a Legacy WebKit web view
after dragging-and-dropping a PDF embedded using an HTML image element into the
same web view.
When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
from the main frame's WebHTMLView and promise AppKit that will provide a Rich Text Format (RTF) document
from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
fullfill its RTF document promise for the WebArchive created at the start of the drag operation. WebKit
expects that the created WebArchive is either for an inline image (e.g. <img>) or an image document that
has a supported image resource MIME type (by querying MIMETypeRegistry::isSupportedImageResourceMIMEType())
and checks for these cases in this order. PDF/PostScript are not listed in the set of supported image
resource MIME types. So, the first check fails and WebKit assumes that the WebArchive was created from
an image document of a supported image resource MIME type. However, the WebArchive was created from a
WebHTMLView and has MIME type text/html. Therefore the assertion fails. We need to add PDF and PostScript
to the set of supported image resource MIME types so that WebKit does not fall back to the WebHTMLView
code path. Historically, PDF and PostScript were in the set supported image resource MIME types. Over time
the set of MIME types for image resouces (images loaded as a document) became identical to the set of MIME
types for images loaded inline (e.g. <img>) and this set omitted the MIME types for PDF and PostScript.
Additionally it is sufficient to implement MIMETypeRegistry::isSupportedImageResourceMIMEType() in terms
of MIMETypeRegistry::isSupportedImageMIMEType() and MIMETypeRegistry::isPDFOrPostScriptMIMEType() instead
of allocating a dedicated HashSet for the supported image resource MIME types (as we currently do).
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Assert that PDF is a supported image MIME type before
instantiating an ImageDocument.
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes): Remove unnecessary allocation of a HashSet for the support
image resource MIME types.
(WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Write in terms of MIMETypeRegistry::isSupportedImageMIMEType()
and MIMETypeRegistry::isPDFOrPostScriptMIMEType().
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
* platform/MIMETypeRegistry.h:
2018-03-29 Antoine Quint <graouts@apple.com>
[Web Animations] CSSTransition objects should have fill: backwards to allow seeking prior to start time
https://bugs.webkit.org/show_bug.cgi?id=184129
Reviewed by Dean Jackson.
In order to allow a CSS Transition to be seeked prior to its start time, it needs to have its fill mode set
to backwards. Adding code to set the fill mode in CSSTransition::initialize() yields early timing model
invalidation and we could get in a situation where stylesWouldYieldNewCSSTransitionsBlendingKeyframes()
was called before we had a chance to create blending keyframes for a CSS transitions, since the call
to create blending keyframes is made after the call to initialize(), so we now cater for this case.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::initialize):
* animation/CSSTransition.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const):
2018-03-30 Daniel Bates <dabates@apple.com>
Remove unused MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
https://bugs.webkit.org/show_bug.cgi?id=184154
Reviewed by Per Arne Vollan.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Deleted.
* platform/MIMETypeRegistry.h:
2018-03-30 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r230102.
Caused assertion failures on JSC bots.
Reverted changeset:
"A stack overflow in the parsing of a builtin (called by
createExecutable) cause a crash instead of a catchable js
exception"
https://bugs.webkit.org/show_bug.cgi?id=184074
https://trac.webkit.org/changeset/230102
2018-03-30 Robin Morisset <rmorisset@apple.com>
A stack overflow in the parsing of a builtin (called by createExecutable) cause a crash instead of a catchable js exception
https://bugs.webkit.org/show_bug.cgi?id=184074
<rdar://problem/37165897>
Reviewed by Keith Miller.
I had to slightly change the type of some bindings between JSC and WebCore. No functional change intended on the WebCore side.
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
(WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
(WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
(WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
(WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeExecutable):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorConstructor::initializeExecutable):
2018-03-29 Antoine Quint <graouts@apple.com>
[Web Animations] Correctly obtain the timing function for a given keyframe
https://bugs.webkit.org/show_bug.cgi?id=184146
Reviewed by Dean Jackson.
The way we would get the timing function for a given KeyframeValue stored in a KeyframeList was really suboptimal.
When keyframes were created, we would set the animated element's style on each keyframe, and set keyframe-specific
properties and values on top. When figuring out the timing function for a KeyframeValue, we would look at its render
style, go through its list of animations, which could include animations that are irrelevant to this specific keyframe
list since all animations from the animated element are referenced, and we would have to look up the correct animation
by name and get the timing function, even though the timing function stored on the animation was now specific to this
particular keyframe.
We now simply set a m_timingFunction member on a KeyframeValue, which is null if no explicit animation-timing-function
was provided for this keyframe in CSS, and otherwise set to a valid TimingFunction.
This fixes our behavior for a 4 existing animation tests when opted into the CSS Animations and CSS Transitions as
Web Animations feature.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::keyframeStylesForAnimation):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty const):
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::createFromCSSText):
(WebCore::TimingFunction::createFromCSSValue):
* platform/animation/TimingFunction.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeValue::timingFunction const): Deleted.
* rendering/style/KeyframeList.h:
(WebCore::KeyframeValue::timingFunction const):
(WebCore::KeyframeValue::setTimingFunction):
2018-03-29 Ryosuke Niwa <rniwa@webkit.org>
Copying a list from Microsoft Word to TinyMCE fails when mso-list is on tags other than P
https://bugs.webkit.org/show_bug.cgi?id=182954
<rdar://problem/37713141>
Reviewed by Wenson Hsieh.
Fixed the bug by relaxing the restriction that we only preserve mso-list on p.
Tests: PasteHTML.PreservesMSOListOnH4
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
2018-03-29 JF Bastien <jfbastien@apple.com>
Use Forward.h instead of forward-declaring WTF::String
https://bugs.webkit.org/show_bug.cgi?id=184172
<rdar://problem/39026146>
Reviewed by Yusuke Suzuki.
As part of #184164 I'm changing WTF::String, and the forward
declarations are just wrong because I'm making it templated. We
should use Forward.h anyways, so do that instead.
* css/makeprop.pl:
* platform/cocoa/PlaybackSessionInterface.h:
* platform/ios/Device.h:
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/win/PathWalker.h:
* testing/js/WebCoreTestSupport.h:
2018-03-29 Ross Kirsling <ross.kirsling@sony.com>
MSVC __forceinline slows down JSC release build fivefold after r229391
https://bugs.webkit.org/show_bug.cgi?id=184062
Reviewed by Alex Christensen.
* platform/graphics/FormatConverter.cpp:
Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
2018-03-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r230087.
Introduced LayoutTest failures.
Reverted changeset:
"FrameSelection::appearanceUpdateTimerFired should be robust
against layout passes underneath it"
https://bugs.webkit.org/show_bug.cgi?id=183395
https://trac.webkit.org/changeset/230087
2018-03-29 Wenson Hsieh <wenson_hsieh@apple.com>
FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
https://bugs.webkit.org/show_bug.cgi?id=183395
<rdar://problem/38055732>
Reviewed by Zalan Bujtas.
In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
mitigation by wrapping the Frame in a Ref when firing the appearance update timer, and ensuring that layout is
really up to date before calling updateAppearanceAfterLayoutOrStyleChange() from the timer.
Test: editing/selection/iframe-update-selection-appearance.html
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::appearanceUpdateTimerFired):
2018-03-29 Daniel Bates <dabates@apple.com>
Substitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitLoad):
* loader/archive/ArchiveFactory.cpp:
(WebCore::ArchiveFactory::isArchiveMIMEType):
(WebCore::ArchiveFactory::isArchiveMimeType): Deleted.
* loader/archive/ArchiveFactory.h:
* platform/MIMETypeRegistry.h:
2018-03-29 Daniel Bates <dabates@apple.com>
MIMETypeRegistry should return const HashSets
https://bugs.webkit.org/show_bug.cgi?id=184150
Reviewed by Per Arne Vollan.
Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
LegacyWebKit can modify the set of non-image MIME types.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
(WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
(WebCore::MIMETypeRegistry::getPDFMIMETypes):
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
* platform/MIMETypeRegistry.h:
2018-03-29 Brady Eidson <beidson@apple.com>
Update Service Worker feature status.
https://bugs.webkit.org/show_bug.cgi?id=184139
Reviewed by Chris Dumez.
* features.json:
2018-03-29 Chris Dumez <cdumez@apple.com>
Drop DOMWindow::frames() / DOMWindow::window() methods
https://bugs.webkit.org/show_bug.cgi?id=184112
Reviewed by Daniel Bates.
Drop DOMWindow::frames() / DOMWindow::window() methods as they are just aliases for DOMWindow::self().
* page/DOMWindow.h:
* page/DOMWindow.idl:
2018-03-29 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r230062.
https://bugs.webkit.org/show_bug.cgi?id=184128
Broke mac port. web content process crashes while loading any
web page (Requested by rniwa on #webkit).
Reverted changeset:
"MSVC __forceinline slows down JSC release build fivefold
after r229391"
https://bugs.webkit.org/show_bug.cgi?id=184062
https://trac.webkit.org/changeset/230062
2018-03-28 Antoine Quint <graouts@apple.com>
[Web Animations] Implement more CSSPropertyBlendingClient methods
https://bugs.webkit.org/show_bug.cgi?id=184077
Reviewed by Dean Jackson.
We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
CSS Transitions as Web Animations feature.
We also ensure we only run a CSSAnimationController assertion in FrameView::didDestroyRenderTree() if
we're not using the CSS Animations and CSS Transitions as Web Animations feature.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
(WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
* animation/KeyframeEffectReadOnly.h:
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
2018-03-28 Chris Dumez <cdumez@apple.com>
Align XMLHttpRequest's open() / send() / abort() with the latest specification
https://bugs.webkit.org/show_bug.cgi?id=184108
Reviewed by Youenn Fablet.
Align XMLHttpRequest's open() / send() / abort() with the latest specification:
- https://xhr.spec.whatwg.org
No new tests, rebaselined existing layout tests.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
Align with https://xhr.spec.whatwg.org/#the-open()-method:
- Change the order of some steps to match the order in the spec. In particular,
open() no longer resets the state to UNSENT or abort any existing load when it
fails early due to being passed a bad method.
(WebCore::XMLHttpRequest::createRequest):
Align with https://xhr.spec.whatwg.org/#the-send()-method:
- Use the simpler "upload listener flag" logic from the spec instead of our more
complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
objects on a background thread when XHR is used inside Web Workers, which was
not thread-safe.
- Set the upload complete flag when the request has no body as per step 9.
- After firing the loadstartEvent, return early if the state is no longer OPEN or
if the send flag is unset, as per step 11.3.
(WebCore::XMLHttpRequest::abort):
Align with https://xhr.spec.whatwg.org/#the-abort()-method:
- Only set the state to UNSENT if the state is still DONE after firing the error
events, as per step 3.
(WebCore::XMLHttpRequest::didSendData):
Use new "upload listener flag".
(WebCore::XMLHttpRequest::dispatchErrorEvents):
Align with https://xhr.spec.whatwg.org/#request-error-steps:
- Stop firing a progress event in case of error as this is not as per specification
and Firefox does not fire those either.
* xml/XMLHttpRequest.h:
2018-03-28 Timothy Hatcher <timothy@apple.com>
Consolidate NSColor to WebCore::Color conversion and fix system colors.
https://bugs.webkit.org/show_bug.cgi?id=184096
rdar://problem/38918925
Reviewed by Tim Horton.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
(WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
Also use nextafter for proper RGBA float conversion.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::color): Use colorFromNSColor.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::systemColor const): Ditto.
(WebCore::paintAttachmentTitleBackground): Ditto.
(WebCore::convertNSColorToColor): Deleted.
2018-03-28 Said Abou-Hallawa <sabouhallawa@apple.com>
The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
https://bugs.webkit.org/show_bug.cgi?id=183972
Reviewed by Daniel Bates.
If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
of the animated properties have to be detached from the items in the list
before it's deleted.
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::clearAnimatedType):
2018-03-28 Ross Kirsling <ross.kirsling@sony.com>
MSVC __forceinline slows down JSC release build fivefold after r229391
https://bugs.webkit.org/show_bug.cgi?id=184062
Reviewed by Alex Christensen.
* platform/graphics/FormatConverter.cpp:
Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
2018-03-28 Zalan Bujtas <zalan@apple.com>
Make it possible to override the screen size
https://bugs.webkit.org/show_bug.cgi?id=184111
<rdar://problem/38972181>
Reviewed by Tim Horton.
We just call screenSize() atm.
* page/Chrome.cpp:
(WebCore::Chrome::overrideScreenSize const):
* page/Chrome.h:
* page/ChromeClient.h:
* platform/HostWindow.h:
* platform/PlatformScreen.h:
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenRect):
(WebCore::overrideScreenSize):
2018-03-28 Timothy Hatcher <timothy@apple.com>
Include the 'text' color keyword as a system color.
https://bugs.webkit.org/show_bug.cgi?id=184113
rdar://problem/38779267
Reviewed by Tim Horton.
* css/StyleColor.cpp:
(WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
(WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
since it is immediately after CSSValueAppleSystemYellow.
2018-03-28 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
https://bugs.webkit.org/show_bug.cgi?id=184110
<rdar://problem/38796648>
Reviewed by Tim Horton.
HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
renderer, and then dispatches a `change` event if needed.
However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
without updating the renderer, leaving it stale.
Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::optionSelectedByUser):
Update the renderer after updating the DOM to reflect the selected option.
2018-03-28 Daniel Bates <dabates@apple.com>
Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
<rdar://problem/36518856>
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillStrongConfirmationPasswordLabel):
2018-03-28 Daniel Bates <dabates@apple.com>
WebSocket cookie incorrectly stored
https://bugs.webkit.org/show_bug.cgi?id=184100
<rdar://problem/37928715>
Reviewed by Brent Fulgham.
A cookie received in a WebSocket response should be stored with respect to the
origin of the WebSocket server in order for it to be sent in a subsequent request.
Also removed a FIXME about implementing support for the long since
deprecated Set-Cookie2 header.
Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.h:
2018-03-28 Chris Dumez <cdumez@apple.com>
Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
https://bugs.webkit.org/show_bug.cgi?id=183962
<rdar://problem/38817833>
Reviewed by Brady Eidson.
Pass extra bits of information to the UIProcess via NavigationAction:
- Is it a cross origin navigation caused by window.open()
- Does the navigated frame have an opener
This information is useful to determine on UIProcess side if we want
to swap WebProcess.
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
(WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
(WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
(WebCore::NavigationAction::setOpener):
(WebCore::NavigationAction::opener const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
2018-03-28 Chris Dumez <cdumez@apple.com>
Thread safety issue in IDBFactory' shouldThrowSecurityException()
https://bugs.webkit.org/show_bug.cgi?id=184064
Reviewed by Ryosuke Niwa.
shouldThrowSecurityException() gets called on a non-main thread but
it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
which calls SecurityOrigin::isLocal().
Since using the SchemeRegistry from the background thread is not safe
(we recently added locks which we're trying to remove), and since SecurityOrigin
methods are often called from background threads, this patch make SecurityOrigin::isLocal()
safe to call from a background thread. To achieve this, we now query the SchemeRegistry
in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
constructed on the main thread.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isLocal const): Deleted.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::isLocal const):
2018-03-28 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r230033.
The LayoutTests modified in this change fail an assertion on
WK1.
Reverted changeset:
"[Web Animations] Implement more CSSPropertyBlendingClient
methods"
https://bugs.webkit.org/show_bug.cgi?id=184077
https://trac.webkit.org/changeset/230033
2018-03-28 Chris Dumez <cdumez@apple.com>
WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
https://bugs.webkit.org/show_bug.cgi?id=184068
Reviewed by Youenn Fablet.
WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
which is not safe. We now use SecurityOriginData since we only need an origin String and
it is safe to construct a SecurityOriginData on any thread.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessage):
2018-03-28 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Make boosted text autosizing values switchable at runtime
https://bugs.webkit.org/show_bug.cgi?id=184092
<rdar://problem/38939917>
Reviewed by Tim Horton.
In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
want to opt in or out of boosted text autosizing values and just use the existing values.
This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
then trigger style recalculation.
Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
(WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
(WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
(WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.
Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
constants for use in extra zoom mode.
* page/SettingsBase.h:
(WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
(WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
(WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):
Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
text autosizing.
2018-03-28 Brent Fulgham <bfulgham@apple.com>
Avoid uninitialized mach ports
https://bugs.webkit.org/show_bug.cgi?id=184090
<rdar://problem/37261129>
Reviewed by Chris Dumez.
It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
there is a potential for us to try to use invalid ports.
We should always check return values, and ensure that the mach port variables we seek to initialize are
kept in a valid state.
No new tests, no Web-facing behavior change.
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.
2018-03-28 Antoine Quint <graouts@apple.com>
[Web Animations] Implement more CSSPropertyBlendingClient methods
https://bugs.webkit.org/show_bug.cgi?id=184077
Reviewed by Dean Jackson.
We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
CSS Transitions as Web Animations feature.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
(WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
* animation/KeyframeEffectReadOnly.h:
2018-03-28 Antoine Quint <graouts@apple.com>
[Web Animations] Comparing two matching FramesTimingFunction objects fails
https://bugs.webkit.org/show_bug.cgi?id=184078
Reviewed by Jon Lee.
Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
restart any transition with a frames() timing function when we check that the Animation objects are similar.
* platform/animation/TimingFunction.h:
2018-03-28 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Remove UpdateAtlas
https://bugs.webkit.org/show_bug.cgi?id=184042
Reviewed by Žan Doberšek.
Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
of buffers to render tiles with cairo, allocate a new buffer for each tile instead.
Covered by existent tests.
* loader/EmptyClients.h:
* page/ChromeClient.h:
* platform/TextureMapper.cmake:
* platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
* platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
* platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
(): Deleted.
* platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
* platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2018-03-27 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r230008.
Lots of HTTP test failures
Reverted changeset:
"Remove unused libsoup ResourceHandle implementation"
https://bugs.webkit.org/show_bug.cgi?id=184048
https://trac.webkit.org/changeset/230008
2018-03-27 Chris Dumez <cdumez@apple.com>
Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=184029
Reviewed by Youenn Fablet.
Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
SecurityOrigin (which isn't).
ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
(WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
(WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
(WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
* page/csp/ContentSecurityPolicy.h:
2018-03-27 Daniel Bates <dabates@apple.com>
Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
(https://bugs.webkit.org/show_bug.cgi?id=179983)
Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
enabled fetch for a mask image to try to fix the following tests from timing out:
media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):
2018-03-27 Per Arne Vollan <pvollan@apple.com>
The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
https://bugs.webkit.org/show_bug.cgi?id=183923
<rdar://problem/38756869>
Reviewed by Brent Fulgham.
The test is timing out when we do not interact directly with the WindowServer, causing
OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
requesting an accelerated pixel format will fail because it cannot determine which GPU is
connected to the display.
OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
process) that does not directly control the display.
We can get correct behavior if we tell OpenGL which GPU is currently connected to the
display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.
We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
which GPU it should use.
See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
for details on how the virtual screen is found from the OpenGL display mask.
No new tests, covered by existing tests.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::setPixelFormat):
(WebCore::identifyAndSetCurrentGPU):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask):
(WebCore::GraphicsContext3D::allowOfflineRenderers):
2018-03-27 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement authenticatorGetAssertion
https://bugs.webkit.org/show_bug.cgi?id=183881
<rdar://problem/37258628>
Reviewed by Brent Fulgham.
This patch does the following few things:
1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
between UI and Web processes.
3) It refines the way how LocalAuthenticator::makeCredential find intersection between
excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
a match in the hash set to produce the intersetction. The new way is also employed in
LocalAuthenticator::getAssertion as well.
4) It abstracts the way to produce authData and thus reorders a bit of code in
LocalAuthenticator::makeCredential.
Covered by API tests.
* Modules/webauthn/AuthenticatorManager.cpp:
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
* Modules/webauthn/cocoa/LocalAuthenticator.h:
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticatorInternal::buildAuthData):
(WebCore::LocalAuthenticatorInternal::produceHashSet):
(WebCore::LocalAuthenticator::makeCredential):
(WebCore::LocalAuthenticator::getAssertion):
(WebCore::LocalAuthenticator::issueClientCertificate const):
* WebCore.xcodeproj/project.pbxproj:
2018-03-27 Chris Dumez <cdumez@apple.com>
Avoid constructing SecurityOrigin objects from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=184024
Reviewed by Youenn Fablet.
Avoid constructing SecurityOrigin objects from non-main threads as much as possible
as it is not safe. This patch gets rid of most offending cases but not all of them
yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
constructor yet.
For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
gets called from non-main threads and construct a SecurityOrigin. Fixing this
will require some refactoring that would have made this patch much larger.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
* page/EventSource.cpp:
(WebCore::EventSource::didReceiveResponse):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegistration):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::origin const):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::workerThread):
* workers/WorkerThread.h:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
(WebCore::fireMessageEvent):
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.h:
2018-03-27 Alex Christensen <achristensen@webkit.org>
Remove unused libsoup ResourceHandle implementation
https://bugs.webkit.org/show_bug.cgi?id=184048
Reviewed by Michael Catanzaro.
This code is unused since r228901 so let's remove it!
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::~ResourceHandle):
(WebCore::ResourceHandleInternal::soupSession):
(WebCore::ResourceHandle::cancelledOrClientless):
(WebCore::ResourceHandle::ensureReadBuffer):
(WebCore::ResourceHandle::currentStreamPosition const):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::didStartRequest):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::releaseForDownload):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::shouldUseCredentialStorage):
(WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedCancellation):
(WebCore::ResourceHandle::receivedChallengeRejection):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::sessionFromContext): Deleted.
(WebCore::ResourceHandle::create): Deleted.
(WebCore::ResourceHandle::ResourceHandle): Deleted.
(WebCore::isAuthenticationFailureStatusCode): Deleted.
(WebCore::tlsErrorsChangedCallback): Deleted.
(WebCore::gotHeadersCallback): Deleted.
(WebCore::applyAuthenticationToRequest): Deleted.
(WebCore::restartedCallback): Deleted.
(WebCore::shouldRedirect): Deleted.
(WebCore::shouldRedirectAsGET): Deleted.
(WebCore::continueAfterWillSendRequest): Deleted.
(WebCore::doRedirect): Deleted.
(WebCore::redirectSkipCallback): Deleted.
(WebCore::wroteBodyDataCallback): Deleted.
(WebCore::cleanupSoupRequestOperation): Deleted.
(WebCore::nextMultipartResponsePartCallback): Deleted.
(WebCore::sendRequestCallback): Deleted.
(WebCore::continueAfterDidReceiveResponse): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::createSoupMessageForHandleAndRequest): Deleted.
(WebCore::createSoupRequestAndMessageForHandle): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
(WebCore::waitingToSendRequest): Deleted.
(WebCore::readCallback): Deleted.
2018-03-27 Chris Dumez <cdumez@apple.com>
Move online state detection from the WebProcess to the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=183989
<rdar://problem/37093299>
Reviewed by Youenn Fablet.
Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
its connected WebProcesses via IPC.
* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::networkStateChanged):
* loader/LoaderStrategy.h:
* page/Navigator.cpp:
(WebCore::Navigator::onLine const):
* page/Page.cpp:
* platform/network/NetworkStateNotifier.h:
* workers/Worker.cpp:
(WebCore::Worker::Worker):
(WebCore::Worker::notifyFinished):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2018-03-27 Daniel Bates <dabates@apple.com>
CSS mask images should be retrieved using potentially CORS-enabled fetch
https://bugs.webkit.org/show_bug.cgi?id=179983
<rdar://problem/35678149>
Reviewed by Brent Fulgham.
As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editors Draft, 23 December 2017)
we should fetch CSS mask images using a potentially CORS-enabled fetch.
Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
closely align with the behavior in the spec.
Test: http/tests/security/css-mask-image.html
* page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
We need this setting to avoid breaking the developer convenience feature that some modern media controls
layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
into the WebKit binary.
* style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
(WebCore::Style::loadPendingImage): Ditto.
(WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
a mask image or shape-outside image.
2018-03-27 Zalan Bujtas <zalan@apple.com>
RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
https://bugs.webkit.org/show_bug.cgi?id=184032
<rdar://problem/38384984>
Reviewed by Antti Koivisto.
We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
undesired and should not be encouraged at all though).
It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
can lead to unexpected result.
Test: fast/multicol/parent-box-when-spanner-is-present.html
* rendering/RenderBox.h:
(WebCore::RenderBox::parentBox const):
(WebCore::RenderBox::firstChildBox const):
(WebCore::RenderBox::lastChildBox const):
(WebCore::RenderBox::previousSiblingBox const):
(WebCore::RenderBox::nextSiblingBox const):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::layout):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::updateLogicalWidth):
2018-03-27 Brent Fulgham <bfulgham@apple.com>
Further refine cookie read/write logging
https://bugs.webkit.org/show_bug.cgi?id=184044
<rdar://problem/38915610>
Reviewed by Chris Dumez.
Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.
* platform/network/NetworkStorageSession.h:
2018-03-27 Antoine Quint <graouts@apple.com>
[Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
https://bugs.webkit.org/show_bug.cgi?id=184038
Reviewed by Dean Jackson.
Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2018-03-27 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Enhance debugging in the BasePlayer
https://bugs.webkit.org/show_bug.cgi?id=184035
Reviewed by Philippe Normand.
No behaviour changes so no test were added/enabled.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
(WebCore::MediaPlayerPrivateGStreamerBase::muted const):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
2018-03-27 Eric Carlson <eric.carlson@apple.com>
Make AVFoundationEnabled preference available on iOS
https://bugs.webkit.org/show_bug.cgi?id=183876
<rdar://problem/38726459>
Reviewed by Youenn Fablet.
Test: AVFoundationPref API test.
* html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
there is already settings.mediaEnabled.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
(WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
* page/RuntimeEnabledFeatures.h:
2018-03-27 Fujii Hironori <Hironori.Fujii@sony.com>
[GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
https://bugs.webkit.org/show_bug.cgi?id=176799
Reviewed by Carlos Garcia Campos.
The length of a surrogate-pair UTF-16 character is 2 even though
the number of characters is 1. An incorrect string length was
passed to enchant_dict_check if the string contains a
surrogate-pair character because the length was calculated by
applying UTF-16 character position to UTF-8 string.
No new tests (Covered by existing tests).
* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
type of an argument `word` from CString to String. Convert a
substring of the argument into UTF-8.
(WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
original UTF-16 string to checkSpellingOfWord instead of a
converted UTF-8 string.
* platform/text/enchant/TextCheckerEnchant.h: Changed the type of
an argument `word` from CString to String.
2018-03-26 Ms2ger <Ms2ger@igalia.com>
Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
https://bugs.webkit.org/show_bug.cgi?id=184007
Reviewed by Žan Doberšek.
No new tests.
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):
2018-03-23 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183819
Reviewed by Dean Jackson.
The current time for a CSS Animation exposed via the API should be clamped between 0 and the animation duration.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsCurrentTime const):
* animation/CSSAnimation.h:
* animation/WebAnimation.h:
2018-03-23 Antoine Quint <graouts@apple.com>
[Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
https://bugs.webkit.org/show_bug.cgi?id=183935
Reviewed by Dean Jackson.
We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.
In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
Transition, the transition-timing-function property set on the element's style serves as the timing function of the
from keyframe.
To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
LinearTimingFunction object.
As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
timing function.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
not be reflected on the effect's timing object.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
value for the "to" keyframe of a CSS Transition.
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
* animation/KeyframeEffectReadOnly.h:
2018-03-26 Chris Dumez <cdumez@apple.com>
Use SecurityOriginData more consistently in Service Worker code
https://bugs.webkit.org/show_bug.cgi?id=183969
Reviewed by Darin Adler.
Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.
I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
in some cases as callers can now use SecurityOrigin::data() instead of
SecurityOriginData::fromSecurityOrigin().
No new tests, no Web-facing behavior change.
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::storageDirectory const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::mediaKeysStorageDirectory const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin const):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/DOMWindow.cpp:
(WebCore:: const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::canAccess const):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::isLocal const):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::toRawString const):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSameSchemeHostPort const):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol const):
(WebCore::SecurityOrigin::host const):
(WebCore::SecurityOrigin::port const):
(WebCore::SecurityOrigin::data const):
(WebCore::SecurityOrigin::isHTTPFamily const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWOriginStore.cpp:
(WebCore::SWOriginStore::add):
(WebCore::SWOriginStore::remove):
(WebCore::SWOriginStore::clear):
* workers/service/server/SWOriginStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::securityOrigin const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::origin const):
(WebCore::SWServerWorker::securityOrigin const):
* workers/service/server/SWServerWorker.h:
2018-03-26 Brent Fulgham <bfulgham@apple.com>
Warn against cookie access in the WebContent process using ProcessPrivilege assertions
https://bugs.webkit.org/show_bug.cgi?id=183911
<rdar://problem/38762306>
Reviewed by Youenn Fablet.
Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
should never call Cookie API directly. That should only happen in the Networking or
UIProcess.
Add a new static flag to NetworkStorageSession that indicates if the current process has
permission to interact with the Cookie API.
No new tests since there is no change in behavior.
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
(WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
the appropriate flag to the ProcessPrivileges data for the current process.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
process is prohibited from interacting with the Cookie API.
(WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
the current process is prohibited from interacting with the Cookie API.
(WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
(WebCore::NetworkStorageSession::ensureSession): Ditto.
(WebCore::NetworkStorageSession::cookieStorage const): Ditto.
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
(WebCore::CookieStorageObserver::startObserving): Ditto.
(WebCore::CookieStorageObserver::stopObserving): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookie):
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::deleteCookie):
(WebCore::nsCookiesToCookieVector):
(WebCore::NetworkStorageSession::getAllCookies):
(WebCore::NetworkStorageSession::getCookies):
(WebCore::NetworkStorageSession::flushCookieStore):
(WebCore::NetworkStorageSession::nsCookieStorage const):
(WebCore::createPrivateStorageSession):
* platform/network/mac/CookieJarMac.mm:
(WebCore::httpCookies):
(WebCore::deleteHTTPCookie):
(WebCore::httpCookiesForURL):
(WebCore::filterCookies):
(WebCore::applyPartitionToCookies):
(WebCore::cookiesInPartitionForURL):
(WebCore::cookiesForSession):
(WebCore::setHTTPCookiesForURL):
(WebCore::deleteAllHTTPCookies):
(WebCore::setCookiesFromDOM):
(WebCore::httpCookieAcceptPolicy):
(WebCore::deleteCookie):
(WebCore::deleteCookiesForHostnames):
(WebCore::deleteAllCookiesModifiedSince):
2018-03-26 Alex Christensen <achristensen@webkit.org>
Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
https://bugs.webkit.org/show_bug.cgi?id=183965
Reviewed by Chris Dumez.
It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
ResourceHandleClient::willCacheResponse was not being called. This makes it so there is one code
path and it executes the logic in ResourceHandleClient::willCacheResponse.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponseAsync):
(WebCore::SubresourceLoader::willCacheResponse): Deleted.
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponseAsync):
(WebCore::ResourceLoader::willCacheResponse): Deleted.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponseAsync):
(WebCore::ResourceHandleClient::shouldCacheResponse):
(WebCore::ResourceHandleClient::willCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.
2018-03-26 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
https://bugs.webkit.org/show_bug.cgi?id=184004
Reviewed by Žan Doberšek.
Do not upload the original buffer. Upload the result of creating a subImage buffer
if it was required.
Covered by existent tests.
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):
2018-03-25 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
https://bugs.webkit.org/show_bug.cgi?id=183985
Reviewed by Michael Catanzaro.
Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
headers and implementation files. Remove dubious whitespace, use #pragma
once, clean up constructors, destructors, method definitions and remove
unnecessary includes in favor of forward declarations where possible.
The TextureMapperPlatformLayer::swapBuffers() method is removed as it
wasn't called or overridden anywhere.
No new tests -- no change in functionality.
* platform/graphics/texmap/TextureMapperBackingStore.cpp:
* platform/graphics/texmap/TextureMapperBackingStore.h:
(WebCore::TextureMapperBackingStore::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperPlatformLayer.h:
(WebCore::TextureMapperPlatformLayer::setClient):
(WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
(WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.
2018-03-25 Dan Bernstein <mitz@apple.com>
[Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
https://bugs.webkit.org/show_bug.cgi?id=183999
Reviewed by Sam Weinig.
* Configurations/WebCore.xcconfig: Removed build settings.
* Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
frameworks search path.
* Configurations/WebKitLegacyStub.iOS.tbd: Removed.
* WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.
2018-03-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229954.
https://bugs.webkit.org/show_bug.cgi?id=184000
Caused many layout tests to crash on Apple High Sierra,
Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
by dydz on #webkit).
Reverted changeset:
"Use SecurityOriginData more consistently in Service Worker
code"
https://bugs.webkit.org/show_bug.cgi?id=183969
https://trac.webkit.org/changeset/229954
2018-03-23 Alex Christensen <achristensen@webkit.org>
Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
https://bugs.webkit.org/show_bug.cgi?id=183966
Reviewed by Chris Dumez.
No change in behavior.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* loader/ResourceLoader.h:
* platform/network/BlobResourceHandle.cpp:
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.
2018-03-24 Chris Dumez <cdumez@apple.com>
Use SecurityOriginData more consistently in Service Worker code
https://bugs.webkit.org/show_bug.cgi?id=183969
Reviewed by Darin Adler.
Use SecurityOriginData more consistently in Service Worker code to avoid constructing
SecurityOrigin objects unnecessarily.
I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
in some cases as callers can now use SecurityOrigin::data() instead of
SecurityOriginData::fromSecurityOrigin().
No new tests, no Web-facing behavior change.
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::storageDirectory const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::mediaKeysStorageDirectory const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::securityOrigin):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin const):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
* page/DOMWindow.cpp:
(WebCore:: const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::canAccess const):
(WebCore::SecurityOrigin::canDisplay const):
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::isLocal const):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::toRawString const):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSameSchemeHostPort const):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::protocol const):
(WebCore::SecurityOrigin::host const):
(WebCore::SecurityOrigin::port const):
(WebCore::SecurityOrigin::data const):
(WebCore::SecurityOrigin::isHTTPFamily const):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::fromFrame):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::fromURL):
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
* workers/service/ServiceWorkerRegistrationKey.h:
* workers/service/server/SWOriginStore.cpp:
(WebCore::SWOriginStore::add):
(WebCore::SWOriginStore::remove):
(WebCore::SWOriginStore::clear):
* workers/service/server/SWOriginStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::securityOrigin const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::origin const):
(WebCore::SWServerWorker::securityOrigin const):
* workers/service/server/SWServerWorker.h:
2018-03-24 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229792.
https://bugs.webkit.org/show_bug.cgi?id=183980
not actually necessary (Requested by thorton on #webkit).
Reverted changeset:
"Fix the build"
https://trac.webkit.org/changeset/229792
2018-03-23 Tim Horton <timothy_horton@apple.com>
Fix the geolocation build
https://bugs.webkit.org/show_bug.cgi?id=183975
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
(WebCore::GeolocationPosition::GeolocationPosition):
2018-03-23 Tim Horton <timothy_horton@apple.com>
Fix the build with no pasteboard
https://bugs.webkit.org/show_bug.cgi?id=183973
Reviewed by Dan Bernstein.
* Configurations/FeatureDefines.xcconfig:
* platform/ios/PlatformPasteboardIOS.mm:
2018-03-23 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Fix some localizable strings after r229878
https://bugs.webkit.org/show_bug.cgi?id=183963
Reviewed by Tim Horton.
The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
use WEB_UI_STRING_KEY instead.
Additionally, remove now-unused localizable strings for the text input view controller.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlDoneButtonTitle):
(WebCore::datePickerDayLabelTitle):
(WebCore::datePickerMonthLabelTitle):
(WebCore::datePickerYearLabelTitle):
2018-03-23 Chris Dumez <cdumez@apple.com>
NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
https://bugs.webkit.org/show_bug.cgi?id=183760
<rdar://problem/37093299>
Reviewed by Ryosuke Niwa.
Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
expects its key parameter to be a regular expression and it can match several
keys. It is also unnecessary in our case since we already have an exact key.
We now call the more efficient SCDynamicStoreCopyValue() instead, which is
the right thing to call when we have an exact key.
This change was suggested by the SC team.
This was tested manually as there is no easy way to write an automated test
for this.
In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
to avoid calling it once per WebProcess.
* platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2018-03-23 Daniel Bates <dabates@apple.com>
Unreviewed, rolling out r229868.
Caused media controls tests to timeout. Will investigate
offline.
Reverted changeset:
"CSS mask images should be retrieved using potentially CORS-
enabled fetch"
https://bugs.webkit.org/show_bug.cgi?id=179983
https://trac.webkit.org/changeset/229868
2018-03-23 Mark Lam <mark.lam@apple.com>
Add pointer profiling hooks to the CSS JIT.
https://bugs.webkit.org/show_bug.cgi?id=183947
<rdar://problem/38803593>
Reviewed by JF Bastien.
No new tests needed. Covered by existing tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
- Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
(WebCore::SelectorDataList::execute const):
2018-03-23 Sihui Liu <sihui_liu@apple.com>
Local storage getItem() for an empty string returned UNDEFINED value.
https://bugs.webkit.org/show_bug.cgi?id=69138
<rdar://problem/13410974>
Reviewed by Brady Eidson.
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnBlobAsString):
2018-03-23 Chris Dumez <cdumez@apple.com>
Promptly terminate service worker processes when they are no longer needed
https://bugs.webkit.org/show_bug.cgi?id=183873
<rdar://problem/38676995>
Reviewed by Youenn Fablet.
The StorageProcess now keeps track of service worker clients for each security
origin. When there is no longer any clients for a given security origin, the
StorageProcess asks the service worker process for the given origin to terminate
and severs its connection to it.
Change is covered by API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
Pass the security origin since this is called when a service worker process
crashes. When a service worker process for origin A crashes, we only want
to mark service workers in origin A as terminated, not ALL of them.
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
Tweak logic so that we only relaunch a service worker process if we still
have clients for its security origin.
* workers/service/server/SWServer.h:
(WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
Add a way to disable the service worker termination delay to facilitate
testing.
* workers/service/server/SWServerToContextConnection.h:
2018-03-23 Brady Eidson <beidson@apple.com>
Go to back/forward list items after a process-swapped navigation.
<rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
Reviewed by Andy Estes.
Covered by new API test.
Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
do a policy check or not.
* WebCore.xcodeproj/project.pbxproj:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
This was a long standing bug that made it difficult to effectively test this change.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::loadItem):
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::setDefersLoading):
(WebCore::HistoryController::recursiveGoToItem):
* loader/HistoryController.h:
* loader/NavigationPolicyCheck.h:
* page/Page.cpp:
(WebCore::Page::goToItem):
* page/Page.h:
2018-03-23 John Wilander <wilander@apple.com>
Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
https://bugs.webkit.org/show_bug.cgi?id=183950
<rdar://problem/38806275>
Reviewed by Brent Fulgham.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
Now isVeryPrevalentResource is decoded to the correct field.
2018-03-23 Youenn Fablet <youenn@apple.com>
WebProcessPool should not ask to register all clients for each service worker process creation
https://bugs.webkit.org/show_bug.cgi?id=183941
Reviewed by Chris Dumez.
Covered by existing unit tests.
Register all Documents of a process no matter its session ID when asked to.
Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
by calling setMayHaveRegisteredServiceWorkers().
This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
will actually register all its future clients.
Add some assertions to ensure that a client is not registered twice.
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registerServiceWorkerClient):
2018-03-23 Eric Carlson <eric.carlson@apple.com>
HTMLElement factory doesn't need to call MediaPlayer::isAvailable
https://bugs.webkit.org/show_bug.cgi?id=183946
<rdar://problem/38802687>
Reviewed by Youenn Fablet.
Test: media/media-disabled.html
* dom/make_names.pl:
(printConstructorInterior):
* page/Settings.yaml:
* page/SettingsDefaultValues.h:
2018-03-23 David Kilzer <ddkilzer@apple.com>
Stop using dispatch_set_target_queue()
<https://webkit.org/b/183908>
<rdar://problem/33553533>
Reviewed by Daniel Bates.
No new tests since no change in behavior.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::globaVideoCaptureSerialQueue): Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().
2018-03-23 Youenn Fablet <youenn@apple.com>
Use libwebrtc ObjectiveC H264 encoder and decoder
https://bugs.webkit.org/show_bug.cgi?id=183912
Reviewed by Eric Carlson.
No observable change of behavior.
Made use of libwebrtc WebKit utilities.
Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
* Configurations/WebCore.xcconfig:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
(WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* testing/Internals.cpp: Removed commented out include.
2018-03-23 Youenn Fablet <youenn@apple.com>
DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
https://bugs.webkit.org/show_bug.cgi?id=183928
Reviewed by Chris Dumez.
Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html
In case mode is include, keep sending credentials even after redirection with preflight.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
2018-03-23 Tim Horton <timothy_horton@apple.com>
Fix the build after r229858
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2018-03-23 Youenn Fablet <youenn@apple.com>
Allow fully whitelisted plug-ins to match non HTTP URLs
https://bugs.webkit.org/show_bug.cgi?id=183938
rdar://problem/38534312
Reviewed by Chris Dumez.
Covered by manual testing and unit testing.
* platform/URL.cpp:
(WebCore::URL::isMatchingDomain const):
2018-03-23 Youenn Fablet <youenn@apple.com>
ActiveDOMObject should assert that they are destroyed in the thread they are created
https://bugs.webkit.org/show_bug.cgi?id=183671
Reviewed by Chris Dumez.
No change of behavior.
Moved MessagePort assertion to ActiveDOMObject.
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::~ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
* dom/MessagePort.h:
2018-03-23 Youenn Fablet <youenn@apple.com>
Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
https://bugs.webkit.org/show_bug.cgi?id=181180
<rdar://problem/36302375>
Reviewed by Eric Carlson.
Test: webrtc/video-update-often.html
AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
We can still ref it on a background thread but we always deref it on the main thread.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2018-03-23 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Fix auto repeat tracks computation with definite min sizes
https://bugs.webkit.org/show_bug.cgi?id=183933
Reviewed by Javier Fernandez.
Indefinitely sized containers use the specified definite min-size (if any) as available
space in order to compute the number of auto repeat tracks to create. A bug in that code was
causing the grid to be one track larger than expected. That was only happening in the case
of the free space being a multiple of the total size of the autorepeat tracks.
Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):
2018-03-23 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Avoid software color conversion inside BitmapTextureGL
https://bugs.webkit.org/show_bug.cgi?id=183892
Reviewed by Žan Doberšek.
Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
conversion during the painting. This way we don't need to swap the R and B components on the CPU.
Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
remove the UpdateContentsFlag as we never need to modify the original image data.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/BitmapTexture.h:
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::BitmapTextureGL):
(WebCore::BitmapTextureGL::didReset):
(WebCore::BitmapTextureGL::updateContents):
(WebCore::BitmapTextureGL::applyFilters):
(WebCore::swizzleBGRAToRGBA): Deleted.
(WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
* platform/graphics/texmap/BitmapTextureGL.h:
(WebCore::BitmapTextureGL::colorConvertFlags const):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::acquireTexture):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::get):
* platform/graphics/texmap/TextureMapperContextAttributes.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawNumber):
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintIntoSurface):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperTile.cpp:
(WebCore::TextureMapperTile::updateContents):
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
(WebCore::TextureMapperTiledBackingStore::updateContents):
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2018-03-23 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Add standard containers with FastAllocator specialization
https://bugs.webkit.org/show_bug.cgi?id=183789
Reviewed by Darin Adler.
* Modules/indexeddb/IDBKeyData.h:
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/webauthn/cbor/CBORValue.h:
It did not use FastAllocator for its container.
* page/WheelEventTestTrigger.h:
* platform/audio/PlatformMediaSessionManager.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* platform/wpe/PlatformPasteboardWPE.cpp:
* rendering/OrderIterator.h:
2018-03-23 Antoine Quint <graouts@apple.com>
[Web Animations] infinite repeat counts aren't reflected for CSS Animations
https://bugs.webkit.org/show_bug.cgi?id=183932
Reviewed by Dean Jackson.
The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2018-03-22 Antoine Quint <graouts@apple.com>
[Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
https://bugs.webkit.org/show_bug.cgi?id=183919
Reviewed by Dean Jackson.
The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
sure we don't create extra RefPtr<> objects.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
element is removed.
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
a pseudo-element is removed.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
for all children elements when an element gets a "display: none" style.
2018-03-23 Antoine Quint <graouts@apple.com>
[Web Animations] Animated transform styles are ignored when calling getComputedStyle()
https://bugs.webkit.org/show_bug.cgi?id=183918
Reviewed by Dean Jackson.
Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
transform is applied for an element. Looking at the RenderStyle is preferable because in the case
of animations running on the compositor, such as a transform-only animation or transition, the
renderer doesn't necessarily have a transform style on it, since we don't blend properties in
software as the animation progresses. Instead, all of the blending is performed by the compositor,
and only the computed style object has the software-blended transform style on it.
We do need to account for inline renderers though as these do not support transforms.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedTransform):
2018-03-22 Antoine Quint <graouts@apple.com>
[Web Animations] Support "transition: all" for CSS Transitions as Web Animations
https://bugs.webkit.org/show_bug.cgi?id=183917
Reviewed by Dean Jackson.
We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
property.
* animation/AnimationTimeline.cpp:
(WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
all backing Animation objects found in the old style that match the conditions enforced by the new method
shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
with a "transition: all" style. If we're dealing with a single property, we only process that single property.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
we can no longer infer it from the backing Animation object.
(WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
since we can no longer infer it from the backing Animation object.
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
for backing Animation objects to determine whether their respective properties match since this would compare the
"property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
which indicates that we don't care about matching the transition property itself.
* animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
CSSTransition to get at the transition property.
* platform/animation/Animation.cpp:
(WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
* platform/animation/Animation.h:
2018-03-22 Tim Horton <timothy_horton@apple.com>
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
https://bugs.webkit.org/show_bug.cgi?id=183930
<rdar://problem/38782249>
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
2018-03-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229876.
https://bugs.webkit.org/show_bug.cgi?id=183929
Some webrtc tests are timing out on iOS simulator (Requested
by youenn on #webkit).
Reverted changeset:
"Use libwebrtc ObjectiveC H264 encoder and decoder"
https://bugs.webkit.org/show_bug.cgi?id=183912
https://trac.webkit.org/changeset/229876
2018-03-22 Megan Gardner <megan_gardner@apple.com>
Expose more system colors via CSS
https://bugs.webkit.org/show_bug.cgi?id=183764
<rdar://problem/36975898>
Reviewed by Tim Horton.
Test: fast/css/apple-system-control-colors.html
Expose Apple specific system colors via CSS.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
2018-03-22 Nan Wang <n_wang@apple.com>
AX: Web table row count is incorrect when role row is added to <tr> in DOM
https://bugs.webkit.org/show_bug.cgi?id=183922
Reviewed by Chris Fleizach.
Although the parent table for an ARIA grid row should be an ARIA table, we
should return the native table if the row is native <tr>.
Test: accessibility/row-with-aria-role-in-native-table.html
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentTable const):
2018-03-22 Chris Dumez <cdumez@apple.com>
Include security origin in the service worker process name
https://bugs.webkit.org/show_bug.cgi?id=183913
Reviewed by Youenn Fablet.
Updated localizable strings.
* English.lproj/Localizable.strings:
2018-03-22 Youenn Fablet <youenn@apple.com>
Use libwebrtc ObjectiveC H264 encoder and decoder
https://bugs.webkit.org/show_bug.cgi?id=183912
Reviewed by Eric Carlson.
No observable change of behavior.
Made use of libwebrtc WebKit utilities.
Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
* Configurations/WebCore.xcconfig:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
(WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* testing/Internals.cpp: Removed commented out include.
2018-03-22 Michael Catanzaro <mcatanzaro@gnome.org>
Unreviewed, fix format string warnings in service worker code
On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2018-03-22 Daniel Bates <dabates@apple.com>
Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
https://bugs.webkit.org/show_bug.cgi?id=183907
<rdar://problem/38759127>
Reviewed by Alex Christensen.
Exports SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() so that we can use it from WebKit.
* platform/SchemeRegistry.h:
2018-03-22 Daniel Bates <dabates@apple.com>
CSS mask images should be retrieved using potentially CORS-enabled fetch
https://bugs.webkit.org/show_bug.cgi?id=179983
<rdar://problem/35678149>
Reviewed by Brent Fulgham.
As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor's Draft, 23 December 2017)
we should fetch CSS mask images using a potentially CORS-enabled fetch.
Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
closely align with the behavior in the spec.
Test: http/tests/security/css-mask-image.html
* style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
(WebCore::Style::loadPendingImage): Ditto.
(WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
a mask image or shape-outside image.
2018-03-22 Zalan Bujtas <zalan@apple.com>
[Simple line layout] Text with letter spacing is not positioned properly.
https://bugs.webkit.org/show_bug.cgi?id=183079
<rdar://problem/38762569>
Reviewed by Antti Koivisto.
We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
since we might not be able to use the fast path anymore.
Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html
* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):
2018-03-21 Antoine Quint <graouts@apple.com>
[Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183845
Reviewed by Dean Jackson.
Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.
* animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
WebAnimation::timeToNextRequiredTick().
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
for previous and current styles are a match.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
playState is set correctly and the animation is not idle.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
been reworked to use the animation's current time, which is based on the timeline's current time.
(WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
style value and the recorded target value differ to determine if new blending keyframes are necessary.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
needs to be scheduled.
* animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
* animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.
2018-03-22 Tim Horton <timothy_horton@apple.com>
Improve readability of WebCore's OTHER_LDFLAGS
https://bugs.webkit.org/show_bug.cgi?id=183909
<rdar://problem/38760992>
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebCore.xcconfig:
2018-03-22 Tim Horton <timothy_horton@apple.com>
Adopt USE(OPENGL[_ES]) in more places
https://bugs.webkit.org/show_bug.cgi?id=183882
<rdar://problem/37912195>
Reviewed by Dan Bernstein.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::hasMuxableGPU):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::texImageIOSurface2D):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]):
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
(-[WebGLLayer display]):
* platform/graphics/ios/GraphicsContext3DIOS.h:
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::blitFramebuffer):
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContext3D::renderbufferStorage):
(WebCore::GraphicsContext3D::getIntegerv):
(WebCore::GraphicsContext3D::texImage2D):
(WebCore::GraphicsContext3D::depthRange):
(WebCore::GraphicsContext3D::clearDepth):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
Make it a bit more clear which code is platform-dependent and which code is GL/GLES-dependent.
2018-03-22 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Make TextureMapperContextAttributes thread-specific
https://bugs.webkit.org/show_bug.cgi?id=183895
Reviewed by Carlos Garcia Campos.
Store the TextureMapperContextAttributes in a thread-specific manner.
The TextureMapperContextAttributes::get() method is now used to retrieve
a reference to that thread-specific object. If it's not been initialized
yet, then the current GL context is used for the initialization, as it
used to be done in the now-removed initialize() method.
TextureMapperPlatformLayerBuffer::clone() method now doesn't need to
be passed a TextureMapperGL object, since the texture can be created
directly by calling BitmapTextureGL::create(), passing the
TextureMapperContextAttributes object that's retrieved from the
thread-specific storage. This further simplifies the
TextureMapperPlatformLayerProxy::Compositor interface, removing the
texmapGL() getter from it.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::threadSpecificAttributes):
(WebCore::TextureMapperContextAttributes::get):
(WebCore::TextureMapperContextAttributes::initialize): Deleted.
* platform/graphics/texmap/TextureMapperContextAttributes.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::TextureMapperGL):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::clone):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2018-03-22 Zalan Bujtas <zalan@apple.com>
SVG root is skipped while marking percentage height descendants dirty.
https://bugs.webkit.org/show_bug.cgi?id=183877
Reviewed by Antti Koivisto.
Calling continingBlock() to get to the correct container works as long as the ancestor inline element
renderers are wrapped in anonymous blocks (continuation for example).
While the SVG root renderer is an inline renderer, it is not wrapped or normalized in any way,
so containingBlock() will elegantly skip it and return an SVG root ancestor.
dirtyForLayoutFromPercentageHeightDescendants calls containingBlock() to walk up
on the ancestor chain to mark elements dirty. This fails when there's an SVG subtree in the block chain.
This patch marks the SVG subtree chain dirty to ensure that layout will get to all the dirty leaf renderers
(note that the SVG subtree is supposed to have only statically positioned elements so parent == containing block).
Covered by existing tests.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
2018-03-22 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled
https://bugs.webkit.org/show_bug.cgi?id=183896
Reviewed by Yusuke Suzuki.
No new tests needed.
* bindings/js/JSWebAnimationCustom.cpp: Add missing #include of Document.h
2018-03-21 Chris Dumez <cdumez@apple.com>
Regression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
https://bugs.webkit.org/show_bug.cgi?id=183886
Reviewed by Wenson Hsieh.
Since r229828, the FrameLoader needs to call FrameLoaderClient::didDecidePolicyForNavigationAction()
whenever a navigation policy decision is made. I added such a call r229828 to
FrameLoader::continueLoadAfterNavigationPolicy() but forgot to add one to
FrameLoader::continueFragmentScrollAfterNavigationPolicy(), which is the equivalent
for fragment navigations.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2018-03-21 Said Abou-Hallawa <sabouhallawa@apple.com>
Disconnect the SVGPathSegList items from their SVGPathElement before rebuilding a new list
https://bugs.webkit.org/show_bug.cgi?id=183723
<rdar://problem/38517871>
Reviewed by Daniel Bates.
When setting the "d" attribute directly on a path, we rebuild the list
of path segments held for creating the property tear off. The old path
segments need to get disconnected from the path element. We already do
that when a path segment is replaced or removed.
Test: svg/dom/reuse-pathseg-after-changing-d.html
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
* svg/SVGPathSegList.cpp:
(WebCore::SVGPathSegList::clear): SVGPathSegListValues::clearContextAndRoles()
will now be called from SVGPathSegListValues::clear() via SVGListProperty::clearValues().
(WebCore::SVGPathSegList::replaceItem):
(WebCore::SVGPathSegList::removeItem):
(WebCore::SVGPathSegList::clearContextAndRoles): Deleted.
* svg/SVGPathSegList.h: SVGPathSegListValues::clearContextAndRoles() will
now be called from SVGPathSegListValues::clear() via SVGListProperty::initializeValues().
* svg/SVGPathSegListValues.cpp:
(WebCore::SVGPathSegListValues::clearItemContextAndRole):
(WebCore::SVGPathSegListValues::clearContextAndRoles):
* svg/SVGPathSegListValues.h:
(WebCore::SVGPathSegListValues::operator=):
(WebCore::SVGPathSegListValues::clear):
2018-03-21 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure animationcancel and transitioncancel events are dispatched
https://bugs.webkit.org/show_bug.cgi?id=183864
Reviewed by Dean Jackson.
In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
animationcancel and transitioncancel events.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
"display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
for all animations that previously existed but are no longer listed in the current style.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
outright, for all transitions that previously existed but are no longer listed in the current style.
(WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
* animation/AnimationTimeline.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
such that an animationcancel or transitioncancel event can be dispatched.
(WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
code has run.
(WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.h:
2018-03-21 Chris Dumez <cdumez@apple.com>
ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
https://bugs.webkit.org/show_bug.cgi?id=183787
Reviewed by Wenson Hsieh.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoaderClient.h:
2018-03-21 Eric Carlson <eric.carlson@apple.com>
Clean up platform VideoFullscreenLayerManager
https://bugs.webkit.org/show_bug.cgi?id=183859
<rdar://problem/38715419>
Reviewed by Jer Noble.
No new tests, no functional change.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/VideoFullscreenLayerManager.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
(WebCore::VideoFullscreenLayerManager::~VideoFullscreenLayerManager):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
(WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenFrame):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm.
(-[WebVideoContainerLayer setBounds:]):
(-[WebVideoContainerLayer setPosition:]):
(WebCore::VideoFullscreenLayerManagerObjC::VideoFullscreenLayerManagerObjC):
(WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame):
(WebCore::VideoFullscreenLayerManagerObjC::didDestroyVideoLayer):
(WebCore::VideoFullscreenLayerManagerObjC::requiresTextTrackRepresentation const):
(WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds):
(WebCore::VideoFullscreenLayerManagerObjC::setTextTrackRepresentation):
2018-03-21 Antoine Quint <graouts@apple.com>
[Web Animations] Dispatch DOM events for CSS Transitions and CSS Animations implemented as Web Animations
https://bugs.webkit.org/show_bug.cgi?id=183781
Reviewed by Dean Jackson.
Now that we've implemented CSS Animations and CSS Transitions as Web Animations (webkit.org/b/183504) we can dispatch DOM events
for targets of DeclarativeAnimation objects. To do that, we add a new invalidateDOMEvents() method on DeclarativeAnimations which
is called when the timer scheduled after the timing model has been invalidated fires in DocumentTimeline::performInvalidationTask().
When we check for DOM events to dispatch, we look at the last recorded phase and iteration and determine whether the state of the
animation has changed. We use a GenericEventQueue to enqueue the events such that they are dispatched asynchronously at a moment
when it is safe to evaluate script.
* animation/AnimationEffectReadOnly.h: Make currentIteration() public since we now need it in DeclarativeAnimation::invalidateDOMEvents().
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::create): Pass the animation target to the constructor instead of its document.
(WebCore::CSSAnimation::CSSAnimation): Pass the animation target to the superclass instead of its document.
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Pass the animation target to the constructor instead of its document.
(WebCore::CSSTransition::CSSTransition): Pass the animation target to the superclass instead of its document.
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::DeclarativeAnimation): Expect an Element instead of a Document and use that element as the target of the
GenericEventQueue that we initialize. We also register this element as our m_target.
(WebCore::DeclarativeAnimation::~DeclarativeAnimation): Close the GenericEventQueue member upon destruction.
(WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
playState is set correctly and the animation is not idle.
(WebCore::DeclarativeAnimation::phaseWithoutEffect const): Because we may need to get an animation's current phase in invalidateDOMEvents()
after an animation's effect has been removed, we provide an alternate way to compute the phase just by looking at the animation's current time.
(WebCore::DeclarativeAnimation::invalidateDOMEvents): Based on the previous and current pending state, iteration and phase, we enqueue animation
and transition DOM events as specified by the CSS Animations Level 2 and CSS Transitions Level 2 specifications.
(WebCore::DeclarativeAnimation::enqueueDOMEvent): Enqueue an event on the GenericEventQueue based on the animation type.
* animation/DeclarativeAnimation.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::performInvalidationTask): We call invalidateDOMEvents() on all declarative animations registered with this timeline
now that the timing model has been invalidated.
* dom/EventNames.h: Add the names of newly-implemented events (animationcancel, transitioncancel, transitionrun and transitionstart).
* dom/GlobalEventHandlers.idl: Add new attribute-based event handlers for the newly-implemented events.
* html/HTMLAttributeNames.in: Add new attribute-based event handlers for the newly-implemented events.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap): Add new attribute-based event handlers for the newly-implemented events.
2018-03-21 Per Arne Vollan <pvollan@apple.com>
Compile error when not using IOSurface canvas backing store.
https://bugs.webkit.org/show_bug.cgi?id=183855
Reviewed by Brent Fulgham.
The method IOSurface::createFromImageBuffer is only referenced when IOSurface
is used as canvas backing store.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
2018-03-21 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Track dirty rects that need update in CoordinatedGraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=175376
Reviewed by Carlos Garcia Campos.
Follow the GraphicsLayerCA class and track rectangles in need of display
in a Vector object. In case the whole layer needs updating, it's marked
separately, and further rects are ignored.
During layer flush, all the rects are used to invalidate the backing
store, or a single layer-sized rect is used in case the whole layer has
to be updated. We can also bail early from updateContentBuffers() if
there are no dirty rects recorded and there's no pending visible rect
adjustment.
At the end of updateContentBuffers() we now test for an existing
previous backing store before inquiring the backing store if the visible
area is already covered, enabling deletion of this backing store.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2018-03-21 Carlos Alberto Lopez Perez <clopez@igalia.com>
[WPE] Build failure with ENABLE_VIDEO=OFF when GStreamer is not available
https://bugs.webkit.org/show_bug.cgi?id=183811
Reviewed by Philippe Normand.
Add build guards for USE_GSTREAMER.
No new tests, it is a build fix.
* platform/graphics/gstreamer/GStreamerUtilities.h:
2018-03-21 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Draw Cairo patterns with cairo_paint_with_alpha()
https://bugs.webkit.org/show_bug.cgi?id=183774
Reviewed by Carlos Garcia Campos.
In the drawPatternToCairoContext() helper in CairoOperations.cpp source
file, always clip the painting region to the specified rectangle and
then use cairo_paint_with_alpha() to paint the passed-in pattern object,
not relaying rasterization to cairo_fill() when using opaque alpha. We
still clamp the alpha value to the 0.0 - 1.0 range.
No new tests -- no change in behavior.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawPatternToCairoContext):
2018-03-21 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
https://bugs.webkit.org/show_bug.cgi?id=183771
Reviewed by Carlos Garcia Campos.
TextureMapperLayer::applyAnimationsRecursively() should return true when
the TextureMapperLayer tree has currently-running animations that
require continuous scene update.
TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
member that's set to true if any of the applied animations are still in
playing state. That information is then returned in syncAnimations(),
and the result is accumulated in the top applyAnimationsRecursively()
call and returned there to the caller.
No new tests -- no change in behavior.
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::applyAnimationsRecursively):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/TextureMapperLayer.h:
2018-03-21 Zan Dobersek <zdobersek@igalia.com>
Use-after-move in SWContextManager::terminateWorker() with Linux x86_64 calling convention
https://bugs.webkit.org/show_bug.cgi?id=183783
Reviewed by Chris Dumez.
In SWContextManager::terminateWorker(), some calling conventions can
end up moving the ServiceWorkerThreadProxy RefPtr into the lambda struct
before that proxy's thread (on which the lambda is bound to execute) is
retrieved.
Avoid this by taking a reference to the thread in a separate earlier
expression, before the RefPtr is moved into the lambda in the following
one.
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
2018-03-21 Timothy Horton <timothy_horton@apple.com>
Fix the build
* platform/network/cf/FormDataStreamCFNet.cpp:
2018-03-20 Tim Horton <timothy_horton@apple.com>
Introduce HAVE_MEDIA_PLAYER and HAVE_CORE_VIDEO
https://bugs.webkit.org/show_bug.cgi?id=183803
<rdar://problem/38690487>
Reviewed by Sam Weinig.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
(-[WebMediaSessionHelper initWithCallback:]):
(-[WebMediaSessionHelper dealloc]):
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData const):
* platform/graphics/cv/PixelBufferConformerCV.cpp:
* platform/graphics/cv/PixelBufferConformerCV.h:
* platform/graphics/cv/TextureCacheCV.h:
* platform/graphics/cv/TextureCacheCV.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
* platform/graphics/cv/VideoTextureCopierCV.h:
Make it possible to disable our dependency on MediaPlayer and CoreVideo.
2018-03-20 Tim Horton <timothy_horton@apple.com>
Enable the minimal simulator feature flag when appropriate
https://bugs.webkit.org/show_bug.cgi?id=183807
Reviewed by Dan Bernstein.
* Configurations/FeatureDefines.xcconfig:
2018-03-19 Ryosuke Niwa <rniwa@webkit.org>
Expose content attributes on _WKLinkIconParameters
https://bugs.webkit.org/show_bug.cgi?id=183768
Reviewed by Alex Christensen.
Collect a vector of content attributes upon finding touch and fav-icons in order to expose it in a WebKit API.
Tests: IconLoading.DefaultFavicon
* html/LinkIconCollector.cpp:
(WebCore::LinkIconCollector::iconsOfTypes): Collect attributes.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading): Use an empty vector for /favicon.ico.
* platform/LinkIcon.h:
(WebCore::LinkIcon::encode const): Encode the vector of content attributes.
(WebCore::LinkIcon::decode): Ditto for decoding.
2018-03-20 Zalan Bujtas <zalan@apple.com>
RenderTreeNeedsLayoutChecker fails with absolutely positioned svg and <use>
https://bugs.webkit.org/show_bug.cgi?id=183718
Reviewed by Antti Koivisto.
This patch ensures after resolving the style for an SVG element with a corresponding element (<use>),
we adjust this style for the cloned SVG element too.
Test: svg/in-html/path-with-absolute-positioned-svg-and-use-crash.html
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustSVGElementStyle):
(WebCore::StyleResolver::adjustRenderStyle):
* css/StyleResolver.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::resolveCustomStyle):
2018-03-20 Brady Eidson <beidson@apple.com>
First piece of process swapping on navigation.
https://bugs.webkit.org/show_bug.cgi?id=183665
Reviewed by Andy Estes.
Covered by API test(s)
This patch:
- A new PolicyAction::Suspend for future use in this feature
- Makes sure that loads triggered as part of a process swap do *not* re-consult the policy delegate
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy):
(WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h: Add a new Policy type "Suspend" to be used in the future
by the process-swap-on-navigation mechanism.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
2018-03-20 Chris Dumez <cdumez@apple.com>
QuickLook.NavigationDelegate API test is failing on iOS with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183791
Reviewed by Alex Christensen.
Update PreviewLoader to not send data (or call finishFinishLoading) until
the resource response has been processed.
* loader/ios/PreviewLoader.mm:
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
(-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
(-[WebPreviewLoader connectionDidFinishLoading:]):
2018-03-20 Antoine Quint <graouts@apple.com>
[Web Animations] Update the timing model when pending tasks schedule changes
https://bugs.webkit.org/show_bug.cgi?id=183785
Reviewed by Dean Jackson.
Changing the time at which a pending play or pause task is scheduled changes the pending
state of the animation and thus should notify that the timing model has changed and invalidate
the effect.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeToRunPendingPlayTask):
(WebCore::WebAnimation::setTimeToRunPendingPauseTask):
(WebCore::WebAnimation::updatePendingTasks):
2018-03-20 Tim Horton <timothy_horton@apple.com>
Add and adopt WK_PLATFORM_NAME and adjust default feature defines
https://bugs.webkit.org/show_bug.cgi?id=183758
<rdar://problem/38017644>
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2018-03-19 Tim Horton <timothy_horton@apple.com>
Apply some SDK checks in LocalDefaultSystemAppearance
https://bugs.webkit.org/show_bug.cgi?id=183767
<rdar://problem/38649611>
Reviewed by Zalan Bujtas.
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2018-03-19 Chris Dumez <cdumez@apple.com>
Have one service worker process per security origin
https://bugs.webkit.org/show_bug.cgi?id=183600
<rdar://problem/35280128>
Reviewed by Brady Eidson.
Split service workers from different origins into their own processes
for security reasons.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::runServiceWorkerIfNecessary):
(WebCore::SWServer::markAllWorkersAsTerminated):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::origin):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::SWServerWorker::securityOrigin const):
(WebCore::SWServerWorker::contextConnection):
* workers/service/server/SWServerWorker.h:
2018-03-19 Megan Gardner <megan_gardner@apple.com>
Have select element respect current appearance
https://bugs.webkit.org/show_bug.cgi?id=183753
Reviewed by Tim Horton.
Not currently testable, will add tests in a later patch.
Have the menu lists/select elements follow the system colors.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustMenuListStyle const):
2018-03-19 Nan Wang <n_wang@apple.com>
AX: embedded attachments do not work correctly with text marker APIs on macOS
https://bugs.webkit.org/show_bug.cgi?id=183751
Reviewed by Chris Fleizach.
In WebKit1, embedded attachments are not working well with text marker APIs.
We should use the corresponding attachment view in the following cases:
1. Hit testing on an attachment object.
2. Getting the attachment object at a text marker position.
3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute.
Not able to construct a layout test because it relies on embedded attachments.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetElement):
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2018-03-19 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, another quick fix for r229699
Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
* Configurations/FeatureDefines.xcconfig:
2018-03-19 Daniel Bates <dabates@apple.com>
Fix case of Strong Password localized string
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::autoFillStrongPasswordLabel):
2018-03-19 Chris Dumez <cdumez@apple.com>
WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183702
<rdar://problem/38566060>
Reviewed by Alex Christensen.
The issue is that the test calls loadHTMLString then loadRequest right after, without
waiting for the first load to complete first. loadHTMLString is special as it relies
on substitute data and which schedules a timer to commit the data. When doing the
navigation policy check for the following loadRequest(), the substitute data timer
would fire and commit its data and load. This would in turn cancel the pending
navigation policy check for the loadRequest().
With sync policy delegates, this is not an issue because we take care of stopping
all loaders when receiving the policy decision, which happens synchronously. However,
when the policy decision happens asynchronously, the pending substitute data load
does not get cancelled in time and it gets committed.
To address the issue, we now cancel any pending provisional load before doing the
navigation policy check.
Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
* loader/FrameLoader.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Cancel any pending provisional load before starting the navigation policy check. This call
needs to be here rather than in the call site of policyChecker().checkNavigationPolicy()
because there is code in PolicyChecker::checkNavigationPolicy() which relies on
FrameLoader::activeDocumentLoader().
Also, we only cancel the provisional load if there is a policy document loader. In some
rare cases (when we receive a redirect after navigation policy has been decided for the
initial request), the provisional document loader needs to receive navigation policy
decisions so we cannot clear the provisional document loader in such case.
2018-03-19 Eric Carlson <eric.carlson@apple.com>
[Extra zoom mode] Require fullscreen for video playback
https://bugs.webkit.org/show_bug.cgi?id=183742
<rdar://problem/38235862>
Reviewed by Jer Noble.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): Always show the play button.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
(WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case
playback is pending.
* html/HTMLMediaElement.h:
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::presentingViewController): New.
(WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
behavior.
(WebAVPlayerLayerView_playerLayer):
(WebAVPlayerLayerView_videoView):
(allocWebAVPlayerLayerViewInstance):
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
(-[WebAVPlayerViewController isPictureInPicturePossible]):
(-[WebAVPlayerViewController isPictureInPictureActive]):
(-[WebAVPlayerViewController isPictureInPictureSuspended]):
(-[WebAVPlayerViewController pictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
(-[WebAVPlayerViewController view]):
(-[WebAVPlayerViewController showsPlaybackControls]):
(-[WebAVPlayerViewController setShowsPlaybackControls:]):
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
(-[WebAVPlayerViewController setDelegate:]):
(-[WebAVPlayerViewController setPlayerController:]):
(-[WebAVPlayerViewController avPlayerViewController]):
(-[WebAVPlayerViewController removeFromParentViewController]):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(fallbackViewController):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(WebCore::supportsPictureInPicture):
2018-03-19 Per Arne Vollan <pvollan@apple.com>
When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
https://bugs.webkit.org/show_bug.cgi?id=183604
<rdar://problem/38305109>
Reviewed by Brent Fulgham.
The call to CVDisplayLinkCreateWithCGDisplay can instead be made in the UIProcess. Notify the WebContent process
about display updates by sending a message from the UIProcess on each screen update. This patch adds an extra
IPC step when notifying the WebContent process about display updates. However, the MotionMark benchmark shows no
performance regression when running it with this patch. A possible explanation for this is that the high priority
display link thread is now running in the UIProcess instead of the WebContent process, which means there will be
more available CPU resources for the WebContent process. A run loop observer is added to make sure that only one
display callback (for each display observer) is executed in a single iteration of the run loop. This will make
sure we are not filling the IPC message queue with unhandled display link messages.
No new tests, covered by existing tests.
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::displayLinkFired):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/DisplayRefreshMonitorManager.h:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
2018-03-19 Megan Gardner <megan_gardner@apple.com>
Ensure local appearance actually mirrors the app's appearance
https://bugs.webkit.org/show_bug.cgi?id=183743
Reviewed by Tim Horton.
Not currently testable, will add tests in a later patch.
Current appearance isn't always accurate by default and needs to be set manually.
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2018-03-19 Zan Dobersek <zdobersek@igalia.com>
Unreviewed GCC 4.9 build-fix after r229672.
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::createCommand): Don't depend on implicit conversion of the
returning std::unique_ptr<> object, and instead only wrap the
heap-allocated PaintingOperation-derived in a std::unique_ptr<> at the
point of return.
2018-03-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229689.
https://bugs.webkit.org/show_bug.cgi?id=183735
Causes fast/loader/inner-iframe-loads-data-url-into-parent-on-
unload-crash.html to fail with async delegates (Requested by
cdumez_ on #webkit).
Reverted changeset:
"WebKit.WebsitePoliciesAutoplayQuirks API test times out with
async policy delegates"
https://bugs.webkit.org/show_bug.cgi?id=183702
https://trac.webkit.org/changeset/229689
2018-03-17 Tim Horton <timothy_horton@apple.com>
Correct redefined fnfErr type
https://bugs.webkit.org/show_bug.cgi?id=183728
<rdar://problem/38590063>
Reviewed by Dan Bernstein.
* platform/network/cf/FormDataStreamCFNet.cpp:
CFStreamError's error parameter takes a SInt32, not an int.
Make sure our redefinition has a compatible type.
2018-03-17 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement authenticatorMakeCredential
https://bugs.webkit.org/show_bug.cgi?id=183527
<rdar://problem/35275886>
Reviewed by Brent Fulgham.
This patch does the following few things:
1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.
Here is a detailed explanantion of 1):
1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
support.
2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
LocalAuthentication API are provided to override the behavoir of LAContext.
4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
it can only be covered by manual tests at this moment.
5. Back to LocalAuthenticator, it currently has two public methods:
5.1. makeCredential(): This method is the one does all the magic.
+ It first checks some parameters.
+ It then invokes LAContext to get user consent.
+ It then talks to Apple Attestation Privacy CA to do attestations.
+ It then stores necessary information into the Keychain.
+ Finally it generates the attestation object.
5.2 isAvailable():
To check if a LocalAuthenticator is available or not.
6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
6.1 Use CF type only if it is requested by APIs.
6.2 Use NS type to manipulate all Objc objects.
6.3 Use C++ otherwise.
Covered by API tests.
* Configurations/WebCore.xcconfig:
* Modules/credentialmanagement/CredentialsMessenger.cpp:
(WebCore::getIdFromAttestationObject): Deleted.
Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
at the same time. Therefore, this method is removed.
* Modules/credentialmanagement/CredentialsMessenger.h:
(WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
(WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
* Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
(WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
(WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
(WebCore::PublicKeyCredentialDescriptor::encode const):
(WebCore::PublicKeyCredentialDescriptor::decode):
* Modules/webauthn/PublicKeyCredentialType.h:
* Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
* Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
(WebCore::LocalAuthenticatorInternal::freePtrs):
(WebCore::LocalAuthenticator::makeCredential const):
(WebCore::LocalAuthenticator::isAvailable const):
(WebCore::LocalAuthenticator::issueClientCertificate const):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
* platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
* testing/MockCredentialsMessenger.cpp:
(WebCore::MockCredentialsMessenger::setCreationReturnBundle):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::makeCredentialReply):
(WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
* testing/MockCredentialsMessenger.h:
* testing/MockCredentialsMessenger.idl:
2018-03-16 Brent Fulgham <bfulgham@apple.com>
Correct debug assertion in Range::borderAndTextRects
https://bugs.webkit.org/show_bug.cgi?id=183710
<rdar://problem/38466976>
Reviewed by Ryosuke Niwa.
A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.
We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.
Tests: fast/dom/range/range-selection-empty-body.html
* dom/Range.cpp:
(WebCore::Range::borderAndTextRects const):
2018-03-15 Filip Pizlo <fpizlo@apple.com>
Put the DOM in IsoHeaps
https://bugs.webkit.org/show_bug.cgi?id=183546
Reviewed by Daniel Bates.
No new tests because no change in behavior.
This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
that DOM UAFs cannot be used for universal read gadgets.
This looks neutral on Speedometer and membuster, though I did have one round of testing
that led me to believe that membuster was regressed - I just wasn't able to reproduce that
result on subsequent testing.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Attr.cpp:
* dom/Attr.h:
* dom/CDATASection.cpp:
* dom/CDATASection.h:
* dom/CharacterData.cpp:
* dom/CharacterData.h:
* dom/Comment.cpp:
* dom/Comment.h:
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/DocumentFragment.cpp:
* dom/DocumentFragment.h:
* dom/DocumentType.cpp:
* dom/DocumentType.h:
* dom/Node.cpp:
* dom/Node.h:
* dom/ProcessingInstruction.cpp:
* dom/ProcessingInstruction.h:
* dom/PseudoElement.cpp:
* dom/PseudoElement.h:
* dom/ShadowRoot.cpp:
* dom/ShadowRoot.h:
* dom/StyledElement.cpp:
* dom/StyledElement.h:
* dom/TemplateContentDocumentFragment.cpp: Added.
* dom/TemplateContentDocumentFragment.h:
* dom/Text.cpp:
* dom/Text.h:
* dom/XMLDocument.cpp: Added.
* dom/XMLDocument.h:
* html/FTPDirectoryDocument.cpp:
* html/FTPDirectoryDocument.h:
* html/FileInputType.cpp:
* html/HTMLAnchorElement.cpp:
* html/HTMLAnchorElement.h:
* html/HTMLAppletElement.cpp:
* html/HTMLAppletElement.h:
* html/HTMLAreaElement.cpp:
* html/HTMLAreaElement.h:
* html/HTMLAttachmentElement.cpp:
* html/HTMLAttachmentElement.h:
* html/HTMLBDIElement.cpp: Added.
* html/HTMLBDIElement.h:
* html/HTMLBRElement.cpp:
* html/HTMLBRElement.h:
* html/HTMLBaseElement.cpp:
* html/HTMLBaseElement.h:
* html/HTMLBodyElement.cpp:
* html/HTMLBodyElement.h:
* html/HTMLButtonElement.cpp:
* html/HTMLButtonElement.h:
* html/HTMLCanvasElement.cpp:
* html/HTMLCanvasElement.h:
* html/HTMLDListElement.cpp:
* html/HTMLDListElement.h:
* html/HTMLDataElement.cpp:
* html/HTMLDataElement.h:
* html/HTMLDataListElement.cpp:
* html/HTMLDataListElement.h:
* html/HTMLDetailsElement.cpp:
* html/HTMLDetailsElement.h:
* html/HTMLDirectoryElement.cpp:
* html/HTMLDirectoryElement.h:
* html/HTMLDivElement.cpp:
* html/HTMLDivElement.h:
* html/HTMLDocument.cpp:
* html/HTMLDocument.h:
* html/HTMLElement.cpp:
* html/HTMLElement.h:
* html/HTMLEmbedElement.cpp:
* html/HTMLEmbedElement.h:
* html/HTMLFieldSetElement.cpp:
* html/HTMLFieldSetElement.h:
* html/HTMLFontElement.cpp:
* html/HTMLFontElement.h:
* html/HTMLFormControlElement.cpp:
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
* html/HTMLFormElement.h:
* html/HTMLFrameElement.cpp:
* html/HTMLFrameElement.h:
* html/HTMLFrameElementBase.cpp:
* html/HTMLFrameElementBase.h:
* html/HTMLFrameOwnerElement.cpp:
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
* html/HTMLFrameSetElement.h:
* html/HTMLHRElement.cpp:
* html/HTMLHRElement.h:
* html/HTMLHeadElement.cpp:
* html/HTMLHeadElement.h:
* html/HTMLHeadingElement.cpp:
* html/HTMLHeadingElement.h:
* html/HTMLHtmlElement.cpp:
* html/HTMLHtmlElement.h:
* html/HTMLIFrameElement.cpp:
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
* html/HTMLInputElement.h:
* html/HTMLKeygenElement.cpp:
* html/HTMLKeygenElement.h:
* html/HTMLLIElement.cpp:
* html/HTMLLIElement.h:
* html/HTMLLabelElement.cpp:
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.cpp:
* html/HTMLLegendElement.h:
* html/HTMLLinkElement.cpp:
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
* html/HTMLMapElement.h:
* html/HTMLMarqueeElement.cpp:
* html/HTMLMarqueeElement.h:
* html/HTMLMenuElement.cpp:
* html/HTMLMenuElement.h:
* html/HTMLMenuItemElement.cpp:
* html/HTMLMenuItemElement.h:
* html/HTMLMetaElement.cpp:
* html/HTMLMetaElement.h:
* html/HTMLMeterElement.cpp:
* html/HTMLMeterElement.h:
* html/HTMLModElement.cpp:
* html/HTMLModElement.h:
* html/HTMLOListElement.cpp:
* html/HTMLOListElement.h:
* html/HTMLObjectElement.cpp:
* html/HTMLObjectElement.h:
* html/HTMLOptGroupElement.cpp:
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.cpp:
* html/HTMLOptionElement.h:
* html/HTMLOutputElement.cpp:
* html/HTMLOutputElement.h:
* html/HTMLParagraphElement.cpp:
* html/HTMLParagraphElement.h:
* html/HTMLParamElement.cpp:
* html/HTMLParamElement.h:
* html/HTMLPictureElement.cpp:
* html/HTMLPictureElement.h:
* html/HTMLPlugInElement.cpp:
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
* html/HTMLPlugInImageElement.h:
* html/HTMLPreElement.cpp:
* html/HTMLPreElement.h:
* html/HTMLProgressElement.cpp:
* html/HTMLProgressElement.h:
* html/HTMLQuoteElement.cpp:
* html/HTMLQuoteElement.h:
* html/HTMLScriptElement.cpp:
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
* html/HTMLSlotElement.cpp:
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
* html/HTMLSourceElement.h:
* html/HTMLSpanElement.cpp:
* html/HTMLSpanElement.h:
* html/HTMLStyleElement.cpp:
* html/HTMLStyleElement.h:
* html/HTMLSummaryElement.cpp:
* html/HTMLSummaryElement.h:
* html/HTMLTableCaptionElement.cpp:
* html/HTMLTableCaptionElement.h:
* html/HTMLTableCellElement.cpp:
* html/HTMLTableCellElement.h:
* html/HTMLTableColElement.cpp:
* html/HTMLTableColElement.h:
* html/HTMLTableElement.cpp:
* html/HTMLTableElement.h:
* html/HTMLTablePartElement.cpp:
* html/HTMLTablePartElement.h:
* html/HTMLTableRowElement.cpp:
* html/HTMLTableRowElement.h:
* html/HTMLTableSectionElement.cpp:
* html/HTMLTableSectionElement.h:
* html/HTMLTemplateElement.cpp:
* html/HTMLTemplateElement.h:
* html/HTMLTextAreaElement.cpp:
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
* html/HTMLTextFormControlElement.h:
* html/HTMLTimeElement.cpp:
* html/HTMLTimeElement.h:
* html/HTMLTitleElement.cpp:
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
* html/HTMLTrackElement.h:
* html/HTMLUListElement.cpp:
* html/HTMLUListElement.h:
* html/HTMLUnknownElement.cpp: Added.
* html/HTMLUnknownElement.h:
* html/HTMLWBRElement.cpp:
* html/HTMLWBRElement.h:
* html/ImageDocument.cpp:
* html/ImageDocument.h:
* html/LabelableElement.cpp:
* html/LabelableElement.h:
* html/MediaController.cpp:
(MediaController::create): Deleted.
(MediaController::MediaController): Deleted.
(MediaController::addMediaElement): Deleted.
(MediaController::removeMediaElement): Deleted.
(MediaController::containsMediaElement const): Deleted.
(MediaController::buffered const): Deleted.
(MediaController::seekable const): Deleted.
(MediaController::played): Deleted.
(MediaController::duration const): Deleted.
(MediaController::currentTime const): Deleted.
(MediaController::setCurrentTime): Deleted.
(MediaController::unpause): Deleted.
(MediaController::play): Deleted.
(MediaController::pause): Deleted.
(MediaController::setDefaultPlaybackRate): Deleted.
(MediaController::playbackRate const): Deleted.
(MediaController::setPlaybackRate): Deleted.
(MediaController::setVolume): Deleted.
(MediaController::setMuted): Deleted.
(playbackStateWaiting): Deleted.
(playbackStatePlaying): Deleted.
(playbackStateEnded): Deleted.
(MediaController::playbackState const): Deleted.
(MediaController::reportControllerState): Deleted.
(eventNameForReadyState): Deleted.
(MediaController::updateReadyState): Deleted.
(MediaController::updatePlaybackState): Deleted.
(MediaController::updateMediaElements): Deleted.
(MediaController::bringElementUpToSpeed): Deleted.
(MediaController::isBlocked const): Deleted.
(MediaController::hasEnded const): Deleted.
(MediaController::scheduleEvent): Deleted.
(MediaController::asyncEventTimerFired): Deleted.
(MediaController::clearPositionTimerFired): Deleted.
(MediaController::hasAudio const): Deleted.
(MediaController::hasVideo const): Deleted.
(MediaController::hasClosedCaptions const): Deleted.
(MediaController::setClosedCaptionsVisible): Deleted.
(MediaController::supportsScanning const): Deleted.
(MediaController::beginScrubbing): Deleted.
(MediaController::endScrubbing): Deleted.
(MediaController::beginScanning): Deleted.
(MediaController::endScanning): Deleted.
(MediaController::canPlay const): Deleted.
(MediaController::isLiveStream const): Deleted.
(MediaController::hasCurrentSrc const): Deleted.
(MediaController::returnToRealtime): Deleted.
(MediaController::startTimeupdateTimer): Deleted.
(MediaController::scheduleTimeupdateEvent): Deleted.
* html/MediaDocument.cpp:
* html/MediaDocument.h:
* html/PluginDocument.cpp:
* html/PluginDocument.h:
* html/RubyElement.cpp:
* html/RubyElement.h:
* html/RubyTextElement.cpp:
* html/RubyTextElement.h:
* html/TextDocument.cpp:
* html/TextDocument.h:
* html/shadow/AutoFillButtonElement.cpp:
* html/shadow/AutoFillButtonElement.h:
* html/shadow/DetailsMarkerControl.cpp:
* html/shadow/DetailsMarkerControl.h:
* html/shadow/ImageControlsRootElement.cpp:
* html/shadow/ImageControlsRootElement.h:
* html/shadow/MediaControlElementTypes.cpp:
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControls.cpp:
* html/shadow/MediaControls.h:
* html/shadow/ProgressShadowElement.cpp:
* html/shadow/ProgressShadowElement.h:
* html/shadow/SliderThumbElement.cpp:
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
* html/shadow/SpinButtonElement.h:
* html/shadow/TextControlInnerElements.cpp:
* html/shadow/TextControlInnerElements.h:
* html/shadow/YouTubeEmbedShadowElement.cpp:
* html/shadow/YouTubeEmbedShadowElement.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
* html/shadow/mac/ImageControlsButtonElementMac.h:
* html/shadow/mac/ImageControlsRootElementMac.cpp:
* html/shadow/mac/ImageControlsRootElementMac.h:
* html/track/TextTrackCueGeneric.cpp:
* html/track/VTTCue.cpp:
* html/track/VTTCue.h:
* html/track/WebVTTElement.cpp:
* html/track/WebVTTElement.h:
* loader/SinkDocument.cpp:
* loader/SinkDocument.h:
* mathml/MathMLAnnotationElement.cpp:
* mathml/MathMLAnnotationElement.h:
* mathml/MathMLElement.cpp:
* mathml/MathMLElement.h:
* mathml/MathMLFractionElement.cpp:
* mathml/MathMLFractionElement.h:
* mathml/MathMLMathElement.cpp:
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.cpp:
* mathml/MathMLMencloseElement.h:
* mathml/MathMLOperatorElement.cpp:
* mathml/MathMLOperatorElement.h:
* mathml/MathMLPaddedElement.cpp:
* mathml/MathMLPaddedElement.h:
* mathml/MathMLPresentationElement.cpp:
* mathml/MathMLPresentationElement.h:
* mathml/MathMLRootElement.cpp:
* mathml/MathMLRootElement.h:
* mathml/MathMLRowElement.cpp:
* mathml/MathMLRowElement.h:
* mathml/MathMLScriptsElement.cpp:
* mathml/MathMLScriptsElement.h:
* mathml/MathMLSelectElement.cpp:
* mathml/MathMLSelectElement.h:
* mathml/MathMLSpaceElement.cpp:
* mathml/MathMLSpaceElement.h:
* mathml/MathMLTokenElement.cpp:
* mathml/MathMLTokenElement.h:
* mathml/MathMLUnderOverElement.cpp:
* mathml/MathMLUnderOverElement.h:
* mathml/MathMLUnknownElement.cpp: Added.
* mathml/MathMLUnknownElement.h:
* svg/SVGAElement.cpp:
* svg/SVGAElement.h:
* svg/SVGAltGlyphDefElement.cpp:
* svg/SVGAltGlyphDefElement.h:
* svg/SVGAltGlyphElement.cpp:
* svg/SVGAltGlyphElement.h:
* svg/SVGAltGlyphItemElement.cpp:
* svg/SVGAltGlyphItemElement.h:
* svg/SVGAnimateColorElement.cpp:
* svg/SVGAnimateColorElement.h:
* svg/SVGAnimateElement.cpp:
* svg/SVGAnimateElement.h:
* svg/SVGAnimateElementBase.cpp:
* svg/SVGAnimateElementBase.h:
* svg/SVGAnimateMotionElement.cpp:
* svg/SVGAnimateMotionElement.h:
* svg/SVGAnimateTransformElement.cpp:
* svg/SVGAnimateTransformElement.h:
* svg/SVGAnimationElement.cpp:
* svg/SVGAnimationElement.h:
* svg/SVGCircleElement.cpp:
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.cpp:
* svg/SVGClipPathElement.h:
* svg/SVGComponentTransferFunctionElement.cpp:
* svg/SVGComponentTransferFunctionElement.h:
* svg/SVGCursorElement.cpp:
* svg/SVGCursorElement.h:
* svg/SVGDefsElement.cpp:
* svg/SVGDefsElement.h:
* svg/SVGDescElement.cpp:
* svg/SVGDescElement.h:
* svg/SVGDocument.cpp:
* svg/SVGDocument.h:
* svg/SVGElement.cpp:
* svg/SVGElement.h:
* svg/SVGEllipseElement.cpp:
* svg/SVGEllipseElement.h:
* svg/SVGFEBlendElement.cpp:
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.cpp:
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.cpp:
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.cpp:
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.cpp:
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEFloodElement.cpp:
* svg/SVGFEFloodElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.cpp:
* svg/SVGFEImageElement.h:
* svg/SVGFELightElement.cpp:
* svg/SVGFELightElement.h:
* svg/SVGFEMergeElement.cpp:
* svg/SVGFEMergeElement.h:
* svg/SVGFEMergeNodeElement.cpp:
* svg/SVGFEMergeNodeElement.h:
* svg/SVGFEMorphologyElement.cpp:
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.cpp:
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.cpp:
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.cpp:
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.cpp:
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGFontFaceElement.cpp:
* svg/SVGFontFaceElement.h:
* svg/SVGFontFaceFormatElement.cpp:
* svg/SVGFontFaceFormatElement.h:
* svg/SVGFontFaceNameElement.cpp:
* svg/SVGFontFaceNameElement.h:
* svg/SVGFontFaceSrcElement.cpp:
* svg/SVGFontFaceSrcElement.h:
* svg/SVGFontFaceUriElement.cpp:
* svg/SVGFontFaceUriElement.h:
* svg/SVGForeignObjectElement.cpp:
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.cpp:
* svg/SVGGElement.h:
* svg/SVGGlyphElement.cpp:
* svg/SVGGlyphElement.h:
* svg/SVGGlyphRefElement.cpp:
* svg/SVGGlyphRefElement.h:
* svg/SVGGradientElement.cpp:
* svg/SVGGradientElement.h:
* svg/SVGGraphicsElement.cpp:
* svg/SVGGraphicsElement.h:
* svg/SVGHKernElement.cpp:
* svg/SVGHKernElement.h:
* svg/SVGImageElement.cpp:
* svg/SVGImageElement.h:
* svg/SVGLineElement.cpp:
* svg/SVGLineElement.h:
* svg/SVGLinearGradientElement.cpp:
* svg/SVGLinearGradientElement.h:
* svg/SVGMPathElement.cpp:
* svg/SVGMPathElement.h:
* svg/SVGMarkerElement.cpp:
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
* svg/SVGMaskElement.h:
* svg/SVGMetadataElement.cpp:
* svg/SVGMetadataElement.h:
* svg/SVGMissingGlyphElement.cpp:
* svg/SVGMissingGlyphElement.h:
* svg/SVGPathElement.cpp:
* svg/SVGPathElement.h:
* svg/SVGPatternElement.cpp:
* svg/SVGPatternElement.h:
* svg/SVGPolyElement.cpp:
* svg/SVGPolyElement.h:
* svg/SVGPolygonElement.cpp:
* svg/SVGPolygonElement.h:
* svg/SVGPolylineElement.cpp:
* svg/SVGPolylineElement.h:
* svg/SVGRadialGradientElement.cpp:
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.cpp:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp:
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.cpp:
* svg/SVGScriptElement.h:
* svg/SVGSetElement.cpp:
* svg/SVGSetElement.h:
* svg/SVGStopElement.cpp:
* svg/SVGStopElement.h:
* svg/SVGStyleElement.cpp:
* svg/SVGStyleElement.h:
* svg/SVGSwitchElement.cpp:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.cpp:
* svg/SVGSymbolElement.h:
* svg/SVGTRefElement.cpp:
* svg/SVGTRefElement.h:
* svg/SVGTSpanElement.cpp:
* svg/SVGTSpanElement.h:
* svg/SVGTextContentElement.cpp:
* svg/SVGTextContentElement.h:
* svg/SVGTextElement.cpp:
* svg/SVGTextElement.h:
* svg/SVGTextPathElement.cpp:
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.cpp:
* svg/SVGTextPositioningElement.h:
* svg/SVGTitleElement.cpp:
* svg/SVGTitleElement.h:
* svg/SVGUnknownElement.cpp: Added.
* svg/SVGUnknownElement.h:
* svg/SVGUseElement.cpp:
* svg/SVGUseElement.h:
* svg/SVGVKernElement.cpp:
* svg/SVGVKernElement.h:
* svg/SVGViewElement.cpp:
* svg/SVGViewElement.h:
* svg/animation/SVGSMILElement.cpp:
* svg/animation/SVGSMILElement.h:
2018-03-16 Youenn Fablet <youenn@apple.com>
Ensure Document::responseReceived and clearResource are called on the main thread
https://bugs.webkit.org/show_bug.cgi?id=183709
Reviewed by Chris Dumez.
No change of behavior.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::clearMainResource):
2018-03-16 Chris Dumez <cdumez@apple.com>
WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183702
Reviewed by Alex Christensen.
The issue is that the test calls loadHTMLString then loadRequest right after, without
waiting for the first load to complete first. loadHTMLString is special as it relies
on substitute data and which schedules a timer to commit the data. When doing the
navigation policy check for the following loadRequest(), the substitute data timer
would fire and commit its data and load. This would in turn cancel the pending
navigation policy check for the loadRequest().
With sync policy delegates, this is not an issue because we take care of stopping
all loaders when receiving the policy decision, which happens synchronously. However,
when the policy decision happens asynchronously, the pending substitute data load
does not get cancelled in time and it gets committed.
To address the issue, this patch updates loadWithDocumentLoader() to cancel any
provisional load when there is an asynchronous navigation policy decision pending.
Change covered by new API test.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
2018-03-16 Brent Fulgham <bfulgham@apple.com>
Set a trap to catch an infrequent form-related nullptr crash
https://bugs.webkit.org/show_bug.cgi?id=183704
<rdar://problem/37579354>
Reviewed by Ryosuke Niwa.
Make FormState a FrameDestructionObserver. We expect all relevant FormState objects to have been
cleaned up prior to the frame being destroyed. If we find such a case, we'd like to see the
stack trace to see what's going on.
* loader/FormState.cpp:
(WebCore::FormState::FormState):
(WebCore::FormState::willDetachPage): RELEASE_ASSERT_NOT_REACHED if we ever get here.
* loader/FormState.h:
2018-03-16 Joanmarie Diggs <jdiggs@igalia.com>
AX: AccessibilityNodeObject::textForLabelElement() doesn't follow AccName calculation rules
https://bugs.webkit.org/show_bug.cgi?id=183661
Reviewed by Chris Fleizach.
Have AccessibilityNodeObject::textForLabelElement() return the value from
accessibleNameForNode() instead of innerText(). The former falls back on
the latter if there is no author-provided accessible name.
Tests: accessibility/aria-label-on-label-element.html
accessibility/label-with-pseudo-elements.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::titleElementText const):
2018-03-16 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix crash on websocket with bad handshake message.
https://bugs.webkit.org/show_bug.cgi?id=183686
Reviewed by Youenn Fablet.
The closing cleanup was called multiple times. Add flag to detect
it is already closed or not.
No new tests because it is covered by existing test:
- LayoutTests/http/tests/websocket/tests/hybi/bad-handshake-crash.html
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::didReceiveData):
2018-03-16 Jer Noble <jer.noble@apple.com>
Make Fullscreen API an Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=183662
Reviewed by Jon Lee.
The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
Experimental Feature is disabled.
* dom/Document.idl:
* dom/Element.idl:
2018-03-16 Megan Gardner <megan_gardner@apple.com>
Ensure that style is updated when the effective appearance changes
https://bugs.webkit.org/show_bug.cgi?id=183690
<rdar://problem/38385900>
Reviewed by Tim Horton and Wenson Hsieh.
Only exposing a function to outside WebCore, no tests needed.
* page/Page.h:
2018-03-16 Chris Dumez <cdumez@apple.com>
WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183679
Reviewed by Alex Christensen.
Update CachedRawResource::didAddClient() to not send data until we've received
the policy decision for the response.
No new tests, covered by new API test.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::responseReceived):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::responseReceived):
* loader/DocumentThreadableLoader.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
* loader/MediaResourceLoader.h:
* loader/appcache/ApplicationCacheResourceLoader.cpp:
(WebCore::ApplicationCacheResourceLoader::responseReceived):
* loader/appcache/ApplicationCacheResourceLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::responseReceived):
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::responseReceived):
* loader/cache/KeepaliveRequestTracker.cpp:
(WebCore::KeepaliveRequestTracker::responseReceived):
* loader/cache/KeepaliveRequestTracker.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):
2018-03-16 Youenn Fablet <youenn@apple.com>
Name Service Worker threads differently from regular Worker threads
https://bugs.webkit.org/show_bug.cgi?id=183698
Reviewed by Chris Dumez.
No observable change of behavior.
For debugging purposes, knowing that a thread is a service worker thread might help give context.
It might also identify on a crash log whether the process is a service worker process or a regular web process.
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::start):
* workers/WorkerThread.h:
(WebCore::WorkerThread::isServiceWorkerThread const):
* workers/service/context/ServiceWorkerThread.h:
2018-03-16 Youenn Fablet <youenn@apple.com>
IceCandidates leak on webrtc/datachannel/basic.html and other tests
https://bugs.webkit.org/show_bug.cgi?id=183676
<rdar://problem/36116228>
Reviewed by Eric Carlson.
Covered by manual testing using --leaks option on WK1.
WebKit should not release the candidates since libwebrtc is not taking ownership.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
2018-03-16 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Add Cairo-specific GraphicsContext operation recorder
https://bugs.webkit.org/show_bug.cgi?id=183593
Reviewed by Carlos Garcia Campos.
Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
that records all GraphicsContext operations for deferred replay on a
different thread. Recording here mostly consists of storing all the
Cairo resources in a thread-safe manner, which is eased by the atomic
reference counting used in Cairo.
Nicosia::PaintingOperation derivatives are used for operations or state
updates that require recording. Instances of these classes are appended
to a Vector<> object that is then pushed into a thread pool in
Nicosia::PaintingEngineThreaded , replaying all the operations against
the Cairo context established from an associated target Nicosia::Buffer.
This GraphicsContextImpl implementation is now used in the
PaintingContextCairo::ForRecording constructor to construct the
GraphicsContext implementation that will be used for recording.
* platform/TextureMapper.cmake:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
(Nicosia::getContext):
(Nicosia::OperationData::arg const const):
(Nicosia::createCommand):
(Nicosia::CairoOperationRecorder::CairoOperationRecorder):
(Nicosia::m_commandList):
(Nicosia::CairoOperationRecorder::updateState):
(Nicosia::CairoOperationRecorder::clearShadow):
(Nicosia::CairoOperationRecorder::setLineCap):
(Nicosia::CairoOperationRecorder::setLineDash):
(Nicosia::CairoOperationRecorder::setLineJoin):
(Nicosia::CairoOperationRecorder::setMiterLimit):
(Nicosia::CairoOperationRecorder::fillRect):
(Nicosia::CairoOperationRecorder::fillRoundedRect):
(Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
(Nicosia::CairoOperationRecorder::fillPath):
(Nicosia::CairoOperationRecorder::fillEllipse):
(Nicosia::CairoOperationRecorder::strokeRect):
(Nicosia::CairoOperationRecorder::strokePath):
(Nicosia::CairoOperationRecorder::strokeEllipse):
(Nicosia::CairoOperationRecorder::clearRect):
(Nicosia::CairoOperationRecorder::drawGlyphs):
(Nicosia::CairoOperationRecorder::drawImage):
(Nicosia::CairoOperationRecorder::drawTiledImage):
(Nicosia::CairoOperationRecorder::drawNativeImage):
(Nicosia::CairoOperationRecorder::drawPattern):
(Nicosia::CairoOperationRecorder::drawRect):
(Nicosia::CairoOperationRecorder::drawLine):
(Nicosia::CairoOperationRecorder::drawLinesForText):
(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
(Nicosia::CairoOperationRecorder::drawEllipse):
(Nicosia::CairoOperationRecorder::drawPath):
(Nicosia::CairoOperationRecorder::drawFocusRing):
(Nicosia::CairoOperationRecorder::save):
(Nicosia::CairoOperationRecorder::restore):
(Nicosia::CairoOperationRecorder::translate):
(Nicosia::CairoOperationRecorder::rotate):
(Nicosia::CairoOperationRecorder::scale):
(Nicosia::CairoOperationRecorder::concatCTM):
(Nicosia::CairoOperationRecorder::setCTM):
(Nicosia::CairoOperationRecorder::getCTM):
(Nicosia::CairoOperationRecorder::beginTransparencyLayer):
(Nicosia::CairoOperationRecorder::endTransparencyLayer):
(Nicosia::CairoOperationRecorder::clip):
(Nicosia::CairoOperationRecorder::clipOut):
(Nicosia::CairoOperationRecorder::clipPath):
(Nicosia::CairoOperationRecorder::clipBounds):
(Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
(Nicosia::CairoOperationRecorder::roundToDevicePixels):
(Nicosia::CairoOperationRecorder::append):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::ForRecording::ForRecording):
2018-03-16 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Clean up TextureMapperLayer constructor
https://bugs.webkit.org/show_bug.cgi?id=183634
Reviewed by Michael Catanzaro.
In the TextureMapperLayer header, only declare the constructor, and move
all the previous member initialization to the point of declaration of
these member variables.
In the TextureMapperLayer implementation file, the constructor and
destructor are moved into proper order at the top of the file. The
former is defaulted, and the latter remains unchanged.
No change in behavior.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::~TextureMapperLayer):
* platform/graphics/texmap/TextureMapperLayer.h:
2018-03-16 Miguel Gomez <magomez@igalia.com>
[GTK] When using EGL, request an OpenGL core profile when possible
https://bugs.webkit.org/show_bug.cgi?id=178719
Reviewed by Carlos Garcia Campos.
When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
context with version >= 3.2 then use whatever EGL gives us.
Covered by existent tests.
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createPbufferContext):
(WebCore::GLContextEGL::createSurfacelessContext):
(WebCore::GLContextEGL::createContextForEGLVersion):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContextEGL::createWaylandContext):
* platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContextEGL::createPixmapContext):
2018-03-16 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
https://bugs.webkit.org/show_bug.cgi?id=183656
Reviewed by Carlos Garcia Campos.
Don't have the TextureMapperLayer class inherit from the
TextureMapperAnimation::Client interface just for the purposes of
synchronization of animation-affected attributes in syncAnimations().
For that purpose it's enough to provide a struct that is passed to that
method, and with the TextureMapperAnimation class filling out any of the
animated attributes that need to be updated.
TextureMapperAnimation::ApplicationResult struct is introducted for that
purpose. std::optional<> members in it are assigned values during the
application process, if an appropriate animation affects them. The
relevant member values in TextureMapperLayer are then updated, or value
from the default state is used.
TextureMapperAnimation::Client is removed.
No new tests -- no change in behavior.
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::applyInternal):
(WebCore::TextureMapperAnimations::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::syncAnimations):
(WebCore::TextureMapperLayer::setAnimatedTransform): Deleted.
(WebCore::TextureMapperLayer::setAnimatedOpacity): Deleted.
(WebCore::TextureMapperLayer::setAnimatedFilters): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
2018-03-16 Devin Rousso <webkit@devinrousso.com>
Web Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
https://bugs.webkit.org/show_bug.cgi?id=178798
<rdar://problem/35175740>
Reviewed by Brian Burg.
When the main frame navigates, the DOMAgent would recieve two InspectorInstrumentation calls,
one when the frame begins its navigation and the other when the document for that frame has
loaded. Both of these would discard the DOMAgent's bindings, which included the map of
`nodeId`s. This was an issue for canvases, as the frontend would be notified whenever any
canvas is created, which would usually occur before the `DOMContentLoaded` event is fired.
As a result, the canvases would attempt to retrieve their associated node, only to have the
DOMAgent discard those bindings quickly thereafter.
This patch removes DOMAgent's and DOMDebuggerAgent's (parity) instrumentation hooks for the
latter event, ensuring that the bindings are only discarded once.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::mainFrameDOMContentLoaded): Deleted.
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Added.
(WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2018-03-15 Tim Horton <timothy_horton@apple.com>
Include CADisplayLink explicitly where needed, instead of all of CA
https://bugs.webkit.org/show_bug.cgi?id=183689
<rdar://problem/38528719>
Reviewed by Wenson Hsieh.
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2018-03-15 Tim Horton <timothy_horton@apple.com>
Include MobileCoreServices in the WebCore prefix header
https://bugs.webkit.org/show_bug.cgi?id=183688
<rdar://problem/38527621>
Reviewed by Dan Bernstein.
* WebCorePrefix.h:
2018-03-15 Megan Gardner <megan_gardner@apple.com>
Create MediaQueryParserContext to provide additional context for the evaluation of media queries
https://bugs.webkit.org/show_bug.cgi?id=183677
Reviewed by Tim Horton.
We need additional context for parsing media queries to make sure they are parsed correctly and valid.
Not currently testable, will add tests in a later patch.
* WebCore.xcodeproj/project.pbxproj:
* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
(WebCore::MediaQuerySet::set):
(WebCore::MediaQuerySet::add):
(WebCore::MediaQuerySet::remove):
* css/MediaList.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::mediaAttributeMatches):
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::featureWithValidDensity):
(WebCore::featureWithValidPositiveLength):
(WebCore::featureWithPositiveInteger):
(WebCore::featureWithPositiveNumber):
(WebCore::featureWithZeroOrOne):
(WebCore::isFeatureValidWithoutValue):
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/MediaQueryExpression.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::matchMedia):
* css/MediaQueryParserContext.cpp: Added.
(WebCore::MediaQueryParserContext::MediaQueryParserContext):
* css/MediaQueryParserContext.h: Added.
(WebCore::MediaQueryParserContext::MediaQueryParserContext):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium const):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::StyleRuleImport):
(WebCore::StyleRuleImport::setCSSStyleSheet):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeImportRule):
(WebCore::CSSParserImpl::consumeMediaRule):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::parseMediaQuerySet):
(WebCore::MediaQueryParser::parseMediaCondition):
(WebCore::MediaQueryParser::MediaQueryParser):
(WebCore::MediaQueryData::addExpression):
* css/parser/MediaQueryParser.h:
(WebCore::MediaQueryData::setMediaQueryParserContext):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::parse):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::setCSSStyleSheet):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* html/HTMLLinkElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parsedMediaAttribute const):
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2018-03-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229639.
https://bugs.webkit.org/show_bug.cgi?id=183683
it is causing a crash in API tests (Requested by youenn on
#webkit).
Reverted changeset:
"ActiveDOMObject should assert that they are destroyed in the
thread they are created"
https://bugs.webkit.org/show_bug.cgi?id=183671
https://trac.webkit.org/changeset/229639
2018-03-15 Youenn Fablet <youenn@apple.com>
Bad configuration parameters should make RTCPeerConnection constructor throw
https://bugs.webkit.org/show_bug.cgi?id=183615
Reviewed by Eric Carlson.
Implement more of https://w3c.github.io/webrtc-pc/#set-pc-configuration.
Throw an error whenever underlying libwebrtc set configuration fails.
Covered by rebased test.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2018-03-15 Youenn Fablet <youenn@apple.com>
replaceTrack triggers negotiationneeded
https://bugs.webkit.org/show_bug.cgi?id=180342
<rdar://problem/35822426>
Reviewed by Eric Carlson.
Covered by updated test.
Fix the case of replacing a track for which data is already flowing.
We should probably do the same for null tracks when fully implementing transceivers.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
2018-03-15 Keith Rollin <krollin@apple.com>
Telemetry for stalled webpage loads
https://bugs.webkit.org/show_bug.cgi?id=183221
<rdar://problem/36549013>
Reviewed by Chris Dumez.
Add telemetry for page loads, tracking the pages that succeed, fail,
or are canceled. This information will be used to track the overall
health of our page loading as time goes on.
No new tests -- no new/changed user-level functionality.
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
(WebCore::DiagnosticLoggingKeys::timedOutKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::occurredKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
* page/DiagnosticLoggingKeys.h:
* platform/network/cf/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::getNSURLErrorDomain const):
(WebCore::ResourceError::getCFErrorDomainCFNetwork const):
(WebCore::ResourceError::mapPlatformError):
2018-03-15 Youenn Fablet <youenn@apple.com>
ActiveDOMObject should assert that they are destroyed in the thread they are created
https://bugs.webkit.org/show_bug.cgi?id=183671
Reviewed by Chris Dumez.
No change of behavior.
Moved MessagePort assertion to ActiveDOMObject.
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::~ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
* dom/MessagePort.h:
2018-03-15 Youenn Fablet <youenn@apple.com>
MessagePort is not always destroyed on the right thread
https://bugs.webkit.org/show_bug.cgi?id=183619
<rdar://problem/38204711>
Reviewed by Chris Dumez.
Add assertion to ensure MessagePort is destroyed in the right thread.
Modify methods taking a ref in a lambda to rely on weak pointers and refing the WorkerThread if in a worker context.
It is safe to ref the WorkerThread since it is thread safe ref counted and we are passing the ref to the main thread
where the WorkerThread is expected to be destroyed.
Test: http/tests/workers/worker-messageport-2.html
* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::updateActivity):
(WebCore::MessagePort::hasPendingActivity const):
* dom/MessagePort.h:
2018-03-15 Jer Noble <jer.noble@apple.com>
Adopt new AVURLAssetUseClientURLLoadingExclusively AVURLAsset creation option.
https://bugs.webkit.org/show_bug.cgi?id=183660
Reviewed by Jon Lee.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2018-03-15 Chris Dumez <cdumez@apple.com>
Unreviewed, fix tiny mistake in r229615 that caused API tests failures.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
2018-03-15 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Remove TextureMapperLayer::texture()
https://bugs.webkit.org/show_bug.cgi?id=183635
Reviewed by Michael Catanzaro.
Remove the unused TextureMapperLayer::texture() method. This enables
removing the virtual TextureMapperBackingStore::texture() method, as
well as the implementations of it in TextureMapperTiledBackingStore and
CoordinatedBackingStore classes.
No change in behavior.
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::texture const): Deleted.
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2018-03-15 Zan Dobersek <zdobersek@igalia.com>
[TexMap] Don't bother caching pattern transform matrix
https://bugs.webkit.org/show_bug.cgi?id=183633
Reviewed by Michael Catanzaro.
Remove the m_patternTransform and m_patternTransformDirty member
variables from the TextureMapperLayer class. These unnecessarily
complicate the state update methods that need to compare the given
attribute against the current state, and only update it if it has
changed.
Instead, compute the pattern TransformationMatrix value on-the-fly in
the paintSelf() method, if at all necessary.
No change in functionality.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::setContentsRect):
(WebCore::TextureMapperLayer::setContentsTileSize):
(WebCore::TextureMapperLayer::setContentsTilePhase):
(WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
2018-03-14 John Wilander <wilander@apple.com>
Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
https://bugs.webkit.org/show_bug.cgi?id=183641
<rdar://problem/38469497>
Reviewed by Brent Fulgham and Chris Dumez.
No new tests. This change is to stabilize existing layout tests.
See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::removeAllStorageAccess):
New function to clear out all storage access entries.
2018-03-14 Youenn Fablet <youenn@apple.com>
imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=183602
Reviewed by Chris Dumez.
Introduce a map of ScriptExecutionContext that is read/write protected using a Lock.
This allows introducing postTaskTo taking a ScriptExecutionContext identifier and callable from any thread.
Use that method in Crypto instead of refing/unrefing the context.
Lock only happens if context does some postTask activity. This is governed by calling or not the new contextIdentifier() getter.
Covered by crypto tests no longer failing m_workerGlobalScope->hasOneRef() assertion.
* crypto/CryptoAlgorithm.cpp:
(WebCore::dispatchAlgorithmOperation):
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest):
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest):
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest):
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest):
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* dom/Document.cpp:
(WebCore::Document::~Document):
* dom/ScriptExecutionContext.cpp:
(WebCore::allScriptExecutionContextsMapLock):
(WebCore::ScriptExecutionContext::ScriptExecutionContext):
(WebCore::ScriptExecutionContext::removeFromContextsMap):
(WebCore::ScriptExecutionContext::checkConsistency const):
(WebCore::ScriptExecutionContext::postTaskTo):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::contextIdentifier const):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):
2018-03-14 Chris Dumez <cdumez@apple.com>
Reduce use of SWServerToContextConnection::globalServerToContextConnection()
https://bugs.webkit.org/show_bug.cgi?id=183626
Reviewed by Youenn Fablet.
Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving towards
having multiple context connections.
No new tests, no expected behavior change.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::matchAll):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::runServiceWorkerIfNecessary):
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::markAllWorkersAsTerminated):
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::fireInstallEvent):
(WebCore::SWServer::fireActivateEvent):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::findClientByIdentifier):
(WebCore::SWServerToContextConnection::matchAll):
(WebCore::SWServerToContextConnection::claim):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextConnection):
(WebCore::SWServerWorker::matchAll):
* workers/service/server/SWServerWorker.h:
2018-03-14 Youenn Fablet <youenn@apple.com>
MessagePort should remove its listeners when being closed
https://bugs.webkit.org/show_bug.cgi?id=183644
Reviewed by Chris Dumez.
Test: http/tests/workers/worker-messageport.html
* dom/MessagePort.cpp:
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
2018-03-14 Chris Dumez <cdumez@apple.com>
Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
https://bugs.webkit.org/show_bug.cgi?id=183624
Reviewed by Youenn Fablet.
Pass in context connection to SWServer::serverToContextConnectionCreated() to avoid
relying on the deprecated globalServerToContextConnection().
No new tests, no expected behavior change.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:
2018-03-14 Mark Lam <mark.lam@apple.com>
Enhance the MacroAssembler and LinkBuffer to support pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=183623
<rdar://problem/38443314>
Reviewed by Michael Saboff.
No new tests. Just adding PtrTags required by new MacroAssembler API.
* cssjit/FunctionCall.h:
(WebCore::FunctionCall::prepareAndCall):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2018-03-14 Chris Fleizach <cfleizach@apple.com>
AX: Implement accessible dismiss action on iOS
https://bugs.webkit.org/show_bug.cgi?id=183352
<rdar://problem/38161500>
Reviewed by Zalan Bujtas.
Test: accessibility/ios-simulator/AOM-dismiss-event.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformEscape]):
2018-03-14 Youenn Fablet <youenn@apple.com>
Update libwebrtc up to 36af4e9614f707f733eb2340fae66d6325aaac5b
https://bugs.webkit.org/show_bug.cgi?id=183481
Reviewed by Eric Carlson.
Covered by existing tests.
Updated libwebrtc binding code.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillEncodingParameters):
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
2018-03-14 Tim Horton <timothy_horton@apple.com>
Fix the build after r229567
* Configurations/FeatureDefines.xcconfig:
2018-03-13 John Wilander <wilander@apple.com>
Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
https://bugs.webkit.org/show_bug.cgi?id=183620
<rdar://problem/38431469>
Reviewed by Brent Fulgham.
Tests: http/tests/storageAccess/deny-storage-access-under-opener.html
http/tests/storageAccess/grant-storage-access-under-opener.html
It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
wasn't enough to address the compatibility issues with popups. Some of
them just detect their unpartitioned cookies, auto-dismiss themselves,
and expect their unpartitioned cookies to be available under the opener
afterwards. We should grant them access if the popup's domain has had
user interaction _previously_.
Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
because if the popup's domain has not received user interaction
previously, we will not grant it storage access on just the window open.
* dom/Document.cpp:
(WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
(WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
(WebCore::Document::hasGrantedPageSpecificStorageAccess): Deleted.
(WebCore::Document::setHasGrantedPageSpecificStorageAccess): Deleted.
Renamed from *Granted* to *Requested* since there is now a case
where access will not be granted, i.e. when the popup domain has
not had user interaction previously.
* dom/Document.h:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
Renamed *Grant* to *Request*.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::logWindowCreation):
New function called from DOMWindow::createWindow().
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
New convenience function.
(WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback): Deleted.
Renamed *Grant* to *Request*.
* loader/ResourceLoadObserver.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
Now calls ResourceLoadObserver::logWindowCreation() if a window
was created and the opener has a document and a page ID.
2018-03-13 Chris Dumez <cdumez@apple.com>
fast/loader/javascript-url-iframe-remove-on-navigate.html is a flaky crash on iOS with async delegates
https://bugs.webkit.org/show_bug.cgi?id=183610
Reviewed by Youenn Fablet.
The issue was that in DocumentLoader::loadMainResource(), the call to requestMainResource() which
return null due to the load getting cancelled synchronously. If this load is the parent frame's last
pending load, then the 'load' event gets fired in the parent frame. In the test, the parent frame's
load event handler does a document.write() call which blows away the iframe. As a result, when
we return from the requestMainResource(), m_frame is null and we crash later on dereferencing it.
No new tests, covered by fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html
which was crashing flakily.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
2018-03-13 Jer Noble <jer.noble@apple.com>
[iOS] Muted media playback can interrupt out-of-process audio
https://bugs.webkit.org/show_bug.cgi?id=183606
<rdar://problem/37466253>
Reviewed by Eric Carlson.
Test: Updated TestWebKitAPI test to verify the correct AVAudioSession category is set.
A non-playing, non-muted media element will cause the AVAudioSession category to be set to
"playing" when a muted media element begins playback. Ignore these non-playing elements for
the purposes of determining the AVAudioSession category.
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):
2018-03-13 Youenn Fablet <youenn@apple.com>
Calling removeTrack with RTCRtpSender does not set SenderTrack to null
https://bugs.webkit.org/show_bug.cgi?id=183308
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::stop): Set track to null when being stopped i.e. removed.
* Modules/mediastream/RTCRtpSender.h:
2018-03-13 Youenn Fablet <youenn@apple.com>
Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
https://bugs.webkit.org/show_bug.cgi?id=183601
<rdar://problem/38309441>
Reviewed by Antti Koivisto.
Test: http/wpt/preload/change-link-rel-attribute.html
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::allClientsRemoved): In case of preload,
cancel the load if not finished when there is no more client attached to it.
* loader/cache/CachedResource.h:
2018-03-12 John Wilander <wilander@apple.com>
Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
https://bugs.webkit.org/show_bug.cgi?id=183577
<rdar://problem/38266987>
Reviewed by Brent Fulgham.
Tested manually on live websites.
No new automated tests because of a bug in WebKitTestRunner:
https://bugs.webkit.org/show_bug.cgi?id=183578
The event sender triggers gestures in the opener rather than
in the popup.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
(WebCore::Document::hasGrantedPageSpecificStorageAccess):
(WebCore::Document::setHasGrantedPageSpecificStorageAccess):
* dom/Document.h:
Added member m_primaryDomainsGrantedPageSpecificStorageAccess
where we store domains that have been granted access.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
Now checks if there is a cross-origin opener and if so, immediately
grants cookie access to the popup's domain if it is partitioned or
blocked.
* loader/ResourceLoadObserver.h:
* platform/network/NetworkStorageSession.h:
Added member m_pagesGrantedStorageAccess.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
(WebCore::NetworkStorageSession::hasStorageAccess const):
Renamed from hasStorageAccessForFrame since the frameID now is optional.
(WebCore::NetworkStorageSession::grantStorageAccess):
Renamed from grantStorageAccessForFrame since the frameID now is optional.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
Now removes the pageID entry in m_pagesGrantedStorageAccess.
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
Renamed since the frameID now is optional.
(WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
Renamed since the frameID now is optional.
2018-03-12 Tim Horton <timothy_horton@apple.com>
Stop using SDK conditionals to control feature definitions
https://bugs.webkit.org/show_bug.cgi?id=183430
<rdar://problem/38251619>
Reviewed by Dan Bernstein.
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Renamed.
2018-03-12 Chris Dumez <cdumez@apple.com>
Return boolean from DOMTokenList's replace() method
https://bugs.webkit.org/show_bug.cgi?id=183567
Reviewed by Youenn Fablet.
Have DOMTokenList's replace() method return a boolean indicating if the
token was replaced, as per:
- https://dom.spec.whatwg.org/#dom-domtokenlist-replace
This is a recent addition to the DOM specification:
- https://github.com/whatwg/dom/pull/582
No new tests, rebaselined existing test.
* html/DOMTokenList.cpp:
(WebCore::replaceInOrderedSet):
(WebCore::DOMTokenList::replace):
* html/DOMTokenList.h:
* html/DOMTokenList.idl:
2018-03-12 Brian Burg <bburg@apple.com>
Ignore some deprecation warnings encountered when compiling with newer versions of ICU
https://bugs.webkit.org/show_bug.cgi?id=183584
<rdar://problem/38395317>
Reviewed by Daniel Bates.
Ignore new deprecation warnings. Where a function has more than one
deprecation warning, mark out the entire function so it remains readable.
* editing/TextIterator.cpp:
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
(WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
* platform/text/TextEncoding.cpp:
2018-03-12 Yoav Weiss <yoav@yoav.ws>
Runtime flag for link prefetch and remove link subresource.
https://bugs.webkit.org/show_bug.cgi?id=183540
Reviewed by Chris Dumez.
This patch removes the LINK_PREFETCH build time flag, removes
link subresource, adds an off-by-default runtime flag for link
prefetch and makes sure link prefetch only works when this flag is on.
Subresource is removed as it's not a part of any spec, nor supported by any
other browser. It was replaced by link preload.
No new tests as this is not adding any new functionality.
* Configurations/FeatureDefines.xcconfig: Remove the LINK_PREFETCH flag.
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute): Put prefetch support behind the runtime flag.
(WebCore::LinkRelAttribute::isSupported): Add prefetch.
* html/LinkRelAttribute.h: Remove the LINK_PREFETCH flag.
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient): Remove the LINK_PREFETCH flag.
(WebCore::LinkLoader::prefetchIfNeeded): Move the prefetch code to `prefetchIfNeeded()`. Remove subresource bits.
(WebCore::LinkLoader::loadLink): Call `prefetchIfNeeded()`.
* loader/LinkLoader.h:
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType): Remove the LINK_PREFETCH flag as well as subresource.
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded): Remove the LINK_PREFETCH flag as well as subresource.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResource::load): Remove the LINK_PREFETCH flag.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::ignoreForRequestCount const): Remove the LINK_PREFETCH flag as well as subresource.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResourceLoader::requestLinkResource): Remove subresource.
(WebCore::contentTypeFromResourceType): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResourceLoader::checkInsecureContent const): Remove the LINK_PREFETCH flag as well as subresource.
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Remove the LINK_PREFETCH flag as well as subresource.
* loader/cache/CachedResourceLoader.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Set the prefetch flag.
(WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Get the prefetch flag.
2018-03-12 Youenn Fablet <youenn@apple.com>
RTCPeerConnection's close method should update signalingState
https://bugs.webkit.org/show_bug.cgi?id=174314
<rdar://problem/33267977>
Reviewed by Eric Carlson.
Covered by rebased test.
Add closed as signalingState enum value.
Set peer connection signaling state to closed once close is called.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::doClose):
* Modules/mediastream/RTCSignalingState.idl:
* platform/mediastream/RTCSignalingState.h:
2018-03-12 Mark Lam <mark.lam@apple.com>
Make a NativeFunction into a class to support pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=183573
<rdar://problem/38384697>
Reviewed by Filip Pizlo.
No new tests because there's no new behavior. Only updating bindings.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHashTableValueArray):
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
2018-03-12 Tim Horton <timothy_horton@apple.com>
Use a different SPI header for some AudioToolbox enums
https://bugs.webkit.org/show_bug.cgi?id=183574
<rdar://problem/38385889>
Reviewed by Anders Carlsson.
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
Adjust SPI imports.
2018-03-12 Danyao Wang <danyao@chromium.org>
Add a query and fragment exception to history API's unique origin restriction.
https://bugs.webkit.org/show_bug.cgi?id=183028
Reviewed by Brent Fulgham.
Tests: http/tests/navigation/pushstate-at-unique-origin-denied.php
Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
* page/History.cpp:
(WebCore::History::stateObjectAdded):
2018-03-12 Antti Koivisto <antti@apple.com>
Don't invalidate descendants for nth pseudo classes unless needed
https://bugs.webkit.org/show_bug.cgi?id=183566
Reviewed by Zalan Bujtas.
We currently invalidate the whole subtrees that may match :nth-child and similar. In many common
cases we know that only the direct siblings may be affected.
* css/SelectorChecker.cpp:
(WebCore::localContextForParent):
(WebCore::SelectorChecker::matchRecursively const):
Track if the context matches the subject element if the selector or its siblings only.
(WebCore::SelectorChecker::checkOne const):
Use different bits of descendant and child invalidation cases.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentMatchesRightmostOrAdjacentElement):
(WebCore::SelectorCompiler::constructFragmentsInternal):
Track if the context matches the subject element if the selector or its siblings only.
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
Use different bits of descendant and child invalidation cases.
* dom/Element.cpp:
(WebCore::invalidateForForwardPositionalRules):
(WebCore::invalidateForBackwardPositionalRules):
Invalidate more precisely based on the new bits.
(WebCore::checkForSiblingStyleChanges):
(WebCore::Element::setDescendantsAffectedByForwardPositionalRules):
(WebCore::Element::setDescendantsAffectedByBackwardPositionalRules):
(WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
(WebCore::Element::rareDataDescendantsAffectedByForwardPositionalRules const):
(WebCore::Element::rareDataDescendantsAffectedByBackwardPositionalRules const):
New bits.
* dom/Element.h:
(WebCore::Element::descendantsAffectedByForwardPositionalRules const):
(WebCore::Element::descendantsAffectedByBackwardPositionalRules const):
* dom/ElementRareData.h:
(WebCore::ElementRareData::descendantsAffectedByForwardPositionalRules const):
(WebCore::ElementRareData::setDescendantsAffectedByForwardPositionalRules):
(WebCore::ElementRareData::descendantsAffectedByBackwardPositionalRules const):
(WebCore::ElementRareData::setDescendantsAffectedByBackwardPositionalRules):
(WebCore::ElementRareData::ElementRareData):
(WebCore::ElementRareData::resetStyleRelations):
* style/StyleRelations.cpp:
(WebCore::Style::commitRelationsToRenderStyle):
(WebCore::Style::commitRelations):
* style/StyleRelations.h:
2018-03-12 Javier Fernandez <jfernandez@igalia.com>
Remove GridLayout runtime flag
https://bugs.webkit.org/show_bug.cgi?id=183484
Reviewed by Myles C. Maxfield.
The Grid Layout feature has been enabled by default for almost a
year, so I think it's time to remove the runtime flag and the
codepath run when the feature is disabled.
No new tests, because there are no changes in functionality.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertContentAlignmentData):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* dom/Document.cpp:
* dom/Document.h:
* page/RuntimeEnabledFeatures.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialDefaultAlignment):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2018-03-12 Antoine Quint <graouts@apple.com>
[Web Animations] Implement CSS Animations and CSS Transitions as Web Animations
https://bugs.webkit.org/show_bug.cgi?id=183504
<rdar://problem/38372965>
Reviewed by Dean Jackson and Jon Lee.
Tests: webanimations/css-animations.html
webanimations/css-transitions.html
This patch implements CSS Animations and CSS Transitions as Web Animations. The main changes are:
* StyleTreeResolver: StyleTreeResolver now has a code path to add CSSAnimation and CSSTransition objects onto the DocumentTimeline
to be picked up by the Web Animations engine. The previous CSSAnimationController code path is preserved if the runtime flag is disabled.
* AnimationTimeline: we add two new methods, updateCSSAnimationsForElement() and updateCSSTransitionsForElement() which are called from
TreeResolver::createAnimatedElementUpdate(). These look at the AnimationList for the old and new RenderStyle objects and create, update
and remove matching CSSAnimation and CSSTransition instances.
* DeclarativeAnimation: a new superclass to both CSSAnimation and CSSTransition which introduces the concept of a backingAnimation(),
which is an Animation held by the RenderStyle objects, and two virtual methods with base implementations, initialize() which is called
upon creating by create() methods in subclasses, and syncPropertiesWithBackingAnimation() which ensures that properties on the
DeclarativeAnimation objects (Web Animations side) match the backing animation (CSS side).
* KeyframeEffectReadOnly: two new important methods to create blending keyframes (KeyframeList) based on backing Animation objects,
computeCSSAnimationBlendingKeyframes() and computeCSSTransitionBlendingKeyframes().
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffectReadOnly.h:
(WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const): We fix this method such that calling it on a KeyframeEffect, which
is a subclass of KeyframeEffectReadOnly, returns true.
* animation/AnimationEffectTimingReadOnly.cpp: In order for DeclarativeAnimation::syncPropertiesWithBackingAnimation() to set the timing
function for a declarative animation's effect, we need a public method to set an effect's timing function outside of just the "easing"
property setter exposed via the JS API. So we introduce a setTimingFunction() method and call it from setEasing().
(WebCore::AnimationEffectTimingReadOnly::setEasing):
(WebCore::AnimationEffectTimingReadOnly::setTimingFunction):
* animation/AnimationEffectTimingReadOnly.h:
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::~AnimationTimeline): Clear all maps and sets containing WebAnimation references to ensure these get destructed
when the AnimationTimeline is being destructed and should no longer hold a reference to them.
(WebCore::AnimationTimeline::relevantMapForAnimation): We store various subclasses of WebAnimation in dedicated maps so we can composite
animations in the correct order when animating. This function returns the correct map for a given animation such that animationWasAddedToElement()
and animationWasRemovedFromElement() mutate the right map.
(WebCore::AnimationTimeline::animationWasAddedToElement):
(WebCore::AnimationTimeline::animationWasRemovedFromElement):
(WebCore::AnimationTimeline::animationsForElement): Make sure to look for animations in the lists of CSS Animations and CSS Transitions as well
as Web Animations.
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): This method is called by TreeResolver::createAnimatedElementUpdate() during style
resolution. It compares the AnimationList of the previous style and the new style for a given element, checks that animations with a given name
that were not present in the old AnimationList have a new matching CSSAnimation object for them added to the AnimationTimeline, that animations
with a given name that are no longer present in the new AnimationList have their matching CSSAnimation object removed from the AnimationTimeline,
and that animations with a given name that are present in both the old and new AnimationList have their matching CSSAnimation updated to match
the current state of the animation in the AnimationList.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Similarly to updateCSSAnimationsForElement(), this method is called during style
resolution by TreeResolver::createAnimatedElementUpdate(). Its role is to create or remove CSSTransition objects based on the AnimationList found
in the old and new styles for a given element. It follows a slightly different logic than updateCSSAnimationsForElement() since for CSS Transitions,
there is no need to update CSSTransition objects for a CSS property existing in both the old and new AnimationList, since when a CSS transitions
property is changed, a whole new transition is initiated. However, it's important to check that different Animation objects and styles would actually
result in different timing properties and blending keyframes, so check for this as well before creating new CSSTransition objects.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::animations const): Change the m_animations type from HashSet to ListHashSet to guarantee we preserve the insertion order which is
required by getAnimations().
(WebCore::AnimationTimeline::hasElementAnimations const): Indicates to DocumentTimeline::updateAnimations() that there are animations targeting the provided element.
(WebCore::AnimationTimeline::elementToAnimationsMap):
(WebCore::AnimationTimeline::elementToCSSAnimationsMap):
(WebCore::AnimationTimeline::elementToCSSTransitionsMap):
* animation/CSSAnimation.cpp: CSSAnimation is now a subclass of DeclarativeAnimation and subclasses initialize() and syncPropertiesWithBackingAnimation()
to perform work specific to CSS Animations.
(WebCore::CSSAnimation::create): Set the animationName property based on the provided backing animation.
(WebCore::CSSAnimation::CSSAnimation):
(WebCore::CSSAnimation::initialize): Create the blending keyframes for this CSSAnimation.
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Reflect the animation-fill-mode, animation-direction, animation-iteration-count and
animation-play-state CSS properties on the AnimationEffectTimingReadOnly object associated with this CSSAnimation.
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp: CSSTransition is now a subclass of DeclarativeAnimation.
(WebCore::CSSTransition::create): Set the transitionProperty property based on the provided backing animation.
(WebCore::CSSTransition::CSSTransition):
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const):
(WebCore::CSSTransition::canBeListed const): Subclass this method such that we also check that we have blending keyframes for a CSSTransition to be
listed by calls to getAnimations().
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp: Added. This new WebAnimation subclass now is the common base class for both CSSAnimation and CSSTransition.
It establishes a relationship with a "backing animation", which is an Animation obtained from a style's AnimationList while resolving styles.
These backing animations contain all of the parsed CSS styles related to CSS Animations and CSS Transitions and we use those to set matching properties
of the Web Animations timing model in the new syncPropertiesWithBackingAnimation() virtual method, which subclasses can override to perform further
work that is specific to a given declarative animation type. The initialize() method is called during create() methods to perform common animation
setup work. Note that while both initialize() and syncPropertiesWithBackingAnimation() are called, we suspend invalidation to that animation's effect
since these methods are meant to be called during style invalidation and we would hit an assertion if we followed the usual route of calling
updateStyleIfNeeded() on the target's document during invalidation.
(WebCore::DeclarativeAnimation::DeclarativeAnimation):
(WebCore::DeclarativeAnimation::setBackingAnimation):
(WebCore::DeclarativeAnimation::initialize): Create a KeyframeEffectReadOnly for this animation and set the provided element as its target, set that
element's document's timeline and play the animation if the backing animation's play state is playing.
(WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): Reflect the {animation|transition}-delay, {animation|transition}-duration and
{animation|transition}-timing-function properties as set on the backing animation.
* animation/DeclarativeAnimation.h: Added.
(WebCore::DeclarativeAnimation::backingAnimation const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations): Trigger style invalidation for elements targeted not just by WebAnimation instances, but also by any
of the DeclarativeAnimation subclasses. We also remove the call to updateFinishedState() which should have been removed when we implemented correct
support for asynchronous WebAnimation operations.
(WebCore::DocumentTimeline::animatedStyleForRenderer): Declarative animations are backed by KeyframeEffectReadOnly effects, so make sure we check
for KeyframeEffectReadOnly or one of its subclasses and not just KeyframeEffect since there now are animation types that use the ReadOnly variant.
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Same as for animatedStyleForRenderer, check for KeyframeEffectReadOnly
and not simply KeyframeEffect.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::invalidateElement): Stop forcing a style resolution as we invalidate element, marking them as dirty is sufficient. Calls to getAnimations()
already force a style resolution as needed.
(WebCore::KeyframeEffectReadOnly::create): Add a new create() method that only provides a target and which is used by DeclarativeAnimation::initialize().
(WebCore::KeyframeEffectReadOnly::getKeyframes): The previous implementation of getKeyframes() used the ParsedKeyframe list held as m_parsedKeyframes
to compute keyframes. In the case of declarative animations, there are no ParsedKeyframe since the JS API was not involved, so we use the blending keyframes
to look for keyframe data.
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Called by CSSAnimation::initialize(), this function creates blending keyframes by
looking up the keyframes date obtained from the @keyframes rule with this backing animation's name.
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Called by CSSTransition::create(), this function creates blending keyframes by
creating a 0-offset keyframe with the old style and a 1-offset keyframe with the new style as provided during TreeResolver::createAnimatedElementUpdate().
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Called by AnimationTimeline::updateCSSTransitionsForElement()
to check that a provided backing Animation and a pair of old and new RenderStyles that may be different objects actually would yield different timing
properties and keyframe CSS values for a given CSS transition to avoid the deletion and creation of CSSTransition objects.
(WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): We mistakenly assumed we always had blending keyframes, which is not always the case with a
CSSTransition where the transition style itself might be set first, but the target value after. So we should only run accelerated provided there are blending
keyframes at least, the function already returning false if it finds a blending keyframe animating a non-accelerated CSS property.
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Check that there actually is a matching ParsedKeyframe to read the timing function from.
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::hasBlendingKeyframes const):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::~WebAnimation): We used to do something very wrong when a WebAnimation was destroyed which uncovered crashes when dealing with
declarative animations. In AnimationTimeline's updateCSSAnimationsForElement() and updateCSSTransitionsForElement(), when we identify that a DeclarativeAnimation
no longer matches an Animation from the current style's AnimationList, we set that DeclarativeAnimation's effect to null and call removeAnimation() on
the timeline. This removes all references from AnimationTimeline to this DeclarativeAnimation and leads to ~WebAnimation being called. Calling removeAnimation()
again in the destructor means that we'd hit ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun) in ref(). It was also meaningless to perform this work in
the WebAnimation destructor since an animation could never be destroyed if it were still registered on a timeline.
(WebCore::WebAnimation::suspendEffectInvalidation): DeclarativeAnimation instances have their timing model properties set during style invalidation, so we need
a mechanism to allow the usual effect invalidation to be suspended in this case. We now maintain a simple m_suspendCount count that increases and decreases with
calls to this method and unsuspendEffectInvalidation() and a isEffectInvalidationSuspended() method returning true whenever that count is positive.
(WebCore::WebAnimation::unsuspendEffectInvalidation):
(WebCore::WebAnimation::timingModelDidChange): Check that effect invalidation is not suspended before proceeding with invalidating the effect.
(WebCore::WebAnimation::setEffect): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
(WebCore::WebAnimation::setTimeline): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
(WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Ensure that the WebAnimation's lifecycle is extended at least to the completion of the scheduled microtask.
This would otherwise cause crashes after declarative animations were destroyed when they were no longer applied.
(WebCore::WebAnimation::runPendingPlayTask): Only fulfill the "ready" promise if it hasn't already been, which might have been the case if multiple calls to play()
are made as a result of updating the animation play state in CSSAnimation::syncPropertiesWithBackingAnimation().
(WebCore::WebAnimation::runPendingPauseTask): Same as above but with multiple pause() calls.
(WebCore::WebAnimation::startOrStopAccelerated): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
(WebCore::WebAnimation::canBeListed const): This new method is called by {Document|Element}::getAnimations() to check that an animation is in the correct state to
be listed. The Web Animations spec explains that only animations "that have an associated target effect which is current or in effect" can be listed. We implement
this behavior as specified.
* animation/WebAnimation.h:
(WebCore::WebAnimation::isDeclarativeAnimation const):
(WebCore::WebAnimation::isEffectInvalidationSuspended):
* dom/Document.cpp:
(WebCore::Document::getAnimations): Ensure that the document's pending styles are resolved before returning animations to ensure that any pending declarative
animations are created. Additionally, we ensure that we only list qualifying animations that have effects targeting elements that are children of thi document.
* dom/Element.cpp:
(WebCore::Element::getAnimations): Same as Document::getAnimations().
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate): When resolving styles, call into the AnimationTimeline if the runtime flag to enable CSS Animations and
CSS Transitions as Web Animations is on. Otherwise, use CSSAnimationController.
2018-03-12 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Crash in WebCore::PlatformDisplayWayland::~PlatformDisplayWayland
https://bugs.webkit.org/show_bug.cgi?id=176490
Reviewed by Žan Doberšek.
Destroy the wl_display with wl_display_disconnect() (client process API), not
wl_display_destroy() (server process API). It has to be destroyed last, so explicitly
destroy the wl_registry and wl_compositor first.
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
2018-03-10 Megan Gardner <megan_gardner@apple.com>
Media query for default appearance
https://bugs.webkit.org/show_bug.cgi?id=183539
<rdar://problem/38326388>
Reviewed by Tim Horton.
Not currently testable, will add tests in a later patch.
Write a media query to evaluate appearance.
* css/CSSValueKeywords.in:
* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::defaultAppearanceEvaluate):
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* page/Page.h:
(WebCore::Page::defaultAppearance const):
(WebCore::Page::setDefaultAppearance):
2018-03-10 Daniel Bates <dabates@apple.com>
InlineTextBox should own shadow data
https://bugs.webkit.org/show_bug.cgi?id=183359
<rdar://problem/38171343>
Reviewed by Darin Adler.
Following r229147 we recompute the selection style, including any shadow data, whenever we
paint the inline text box. Therefore, InlineTextBox needs to take ownership of the shadow
data or it may be deallocated before it can be used.
Covered by existing tests.
* rendering/InlineTextBox.cpp: Changed data type of InlineTextBox::MarkedTextStyle::textShadow
from const ShadowData* to std::optional<ShadowData>. Also removed explicitly deleted equality
and inequality operators as they are unnecessary. Layout tests should catch if these are ever
implemented and used when painting because the painted results will be wrong.
(WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const): Clone ShadowData.
(WebCore::InlineTextBox::resolveStyleForMarkedText): Simplified logic.
(WebCore::InlineTextBox::paintMarkedTextForeground): Modified code now that MarkedTextStyle
holds a std::optional<ShadowData>.
(WebCore::InlineTextBox::paintMarkedTextDecoration): Ditto.
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextSelectionPaintStyle): Changed the out parameter type from const ShadowData*
to std::optional<ShadowData>& and modified code as needed.
* rendering/TextPaintStyle.h:
* rendering/style/ShadowData.cpp: Removed unncessary #include of header LayoutRect.h.
This header will be included via ShadowData.h.
(WebCore::ShadowData::clone): Convenience method that returns an std::optional to a
cloned ShadowData object.
* rendering/style/ShadowData.h:
2018-03-09 Zalan Bujtas <zalan@apple.com>
Turn off offset*/scroll* optimization for input elements with shadow content
https://bugs.webkit.org/show_bug.cgi?id=182383
<rdar://problem/37114190>
Reviewed by Antti Koivisto.
We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width.
In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return
the previously computed values even when some part of the tree is dirty.
In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout)
for the root, while true (needs layout) for the shadow content.
This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result.
Test: fast/forms/scrollheight-with-mutation-crash.html
* dom/Document.cpp:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2018-03-10 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Copying a table from the Numbers app and pasting into iCloud Numbers fails
https://bugs.webkit.org/show_bug.cgi?id=183485
<rdar://problem/38041984>
Reviewed by Ryosuke Niwa.
After r222656, WebKit now treats raw image data on the pasteboard as files for the purposes of computing
DataTransfer.files and DataTransfer.types. However, this is combined with existing policies that suppress
DataTransfer.getData and DataTransfer.setData when the pasteboard contains files (generalized to copy/paste in
r222688). This means we now don't allow web pages to access "text/plain" in the case where the user copies part
of a table from the native Numbers app since Numbers additionally writes a snapshot of the table to the platform
pasteboard.
This restriction on getData/setData was intended to prevent web pages from extracting users' file paths when
pasting or dropping, so it doesn't make sense to enforce this restriction even when there is only in-memory
image data on the pasteboard. To fix this bug, we make Pasteboard::fileContentState() differentiate between
cases where there are (real) files on the pasteboard, and cases where we've fallen back to treating image data
as files.
Rebaselined existing LayoutTests to match new behavior.
Also covered by 4 new API tests:
- PasteMixedContent.ImageDataAndPlainText
- PasteMixedContent.ImageDataAndPlainTextAndURL
- PasteMixedContent.ImageDataAndPlainTextAndURLAndHTML
- UIPasteboardTests.DataTransferGetDataWhenPastingImageAndText
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
If custom pasteboard data is enabled, suppress getData and setData if and only if we might actually expose file
paths (see Pasteboard::fileContentState).
(WebCore::DataTransfer::types const):
Only allow "text/html" or "text/uri-list" in the case where there are actual files in the pasteboard. If there's
only image data, add all of the DOM-safe types back into the list of types.
* platform/Pasteboard.h:
* platform/StaticPasteboard.h:
Add an enum type to represent the result of Pasteboard::fileContentState.
- NoFileOrImageData indicates that there was nothing on the pasteboard that could be considered a file
from the point of view of the page.
- InMemoryImage indicates that there are no files on the pasteboard, but there is image data that we consider
to be files, exposed via DataTransfer API.
- MayContainFilePaths indicates that there might be file paths on the pasteboard. This means that the source
has either written file paths to the pasteboard (for example, through NSFilenamesPboardType) or the source
has written image data along with a URL type of some sort that does not match one of the allowed URL schemes
that are safe to expose (currently, these are http-family, data, or blob).
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
Refactor to return one of the three enum types described above.
(WebCore::Pasteboard::containsFiles): Deleted.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::fileContentState):
(WebCore::Pasteboard::containsFiles): Deleted.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::fileContentState):
(WebCore::Pasteboard::containsFiles): Deleted.
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::fileContentState):
(WebCore::Pasteboard::containsFiles): Deleted.
Adjust for Pasteboard::fileContentState() tweaks.
2018-03-09 Chris Fleizach <cfleizach@apple.com>
AX: WebKit seems to be running spell checker even on non-editable content text
https://bugs.webkit.org/show_bug.cgi?id=183456
<rdar://problem/38076042>
Reviewed by Joanmarie Diggs.
Test: accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html
Only apply misspelled attributes if it's for editable text. It's not useful or performant to do this for static text.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetSpelling):
2018-03-09 Nan Wang <n_wang@apple.com>
AX: AOM: More accessibility events support
https://bugs.webkit.org/show_bug.cgi?id=183023
<rdar://problem/37764380>
Reviewed by Chris Fleizach.
The test is crashing when we call updateBackingStore when
the AXObjectCache object is gone. Added a check to fix that.
Modified the test by using the right format of setTimeout and extended the delay.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
2018-03-09 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed. Fix WinCairo build after r229497.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::getNormalizedMIMEType):
2018-03-09 Ross Kirsling <ross.kirsling@sony.com>
Clean up MIMETypeRegistry::mimeTypeAssociationMap for Curl
https://bugs.webkit.org/show_bug.cgi?id=170529
Reviewed by Alex Christensen.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::getNormalizedMIMEType):
(WebCore::mimeTypeAssociationMap): Deleted.
Create map with makeNeverDestroyed and a loop instead.
2018-03-09 Brian Burg <bburg@apple.com>
Web Inspector: there should only be one way for async backend commands to send failure
https://bugs.webkit.org/show_bug.cgi?id=183524
Reviewed by Timothy Hatcher.
Remove some useless ErrorString arguments. Fix some bugs where we
may never call the callback in an early exit situation.
Covered by existing Inspector and protocol generator tests.
* inspector/agents/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::executeSQL):
* inspector/agents/InspectorDatabaseAgent.h:
* inspector/agents/InspectorIndexedDBAgent.h:
* inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::getDocumentAndIDBFactoryFromFrameOrSendFailure):
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
(WebCore::InspectorIndexedDBAgent::requestDatabase):
(WebCore::InspectorIndexedDBAgent::requestData):
(WebCore::InspectorIndexedDBAgent::clearObjectStore):
(WebCore::assertDocument): Deleted.
(WebCore::assertIDBFactory): Deleted.
Modernize this code a little bit to share the document/idbFactory extraction code.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource):
* inspector/agents/InspectorNetworkAgent.h:
2018-03-09 Youenn Fablet <youenn@apple.com>
Crash in ServiceWorkerContainer::ready
https://bugs.webkit.org/show_bug.cgi?id=183380
Reviewed by Chris Dumez.
Not using 'this' through lambdas.
Instead rely on the last lambda that is passed a ScriptExecutionContext& to get back 'this' which is a ServiceWorkerContainer.
Should be covered by imported/w3c/web-platform-tests/service-workers/service-worker/register-default-scope.https.html no longer crashing.
Although it should probably be LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html that should crash
since this is the main test using ready.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ready):
2018-03-09 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSource and RealtimeOutgoingVideoSource should be destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=183483
<rdar://problem/38214152>
Reviewed by Eric Carlson.
When dereferencing from libwebrtc code path, schedule a call to deref on main thread.
WebCore dereferencing is happening in the main thread so this guarantees destruction on the main thread.
Covered by updated mock libwebrtc peer connection backend.
We make mock senders to keep a reference to their source which are RealtimeOutgoingXXSource.
We then make mock peer connection backend to free the mock senders in a background thread.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::stop):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::stop):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::ThreadKeeper::create):
(WebCore::ThreadKeeper::setThread):
(WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
* testing/MockLibWebRTCPeerConnection.h:
2018-03-09 Jer Noble <jer.noble@apple.com>
Unconditionalize more methods in VideoFullscreenInterface (and related classes)
https://bugs.webkit.org/show_bug.cgi?id=183501
Reviewed by Eric Carlson.
No need for these methods to be PLATFORM(MAC) only.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::ensureControlsManager):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::isPlayingVideoInEnhancedFullscreen const):
* platform/mac/VideoFullscreenInterfaceMac.h:
2018-03-09 Youenn Fablet <youenn@apple.com>
ServiceWorker should respect IDB and DOMCache partitioning
https://bugs.webkit.org/show_bug.cgi?id=183496
Reviewed by Brady Eidson.
Test: http/wpt/service-workers/third-party-registration.html
Set the correct top origin of service worker ScriptExecutionContext.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
2018-03-09 Youenn Fablet <youenn@apple.com>
Cannot change audio input source device
https://bugs.webkit.org/show_bug.cgi?id=175975
<rdar://problem/34073589>
Reviewed by Eric Carlson.
Covered by manually testing https://webrtc.github.io/samples/src/content/devices/input-output/ with a USB web cam.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setCaptureDeviceID):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2018-03-09 Jer Noble <jer.noble@apple.com>
Add new CSS env constants for use with fullscreen
https://bugs.webkit.org/show_bug.cgi?id=183498
Reviewed by Dean Jackson.
Tests: fullscreen/fullscreen-auto-hide-delay.html
fullscreen/fullscreen-inset-top.html
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::nameForProperty const):
(WebCore::variableDataForPositiveDuration):
(WebCore::ConstantPropertyMap::setFullscreenInsetTop):
(WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay):
* dom/ConstantPropertyMap.h:
* page/Page.cpp:
(WebCore::Page::setFullscreenInsetTop):
(WebCore::Page::setFullscreenAutoHideDelay):
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setFullscreenInsetTop):
(WebCore::Internals::setFullscreenAutoHideDelay):
* testing/Internals.h:
* testing/Internals.idl:
2018-03-09 Zalan Bujtas <zalan@apple.com>
RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
https://bugs.webkit.org/show_bug.cgi?id=183493
<rdar://problem/38030461>
Reviewed by Antti Koivisto.
Multicolumn spanners are taken out of their original position and placed next
to a RenderMultiColumnSet. splitAnonymousBoxesAroundChild needs to know the original parent (in the render tree context).
Test: fast/multicol/adjust-beforeChild-for-spanner-crash.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::adjustBeforeChildForMultiColumnSpannerIfNeeded):
* rendering/updating/RenderTreeBuilderMultiColumn.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::attach):
2018-03-09 Jer Noble <jer.noble@apple.com>
Add isPictureInPictureActive messaging across WebKit process boundary
https://bugs.webkit.org/show_bug.cgi?id=183499
Reviewed by Eric Carlson.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::pictureInPictureActiveChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::isPictureInPictureActive const):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::isPictureInPictureActive const):
2018-03-09 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Implement connection limit.
https://bugs.webkit.org/show_bug.cgi?id=183016
Implement both connection limit per host and total
connection limit on curl network layer.
Reviewed by Youenn Fablet.
No new tests because there's no behavior change.
* platform/network/curl/CurlContext.cpp:
(WebCore::EnvironmentVariableReader::sscanTemplate<signed>):
(WebCore::CurlContext::CurlContext):
(WebCore::CurlMultiHandle::setMaxConnects):
(WebCore::CurlMultiHandle::setMaxTotalConnections):
(WebCore::CurlMultiHandle::setMaxHostConnections):
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::scheduler):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::startWithJobManager):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::completeDidReceiveResponse):
(WebCore::CurlRequest::pausedStatusChanged):
* platform/network/curl/CurlRequestScheduler.cpp:
(WebCore::CurlRequestScheduler::CurlRequestScheduler):
(WebCore::CurlRequestScheduler::workerThread):
(WebCore::CurlRequestScheduler::singleton): Deleted.
* platform/network/curl/CurlRequestScheduler.h:
2018-03-09 Jer Noble <jer.noble@apple.com>
webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
https://bugs.webkit.org/show_bug.cgi?id=183383
Reviewed by Eric Carlson.
Fire the webkitfullscreenchange event at the same time as the pseudo class selector changes, during the handling
of webkitDidEnterFullScreenForElement. For WebKit2 clients, this is guaranteed to be asynchronous, since the
calling method originates in the UIProcess. For WebKit1 clients (and WKTR and DRT), there's the possibility that
webkitWillEnterFullScreenForElement will be called synchronously from within
Document::requestFullScreenForElement(), so break that synchronousness by starting the
ChromeClient::enterFullScreenForElement(...) process in a async task.
Previously, the firing of the fullscreenchange event was done through a zero-length timer. Use a
GenericTaskQueue instead.
A number of layout tests depend on the behavior that the element will be in fullscreen when the 'playing' event
fires. This was true for DRT (but not WKTR), since its fullscreen implementations were deliberately synchronous, but
won't necessarily be true for all ports. Fix this in a subsequent patch.
* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
(WebCore::Document::webkitExitFullscreen):
(WebCore::Document::webkitWillEnterFullScreenForElement):
(WebCore::Document::webkitDidEnterFullScreenForElement):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::dispatchFullScreenChangeEvents):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::setPlaying):
2018-03-09 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Add threaded PaintingEngine implementation
https://bugs.webkit.org/show_bug.cgi?id=183511
Reviewed by Carlos Garcia Campos.
Add Nicosia::PaintingEngineThreaded, class that internally uses a thread
pool in which painting tasks are executed.
Implementation for now defaults to using GLib's GThreadPool, defaulting
to 4 threads that are exclusive to this pool. These parameters should be
fine-tuned in the future, or even made configurable, but are a solid
basis for testing.
In PaintingEngineThreaded::paint(), PaintingContext implementation is
used to record all the operations, and the gathered Vector is combined
with the Buffer object and dispatched into the thread pool. In the
thread function, the provided buffer and painting operations are run
through the PaintingContext implementation, replaying all the operations
on a painting context that draws into the given buffer.
The recorded operation objects implement the PaintingOperation interface
contain all the data necessary to replay a given operation. They can be
executed against a PaintingOperationReplay object, as is the case during
PaintingContext::replay(), or they can be dumped into a TextStream
object for debugging purposes.
PaintingContext now also provides the record() and replay() static
functions. PaintingContext objects now differ per purpose, which can be
either for painting or for recording. paint() and replay() use a
for-painting PaintingContext, and record() uses a for-recording one.
The for-painting PaintingContext receives a Buffer object, i.e. a memory
area on which it can draw, while the for-recording PaintingContext uses
the passed-in PaintingOperations Vector that should store all the
recorded operations.
The current Cairo implementation of PaintingContext is moved into
PaintingContextCairo::ForPainting. PaintingContextCairo::ForRecording is
added but is currently no-op until a Cairo-specific GraphicsContextImpl
with recording capabilities is added, allowing any call on the
GraphicsContext object used in PaintingContext::record() to be recorded
for later replay. PaintingOperationReplayCairo, inheriting from
PaintingOperationReplay, will be used for replay purposes, providing
only reference to the PlatformContextCairo object that is constructed in
PaintingContextCairo::ForPainting.
The Cairo-specific GraphicsContextImpl implementation will be added in
a separate patch. After that, PaintingEngine::create() will be modified
so that the Nicosia::PaintingEngineThreaded implementation can be used
for testing purposes, probably by setting an environment variable.
* platform/TextureMapper.cmake:
* platform/graphics/nicosia/NicosiaPaintingContext.cpp:
(Nicosia::PaintingContext::createForPainting):
(Nicosia::PaintingContext::createForRecording):
(Nicosia::PaintingContext::create): Deleted.
* platform/graphics/nicosia/NicosiaPaintingContext.h:
(Nicosia::PaintingContext::paint):
(Nicosia::PaintingContext::record):
(Nicosia::PaintingContext::replay):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: Added.
(Nicosia::s_threadFunc):
(Nicosia::paintLayer):
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
(Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
(Nicosia::PaintingEngineThreaded::paint):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
* platform/graphics/nicosia/NicosiaPaintingOperation.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::ForPainting::ForPainting):
(Nicosia::PaintingContextCairo::ForPainting::~ForPainting):
(Nicosia::PaintingContextCairo::ForPainting::graphicsContext):
(Nicosia::PaintingContextCairo::ForPainting::replay):
(Nicosia::PaintingContextCairo::ForRecording::ForRecording):
(Nicosia::PaintingContextCairo::ForRecording::graphicsContext):
(Nicosia::PaintingContextCairo::ForRecording::replay):
(Nicosia::PaintingContextCairo::PaintingContextCairo): Deleted.
(Nicosia::PaintingContextCairo::~PaintingContextCairo): Deleted.
(Nicosia::PaintingContextCairo::graphicsContext): Deleted.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
* platform/graphics/nicosia/cairo/NicosiaPaintingOperationReplayCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
(Nicosia::PaintingOperationReplayCairo::PaintingOperationReplayCairo):
2018-03-09 Zan Dobersek <zdobersek@igalia.com>
Remove some unused cruft in TextureMapperLayer.
The ScrollingClient class is not used anymore since r229318.
findScrollableContentsLayerAt() is similarly unused, but also lacking
an actual definition. ContentsLayerCount enum can also be purged.
Rubber-stamped by Carlos Garcia Campos.
* platform/graphics/texmap/TextureMapperLayer.h:
2018-03-08 Zan Dobersek <zdobersek@igalia.com>
Add basic synchronization capability to Nicosia::Buffer
https://bugs.webkit.org/show_bug.cgi?id=183500
Reviewed by Carlos Garcia Campos.
Have Nicosia::Buffer track a painting state, and allow that state to be
modified and accessed from different threads. The PaintingState enum
value is protected by a Lock object, and can be modified via the
beginPainting() and completePainting() methods. Additionally, the
waitUntilPaintingComplete() method allows the caller to wait until the
painting is complete for the given Nicosia::Buffer object.
This added state doesn't affect a Nicosia::Buffer object internally, and
doesn't have any effect on existing usages of Nicosia::Buffer (which
are not multi-threaded).
* platform/graphics/nicosia/NicosiaBuffer.cpp:
(Nicosia::Buffer::beginPainting):
(Nicosia::Buffer::completePainting):
(Nicosia::Buffer::waitUntilPaintingComplete):
* platform/graphics/nicosia/NicosiaBuffer.h:
2018-03-08 Zan Dobersek <zdobersek@igalia.com>
Move NicosiaPaintingContextCairo files under Cairo-specific directory
https://bugs.webkit.org/show_bug.cgi?id=183497
Reviewed by Carlos Garcia Campos.
Pack Cairo-specific files in the Nicosia subsystem under cairo/.
* platform/TextureMapper.cmake:
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.h.
2018-03-08 Nan Wang <n_wang@apple.com>
AX: AOM: More accessibility events support
https://bugs.webkit.org/show_bug.cgi?id=183023
<rdar://problem/37764380>
Reviewed by Chris Fleizach.
Fixed the crash that we shouldn't dispatch the accessibility events if the
event path is empty.
Also added a check to not dispatch events if the runtime flag is not enabled.
Test: accessibility/mac/AOM-events-webarea-crash.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
* accessibility/AccessibilityObject.h:
2018-03-08 Megan Gardner <megan_gardner@apple.com>
Allow WebViews to disable system appearance
https://bugs.webkit.org/show_bug.cgi?id=183418
<rdar://problem/36975642>
Reviewed by Tim Horton.
Not currently testable, tests will be added in a later patch.
Allow webviews to choose whether or not to follow the default system appearance.
* css/StyleColor.cpp:
(WebCore::StyleColor::colorFromKeyword):
* css/StyleColor.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* css/parser/CSSParserMode.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setStrokeColor):
(WebCore::CanvasRenderingContext2DBase::setFillColor):
* html/canvas/CanvasStyle.cpp:
(WebCore::parseColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/canvas/CanvasStyle.h:
* page/Page.h:
(WebCore::Page::useSystemAppearance const):
(WebCore::Page::setUseSystemAppearance):
* platform/Theme.cpp:
(WebCore::Theme::paint):
* platform/Theme.h:
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(-[WebCoreThemeView initWithUseSystemAppearance:]):
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::ThemeMac::ensuredView):
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
(WebCore::ThemeMac::paint):
(-[WebCoreThemeView init]): Deleted.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::systemColor const):
(WebCore::RenderTheme::focusRingColor):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformFocusRingColor const):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::platformFocusRingColor const):
(WebCore::RenderThemeMac::systemColor const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
2018-03-08 Megan Gardner <megan_gardner@apple.com>
Ensure default appearance for selection form control
https://bugs.webkit.org/show_bug.cgi?id=183482
<rdar://problem/38274894>
Reviewed by Tim Horton.
The appearance for selection form controls was not set to default.
Not currently testable, will add tests in a later patch.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2018-03-08 Per Arne Vollan <pvollan@apple.com>
[Win] Compile error: pal/ExportMacros.h not found.
https://bugs.webkit.org/show_bug.cgi?id=183467
Reviewed by Brent Fulgham.
PAL header files are no longer located under the WebCore folder in forwarding headers. An additional
build step is required to copy the PAL header files to the internal include folder.
No new tests, no change in functionality.
* PlatformWin.cmake:
* WebCore.vcxproj/WebCore.proj:
2018-03-08 Megan Gardner <megan_gardner@apple.com>
Ensure system appearance is default for legacy webkit
https://bugs.webkit.org/show_bug.cgi?id=183473
<rdar://problem/38210306>
Reviewed by Tim Horton.
Need to set the appearance on the window for legacy webkit due to differences in drawing.
Not currently testable, will add tests in a later patch.
* platform/mac/ThemeMac.mm:
(WebCore::paintButton):
2018-03-08 Youenn Fablet <youenn@apple.com>
libwebrtc update broke internal builds
https://bugs.webkit.org/show_bug.cgi?id=183454
Reviewed by Eric Carlson.
No change of behavior.
Fixed header search paths.
Removed deleted file from XCode project as an additional clean-up.
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2018-03-08 Per Arne Vollan <pvollan@apple.com>
NSAnimation is not working in the WebContent process when WindowServer access is blocked.
https://bugs.webkit.org/show_bug.cgi?id=183291
Reviewed by Dean Jackson.
The animation can be implemented by using an NSTimer instead. Use the existing Bezier timing
function to create a smooth animation.
No new tests. This code is used to fade scrollbars in and out by animating the alpha value.
This scrollbar setting is not the default in macOS, which makes it non trivial to create
layout tests for this.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
(-[WebScrollbarPartAnimation startAnimation]):
(-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
(-[WebScrollbarPartAnimation invalidate]):
(-[WebScrollbarPartAnimation setDuration:]):
(-[WebScrollbarPartAnimation stopAnimation]):
(-[WebScrollbarPartAnimation setCurrentProgress:]): Deleted.
2018-03-08 Said Abou-Hallawa <sabouhallawa@apple.com>
Templatize SVGAnimatedType
https://bugs.webkit.org/show_bug.cgi?id=183017
Reviewed by Dean Jackson.
This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
goal to have SVGAnimatedType be type independent. The appropriate method
of this template will be implicitly instantiated based to the type of the
animated attribute(s).
* Sources.txt: Delete SVGAnimatedType.cpp since its function became template
functions or short enough to be inline functions.
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::constructFromString):
(WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
Use the template functions SVGAnimatedType::create<>() and SVGAnimatedType::as<>().
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::constructFromString):
(WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::constructFromString):
(WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedEnumeration.cpp:
(WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
(WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::constructFromString):
(WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::constructFromString):
(WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::constructFromString):
(WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::constructFromString):
(WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::constructFromString):
(WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::constructFromString):
(WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::constructFromString):
(WebCore::SVGAnimatedPointListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::constructFromString):
(WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedString.cpp:
(WebCore::SVGAnimatedStringAnimator::constructFromString):
(WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedStringAnimator::calculateAnimatedValue):
Ditto.
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::constructFromString):
(WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
Ditto.
* svg/SVGAnimatedType.cpp: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::create):
(WebCore::SVGAnimatedType::SVGAnimatedType):
(WebCore::SVGAnimatedType::~SVGAnimatedType):
(WebCore::SVGAnimatedType::as const):
(WebCore::SVGAnimatedType::as):
(WebCore::SVGAnimatedType::type const):
(WebCore::SVGAnimatedType::valueAsString const):
(WebCore::SVGAnimatedType::setValueAsString):
(WebCore::SVGAnimatedType::supportsAnimVal):
(WebCore::SVGAnimatedType::angleAndEnumeration const): Deleted.
(WebCore::SVGAnimatedType::boolean const): Deleted.
(WebCore::SVGAnimatedType::color const): Deleted.
(WebCore::SVGAnimatedType::enumeration const): Deleted.
(WebCore::SVGAnimatedType::integer const): Deleted.
(WebCore::SVGAnimatedType::integerOptionalInteger const): Deleted.
(WebCore::SVGAnimatedType::length const): Deleted.
(WebCore::SVGAnimatedType::lengthList const): Deleted.
(WebCore::SVGAnimatedType::number const): Deleted.
(WebCore::SVGAnimatedType::numberList const): Deleted.
(WebCore::SVGAnimatedType::numberOptionalNumber const): Deleted.
(WebCore::SVGAnimatedType::path const): Deleted.
(WebCore::SVGAnimatedType::pointList const): Deleted.
(WebCore::SVGAnimatedType::preserveAspectRatio const): Deleted.
(WebCore::SVGAnimatedType::rect const): Deleted.
(WebCore::SVGAnimatedType::string const): Deleted.
(WebCore::SVGAnimatedType::transformList const): Deleted.
(WebCore::SVGAnimatedType::angleAndEnumeration): Deleted.
(WebCore::SVGAnimatedType::boolean): Deleted.
(WebCore::SVGAnimatedType::color): Deleted.
(WebCore::SVGAnimatedType::enumeration): Deleted.
(WebCore::SVGAnimatedType::integer): Deleted.
(WebCore::SVGAnimatedType::integerOptionalInteger): Deleted.
(WebCore::SVGAnimatedType::length): Deleted.
(WebCore::SVGAnimatedType::lengthList): Deleted.
(WebCore::SVGAnimatedType::number): Deleted.
(WebCore::SVGAnimatedType::numberList): Deleted.
(WebCore::SVGAnimatedType::numberOptionalNumber): Deleted.
(WebCore::SVGAnimatedType::path): Deleted.
(WebCore::SVGAnimatedType::pointList): Deleted.
(WebCore::SVGAnimatedType::preserveAspectRatio): Deleted.
(WebCore::SVGAnimatedType::rect): Deleted.
(WebCore::SVGAnimatedType::string): Deleted.
(WebCore::SVGAnimatedType::transformList): Deleted.
Replace the union by a Variant. Replace all the type specific functions
by the template functions create() and as(). Use WTF::visit to get the
value stored in the variant. Use the SVGPropertyTraits to perform the
required operation.
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::executeAction):
Rename the parameters and the local variables to match their types. Use
the SVGAnimatedType template functions create() and as().
* svg/SVGLengthValue.h:
(WebCore::SVGPropertyTraits<SVGLengthValue>::parse): This was moved from
SVGAnimatedType::setValueAsString()
(WebCore::SVGPropertyTraits<SVGLengthValue>::toString): This was moved from
SVGAnimatedType::valueAsString().
* svg/SVGMarkerTypes.h: Add placeholders for parse() and toString() so
SVGAnimatedType::valueAsString() and setValueAsString() can compile for
all types.
* svg/SVGNumberListValues.h:
(WebCore::SVGPropertyTraits<SVGNumberListValues>::parse):
* svg/SVGPathByteStream.h:
(WebCore::SVGPropertyTraits<SVGPathByteStream>::parse):
(WebCore::SVGPropertyTraits<SVGPathByteStream>::toString):
* svg/SVGPointListValues.h:
(WebCore::SVGPropertyTraits<SVGPointListValues>::parse):
(WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
* svg/SVGPreserveAspectRatioValue.h:
(WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString):
(WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse):
(WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString):
Ditto.
* svg/SVGTransformListValues.h:
(WebCore::SVGPropertyTraits<SVGTransformListValues>::parse):
Ditto.
* svg/SVGValue.h: Added. SVGValueVariant is the replacement of the union
SVGAnimatedType::DataUnion.
* svg/properties/SVGPropertyInfo.h:
Add a minimum and maximum AnimatedPropertyType so, SVGAnimatedType::type()
can assert that the index of the variant is in the range of this enum.
* svg/properties/SVGPropertyTraits.h:
(WebCore::SVGPropertyTraits<bool>::parse):
(WebCore::SVGPropertyTraits<unsigned>::parse):
(WebCore::SVGPropertyTraits<int>::parse):
Ditto.
2018-03-08 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
https://bugs.webkit.org/show_bug.cgi?id=183449
Reviewed by Mark Lam.
This patch removes jsDynamicDowncast. Our JSC::jsDynamicCast can have a way to inject a fast
path that is similar to jsDynamicDowncast. WebCore can leverage this functionality to add
a fast path for WebCore's extended JS object types (JSEvent, JSElement, JSNode, and JSDocument).
No behavior change.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CommonVM.cpp:
(WebCore::lexicalFrameFromCommonVM):
* bindings/js/JSDOMConvertBufferSource.h:
(WebCore::toPossiblySharedArrayBufferView):
* bindings/js/JSDOMConvertPromise.h:
(WebCore::Converter<IDLPromise<T>>::convert):
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::reportException):
(WebCore::retrieveErrorMessage):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::JSDOMWindowProxy::toWrapped):
* bindings/js/JSDOMWrapperCache.h:
* bindings/js/JSDocumentCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
(WebCore::jsDocumentCast): Deleted.
* bindings/js/JSDynamicDowncast.h: Removed.
* bindings/js/JSElementCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
(WebCore::jsElementCast): Deleted.
* bindings/js/JSEventCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
(WebCore::jsEventCast): Deleted.
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::jsEventTargetCast):
* bindings/js/JSNodeCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
(WebCore::jsNodeCast): Deleted.
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::JSReadableStreamSource::start):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::toJSDedicatedWorkerGlobalScope):
(WebCore::toJSWorkerGlobalScope):
(WebCore::toJSServiceWorkerGlobalScope):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::isDisturbed):
* bindings/js/ReadableStream.h:
(WebCore::JSReadableStreamWrapperConverter::toWrapped):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::serialize):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(GetCastingHelperForThisObject):
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::jsInterfaceNameConstructor):
(WebCore::setJSInterfaceNameConstructor):
(WebCore::JSInterfaceName::toWrapped):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::IDLAttribute<JSMapLike>::cast):
(WebCore::IDLOperation<JSMapLike>::cast):
(WebCore::jsMapLikeConstructor):
(WebCore::setJSMapLikeConstructor):
(WebCore::JSMapLike::toWrapped):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::IDLAttribute<JSReadOnlyMapLike>::cast):
(WebCore::IDLOperation<JSReadOnlyMapLike>::cast):
(WebCore::jsReadOnlyMapLikeConstructor):
(WebCore::setJSReadOnlyMapLikeConstructor):
(WebCore::JSReadOnlyMapLike::toWrapped):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::IDLAttribute<JSTestActiveDOMObject>::cast):
(WebCore::IDLOperation<JSTestActiveDOMObject>::cast):
(WebCore::jsTestActiveDOMObjectConstructor):
(WebCore::setJSTestActiveDOMObjectConstructor):
(WebCore::JSTestActiveDOMObject::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::IDLAttribute<JSTestCEReactions>::cast):
(WebCore::IDLOperation<JSTestCEReactions>::cast):
(WebCore::jsTestCEReactionsConstructor):
(WebCore::setJSTestCEReactionsConstructor):
(WebCore::JSTestCEReactions::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::IDLAttribute<JSTestCEReactionsStringifier>::cast):
(WebCore::IDLOperation<JSTestCEReactionsStringifier>::cast):
(WebCore::jsTestCEReactionsStringifierConstructor):
(WebCore::setJSTestCEReactionsStringifierConstructor):
(WebCore::JSTestCEReactionsStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::IDLAttribute<JSTestCallTracer>::cast):
(WebCore::IDLOperation<JSTestCallTracer>::cast):
(WebCore::jsTestCallTracerConstructor):
(WebCore::setJSTestCallTracerConstructor):
(WebCore::JSTestCallTracer::toWrapped):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
(WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::IDLAttribute<JSTestDOMJIT>::cast):
(WebCore::IDLOperation<JSTestDOMJIT>::cast):
(WebCore::jsTestDOMJITConstructor):
(WebCore::setJSTestDOMJITConstructor):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::IDLAttribute<JSTestEnabledBySetting>::cast):
(WebCore::IDLOperation<JSTestEnabledBySetting>::cast):
(WebCore::jsTestEnabledBySettingConstructor):
(WebCore::setJSTestEnabledBySettingConstructor):
(WebCore::JSTestEnabledBySetting::toWrapped):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::IDLAttribute<JSTestEventConstructor>::cast):
(WebCore::jsTestEventConstructorConstructor):
(WebCore::setJSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::IDLOperation<JSTestEventTarget>::cast):
(WebCore::jsTestEventTargetConstructor):
(WebCore::setJSTestEventTargetConstructor):
(WebCore::JSTestEventTarget::toWrapped):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::IDLAttribute<JSTestException>::cast):
(WebCore::jsTestExceptionConstructor):
(WebCore::setJSTestExceptionConstructor):
(WebCore::JSTestException::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
(WebCore::jsTestGenerateIsReachableConstructor):
(WebCore::setJSTestGenerateIsReachableConstructor):
(WebCore::JSTestGenerateIsReachable::toWrapped):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::IDLAttribute<JSTestGlobalObject>::cast):
(WebCore::IDLOperation<JSTestGlobalObject>::cast):
(WebCore::jsTestGlobalObjectConstructor):
(WebCore::setJSTestGlobalObjectConstructor):
(WebCore::JSTestGlobalObject::toWrapped):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::jsTestIndexedSetterNoIdentifierConstructor):
(WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
(WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::jsTestIndexedSetterThrowingExceptionConstructor):
(WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
(WebCore::JSTestIndexedSetterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::IDLOperation<JSTestIndexedSetterWithIdentifier>::cast):
(WebCore::jsTestIndexedSetterWithIdentifierConstructor):
(WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
(WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::IDLAttribute<JSTestInterface>::cast):
(WebCore::IDLOperation<JSTestInterface>::cast):
(WebCore::jsTestInterfaceConstructor):
(WebCore::setJSTestInterfaceConstructor):
(WebCore::JSTestInterface::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::IDLAttribute<JSTestInterfaceLeadingUnderscore>::cast):
(WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
(WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::IDLOperation<JSTestIterable>::cast):
(WebCore::jsTestIterableConstructor):
(WebCore::setJSTestIterableConstructor):
(WebCore::JSTestIterable::toWrapped):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::IDLAttribute<JSTestJSBuiltinConstructor>::cast):
(WebCore::IDLOperation<JSTestJSBuiltinConstructor>::cast):
(WebCore::jsTestJSBuiltinConstructorConstructor):
(WebCore::setJSTestJSBuiltinConstructorConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::IDLOperation<JSTestMediaQueryListListener>::cast):
(WebCore::jsTestMediaQueryListListenerConstructor):
(WebCore::setJSTestMediaQueryListListenerConstructor):
(WebCore::JSTestMediaQueryListListener::toWrapped):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor):
(WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor):
(WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
(WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast):
(WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor):
(WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::jsTestNamedConstructorConstructor):
(WebCore::setJSTestNamedConstructorConstructor):
(WebCore::JSTestNamedConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::jsTestNamedDeleterNoIdentifierConstructor):
(WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
(WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::jsTestNamedDeleterThrowingExceptionConstructor):
(WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
(WebCore::JSTestNamedDeleterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::IDLOperation<JSTestNamedDeleterWithIdentifier>::cast):
(WebCore::jsTestNamedDeleterWithIdentifierConstructor):
(WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
(WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::jsTestNamedDeleterWithIndexedGetterConstructor):
(WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
(WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::jsTestNamedGetterCallWithConstructor):
(WebCore::setJSTestNamedGetterCallWithConstructor):
(WebCore::JSTestNamedGetterCallWith::toWrapped):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::jsTestNamedGetterNoIdentifierConstructor):
(WebCore::setJSTestNamedGetterNoIdentifierConstructor):
(WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::IDLOperation<JSTestNamedGetterWithIdentifier>::cast):
(WebCore::jsTestNamedGetterWithIdentifierConstructor):
(WebCore::setJSTestNamedGetterWithIdentifierConstructor):
(WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::jsTestNamedSetterNoIdentifierConstructor):
(WebCore::setJSTestNamedSetterNoIdentifierConstructor):
(WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::jsTestNamedSetterThrowingExceptionConstructor):
(WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
(WebCore::JSTestNamedSetterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::IDLOperation<JSTestNamedSetterWithIdentifier>::cast):
(WebCore::jsTestNamedSetterWithIdentifierConstructor):
(WebCore::setJSTestNamedSetterWithIdentifierConstructor):
(WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast):
(WebCore::jsTestNamedSetterWithIndexedGetterConstructor):
(WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
(WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetterAndSetter>::cast):
(WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor):
(WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::jsTestNamedSetterWithOverrideBuiltinsConstructor):
(WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
(WebCore::JSTestNamedSetterWithOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast):
(WebCore::IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast):
(WebCore::jsTestNamedSetterWithUnforgablePropertiesConstructor):
(WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
(WebCore::JSTestNamedSetterWithUnforgableProperties::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
(WebCore::IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
(WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
(WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
(WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::IDLAttribute<JSTestNode>::cast):
(WebCore::IDLOperation<JSTestNode>::cast):
(WebCore::jsTestNodeConstructor):
(WebCore::setJSTestNodeConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::IDLAttribute<JSTestObj>::cast):
(WebCore::IDLOperation<JSTestObj>::cast):
(WebCore::jsTestObjConstructor):
(WebCore::setJSTestObjConstructor):
(WebCore::JSTestObj::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::jsTestOverloadedConstructorsConstructor):
(WebCore::setJSTestOverloadedConstructorsConstructor):
(WebCore::JSTestOverloadedConstructors::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
(WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::IDLOperation<JSTestOverrideBuiltins>::cast):
(WebCore::jsTestOverrideBuiltinsConstructor):
(WebCore::setJSTestOverrideBuiltinsConstructor):
(WebCore::JSTestOverrideBuiltins::toWrapped):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::jsTestPluginInterfaceConstructor):
(WebCore::setJSTestPluginInterfaceConstructor):
(WebCore::JSTestPluginInterface::toWrapped):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::IDLAttribute<JSTestPromiseRejectionEvent>::cast):
(WebCore::jsTestPromiseRejectionEventConstructor):
(WebCore::setJSTestPromiseRejectionEventConstructor):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::IDLAttribute<JSTestSerialization>::cast):
(WebCore::IDLOperation<JSTestSerialization>::cast):
(WebCore::jsTestSerializationConstructor):
(WebCore::setJSTestSerializationConstructor):
(WebCore::JSTestSerialization::toWrapped):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
(WebCore::jsTestSerializationIndirectInheritanceConstructor):
(WebCore::setJSTestSerializationIndirectInheritanceConstructor):
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::IDLAttribute<JSTestSerializationInherit>::cast):
(WebCore::IDLOperation<JSTestSerializationInherit>::cast):
(WebCore::jsTestSerializationInheritConstructor):
(WebCore::setJSTestSerializationInheritConstructor):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::IDLAttribute<JSTestSerializationInheritFinal>::cast):
(WebCore::IDLOperation<JSTestSerializationInheritFinal>::cast):
(WebCore::jsTestSerializationInheritFinalConstructor):
(WebCore::setJSTestSerializationInheritFinalConstructor):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::IDLAttribute<JSTestSerializedScriptValueInterface>::cast):
(WebCore::IDLOperation<JSTestSerializedScriptValueInterface>::cast):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
(WebCore::JSTestSerializedScriptValueInterface::toWrapped):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::IDLOperation<JSTestStringifier>::cast):
(WebCore::jsTestStringifierConstructor):
(WebCore::setJSTestStringifierConstructor):
(WebCore::JSTestStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::IDLOperation<JSTestStringifierAnonymousOperation>::cast):
(WebCore::jsTestStringifierAnonymousOperationConstructor):
(WebCore::setJSTestStringifierAnonymousOperationConstructor):
(WebCore::JSTestStringifierAnonymousOperation::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::IDLOperation<JSTestStringifierNamedOperation>::cast):
(WebCore::jsTestStringifierNamedOperationConstructor):
(WebCore::setJSTestStringifierNamedOperationConstructor):
(WebCore::JSTestStringifierNamedOperation::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::IDLOperation<JSTestStringifierOperationImplementedAs>::cast):
(WebCore::jsTestStringifierOperationImplementedAsConstructor):
(WebCore::setJSTestStringifierOperationImplementedAsConstructor):
(WebCore::JSTestStringifierOperationImplementedAs::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::IDLOperation<JSTestStringifierOperationNamedToString>::cast):
(WebCore::jsTestStringifierOperationNamedToStringConstructor):
(WebCore::setJSTestStringifierOperationNamedToStringConstructor):
(WebCore::JSTestStringifierOperationNamedToString::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::IDLAttribute<JSTestStringifierReadOnlyAttribute>::cast):
(WebCore::IDLOperation<JSTestStringifierReadOnlyAttribute>::cast):
(WebCore::jsTestStringifierReadOnlyAttributeConstructor):
(WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
(WebCore::JSTestStringifierReadOnlyAttribute::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::IDLAttribute<JSTestStringifierReadWriteAttribute>::cast):
(WebCore::IDLOperation<JSTestStringifierReadWriteAttribute>::cast):
(WebCore::jsTestStringifierReadWriteAttributeConstructor):
(WebCore::setJSTestStringifierReadWriteAttributeConstructor):
(WebCore::JSTestStringifierReadWriteAttribute::toWrapped):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::IDLAttribute<JSTestTypedefs>::cast):
(WebCore::IDLOperation<JSTestTypedefs>::cast):
(WebCore::jsTestTypedefsConstructor):
(WebCore::setJSTestTypedefsConstructor):
(WebCore::JSTestTypedefs::toWrapped):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject setValue:forKey:]):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::lengthGetter):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
2018-03-08 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Add inherits<T>(VM&) leveraging JSCast fast path
https://bugs.webkit.org/show_bug.cgi?id=183429
Reviewed by Mark Lam.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* bindings/js/JSDOMConvertDate.cpp:
(WebCore::valueToDate):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::scriptExecutionContext const):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSEventTargetCustom.cpp:
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::pushEventHandlerScope const):
* bindings/js/JSXPathNSResolverCustom.cpp:
(WebCore::JSXPathNSResolver::toWrapped):
* bindings/js/ScriptState.cpp:
(WebCore::domWindowFromExecState):
(WebCore::scriptExecutionContextFromExecState):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::isArray):
(WebCore::CloneSerializer::isMap):
(WebCore::CloneSerializer::isSet):
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneSerializer::dumpDOMPoint):
(WebCore::CloneSerializer::dumpDOMRect):
(WebCore::CloneSerializer::dumpDOMMatrix):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readArrayBufferView):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadDispatcher):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::construct):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):
* bridge/objc/WebScriptObject.mm:
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeMethod):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::callObjCFallbackObject):
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::callRuntimeObject):
(JSC::Bindings::callRuntimeConstructor):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::subtype):
(WebCore::WebInjectedScriptHost::isHTMLAllCollection):
2018-03-08 Tim Horton <timothy_horton@apple.com>
Stop linking ApplicationServices directly
https://bugs.webkit.org/show_bug.cgi?id=182867
<rdar://problem/38252142>
Reviewed by Alex Christensen.
The frameworks that we use that live inside ApplicationServices
have mostly moved out, so import them directly.
* Configurations/WebCore.xcconfig:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* platform/MIMETypeRegistry.cpp:
* platform/graphics/ComplexTextController.cpp:
* platform/graphics/cg/ColorCG.cpp:
* platform/graphics/cg/ImageDecoderCG.cpp:
* platform/graphics/cg/UTIRegistry.cpp:
* platform/graphics/cocoa/FontCocoa.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
* platform/graphics/mac/GlyphPageMac.cpp:
* platform/graphics/mac/PDFDocumentImageMac.mm:
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
* platform/graphics/win/FontCGWin.cpp:
* platform/graphics/win/FontCacheWin.cpp:
* platform/graphics/win/FontCustomPlatformData.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/graphics/win/ImageCGWin.cpp:
* platform/graphics/win/SimpleFontDataCGWin.cpp:
2018-03-07 Tim Horton <timothy_horton@apple.com>
Sort and separate FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=183427
Reviewed by Dan Bernstein.
* Configurations/FeatureDefines.xcconfig:
Sort and split FeatureDefines into paragraphs
(to make it easier to sort later).
2018-03-07 Zalan Bujtas <zalan@apple.com>
Invalid innerTextRenderer in RenderTextControlSingleLine::styleDidChange()
https://bugs.webkit.org/show_bug.cgi?id=183385
<rdar://problem/38085397>
Reviewed by Antti Koivisto.
When HTMLInputElement::updateType() is called with a dirty value, we eagerly change the m_inputType first
and then we take care of the dirty value by calling setAttributeWithoutSynchronization().
With a DOMSubtreeModified event listener attached, setAttributeWithoutSynchronization() can end up running some
layout code (offsetHeight) with a renderer - m_inputType mismatch.
This patch ensures that we don't change the m_inputType until after we finished setting the new value.
Test: fast/DOM/HTMLInputElement/input-value-and-type-change-crash.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
2018-03-07 Chris Dumez <cdumez@apple.com>
Get rid of custom bindings for History's replaceState() / pushState()
https://bugs.webkit.org/show_bug.cgi?id=183372
Reviewed by Youenn Fablet.
Get rid of custom bindings for History's replaceState() / pushState() by
moving the cached state from the wrapper to the History implementation
object.
No new tests, no web-facing behavior change.
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::state const):
(WebCore::JSHistory::visitAdditionalChildren):
* page/History.cpp:
(WebCore::History::cachedState):
(WebCore::History::stateObjectAdded):
* page/History.h:
(WebCore::History::pushState):
(WebCore::History::replaceState):
* page/History.idl:
2018-03-07 Youenn Fablet <youenn@apple.com>
Match unsupported plugins based on domains and not origin
https://bugs.webkit.org/show_bug.cgi?id=183384
Reviewed by Chris Dumez.
Move from an origin-keyed map to a vector of plugins.
We iterate through the vector and a match happens if the page host name ends with the provided matching domain.
This allows supporting rules for *.mydomain.com by passing 'mydomain.com'.
Covered by existing tests.
We are not testing subdomains like www.localhost since there is no support in our CI but this is tested through Unit tests.
* loader/EmptyClients.cpp:
* platform/URL.cpp:
(WebCore::URL::isMatchingDomain const):
* platform/URL.h:
* plugins/PluginData.h:
(WebCore::isSupportedPlugin):
(WebCore::SupportedPluginName::decode):
(WebCore::SupportedPluginName::encode const):
* plugins/PluginInfoProvider.h:
2017-12-18 Youenn Fablet <youenn@apple.com>
Update to libwebrtc revision 4e70a72571dd26b85c2385e9c618e343428df5d3
https://bugs.webkit.org/show_bug.cgi?id=180843
Reviewed by Eric Carlson.
Covered by existing tests.
Moving H264 codecs and factories to libwebrtc.
Updating LibWebRTCProvider according new libwebrtc API.
Updating ref counting according new libwebrtc API.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(WebCore::LibWebRTCMediaEndpoint::AddRef const):
(WebCore::LibWebRTCMediaEndpoint::Release const):
(WTF::LogArgument<webrtc::RTCStats>::toString):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnectionFactory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.cpp: Removed.
* platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Removed.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::ConvertToI420):
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
* testing/Internals.cpp:
(WebCore::Internals::setH264HardwareEncoderAllowed):
* testing/MockLibWebRTCPeerConnection.h:
2018-03-07 Sihui Liu <sihui_liu@apple.com>
replaceState cause back/forward malfunction on html page with <base href="/"> tag
https://bugs.webkit.org/show_bug.cgi?id=182678
<rdar://problem/37517821>
Reviewed by Chris Dumez.
replaceState should not change URL when the URL argument is NULL, but should change URL when the URL argument is an empty string.
Test: http/tests/history/replacestate-no-url.html
* page/History.cpp:
(WebCore::History::urlForState):
2018-03-07 Antti Koivisto <antti@apple.com>
Don't invalidate descendants for sibling combinators unless needed
https://bugs.webkit.org/show_bug.cgi?id=183410
<rdar://problem/38227297>
Reviewed by Zalan Bujtas.
If we know the matched sibling combinator doesn't affect descendants we shouldn't invalidate them.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively const):
Use different bit for the descendant case.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentMatchesTheRightmostElement):
Remove unneeded context assert.
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
Use different bit for the descendant case.
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPseudoElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
* dom/Element.cpp:
(WebCore::invalidateForSiblingCombinators):
Invalidate the target sibling or all descendants based on the bits.
* dom/Element.h:
(WebCore::Element::descendantsAffectedByPreviousSibling const):
(WebCore::Element::setDescendantsAffectedByPreviousSibling const):
* dom/Node.h:
* style/StyleRelations.cpp:
(WebCore::Style::commitRelationsToRenderStyle):
(WebCore::Style::commitRelations):
* style/StyleRelations.h:
Add DescendantsAffectedByPreviousSibling bit. AffectedByPreviousSibling is now just about the target element.
2018-03-07 Antti Koivisto <antti@apple.com>
checkForSiblingStyleChanges should use internal versions of the invalidation functions
https://bugs.webkit.org/show_bug.cgi?id=183405
<rdar://problem/38218310>
Reviewed by Zalan Bujtas.
Non-internal invalidateStyleForElement/Subtree() implement sibling combinator invalidation. Checking this
is only needed if the element in question changed somehow. In checkForSiblingStyleChanges we know that
another element changed and we really just want to invalidate.
* css/SelectorChecker.cpp:
(WebCore::isFirstOfType):
(WebCore::SelectorChecker::checkOne const):
Also make :first-of-type use ChildrenAffectedByForwardPositionalRules for invalidation similar to :last-of-type
for more correct invalidation.
* dom/Element.cpp:
(WebCore::checkForSiblingStyleChanges):
2018-03-07 Yusuke Suzuki <utatane.tea@gmail.com>
HTML `pattern` attribute should set `u` flag for regular expressions
https://bugs.webkit.org/show_bug.cgi?id=151598
Reviewed by Chris Dumez.
This patch attaches "u" flag to the RegExp compiled for HTML "pattern" attribute[1].
[1]: https://html.spec.whatwg.org/multipage/forms.html#the-pattern-attribute
* html/BaseTextInputType.cpp:
(WebCore::BaseTextInputType::patternMismatch const):
2018-03-07 Frederic Wang <fwang@igalia.com>
Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
https://bugs.webkit.org/show_bug.cgi?id=183081
Reviewed by Antonio Gomes.
The frames may be resized when the FrameFlattening option is modified and hence this patch
forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
bug 171667).
Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html
* page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or
FrameFlattening options is changed.
* page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().
(WebCore::SettingsBase::setNeedsRelayoutAllFrames): Make layout and preferred widths dirty
on all frames in the page and schedule a relayout.
* page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().
2018-03-07 Alejandro G. Castro <alex@igalia.com>
Make NetworkRTCResolver port agnostic
https://bugs.webkit.org/show_bug.cgi?id=178855
Reviewed by Youenn Fablet.
Add new API in the DNSResolveQueue allowing to revolve hostnames and get the result. Add platform
specific code for soup platform and refactor the other platforms. Added new API to the DNS API header
and move the general code to the DNS.cpp file, that way we can reuse that code in all the platforms
and leave the ResolveQueue class of the platforms in a file.
No new tests because this is a refactor.
* PlatformAppleWin.cmake: Move the DNSCFNet class to DNSResolveQueueCFNet.
* PlatformMac.cmake: Ditto.
* Sources.txt: Add the DNS.cpp for compilation.
* SourcesCocoa.txt: Move the DNSCFNet class to DNSResolveQueueCFNet.
* WebCore.xcodeproj/project.pbxproj: Move the DNSCFNet class to DNSResolveQueueCFNet, add the DNS.cpp
for compilation. Add the new DNSResolveQueueCFNet class.
* platform/Curl.cmake: Move the DNSCFNet class to DNSResolveQueueCurl.
* platform/network/DNS.cpp: Add this file with the default implementation of the DNS functions for
all the platforms.
(WebCore::prefetchDNS): Copied from every platform implementation.
(WebCore::resolveDNS): Add the function, resolves a hostname, receives the identifier of the operation
and the completion handler.
(WebCore::stopResolveDNS): Add the function, stops a resolution operation, receives the identifier
of the operation.
* platform/network/DNS.h: Add the new APIs resolveDNS and stopResolveDNS with the classes used for the
implementation.
(WebCore::IPAddress::IPAddress): Add this class used to send the resolved address information, it does
not depend on libwebrtc rtc classes.
(WebCore::IPAddress::get): Get a reference to the struct sockaddr_in in the IPAddress class.
(WebCore::DNSCompletionHandler): Add this CompletionHandler type to be used when resolving the DNS
address.
* platform/network/DNSResolveQueue.cpp: Add the DNSResolveQueue platform instantiation in the singleton.
(WebCore::DNSResolveQueue::singleton): Use DNSResolveQueue platform classes when creating the singleton..
(WebCore::DNSResolveQueue::resolve): Add this method to get the address of a hostname, it sends the
identifier and the completion handler to use when returning the result.
(WebCore::DNSResolveQueue::stopResolve): Add this method to stop the resolve operation when required.
* platform/network/DNSResolveQueue.h: Add the new methods and make the class abstract, so that every
platform can implement the functions.
* platform/network/cf/DNSResolveQueueCFNet.cpp: Renamed from Source/WebCore/platform/network/cf/DNSCFNet.cpp.
Add the methods to the new class DNSResolveQueueCFNet, move the prefetchDNS to the DNS.cpp general
implementation.
* platform/network/cf/DNSResolveQueueCFNet.h: Add the new class inheriting from the DNSResolveQueue. Add the
new methods, we have to implement these methods and move the NetworkRTCResolver for COCOA code here.
(WebCore::DNSResolveQueueCF::resolve): Dummy method, not implemented.
(WebCore::DNSResolveQueueCF::stopResolve): Ditto.
* platform/network/curl/DNSResolveQueueCurl.cpp: Renamed from Source/WebCore/platform/network/curl/DNSCurl.cpp.
* platform/network/curl/DNSResolveQueueCurl.h: Add the new class inheriting from the DNSResolveQueue.
(WebCore::DNSResolveQueueCurl::resolve): Ditto.
(WebCore::DNSResolveQueueCurl::stopResolve): Ditto.
* platform/network/soup/DNSResolveQueueSoup.h: New class inheriting from the DNSResolveQueue class, adding
a HasMap with the active operations, it allows stopping them.
* platform/network/soup/DNSResolveQueueSoup.cpp: Renamed from Source/WebCore/platform/network/curl/DNSSoup.cpp.
(WebCore::resolvedWithObserverCallback): Called when the result address from the soup platform is ready,
sends the address to the completion handler.
(WebCore::DNSResolveQueueSoup::resolve): Launch the resolve operation with the soup library.
(WebCore::DNSResolveQueueSoup::stopResolve): Stop the resolve operation on process with a GCancellable.
2018-03-06 Brian Burg <bburg@apple.com>
[Cocoa] Stop copying ForwardingHeaders directory that no longer exists
https://bugs.webkit.org/show_bug.cgi?id=183396
Reviewed by Dan Bernstein.
* WebCore.xcodeproj/project.pbxproj:
Rename the phase to "Copy ICU Headers". ForwardingHeaders are no longer a thing.
2018-03-06 Youenn Fablet <youenn@apple.com>
didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change
https://bugs.webkit.org/show_bug.cgi?id=183299
<rdar://problem/37547029>
Reviewed by Alex Christensen.
In case of redirection with service worker registration change, we cancel the load and create a new one.
This prevent ResourceLoader::willSendRequestInternal to call the didReceiveServerRedirectForProvisionalNavigation
callback. We thus explictly call this callback after restarting the load with the new service worker step.
We only call this callback if the main resource is there as we do not want to call it if it was blocked by content extension.
Test: http/wpt/service-workers/navigation-redirect-main-frame.https.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
2018-03-06 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Remove unnecessary copied ResourceRequest member variable.
https://bugs.webkit.org/show_bug.cgi?id=183010
Reviewed by Youenn Fablet.
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::resourceRequest const):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::addCacheValidationHeaders):
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
2018-03-06 Nan Wang <n_wang@apple.com>
AX: Flaky test after r229310
https://bugs.webkit.org/show_bug.cgi?id=183376
<rdar://problem/38188685>
Reviewed by Chris Fleizach.
The test that forces the context menu to show sometimes locks up
the test runner. Also, we missed a case where calling AXShowMenu
action on a combobox is not dispatching the accessibility event.
Using the combobox example to test the event dispatching in order to
avoid the test hang.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2018-03-06 Chris Dumez <cdumez@apple.com>
fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183345
Reviewed by Alex Christensen.
FrameLoader::loadURL() was calling loadWithNavigationAction() and then resetting the
m_quickRedirectComing flag right after. This works if the navigation policy decision
triggered by loadWithNavigationAction() is made synchronously. However, when it is
made asynchronously, the flag gets reset too early, before the policy decision
handler has been called. This is an issue because the policy decision handler
relies on the m_quickRedirectComing flag.
Similarly, FrameLoader::loadFrameRequest() was calling loadPostRequest() / loadURL()
and then focusing a frame right after. This does not work as intended when the navigation
policy decision is made asynchronously.
To address the issue, we now pass a completion handler that gets called when the operation
has actually completion, after the policy decision has been made. This maintains the
behavior in place with synchronous policy delegates.
Test: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegates.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
2018-03-06 Antoine Quint <graouts@apple.com>
[Web Animations] Add a new CSSTransition subclass of WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=183373
<rdar://problem/38181985>
Reviewed by Dean Jackson.
Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
upon identifying that a new CSS Animation has been added to an element.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSTransition.cpp: Added.
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::CSSTransition):
* animation/CSSTransition.h: Added.
* animation/CSSTransition.idl: Added.
* animation/KeyframeEffect.cpp:
* animation/WebAnimation.h:
(WebCore::WebAnimation::isCSSTransition const):
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/WebCoreBuiltinNames.h:
2018-03-06 Megan Gardner <megan_gardner@apple.com>
Ensure system appearance is default for web content
https://bugs.webkit.org/show_bug.cgi?id=183354
<rdar://problem/36975571>
<rdar://problem/38162381>
Make sure the the system appearance for web content is default, and
consolidate that code to a single class.
Reviewed by Tim Horton.
Not currently testable, will add tests in a future patch.
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/LocalDefaultSystemAppearance.h: Added.
* platform/mac/LocalDefaultSystemAppearance.mm: Added.
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.mm:
(-[WebCoreThemeView init]):
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
2018-03-06 Antoine Quint <graouts@apple.com>
[Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
https://bugs.webkit.org/show_bug.cgi?id=183370
<rdar://problem/38180729>
Reviewed by Dean Jackson.
Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
default while we bring this feature up.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
(WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
2018-03-06 Daniel Bates <dabates@apple.com>
Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements
in TextureCacheCV.h
Rubber-stamped by Tim Horton.
* platform/graphics/cv/TextureCacheCV.h:
2018-03-06 Antti Koivisto <antti@apple.com>
Cache hasComplexSelectorsForStyleAttribute bit
https://bugs.webkit.org/show_bug.cgi?id=183363
Reviewed by Andreas Kling.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::hasComplexSelectorsForStyleAttribute const):
Cache the bit to avoid hash lookups.
* css/DocumentRuleSets.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::invalidateStyleAttribute):
(WebCore::shouldSynchronizeStyleAttributeImmediatelyForInvalidation): Deleted.
Move code to DocumentRuleSets.
2018-03-06 Myles C. Maxfield <mmaxfield@apple.com>
Change the type of SVGToOTFFontConverter::m_weight to be not a char
https://bugs.webkit.org/show_bug.cgi?id=183339
Reviewed by Alex Christensen.
No new tests because there is no behavior change.
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendOS2Table):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2018-03-06 Antoine Quint <graouts@apple.com>
[Web Animations] Add a new CSSAnimation subclass of WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=183371
<rdar://problem/38181724>
Reviewed by Dean Jackson.
Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
upon identifying that a new CSS Animation has been added to an element.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSAnimation.cpp: Added.
(WebCore::CSSAnimation::create):
(WebCore::CSSAnimation::CSSAnimation):
* animation/CSSAnimation.h: Added.
* animation/CSSAnimation.idl: Added.
* animation/KeyframeEffectReadOnly.cpp
* animation/WebAnimation.h:
(WebCore::WebAnimation::isCSSAnimation const):
* animation/WebAnimation.idl:
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:
2018-03-06 Ms2ger <Ms2ger@igalia.com>
Explicitly qualify some method calls on this in lambdas in Service Worker code.
https://bugs.webkit.org/show_bug.cgi?id=183367
Reviewed by Chris Dumez.
No new tests -- no change in behavior.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::matchAll):
2018-03-06 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
https://bugs.webkit.org/show_bug.cgi?id=183340
Reviewed by Michael Catanzaro.
TextureMapperLayer::scrollBy() method is completely unused and can be
removed. This opens the gates on removing majority of scrolling-related
code in TextureMapperLayer, CoordinatedGraphicsLayer and
CoordinatedGraphicsScene classes, along with smaller bits in other
closely-associated classes.
We're able to remove two virtual method overrides in the
ScrollingCoordinatorCoordinatedGraphics class.
TextureMapperLayer can drop the ScrollingClient member variable, along
with multiple others. Various unused methods in that class are removed
as well.
CoordinatedGraphicsLayer and GraphicsLayerTextureMapper can both remove
the custom scrolling state tracking.
No new tests -- no change in behavior.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea): Deleted.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::didCommitScrollOffset): Deleted.
(WebCore::GraphicsLayerTextureMapper::setIsScrollable): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::hitTest): Deleted.
(WebCore::TextureMapperLayer::scrollableLayerHitTestCondition): Deleted.
(WebCore::TextureMapperLayer::findScrollableContentsLayerAt): Deleted.
(WebCore::TextureMapperLayer::mapScrollOffset): Deleted.
(WebCore::TextureMapperLayer::commitScrollOffset): Deleted.
(WebCore::TextureMapperLayer::scrollBy): Deleted.
(WebCore::TextureMapperLayer::didCommitScrollOffset): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::resetLayerState):
(WebCore::CoordinatedGraphicsLayer::setScrollableArea): Deleted.
(WebCore::CoordinatedGraphicsLayer::commitScrollOffset): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2018-03-06 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
https://bugs.webkit.org/show_bug.cgi?id=183360
Reviewed by Sergio Villar Senin.
When animations are being applied on the TextureMapperLayer tree, the
monotonic time value is retrieved repeatedly in TextureMapperAnimation
class. Instead of spawning repeated syscalls that are required to obtain
the time value, TextureMapperLayer::applyAnimationsRecursively() now
accepts a MonotonicTime value that should be used for all animation
updates.
No new tests -- no change in behavior.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::computeTotalRunningTime):
(WebCore::TextureMapperAnimations::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
(WebCore::TextureMapperAnimation::keyframes const):
(WebCore::TextureMapperAnimation::animation const):
(WebCore::TextureMapperAnimation::boxSize const): Deleted.
(WebCore::TextureMapperAnimation::listsMatch const): Deleted.
(WebCore::TextureMapperAnimation::startTime const): Deleted.
(WebCore::TextureMapperAnimation::pauseTime const): Deleted.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::applyAnimationsRecursively):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/TextureMapperLayer.h:
2018-03-06 Zan Dobersek <zdobersek@igalia.com>
[CoordGraphics] Clean up CoordinatedImageBacking
https://bugs.webkit.org/show_bug.cgi?id=183332
Reviewed by Carlos Garcia Campos.
Clean up the CoordinatedImageBacking class. Prefer reference values in
class functions, methods and member variables, where possible. Move
member variables into a more sensible order. Initialize a few member
variables at the place of declaration.
Drop releaseSurfaceIfNeeded() and updateVisibilityIfNeeded() methods,
integrating them into the update() method, which was the only place
where they were called from.
We don't have to keep a reference to the buffer object, since we're
not using it internally after it's been passed to the client's
updateImageBacking() implementation.
No new tests -- no change in behavior.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::syncImageBacking):
(WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
(WebCore::CoordinatedImageBacking::getCoordinatedImageBackingID):
(WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
(WebCore::CoordinatedImageBacking::addHost):
(WebCore::CoordinatedImageBacking::removeHost):
(WebCore::CoordinatedImageBacking::update):
(WebCore::CoordinatedImageBacking::clearContentsTimerFired):
(WebCore::CoordinatedImageBacking::create): Deleted.
(WebCore::CoordinatedImageBacking::markDirty): Deleted.
(WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded): Deleted.
(WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
2018-03-06 Zan Dobersek <zdobersek@igalia.com>
GraphicsLayerTextureMapper: remove the setAnimations() method
https://bugs.webkit.org/show_bug.cgi?id=183358
Reviewed by Carlos Garcia Campos.
Remove the GraphicsLayerTextureMapper::setAnimations() method. This was
not called from anywhere, and is not the way animations are generated
for a given GraphicsLayer object (that would be addAnimation() method).
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setAnimations): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2018-03-06 Nan Wang <n_wang@apple.com>
AX: AOM: More accessibility events support
https://bugs.webkit.org/show_bug.cgi?id=183023
<rdar://problem/37764380>
Reviewed by Chris Fleizach.
Accessibility events.
Spec: https://wicg.github.io/aom/spec/phase2.html
This change adds support for these new events:
accessiblecontextmenu
accessibledecrement
accessibledismiss
accessiblefocus
accessibleincrement
accessiblescrollintoview
accessibleselect
Note: The show context menu action is only supported on macOS now.
The dismiss action is not implemented for all the platforms yet.
Test: accessibility/mac/AOM-events-all.html
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::setSelected):
* accessibility/AccessibilityMediaObject.cpp:
(WebCore::AccessibilityMediaObject::increment):
(WebCore::AccessibilityMediaObject::decrement):
* accessibility/AccessibilityMenuListOption.cpp:
(WebCore::AccessibilityMenuListOption::setSelected):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::increment):
(WebCore::AccessibilityNodeObject::decrement):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
(WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
(WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const):
(WebCore::AccessibilityObject::scrollToMakeVisible const):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent): Deleted.
(WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setFocused):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
* dom/Element.idl:
* dom/EventNames.h:
2018-03-05 Yusuke Suzuki <utatane.tea@gmail.com>
Fix std::make_unique / new[] using system malloc
https://bugs.webkit.org/show_bug.cgi?id=182975
Reviewed by JF Bastien.
Use Vector, FAST_ALLOCATED, or UniqueArray instead.
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::setBuffer):
* Modules/webaudio/AudioBufferSourceNode.h:
* css/StyleRule.h:
* cssjit/CompiledSelector.h:
* html/HTMLFrameSetElement.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::LRUImageBufferCache):
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::bubbleToFront):
* html/canvas/WebGLRenderingContextBase.h:
* platform/Length.cpp:
(WebCore::newCoordsArray):
(WebCore::newLengthArray):
(): Deleted.
* platform/Length.h:
* platform/audio/DynamicsCompressor.cpp:
(WebCore::DynamicsCompressor::setNumberOfChannels):
* platform/audio/DynamicsCompressor.h:
* platform/audio/FFTFrame.h:
* platform/audio/gstreamer/FFTFrameGStreamer.cpp:
(WebCore::FFTFrame::FFTFrame):
* platform/graphics/FormatConverter.h:
(WebCore::FormatConverter::FormatConverter):
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::texImage2DResourceSafe):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::getDirtyRects):
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::flipImageSurfaceVertically):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/gpu/Texture.cpp:
(WebCore::Texture::updateSubRect):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::getActiveAttribImpl):
(WebCore::GraphicsContext3D::getActiveUniformImpl):
(WebCore::GraphicsContext3D::getProgramInfoLog):
(WebCore::GraphicsContext3D::getShaderInfoLog):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::getShaderLog):
(WebCore::getProgramLog):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::putData):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::PNGImageReader):
(WebCore::PNGImageReader::close):
(WebCore::PNGImageReader::interlaceBuffer const):
(WebCore::PNGImageReader::createInterlaceBuffer):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decodeFrame):
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::SocketData::SocketData):
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::createCopy):
(WebCore::SocketStreamHandleImpl::readData):
(): Deleted.
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::connected):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
2018-03-05 Yoav Weiss <yoav@yoav.ws>
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657
Reviewed by Darin Adler.
Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.
Test: http/tests/preconnect/link-header-rel-preconnect-http.php
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
(WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
* loader/LinkLoader.h:
2018-03-05 Antti Koivisto <antti@apple.com>
Add ChildrenAffectedByForwardPositionalRules bit for nth-child pseudo class marking
https://bugs.webkit.org/show_bug.cgi?id=183341
<rdar://problem/38151470>
Reviewed by Zalan Bujtas.
Use it instead of AffectsNextSibling/AffectedByPreviousSibling bits, similar to ChildrenAffectedByBackwardPositionalRules bit.
This is more efficient and requires way less marking.
* css/SelectorChecker.cpp:
(WebCore::countElementsBefore):
(WebCore::countElementsOfTypeBefore):
(WebCore::SelectorChecker::checkOne const):
Mark with ChildrenAffectedByForwardPositionalRules.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
Mark with ChildrenAffectedByForwardPositionalRules.
* dom/Element.cpp:
(WebCore::checkForSiblingStyleChanges):
Invalidate siblings after added/removed element.
(WebCore::Element::setChildrenAffectedByForwardPositionalRules):
(WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
(WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules const):
Add the new marking bit.
* dom/Element.h:
(WebCore::Element::childrenAffectedByForwardPositionalRules const):
(WebCore::Element::attributeWithoutSynchronization const):
Remove assert so we can use this to get the current unresolved lazy value of style attrbute.
* dom/ElementRareData.h:
(WebCore::ElementRareData::childrenAffectedByForwardPositionalRules const):
(WebCore::ElementRareData::setChildrenAffectedByForwardPositionalRules):
(WebCore::ElementRareData::ElementRareData):
(WebCore::ElementRareData::resetStyleRelations):
Add the new marking bit.
* dom/StyledElement.cpp:
(WebCore::StyledElement::invalidateStyleAttribute):
In special case where we have attribute selectors for style attribute, synchronize the attribute immediately so we get invalidation right.
Tested by fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
* style/StyleRelations.cpp:
(WebCore::Style::commitRelationsToRenderStyle):
(WebCore::Style::commitRelations):
Commit the new bit.
* style/StyleRelations.h:
2018-03-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed build fix, remove unused variables.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSpeakAs):
(WebCore::consumeHangingPunctuation):
2018-03-05 Chris Dumez <cdumez@apple.com>
fast/loader/onload-policy-ignore-for-frame.html is timing out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183337
Reviewed by Ryosuke Niwa.
Make sure we call checkCompleted() before calling checkLoadComplete() in
FrameLoader::continueLoadAfterNavigationPolicy() when the client tells us
to ignore the navigation, so that we properly recognize that the load is
done. This matches what is already done in FrameLoader::receivedMainResourceError().
Test: fast/loader/onload-policy-ignore-for-frame-async-delegates.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2018-03-05 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Allow user-installed fonts to be disabled
https://bugs.webkit.org/show_bug.cgi?id=183349
Rubber stamped by Brent Fulgham.
Tests: fast/text/user-installed-font.html
fast/text/user-installed-fonts/disable.html
fast/text/user-installed-fonts/shadow-disable.html
fast/text/user-installed-fonts/shadow-family-disable.html
fast/text/user-installed-fonts/shadow-family.html
fast/text/user-installed-fonts/shadow-postscript-disable.html
fast/text/user-installed-fonts/shadow-postscript-family-disable.html
fast/text/user-installed-fonts/shadow-postscript-family.html
fast/text/user-installed-fonts/shadow-postscript.html
fast/text/user-installed-fonts/shadow.html
fast/text/user-installed-fonts/system-ui.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
2018-03-05 Myles C. Maxfield <mmaxfield@apple.com>
Silence OpenGL and OpenGL ES deprecation warnings in newer SDKs
https://bugs.webkit.org/show_bug.cgi?id=183350
Unreviewed.
* Configurations/WebCore.xcconfig:
2018-03-05 Andy Estes <aestes@apple.com>
[Mac] Teach WebCore::Pasteboard about file promise drags
https://bugs.webkit.org/show_bug.cgi?id=183314
<rdar://problem/38105493>
Reviewed by Darin Adler.
While WebKit does support receiving file promise drags (since r210360), WebCore::Pasteboard
has not been instructed on how to read their file paths. When the various pasteboard readers
ask for file paths after a file promise drop, they receive an empty vector. This impacts
various features, most notably the DataTransfer API.
Pasteboard actually cannot learn about promised file paths from the pasteboard itself, as
the pasteboard only contains the dragged files' UTIs. Promised file paths aren't known until
the WebKits call -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...], at which
point the file paths are passed to WebCore as part of WebCore::DragData.
When we construct new Pasteboards for drag and drop, we need to store any promised file
paths from the DragData. Then, when the various pasteboard readers ask for file paths and
NSFilesPromisePboardType is on the pasteboard, we can return these promised file paths.
Tests: editing/pasteboard/data-transfer-items-drag-drop-file-promise.html
editing/pasteboard/data-transfer-items-drop-file-promise.html
editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html
editing/pasteboard/datatransfer-types-dropping-text-file-promise.html
editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html
editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html
editing/pasteboard/file-input-files-access-promise.html
* platform/FileSystem.h:
* platform/Pasteboard.h:
(WebCore::Pasteboard::Pasteboard):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsPromise const):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::toString):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readFilePaths):
(WebCore::absoluteURLsFromPasteboardFilenames): Deleted.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::numberOfFiles const):
2018-03-05 Andy Estes <aestes@apple.com>
[Mac] Fix the build
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate): Removed unused variables.
2018-03-05 Antti Koivisto <antti@apple.com>
Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors
https://bugs.webkit.org/show_bug.cgi?id=183325
<rdar://problem/38134480>
Reviewed by Zalan Bujtas.
It is sufficient to invalidate siblings before the mutation point.
* dom/Element.cpp:
(WebCore::checkForSiblingStyleChanges):
We already do sibling walk in the case of forwards positional rules and sibling combinators. The work
done here is insignifant compared to cost of overinvalidating.
2018-03-05 Ali Juma <ajuma@chromium.org>
imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html times out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183297
Reviewed by Chris Dumez.
When a FrameLoader's policy document loader is cleared after receiving a navigation policy decision
to not continue loading, we still need to trigger a check for load completion, since this loader or
an ancestor loader may have been in state isLoadingInAPISense only because of the existence of
the just-cleared policy document loader. Without triggering this check, these loaders may never
call WebFrameLoaderClient::dispatchDidFinishLoad.
Test: http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2018-03-04 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
https://bugs.webkit.org/show_bug.cgi?id=183312
Reviewed by Mark Lam.
Remove wtf/CurrentTime.h include pragma.
* Modules/geolocation/Geolocation.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/speech/SpeechSynthesis.cpp:
* contentextensions/ContentExtensionCompiler.cpp:
* contentextensions/ContentExtensionParser.cpp:
* dom/Document.cpp:
* dom/Element.cpp:
* dom/Event.cpp:
* dom/ScriptedAnimationController.cpp:
* dom/SimulatedClick.cpp:
* fileapi/File.cpp:
* fileapi/FileReader.cpp:
* history/CachedPage.cpp:
* html/BaseDateAndTimeInputType.cpp:
* html/DateTimeInputType.cpp:
* html/HTMLMediaElement.cpp:
* html/MediaController.cpp:
* html/MediaElementSession.cpp:
* html/MonthInputType.cpp:
* html/TimeInputType.cpp:
* html/parser/HTMLParserScheduler.h:
* inspector/InspectorCanvas.cpp:
* loader/FrameLoader.cpp:
* loader/LoadTiming.cpp:
* loader/NavigationScheduler.cpp:
* loader/ProgressTracker.cpp:
* loader/cache/CachedCSSStyleSheet.cpp:
* loader/cache/CachedImage.cpp:
* loader/cache/CachedResource.cpp:
* loader/cache/MemoryCache.cpp:
* page/DOMTimer.cpp:
* page/DOMWindow.cpp:
* page/DragController.cpp:
* page/EventHandler.cpp:
* page/FocusController.cpp:
* page/FrameView.cpp:
* page/Page.cpp:
* page/Performance.cpp:
* page/PerformanceTiming.cpp:
* page/animation/AnimationBase.cpp:
* page/animation/CSSAnimationController.cpp:
* page/mac/WheelEventDeltaFilterMac.mm:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
* platform/ScrollAnimationKinetic.cpp:
* platform/ScrollAnimationSmooth.cpp:
* platform/ThreadTimers.cpp:
* platform/Timer.cpp:
* platform/audio/mac/AudioSampleDataSource.mm:
* platform/cocoa/ScrollController.mm:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/gamepad/mac/HIDGamepad.cpp:
* platform/graphics/BitmapImage.cpp:
* platform/graphics/DisplayRefreshMonitorManager.cpp:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/LayerPool.cpp:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
* platform/graphics/texmap/TextureMapper.cpp:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
* platform/gtk/ScrollAnimatorGtk.cpp:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/ScrollViewIOS.mm:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
* platform/mock/MockRealtimeMediaSource.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
* platform/network/CacheValidation.cpp:
* platform/network/DNSResolveQueue.cpp:
* platform/network/ResourceResponseBase.cpp:
* platform/network/curl/CurlCacheEntry.cpp:
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/text/TextEncodingRegistry.cpp:
* platform/text/win/LocaleWin.cpp:
* platform/win/MainThreadSharedTimerWin.cpp:
* platform/win/PlatformMouseEventWin.cpp:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderProgress.cpp:
* svg/animation/SMILTimeContainer.cpp:
* testing/MockGamepad.cpp:
* workers/WorkerRunLoop.cpp:
2018-03-04 Tim Horton <timothy_horton@apple.com>
Make !ENABLE(DATA_DETECTION) iOS build actually succeed
https://bugs.webkit.org/show_bug.cgi?id=183283
<rdar://problem/38062148>
Reviewed by Sam Weinig.
* Configurations/FeatureDefines.xcconfig:
2018-03-03 Said Abou-Hallawa <sabouhallawa@apple.com>
Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
https://bugs.webkit.org/show_bug.cgi?id=183165
Reviewed by Darin Adler.
Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
in MathExtras.h while the rest were directed to this local static function.
There should not be two versions with the same name while they are supposed
to do the same thing. Besides, the local version does not work correctly
if the type of the argument's max limit is less the max limit of the returned
type, e.g. char -> uint16_t.
* svg/SVGToOTFFontConversion.cpp:
(WebCore::clampTo): Deleted.
2018-03-03 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=183273
<rdar://problem/38054892>
Reviewed by Antti Koivisto.
Covered by existing tests.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
* rendering/RenderElement.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
2018-03-03 Yoav Weiss <yoav@yoav.ws>
Link headers for subresources are not being processes
https://bugs.webkit.org/show_bug.cgi?id=181789
Reviewed by Youenn Fablet.
Triggers Link header processing when the Link headers arrive on a subresource.
Test: http/tests/preload/link-header-on-subresource.html
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Change the media check conditions.
* loader/LinkLoader.h: Add a third state for media checks.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Preload links from headers for subresources.
2018-03-02 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
https://bugs.webkit.org/show_bug.cgi?id=183293
Reviewed by Alex Christensen.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2018-03-02 Dean Jackson <dino@apple.com>
Remove NP_GLContext since it is unsupported
https://bugs.webkit.org/show_bug.cgi?id=183305
<rdar://problem/36875555>
Reviewed by Simon Fraser.
* plugins/npapi.h: Remove NP_GLContext and mention that
it is not supported.
2018-03-02 Chris Dumez <cdumez@apple.com>
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html crashes with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183294
<rdar://problem/38073596>
Reviewed by Youenn Fablet.
Drop code that was added to SubresourceLoader::willCancel() in r228852. The purpose of this code
was to make sure that SubresourceLoader::m_policyForResponseCompletionHandler always gets called,
even when the load is cancelled. However, this code is not needed (since m_policyForResponseCompletionHandler
is a CompletionHandler, an assertion will be hit if we fail to call it and we'll know). Calling
the completionHandler inside SubresourceLoader::willCancel() is too early and leads to crashes.
The completionHandler currently gets called DocumentLoader::responseReceived() via a call to
mainResourceLoader->didReceiveResponsePolicy(). Note that in r229177, we made sure that the
call to didReceiveResponsePolicy() happens *after* the call to continueAfterContentPolicy()
to maintain our non-async policy delegate behavior. However, continueAfterContentPolicy()
would end up calling willCancel() and call the completionHandler when shouldContinue was
false.
Test: http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willCancel):
2018-03-02 Tim Horton <timothy_horton@apple.com>
Fix the build after r229185 and r229184
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/ios/DeviceOrientationClientIOS.h:
* platform/ios/DeviceOrientationClientIOS.mm:
2018-03-02 Tim Horton <timothy_horton@apple.com>
Make the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
https://bugs.webkit.org/show_bug.cgi?id=183296
Reviewed by Dan Bernstein.
* platform/ios/DeviceMotionClientIOS.h:
* platform/ios/DeviceMotionClientIOS.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebCoreMotionManager.mm:
2018-03-02 Tim Horton <timothy_horton@apple.com>
Make it possible to build for iOS without Celestial
https://bugs.webkit.org/show_bug.cgi?id=183295
<rdar://problem/38074468>
Reviewed by Dan Bernstein.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
2018-03-02 Youenn Fablet <youenn@apple.com>
Clients should register to StorageProcess with their service worker registration identifier
https://bugs.webkit.org/show_bug.cgi?id=182313
<rdar://problem/38044403>
Reviewed by Chris Dumez.
Relanding with fixing matchAll for uncontrolled clients.
No observable change of behavior in regular conditions.
When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
and we will not be able to retrieve the registration from these identifiers.
The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
* dom/Document.cpp:
(WebCore::Document::setServiceWorkerConnection):
* workers/service/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::matchAll):
(WebCore::SWServer::claim):
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::setClientActiveWorker): Deleted.
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::activate):
2018-03-02 Youenn Fablet <youenn@apple.com>
Loads for a Document controlled by a Service Worker should not use AppCache
https://bugs.webkit.org/show_bug.cgi?id=183148
Reviewed by Chris Dumez.
Covered by updated test.
Postponing document loading through app cache after matching service worker registration.
Trying to load through app cache only if there is no service worker registration.
Disabling app cache for any load that has a service worker registration identifier.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
(WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
(WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
(WebCore::DocumentLoader::scheduleSubstituteResourceLoad):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadMainResource):
(WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
* loader/appcache/ApplicationCacheHost.h:
2018-03-02 Chris Dumez <cdumez@apple.com>
fast/events/before-unload-remove-itself.html crashes with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183290
<rdar://problem/38069045>
Reviewed by Alex Christensen.
When the navigation policy happens asynchronously, it is now possible for the
Frame / FrameLoader to get destroyed between the point that policyChecker().checkNavigationPolicy()
is called and when continueLoadAfterNavigationPolicy() is called.
To address the issue, we now protect the Frame and capture it in the lambda passed
to policyChecker().checkNavigationPolicy().
Test: fast/events/before-unload-remove-itself-async-delegate.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
2018-03-02 Chris Dumez <cdumez@apple.com>
Converting a load to a download does not work with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183254
<rdar://problem/38035334>
Reviewed by Youenn Fablet.
Update DocumentLoader::responseReceived() to call didReceiveResponsePolicy()
on the mainResourceLoader *after* calling continueAfterContentPolicy(),
not *before*. This makes sure that the WebResourceLoader sends the
NetworkResourceLoader::ContinueDidReceiveResponse IPC back to the Network
Process *after* the policy decision has been processed, which restores the
pre-r228852 order.
Test: fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
2018-03-02 Youenn Fablet <youenn@apple.com>
Some RealtimeMediaSource methods do not need to be marked as virtual
https://bugs.webkit.org/show_bug.cgi?id=183272
Reviewed by Eric Carlson.
No change of behavior.
* platform/mediastream/RealtimeMediaSource.h:
2018-03-01 Yusuke Suzuki <utatane.tea@gmail.com>
Remove monotonicallyIncreasingTime
https://bugs.webkit.org/show_bug.cgi?id=182911
Reviewed by Michael Catanzaro.
While generic code uses MonotonicTime, CAAnimation uses media time (CFTimeInterval).
At this boundary, we convert MonotonicTime to media time, this is the same logic to
the code before this patch.
* Modules/gamepad/Gamepad.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::monitorBufferingRate):
* Modules/mediasource/SourceBuffer.h:
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::startSpeakingImmediately):
(WebCore::SpeechSynthesis::fireEvent):
* Modules/speech/SpeechSynthesisUtterance.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::parseRuleList):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
* dom/Element.cpp:
(WebCore::Element::setActive):
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::hasExpired const):
* history/CachedPage.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::startProgressEventTimer):
(WebCore::HTMLMediaElement::progressEventTimerFired):
(WebCore::HTMLMediaElement::refreshCachedTime const):
(WebCore::HTMLMediaElement::invalidateCachedTime const):
(WebCore::HTMLMediaElement::currentMediaTime const):
(WebCore::HTMLMediaElement::startPlaybackProgressTimer):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::mostRecentUserInteractionTime const):
(WebCore::MediaElementSession::resetPlaybackSessionState):
* html/MediaElementSession.h:
* html/parser/HTMLParserScheduler.cpp:
(WebCore::PumpSession::PumpSession):
(WebCore::HTMLParserScheduler::HTMLParserScheduler):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::checkForYield):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::finalizeFrame):
* inspector/InspectorCanvas.h:
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::startTracking):
(WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
(WebCore::InspectorMemoryAgent::collectSample):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::timestamp):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::timestamp):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::timestamp):
* inspector/agents/WebHeapAgent.cpp:
(WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
* inspector/agents/WebHeapAgent.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didDraw):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAccessDecodedData):
* loader/cache/CachedResource.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
* page/EventHandler.cpp:
(WebCore::MaximumDurationTracker::MaximumDurationTracker):
(WebCore::MaximumDurationTracker::~MaximumDurationTracker):
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedElement):
(WebCore::FocusController::timeSinceFocusWasSet const):
* page/FocusController.h:
* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
* page/FrameView.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::freezeAtTime):
(WebCore::AnimationBase::beginAnimationUpdateTime const):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::onAnimationStartResponse):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::startTimeResponse):
(WebCore::CSSAnimationController::notifyAnimationStarted):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* page/mac/WheelEventDeltaFilterMac.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
(WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
* platform/ControlStates.h:
(WebCore::ControlStates::timeSinceControlWasFocused const):
(WebCore::ControlStates::setTimeSinceControlWasFocused):
* platform/PlatformSpeechSynthesisUtterance.h:
(WebCore::PlatformSpeechSynthesisUtterance::startTime const):
(WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
* platform/gamepad/PlatformGamepad.h:
(WebCore::PlatformGamepad::lastUpdateTime const):
(WebCore::PlatformGamepad::connectTime const):
(WebCore::PlatformGamepad::PlatformGamepad):
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
(WebCore::GameControllerGamepad::setupAsGamepad):
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::HIDGamepad):
(WebCore::HIDGamepad::valueChanged):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::suspendAnimations):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::notifyAnimationStarted):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerAnimationStarted):
(WebCore::AVFWrapper::createImageForTimeInRect):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::pauseAnimation):
(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
(WebCore::GraphicsLayerCA::setAnimationOnLayer):
(WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
(WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::LayerPool):
(WebCore::LayerPool::addLayer):
(WebCore::LayerPool::decayedCapacity const):
(WebCore::LayerPool::pruneTimerFired):
* platform/graphics/ca/LayerPool.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::startedNewCohort):
(WebCore::TileGrid::TileCohortInfo::timeUntilExpiration):
(WebCore::TileGrid::cohortRemovalTimerFired):
* platform/graphics/ca/TileGrid.h:
(WebCore::TileGrid::TileCohortInfo::TileCohortInfo):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(mediaTimeToCurrentTime):
(-[WebAnimationDelegate animationDidStart:]):
(PlatformCALayerCocoa::animationStarted):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::animationStarted):
(PlatformCALayerWin::layerTreeAsString const):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::decodeSample):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/BitmapTexturePool.h:
(WebCore::BitmapTexturePool::Entry::markIsInUse):
(WebCore::BitmapTexturePool::Entry::canBeReleased const):
(): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::addAnimation):
(WebCore::GraphicsLayerTextureMapper::pauseAnimation):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::TextureMapperAnimation):
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::pause):
(WebCore::TextureMapperAnimation::resume):
(WebCore::TextureMapperAnimation::computeTotalRunningTime):
(WebCore::TextureMapperAnimations::pause):
(WebCore::TextureMapperAnimations::suspend):
* platform/graphics/texmap/TextureMapperAnimation.h:
(WebCore::TextureMapperAnimation::startTime const):
(WebCore::TextureMapperAnimation::pauseTime const):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
(WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
* platform/graphics/texmap/TextureMapperFPSCounter.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::markUsed):
(WebCore::TextureMapperPlatformLayerBuffer::lastUsedTime const):
(): Deleted.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):
(WebCore::CoordinatedGraphicsLayer::pauseAnimation):
(WebCore::CoordinatedGraphicsLayer::suspendAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
(WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::elapsedTime):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
(WebCore::MockRealtimeAudioSource::stopProducingData):
(WebCore::MockRealtimeAudioSource::elapsedTime):
(WebCore::MockRealtimeAudioSource::tick):
(WebCore::MockRealtimeAudioSource::delaySamples):
* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::render):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startProducingData):
(WebCore::MockRealtimeVideoSource::stopProducingData):
(WebCore::MockRealtimeVideoSource::elapsedTime):
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::delaySamples):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
* platform/network/DNSResolveQueue.cpp:
(WebCore::DNSResolveQueue::DNSResolveQueue):
(WebCore::DNSResolveQueue::isUsingProxy):
* platform/network/DNSResolveQueue.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::suspendAnimations):
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyAnimationStarted):
(WebCore::RenderLayerBacking::suspendAnimations):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didPaintBacking):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
(WebCore::RenderProgress::animationProgress const):
(WebCore::RenderProgress::updateAnimationState):
* rendering/RenderProgress.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::animationDurationForProgressBar const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::animationDurationForProgressBar const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::animationDurationForProgressBar const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::animationDurationForProgressBar const):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::SMILTimeContainer):
(WebCore::SMILTimeContainer::elapsed const):
(WebCore::SMILTimeContainer::isActive const):
(WebCore::SMILTimeContainer::isPaused const):
(WebCore::SMILTimeContainer::isStarted const):
(WebCore::SMILTimeContainer::begin):
(WebCore::SMILTimeContainer::pause):
(WebCore::SMILTimeContainer::resume):
(WebCore::SMILTimeContainer::setElapsed):
(WebCore::SMILTimeContainer::timerFired):
* svg/animation/SMILTimeContainer.h:
* testing/Internals.cpp:
(WebCore::Internals::delayMediaStreamTrackSamples):
* testing/MockGamepad.cpp:
(WebCore::MockGamepad::MockGamepad):
(WebCore::MockGamepad::updateDetails):
(WebCore::MockGamepad::setAxisValue):
(WebCore::MockGamepad::setButtonValue):
2018-03-02 Alejandro G. Castro <alex@igalia.com>
Make LibWebRTCProvider port agnostic again after r215424
https://bugs.webkit.org/show_bug.cgi?id=183080
Reviewed by Youenn Fablet.
In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
we have moved that code to the cocoa class and created a glib implementation that will be used in the future
to implement the LibWebRTCProviderGlib class.
No new tests, this is a refactor.
* Sources.txt: Add the compilation of the new file.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
(WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
linking libwebrtc for the moment in these situations.
2018-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
https://bugs.webkit.org/show_bug.cgi?id=183246
Reviewed by Michael Catanzaro.
We are not correctly handling the combining enclosed keycap since we switched to use
ComplexTextController. This is because fontForCombiningCharacterSequence() always returns the font of the first
character, without checking if that font can render the whole sequence or not. Before 222843, the shaper did
that check when creating the text runs. In this case the sequence was split and a different font was used for the
text and the mark. This patch makes fontForCombiningCharacterSequence() try to find a suitable font for the
whole sequence, first looking at the CSS fallbacks and finally at system ones. The result is much better than
the old one, because we use the same font for both the text and the mark. If there isn't any font to render the
mark, then we fallback to use the first character font, since we will end up rendering the missing glyph
character, it's better to use the same font than the first character one.
Test: fast/text/combining-enclosing-keycap.html
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Check if the first charatcer font can render
the whole sequence, trying with fallbacks otherwise.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Check if the font face has glyphs for the whole
sequence not just the first character.
2018-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Remove FontPlatformData fallbacks
https://bugs.webkit.org/show_bug.cgi?id=183210
Reviewed by Michael Catanzaro.
They are only used by FontCache::systemFallbackForCharacters() where a direct FcFontMatch provides the same
or better results.
* platform/graphics/FontPlatformData.h: Remove fallbacks.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters): Use FcFontMatch() only.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::fallbacks): Removed.
2018-03-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229153.
https://bugs.webkit.org/show_bug.cgi?id=183274
it is breaking imported/w3c/web-platform-tests/service-workers
/service-worker/clients-matchall-exact-controller.https.html
(Requested by youenn on #webkit).
Reverted changeset:
"Clients should register to StorageProcess with their service
worker registration identifier"
https://bugs.webkit.org/show_bug.cgi?id=182313
https://trac.webkit.org/changeset/229153
2018-03-01 Youenn Fablet <youenn@apple.com>
Clients should register to StorageProcess with their service worker registration identifier
https://bugs.webkit.org/show_bug.cgi?id=182313
Reviewed by Chris Dumez.
No observable change of behavior in regular conditions.
When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
and we will not be able to retrieve the registration from these identifiers.
The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
* dom/Document.cpp:
(WebCore::Document::setServiceWorkerConnection):
* workers/service/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registerServiceWorkerClient):
* workers/service/server/SWServer.h:
2018-03-01 Youenn Fablet <youenn@apple.com>
Add API test to validate setting of service worker and cache storage directories
https://bugs.webkit.org/show_bug.cgi?id=182543
Reviewed by Chris Dumez.
Covered by API tests.
Add getters to service worker registration directory.
* testing/Internals.cpp:
(WebCore::Internals::serviceWorkerRegistrationDirectory):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/SWClientConnection.h:
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::serviceWorkerRegistrationDirectory const):
* workers/service/server/RegistrationStore.h:
(WebCore::RegistrationStore::serviceWorkerRegistrationDirectory const):
* workers/service/server/SWServer.h:
(WebCore::SWServer::serviceWorkerRegistrationDirectory const):
2018-03-01 Youenn Fablet <youenn@apple.com>
SWServer::removeClientServiceWorkerRegistration should not log an error if there is no registration
https://bugs.webkit.org/show_bug.cgi?id=183248
Reviewed by Chris Dumez.
No change of behavior.
Removed the error logging.
As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
and by the time it goes to the StorageProcess, the registration is already cleared.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::removeClientServiceWorkerRegistration):
2018-03-01 Daniel Bates <dabates@apple.com>
CSS ::selection stroke-color and stroke-width are not applied to selected text in text fields
and ::selection:window-inactive stroke-color and stroke-width are never applied
https://bugs.webkit.org/show_bug.cgi?id=183178
Reviewed by David Hyatt.
This change fixes the following two issues:
1. Properties stroke-color and stroke-width are not applied to the ::selection pseudo-
element of text fields.
2. Properties stroke-color and stroke-width are never applied to ::selection:window-inactive
pseudo elements.
Currently when computing the paint styles for selected text we query the cached styles for
the ::selection pseudo element on the renderer. Text fields are implemented using a User Agent
shadow DOM. With regards to issue (1) the renderer queried was the inner most renderer for
the text in the text field. But it should have been the shadow host renderer (i.e. the renderer
for the <input>). With regards to issue (2) we cannot retrieve cached styles for the
::selection pseudo element because it can be effected by a pseudo class, :window-inactive,
which matches when the page is deactivated (i.e. the window is in the background as the user
made another window the frontmost window). Both of these issues are fixed by making use
of RenderElement::selectionPseudoStyle().
Tests: fast/selectors/selection-window-inactive-stroke-color.html
fast/selectors/selection-window-inactive-text-shadow.html
fast/selectors/text-field-selection-stroke-color.html
fast/selectors/text-field-selection-text-shadow.html
fast/selectors/text-field-selection-window-inactive-stroke-color.html
fast/selectors/text-field-selection-window-inactive-text-shadow.html
* rendering/RenderText.h:
(WebCore::RenderText::selectionPseudoStyle const): Add a convenience function that turns
around and calls the function of the same name on its parent.
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextSelectionPaintStyle): Modified to use RenderText::selectionPseudoStyle()
instead of directly querying for the cached styles for the ::selection pseudo element.
2018-03-01 Per Arne Vollan <pvollan@apple.com>
Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
https://bugs.webkit.org/show_bug.cgi?id=183231
<rdar://problem/37793457>
Reviewed by Brent Fulgham.
When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
The notification about scrollbar preferences is never received by the WebContent process when there is no
WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
notifying the WebProcess about this by sending it a message. This message should also contain the preferred
scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
there is no WindowServer access.
No new tests, covered by existing tests.
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/NSScrollerImpDetails.mm:
(WebCore::ScrollerStyle::recommendedScrollerStyle):
(WebCore::ScrollerStyle::setUseOverlayScrollbars):
(WebCore::recommendedScrollerStyle): Deleted.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar const):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar const):
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::scrollbarThickness):
(WebCore::ScrollbarThemeMac::usesOverlayScrollbarsChanged):
2018-03-01 Myles C. Maxfield <mmaxfield@apple.com>
Temporarily enable user-installed-fonts everywhere until we can stop crashing on launch
https://bugs.webkit.org/show_bug.cgi?id=183255
Unreviewed.
Tests are already disabled.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
2018-03-01 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Split DNS cache expiration and connection timeout setting.
https://bugs.webkit.org/show_bug.cgi?id=182979
It was mis-implemented and was named ambiguous name 'enableTimeout'.
Implement each feature correctly.
Reviewed by Per Arne Vollan.
* platform/network/curl/CurlContext.cpp:
(WebCore::EnvironmentVariableReader::read):
(WebCore::EnvironmentVariableReader::defined):
(WebCore::EnvironmentVariableReader::readAs):
(WebCore::EnvironmentVariableReader::sscanTemplate):
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>):
(WebCore::CurlContext::CurlContext):
(WebCore::safeTimeValue):
(WebCore::CurlHandle::setDnsCacheTimeout):
(WebCore::CurlHandle::setConnectTimeout):
(WebCore::CurlHandle::setTimeout):
(WebCore::CurlHandle::enableTimeout): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::dnsCacheTimeout const):
(WebCore::CurlContext::connectTimeout const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
2018-03-01 Zalan Bujtas <zalan@apple.com>
Remove RenderElement::s_noLongerAffectsParentBlock
https://bugs.webkit.org/show_bug.cgi?id=183196
<rdar://problem/38030797>
Reviewed by Antti Koivisto.
Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
Covered by existing tests.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::noLongerAffectsParentBlock const):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:
(WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
2018-03-01 Chris Dumez <cdumez@apple.com>
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183225
<rdar://problem/38003828>
Reviewed by Alex Christensen.
Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
or src="about:blank" should load synchronously as per HTML specification.
Test: http/wpt/html/browsers/windows/browsing-context.html
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2018-03-01 Christopher Reid <chris.reid@sony.com>
[Curl] Linker errors in some curl files due to missing exports
https://bugs.webkit.org/show_bug.cgi?id=183238
Reviewed by Alex Christensen.
No new tests, no change in behavior.
Adding WEBCORE_EXPORT to functions now used in WebKit.
* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/CurlContext.h:
2018-03-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229130.
https://bugs.webkit.org/show_bug.cgi?id=183244
It breaks AppleWin compilation (Requested by alexg__ on
#webkit).
Reverted changeset:
"Make LibWebRTCProvider port agnostic again after r215424"
https://bugs.webkit.org/show_bug.cgi?id=183080
https://trac.webkit.org/changeset/229130
2018-03-01 Alejandro G. Castro <alex@igalia.com>
Make LibWebRTCProvider port agnostic again after r215424
https://bugs.webkit.org/show_bug.cgi?id=183080
Reviewed by Youenn Fablet.
In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
we have moved that code to the cocoa class and created a glib implementation that will be used in the future
to implement the LibWebRTCProviderGlib class.
No new tests, this is a refactor.
* Sources.txt: Add the compilation of the new file.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
(WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
linking libwebrtc for the moment in these situations.
2018-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Color emojis in WebKitGTK+ for great justice
https://bugs.webkit.org/show_bug.cgi?id=183155
Reviewed by Michael Catanzaro.
Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
(WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
(WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
(WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
(WebCore::FontCache::systemFallbackForCharacters): Clean it up.
(WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.
2018-02-28 Philippe Normand <pnormand@igalia.com>
[GStreamer] text samples no longer processed
https://bugs.webkit.org/show_bug.cgi?id=183212
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
track stream ID instead of (potentially) manually generated track
ID stored as hashmap keys.
2018-02-28 Tim Horton <timothy_horton@apple.com>
Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
https://bugs.webkit.org/show_bug.cgi?id=183193
Reviewed by Andy Estes.
* DerivedSources.make:
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
push it down from DerivedSources.make. Also clean up DerivedSources.make
a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.
2018-02-28 Nan Wang <n_wang@apple.com>
AX: AOM: Dispatch accessiblesetvalue event
https://bugs.webkit.org/show_bug.cgi?id=183021
<rdar://problem/37764242>
Reviewed by Chris Fleizach.
Accessibility events.
Spec: https://wicg.github.io/aom/spec/phase2.html
Added a new event type AccessibleSetValueEvent.
Test: accessibility/mac/AOM-event-accessiblesetvalue.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent):
(WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::setValue):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::setValue):
* accessibility/AccessibleSetValueEvent.cpp: Added.
(WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
* accessibility/AccessibleSetValueEvent.h: Added.
(WebCore::AccessibleSetValueEvent::create):
(WebCore::AccessibleSetValueEvent::value const):
* accessibility/AccessibleSetValueEvent.idl: Added.
* dom/Element.idl:
* dom/EventNames.h:
* dom/EventNames.in:
2018-02-28 Chris Dumez <cdumez@apple.com>
html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183168
<rdar://problem/37951341>
Reviewed by Alex Christensen.
The test has an anchor element with both a 'click' event handler which submits a form
and an href attribute. When clicking the link, as per specification, things happen in
this order:
1. We fire the click event at the anchor, which will execute the event handler and submit the form.
Submitting the form *schedules* a navigation to 'click.html'.
2. We execute the anchor activation code which *navigates* to 'href.html'. The navigation to
'href' is supposed to cancel the pending navigation to 'click.html' and we should navigate
to 'href.html', which is what the test asserts.
The issue for us is that we do not cancel pending navigations until after the navigation
policy decision is made, when the provisional loads actually starts, in FrameLoader::provisionalLoadStarted().
Because the policy decision for the navigation can now be made asynchronously, the NavigationScheduler
timer can now fire while the decision is made and we'll submit the form, thus navigating to
'click.html'.
To address the issue, we now cancel any pending navigations in FrameLoader::loadWithDocumentLoader(),
*before* doing the policy check for the navigation.
Test: http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
2018-02-28 John Wilander <wilander@apple.com>
Add a second tier of prevalence to facilitate telemetry on very prevalent domains
https://bugs.webkit.org/show_bug.cgi?id=183218
<rdar://problem/37992388>
Reviewed by Brent Fulgham.
Test: http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
Handling of the new boolean field isVeryPrevalentResource.
* loader/ResourceLoadStatistics.h:
Added the new boolean field isVeryPrevalentResource.
2018-02-28 Alex Christensen <achristensen@webkit.org>
Reduce use of NetworkingContext in WebKit
https://bugs.webkit.org/show_bug.cgi?id=183213
Reviewed by Brady Eidson.
NetworkingContext is intended to be used only with ResourceHandle, which is now only used in WebKitLegacy.
Now that we don't use ResourceHandle in the WebProcess, everything that was done through the NetworkingContext
can now be done a cleaner way with no change in behavior.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* loader/LoaderStrategy.h:
* platform/network/ProxyServer.h:
* platform/network/cf/ProxyServerCFNet.cpp:
(WebCore::proxyServersForURL):
* platform/network/curl/ProxyServerCurl.cpp:
(WebCore::proxyServersForURL):
* platform/network/soup/ProxyServerSoup.cpp:
(WebCore::proxyServersForURL):
2018-02-28 Zalan Bujtas <zalan@apple.com>
Remove RenderElement::s_affectsParentBlock
https://bugs.webkit.org/show_bug.cgi?id=183187
<rdar://problem/37961079>
Reviewed by Antti Koivisto.
Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
Covered by existing tests.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:
2018-02-28 Antti Koivisto <antti@apple.com>
Filter attribute selectors with selector filter
https://bugs.webkit.org/show_bug.cgi?id=183200
Reviewed by Zalan Bujtas.
Currently selector filtering is done based on tags, classes and ids. We should include attributes too.
This patch adds filtering based on attribute name (but not content).
* css/SelectorFilter.cpp:
(WebCore::isExcludedAttribute):
Ignore id, class and style attributes. First two are already handled and the last is common but is rarely
used in selectors.
(WebCore::collectElementIdentifierHashes):
Collect attributes.
Remove the unnecessary StyledElement casting.
(WebCore::collectSimpleSelectorHash):
Collect attribute selectors.
(WebCore::chooseSelectorHashesForFilter):
Pick attributes with high priority for the filter as it is likely a good signal.
2018-02-27 Sergio Villar Senin <svillar@igalia.com>
[WebVR] Convert VRPlatformDisplayInfo into a class
https://bugs.webkit.org/show_bug.cgi?id=183162
Reviewed by Žan Doberšek.
In preparation for further changes we're transforming the
VRPlatformDisplayInfo into a class. All the members are now private
and the class provides the needed getters/setters.
Apart from that VRDisplayCapabilityFlags is now just an unsigned and
the different flags are defined in VRDisplayCapabilityFlag enum.
Another cleanup was the removal of VRDisplayCapabilities.cpp as
everything can be implemented in the header.
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::isConnected const):
(WebCore::VRDisplay::stageParameters const):
* Modules/webvr/VRDisplayCapabilities.cpp: Removed.
* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::hasPosition const):
(WebCore::VRDisplayCapabilities::hasOrientation const):
(WebCore::VRDisplayCapabilities::hasExternalDisplay const):
(WebCore::VRDisplayCapabilities::canPresent const):
(WebCore::VRDisplayCapabilities::maxLayer const):
(WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
* Sources.txt:
* platform/vr/VRPlatformDisplay.h:
(WebCore::VRPlatformDisplayInfo::displayName const):
(WebCore::VRPlatformDisplayInfo::setDisplayName):
(WebCore::VRPlatformDisplayInfo::isConnected const):
(WebCore::VRPlatformDisplayInfo::setIsConnected):
(WebCore::VRPlatformDisplayInfo::isMounted const):
(WebCore::VRPlatformDisplayInfo::setIsMounted):
(WebCore::VRPlatformDisplayInfo::capabilityFlags const):
(WebCore::VRPlatformDisplayInfo::setCapabilityFlags):
(WebCore::VRPlatformDisplayInfo::displayIdentifier const):
(WebCore::VRPlatformDisplayInfo::setDisplayIdentifier):
(WebCore::VRPlatformDisplayInfo::eyeTranslation const):
(WebCore::VRPlatformDisplayInfo::setEyeTranslation):
(WebCore::VRPlatformDisplayInfo::eyeFieldOfView const):
(WebCore::VRPlatformDisplayInfo::setEyeFieldOfView):
(WebCore::VRPlatformDisplayInfo::renderSize const):
(WebCore::VRPlatformDisplayInfo::setRenderSize):
(WebCore::VRPlatformDisplayInfo::setPlayAreaBounds):
(WebCore::VRPlatformDisplayInfo::playAreaBounds const):
(WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform):
(WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const):
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::VRPlatformDisplayOpenVR::updateEyeParameters):
(WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
2018-02-27 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r229060.
https://bugs.webkit.org/show_bug.cgi?id=183198
This patch causes crashes on two SVG tests (Requested by fredw
on #webkit).
Reverted changeset:
"Relayout frames after AsyncFrameScrolling or FrameFlattening
option is changed"
https://bugs.webkit.org/show_bug.cgi?id=183081
https://trac.webkit.org/changeset/229060
2018-02-27 Youenn Fablet <youenn@apple.com>
Do not trigger a service worker match in case of document redirection if it will be already served by AppCache
https://bugs.webkit.org/show_bug.cgi?id=183185
<rdar://problem/37693796>
Reviewed by Chris Dumez.
Disabling service worker matching in case there is a substitute data.
Otherwise there is a risk for a double load, substitute data first and the new load
triggered if matching a new registration.
A future fix should first do service worker registration matching and if there is no registration query appcache.
Test: http/tests/appcache/main-resource-redirect-with-sw.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
2018-02-27 Tim Horton <timothy_horton@apple.com>
Ensure target triple is propagated correctly to DerivedSources.make
https://bugs.webkit.org/show_bug.cgi?id=183189
<rdar://problem/37959694>
Reviewed by Dan Bernstein.
If we don't propagate the target triple, we can sometimes build with
the wrong options enabled.
* Configurations/Base.xcconfig:
Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts.
* DerivedSources.make:
Propagate the target triple into our compiler invocations.
2018-02-27 Doug Russell <doug@getitdownonpaper.com>
AX: Spell check and style attributes should be optional when fetching attributed string
https://bugs.webkit.org/show_bug.cgi?id=160744
Reviewed by Chris Fleizach.
The overhead of fetching a spell checked attributed string via AX API is substantial.
In some cases on the order of 7/8 of the total time spent fetching the string.
This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).
AXAttributedStringForTextMarkerRange will remain unchanged.
Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
accessibility/mac/attributed-string/attributed-string-for-range.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributedStringAppendText):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
(-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.
2018-02-27 Daniel Bates <dabates@apple.com>
Standardize terminology for marked text
https://bugs.webkit.org/show_bug.cgi?id=180999
Reviewed by Zalan Bujtas.
The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type
and optional document marker. In particular, a MarkerSubrange may not always correspond to a document
marker. For instance, selected text is represented using a MarkerSubrange that does not have a
corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to
describe these tagged text subranges.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const):
(WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual):
(WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual):
(WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual):
(WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText):
(WebCore::createMarkedTextFromSelectionInBox):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintPlatformDocumentMarkers):
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const):
(WebCore::InlineTextBox::resolveStyleForMarkedText):
(WebCore::InlineTextBox::subdivideAndResolveStyle):
(WebCore::InlineTextBox::coalesceAdjacentMarkedTexts):
(WebCore::InlineTextBox::collectMarkedTextsForDraggedContent):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
(WebCore::InlineTextBox::paintMarkedTexts):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted.
(WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted.
(WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted.
(WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted.
(WebCore::createMarkerSubrangeFromSelectionInBox): Deleted.
(WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted.
(WebCore::InlineTextBox::resolveStyleForSubrange): Deleted.
(WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted.
(WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted.
(WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted.
(WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
(WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted.
(WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted.
(WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::paintMarkedTexts):
(WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
* rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp.
(WebCore::subdivide):
* rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h.
(WebCore::MarkedText::MarkedText):
(WebCore::MarkedText::isEmpty const):
(WebCore::MarkedText::operator!= const):
(WebCore::MarkedText::operator== const):
2018-02-27 Chris Dumez <cdumez@apple.com>
Unreviewed, roll out r228430.
Roll out r228430 now that it is no longer needed after r228852.
No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously
API test.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::schedule):
2018-02-27 Antoine Quint <graouts@apple.com>
[Web Animations] Correct implementation of pending tasks and promises
https://bugs.webkit.org/show_bug.cgi?id=183161
Reviewed by Dean Jackson.
We had an incorrect implementation of the spec due to two misinterpretations.
The first one is about pending tasks (play and pause) which the spec says should
be performed by "scheduling a task". In WebCore, this means using postTask() on a
ScriptExecutionContext, such as Document. One of the big practical changes is that
calling play() on an animation correctly sets its startTime to null (unresolved)
immediately after the call to play() returns before setting it to a resolved value
when the task is performed asynchronously. As a result, the playState is now always
accurate.
The second one is about promises where new promises need to be created in certain
situations called out by the spec. We used to call clear() on them, but this merely
resets the fulfillment or rejection state of the promise, while the spec requires
a different object to be returned for the promise. We now create our promises using
makeUniqueRef<> when new promise objects are expected to be created.
This patch also corrects a few smaller bugs and spec compliant issues, called out
below, related to pending tasks and promises uncovered while looking at relevant
WPT tests.
* animation/DocumentTimeline.h: Expose the Document used to create this timeline such
that it may be used by WebAnimation objects registered for this timeline when scheduling
a task is required via postTask().
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled
before rejecting it. While the spec does not specifically call this out, a promise may not
be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that
it was in the correct pending state before attemping to reject it.
(WebCore::WebAnimation::resetPendingTasks):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::finishNotificationSteps):
(WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling
that task, but the spec says to check for either a pending pause or play task (ie. pending())
and to cancel whichever is scheduled.
(WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the
spec when running a pending task.
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::runPendingPauseTask):
(WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated
timeline's document to schedule pending tasks for which the criteria to run are met, ie. there
is an associated timeline.
* animation/WebAnimation.h:
2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
https://bugs.webkit.org/show_bug.cgi?id=183100
<rdar://problem/37840987>
Reviewed by Tim Horton.
Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which
(when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether
"shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size.
The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details.
Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters
ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setMinimumLayoutSize):
Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size.
(WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit):
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where
"shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions.
(WebCore::ViewportConfiguration::initialScaleFromSize const):
Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size
is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As
such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout
size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions.
(WebCore::ViewportConfiguration::minimumScale const):
Similarly, use view size instead of minimum layout size to compute minimum scale.
(WebCore::ViewportConfiguration::description const):
* page/ViewportConfiguration.h:
2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the debug build after r228877.
In the case where CAN_DISALLOW_USER_INSTALLED_FONTS is enabled, this function doesn't return anything when
allowUserInstalledFonts != AllowUserInstalledFonts::No. Fix the build by moving `return nullptr;` back out of
the `#else`.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::installedFontMandatoryAttributes):
2018-02-27 Milan Crha <mcrha@redhat.com>
Potential privacy issue: DNS prefetching can be re-enabled
https://bugs.webkit.org/show_bug.cgi?id=182924
Reviewed by Michael Catanzaro.
* dom/Document.cpp:
(WebCore::Document::parseDNSPrefetchControlHeader):
2018-02-26 Antoine Quint <graouts@apple.com>
[Web Animations] Implement the procedure to set the target effect of an animation
https://bugs.webkit.org/show_bug.cgi?id=183146
Reviewed by Dean Jackson.
We only had a partial implementation of setEffect() and we now update it to cover the entire
implementation as mandated by the spec. While this doesn't yield any WPT results changes, this
patch will help getting a significant number of new PASS results when we get around to implement
correct support for async procedures (pending pause/play tasks and promises) in the next patch.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
2018-02-26 Antoine Quint <graouts@apple.com>
[Web Animations] Update the playState implementation
https://bugs.webkit.org/show_bug.cgi?id=183145
Reviewed by Dean Jackson.
The Web Animations spec has changed since we first implemented the playState property and the "pending"
enum value has been dropped since then (there is a separate "pending" property which we also implement).
We update our implementation to match the latest spec text. This does not change WPT test results a lot,
but this patch will help getting a significant number of new PASS results when we get around to implementing
correct support for async procedures (pending pause/play tasks and promises) in a couple of patches.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
2018-02-27 Wenson Hsieh <wenson_hsieh@apple.com>
Address post-review comment after r229049.
https://bugs.webkit.org/show_bug.cgi?id=183142
Reviewed by Tim Horton.
Wrap a newly added string literal with ASCIILiteral.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):
2018-02-26 Mark Lam <mark.lam@apple.com>
Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
https://bugs.webkit.org/show_bug.cgi?id=183159
<rdar://problem/37930837>
Reviewed by Keith Miller.
No new tests needed because this is just a refactoring patch.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2018-02-26 Dan Bernstein <mitz@apple.com>
Removed references to files that were removed in r228912.
* WebCore.xcodeproj/project.pbxproj: Removed references to SourcesIOS.txt and SourcesMac.txt.
2018-02-26 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
https://bugs.webkit.org/show_bug.cgi?id=183142
<rdar://problem/37912966>
Reviewed by Tim Horton.
Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
style sheet in RenderTheme to include these two style rules.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):
2018-02-26 Don Olmstead <don.olmstead@sony.com>
Fix WebCore includes within WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183147
Reviewed by Tim Horton.
No new tests. No change in behavior.
* PlatformWin.cmake:
* platform/win/GDIUtilities.h:
2018-02-26 Youenn Fablet <youenn@apple.com>
Add some more release logging related to DocumentWriter::addData crash
https://bugs.webkit.org/show_bug.cgi?id=183141
Reviewed by Chris Dumez.
No change of behavior.
Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/DocumentWriter.h:
2018-02-26 Antoine Quint <graouts@apple.com>
[Web Animations] Implement the procedure to set the start time
https://bugs.webkit.org/show_bug.cgi?id=183137
Reviewed by Dean Jackson.
Implement the procedure to set the start time as setBindingsStartTime() and use the setStartTime() method as
an internal method to set the m_startTime instance variable and invalidate the timing model rather than run
the entire procedure which should only be called when setting the "startTime" property through the JS API.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):
2018-02-26 Christopher Reid <chris.reid@sony.com>
[Curl] Cookies are not being added to the Cookie field in Request Headers
https://bugs.webkit.org/show_bug.cgi?id=183095
Reviewed by Alex Christensen.
Populating the Cookie request header field now that cookies are no longer handled in libcurl.
* platform/network/curl/CookieJarCurlDatabase.cpp: Renaming the httpOnly variable as its actual use wasn't clear
* platform/network/curl/ResourceHandleCurl.cpp:
2018-02-26 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure setting the hold time invalidates the timing model
https://bugs.webkit.org/show_bug.cgi?id=183136
Reviewed by Dean Jackson.
We used to always set the m_holdTime member variable directly, but the computation of the currentTime
depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well
as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that
sets the member variable and invalidates the timing model.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setHoldTime):
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::runPendingPauseTask):
* animation/WebAnimation.h:
2018-02-26 Youenn Fablet <youenn@apple.com>
MessagePort is not always destroyed in the right thread
https://bugs.webkit.org/show_bug.cgi?id=183053
Reviewed by Chris Dumez.
Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there
is no longer a need to keep the MessagePort around.
This is very time sensitive and does not happen a lot when running WPT tests.
Update existing call sites to pass a lambda.
* dom/MessagePort.cpp:
(WebCore::MessagePort::existingMessagePortForIdentifier):
* dom/MessagePort.h:
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
(WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
2018-02-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226745.
https://bugs.webkit.org/show_bug.cgi?id=183132
This is breaking some websites (Requested by youenn on
#webkit).
Reverted changeset:
"Use no-cache fetch mode when loading main documents with
location.reload()"
https://bugs.webkit.org/show_bug.cgi?id=181285
https://trac.webkit.org/changeset/226745
2018-02-26 Philippe Normand <pnormand@igalia.com>
Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
There is no such ENABLE_GSTREAMER_PLAYBIN3.
2018-02-26 Philippe Normand <pnormand@igalia.com>
Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Create an EGL display, even in Wayland.
2018-02-21 Sergio Villar Senin <svillar@igalia.com>
[WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
https://bugs.webkit.org/show_bug.cgi?id=182999
Reviewed by Žan Doberšek.
Retrieve the z-depth of the eye view frustum and the HMD unique id.
The unique identifier is generated by the VRPlatormManager whereas
we use the default values from the spec for the z-depth (those can
be changed by applications later via JavaScript).
Once this lands the only remaining data to be retrieved from VR
backends for VRDisplay is the pose (getPose() call) and the frame
data (getFrameData() call).
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::displayId const): Deleted.
(WebCore::VRDisplay::displayName const): Deleted.
(WebCore::VRDisplay::depthNear const): Deleted.
(WebCore::VRDisplay::setDepthNear): Deleted.
(WebCore::VRDisplay::depthFar const): Deleted.
(WebCore::VRDisplay::setDepthFar): Deleted.
* Modules/webvr/VRDisplay.h:
(WebCore::VRDisplay::displayId const): Moved implementation from
source file.
(WebCore::VRDisplay::displayName const): Ditto.
(WebCore::VRDisplay::depthNear const):
(WebCore::VRDisplay::setDepthNear):
(WebCore::VRDisplay::depthFar const):
(WebCore::VRDisplay::setDepthFar):
* platform/vr/VRManager.cpp:
(WebCore::VRManager::generateUniqueDisplayIdentifier):
* platform/vr/VRManager.h:
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2018-02-26 Charlie Turner <cturner@igalia.com>
Fix build error with !LOG_DISABLED
https://bugs.webkit.org/show_bug.cgi?id=183049
Reviewed by Philippe Normand.
The following error message was being reported when doing a
release build with -DLOG_DISABLED=0:
../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier):
../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: logString was not declared in this scope
LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
Other uses of logString are guarded by !LOG_DISABLED rather than
NDEBUG, which was the cause of this issue.
* dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED
rather than NDEBUG.
2018-02-26 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] User current executable name instead of g_get_prgname() for gst_init
https://bugs.webkit.org/show_bug.cgi?id=183119
Reviewed by Philippe Normand.
g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling
g_set_prgname(). Use WTF::getCurrentExecutableName() instead.
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):
2018-02-25 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Disable downloadable binary fonts by default
https://bugs.webkit.org/show_bug.cgi?id=183102
<rdar://problem/37860699>
Reviewed by Tim Horton.
Disable downloadable binary fonts by default in extra zoom mode by making the initial value of
`downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once
layout test support is in place.
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
* page/SettingsBase.h:
2018-02-25 Chris Dumez <cdumez@apple.com>
Service workers do not work well inside Web.app
https://bugs.webkit.org/show_bug.cgi?id=183105
<rdar://problem/37864140>
Reviewed by Youenn Fablet.
SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor
instead of using the sessionID of the SWServer that created the service worker thread.
As a result, when the Service Worker would establish a SWClientConnection to the
server, it would use the wrong sessionID and would end up using a different SWServer
(Since we have a different SWServer instance per sessionID). As a result,
ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not
be kept in sync with the server (since they registered themselves with the wrong
SWServer).
Covered by new API test.
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationStore.h:
(WebCore::RegistrationStore::server):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextData const):
2018-02-24 Fujii Hironori <Hironori.Fujii@sony.com>
Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad
https://bugs.webkit.org/show_bug.cgi?id=182920
Reviewed by Darin Adler.
A test case
imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html
always crashes due to a null-dereference if compiled and optimized
by GCC 7.2. The second argument `resource` of
DocumentLoader::scheduleSubstituteResourceLoad can be null if the
resource can't be found in cache. I guess GCC optimizes inline
HashMap::add based on assuming the `resource` never becomes null
because its type is SubstituteResource&.
This changes introduces a new method
DocumentLoader::scheduleCannotShowURLError because it looks tricky
to pass a nullptr to the second argument of
scheduleSubstituteResourceLoad.
No new tests (Covered by existing tests).
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method.
* loader/DocumentLoader.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
Call scheduleCannotShowURLError if the resource not found in the appcache.
2018-02-17 Darin Adler <darin@apple.com>
Prepare for ExtendedColor changes (first step)
https://bugs.webkit.org/show_bug.cgi?id=182904
Reviewed by Sam Weinig.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createColorValue): Use HashMap::ensure.
(WebCore::CSSValuePool::createFontFamilyValue): Ditto.
(WebCore::CSSValuePool::createFontFaceValue): Ditto.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::maybeParseValue): Tightened up
the logic a bit.
* html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes.
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction): Updated for Ref instead of
RefPtr and to use move semantics.
(WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr.
(WebCore::buildArrayForVector): Ditto.
(WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more.
(WebCore::InspectorCanvas::buildAction): Ditto.
(WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto.
(WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto.
(WebCore::InspectorCanvas::buildArrayForImageData): Ditto.
* inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead
of typedef and removed unneeded ErrorString typedef and some includes.
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag): Use auto and Ref.
* platform/DragData.h: Used pragma once and reorganized includes a bit.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to
prepare for removal of the RGBA32 type coming in a future patch.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::cacheNativeImageAtIndex): Ditto.
(WebCore::ImageSource::canUseAsyncDecoding): Ditto.
* platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only
code to use PLATFORM(MAC) to be easier to read.
(WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of
calling CGColorSpaceCreateWithName each time.
* platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed
now that it was removed from some header.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t
instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
* platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
(WebCore::ImageBackingStore::image const): Ditto.
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::haveDecodedRow): Ditto.
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::setPixel): Ditto.
(WebCore::JPEGImageDecoder::outputScanlines): Ditto.
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::rowAvailable): Ditto.
(WebCore::PNGImageDecoder::frameComplete): Ditto.
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decodeFrame): Ditto.
(WebCore::WEBPImageDecoder::applyPostProcessing): Ditto.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::color): Added comments.
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paintSelection): Use Color::isVisible.
2018-02-23 Chris Dumez <cdumez@apple.com>
Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&)
https://bugs.webkit.org/show_bug.cgi?id=183066
<rdar://problem/37804111>
Reviewed by Ryosuke Niwa.
SecurityOrigin objects are constructed on various threads. However, someone added a
shouldTreatAsPotentiallyTrustworthy() call to the SecurityOrigin constructor which
was not thread safe. This is because this function relies on SchemeRegistry::shouldTreatURLSchemeAsSecure()
and SchemeRegistry::shouldTreatURLSchemeAsLocal() which were relying on global static HashMaps without
locks.
Update SecurityOrigin to initialize m_isPotentiallyTrustworthy lazily, to avoid paying
initialization cost in the constructor. This is only queries by SecurityContext::isSecureContext().
Make SchemeRegistry::shouldTreatURLSchemeAsLocal() and SchemeRegistry::shouldTreatURLSchemeAsSecure()
thread-safe, since they are needed to initialize SecurityOrigin::m_isPotentiallyTrustworthy from
various threads.
SchemeRegistry::shouldTreatURLSchemeAsSecure() is only called from SecurityOrigin (which requires
thread-safety), and getUserMedia() which is not hot code so the extra locking there should not
be an issue.
SchemeRegistry::shouldTreatURLSchemeAsLocal() is called from SecurityOrigin (which requires thread-
safety). It is also called from isQuickLookPreviewURL(), MHTMLArchive::create(), Page::userStyleSheetLocationChanged(),
isRemoteWebArchive() and HTMLPlugInImageElement. All these are not hot code so I do not think
we need a fast path.
* page/SecurityOrigin.cpp:
(WebCore::isLoopbackIPAddress):
(WebCore::shouldTreatAsPotentiallyTrustworthy):
(WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
(WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
* page/SecurityOrigin.h:
* platform/SchemeRegistry.cpp:
(WebCore::localURLSchemesLock):
(WebCore::localURLSchemes):
(WebCore::secureSchemesLock):
(WebCore::secureSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsLocal):
(WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
(WebCore::SchemeRegistry::registerURLSchemeAsSecure):
(WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
* platform/SchemeRegistry.h:
2018-02-23 Christopher Reid <chris.reid@sony.com>
[Curl] Cookie Database files are wrongfully getting deleted when the database is opened
https://bugs.webkit.org/show_bug.cgi?id=183051
Reviewed by Per Arne Vollan.
The file stat logic was backwards causing a wrongful detection of database corruption.
Fixed the logic and abstracted these calls to use FileSystem.
* platform/network/curl/CookieJarDB.cpp:
2018-02-23 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED
https://bugs.webkit.org/show_bug.cgi?id=183084
<rdar://problem/37828706>
Reviewed by Antti Koivisto.
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderBlockFlow.h:
* rendering/updating/RenderTreeBuilderContinuation.h:
* rendering/updating/RenderTreeBuilderFirstLetter.h:
* rendering/updating/RenderTreeBuilderFormControls.h:
* rendering/updating/RenderTreeBuilderFullScreen.h:
* rendering/updating/RenderTreeBuilderInline.h:
* rendering/updating/RenderTreeBuilderList.h:
* rendering/updating/RenderTreeBuilderMathML.h:
* rendering/updating/RenderTreeBuilderMultiColumn.h:
* rendering/updating/RenderTreeBuilderRuby.h:
* rendering/updating/RenderTreeBuilderSVG.h:
* rendering/updating/RenderTreeBuilderTable.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.h:
2018-02-23 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183027
<rdar://problem/37773058>
Reviewed by Antti Koivisto.
No change in functionality.
* dom/Document.cpp:
(WebCore::Document::setFullScreenRenderer):
* dom/Document.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreenPlaceholder::RenderFullScreenPlaceholder):
(WebCore::RenderFullScreenPlaceholder::isRenderFullScreenPlaceholder const):
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
(): Deleted.
(WebCore::RenderFullScreen::createPlaceholder): Deleted.
* rendering/RenderFullScreen.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::createPlaceholderForFullScreen):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFullScreen.cpp:
(WebCore::RenderTreeBuilder::FullScreen::createPlaceholder):
* rendering/updating/RenderTreeBuilderFullScreen.h:
2018-02-23 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
https://bugs.webkit.org/show_bug.cgi?id=183073
<rdar://problem/37814585>
Reviewed by Antti Koivisto.
So that we don't destroy a renderer accidentally.
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderRuby.h:
* rendering/updating/RenderTreeBuilderSVG.h:
2018-02-22 Antoine Quint <graouts@apple.com>
REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
https://bugs.webkit.org/show_bug.cgi?id=183074
<rdar://problem/37747028>
Reviewed by Eric Carlson.
Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html
In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media
element we stop listening to the bulk of media events and prevent controls from updating any DOM properties
so as to minimize the amount of CPU usage by the Web process.
An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing,
the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed"
property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning
"false". As a result, if the "controls" attribute was turned back on after the media started playing, they
would default to showing the start button, which would be then in the play state, ie. showing the pause icon.
We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered
regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on
the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back
to "true" from a previous "false" value.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.handleEvent):
* Modules/modern-media-controls/media/start-support.js:
(StartSupport):
(StartSupport.prototype.enable):
(StartSupport.prototype.handleEvent):
(StartSupport.prototype._updateShowsStartButton):
2018-02-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=173655
<rdar://problem/37706341>
Reviewed by Philippe Normand.
Do not assume gst is only used in the WebProcess, the MIMETypeRegistry also uses gst to get the list of
supported media types. Move the code to extract gst options from the process command line to a helper function
and use it in the UI process to pass the options to the WebProcess, but also in the current process when gst is
initialized without providing options.
Fixes several unit tests that use MIMETypeRegistry in the UI process.
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::extractGStreamerOptionsFromCommandLine): Helper to get the gst options from the current process
command line.
(WebCore::initializeGStreamer): Ensure this is called once. Get the gst options from the given vector or extract
it from the command line if not provided.
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Bring back the gst
initialization here.
2018-02-23 Philippe Normand <pnormand@igalia.com>
[GStreamer] HTTP totalBytes query returns 0 after seeking (sometimes)
https://bugs.webkit.org/show_bug.cgi?id=183002
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Initialize member variables. Also no need
to set the appsrc size at that point.
(webKitWebSrcStop): There is no need to reset the size when
seeking. Size should in most cases represent the Content-Length
response attribute, even when seeking.
(webKitWebSrcStart): No need to reset the size attribute.
(webKitWebSrcQueryWithParent): Let appsrc handle DURATION queries.
(CachedResourceStreamingClient::responseReceived): Emit duration notification one time only.
2018-02-23 Philippe Normand <pnormand@igalia.com>
[GStreamer] media/video-src-blob-using-open-panel.html crashes in Debug
https://bugs.webkit.org/show_bug.cgi?id=183005
Reviewed by Xabier Rodriguez-Calvar.
Test: media/video-src-blob-using-open-panel.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::convertToInternalProtocol): Also convert blob URIs
because they're handled by our httpsrc element.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcGetProtocols): Prefix blob URIs too, for consistency purpose.
2018-02-22 Yusuke Suzuki <utatane.tea@gmail.com>
Remove currentTime() / currentTimeMS()
https://bugs.webkit.org/show_bug.cgi?id=183052
Reviewed by Mark Lam.
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::haveSuitableCachedPosition):
* dom/DOMTimeStamp.h:
(WebCore::convertSecondsToDOMTimeStamp):
* fileapi/File.cpp:
(WebCore::File::File):
(WebCore::File::lastModified const):
* history/HistoryItem.cpp:
(WebCore::generateSequenceNumber):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const):
* html/DateTimeInputType.cpp:
(WebCore::DateTimeInputType::defaultValueForStepUp const):
* html/MonthInputType.cpp:
(WebCore::MonthInputType::defaultValueForStepUp const):
* html/TimeInputType.cpp:
(WebCore::TimeInputType::defaultValueForStepUp const):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
* loader/EmptyFrameLoaderClient.h:
* loader/FormSubmission.cpp:
(WebCore::generateFormDataIdentifier):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clientRedirected):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/NavigationScheduler.cpp:
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/History.h:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::startFadeAnimation):
(WebCore::PageOverlay::fadeAnimationTimerFired):
* page/PageOverlay.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
* platform/ios/LegacyTileLayerPool.h:
* platform/ios/LegacyTileLayerPool.mm:
(WebCore::LegacyTileLayerPool::LegacyTileLayerPool):
(WebCore::LegacyTileLayerPool::addLayer):
(WebCore::LegacyTileLayerPool::decayedCapacity const):
(WebCore::LegacyTileLayerPool::prune):
* platform/ios/SystemMemoryIOS.cpp:
(WebCore::systemMemoryLevel):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2018-02-22 Per Arne Vollan <pvollan@apple.com>
The WebContent process should not use NSScreen in the screenDepth implementation.
https://bugs.webkit.org/show_bug.cgi?id=183048
Reviewed by Brent Fulgham.
NSScreen method calls should be done in the UIProcess, since these calls will communicate with
the WindowServer. The screen depth property can be retrieved in the UIProcess, and sent to the
WebContent process, where it is cached. Whenever screen properties change, the UIProcess will
send the new screen properties to the WebProcess.
No new tests, covered by existing tests.
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):
* platform/mac/PlatformScreenMac.mm:
(WebCore::getScreenProperties):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
2018-02-22 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy()
https://bugs.webkit.org/show_bug.cgi?id=183061
<rdar://problem/37800269>
Reviewed by Ryosuke Niwa.
...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()
No change in functionality.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
(WebCore::Document::setFullScreenRenderer):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::didAttachChild):
(WebCore::RenderElement::didInsertChild): Deleted.
* rendering/RenderElement.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
(WebCore::RenderFullScreen::createPlaceholder):
* rendering/RenderMenuList.cpp:
(RenderMenuList::didAttachChild):
(RenderMenuList::setText):
(RenderMenuList::didInsertChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::updateTextRenderer):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::setText):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::destroy):
(WebCore::RenderTreeBuilder::attach):
(WebCore::RenderTreeBuilder::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::detach):
(WebCore::RenderTreeBuilder::attachToRenderElement):
(WebCore::RenderTreeBuilder::attachToRenderElementInternal):
(WebCore::RenderTreeBuilder::move):
(WebCore::RenderTreeBuilder::moveAllChildren):
(WebCore::RenderTreeBuilder::moveChildren):
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
(WebCore::RenderTreeBuilder::detachFromRenderGrid):
(WebCore::RenderTreeBuilder::detachFromRenderElement):
(WebCore::RenderTreeBuilder::attachToRenderGrid):
(WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
(WebCore::RenderTreeBuilder::insertChild): Deleted.
(WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
(WebCore::RenderTreeBuilder::takeChild): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
(WebCore::RenderTreeBuilder::moveChildTo): Deleted.
(WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
(WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::attach):
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
(WebCore::RenderTreeBuilder::Block::detach):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
(WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
(WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::attach):
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
(WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
* rendering/updating/RenderTreeBuilderBlockFlow.h:
* rendering/updating/RenderTreeBuilderContinuation.cpp:
(WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::attach):
(WebCore::RenderTreeBuilder::FormControls::detach):
(WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
(WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderFormControls.h:
* rendering/updating/RenderTreeBuilderFullScreen.cpp:
(WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::attach):
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::splitFlow):
(WebCore::RenderTreeBuilder::Inline::splitInlines):
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
(WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
* rendering/updating/RenderTreeBuilderInline.h:
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::makeFences):
(WebCore::RenderTreeBuilder::MathML::attach):
(WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
* rendering/updating/RenderTreeBuilderMathML.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
(WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::attach):
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
(WebCore::RenderTreeBuilder::Ruby::detach):
(WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
(WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderRuby.h:
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::attach):
(WebCore::RenderTreeBuilder::SVG::detach):
(WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
(WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
* rendering/updating/RenderTreeBuilderSVG.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::Table::attach):
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
(WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
* rendering/updating/RenderTreeBuilderTable.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::RenderTreeUpdater::createTextRenderer):
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):
(WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers):
2018-02-22 Chris Dumez <cdumez@apple.com>
ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
https://bugs.webkit.org/show_bug.cgi?id=183059
<rdar://problem/37800202>
Reviewed by Youenn Fablet.
Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well,
given that it is a String and it would not be safe to send it to another thread otherwise.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
2018-02-22 Chris Dumez <cdumez@apple.com>
ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
https://bugs.webkit.org/show_bug.cgi?id=183050
<rdar://problem/37796881>
Reviewed by Youenn Fablet.
Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2018-02-22 Chris Dumez <cdumez@apple.com>
ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
https://bugs.webkit.org/show_bug.cgi?id=183046
<rdar://problem/37793395>
Reviewed by Youenn Fablet.
Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):
2018-02-22 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix warning on clang.
https://bugs.webkit.org/show_bug.cgi?id=182986
Reviewed by Konstantin Tokarev.
No new tests because there's no behaviro changes.
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::CurlResourceHandleDelegate::curlDidSendData):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
(WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
* platform/network/curl/CurlResourceHandleDelegate.h:
2018-02-22 Youenn Fablet <youenn@apple.com>
WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
https://bugs.webkit.org/show_bug.cgi?id=183041
Reviewed by Chris Dumez.
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
case of an already deleted cache, i.e. returned identifer is 0.
2018-02-22 Alejandro G. Castro <alex@igalia.com>
Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
https://bugs.webkit.org/show_bug.cgi?id=183031
Reviewed by Youenn Fablet.
This include and namespace are not required in the file.
Just removing unused code, no tests required.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2018-02-22 Chris Dumez <cdumez@apple.com>
Document.open() cancels existing provisional load but not navigation policy check
https://bugs.webkit.org/show_bug.cgi?id=183012
<rdar://problem/37755831>
Reviewed by Alex Christensen.
Test: fast/dom/Document/open-with-pending-load-async-policy.html
* dom/Document.cpp:
(WebCore::Document::open):
The existing code was calling FrameLoader::stopAllLoaders() when the loader's state
is FrameStateProvisional. The issue is that the FrameLoader's state only gets set
to FrameStateProvisional after the policy decision for the navigation is made.
This means that we fail to cancel a pending load if is still in the policy decision
stage, which can happen when the policy decision is made asynchronously. We now
also cancel such pending navigation policy checks as well.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the
lambda. Otherwise, it gets reset too early when the policy decision is made
asynchronously.
2018-02-22 Youenn Fablet <youenn@apple.com>
Add release asserts for service worker fetch and postMessage events
https://bugs.webkit.org/show_bug.cgi?id=183025
rdar://problem/37765052
Reviewed by Daniel Bates.
Add release assertion so that a service worker will only dispatch a message event
for clients and service workers with the same origin.
No change of behavior.
* platform/network/ResourceRequestBase.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-02-22 Miguel Gomez <magomez@igalia.com>
including both gl3.h and gl2.h when USE_OPENGL_ES is enabled
https://bugs.webkit.org/show_bug.cgi?id=183008
Reviewed by Michael Catanzaro.
Don't include GLES3 headers as we stick to GLES2 API resources.
No new tests, no behavior change.
* platform/graphics/GLContext.cpp:
2018-02-22 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Fix some build errors in service workers code
https://bugs.webkit.org/show_bug.cgi?id=182966
Reviewed by Žan Doberšek.
No new tests: no change in behavior.
* workers/service/ServiceWorkerProvider.h: add missing forward declaration.
2018-02-21 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183022
<rdar://problem/37764326>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::insertedIntoTree):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderElementInternal):
(WebCore::RenderTreeBuilder::moveChildrenTo):
(WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted.
* rendering/updating/RenderTreeBuilder.h:
2018-02-21 Tim Horton <timothy_horton@apple.com>
Include all Cocoa sources in all Cocoa platform builds
https://bugs.webkit.org/show_bug.cgi?id=183026
<rdar://problem/37513101>
Reviewed by Dan Bernstein.
Similar to r228571, don't have separate Sources files for iOS and Mac.
All sources now have #ifdefs that ensure that only the right ones
build on the right platforms. This makes it much easier to reason
about what builds where by just looking at the sources.
* SourcesCocoa.txt:
* SourcesIOS.txt: Removed.
* SourcesMac.txt: Removed.
* WebCore.xcodeproj/project.pbxproj:
* editing/WebContentReader.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2018-02-21 Youenn Fablet <youenn@apple.com>
Make SubstituteResource take a ResourceResponse r-value
https://bugs.webkit.org/show_bug.cgi?id=183020
Reviewed by Alex Christensen.
No change of behavior.
Make SubstituteResource take a ResourceResponse r-value.
Update ArchiveResource accordingly.
Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache
before passing it to SubstituteResource constructor.
* loader/SubstituteResource.h:
(WebCore::SubstituteResource::SubstituteResource):
(WebCore::SubstituteResource::resourceResponse): Deleted.
* loader/appcache/ApplicationCacheResource.cpp:
(WebCore::ApplicationCacheResource::create):
(WebCore::ApplicationCacheResource::ApplicationCacheResource):
* loader/appcache/ApplicationCacheResource.h:
(WebCore::ApplicationCacheResource::create): Deleted.
* loader/archive/ArchiveResource.cpp:
(WebCore::ArchiveResource::ArchiveResource):
2018-02-21 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
https://bugs.webkit.org/show_bug.cgi?id=183019
<rdar://problem/37761421>
Reviewed by Antti Koivisto.
All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::willBeDestroyed):
* rendering/RenderBoxModelObject.h:
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::willBeDestroyed):
* rendering/RenderCounter.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::willBeDestroyed):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::willBeDestroyed):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::willBeDestroyed):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderInline.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::willBeDestroyed):
* rendering/RenderLayerModelObject.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::willBeDestroyed):
* rendering/RenderListBox.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::willBeDestroyed):
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::willBeDestroyed):
* rendering/RenderMenuList.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::destroy):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::willBeDestroyed):
* rendering/RenderReplaced.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::willBeDestroyed):
* rendering/RenderSearchField.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::willBeDestroyed):
* rendering/RenderText.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::willBeDestroyed):
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
* rendering/RenderVideo.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed):
* rendering/RenderWidget.h:
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::willBeDestroyed):
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::willBeDestroyed):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::willBeDestroyed):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::willBeDestroyed):
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::willBeDestroyed):
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::willBeDestroyed):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::willBeDestroyed):
* rendering/svg/RenderSVGText.h:
2018-02-21 Per Arne Vollan <pvollan@apple.com>
The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
https://bugs.webkit.org/show_bug.cgi?id=182855
Reviewed by Brent Fulgham.
On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
process whenever there is a change in the display properties, and have the WebContent process cache these
display properties. This message should also be sent to a newly started WebContent process.
No new tests, covered by existing tests.
* WebCore.xcodeproj/project.pbxproj:
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::getScreenProperties):
(WebCore::screenProperties):
(WebCore::setScreenProperties):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/ScreenProperties.h: Added.
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):
2018-02-21 Christopher Reid <chris.reid@sony.com>
[Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=182751
Reviewed by Youenn Fablet.
No change in behavior.
Adding support to set a custom CookieJar Database.
Took CookieJarDB::open() out of its constructor because both the Network and Web process
were trying to open the journal files but one process was failing due to a lack of permission.
Now the database file is lazily opened and only the Network process will try to open the database.
Some cleanup was done to CookieJarDB too.
* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
2018-02-21 Chris Dumez <cdumez@apple.com>
Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&)
https://bugs.webkit.org/show_bug.cgi?id=183018
<rdar://problem/37754154>
Reviewed by Eric Carlson.
The fix at r228708 was trying to address the fact that avplayer sometimes
deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which
was not safe because its _resource data member needs to be deallocated on
the main thread.
The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask.
This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient)
which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could
call methods like responseReceived() on the resource, which would call responseReceived() on the
client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid
m_task pointer.
To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which
gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed
on a non-main thread. So that this is safe, every time the client tries to use m_task, we now
acquire a lock for thread-safety and do a null-check on m_task.
No new tests, no known reproduction case.
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResource::client):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::clearTask):
(WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse):
(WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
(WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
(WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed):
(WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed):
(WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
(-[WebCoreNSURLSessionDataTask dealloc]):
2018-02-21 Youenn Fablet <youenn@apple.com>
Move AppCache loading to the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=178540
<rdar://problem/37119346>
Reviewed by Alex Christensen.
Covered by existing tests.
Use ApplicationResourceLoader for cache entry loading.
Remove all ResourceHandle use from ApplicationCacheGroup.
Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries.
Updated ApplicationCacheResourceLoader to handle different types of CachedResource.
This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type.
Use Include as credentials mode as per specification.
Add a new ApplicationCache ResourceResonse::Source.
This allows fixing an assertion and should allow better inspector support if needs be.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::responseSource):
* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* loader/SubstituteResource.h:
(WebCore::SubstituteResource::resourceResponse):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::stopLoading):
(WebCore::ApplicationCacheGroup::update):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
(WebCore::ApplicationCacheGroup::didFail):
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
(WebCore::ApplicationCacheGroup::startLoadingEntry):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheResource.cpp:
(WebCore::ApplicationCacheResource::ApplicationCacheResource):
* loader/appcache/ApplicationCacheResourceLoader.cpp:
(WebCore::ApplicationCacheResourceLoader::create):
(WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader):
(WebCore::ApplicationCacheResourceLoader::responseReceived):
(WebCore::ApplicationCacheResourceLoader::redirectReceived):
* loader/appcache/ApplicationCacheResourceLoader.h:
* platform/network/ResourceResponseBase.h:
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
* testing/Internals.cpp:
(WebCore::responseSourceToString):
2018-02-21 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183014
<rdar://problem/37757428>
Reviewed by Antti Koivisto.
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::~RenderBoxModelObject):
(WebCore::RenderBoxModelObject::willBeDestroyed):
(WebCore::RenderBoxModelObject::continuationChainNode const):
(): Deleted.
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted.
* rendering/RenderBoxModelObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::removeAndDestroy):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::continuationBuilder):
* rendering/updating/RenderTreeBuilderContinuation.cpp: Added.
(WebCore::RenderTreeBuilder::Continuation::Continuation):
(WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
* rendering/updating/RenderTreeBuilderContinuation.h: Added.
2018-02-21 Youenn Fablet <youenn@apple.com>
ServiceWorkerJob::m_lastResponse is unneeded
https://bugs.webkit.org/show_bug.cgi?id=183013
Reviewed by Chris Dumez.
Remove this field since not used anywhere.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::didReceiveResponse):
* workers/service/ServiceWorkerJob.h:
2018-02-21 Youenn Fablet <youenn@apple.com>
Use ResourceLoader to load appcache manifest
https://bugs.webkit.org/show_bug.cgi?id=182861
Reviewed by Alex Christensen.
Covered by updated tests.
Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
Make use of it to load the app cache manifest.
Future work should load entries using the same loader.
Remove manifest handle.
Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
is handled by its ApplicationCacheGroup.
Add a ResourceLoader option to bypass the application cache.
Use it for manifest loading.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/ResourceLoaderOptions.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::stopLoading):
(WebCore::ApplicationCacheGroup::update):
(WebCore::ApplicationCacheGroup::createRequest):
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
(WebCore::ApplicationCacheGroup::didReceiveData):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::didFail):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
* loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
* loader/appcache/ApplicationCacheResourceLoader.h: Added.
2018-02-21 Don Olmstead <don.olmstead@sony.com>
[CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
https://bugs.webkit.org/show_bug.cgi?id=182883
Reviewed by Per Arne Vollan.
No new tests. No change in behavior.
* WebCorePrefix.h:
* config.h:
* testing/js/WebCoreTestSupportPrefix.h:
2018-02-21 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=183009
Reviewed by Antti Koivisto.
No change in functionality.
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
* rendering/RenderView.cpp:
(WebCore::RenderView::~RenderView):
(WebCore::RenderView::willBeDestroyed): Deleted.
* rendering/RenderView.h:
2018-02-21 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
https://bugs.webkit.org/show_bug.cgi?id=181825
Reviewed by Carlos Garcia Campos.
We could fix this crash, but that would not be good enough, because upower-glib is a
synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process.
Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead.
Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build
flag is no longer needed.
* platform/LowPowerModeNotifier.cpp:
* platform/LowPowerModeNotifier.h:
* platform/glib/LowPowerModeNotifierGLib.cpp:
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::updateWarningLevel):
(WebCore::LowPowerModeNotifier::warningLevelChanged):
(WebCore::LowPowerModeNotifier::gPropertiesChangedCallback):
(WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::updateState): Deleted.
(WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted.
2018-02-21 Chris Dumez <cdumez@apple.com>
VTTCue constructor should use 'double' type for startTime / endTime
https://bugs.webkit.org/show_bug.cgi?id=182988
Reviewed by Eric Carlson.
VTTCue constructor should use 'double' type for startTime / endTime, not
'unrestricted double':
- https://w3c.github.io/webvtt/#the-vttcue-interface
Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime,
even though those correctly use type 'double':
- https://html.spec.whatwg.org/multipage/media.html#texttrackcue
The new behavior is consistent with Firefox and Chrome.
No new tests, updated existing test.
* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLDouble>::convert):
Add assertion to make sure our implementation never tries to return NaN
for an IDL attribute of type 'double'. This would be invalid as per Web
IDL spec and would crash if the NaN being returned was impure as JSValue
could not store it as a double.
* html/track/VTTCue.idl:
Update constructor parameters to use 'double' type instead of 'unrestricted
double', as per:
- https://w3c.github.io/webvtt/#the-vttcue-interface
2018-02-21 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182946
<rdar://problem/37690039>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval):
* rendering/updating/RenderTreeBuilderFirstLetter.h:
2018-02-21 Ms2ger <Ms2ger@igalia.com>
[GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
https://bugs.webkit.org/show_bug.cgi?id=183001
Reviewed by Philippe Normand.
This function is called from structured cloning, in particular when storing
a key in IndexedDB. This would trip the assertion if the key in question is
non-exportable.
The assertion was copied from the macOS implementation in r172389; it was
subsequently removed there in r172898 to handle this case.
Test: crypto/subtle/rsa-indexeddb-non-exportable.html
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::exportData const): remove assertion.
2018-02-21 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Make system-ui obey the user-installed-font policy
https://bugs.webkit.org/show_bug.cgi?id=182860
<rdar://problem/36158249>
Reviewed by Antti Koivisto.
We have a completely different codepath for system-ui which makes it follow the system's
font cascade list. This codepath (along with all the other relevant places which create
system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly
mechanical; we simply are hooking up the flag across SystemFontDatabase.
There are a few places which creates system fonts which this patch doesn't touch. This is
not a problem because all the remaining places either:
1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw
away the font object itself, or
2) Use the font in an environment where script cannot access the characters rendered (such
as DragImages or the fullscreen placeholder view or the inside of the attachment element).
Test: fast/text/user-installed-fonts/system-ui.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::fontWithFamily):
(WebCore::installedFontMandatoryAttributes):
(WebCore::createSpecificFontForInstalledFonts):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::SystemFontDatabase::removeCascadeList):
(WebCore::SystemFontDatabase::computeCascadeList):
(WebCore::systemFontParameters):
(WebCore::systemFontCascadeList):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
2018-02-21 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix build after r228867.
* Modules/webvr/VRStageParameters.cpp:
2018-02-21 Philippe Normand <pnormand@igalia.com>
[GStreamer] Rewrite purgeInvalid*Tracks methods
https://bugs.webkit.org/show_bug.cgi?id=183004
Reviewed by Carlos Garcia Campos.
Removing items from a hashmap while iterating is bad.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks):
Safely remove items from the hashmap using removeIf().
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
2018-02-21 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix build after r228867.
* Modules/webvr/VRStageParameters.cpp:
2018-02-21 Philippe Normand <pnormand@igalia.com>
[GStreamer] Crash in Debug build when purging invalid tracks
https://bugs.webkit.org/show_bug.cgi?id=182997
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2.
(WebCore::TrackPrivateBaseGStreamer::getTag): Ditto.
2018-02-21 Philippe Normand <pnormand@igalia.com>
[GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
https://bugs.webkit.org/show_bug.cgi?id=182996
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Adopt references when running with GStreamer 1.13.1 to avoid
memory leaks.
2018-02-20 Philippe Normand <pnormand@igalia.com>
[GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617
https://bugs.webkit.org/show_bug.cgi?id=160131
<rdar://problem/35873985>
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We
can't assume the pad has a sticky event here like implemented in
InbandTextTrackPrivateGStreamer because it might be emitted after
the track was created. So fallback to a dummy stream ID like in
the Audio and Video tracks.
2018-02-20 Sergio Villar Senin <svillar@igalia.com>
[WebVR][OpenVR] Retrieve stage parameters
https://bugs.webkit.org/show_bug.cgi?id=182976
Reviewed by Žan Doberšek.
Use OpenVR to retrieve stage parameters, i.e., play area size and
the transformation from sitting to standing position. It includes
the same fallback used by Firefox to provide sensible values in case
we cannot get the required information from the VR SDK (it's quite
common not to have defined a play area).
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::stageParameters const):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::VRStageParameters):
(WebCore::VRStageParameters::sittingToStandingTransform const):
(WebCore::VRStageParameters::sizeX const):
(WebCore::VRStageParameters::sizeZ const):
* Modules/webvr/VRStageParameters.h:
(WebCore::VRStageParameters::create):
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2018-02-21 Philippe Normand <pnormand@igalia.com>
[GStreamer] Create a Wayland GL display instead of EGL
https://bugs.webkit.org/show_bug.cgi?id=182968
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Add logging and instantiate a GstDisplayWayland display instead of
an EGL display when running under a Wayland compositor.
2018-02-21 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182947
<rdar://problem/37690848>
Reviewed by Antti Koivisto.
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::fullScreenBuilder):
* rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
(WebCore::RenderTreeBuilder::FullScreen::FullScreen):
(WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
* rendering/updating/RenderTreeBuilderFullScreen.h: Added.
* rendering/updating/RenderTreeBuilderMathML.cpp:
2018-02-20 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182943
<rdar://problem/37689029>
Reviewed by Antti Koivisto.
We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
the RenderListItem's descendent).
Covered by existing tests.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::~RenderListItem):
(WebCore::RenderListItem::willBeDestroyed): Deleted.
* rendering/RenderListItem.h:
2018-02-20 Nan Wang <n_wang@apple.com>
AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
https://bugs.webkit.org/show_bug.cgi?id=182752
<rdar://problem/37518233>
Reviewed by Ryosuke Niwa.
Call the assistive technology specific method for becoming first responder.
Test: accessibility/mac/accessibility-make-first-responder.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
* page/ChromeClient.h:
2018-02-20 Tim Horton <timothy_horton@apple.com>
Introduce HAVE(IOSURFACE_ACCELERATOR)
https://bugs.webkit.org/show_bug.cgi?id=182955
<rdar://problem/37699510>
Reviewed by Sam Weinig.
No new tests, no change in behavior.
Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
IOSurfaceAccelerator behind it.
Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.
* page/cocoa/MemoryReleaseCocoa.mm:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/cg/IOSurfacePool.cpp:
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
* platform/graphics/cv/VideoTextureCopierCV.h:
2018-02-20 Chris Dumez <cdumez@apple.com>
Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
https://bugs.webkit.org/show_bug.cgi?id=182720
<rdar://problem/37515204>
Reviewed by Alex Christensen.
Wait for the policy response from the client after receiving a resource response,
before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to
the NetworkProcess. Otherwise, the network process may start sending us data and
we may end up committing the provisional load before receiving the policy decision
fron the client.
Change is covered by new API test.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::deliverResponseAndData):
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::didReceiveResponse):
(WebCore::ResourceLoader::didReceiveResponseAsync):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didReceiveResponsePolicy):
(WebCore::SubresourceLoader::willCancel):
* loader/SubresourceLoader.h:
* loader/ios/PreviewLoader.mm:
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
2018-02-20 Chris Dumez <cdumez@apple.com>
Crash under JSC::JSCell::toNumber(JSC::ExecState*)
https://bugs.webkit.org/show_bug.cgi?id=182984
<rdar://problem/37694346>
Reviewed by Mark Lam.
The issue was caused by DOMMatrix attributes potentially returning "impure"
NaN values. We would call JSC::jsNumber(double) to construct the JSValue
but this is only safe for pure NaN values. Make sure we purify the double
returned by the implementation for IDL attributes of type 'unrestricted double'
before calling JSC::jsNumber(double).
No new tests, extended existing test.
* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
* testing/TypeConversions.h:
(WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const):
(WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const):
(WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const):
* testing/TypeConversions.idl:
2018-02-20 Tim Horton <timothy_horton@apple.com>
Make more use of USE(OPENGL_ES) where it makes sense
https://bugs.webkit.org/show_bug.cgi?id=182957
<rdar://problem/37699443>
Reviewed by Dan Bernstein.
No new tests, no behavior change.
Make use of USE(OPENGL_ES) for CoreVideo functions that differ based
on GL availability. Also adjust GraphicsContext3D in the same way.
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cv/TextureCacheCV.mm:
(WebCore::TextureCacheCV::create):
(WebCore::TextureCacheCV::textureFromImage):
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::enumToStringMap):
(WebCore::VideoTextureCopierCV::initializeContextObjects):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2018-02-20 Nan Wang <n_wang@apple.com>
AX: AOM: Dispatch accessibleclick event
https://bugs.webkit.org/show_bug.cgi?id=180898
<rdar://problem/36086710>
Reviewed by Ryosuke Niwa.
Accessibility events.
Spec: https://wicg.github.io/aom/spec/phase2.html
This patch allows developers to register event handlers on Elements
for custom accessibility events.
Accessibility events go through a capturing and bubbling phase just
like DOM events, but in the accessibility tree.
Implemented "accessibleclick" event.
Test: accessibility/mac/AOM-events.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
* dom/Element.idl:
* dom/EventDispatcher.cpp:
(WebCore::dispatchEventWithType):
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventDispatcher.h:
* dom/EventNames.h:
* dom/EventPath.cpp:
(WebCore::EventPath::EventPath):
* dom/EventPath.h:
2018-02-20 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
https://bugs.webkit.org/show_bug.cgi?id=182952
<rdar://problem/37636190>
Reviewed by Tim Horton.
After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text
to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the
pasteboard won't read any data on paste.
To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard.
Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make
it clear that the data should be consumed as a URL.
This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test,
ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting
into a DataTransfer-dumping test harness.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
2018-02-20 Eric Carlson <eric.carlson@apple.com>
[iOS] Returning from Auto-PiP causes Safari to be unresponsive
https://bugs.webkit.org/show_bug.cgi?id=182977
<rdar://problem/37685981>
Reviewed by Jer Noble.
Remove the error handling added in r228115, it breaks auto-pip.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
2018-02-20 Jer Noble <jer.noble@apple.com>
[EME] Adopt new AVContentKeySession success delegate callback
https://bugs.webkit.org/show_bug.cgi?id=182974
<rdar://problem/36079035>
Reviewed by Eric Carlson.
Store the updateLicenseCallback if the new protocol method is present and supported.
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
2018-02-19 Dean Jackson <dino@apple.com>
Handle all writing-modes in downcast
https://bugs.webkit.org/show_bug.cgi?id=182949
<rdar://problem/37710687>
Reviewed by Myles Maxfield.
It appears we forgot to handle the deprecated "lr"
writing-mode value.
Test: fast/writing-mode/svg-writing-modes.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator WritingMode const):
2018-02-20 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Drop target GraphicsContext usage in Cairo operations
https://bugs.webkit.org/show_bug.cgi?id=182964
Reviewed by Carlos Garcia Campos.
The GraphicsContext parameters in various Cairo operations are not used
anymore, so they can be removed. Callsites are updated to reflect this.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawShadowLayerBuffer):
(WebCore::Cairo::fillShadowBuffer):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::drawSurface):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::fillRect):
(WebCore::GraphicsContextImplCairo::fillRoundedRect):
(WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
(WebCore::GraphicsContextImplCairo::fillPath):
(WebCore::GraphicsContextImplCairo::strokeRect):
(WebCore::GraphicsContextImplCairo::strokePath):
(WebCore::GraphicsContextImplCairo::drawGlyphs):
(WebCore::GraphicsContextImplCairo::drawNativeImage):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-02-20 Sergio Villar Senin <svillar@igalia.com>
[WebVR][OpenVR] Retrieve eye parameters and field of view
https://bugs.webkit.org/show_bug.cgi?id=182962
Reviewed by Žan Doberšek.
Get the required data from OpenVR to fill in the VREyeParameters and
the VRFieldOfView objects.
* Modules/webvr/VRDisplay.cpp: Create some attributes in the
body of the constructor instead in the member initialization list to
avoid calling getDisplayInfo() multiple times.
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::capabilities const):
(WebCore::VRDisplay::getEyeParameters const):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VREyeParameters.cpp:
(WebCore::VREyeParameters::VREyeParameters): Added new attributes to
the constructor.
(WebCore::VREyeParameters::offset const): Return a Ref instead of
a raw pointer.
(WebCore::VREyeParameters::renderWidth const):
(WebCore::VREyeParameters::renderHeight const):
* Modules/webvr/VREyeParameters.h:
(WebCore::VREyeParameters::create):
* Modules/webvr/VRFieldOfView.cpp: Removed. All the impletementation
fits perfectly in the header file.
* Modules/webvr/VRFieldOfView.h:
(WebCore::VRFieldOfView::create):
(WebCore::VRFieldOfView::upDegrees const):
(WebCore::VRFieldOfView::rightDegrees const):
(WebCore::VRFieldOfView::downDegrees const):
(WebCore::VRFieldOfView::leftDegrees const):
(WebCore::VRFieldOfView::VRFieldOfView):
* Sources.txt:
* platform/vr/VRPlatformDisplay.h: Added some more data to the
VRPlatformDisplayInfo struct.
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::VRPlatformDisplayOpenVR::computeFieldOfView): Computes the
up/down/left/right FOV angles in degrees from the raw project
values returned by OpenVR.
(WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): Fills in
the eye parameter info.
(WebCore::VRPlatformDisplayOpenVR::~VRPlatformDisplayOpenVR):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2018-02-20 Philippe Normand <pnormand@igalia.com>
[GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=173655
Reviewed by Xabier Rodriguez-Calvar.
The FIXME in GStreamerUtilities.cpp asks to pass the command line
parameters to the GStreamer initialization function.
Based on initial patch by: Vanessa Chipirrás Navalón <vchipirras@igalia.com>
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon): Removes the call to the method
that GStreamer initializes. It is no longer necessary.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
* platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
GStreamer options as the input parameter of the initializeGStreamer() method.
2018-02-20 Miguel Gomez <magomez@igalia.com>
[GTK] whatsapp web blurry in some parts, sharp on others
https://bugs.webkit.org/show_bug.cgi?id=182673
Reviewed by Carlos Garcia Campos.
CoordinatedGraphicsLayer::createBackingStore() uses the scale factor returned by effectiveContentsScale(),
which is always 1 if selfOrAncestorHaveNonAffineTransforms() returns true. But this fuction always returns
true if the layer has an AnimatedPropertyTransform animation, which means that layers with those animations
won't use the appropriate scale factor, causing blurry renderings.
This patch removes the animations check, so animated layers properly use the required scale factor.
No new tests, no behavior change.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2018-02-20 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=182958
Reviewed by Carlos Garcia Campos.
To allow ShadowBlur usage in different threads, avoid the ShadowBlur
class using the scratch buffer internally. The current implementation of
that scratch buffer is not thread-safe and its usage in such conditions
can lead to crashes.
Instead, the new methods use a temporary ImageBuffer object for drawing.
This does negate the efficiency of possibly reusing the scratch buffer,
but at this point that is not yet the priority. This only affects ports
using Cairo for drawing.
The added methods don't require a target GraphicsContext object to be
passed in, instead they accept buffer draw callbacks that are invoked
with the temporary ImageBuffer object containing the rasterized shadow,
as well as position and size parameters. The CTM and clip bounds values
also have to be passed in manually. In CairoOperations.cpp, the provided
callbacks invoke commands that are equivalent in effect to those that
would otherwise be invoked on the target GraphicsContext object in the
ShadowBlur class.
For now, this approach has to avoid the tiling-based drawing of the
rectangular shadows in drawRectShadow() and inset shadows in
drawInsetShadow(), and instead stick to the non-tiling fallback. While
only affecting Cairo-using ports, with some refactoring it should be
possible to again leverage the tiling-based approach as well.
The beginShadowLayer() and endShadowLayer() functions, which are only
used in CairoOperations.cpp, are replaced with the drawShadowLayer()
method. This one accepts an additional callback that allows the caller
to explicitly draw the shadow shape using the provided shadowing
GraphicsContext object. As with the other two new methods, a temporary
ImageBuffer object is used, and the buffer draw callback is invoked to
allow caller to properly handle the shadowing output.
In CairoOperations.cpp, the new ShadowBlur methods are exercised, with
direct Cairo operation invocation replacing the GraphicsContext calls
otherwise done through ShadowBlur. ShadowState object now also has to
track the global alpha and the global composite operator values so that
it can properly rasterize the resulting shadow into the final image.
No new tests -- no change in behavior.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::adjustBlurRadius):
(WebCore::ShadowBlur::calculateLayerBoundingRect):
(WebCore::ShadowBlur::drawRectShadow):
(WebCore::ShadowBlur::drawInsetShadow):
(WebCore::ShadowBlur::drawShadowLayer):
(WebCore::ShadowBlur::beginShadowLayer): Deleted.
(WebCore::ShadowBlur::endShadowLayer): Deleted.
* platform/graphics/ShadowBlur.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawShadowLayerBuffer):
(WebCore::Cairo::fillShadowBuffer):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowState::ShadowState):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::drawSurface):
* platform/graphics/cairo/CairoOperations.h:
Default-initialize FillSource::fillRule to RULE_NONZERO.
* platform/graphics/cairo/PlatformContextCairo.h:
Drop the ShadowBlur.h include, it's moved to CairoOperations.cpp.
* rendering/RenderThemeGtk.cpp:
Explicitly include the FloatRoundedRect.h header now that it's not
included through the ShadowBlur.h header via PlatformContextCairo.h.
2018-02-20 Sergio Villar Senin <svillar@igalia.com>
[WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR
https://bugs.webkit.org/show_bug.cgi?id=182961
Reviewed by Xabier Rodriguez-Calvar.
The shared feature was properly added to RuntimeEnabledFeatures some
time ago but the code was instead using a private method in
NavigatorWebVR to temporarily disable it. WebVR is enabled in
WebPreferences.yaml for GTK+ & WPE as default experimental feature.
* Modules/webvr/NavigatorWebVR.cpp:
(WebCore::NavigatorWebVR::getVRDisplays):
(WebCore::NavigatorWebVR::vrEnabled): Deleted.
2018-02-19 Antti Koivisto <antti@apple.com>
Use selector filter when invalidating descendants
https://bugs.webkit.org/show_bug.cgi?id=182839
<rdar://problem/37581072>
Reviewed by Zalan Bujtas.
We can make descendant invalidation faster by enabling filtering.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::initializeParentStack):
Traverse and reverse the ancestor chain, and push it.
(WebCore::SelectorFilter::pushParent):
(WebCore::SelectorFilter::pushParentInitializingIfNeeded):
Add a version of pushParent that can initialize the stack.
(WebCore::SelectorFilter::popParent):
(WebCore::SelectorFilter::popParentsUntil):
Pop until a given parent element.
(WebCore::SelectorFilter::pushParentStackFrame): Deleted.
(WebCore::SelectorFilter::popParentStackFrame): Deleted.
These were the same as push/popParent.
* css/SelectorFilter.h:
(WebCore::SelectorFilter::popParent): Deleted.
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForDescendants):
Use pushParentInitializingIfNeeded.
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
Use selector filter when doing descendant tree invalidation.
Make sure to pop it until the parent when reusing.
2018-02-19 Fujii Hironori <Hironori.Fujii@sony.com>
null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted
https://bugs.webkit.org/show_bug.cgi?id=161947
Reviewed by Ryosuke Niwa.
InsertedNodes happened to be empty if the inserted nodes were
removed. Add more checks if InsertedNodes is empty.
No new tests (Covered by existing tests).
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply): Return early if InsertedNodes becomes empty.
* editing/ReplaceSelectionCommand.h:
(WebCore::ReplaceSelectionCommand::InsertedNodes::isEmpty): New method.
(WebCore::ReplaceSelectionCommand::InsertedNodes::lastLeafInserted const):
Assert m_lastNodeInserted is not null.
(WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf const): Ditto.
2018-02-19 Said Abou-Hallawa <sabouhallawa@apple.com>
Add SVGPropertyTraits::fromString() to all the SVG animated types
https://bugs.webkit.org/show_bug.cgi?id=182901
Reviewed by Dean Jackson.
This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
goal is is to templatize the SVGAnimatedType class and to use SVGPropertyTraits
methods inside the template functions.
* WebCore.xcodeproj/project.pbxproj: Move the enum and the SVGPropertyTraits
from SVGMarkerElement.h to SVGMarkerTypes.h.
* svg/SVGAngle.h:
(WebCore::SVGAngle::SVGAngle): Delete unused constructor and create() method.
* svg/SVGAngleValue.h:
* svg/SVGAnimateMotionElement.cpp:
(WebCore::parsePoint): Deleted. Move this function to SVGParserUtilities.cpp
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::constructFromString): Use SVGPropertyTraits::fromString().
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::constructFromString): Ditto.
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::constructFromString): Ditto.
(WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Use const.
(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Ditto.
* svg/SVGAnimatedEnumeration.cpp:
(WebCore::SVGAnimatedEnumerationAnimator::constructFromString): Ditto.
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::constructFromString): Ditto.
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString): Ditto.
* svg/SVGAnimatedLength.cpp:
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::constructFromString): Ditto.
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::constructFromString): Ditto
(WebCore::parseNumberFromString):
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::constructFromString): Ditto.
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString): Ditto.
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::constructFromString): Ditto.
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::constructFromString): Ditto.
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString): Ditto.
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::constructFromString): Ditto.
* svg/SVGAnimatedString.cpp:
(WebCore::SVGAnimatedStringAnimator::constructFromString): Ditto.
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::constructFromString): Ditto.
* svg/SVGLength.h:
(WebCore::SVGLength::SVGLength): Delete unused constructor and create() method.
* svg/SVGLengthListValues.h:
(WebCore::SVGPropertyTraits<SVGLengthListValues>::fromString): New SVGPropertyTraits method.
(WebCore::SVGPropertyTraits<SVGLengthListValues>::parse): Ditto.
* svg/SVGMarkerElement.h:
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue): Deleted.
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString): Deleted.
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString): Deleted.
(WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Deleted.
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Deleted.
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Deleted.
* svg/SVGMarkerTypes.h: Added.
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue):
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
(WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue):
* svg/SVGMatrix.h: Delete unused constructor and create method.
* svg/SVGNumber.h:
(WebCore::SVGNumber::SVGNumber): Ditto.
* svg/SVGNumberListValues.h:
(WebCore::SVGPropertyTraits<SVGNumberListValues>::fromString): New SVGPropertyTraits method.
* svg/SVGParserUtilities.cpp:
(WebCore::parsePoint): This is moved from SVGAnimateMotionElement.cpp
* svg/SVGParserUtilities.h:
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::SVGPathByteStream):
(WebCore::SVGPathByteStream::operator=): Add copy and move assignment operators.
(WebCore::SVGPathByteStream::copy const): Use the copy assignment.
(WebCore::SVGPathByteStream::isEmpty const): Use Data.isEmpty().
(WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): New SVGPropertyTraits method.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Ditto.
* svg/SVGPathUtilities.cpp:
(WebCore::addToSVGPathByteStream): Answer Simon's questions which were added in r190844.
* svg/SVGPoint.h:
(WebCore::SVGPoint::SVGPoint): Delete unused constructor and create method.
* svg/SVGPointListValues.h:
(WebCore::SVGPropertyTraits<SVGPointListValues>::fromString): New SVGPropertyTraits method.
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::parseAttribute): Use the move assignment operator.
* svg/SVGPreserveAspectRatio.h:
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Delete unused constructor and create method.
* svg/SVGPreserveAspectRatioValue.cpp:
(WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): Add new constructor.
* svg/SVGPreserveAspectRatioValue.h:
(WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString): New SVGPropertyTraits method.
(WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString): Ditto.
* svg/SVGRect.h:
(WebCore::SVGRect::SVGRect): Delete unused constructor and create method.
* svg/SVGRectTraits.h: Removed.
* svg/SVGTransform.h:
(WebCore::SVGTransform::SVGTransform): Delete unused constructor and create method.
* svg/SVGTransformListValues.h:
(WebCore::SVGPropertyTraits<SVGTransformListValues>::fromString): New SVGPropertyTraits method.
* svg/properties/SVGPropertyTearOff.h: Delete unused create method.
* svg/properties/SVGPropertyTraits.h: New SVGPropertyTraits methods.
(WebCore::SVGPropertyTraits<bool>::fromString):
(WebCore::SVGPropertyTraits<Color>::initialValue):
(WebCore::SVGPropertyTraits<Color>::fromString):
(WebCore::SVGPropertyTraits<Color>::parse):
(WebCore::SVGPropertyTraits<Color>::toString):
(WebCore::SVGPropertyTraits<int>::fromString):
(WebCore::SVGPropertyTraits<float>::fromString):
(WebCore::SVGPropertyTraits<float>::parse):
(WebCore::SVGPropertyTraits<FloatPoint>::initialValue):
(WebCore::SVGPropertyTraits<FloatPoint>::fromString):
(WebCore::SVGPropertyTraits<FloatPoint>::parse):
(WebCore::SVGPropertyTraits<FloatPoint>::toString):
(WebCore::SVGPropertyTraits<FloatRect>::initialValue):
(WebCore::SVGPropertyTraits<FloatRect>::fromString):
(WebCore::SVGPropertyTraits<FloatRect>::parse):
(WebCore::SVGPropertyTraits<FloatRect>::toString):
(WebCore::SVGPropertyTraits<String>::fromString):
(WebCore::SVGPropertyTraits<String>::parse):
(WebCore::SVGPropertyTraits<String>::toString):
2018-02-19 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Implement a compact set of media controls
https://bugs.webkit.org/show_bug.cgi?id=182937
<rdar://problem/37682257>
Reviewed by Eric Carlson.
We add a new type of media controls used when we need stripped down and compact controls. The new
CompactMediaControls only show a play/pause button and an invalid placard and disregard all media
events that are not relevant to the display of these controls.
To distinguish cases where we need to show compact media controls, we expose a new property on
MediaControlsHost called "compactMode".
Tests: media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html
media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::base64StringForIconNameAndType const):
(WebCore::MediaControlsHost::compactMode const):
* Modules/mediacontrols/MediaControlsHost.h:
(WebCore::MediaControlsHost::setSimulateCompactMode):
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/modern-media-controls/controls/compact-media-controls.js: Added.
(CompactMediaControls.prototype.get scaleFactor):
(CompactMediaControls.prototype.set scaleFactor):
(CompactMediaControls.prototype.get shouldCenterControlsVertically):
(CompactMediaControls.prototype.set shouldCenterControlsVertically):
(CompactMediaControls.prototype.get placard):
(CompactMediaControls.prototype.set placard):
(CompactMediaControls.prototype.layout):
(CompactMediaControls.prototype.commitProperty):
* Modules/modern-media-controls/controls/icon-service.js:
(const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
(const.iconService.new.IconService):
* Modules/modern-media-controls/controls/inline-media-controls.js:
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/main.js:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits):
(MediaController.prototype._supportingObjectClasses): Compute the set of MediaControllerSupport classes based
on the layout traits such that in compact mode we only return PlacardSupport and PlaybackSupport.
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._controlsClassForLayoutTraits):
(MediaController.prototype._shouldControlsBeAvailable):
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents): Only track the "error" event in compact mode since this is the only
relevant placard.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): Only show or hide the play/pause button based on the playback state
when in compact mode.
(PlaybackSupport):
* WebCore.xcodeproj/project.pbxproj:
2018-02-19 Antoine Quint <graouts@apple.com>
[Web Animations] Make KeyframeEffect target nullable and read-write
https://bugs.webkit.org/show_bug.cgi?id=182741
Reviewed by Dean Jackson.
We used to completely disregard null targets, for instance not parsing keyframes, but targets
can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL
for KeyframeEffect to mark the target property as read-write and update the implementation
to correctly handle null targets.
This revealed a few issues in our implementation by allowing more WPT tests to run. So we also
ensure that:
- we don't crash when parsing font-related properties by calling update() on the generated
RenderStyle's FontCascade when parsing keyframes.
- CSS properties are provided as camel-case and not as hyphenated form
- values provided in keyframes dictionaries are only read for valid properties
- styles for effect targets are invalidated as soon as the timing model for that animation
is changed
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::invalidateElement): Add a new utility method to invalidate a given element since
we may want to invalidate not only the current target (m_target) but also a previous target.
(WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName
so that it can call that function. We also check that we reject CSS properties that are not provided in
camel-case form (eg. "font-size" vs. "fontSize").
(WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name
maps to a valid CSS property.
(WebCore::KeyframeEffectReadOnly::processKeyframes): Allow keyframes to be processed even if the effect's
target is null.
(WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and
invalidate the style of the new target and the old targets, if any. We also update the blending keyframes
since this task may not have been completed in a previous call to processKeyframes() due to the target being
null at that time.
(WebCore::KeyframeEffectReadOnly::invalidate): Use the invalidateElement() utility.
* animation/KeyframeEffectReadOnly.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget()
to inform the animation of the previous effect target and the new one upon a target change. This allows us to
forward this information onto the timeline so that we correctly add or remove the targets from the list of
animated elements.
* animation/WebAnimation.h:
2018-02-19 Chris Dumez <cdumez@apple.com>
Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
https://bugs.webkit.org/show_bug.cgi?id=182927
<rdar://problem/37675748>
Reviewed by Antti Koivisto.
Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
It is currently being called from a background thread in the following places:
- ServiceWorkerJob::didReceiveResponse()
- WorkerGlobalScope::importScripts()
These call sites on non-main threads were added recently with the support for service workers.
No new tests, already covered by existing tests that flakily experience service worker
process crashes.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
2018-02-19 Dean Jackson <dino@apple.com>
SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45
https://bugs.webkit.org/show_bug.cgi?id=182944
<rdar://problem/35369984>
Reviewed by Myles Maxfield.
Avoid a divide-by-zero.
Test: svg/text/font-bad-unitsperem.html
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::unitsPerEm const):
2018-02-19 Tim Horton <timothy_horton@apple.com>
REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ
https://bugs.webkit.org/show_bug.cgi?id=182910
<rdar://problem/37533950>
Reviewed by Simon Fraser.
We reverted other changes to the definition of client coordinates
in r219829 due to compatibility concerns. However, we failed to revert
r219342 on trunk, leaving elementFromPoint() using coordinates relative
to the layout viewport.
Add a currently off-by-default setting to switch on layout-viewport-relative
client coordinates and guard the elementFromPoint changes behind it.
A future patch should roll r219829 back in also behind this setting, so
that everything remains consistent regardless of which coordinate space we choose.
* dom/TreeScope.cpp:
(WebCore::absolutePointIfNotClipped):
* page/Settings.yaml:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest):
2018-02-19 Eric Carlson <eric.carlson@apple.com>
[Extra zoom mode] Don't allow PiP media playback
https://bugs.webkit.org/show_bug.cgi?id=182930
<rdar://problem/37676259>
Reviewed by Andy Estes.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled:
if it isn't implemented.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
2018-02-19 Antoine Quint <graouts@apple.com>
[Web Animations] Decouple parsing JS keyframes and computing blending keyframes
https://bugs.webkit.org/show_bug.cgi?id=182939
<rdar://problem/37678364>
Reviewed by Dean Jackson.
Move all the code used to create the KeyframeList into a dedicated updateBlendingKeyframes() method.
No new tests since this code change has no user-visible impact.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::processKeyframes):
(WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
* animation/KeyframeEffectReadOnly.h:
2018-02-19 Jer Noble <jer.noble@apple.com>
[EME] Add mechanism for MediaKeySession to react to HDCP changes
https://bugs.webkit.org/show_bug.cgi?id=182935
Reviewed by Eric Carlson.
Add a client callback interface to CDMInterface to allow subclasses to communicate up to
MediaKeySEssion. Add a virtual method to CDMInterface to allow it to be notified of HDCP
status changes. Override this method in CDMInstanceFairPlayStreamingAVFObjC. Hook up the
outputObscuredDueToInsufficientExternalProtectionChanged() methods in both
MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC to this new
CDMInstance method. Add an Internals method to simulate an HDCP error for testing purposes.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::~MediaKeySession):
(WebCore::MediaKeySession::updateKeyStatuses):
* Modules/encryptedmedia/MediaKeySession.h:
* platform/encryptedmedia/CDMInstance.h:
(WebCore::CDMInstance::setHDCPStatus):
(WebCore::CDMInstance::setClient):
(WebCore::CDMInstance::clearClient):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::beginSimulatedHDCPError):
(WebCore::MediaPlayer::endSimulatedHDCPError):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::beginSimulatedHDCPError):
(WebCore::MediaPlayerPrivateInterface::endSimulatedHDCPError):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::playerKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
* testing/Internals.cpp:
(WebCore::Internals::beginSimulatedHDCPError):
(WebCore::Internals::endSimulatedHDCPError):
* testing/Internals.h:
* testing/Internals.idl:
2018-02-19 Chris Dumez <cdumez@apple.com>
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase
https://bugs.webkit.org/show_bug.cgi?id=182931
<rdar://problem/37602962>
Reviewed by Antti Koivisto.
Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being
used from several threads in WebCoreNSURLSession. Also make sure it is
always destroyed on the main thread since it ends up destroying a
CachedRawResource object.
No new tests, no known reproduction case.
* platform/graphics/PlatformMediaResourceLoader.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask dealloc]):
2018-02-19 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy()
https://bugs.webkit.org/show_bug.cgi?id=182934
<rdar://problem/37678241>
Reviewed by Antti Koivisto.
No change in functionality.
* dom/Document.cpp:
(WebCore::Document::setFullScreenRenderer):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::willBeDestroyed):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
(WebCore::RenderTextFragment::setText):
* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeAndDestroy):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
(WebCore::RenderTreeBuilder::removeAndDestroyChild): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
2018-02-19 Daniel Bates <dabates@apple.com>
Do not block authentication challenge to navigated resources
https://bugs.webkit.org/show_bug.cgi?id=182807
<rdar://problem/37481619>
Reviewed by Brent Fulgham.
Blocking the main resource from asking for credentials depending on how it was
navigated to could be confusing to a person and breaks web compatibility. Restore
the behavior before r224134.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::willSendRequestInternal):
(WebCore::ResourceLoader::didBlockAuthenticationChallenge):
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials const):
(WebCore::ResourceLoader::isMixedContent const): Deleted.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const):
(WebCore::ResourceLoader::wasInsecureRequestSeen const): Deleted.
2018-02-17 Antoine Quint <graouts@apple.com>
[Web Animations] Store all parsed keyframe input information in a single structure
https://bugs.webkit.org/show_bug.cgi?id=182903
Reviewed by Dean Jackson.
When parsing keyframe input provided through the JS API, we used to create several data structures.
During parsing we would create a Vector<ProcessedKeyframe> where we would store the validated values
for "offset", "easing" and "composite" as well as CSS properties and CSS values as strings.
Then we would create a KeyframeList, a class that pre-dates the work on Web Animations and is used
for hardware animations, with RenderStyle objects that are used for CSS property blending at runtime.
Once the KeyframeList was created, the Vector<ProcessedKeyframe> was discarded.
Since KeyframeList did not know about nullable offsets, timing functions and composite operations, and
because we do not with to modify a legacy class that we will eventually remove once all the Web Animations
work is complete, we also stored the parsed offsets as m_offsets, the timing functions as m_timingFunctions
and the composite operations as m_compositeOperations.
In this patch we rename the ProcessedKeyframe structure used temporarily during parsing to ParsedKeyframe and
store both the input and processed data related to a given keyframe in that single structure which we keep
around as m_parsedKeyframes when we finished processing the keyframes input. This update ParsedKeyframe structure
allows to keep around the original nullable offsets, the original CSS properties and CSS values as strings as
a HashMap<CSSPropertyID, String>, as well as the CSS properties and CSS values as CSSValue objects using a
MutableStyleProperties object.
This has the benefit of reducing the number of members, but also pave the way for supporting read-write targets
where we will be able to decouple parsing keyframes and creating a KeyframeList, which requires a valid target
to create RenderStyle objects used for blending, since the original parsing-time information is now stored.
Finally, this allowed getKeyframes() to be more compliant by returning the CSS values as originally provided in
the keyframe input with shorthand properties when provided, rather than the long-hands we used to read back
through RenderStyle objects.
The generated KeyframeList is now stored as m_blendingKeyframes and is only used for the purpose of interfacing
with hardware animations and CSS property blending.
While ProcessedKeyframe was copyable due to holding only simple types, ParsedKeyframe is not since it uses a Ref
to hold the MutableStyleProperties. This uncovered some cases where we copied ProcessedKeyframe objects, we now
ensure that the ParsedKeyframe objects are moved instead, which was the correct thing to do all along.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::computeMissingKeyframeOffsets): While we used to store std::optional<double> for the computed offset,
we now store a simple double, which makes more sense since the computed offset is eventually a fully resolved
value after calling computeMissingKeyframeOffsets(). So we now compute the final computed offset without resorting
to intermediate nullable computed offsets.
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly):
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
(WebCore::KeyframeEffectReadOnly::getKeyframes):
(WebCore::KeyframeEffectReadOnly::processKeyframes):
(WebCore::KeyframeEffectReadOnly::computeStackingContextImpact):
(WebCore::KeyframeEffectReadOnly::shouldRunAccelerated):
(WebCore::KeyframeEffectReadOnly::getAnimatedStyle):
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::startOrStopAccelerated):
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::ParsedKeyframe::ParsedKeyframe):
2018-02-19 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Remove redundant RenderObject::removeFromParentAndDestroy
https://bugs.webkit.org/show_bug.cgi?id=182926
<rdar://problem/37674997>
Reviewed by Antti Koivisto.
Call RenderTreeBuilder::removeAndDestroyChild() directly instead.
No change in functionality.
* dom/Document.cpp:
(WebCore::Document::setFullScreenRenderer):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::willBeDestroyed):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy): Deleted.
* rendering/RenderObject.h:
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
(WebCore::RenderTextFragment::setText):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
2018-02-19 Tim Horton <timothy_horton@apple.com>
Increase text autosizing constants for extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=182919
<rdar://problem/37671259>
Reviewed by Wenson Hsieh.
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::defaultMinimumZoomFontSize):
(WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient):
(WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient):
(WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease):
* page/SettingsBase.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::oneLineTextMultiplier):
(WebCore::textMultiplier):
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustTextNodeSizes):
Make autosizing constants settings, and change their default values.
2018-02-17 Antoine Quint <graouts@apple.com>
[Web Animations] Accept null composite modes in keyframes
https://bugs.webkit.org/show_bug.cgi?id=182902
Reviewed by Dean Jackson.
The Web Animations spec used to specify that that composite modes should be non-null and instead not be
provided when specifying keyframes, but now null values are accepted. We update the IDL input types used
when parsing keyframes to allow for null values.
We had already updated the getKeyframes() output in webkit.org/b/182600.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::processIterableKeyframes):
(WebCore::processKeyframeLikeObject):
(WebCore::processPropertyIndexedKeyframes):
* animation/KeyframeEffectReadOnly.h:
* animation/KeyframeEffectReadOnly.idl:
2018-02-19 Ms2ger <Ms2ger@igalia.com>
Explicitly qualify some method calls on this in lamdas in Service Worker code.
https://bugs.webkit.org/show_bug.cgi?id=182875
Reviewed by Chris Dumez.
This is necessary for the code to build with GCC 5. Other code already
appears to have been adapted similarly.
No change in functionality.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::startLoadingMainResource):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::claim):
(WebCore::SWServer::Connection::resolveRegistrationReadyRequests):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateRegistrationState):
(WebCore::SWServerRegistration::setUpdateViaCache):
(WebCore::SWServerRegistration::setLastUpdateTime):
(WebCore::SWServerRegistration::fireUpdateFoundEvent):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
2018-02-19 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement::removeAndDestroyChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182915
<rdar://problem/37658123>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild): Deleted.
* rendering/RenderElement.h:
(WebCore::RenderElement::isChildAllowed const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy):
* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeAndDestroyChild):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2018-02-12 Sergio Villar Senin <svillar@igalia.com>
[WebVR][OpenVR] Implement getVRDisplays()
https://bugs.webkit.org/show_bug.cgi?id=182692
Reviewed by Žan Doberšek.
This provides an implementation of Navigator's getVRDisplays()
method using OpenVR as backend. It queues several promises in
a queue and resolves them all just once. The information retrieved
is very minimal for the time being, but this change lays the ground
for all the changes that are about to land.
The VR code uses a VRManager which is the interface with the
platform code and the responsible for instantiating the right
platform code. This platform code is currently being implemented
using OpenVR but could we also ported in the future to OpenXR or any
other VR SDK.
* CMakeLists.txt:
* Modules/webvr/NavigatorWebVR.cpp:
(WebCore::NavigatorWebVR::getVRDisplays):
(WebCore::NavigatorWebVR::vrEnabled):
* Modules/webvr/NavigatorWebVR.h:
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::create):
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::isConnected const):
(WebCore::VRDisplay::displayName const):
* Modules/webvr/VRDisplay.h:
* Modules/webvr/VRDisplayCapabilities.cpp:
(WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
(WebCore::VRDisplayCapabilities::hasPosition const):
(WebCore::VRDisplayCapabilities::hasOrientation const):
(WebCore::VRDisplayCapabilities::hasExternalDisplay const):
(WebCore::VRDisplayCapabilities::canPresent const):
(WebCore::VRDisplayCapabilities::maxLayer const):
* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::create):
* Sources.txt:
* platform/vr/VRManager.cpp: Added. This is the main interface used by bindings code to
access VR devices data provided by platform code.
(WebCore::VRManager::singleton):
(WebCore::VRManager::VRManager):
(WebCore::VRManager::~VRManager):
(WebCore::VRManager::refreshVRDevices):
* platform/vr/VRManager.h: Added.
* platform/vr/VRPlatformDisplay.h: Added. Abstraction of a VR display system. To be
implemented by backends like OpenVR, OpenXR...
* platform/vr/VRPlatformManager.h: Added. Abstraction of the platform specific class which
retrieves data from VR devices. To be implemented by backends like OpenVR, OpenXR...
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: Added.
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
* platform/vr/openvr/VRPlatformDisplayOpenVR.h: Added.
* platform/vr/openvr/VRPlatformManagerOpenVR.cpp: Added.
(WebCore::VRPlatformManagerOpenVR::create):
(WebCore::VRPlatformManagerOpenVR::VRPlatformManagerOpenVR):
(WebCore::VRPlatformManagerOpenVR::~VRPlatformManagerOpenVR):
(WebCore::VRPlatformManagerOpenVR::initOpenVR):
* platform/vr/openvr/VRPlatformManagerOpenVR.h: Added.
* WebCore.xcodeproj/project.pbxproj:
2018-02-19 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Apply automatic minimum size clamping to spanning items too
https://bugs.webkit.org/show_bug.cgi?id=182684
Reviewed by Javier Fernandez.
In r225776 we added the conditions from the spec to apply
the automatic minimum size clamping when required
but only to non-spanning items.
See: https://drafts.csswg.org/css-grid/#min-size-auto
This patch moves the code from GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem()
to GridTrackSizingAlgorithmStrategy::minSizeForChild()
that way the clamping is applied for both spanning and non-spanning items.
This somehow reverts r225776, as it was adding some duplicated code.
All the checks to know if we should use that part of the spec
were already present in GridTrackSizingAlgorithmStrategy::minSizeForChild().
Apart from using the previous code, there's a new loop to verify
that the max track sizing function is fixed for all the tracks of the item.
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2018-02-19 Philippe Normand <pnormand@igalia.com>
[GTK][GStreamer] Replaying a webm video twice causes the video to stop getting rendered
https://bugs.webkit.org/show_bug.cgi?id=176789
Reviewed by Xabier Rodriguez-Calvar.
Ensure the wrapped GstGLContext is set when the pipeline goes from
READY to PAUSED state. This is a workaround for
https://bugzilla.gnome.org/show_bug.cgi?id=757933.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Add debug statement.
(WebCore::MediaPlayerPrivateGStreamer::readyTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
Ensure the wrapped GstGLContext is set when the pipeline goes from
READY to PAUSED state.
(WebCore::MediaPlayerPrivateGStreamer::didEnd): Add debug statement.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Change the requestGLContext to be a method instead of a static
function. Being a static function was a requirement for the now-removed OpenWebRTC player.
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Add
debug statement, fix requestGLContext usage.
(WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): Refactor as method.
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): Fix requestGLContext usage.
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Remove fixed FIXME.
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGLVideoSinkContext):
Set display and app wrapped contexts on the video sink.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2018-02-19 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer] Crash in WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete
https://bugs.webkit.org/show_bug.cgi?id=166733
Reviewed by Philippe Normand.
There are a couple of issues to tackle here.
First is handling getting more than one missing plugin
installation request at the same time. For this we add the request
to a Vector and handle them there.
Second is that if the player is dead and we still get the result,
bad things happen. For that we "weaked" the pointer capture by the
lambda.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
Handle Vector of callbacks.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Weak
private player pointer and put the callback in the Vector.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Callback becomes Vector.
* platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h:
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete):
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
Callback function is refactored into a "using" type and added self
as parameter to the function.
2018-02-19 Philippe Normand <pnormand@igalia.com>
[GStreamer] Playbin3 support
https://bugs.webkit.org/show_bug.cgi?id=182530
Reviewed by Xabier Rodriguez-Calvar.
This patch introduces opt-in support for the playbin3 GStreamer
element. This new playback element is still considered
experimental but it can still be very useful for media assets
containing multiple tracks of the same type. In such scenario
audio/video decoders would be created only for the selected tracks
whereas playbin2 creates decoder for each track.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: Take
a weak pointer of the media player instead of playbin and call the
player when enabling tracks. Also use the GstStream API instead of
inspecting the pad when playbin3 is used.
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
(WebCore::AudioTrackPrivateGStreamer::disconnect):
(WebCore::AudioTrackPrivateGStreamer::markAsActive):
(WebCore::AudioTrackPrivateGStreamer::setEnabled):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp: GstStream and
GstStreamCollection smart pointer support.
(WTF::adoptGRef):
(WTF::refGPtr<GstStream>):
(WTF::derefGPtr<GstStream>):
(WTF::refGPtr<GstStreamCollection>):
(WTF::derefGPtr<GstStreamCollection>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
Use the GstStream API instead of inspecting the pad when playbin3
is used.
(WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
(WebCore::InbandTextTrackPrivateGStreamer::disconnect):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
(WebCore::InbandTextTrackPrivateGStreamer::create):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
m_{audio,video,text}Tracks are now hashmaps, which is a bit more
convenient to use than Vectors.
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Update our
tracks implementations depending on the streams stored in the
collection.
(WebCore::MediaPlayerPrivateGStreamer::enableTrack): Activate the
given track. This method is called by the TrackPrivate
implementations.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
Refactored legacy (playbin2) support for track hashmap storage.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::newTextSample): Use track hashmap storage.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): React on
playbin3 GstStream messages, store the collection provided and
activate the given selected streams accordingly.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Invalidate tracks no longer needed.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::sourceSetupCallback):
Refactoring, use source-setup signal instead of the source
property which is not supported in playbin3.
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
Promoted logging messages, GST_TRACE should be used for very
frequent and less interesting messages.
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Called by the source-setup signal handler.
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Debugging message added.
(WebCore::MediaPlayerPrivateGStreamer::setPreload): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Create a
playbin3 element if USE(GSTREAMER_PLAYBIN3) was enabled and
connect to playbin2 signals otherwise.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Promoted to public.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
New StreamCollectionChanged notification type, used the sub-class.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Support for GstStream API.
(WebCore::TrackPrivateBaseGStreamer::disconnect): Clear GstStream too.
(WebCore::TrackPrivateBaseGStreamer::tagsChanged): Get tags from GstStream.
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): No need to check m_pad twice.
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: Take
a weak pointer of the media player instead of playbin and call the
player when enabling tracks. Also use the GstStream API instead of
inspecting the pad when playbin3 is used.
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
(WebCore::VideoTrackPrivateGStreamer::disconnect):
(WebCore::VideoTrackPrivateGStreamer::markAsActive):
(WebCore::VideoTrackPrivateGStreamer::setSelected):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Pass player pointer to track constructor.
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Source-setup signal handler.
(WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2018-02-19 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r219298): RELEASE_ASSERT(!m_owningPointerForClose) fails in WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
https://bugs.webkit.org/show_bug.cgi?id=174354
<rdar://problem/33294987>
Reviewed by Michael Catanzaro.
UniqueIDBDatabase::invokeOperationAndTransactionTimer was called
even after m_owningPointerForClose was set in
UniqueIDBDatabase::didDeleteBackingStore.
No new tests (Covered by existing tests).
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
Do not start deleting the UniqueIDBDatabase. Just call invokeOperationAndTransactionTimer.
(WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
Assert m_owningPointerForClose is null.
2018-02-18 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com>
Fix build error after r228417 without ACCESSIBILITY
https://bugs.webkit.org/show_bug.cgi?id=182914
Reviewed by Chris Fleizach.
An inline empty version of AXObjectCache::deferFocusdUIElementChangeIfNeeded()
needs to be defined if not HAVE(ACCESSIBILITY).
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
2018-02-18 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] REGRESSION(r228238) Detach renderer before destroying its subtree.
https://bugs.webkit.org/show_bug.cgi?id=182908
<rdar://problem/37619394>
Reviewed by Antti Koivisto.
Prior to r228238 we first detached the to-be-destroyed renderer and then
started nuking its descendants. r228238 changed the order and now the descendants are
destroyed while they are still attached to the tree. Apparently some of the takeChild()
normalization logic gets triggered now that the renderers still have access to their previous/next
siblings. This is unexpected and it shouldn't matter whether the subtree is still attached.
Let's revert it to the original order for now (see webkit.org/b/182909).
Test: fast/block/crash-when-subtree-is-still-attached.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild):
2018-02-18 Charlie Turner <cturner@igalia.com>
[GStreamer] Push smaller buffers from HTTP source
https://bugs.webkit.org/show_bug.cgi?id=182829
Reviewed by Philippe Normand.
Split the received buffer into smaller buffers of a size consistent
with the basesrc (4KiB). It is important not to push large buffers
into the appsrc (where large is relative to the appsrc's configured
byte size). If large buffers are pushed, then when they are internally
dequeued by the appsrc, the buffering percentage can dramatically
plummet due to a large amount of bytes being removed after a push. This
can in turn trick the media player into thinking it needs to buffer,
and then issuing a spurious set of playing->paused then
paused->playing transitions, which by the time the buffering logic
completes, data are already available.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::dataReceived):
2018-02-17 Darin Adler <darin@apple.com>
Web Inspector: get rid of remaining uses of OptOutput<T>
https://bugs.webkit.org/show_bug.cgi?id=180607
Reviewed by Brian Burg.
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
(WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
of lineEndings().get().
(WebCore::InspectorStyle::styleWithProperties const): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
(WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
a std::unique_ptr<Vector>.
(WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
* inspector/InspectorStyleSheet.h: Updated for the above.
* inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
* inspector/agents/InspectorCanvasAgent.cpp: Ditto.
* inspector/agents/InspectorCanvasAgent.h: Ditto.
* inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
so we don't waste space with a pointer to the string.
(WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
explicit creation of String, which was wasteful and unnecessary.
(WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.
* inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
final instead of override.
* inspector/agents/InspectorPageAgent.cpp: Ditto.
* inspector/agents/InspectorPageAgent.h: Ditto.
2018-02-16 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Cleanup RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182899
<rdar://problem/37627888>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::moveChildTo):
(WebCore::RenderTreeBuilder::moveAllChildrenTo):
(WebCore::RenderTreeBuilder::moveChildrenTo):
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderButton): Deleted.
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::current):
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::takeChild):
* rendering/updating/RenderTreeBuilderFormControls.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2018-02-16 Daniel Bates <dabates@apple.com>
Remove UTF-32 BOM parsing code
https://bugs.webkit.org/show_bug.cgi?id=182900
<rdar://problem/37238717>
Reviewed by Alexey Proskuryakov.
The UTF-32 encodings were removed from the text codec registry in r224747. So,
we no longer need code to parse UTF-32{BE, LE} BOM or encode and decode these
variants.
* dom/TextDecoder.cpp:
(WebCore::codeUnitByteSize):
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::checkForBOM):
(WebCore::TextResourceDecoder::checkForHeadCharset):
* platform/text/TextEncoding.cpp:
(WebCore::TextEncoding::isNonByteBasedEncoding const):
(WebCore::UTF32BigEndianEncoding): Deleted.
(WebCore::UTF32LittleEndianEncoding): Deleted.
* platform/text/TextEncoding.h:
2018-02-16 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182896
<rdar://problem/37623051>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo): Deleted.
(WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
(WebCore::RenderBoxModelObject::moveAllChildrenToInternal): Deleted.
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::moveChildTo): Deleted.
(WebCore::RenderBoxModelObject::moveAllChildrenTo): Deleted.
(WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::moveChildTo):
(WebCore::RenderTreeBuilder::moveAllChildrenTo):
(WebCore::RenderTreeBuilder::moveChildrenTo):
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::moveAllChildrenToInternal):
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
(WebCore::RenderTreeBuilder::Block::takeChild):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/updating/RenderTreeBuilderBlockFlow.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2018-02-16 Andy Estes <aestes@apple.com>
[Cocoa] Stop using non-prefixed vDSP functions in 32-bit builds
https://bugs.webkit.org/show_bug.cgi?id=182898
<rdar://problem/37195079>
Reviewed by Tim Horton.
There's no need to use non-prefixed vDSP function aliases on 32-bit builds.
The vDSP-prefixed versions are available on all Cocoa platforms we currently support.
* platform/audio/DirectConvolver.cpp:
(WebCore::DirectConvolver::process):
* platform/audio/VectorMath.cpp:
(WebCore::VectorMath::vsmul):
(WebCore::VectorMath::vadd):
(WebCore::VectorMath::vmul):
(WebCore::VectorMath::zvmul):
2018-02-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r228575.
Introduced LayoutTest crashes under GuardMalloc.
Reverted changeset:
"Use ResourceLoader to load appcache manifest"
https://bugs.webkit.org/show_bug.cgi?id=182861
https://trac.webkit.org/changeset/228575
2018-02-16 Dean Jackson <dino@apple.com>
Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
https://bugs.webkit.org/show_bug.cgi?id=182894
Reviewed by Tim Horton.
Adjust the places where we check for PLATFORM(MAC) or
PLATFORM(IOS) related to WebGL, and instead rely
on USE(OPENGL) USE(OPENGL_ES).
* CMakeLists.txt:
* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::initializeOpenGLShimsIfNeeded):
* platform/graphics/GraphicsContext3DPrivate.cpp:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::createSharingContext):
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContextEGL::createWaylandContext):
* platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
(WebCore::GraphicsContext3D::getExtensions):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::initialize):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::~TextureMapperGLData):
(WebCore::TextureMapperGLData::getVAO):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::TextureMapperGL::endPainting):
* platform/graphics/texmap/TextureMapperGLHeaders.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
2018-02-16 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182885
<rdar://problem/37617371>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal): Deleted.
* rendering/RenderObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderElement):
2018-02-16 Youenn Fablet <youenn@apple.com>
Allow specifying which plug-ins are supported
https://bugs.webkit.org/show_bug.cgi?id=182748
Reviewed by Chris Dumez.
Tests: http/tests/plugins/nounsupported-plugin.html
http/tests/plugins/supported-plugin-all-origin-visibility.html
http/tests/plugins/supported-plugin-on-specific-origin.html
http/tests/plugins/supported-plugin-origin-specific-visibility.html
http/tests/plugins/unsupported-plugin-on-specific-origin.html
plugins/unsupported-plugin.html
Added support for computing plugin web visibility with the added knowledge of supported plugins.
In case of a plugin failing to be created due to being unsupported, update the UI
to use mark the plugin as "Unexpected plug in".
Added internal API to retrieve the plug-in error description message.
* English.lproj/Localizable.strings:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::setReplacement):
* html/HTMLPlugInElement.h:
* loader/EmptyClients.cpp:
* platform/LocalizedStrings.cpp:
(WebCore::unsupportedPluginText):
* platform/LocalizedStrings.h:
* plugins/PluginData.cpp:
(WebCore::PluginData::initPlugins):
* plugins/PluginData.h:
(WebCore::decodePluginNames):
(WebCore::encodePluginNames):
(WebCore::SupportedPluginNames::decode):
(WebCore::SupportedPluginNames::encode const):
* plugins/PluginInfoProvider.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::unavailablePluginReplacementText):
* rendering/RenderEmbeddedObject.h:
(WebCore::RenderEmbeddedObject::pluginReplacementTextIfUnavailable const):
* testing/Internals.cpp:
(WebCore::Internals::unavailablePluginReplacementText):
* testing/Internals.h:
* testing/Internals.idl:
2018-02-16 Chris Dumez <cdumez@apple.com>
http/tests/security/http-0.9/xhr-blocked.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182857
<rdar://problem/37616958>
Reviewed by Antti Koivisto.
WebCoreResourceHandleAsOperationQueueDelegate does not own the messageQueue and
the detachHandle function was failing to nullout m_messageQueue when the resourceHandle
gets destroyed. This means that callFunctionOnMainThread would sometimes try to append
to a dead messageQueue.
No new tests, already covered by:
http/tests/security/http-0.9/xhr-blocked.html is flaky
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):
2018-02-16 Antti Koivisto <antti@apple.com>
Assert in mixed blend animation
https://bugs.webkit.org/show_bug.cgi?id=182887
<rdar://problem/37598140>
Reviewed by Zalan Bujtas.
Test: fast/css/calc-mixed-blend-crash.html
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
Fix mismatch between the type test and the value used.
2018-02-16 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182876
<rdar://problem/37607604>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildIgnoringContinuation): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChildIgnoringContinuation): Deleted.
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildIgnoringContinuation): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::splitInlines):
2018-02-16 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Unify logic of ResourceHandleCurlDelegate into ResourceHandle
https://bugs.webkit.org/show_bug.cgi?id=182578
Reconstruct the classes to match Curl port network layer more similar
structure with other ports. Move CurlRequest handling into ResourceHandle
and makes CurlResourceHandleDelegate simple life cycle. Also its duty is
for most of incoming data and event handling from CurRequest.
Reviewed by Alex Christensen.
No new tests because there's no new behavior.
* platform/Curl.cmake:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::didReceiveResponse):
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::~CurlDownload):
(WebCore::CurlDownload::createCurlRequest):
(WebCore::CurlDownload::curlDidReceiveResponse):
(WebCore::CurlDownload::curlDidReceiveBuffer):
(WebCore::CurlDownload::curlDidComplete):
(WebCore::CurlDownload::curlDidFailWithError):
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::callClient):
(WebCore::CurlRequest::willSendData):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
(WebCore::CurlRequest::invalidateClient):
(WebCore::CurlRequest::setClient): Deleted.
* platform/network/curl/CurlRequestClient.h:
* platform/network/curl/CurlResourceHandleDelegate.cpp: Added.
(WebCore::CurlResourceHandleDelegate::CurlResourceHandleDelegate):
(WebCore::CurlResourceHandleDelegate::ref):
(WebCore::CurlResourceHandleDelegate::deref):
(WebCore::CurlResourceHandleDelegate::cancelledOrClientless):
(WebCore::CurlResourceHandleDelegate::client const):
(WebCore::CurlResourceHandleDelegate::d):
(WebCore::CurlResourceHandleDelegate::curlDidSendData):
(WebCore::handleCookieHeaders):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
(WebCore::CurlResourceHandleDelegate::curlDidComplete):
(WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
* platform/network/curl/CurlResourceHandleDelegate.h: Added.
(WebCore::CurlResourceHandleDelegate::response const):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandleInternal::~ResourceHandleInternal):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::cancelledOrClientless):
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::delegate):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::getCredential):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::continueAfterDidReceiveResponse):
(WebCore::ResourceHandle::shouldRedirectAsGET):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
(WebCore::ResourceHandle::handleDataURL):
* platform/network/curl/ResourceHandleCurlDelegate.cpp: Removed.
* platform/network/curl/ResourceHandleCurlDelegate.h: Removed.
2018-02-16 Youenn Fablet <youenn@apple.com>
Use ResourceLoader to load appcache manifest
https://bugs.webkit.org/show_bug.cgi?id=182861
Reviewed by Alex Christensen.
Covered by updated tests.
Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
Make use of it to load the app cache manifest.
Future work should load entries using the same loader.
Remove manifest handle.
Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
is handled by its ApplicationCacheGroup.
Add a ResourceLoader option to bypass the application cache.
Use it for manifest loading.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/ResourceLoaderOptions.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::stopLoading):
(WebCore::ApplicationCacheGroup::update):
(WebCore::ApplicationCacheGroup::createRequest):
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
(WebCore::ApplicationCacheGroup::didReceiveData):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::didFail):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
* loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
* loader/appcache/ApplicationCacheResourceLoader.h: Added.
2018-02-16 Chris Dumez <cdumez@apple.com>
Crash under WebCore::EventTarget::fireEventListeners
https://bugs.webkit.org/show_bug.cgi?id=182880
<rdar://problem/20788804>
Reviewed by Youenn Fablet.
Make sure the 'ended' event does not get dispatched on a
AudioScheduledSourceNode after ActiveDOMObjects have been stopped.
Test: webaudio/audiobuffersource-ended-detached-frame.html
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):
2018-02-16 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
https://bugs.webkit.org/show_bug.cgi?id=182771
<rdar://problem/36459988>
Reviewed by Brent Fulgham.
This patch implements PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
per https://www.w3.org/TR/webauthn/#isUserVerifyingPlatformAuthenticatorAvailable with some
limitations.
In addition, it changes DeferredPromise to DOMPromiseDeferred<> for all CredentialsManagement
and WebAuthN API.
Test: http/wpt/webauthn/public-key-is-user-verifying-platform-authenticator-available.html
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::store):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess const):
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/credentialmanagement/CredentialsMessenger.cpp:
(WebCore::CredentialsMessenger::addCreationCompletionHandler):
Remove a redundant assertion.
(WebCore::CredentialsMessenger::addRequestCompletionHandler):
Remove a redundant assertion.
(WebCore::CredentialsMessenger::addQueryCompletionHandler):
(WebCore::CredentialsMessenger::takeQueryCompletionHandler):
* Modules/credentialmanagement/CredentialsMessenger.h:
* Modules/webauthn/AuthenticatorManager.cpp:
(WebCore::AuthenticatorManagerInternal::initTimeoutTimer):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
(WebCore::AuthenticatorManager::isUserVerifyingPlatformAuthenticatorAvailable const):
* Modules/webauthn/AuthenticatorManager.h:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
* Modules/webauthn/PublicKeyCredential.h:
* testing/MockCredentialsMessenger.cpp:
(WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
(WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
* testing/MockCredentialsMessenger.h:
* testing/MockCredentialsMessenger.idl:
2018-02-16 Tim Horton <timothy_horton@apple.com>
Stop using EXCLUDED_SOURCE_FILE_NAMES for touch and gesture files in WebCore
https://bugs.webkit.org/show_bug.cgi?id=182866
Reviewed by Daniel Bates.
* Configurations/WebCore.xcconfig:
These generated files already have ENABLE() flags around them,
so there's no reason to exclude them explicitly.
2018-02-16 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build after r228562.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
2018-02-16 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182878
<rdar://problem/37608349>
Reviewed by Antti Koivisto.
This patch removes the last addChild() related mutation logic from the renderers.
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::didInsertChild):
(WebCore::RenderElement::addChild): Deleted.
* rendering/RenderElement.h:
(WebCore::RenderElement::isChildAllowed const):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderElement):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
2018-02-16 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r228546.
This caused a consistent crash on all macOS WK2 platforms.
Reverted changeset:
"Web Inspector: get rid of remaining uses of OptOutput<T>"
https://bugs.webkit.org/show_bug.cgi?id=180607
https://trac.webkit.org/changeset/228546
2018-02-16 Youenn Fablet <youenn@apple.com>
Log the error message when failing to open the database
https://bugs.webkit.org/show_bug.cgi?id=182795
<rdar://problem/37592399>
Unreviewed.
Fixing iOS simulator debug build.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
2018-02-16 Fujii Hironori <Hironori.Fujii@sony.com>
IndexedDB: Several test crash in when destroying a IDBKeyData
https://bugs.webkit.org/show_bug.cgi?id=167576
Reviewed by Michael Catanzaro.
IDBKeyDataHashTraits::constructDeletedValue is using operator= to
assign deletedValue. But, the value is destructed just before
calling constructDeletedValue. You can't use operator= for a
destructed value.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyDataHashTraits::constructDeletedValue):
Construct null value before assigning deletedValue.
2018-02-16 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182862
<rdar://problem/37595464>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChild): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderBlock): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::makeFences):
(WebCore::RenderTreeBuilder::MathML::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):
2018-02-16 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Add basic support for <input type='date'> using date picker UI
https://bugs.webkit.org/show_bug.cgi?id=182847
<rdar://problem/35143111>
Reviewed by Tim Horton.
Add new localized strings for "month", "day" and "year" as they appear in the date picker.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::textInputModeWriteButtonTitle):
(WebCore::textInputModeSpeechButtonTitle):
(WebCore::datePickerDayLabelTitle):
(WebCore::datePickerMonthLabelTitle):
(WebCore::datePickerYearLabelTitle):
(WebCore::textInputModeWriteButton): Deleted.
(WebCore::textInputModeSpeechButton): Deleted.
* platform/LocalizedStrings.h:
2018-02-16 Zan Dobersek <zdobersek@igalia.com>
HarfBuzzFace should operate with a FontPlatformData reference
https://bugs.webkit.org/show_bug.cgi?id=182863
Reviewed by Carlos Garcia Campos.
Instead of keeping a never-null pointer to FontPlatformData,
HarfBuzzFace should operate with a FontPlatformData reference.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::harfBuzzFace const):
* platform/graphics/harfbuzz/HarfBuzzFace.cpp:
(WebCore::HarfBuzzFace::HarfBuzzFace):
* platform/graphics/harfbuzz/HarfBuzzFace.h:
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFace):
(WebCore::HarfBuzzFace::createFont):
2018-02-15 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] parent.Render*::addChild() cleanup
https://bugs.webkit.org/show_bug.cgi?id=182842
<rdar://problem/37585524>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::makeFences):
(WebCore::RenderTreeBuilder::MathML::insertChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
2018-02-15 Megan Gardner <megan_gardner@apple.com>
Support scrolling for non-editable web-selection and start autoscroll when near screen edges
https://bugs.webkit.org/show_bug.cgi?id=182815
Reviewed by Tim Horton.
Adjust the position we are autoscrolling to so that when we are close to an edge, we will start autoscrolling
while we are still inside the view. Autoscrolling still happens when you drag past the edge of a view.
No new tests (This is difficult to test in this state, but when we switch assistants, test will also be added).
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::startSelectionAutoscroll):
(WebCore::EventHandler::cancelSelectionAutoscroll):
(WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
(WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const):
(WebCore::EventHandler::startTextAutoscroll): Deleted.
(WebCore::EventHandler::cancelTextAutoscroll): Deleted.
2018-02-15 Youenn Fablet <youenn@apple.com>
Log the error message when failing to open the database
https://bugs.webkit.org/show_bug.cgi?id=182795
Reviewed by Chris Dumez.
No change of behavior.
Print the error message as it does not contain any user private information.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
2018-02-15 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderMenuList::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182840
<rdar://problem/37583638>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderMenuList.cpp:
(RenderMenuList::didInsertChild):
(RenderMenuList::addChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::FormControls::insertChild):
(WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded): Deleted.
* rendering/updating/RenderTreeBuilderFormControls.h:
2018-02-15 Darin Adler <darin@apple.com>
Web Inspector: get rid of remaining uses of OptOutput<T>
https://bugs.webkit.org/show_bug.cgi?id=180607
Reviewed by Brian Burg.
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
(WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
of lineEndings().get().
(WebCore::InspectorStyle::styleWithProperties const): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
(WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
a std::unique_ptr<Vector>.
(WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
* inspector/InspectorStyleSheet.h: Updated for the above.
* inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
* inspector/agents/InspectorCanvasAgent.cpp: Ditto.
* inspector/agents/InspectorCanvasAgent.h: Ditto.
* inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
so we don't waste space with a pointer to the string.
(WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
explicit creation of String, which was wasteful and unnecessary.
(WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.
* inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
final instead of override.
* inspector/agents/InspectorPageAgent.cpp: Ditto.
* inspector/agents/InspectorPageAgent.h: Ditto.
2018-02-15 Chris Dumez <cdumez@apple.com>
Flaky Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html
https://bugs.webkit.org/show_bug.cgi?id=182270
<rdar://problem/36904314>
Reviewed by Antti Koivisto.
No new tests, already covered by existing tests that crash flakily on the bots.
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
isolate copy the initiator string as this object can be destroyed on a different thread. This was
causing the test to flakily crash as well when destroying ThreadLocalData.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(scheduledWithCustomRunLoopMode):
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
Fix thread safety issue in callFunctionOnMainThread. This function is called from a background thread
to get to the main thread. However, it relied on m_handle which would get nullified on the main thread
by detachHandle when the ResourceHandle is destroyed. Fix the issue by not relying on m_handle anymore.
(-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
- Go back to using autorelease() instead of get() for the returned objects to match the code pre-r224522.
- Dispatch the protectedSelf variables that were added in r227073 to the main thread to make sure we do
not get destroyed on the background thread when protectedSelf is the last strong reference to self.
Destroying the WebCoreResourceHandleAsOperationQueueDelegate on the background safe is unsafe due to
its m_messageQueue data member which contains lambdas that may capture anything.
- Add a Lock to protect against detachHandle getting called on the main thread and nulling out
m_handle / m_requestResult / m_cachedResponseResult while the background thread may be accessing
them.
2018-02-15 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTableRow::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182838
<rdar://problem/37580762>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::didInsertTableCell):
(WebCore::RenderTableRow::addChild): Deleted.
* rendering/RenderTableRow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderTableRow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
2018-02-15 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure that changing the timing model updates styles synchronously
https://bugs.webkit.org/show_bug.cgi?id=182836
Reviewed by Dean Jackson.
We did not invalidate the timing model when properties of an effect's timing object changed
and even when we did invalidate the timing model, we did not update styles on effect targets
synchronously, only scheduling such updates for the next animation frame.
In this patch we expose the effect on the timing object such that changing timing properties
can notify the effect of a change in the timing model, which can then be forwarded to the
animation (which already informs its timeline, if any).
Additionally, when an animation's timing model has changed, we now invalidate the effect, which
will update styles synchronously.
This produces a number of progressions in WPT tests.
* animation/AnimationEffectReadOnly.cpp:
(WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly): Set the timing object's effect upon
effect construction.
(WebCore::AnimationEffectReadOnly::~AnimationEffectReadOnly): Set the timing object's effect to
null upon effect destruction.
(WebCore::AnimationEffectReadOnly::timingDidChange): Notify the animation (if any) that its timing
model changed following a change in the timing properties.
* animation/AnimationEffectReadOnly.h: Add a new virtual invalidate() method that subclasses can
override to implement invalidation behavior when the animation finds out its timing model changed.
* animation/AnimationEffectTimingReadOnly.cpp: Notify the effect when a property changes such
that it may notify its animation of a timing model change.
(WebCore::AnimationEffectTimingReadOnly::propertyDidChange):
(WebCore::AnimationEffectTimingReadOnly::setIterationStart):
(WebCore::AnimationEffectTimingReadOnly::setIterations):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDuration):
(WebCore::AnimationEffectTimingReadOnly::setEasing):
(WebCore::AnimationEffectTimingReadOnly::setDelay):
(WebCore::AnimationEffectTimingReadOnly::setEndDelay):
(WebCore::AnimationEffectTimingReadOnly::setFill):
(WebCore::AnimationEffectTimingReadOnly::setIterationDuration):
(WebCore::AnimationEffectTimingReadOnly::setDirection):
* animation/AnimationEffectTimingReadOnly.h:
(WebCore::AnimationEffectTimingReadOnly::setEffect):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDelay):
(WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay):
(WebCore::AnimationEffectTimingReadOnly::setDelay): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setEndDelay): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setFill): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setIterationDuration): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setDirection): Deleted.
* animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange()
to align it with the new WebAnimation::timingModelDidChange() method.
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::setCurrentTime):
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::timingModelDidChange):
(WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::timingModelDidChange):
(WebCore::DocumentTimeline::updateAnimations):
(WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::invalidate): Override the invalidate() method to perform a synchronous
style update in order to ensure that timing properties are accounted for right as they change.
* animation/KeyframeEffectReadOnly.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingModelDidChange): Invalidate the effect and notify the timeline of a timing
model change when an animation is notified that its timing model has changed.
(WebCore::WebAnimation::setStartTime):
* animation/WebAnimation.h:
2018-02-15 Timothy Horton <timothy_horton@apple.com>
Fix the build.
* platform/ios/KeyEventCodesIOS.h:
2018-02-15 John Wilander <wilander@apple.com>
Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
https://bugs.webkit.org/show_bug.cgi?id=182812
<rdar://problem/37511406>
Reviewed by Brent Fulgham.
No new tests. Tested manually between versions of Safari.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
Now only expects these fields for model version 11 or higher:
- topFrameUniqueRedirectsTo
- topFrameUniqueRedirectsFrom
- subresourceUniqueRedirectsFrom
- timesAccessedAsFirstPartyDueToUserInteraction
- timesAccessedAsFirstPartyDueToStorageAccessAPI
* loader/ResourceLoadStatistics.h:
2018-02-15 Tim Horton <timothy_horton@apple.com>
Stop using EXCLUDED_SOURCE_FILE_NAMES for actual source files in WebCore
https://bugs.webkit.org/show_bug.cgi?id=182822
Reviewed by Dan Bernstein.
It's much easier to reason about things if xcconfigs don't apply extra
constraints to which source files actually build on a per-platform basis.
We should use #ifs instead like we usually do.
* Configurations/WebCore.xcconfig:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
* accessibility/ios/AccessibilityObjectIOS.mm:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/AccessibilityObjectMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* dom/DataTransferMac.mm:
* editing/ios/DictationCommandIOS.cpp:
* editing/ios/DictationCommandIOS.h:
* editing/ios/EditorIOS.mm:
* editing/ios/WebContentReaderIOS.mm:
* editing/mac/EditorMac.mm:
* editing/mac/WebContentReaderMac.mm:
* page/ios/EventHandlerIOS.mm:
* page/ios/FrameIOS.mm:
* page/mac/EventHandlerMac.mm:
* page/scrolling/ios/ScrollingCoordinatorIOS.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
* platform/ThreadCheck.h:
* platform/audio/ios/AudioDestinationIOS.h:
* platform/audio/ios/AudioFileReaderIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/ios/FontCacheIOS.mm:
* platform/graphics/ios/GraphicsContext3DIOS.h:
* platform/graphics/ios/IconIOS.mm:
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
* platform/graphics/mac/IconMac.mm:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
* platform/ios/CursorIOS.cpp:
* platform/ios/DeviceMotionClientIOS.h:
* platform/ios/DeviceOrientationClientIOS.h:
* platform/ios/EventLoopIOS.mm:
* platform/ios/KeyEventCodesIOS.h:
* platform/ios/LowPowerModeNotifierIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
* platform/ios/PlatformPasteboardIOS.mm:
* platform/ios/PlatformScreenIOS.mm:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
* platform/ios/SSLKeyGeneratorIOS.cpp:
* platform/ios/ScrollAnimatorIOS.h:
* platform/ios/ScrollAnimatorIOS.mm:
* platform/ios/ScrollViewIOS.mm:
* platform/ios/ScrollbarThemeIOS.h:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/SystemMemoryIOS.cpp:
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
* platform/ios/TileControllerMemoryHandlerIOS.cpp:
* platform/ios/TileControllerMemoryHandlerIOS.h:
* platform/ios/UserAgentIOS.mm:
* platform/ios/ValidationBubbleIOS.mm:
* platform/ios/WidgetIOS.mm:
* platform/mac/CursorMac.mm:
* platform/mac/EventLoopMac.mm:
* platform/mac/LocalCurrentGraphicsContext.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/NSScrollerImpDetails.mm:
* platform/mac/PasteboardMac.mm:
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
* platform/mac/PlatformPasteboardMac.mm:
* platform/mac/PlatformScreenMac.mm:
* platform/mac/PlatformSpeechSynthesizerMac.mm:
* platform/mac/SSLKeyGeneratorMac.mm:
* platform/mac/ScrollViewMac.mm:
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
* platform/mac/ThreadCheck.mm:
* platform/mac/UserAgentMac.mm:
* platform/mac/WebCoreView.h:
* platform/mac/WebCoreView.m:
* platform/mac/WidgetMac.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
* platform/network/ios/NetworkStateNotifierIOS.mm:
* platform/network/ios/WebCoreURLResponseIOS.h:
* platform/network/ios/WebCoreURLResponseIOS.mm:
* platform/network/mac/NetworkStateNotifierMac.cpp:
2018-02-15 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTableSection::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182835
<rdar://problem/37579191>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::willInsertTableRow):
(WebCore::RenderTableSection::addChild): Deleted.
* rendering/RenderTableSection.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild): Leftover from r228529.
(WebCore::RenderTreeBuilder::insertChildToRenderTable): Deleted. Leftover from r228529.
(WebCore::RenderTreeBuilder::insertChildToRenderTableSection): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
2018-02-15 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTable::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182832
<rdar://problem/37576362>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::willInsertTableColumn):
(WebCore::RenderTable::willInsertTableSection):
(WebCore::RenderTable::addChild): Deleted.
* rendering/RenderTable.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
2018-02-14 Darin Adler <darin@apple.com>
Use std::make_unique instead of explicit calls to new and instead of writing create functions
https://bugs.webkit.org/show_bug.cgi?id=182821
Reviewed by Anders Carlsson.
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient): Use std::make_unique insteadof create functions.
* loader/LinkPreloadResourceClients.h: Make constructors public, get rid of create functions,
make overrides be private and final, get rid of unnecessary public default virtual destructors
that the compiler will generate correctly without anything explicit.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMFactoryClearKey::createCDM): Use std::make_unique instead of std::unique_ptr/new.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use
std::make_unique instead of calling a create function.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Made the constructor
public and got rid of the create function.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::create): Deleted.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize const):
Use std::make_unique instead of std::unique_ptr/new.
2018-02-15 Andy Estes <aestes@apple.com>
Finish unifying Apple Pay and Payment Request sources
https://bugs.webkit.org/show_bug.cgi?id=182831
Reviewed by Keith Miller.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-02-15 Zan Dobersek <zdobersek@igalia.com>
HarfBuzzFace: rework cache entry reference holding
https://bugs.webkit.org/show_bug.cgi?id=182828
Reviewed by Michael Catanzaro.
Move the FaceCacheEntry and HarfBuzzFaceCache types into the
HarfBuzzFace class as CacheEntry and Cache, respectively. The Cache
singleton is also moved there.
In the HarfBuzzFace constructor, we now don't increase the CacheEntry
reference, but instead just keep a reference to that object through
a RefPtr<CacheEntry> object. We don't need to retrieve the hb_face_t
object and the glyph cache HashMap in the constructor anymore, we just
retrieve them when necessary through that CacheEntry reference.
In the destructor, that RefPtr<CacheEntry> object is nulled out before
the object in Cache is removed if that's where the final reference is
kept.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp:
(WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
(WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
(WebCore::HarfBuzzFace::cache):
(WebCore::HarfBuzzFace::HarfBuzzFace):
(WebCore::HarfBuzzFace::~HarfBuzzFace):
(WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
(WebCore::FaceCacheEntry::create): Deleted.
(WebCore::FaceCacheEntry::~FaceCacheEntry): Deleted.
(WebCore::FaceCacheEntry::face): Deleted.
(WebCore::FaceCacheEntry::glyphCache): Deleted.
(WebCore::FaceCacheEntry::FaceCacheEntry): Deleted.
(WebCore::harfBuzzFaceCache): Deleted.
* platform/graphics/harfbuzz/HarfBuzzFace.h:
(WebCore::HarfBuzzFace::CacheEntry::create):
(WebCore::HarfBuzzFace::CacheEntry::face):
(WebCore::HarfBuzzFace::CacheEntry::glyphCache):
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzGetGlyph):
(WebCore::HarfBuzzFace::createFont):
2018-02-15 Zan Dobersek <zdobersek@igalia.com>
FontPlatformData::harfBuzzFace() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=182825
Reviewed by Carlos Garcia Campos.
Have FontPlatformData::harfBuzzFace() return a reference instead of a
pointer, given that the returned HarfBuzzFace object cannot be null.
Call-sites of FontPlatformData::harfBuzzFace() are adjusted.
OpenTypeMathData constructors are also changed to not rely on
preprocessor to correctly position the closing brace.
* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::harfBuzzFace const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData):
2018-02-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
https://bugs.webkit.org/show_bug.cgi?id=181946
<rdar://problem/37258262>
Reviewed by Chris Dumez.
This patch changes the original async model from a work queue to IPC between WebProcess
and UIProcess. Since all authenticator operations must be handled in the UIProcess due
to sandboxing, this message passing IPC async model then surpasses the original multi
threading model. To cooperate that, a CredentialsMessenger class is then created and
all task dispatching code is moved thre.
As an improvement over existing code, static functions from PublicKeyCredential are
moved to AuthenticatorManager. AuthenticatorManager is made as a singleton such that
when static functions are called, they could reach the CredentialsMessenger to interact
with UIProccess. CredentialsMessenger and AuthenticatorManager are separated so later
on when other Credential types are created, they can reuse the same IPC messenger.
What's more, a mock CredentialsMessenger is then created to mock behaviors of UIProcess
for testing purpose.
Covered by existing tests.
* DerivedSources.make:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::CredentialsContainer):
(WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::PendingPromise::PendingPromise): Deleted.
(WebCore::CredentialsContainer::dispatchTask): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::PendingPromise::create): Deleted.
* Modules/credentialmanagement/CredentialsMessenger.cpp: Added.
(WebCore::CredentialsMessenger::exceptionReply):
(WebCore::CredentialsMessenger::addCreationCompletionHandler):
(WebCore::CredentialsMessenger::takeCreationCompletionHandler):
(WebCore::CredentialsMessenger::addRequestCompletionHandler):
(WebCore::CredentialsMessenger::takeRequestCompletionHandler):
(WebCore::CredentialsMessenger::addQueryCompletionHandler):
(WebCore::CredentialsMessenger::takeQueryCompletionHandler):
(WebCore::getIdFromAttestationObject):
* Modules/credentialmanagement/CredentialsMessenger.h: Added.
(WebCore::CreationReturnBundle::CreationReturnBundle):
(WebCore::AssertionReturnBundle::AssertionReturnBundle):
(WebCore::CredentialsMessenger::weakPtrFactory const):
* Modules/webauthn/Authenticator.cpp: Removed.
* Modules/webauthn/Authenticator.h: Removed.
* Modules/webauthn/AuthenticatorManager.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorManagerInternal::produceClientDataJson):
(WebCore::AuthenticatorManagerInternal::produceClientDataJsonHash):
(WebCore::AuthenticatorManagerInternal::initTimer):
(WebCore::AuthenticatorManagerInternal::didTimerFire):
(WebCore::AuthenticatorManager::singleton):
(WebCore::AuthenticatorManager::setMessenger):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/AuthenticatorManager.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredentialInternal::produceClientDataJson): Deleted.
(WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash): Deleted.
(WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject): Deleted.
(WebCore::PublicKeyCredential::collectFromCredentialStore): Deleted.
(WebCore::PublicKeyCredential::discoverFromExternalSource): Deleted.
(WebCore::PublicKeyCredential::store): Deleted.
(WebCore::PublicKeyCredential::create): Deleted.
(WebCore::PublicKeyCredential::rawId const): Deleted.
(WebCore::PublicKeyCredential::response const): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockCredentialsMessenger const):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCredentialsMessenger.cpp: Added.
(WebCore::MockCredentialsMessenger::MockCredentialsMessenger):
(WebCore::MockCredentialsMessenger::~MockCredentialsMessenger):
(WebCore::MockCredentialsMessenger::setAttestationObject):
(WebCore::MockCredentialsMessenger::setAssertionReturnBundle):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::getAssertion):
(WebCore::MockCredentialsMessenger::makeCredentialReply):
(WebCore::MockCredentialsMessenger::getAssertionReply):
* testing/MockCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* testing/MockCredentialsMessenger.idl: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2018-02-15 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderInline/RenderGrid::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182819
<rdar://problem/37558187>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild): Deleted.
* rendering/RenderGrid.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::takeChild): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):
2018-02-15 Antoine Quint <graouts@apple.com>
[Modern Media Controls] REGRESSION: Inline media controls are not disabled while in fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=182830
<rdar://problem/37537909>
Reviewed by Eric Carlson.
The test media/modern-media-controls/media-controller/ios/media-controller-stop-updates-in-fullscreen.html
regressed when fixing webkit.org/b/182668 since we now started only caring about the presence of the "controls"
attribute to identify that WebKit media controls should be available.
We now have a dedicated _shouldControlsBeAvailable() method which more clearly establishes the conditions under
which controls should be available and correctly disables them while in fullscreen on iOS, regardless of the
"controls" attribute value.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._shouldControlsBeAvailable):
(MediaController.prototype._updateControlsAvailability):
2018-02-15 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r228495.
This caused mulitple perf tests to fail consistently.
Reverted changeset:
"Resource Load Statistics: Make sure
WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
ingest older plist versions and not reset the database"
https://bugs.webkit.org/show_bug.cgi?id=182812
https://trac.webkit.org/changeset/228495
2018-02-15 Zan Dobersek <zdobersek@igalia.com>
Clean up HarfBuzzFaceCairo
https://bugs.webkit.org/show_bug.cgi?id=182824
Reviewed by Carlos Garcia Campos.
Clean up Cairo-specific bits of HarfBuzzFace implementation.
HarfBuzzFontData is simplified, removing the constructor and turning the
cairo_scaled_font_t member into a RefPtr<>, tying the Cairo object's
lifetime to the lifetime of the HarfBuzzFontData instance.
HarfBuzz font callbacks have the HarfBuzzFontData casting cleaned up,
casting the user data pointer straight into a HarfBuzzFontData reference
that's then used in the functions. HarfBuzzFontData member access is
also adjusted.
HarfBuzzFace::createFace() now references the cairo_scaled_font_t object
that is then set as the user data pointer, with the destroy callback
that dereferences that object also specified. With hb_face_t being a
reference-counted object itself, this ensures the cairo_scaled_font_t
object doesn't get destroyed while hb_face_t is still alive.
In HarfBuzzFace::createFont(), the hb_font_t creation is cleaned up,
with a C++ lambda used as the destroy callback.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzGetGlyph):
(WebCore::harfBuzzGetGlyphHorizontalAdvance):
(WebCore::harfBuzzGetGlyphExtents):
(WebCore::harfBuzzCairoGetTable):
(WebCore::HarfBuzzFace::createFace):
(WebCore::HarfBuzzFace::createFont):
(WebCore::HarfBuzzFontData::HarfBuzzFontData): Deleted.
(WebCore::destroyHarfBuzzFontData): Deleted.
2018-02-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] WebVTT caps changed in GStreamer 1.14
https://bugs.webkit.org/show_bug.cgi?id=182690
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use
text/vtt caps only for GStreamer versions inferior or equal to
1.12. In 1.13 (current git master) the VTT caps format changed to
application/x-subtitle-vtt.
2018-02-15 Zan Dobersek <zdobersek@igalia.com>
HarfBuzzFace should not be ref-counted
https://bugs.webkit.org/show_bug.cgi?id=182823
Reviewed by Carlos Garcia Campos.
The HarfBuzzFace objects shouldn't be copied along in FontPlatformData
copy assignment operator, which made it a requirement for that class to
be ref-counted. Cairo-based HarfBuzzFace implementation uses the
cairo_scaled_font_t object from FontPlatformData internally, but upon
FontPlatformData cloning that scaled font object could change, meaning
HarfBuzzFace object that's shared with another FontPlatformData object
would end up using a different cairo_scaled_font_t object from the one
that's been regenerated in the newly-cloned FontPlatformData object.
Instead of ref-counting the HarfBuzzFace objects, they should be handled
in FontPlatformData through std::unique_ptr<>. In the FontPlatformData
copy assignment operator, the copy target's m_harfBuzzFace object is
nulled out, allowing the next harfBuzzFace() call to construct an
object that properly leverages the cairo_scaled_font_t object that could
have changed during cloning.
* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=):
(WebCore::FontPlatformData::harfBuzzFace const):
* platform/graphics/harfbuzz/HarfBuzzFace.h:
(WebCore::HarfBuzzFace::create): Deleted.
2018-02-14 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderMathMLFenced::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182817
<rdar://problem/37556761>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::addChild): Deleted.
* rendering/mathml/RenderMathMLFenced.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderMathMLFenced): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::insertChild):
2018-02-14 Antti Koivisto <antti@apple.com>
Do sibling invalidation on mutation
https://bugs.webkit.org/show_bug.cgi?id=182809
Reviewed by Zalan Bujtas.
We used to invalidate siblings for sibling combinators and nth-pseudo classes during style resolution tree walk.
This would consider any element with invalid style a reason to invalidate siblings too. However we now do
accurate invalidation on class and attribute changes and this approach ends up invalidating too much.
This patch sibling style invalidation to mutation time and removes invalidation code from style resolution tree walk.
* dom/Element.cpp:
(WebCore::invalidateSiblingsIfNeeded):
Helper to invalidate siblings.
(WebCore::Element::invalidateStyle):
(WebCore::Element::invalidateStyleAndLayerComposition):
(WebCore::Element::invalidateStyleForSubtree):
(WebCore::Element::invalidateStyleAndRenderersForSubtree):
Invalidate siblings if needed based on affectsNextSibling/affectedByPreviousSibling bits.
(WebCore::Element::invalidateStyleInternal):
(WebCore::Element::invalidateStyleForSubtreeInternal):
Add "internal" versions that don't invalidate siblings. These are used by StyleInvalidator for accurate invalidation.
* dom/Element.h:
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateIfNeeded):
(WebCore::Style::Invalidator::invalidateStyle):
Use internal invalidation functions.
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveComposedTree):
Remove sibling invalidation.
* style/StyleTreeResolver.h:
2018-02-14 John Wilander <wilander@apple.com>
Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
https://bugs.webkit.org/show_bug.cgi?id=182812
<rdar://problem/37511406>
Reviewed by Brent Fulgham.
No new tests. Tested manually between versions of Safari.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
Now only expects these fields for model version 11 or higher:
- topFrameUniqueRedirectsTo
- topFrameUniqueRedirectsFrom
- subresourceUniqueRedirectsFrom
- timesAccessedAsFirstPartyDueToUserInteraction
- timesAccessedAsFirstPartyDueToStorageAccessAPI
* loader/ResourceLoadStatistics.h:
2018-02-14 Basuke Suzuki <Basuke.Suzuki@sony.com>
[WinCairo] Fix several build warnings under WebCore/platform
https://bugs.webkit.org/show_bug.cgi?id=182802
Reviewed by Konstantin Tokarev.
Warning C4101 'fileModificationDate': unreferenced local variable
Source\WebCore\platform\network\curl\CurlCacheEntry.cpp:279
Warning C4239 nonstandard extension used: 'argument': conversion from 'WTF::String'
to 'WTF::String &'
Source\WebCore\platform\text\win\LocaleWin.cpp:75
Source\WebCore\platform\text\win\LocaleWin.cpp:77
Warning C4838 conversion from 'UINT' to 'CLIPFORMAT' requires a narrowing conversion
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:170
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:325
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:332
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:351
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:358
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:366
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:373
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:380
Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:387
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::parseResponseHeaders):
* platform/text/win/LocaleWin.cpp:
(WebCore::LCIDFromLocaleInternal):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::registerClipboardFormat):
(WebCore::texthtmlFormat):
(WebCore::urlWFormat):
(WebCore::urlFormat):
(WebCore::filenameWFormat):
(WebCore::filenameFormat):
(WebCore::htmlFormat):
(WebCore::smartPasteFormat):
(WebCore::fileDescriptorFormat):
(WebCore::fileContentFormatZero):
2018-02-14 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182811
<rdar://problem/37549714>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addChild): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::addChild): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::addChild): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::addChild): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToSVGContainer): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGInline): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGRoot): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGText): Deleted.
* rendering/updating/RenderTreeBuilder.h:
2018-02-14 Daniel Bates <dabates@apple.com>
Disallow cross-origin subresources from asking for credentials
https://bugs.webkit.org/show_bug.cgi?id=182579
<rdar://problem/36162271>
Reviewed by Andy Estes.
Prompts for credentials to load cross-origin subresources are typically seen as unexpected
by a person that navigates to- or interacts with- a web page. The cross-origin and implicit
loading nature of these subresources makes asking for credentials questionable because they
are not being served by the same origin of the page a person explicitly loaded and are not
guaranteed to correspond to an explicit user interaction other than the initial load of the
page. We know that subresources that ask for credentials can be abused as part of a phishing
attack. It seems reasonable to disallow cross-origin subresources from asking for credentials
due to their questionable nature and the risk for abuse. This will also make the behavior
of WebKit match the behavior of Chrome.
Tests: http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials.html
http/tests/security/basic-auth-subresource.html
http/tests/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.html
http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::isSubresourceLoader const): Formerly non-const.
(WebCore::ResourceLoader::shouldAllowResourceToAskForCredentials const): Added.
(WebCore::ResourceLoader::didBlockAuthenticationChallenge): Emit Web Inspector console message if
the authentication challenge was blocked because the request is cross origin.
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Disallow a cross-origin
request from prompting for credentials.
(WebCore::ResourceLoader::isSubresourceLoader): Deleted; made const.
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader): Update ResourceLoader state so that block cross-origin
subresources from prompting for credentials, if applicable.
(WebCore::SubresourceLoader::isSubresourceLoader const): Formerly non-const.
(WebCore::SubresourceLoader::isSubresourceLoader): Deleted; made const.
* loader/SubresourceLoader.h:
* page/Settings.yaml: Add setting allowCrossOriginSubresourcesToAskForCredentials (defaults: false -
do not allow cross origin subresources to ask for credentials).
2018-02-14 Don Olmstead <don.olmstead@sony.com>
WebCore headers should not include config.h or PlatformExportMacros.h
https://bugs.webkit.org/show_bug.cgi?id=182799
Reviewed by Darin Adler.
No new tests. No change in behavior.
* Modules/speech/SpeechSynthesis.h:
* bindings/js/JSDOMGlobalObject.h:
* contentextensions/ContentExtensionError.h:
* contentextensions/DFA.h:
* dom/ContextDestructionObserver.h:
* dom/DeviceOrientationClient.h:
* dom/DeviceOrientationData.h:
* editing/cocoa/HTMLConverter.h:
* loader/FrameLoaderStateMachine.h:
* loader/cache/CachedResourceHandle.h:
* page/FrameDestructionObserver.h:
* page/RuntimeEnabledFeatures.h:
* platform/URL.h:
* platform/audio/AudioHardwareListener.h:
* platform/audio/AudioSession.h:
* platform/graphics/Color.h:
* platform/graphics/IntSize.h:
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/win/LocalWindowsContext.h:
* platform/network/CacheValidation.h:
* platform/network/CredentialBase.h:
* platform/network/ResourceHandleClient.h:
* platform/network/cf/CertificateInfo.h:
2018-02-12 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails
https://bugs.webkit.org/show_bug.cgi?id=182564
Reviewed by Wenson Hsieh.
Unfortunately, r228352 was inadaquate to fix copying & pasting of a list item from Microsoft Word into TinyMCE
in older verions of TinyMCE. This patch amends the approach taken by r228352 to make it work across the board
as well as unbreak GMail.
Turns out older versions of TinyMCE can't handle list items when computed styles are added as inline style
declarations by WebKit. To make this work, avoid adding any computed styles as inline styles within mso-list
conditionals as well as any p elements whose style attribute contains "mso-list" property. We would instead
preserve these styles by keeping Microsoft Word's CSS style rules in addition to special @list rules.
In addition, not keeping the style element of Microsoft Word in a head element as done in r228352 causes some
versions of TinyMCE to treat it as regular text, and inserting a bunch of @list rules as user visible text.
To work around this problem, we serialize the style rules as a comment (<!-- ~ -->) within a head element.
Furthermore, when Microsoft Word is in the compatibility mode, it does not generate xmlns:o as the first xmlns
declaration. Generalized the code to detect Microsoft Word's HTML declaration by looking for xmlns:o and xmlns:w
xmls declarations.
Finally, it turns out that Gmail has its own handling of list items copy & pasted from Microsoft Word, and also
needs this quirks but in the pasted HTML, not the one exposed in getData. As such, this patch also enables the
MSO list quirks in the pasted content as well as the one exposed in getData.
Tests: PasteHTML.PreservesMSOList
PasteHTML.PreservesMSOListInCompatibilityMode
PasteHTML.StripsMSOListWhenMissingMSOHTMLElement
PasteWebArchive.PreservesMSOList
PasteWebArchive.PreservesMSOListInCompatibilityMode
PasteWebArchive.StripsMSOListWhenMissingMSOHTMLElement
* editing/HTMLInterchange.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::removeHeadContents): Don't remove the special style element needed for the MSO list quirks since we
don't keep the computed style as inline styles in this case.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readWebArchive): Enable the quirks in the pasted content as well as opposed to
just in DataTransfer API exposed to the JavaScript.
(WebCore::WebContentReader::readHTML): Ditto.
* editing/markup.cpp:
(WebCore::shouldPreserveMSOLists): Added. Generalized the logic to detect a Microsoft Word document.
more xmlns declarations.
(WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement): Added.
(WebCore::StyledMarkupAccumulator::appendElement): Don't generate the second style element here for elements
with most-list properties. Instead, avoid overriding inline styles with computed styles altogether.
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Include the style rules as well as list rules
and wrap the "style" element in a "head" element to make it compatible with older versions of TinyMCE.
2018-02-14 Dean Jackson <dino@apple.com>
CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot + 618
https://bugs.webkit.org/show_bug.cgi?id=182798
<rdar://problem/23337253>
Reviewed by Eric Carlson.
Speculative fix for a crash in HTMLPlugInImageElement::didAddUserAgentShadowRoot.
The guess is that the m_swapRendererTimer is set, and the display state changes to
something that does not require a shadow root, but before the timer fires.
Fix this by ensuring that the timer is reset on every display state change.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::setDisplayState): Guard for sets that wouldn't
actually change value, and make sure we always reset the timer.
2018-02-14 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Don't use arrays as values for localisable strings
https://bugs.webkit.org/show_bug.cgi?id=182791
<rdar://problem/36007262>
Reviewed by Dean Jackson.
Localization tools expect localizable strings to be specified as key-value pairs where both the key and the pair
are plain strings. For the skip buttons, we used an array value to specify a replacement string. We now perform
this task in code with a centralized SkipSeconds constant defining the skip amount.
* English.lproj/modern-media-controls-localized-strings.js:
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/main.js:
(UIString):
* Modules/modern-media-controls/media/skip-back-support.js:
(SkipBackSupport.prototype.buttonWasPressed):
* Modules/modern-media-controls/media/skip-forward-support.js:
(SkipForwardSupport.prototype.buttonWasPressed):
2018-02-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r228444.
Introduced API and Layout test failures.
Reverted changeset:
"[WebAuthN] Revisit the whole async model of task dispatching,
timeout and aborting"
https://bugs.webkit.org/show_bug.cgi?id=181946
https://trac.webkit.org/changeset/228444
2018-02-14 Brent Fulgham <bfulgham@apple.com>
Confirm proper thread in UserGestureIndicator constructor
https://bugs.webkit.org/show_bug.cgi?id=175980
Reviewed by Daniel Bates.
Document is a main-thread object. If we enter the UserGestureIndicator constructor
on a non-main thread, we should ASSERT, not return silently.
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
2018-02-14 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Remove redundant RenderTreeBuilder methods
https://bugs.webkit.org/show_bug.cgi?id=182770
<rdar://problem/37525627>
Reviewed by Daniel Bates.
No change in functionality.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::dropAnonymousBoxChild): Deleted.
(WebCore::RenderTreeBuilder::moveRubyChildren): Deleted.
(WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChild):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
2018-02-14 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182762
<rdar://problem/37523756>
Reviewed by Daniel Bates.
This patch removes the remaining takeChild() related mutation logic from the renderers.
No change in functionality.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::takeChild): Deleted.
(WebCore::RenderElement::takeChildInternal): Deleted.
* rendering/RenderElement.h:
* rendering/RenderObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::takeChildFromRenderElement):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
(WebCore::RenderTreeBuilder::Block::takeChild):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::splitFlow):
(WebCore::RenderTreeBuilder::Inline::splitInlines):
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::takeChild): Leftover from the previous patch.
2018-02-13 Antti Koivisto <antti@apple.com>
REGRESSION(r228313): Membuster | macOS | All Devices | 1.5 MB
https://bugs.webkit.org/show_bug.cgi?id=182744
<rdar://problem/37463770>
Reviewed by Zalan Bujtas.
We need to respect low memory notifications explicitly now that the compiled selectors are not part of RuleData.
* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
* css/StyleRule.h:
Switch to std::unique_ptr<[]> from Vector to avoid unnecessary bloat.
* css/StyleSheetContents.cpp:
(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseRules const):
Add a rule traversal function, similar to the existing traverseSubresources.
(WebCore::StyleSheetContents::traverseSubresources const):
Use traverseRules to implement traverseSubresources.
(WebCore::traverseSubresourcesInRules): Deleted.
* css/StyleSheetContents.h:
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
* style/StyleScope.cpp:
(WebCore::Style::Scope::releaseMemory):
Release memory for compiled selectors on memory notification.
* style/StyleScope.h:
2018-02-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r228431.
https://bugs.webkit.org/show_bug.cgi?id=182766
Regressed CMake build stability (Requested by dolmstead on
#webkit).
Reverted changeset:
"[CMake] Make WebCore headers copies"
https://bugs.webkit.org/show_bug.cgi?id=182512
https://trac.webkit.org/changeset/228431
2018-02-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r228437, r228439, and r228440.
https://bugs.webkit.org/show_bug.cgi?id=182756
Introduced LayoutTest failures (Requested by ryanhadd_ on
#webkit).
Reverted changesets:
"[Web Animations] Make KeyframeEffect target nullable and
read-write"
https://bugs.webkit.org/show_bug.cgi?id=182741
https://trac.webkit.org/changeset/228437
"Unreviewed attempt to fix build after r228437."
https://trac.webkit.org/changeset/228439
"[Web Animations] Make KeyframeEffect target nullable and
read-write"
https://bugs.webkit.org/show_bug.cgi?id=182741
https://trac.webkit.org/changeset/228440
2018-02-13 Antoine Quint <graouts@apple.com>
Removing the controls attribute from a <video> element does not tear down the controls shadow DOM nor cancel event listeners.
https://bugs.webkit.org/show_bug.cgi?id=182668
<rdar://problem/33793004>
Reviewed by Jer Noble.
When controls were turned off for inline media players, we would remove all media controls elements from the shadow root,
but we would nevertheless continue to listen to media events and, as a result, update properties of the media controls
which would lead to requestAnimationFrame() calls that would update the detached DOM nodes.
We now only listent to media events if controls are turned on.
* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.enable): Remove the mutation observer from ControlsVisibilitySupport since observing
changes to the controls attribute is now performed directly in MediaController. We need to make sure that we update the
controls however since fadesWhileIdle is turned off in the disable() call to ensure that the auto-hide behavior is disabled
as well.
(ControlsVisibilitySupport.prototype.disable): Disable the auto-hide controller as well.
(ControlsVisibilitySupport.prototype._updateControls): Remove code that has now been moved into MediaController._updateControlsAvailability().
* Modules/modern-media-controls/media/media-controller.js:
(MediaController): Listen to the "play" event on the media so that we call _updateControlsAvailability() in this situation to account for
shouldForceControlsDisplay on MediaControlsHost. We also register for a mutation observer to track when the controls attribute availability
changes in which case we want to call _updateControlsAvailability() as well.
(MediaController.prototype.handleEvent): Call _updateControlsAvailability() instead of _updateiOSFullscreenProperties() which has been renamed
and expanded.
(MediaController.prototype._updateControlsIfNeeded): Call _updateControlsAvailability() after controls have been updated.
(MediaController.prototype._updateControlsAvailability): We now disable supporting media controller objects when we know that controls should
be hidden in all cases except when in fullscreen on macOS.
(MediaController.prototype._updateiOSFullscreenProperties): Deleted.
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.disable): Only allow the media events required to track when to show placards when in fullscreen since inline media
players need to show the AirPlay and picture-in-picture placards even when controls are disabled.
2018-02-13 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
https://bugs.webkit.org/show_bug.cgi?id=181946
<rdar://problem/37258262>
Reviewed by Chris Dumez.
This patch changes the original async model from a work queue to IPC between WebProcess
and UIProcess. Since all authenticator operations must be handled in the UIProcess due
to sandboxing, this message passing IPC async model then surpasses the original multi
threading model. To cooperate that, a CredentialsMessenger class is then created and
all task dispatching code is moved thre.
As an improvement over existing code, static functions from PublicKeyCredential are
moved to AuthenticatorManager. AuthenticatorManager is made as a singleton such that
when static functions are called, they could reach the CredentialsMessenger to interact
with UIProccess. CredentialsMessenger and AuthenticatorManager are separated so later
on when other Credential types are created, they can reuse the same IPC messenger.
What's more, a mock CredentialsMessenger is then created to mock behaviors of UIProcess
for testing purpose.
Covered by existing tests.
* DerivedSources.make:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::CredentialsContainer):
(WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::PendingPromise::PendingPromise): Deleted.
(WebCore::CredentialsContainer::dispatchTask): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::PendingPromise::create): Deleted.
* Modules/credentialmanagement/CredentialsMessenger.cpp: Added.
(WebCore::CredentialsMessenger::exceptionReply):
(WebCore::CredentialsMessenger::addCreationCompletionHandler):
(WebCore::CredentialsMessenger::takeCreationCompletionHandler):
(WebCore::CredentialsMessenger::addRequestCompletionHandler):
(WebCore::CredentialsMessenger::takeRequestCompletionHandler):
(WebCore::CredentialsMessenger::addQueryCompletionHandler):
(WebCore::CredentialsMessenger::takeQueryCompletionHandler):
(WebCore::getIdFromAttestationObject):
* Modules/credentialmanagement/CredentialsMessenger.h: Added.
(WebCore::CreationReturnBundle::CreationReturnBundle):
(WebCore::AssertionReturnBundle::AssertionReturnBundle):
(WebCore::CredentialsMessenger::weakPtrFactory const):
* Modules/webauthn/Authenticator.cpp: Removed.
* Modules/webauthn/Authenticator.h: Removed.
* Modules/webauthn/AuthenticatorManager.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorManagerInternal::produceClientDataJson):
(WebCore::AuthenticatorManagerInternal::produceClientDataJsonHash):
(WebCore::AuthenticatorManagerInternal::initTimer):
(WebCore::AuthenticatorManagerInternal::didTimerFire):
(WebCore::AuthenticatorManager::singleton):
(WebCore::AuthenticatorManager::setMessenger):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/AuthenticatorManager.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredentialInternal::produceClientDataJson): Deleted.
(WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash): Deleted.
(WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject): Deleted.
(WebCore::PublicKeyCredential::collectFromCredentialStore): Deleted.
(WebCore::PublicKeyCredential::discoverFromExternalSource): Deleted.
(WebCore::PublicKeyCredential::store): Deleted.
(WebCore::PublicKeyCredential::create): Deleted.
(WebCore::PublicKeyCredential::rawId const): Deleted.
(WebCore::PublicKeyCredential::response const): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockCredentialsMessenger const):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCredentialsMessenger.cpp: Added.
(WebCore::MockCredentialsMessenger::setAttestationObject):
(WebCore::MockCredentialsMessenger::setAssertionReturnBundle):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::getAssertion):
(WebCore::MockCredentialsMessenger::makeCredentialReply):
(WebCore::MockCredentialsMessenger::getAssertionReply):
* testing/MockCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* testing/MockCredentialsMessenger.idl: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2018-02-13 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182746
<rdar://problem/37512871>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild): Deleted.
* rendering/RenderBlock.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
(WebCore::RenderTreeBuilder::takeChildFromRenderBlock): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
2018-02-13 Antoine Quint <graouts@apple.com>
[Web Animations] Make KeyframeEffect target nullable and read-write
https://bugs.webkit.org/show_bug.cgi?id=182741
Additional unreviewed attempt to fix build after r228437.
* dom/Element.h:
2018-02-13 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix build after r228437.
* dom/Element.h:
2018-02-13 Antoine Quint <graouts@apple.com>
[Web Animations] Make KeyframeEffect target nullable and read-write
https://bugs.webkit.org/show_bug.cgi?id=182741
Reviewed by Dean Jackson.
We used to completely disregard null targets, for instance not parsing keyframes, but targets
can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL
for KeyframeEffect to mark the target property as read-write and update the implementation
to correctly handle null targets by creating a StyleResolver based on the ScriptExecutionContext's
document's document element (the <html> element in practice) and not the target itself, since it
can be null.
This revealed a few issues in our implementation by allowing more WPT tests to run. So we also
ensure that:
- we don't crash when parsing font-related properties by calling update() on the generated
RenderStyle's FontCascade when parsing keyframes.
- CSS properties are provided as camel-case and not as hyphenated form
- values provided in keyframes dictionaries are only read for valid properties
- styles for effect targets are invalidated as soon as the timing model for that animation
is changed
We also rename AnimationTimeline::animationTimingModelDidChange() to AnimationTimeline::timingModelDidChange()
since the previous name didn't add useful information and we're adding a new WebAnimation::timingModelDidChange()
method, so having the two methods have a similar name made more sense.
* animation/Animatable.idl: Call animate() with a ScriptExecutionContext rather than a ScriptState
so that the ScriptExecutionContext can be passed to the KeyframeEffectReadOnly constructor.
* animation/AnimationEffectReadOnly.h: Add a new invalidate() method, designed to be subclassed, that
is called when the timing model for this effect or owning animation has changed.
* animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange().
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::setCurrentTime):
* animation/AnimationTimeline.h: Rename animationTimingModelDidChange() to timingModelDidChange().
(WebCore::AnimationTimeline::timingModelDidChange):
(WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange().
(WebCore::DocumentTimeline::timingModelDidChange):
(WebCore::DocumentTimeline::updateAnimations):
(WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.h: Rename animationTimingModelDidChange() to timingModelDidChange().
* animation/KeyframeEffect.cpp: Expect a ScriptExecutionContext rather than a ScriptState.
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::setKeyframes):
* animation/KeyframeEffect.h: Expect a ScriptExecutionContext rather than a ScriptState.
* animation/KeyframeEffect.idl: Expect a ScriptExecutionContext rather than a ScriptState and make the
target property read-write.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName
so that it can call that function. We also check that we reject CSS properties that are not provided in
camel-case form (eg. "font-size" vs. "fontSize").
(WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name
maps to a valid CSS property.
(WebCore::KeyframeEffectReadOnly::create): Expect a ScriptExecutionContext rather than a ScriptState.
(WebCore::KeyframeEffectReadOnly::processKeyframes): Expect a ScriptExecutionContext rather than a ScriptState
and use the context's document to get an HTML element to create a StyleResolver. We also call update() on the
generated RenderStyle's FontCascade since otherwise we would hit an ASSERT in FontCascade when parsing font-related
CSS properties.
(WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and invalidate
the style of the new target and the old targets, if any.
(WebCore::KeyframeEffectReadOnly::invalidate): Invalidate the target's style. This method is called by setTarget()
and WebAnimation::timingModelDidChange().
* animation/KeyframeEffectReadOnly.h: Expect a ScriptExecutionContext rather than a ScriptState.
* animation/KeyframeEffectReadOnly.idl: Expect a ScriptExecutionContext rather than a ScriptState.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingModelDidChange): We add this new method such that any place in WebAnimation where we
know the animation's timing model has changed we can invalidate the associated effect, if any, as well as notify
the timeline, if any. We used to only notify the timeline and, as a result, only invalidate the associated effect
in the next display monitor refresh.
(WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget() to inform
the animation of the previous effect target and the new one upon a target change. This allows us to forward this information
onto the timeline so that we correctly add or remove the targets from the list of animated elements.
(WebCore::WebAnimation::setStartTime):
* animation/WebAnimation.h: Expose the new effectTargetDidChange() and timingModelDidChange() methods.
* dom/Element.cpp: Expect a ScriptExecutionContext rather than a ScriptState.
(WebCore::Element::animate):
* dom/Element.h: Expect a ScriptExecutionContext rather than a ScriptState.
2018-02-13 Antti Koivisto <antti@apple.com>
Crash when breakpoint hit in unload handler
https://bugs.webkit.org/show_bug.cgi?id=169855
<rdar://problem/28683567>
Reviewed by Daniel Bates.
Test: inspector/debugger/reload-paused.html
CachedRawResource::updateBuffer may generate unload event in client notify callback. If Inspector was
paused, this even would spawn a nested runloop. CachedRawResource::finishLoading would get called in
the nested loop, confusing the DocumentLoader state machine and resulting in crashes later.
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):
- Set a bit when entering the client callback.
- Ensure we don't re-enter updateBuffer.
- If finishLoading got delayed during client callback, do it at the end.
(WebCore::CachedRawResource::finishLoading):
If we are in updateBuffer client callback, save the buffer and bail out.
* loader/cache/CachedRawResource.h:
2018-02-13 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlockFlow::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182739
<rdar://problem/37506542>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::takeChild): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::multiColumnRelativeWillBeRemoved): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
* rendering/updating/RenderTreeBuilderBlock.h:
2018-02-13 Don Olmstead <don.olmstead@sony.com>
[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512
Reviewed by Keith Miller.
No new tests. No change in behavior.
* CMakeLists.txt:
* PlatformAppleWin.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
* platform/Cairo.cmake:
* platform/Curl.cmake:
* platform/FreeType.cmake:
* platform/GStreamer.cmake:
* platform/ImageDecoders.cmake:
* platform/TextureMapper.cmake:
* platform/graphics/win/LocalWindowsContext.h:
2018-02-13 Chris Dumez <cdumez@apple.com>
REGRESSION (r228299): Broke reader mode in Safari
https://bugs.webkit.org/show_bug.cgi?id=182697
<rdar://problem/37399012>
Reviewed by Ryosuke Niwa.
Rework the fix for r228299 to be more targeted. I moved the policy check
cencelation from FrameLoader::stopLoading() to NavigationScheduler::schedule()
when a pending load is cancelled by another load. I have verified that the
sites fixed by r228299 still work with this more limited change. However,
reader mode is now working again.
The issue seems to be that we tell CFNetwork to continue with the load after
receiving the response, even if the client has not responded to the
decidePolicyForNavigationResponse delegate yet. As a result, CFNetwork sends
us the resource data and we may commit the provisional load before receiving
the policy response from the client. When the provisional load is committed,
we call FrameLoader::stopLoading() which after r228299 cancelled pending
policy checks. Because we did not wait for the policy check response to
commit the load, we would cancel it which would make the load fail.
The real fix here would be to make not tell CFNetwork to continue until after
we've received the policy delegate response. However, this is a larger and
riskier change at this point. I will follow-up on this issue.
Covered by new API test.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::schedule):
2018-02-13 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderSVG*::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182736
<rdar://problem/37503107>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::takeChild): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::takeChild): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::takeChild): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::takeChild): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::takeChild):
* rendering/updating/RenderTreeBuilderSVG.h:
2018-02-13 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderGrid::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182734
<rdar://problem/37500876>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::takeChild): Deleted.
* rendering/RenderGrid.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
* rendering/updating/RenderTreeBuilder.h:
2018-02-13 Nan Wang <n_wang@apple.com>
AX: Remove AccessibleNode class
https://bugs.webkit.org/show_bug.cgi?id=182724
<rdar://problem/37486024>
Reviewed by Chris Fleizach.
Removed all the AccessibleNode related code since AOM has
an alternate direction now.
No new tests. Made sure existing tests don't break.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::findModalNodes):
(WebCore::nodeHasRole):
(WebCore::AXObjectCache::handleLiveRegionCreated):
(WebCore::AXObjectCache::handleMenuItemSelected):
(WebCore::AXObjectCache::handleModalChange):
(WebCore::isNodeAriaVisible):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::isMultiSelectable const):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::readOnlyValue const):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::roleValue const):
(WebCore::AccessibilityImageMapLink::accessibilityDescription const):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isEnabled const):
(WebCore::AccessibilityListBoxOption::stringValue const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isEnabled const):
(WebCore::AccessibilityNodeObject::isPressed const):
(WebCore::AccessibilityNodeObject::isChecked const):
(WebCore::AccessibilityNodeObject::isMultiSelectable const):
(WebCore::AccessibilityNodeObject::isRequired const):
(WebCore::AccessibilityNodeObject::headingLevel const):
(WebCore::AccessibilityNodeObject::valueDescription const):
(WebCore::AccessibilityNodeObject::valueForRange const):
(WebCore::AccessibilityNodeObject::maxValueForRange const):
(WebCore::AccessibilityNodeObject::minValueForRange const):
(WebCore::AccessibilityNodeObject::ariaAccessibilityDescription const):
(WebCore::siblingWithAriaRole):
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::alternativeText const):
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea const):
(WebCore::AccessibilityNodeObject::hierarchicalLevel const):
(WebCore::shouldUseAccessibilityObjectInnerText):
(WebCore::AccessibilityNodeObject::stringValue const):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::readOnlyValue const):
(WebCore::AccessibilityObject::supportsAutoComplete const):
(WebCore::AccessibilityObject::autoCompleteValue const):
(WebCore::AccessibilityObject::ariaIsMultiline const):
(WebCore::AccessibilityObject::invalidStatus const):
(WebCore::AccessibilityObject::supportsCurrent const):
(WebCore::AccessibilityObject::currentState const):
(WebCore::AccessibilityObject::roleDescription const):
(WebCore::AccessibilityObject::keyShortcutsValue const):
(WebCore::AccessibilityObject::placeholderValue const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
(WebCore::AccessibilityObject::sortDirection const):
(WebCore::AccessibilityObject::supportsHasPopup const):
(WebCore::AccessibilityObject::hasPopupValue const):
(WebCore::AccessibilityObject::supportsSetSize const):
(WebCore::AccessibilityObject::supportsPosInSet const):
(WebCore::AccessibilityObject::setSize const):
(WebCore::AccessibilityObject::posInSet const):
(WebCore::AccessibilityObject::supportsPressed const):
(WebCore::AccessibilityObject::supportsExpanded const):
(WebCore::AccessibilityObject::isExpanded const):
(WebCore::AccessibilityObject::checkboxOrRadioValue const):
(WebCore::AccessibilityObject::pressedIsPresent const):
(WebCore::AccessibilityObject::isAXHidden const):
(WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
(WebCore::AccessibilityObject::ariaDetailsElements const):
(WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
(WebCore::AccessibilityObject::ariaErrorMessageElements const):
(WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
(WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
(WebCore::AccessibilityObject::hasProperty const): Deleted.
(WebCore::AccessibilityObject::stringValueForProperty const): Deleted.
(WebCore::AccessibilityObject::boolValueForProperty const): Deleted.
(WebCore::AccessibilityObject::intValueForProperty const): Deleted.
(WebCore::AccessibilityObject::unsignedValueForProperty const): Deleted.
(WebCore::AccessibilityObject::doubleValueForProperty const): Deleted.
(WebCore::AccessibilityObject::elementValueForProperty const): Deleted.
(WebCore::AccessibilityObject::elementsFromProperty const): Deleted.
(WebCore::AccessibilityObject::elementsReferencedByProperty const): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::isSelected const):
(WebCore::AccessibilityRenderObject::activeDescendant const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::orientation const):
(WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
(WebCore::AccessibilityRenderObject::liveRegionStatus const):
(WebCore::AccessibilityRenderObject::liveRegionRelevant const):
(WebCore::AccessibilityRenderObject::liveRegionAtomic const):
(WebCore::AccessibilityRenderObject::isBusy const):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable const):
(WebCore::AccessibilityTable::axColumnCount const):
(WebCore::AccessibilityTable::axRowCount const):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::axColumnIndex const):
(WebCore::AccessibilityTableCell::axRowIndex const):
(WebCore::AccessibilityTableCell::axColumnSpan const):
(WebCore::AccessibilityTableCell::axRowSpan const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::axColumnIndex const):
(WebCore::AccessibilityTableRow::axRowIndex const):
* accessibility/AccessibleNode.cpp: Removed.
* accessibility/AccessibleNode.h: Removed.
* accessibility/AccessibleNode.idl: Removed.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Element.cpp:
(WebCore::Element::canContainRangeEndPoint const):
(WebCore::Element::accessibleNode): Deleted.
(WebCore::Element::existingAccessibleNode const): Deleted.
* dom/Element.h:
* dom/Element.idl:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::accessibleNode const): Deleted.
(WebCore::ElementRareData::setAccessibleNode): Deleted.
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemAccessibilityText const):
2018-02-13 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderButton::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182732
<rdar://problem/37500564>
Reviewed by Antti Koivisto.
No change of functionality.
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setInnerRenderer):
(WebCore::RenderButton::takeChild): Deleted.
* rendering/RenderButton.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
* rendering/updating/RenderTreeBuilder.h:
2018-02-13 Alicia Boya García <aboya@igalia.com>
[Gstreamer][MSE] Add string representation for GStreamerMediaSample
https://bugs.webkit.org/show_bug.cgi?id=180262
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
(WebCore::GStreamerMediaSample::offsetTimestampsBy):
* platform/graphics/gstreamer/mse/GStreamerMediaSample.h:
2018-02-12 Chris Fleizach <cfleizach@apple.com>
AX: defer focusedUIElement notifications
https://bugs.webkit.org/show_bug.cgi?id=182643
<rdar://problem/37394310>
Reviewed by Zalan Bujtas.
Deferring focus changes for accessibility has a number of benefits.
1) Reduces the chance of calling into layout during layout.
2) Coalesces multiple focus notifications that would be needlessly sent.
3) Improves performance by not calling out to the accessibility notification machinery during layout.
In this patch, I also started making more AXObjectCache calls private. This will reduce the chance that clients
will call into AXObjectCache during unexpected times.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
(WebCore::conditionallyAddNodeToFilterList):
(WebCore::filterVectorPairForRemoval):
(WebCore::filterMapForRemoval):
(WebCore::filterListForRemoval):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
2018-02-12 John Wilander <wilander@apple.com>
Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
https://bugs.webkit.org/show_bug.cgi?id=182664
<rdar://problem/37372572>
Reviewed by Brent Fulgham.
Tests: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html
http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
We now collect statistics on top frame navigational redirects too, both to and from.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
We now collect statistics on redirects from in addition to the existing redirects to.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
Three new fields:
- topFrameUniqueRedirectsTo
- topFrameUniqueRedirectsFrom
- subresourceUniqueRedirectsFrom
2018-02-12 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderMenuList::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182715
<rdar://problem/37477050>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
* rendering/updating/RenderTreeBuilder.h:
2018-02-12 Ross Kirsling <ross.kirsling@sony.com>
Unify UserAgent into WebCore/platform.
https://bugs.webkit.org/show_bug.cgi?id=182716
Reviewed by Michael Catanzaro.
No change in functionality.
* SourcesCocoa.txt:
* SourcesIOS.txt:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/cocoa/UserAgent.h: Removed.
* platform/UserAgent.h:
* platform/cocoa/UserAgentCocoa.mm: Renamed from Source/WebCore/page/cocoa/UserAgent.mm.
* platform/ios/UserAgentIOS.mm: Renamed from Source/WebCore/page/ios/UserAgentIOS.mm.
* platform/mac/UserAgentMac.mm: Renamed from Source/WebCore/page/mac/UserAgentMac.mm.
2018-02-12 Antoine Quint <graouts@apple.com>
[Web Animations] Support the copy constructors for KeyframeEffectReadOnly and KeyframeEffect
https://bugs.webkit.org/show_bug.cgi?id=182712
Reviewed by Dean Jackson.
We now support the variants for the KeyframeEffectReadOnly and KeyframeEffect constructors where
another KeyframeEffectReadOnly is provided as a source. All timing, keyframe and target properties
of that source are copied on the newly-constructed KeyframeEffect.
To support copying properties, we add new copyPropertiesFromSource() methods to
AnimationEffectTimingReadOnly and KeyframeEffectReadOnly to encapsulate copying various
member variables in the relevant classes. Copying properties of the backing KeyframeList
is performed in KeyframeEffectReadOnly::copyPropertiesFromSource() via public KeyframeList
methods.
* animation/AnimationEffectTimingReadOnly.cpp:
(WebCore::AnimationEffectTimingReadOnly::copyPropertiesFromSource):
* animation/AnimationEffectTimingReadOnly.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectOptions.idl:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::create):
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
* animation/KeyframeEffectReadOnly.h:
* animation/KeyframeEffectReadOnly.idl:
2018-02-12 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Introduce RenderTreebuilder::takeChild
https://bugs.webkit.org/show_bug.cgi?id=182707
<rdar://problem/37473433>
Reviewed by Antti Koivisto.
All takeChild calls should go through RenderTreeBuilder::takeChild from now on.
This patch also moves the Ruby related takeChild calls to RenderTreeBuilder.
No change in functionality.
* rendering/RenderButton.cpp:
(WebCore::RenderButton::takeChild):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild):
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild): Deleted.
(WebCore::RenderRubyAsBlock::takeChild): Deleted.
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsInline): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsBlock): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyRun): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2018-02-12 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock::dropAnonymousBoxChild to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182704
<rdar://problem/37469469>
Reviewed by Antti Koivisto.
All the callsites are now in RenderTreeBuilder.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::dropAnonymousBoxChild): Deleted.
* rendering/RenderBlock.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
(WebCore::RenderTreeBuilder::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderBlock.h:
2018-02-12 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r228376.
This caused accessibility/mac/selection-notification-focus-
change.html to become flaky on macOS.
Reverted changeset:
"AX: defer focusedUIElement notifications"
https://bugs.webkit.org/show_bug.cgi?id=182643
https://trac.webkit.org/changeset/228376
2018-02-12 Ryan Haddad <ryanhaddad@apple.com>
[iOS] media tests failing ASSERT_NOT_REACHED() in WebCore::VideoFullscreenInterfaceAVKit::cleanupFullscreen()
https://bugs.webkit.org/show_bug.cgi?id=182527
Reviewed by Alexey Proskuryakov.
Temporarily remove an assertion from VideoFullscreenInterfaceAVKit to stop tests from crashing on iOS
while the root cause is being investigated.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
2018-02-12 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Remove redundant RenderTreeBuilder instance
https://bugs.webkit.org/show_bug.cgi?id=182700
<rdar://problem/37463958>
Reviewed by Antti Koivisto.
* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):
2018-02-12 Chris Fleizach <cfleizach@apple.com>
AX: defer focusedUIElement notifications
https://bugs.webkit.org/show_bug.cgi?id=182643
<rdar://problem/37394310>
Reviewed by Zalan Bujtas.
Deferring focus changes for accessibility has a number of benefits.
1) Reduces the chance of calling into layout during layout.
2) Coalesces multiple focus notifications that would be needlessly sent.
3) Improves performance by not calling out to the accessibility notification machinery during layout.
In this patch, I also started making more AXObjectCache calls private. This will reduce the chance that clients
will call into AXObjectCache during unexpected times.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
(WebCore::conditionallyAddNodeToFilterList):
(WebCore::filterVectorPairForRemoval):
(WebCore::filterMapForRemoval):
(WebCore::filterListForRemoval):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
2018-02-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Scrolling sometimes jumps around
https://bugs.webkit.org/show_bug.cgi?id=178519
Reviewed by Michael Catanzaro.
* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::computeVelocity): use -1 as the multiplier for the accumulated deltas,
since all we need is to make them negative. Multiplying by -1000 leads to very high velocities being
returned, causing the viewport to scroll to the end of the page.
2018-02-10 Wenson Hsieh <wenson_hsieh@apple.com>
Remove an unused static variable in DeprecatedGlobalSettings.h
https://bugs.webkit.org/show_bug.cgi?id=182672
Reviewed by Joseph Pecoraro.
After r227282, this flag is no longer used anywhere. No change in behavior.
* page/DeprecatedGlobalSettings.h:
2018-02-10 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock::takeChild mutation to a RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182662
<rdar://problem/37408571>
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild):
(WebCore::canDropAnonymousBlock): Deleted.
(WebCore::canMergeContiguousAnonymousBlocks): Deleted.
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takenChildFromRenderBlock):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::canDropAnonymousBlock):
(WebCore::canMergeContiguousAnonymousBlocks):
(WebCore::RenderTreeBuilder::Block::takeChild):
* rendering/updating/RenderTreeBuilderBlock.h:
2018-02-08 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails
https://bugs.webkit.org/show_bug.cgi?id=182564
Reviewed by Wenson Hsieh.
Turns out that Microsoft Word generates p and span elements with special styles instead of standard
ul and ol elements when copying a list items, and TinyMCE has a specialized code path to process
this proprietary format of Microsoft Word. The regression was caused by WebKit's sanitization code
stripping away these non-standard CSS rules and inline styles.
To preseve pre-r223440 behavior in TinyMCE, we preserve the following in a HTML markup:
1. The "html" element at the beginning with xmlns content attributes
2. @list rules in a style element starting with "/* List Definitions */" comment
3. inline style content attribute with "mso-list" property
4. comments conditional sections with "[if !supportLists]" and "[endif]"
(1) is needed for TinyMCE to trigger the specialized code path for Microsoft Word. (2) contains
the information about the structure of list items. (3) is needed to associate each p element with
a rule in (2). (4) is needed to strip away the content generated as list markers (e.g. dots).
We enable this "MSO list quirks" when the content comes from a non-WebKit client or a WebKit client
that doesn't enable custom pasteboard data (detected by the content origin being null), and the HTML
markup starts with a specific sequence of characters generated by Microsoft Word.
Test: http/tests/security/clipboard/copy-paste-html-across-origin-strips-mso-list.html
PasteHTML.PreservesMSOList
PasteHTML.StripsMSOListWhenMissingMSOHTMLElement
PasteWebArchive.PreservesMSOList
PasteWebArchive.StripsMSOListWhenMissingMSOHTMLElement
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendTextSubstring): Added.
* editing/MarkupAccumulator.h:
* editing/WebContentReader.cpp:
(WebCore::FrameWebContentReader::msoListQuirksForMarkup const): Added. Enables the MSO list quirks
if the content origin is null. The content origin specifies the pasteboard content's origin if it's
copied in WebKit with custom pasteboard data types enabled. In all other applications, it would be
set to null.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::markupForFragmentInDocument): Moved to markup.cpp as sanitizedMarkupForFragmentInDocument.
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readWebArchive): Always disables MSO list quirks since this code path is
only used by WebKit's native code to paste content.
(WebCore::WebContentMarkupReader::readWebArchive): Calls msoListQuirksForMarkup since this is the code
path used by DataTransfer.
(WebCore::WebContentReader::readHTML): Always disables MSO list quirks since this code path is only
used by WebKit's native code to paste content.
(WebCore::WebContentMarkupReader::readHTML): Calls msoListQuirksForMarkup since this is the code path
used by DataTransfer.
* editing/markup.cpp:
(WebCore::sanitizeMarkup): Use sanitizedMarkupForFragmentInDocument to share code.
(WebCore::MSOListMode): Added. Set to Preserve if the sanitized markup is the one generated by
Microsoft Word, and MSO list quirks should actually kick in. This is unlike MSOListQuirks, which is
set to Enable whenever the content COULD be the one generated by Microsoft Word.
(WebCore::StyledMarkupAccumulator): Added a special MSO list preservation mode enabled by MSOListMode.
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::appendElement): Preseve (3). Unfortunately, TinyMCE only recognizes
mso-list and related properties only if they appear on their own. But we also need to preserve
the inline style generated using the computed style since we would lose the inline styles of the text
otherwise (e.g. red text and bold font). To workaround this, we generate two style content attributes,
one containing computed styles and another one containing mso-list. Luckily, the HTML parsing algorithm
dictates that the first attribute always wins when more than one attributes of the same name appears,
so we place the computed style's style attribute first so that the pasted content in non-TinyMCE
environment will continue to work.
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Added. Generates special markup for
the conditional statements and the special style element with @list rules.
(WebCore::createMarkupInternal):
(WebCore::createMarkup):
(WebCore::sanitizedMarkupForFragmentInDocument): Moved from WebContentReaderCocoa.mm. If MSOListQuirks
is set to Enable, and the markup starts with a specific sequence of characters, generate the markup
with the newly added quirks code in StyledMarkupAccumulator, and wrap it in a special "html" element
TinyMCE recognizes.
* editing/markup.h:
(WebCore::MSOListQuirks): Added. Set to CheckIfNeeded if the content COULD require MSO list quirks.
2018-02-09 Dean Jackson <dino@apple.com>
ImageBitmapRenderingContext should be Runtime guarded
https://bugs.webkit.org/show_bug.cgi?id=182665
<rdar://problem/37411410>
Reviewed by Sam Weinig.
Add a flag to ensure the ImageBitmapRenderingContext interface is only
visible when the runtime feature is enabled.
* bindings/js/WebCoreBuiltinNames.h:
* html/canvas/ImageBitmapRenderingContext.idl:
2018-02-09 Don Olmstead <don.olmstead@sony.com>
[CMake] Make PAL headers copies
https://bugs.webkit.org/show_bug.cgi?id=182645
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* CMakeLists.txt:
2018-02-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRubyRun::takeChild mutation to a RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182655
<rdar://problem/37406801>
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyRun):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-02-09 Andy Estes <aestes@apple.com>
[Payment Request] Apple Pay sheet does not dismiss when calling complete() with result "unknown" or "fail"
https://bugs.webkit.org/show_bug.cgi?id=182658
<rdar://problem/37293917>
Reviewed by Brady Eidson.
When PaymentResponse::complete() is called with a result of "unknown" or "fail", we should
treat this as a fatal error and dismiss the Apple Pay sheet. However, we were adding an
error with code "unknown" to the authorization result, which PassKit interprets as a
non-fatal error. Instead, we should not set any errors and just use a status code of
PaymentAuthorizationStatus::Failure, which PassKit interprets as a fatal error, dismissing
the sheet.
No test possible.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::complete):
2018-02-09 Wenson Hsieh <wenson_hsieh@apple.com>
Pasting from Excel no longer provides text/html data
https://bugs.webkit.org/show_bug.cgi?id=182636
<rdar://problem/37087060>
Reviewed by Ryosuke Niwa.
After r222656, we treat images on the pasteboard as files. However, we also have an existing policy which hides
text data ("text/uri-list", "text/html", "text/plain") from the page when files are present on the pasteboard.
When copying a table, Microsoft Excel writes a rendering of the table to the pasteboard as an image. This means
that we'll hide other data types (importantly, 'text/html') upon pasting, even though important clients (such as
Google Docs and Confluence) depend on the 'text/html' data in order to correctly handle the paste (rather than
paste as an image of a table).
To fix this, we add an exception to the DataTransfer.getData codepath when the pasteboard contains files.
Instead of always returning the empty string for text/html, we still allow pasteboard access, but only read
from a limited set of rich text types, i.e. web archive, RTF(D), and HTML markup. Importantly, this prevents
us from exposing any file paths that appear as plain text or URLs on the pasteboard. Just as in the regular
codepath for getData(), if the pasteboard data comes from the same origin, we allow unsanitized access;
otherwise, we use WebContentMarkupReader to extract markup from the pasteboard.
Tests: PasteMixedContent.ImageFileAndPlainText
PasteMixedContent.ImageFileAndWebArchive
PasteMixedContent.ImageFileAndHTML
PasteMixedContent.ImageFileAndRTF
PasteMixedContent.ImageFileAndURL
PasteMixedContent.ImageFileWithHTMLAndURL
DataInteractionTests.DataTransferGetDataWhenDroppingImageAndMarkup
Also rebaselined some layout tests, which cover changes in behavior when dropping on macOS and pasting on iOS.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):
Augment the codepath handling the case where the pasteboard contains files, such that we allow reading
"text/html", but only from rich text types.
(WebCore::DataTransfer::readStringFromPasteboard const):
Factor out logic for reading from the pasteboard into a private helper. This is called in two places from
getDataForItem: in the normal (existing) path, and in the case where we allow 'text/html' to be read despite
files appearing in the pasteboard.
One important difference here is that this helper now takes a WebContentReadingPolicy, whose purpose is to
prevent reading from non-rich-text types when files appear in the pasteboard.
Another tweak here is that we now use `lowercaseType` instead of the original (unadjusted) `type` when reading
from the pasteboard. This doesn't seem to be intended in the first place.
(WebCore::DataTransfer::types const):
Tweak the implementation of DataTransfer.types() in the case where files exist on the pasteboard, such that we
also add "text/html" if it is present in the list of DOM-safe types.
* dom/DataTransfer.h:
* platform/Pasteboard.h:
Introduce WebContentReadingPolicy, which indicates whether or not we should limit web content reading from the
pasteboard to only rich text types upon paste or drop. Normally, we allow all types to be read as web content
(::AnyType), but when files appear on the pasteboard, we force OnlyRichTextTypes to ensure that no other types
can unintentionally be read back as web content.
* platform/StaticPasteboard.h:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::read):
* platform/ios/PasteboardIOS.mm:
Teach Pasteboard (on iOS) to respect WebContentReadingPolicy.
(WebCore::isTypeAllowedByReadingPolicy):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
* platform/mac/PasteboardMac.mm:
Teach Pasteboard (on macOS) to respect WebContentReadingPolicy.
(WebCore::Pasteboard::read):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::read):
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::read):
Adjust non-Cocoa Pasteboard implementations for an interface change.
2018-02-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRubyAsInline/AsBlock::takeChild mutation to a RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182651
<rdar://problem/37405042>
Reviewed by Antti Koivisto.
No change in functionality.
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::takeChild):
(WebCore::isAnonymousRubyInlineBlock): Deleted.
(WebCore::isRubyChildForNormalRemoval): Deleted.
(WebCore::findRubyRunParent): Deleted.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsInline):
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsBlock):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::findRubyRunParent):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-02-09 Per Arne Vollan <pvollan@apple.com>
Assert that NSApp is not running in the WebProcess.
https://bugs.webkit.org/show_bug.cgi?id=182553
Reviewed by Simon Fraser.
In WebCore, there are a few places where NSApp is referenced. Since the WebContent process
is no longer using the NSApplication run loop, and NSApp is no longer guaranteed to be
valid, we should make sure that the NSApp is not referenced by the WebContent process or
the Network process, by asserting that the NSApplication event loop is running when NSApp
is referenced. It is still ok for the UIProcess to reference NSApp. Adding these assert
will help catch NSApp references when the NSApplication run loop is not used.
Also, do not post a fake mouse event in PasteBoard::setDragImage when the NSApplication
run loop is not running, since this is only relevant in WK1.
No new tests, covered by existing tests.
* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
2018-02-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Introduce RenderTreeBuilder to willBeDestoryed/removeFromParentAndDestroy
https://bugs.webkit.org/show_bug.cgi?id=182635
<rdar://problem/37377489>
Reviewed by Antti Koivisto.
This patch helps finding callsites where we don't have a RenderTreeBuilder instance.
No change in functionality.
* dom/Document.cpp:
(WebCore::Document::setFullScreenRenderer):
* dom/Document.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed):
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::willBeDestroyed):
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::willBeDestroyed):
* rendering/RenderCounter.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::willBeDestroyed):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::willBeDestroyed):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderFullScreen.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::willBeDestroyed):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderInline.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::willBeDestroyed):
* rendering/RenderLayerModelObject.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::willBeDestroyed):
* rendering/RenderListBox.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::willBeDestroyed):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::willBeDestroyed):
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::willBeDestroyed):
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy):
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::destroy):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::willBeDestroyed):
* rendering/RenderReplaced.h:
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::takeChild):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::willBeDestroyed):
* rendering/RenderSearchField.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::willBeDestroyed):
* rendering/RenderText.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::willBeDestroyed):
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
(WebCore::RenderTextFragment::setText):
* rendering/RenderTextFragment.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
* rendering/RenderVideo.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed):
* rendering/RenderWidget.h:
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::willBeDestroyed):
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::willBeDestroyed):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::willBeDestroyed):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::willBeDestroyed):
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::willBeDestroyed):
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::willBeDestroyed):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::willBeDestroyed):
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2018-02-09 Brent Fulgham <bfulgham@apple.com>
[macOS, iOS] Expose OS marketing version in UserAgent
https://bugs.webkit.org/show_bug.cgi?id=182629
<rdar://problem/37370975>
Reviewed by Daniel Bates.
Revert back to dynamically reading the operating system marketing version
rather than using a hard-coded version.
* page/cocoa/UserAgent.mm:
(WebCore::systemMarketingVersionForUserAgentString):
2018-02-08 Antoine Quint <graouts@apple.com>
[Web Animations] Refactor AnimationEffect and KeyframeEffect into AnimationEffectReadOnly, KeyframeEffectReadOnly and KeyframeEffect
https://bugs.webkit.org/show_bug.cgi?id=182608
Reviewed by Dean Jackson.
Currently, we have an AnimationEffect class with read-write members and a KeyframeEffect subclass with read-write
members. The spec has an AnimationEffectReadOnly class, with read-only members, a KeyframeEffectReadOnly subclass,
with read-only members, and then the KeyframeEffect subclass (of KeyframeEffectReadOnly) with read-write members.
Likewise, currently we have an AnimationEffectTiming class with read-write members. While the spec has this class
as well, it also specifies a read-only AnimationEffectTimingReadOnly superclass.
In this patch we refactor the code to match the spec, which gives us a big boost in our WPT pass rate. The vast
majority of the code is just copied from one class to another verbatim. The limited actual code changes, all related
to the new subclassing, are:
- AnimationEffectTimingReadOnly is not actually read-only as far as WebCore is concerned, it actually exposes setters
for all of its properties, but the IDL for this class specifies all properties as read-only, so we match the spec. The
reason for this is that it is necessary to be able to set members of an AnimationEffectTimingReadOnly object based on
a Variant<double, KeyframeEffectOptions> provided to Element.animate() or the KeyframeEffectReadOnly and KeyframeEffect
constructors, and the logic to handle properties in such dictionaries is the same as the logic required to set individual
members in AnimationEffectTiming. So in essence, the sole role of AnimationTimingEffect is to provide an IDL interface
with read-write members, but the parent class is itself read-write as far as WebCore is concerned.
- AnimationEffectTimingReadOnly exposes a new setProperties() method which takes in a nullable Variant<double, KeyframeEffectOptions>
so that code that was previously specific to KeyframeEffect can be factored into this method and both the constructors of
KeyframeEffectReadOnly and KeyframeEffect can make use of it without code duplication.
- The AnimationEffectReadOnly constructor now takes an AnimationEffectTimingReadOnly as input since that class and
KeyframeEffectReadOnly expose an AnimationEffectTimingReadOnly object, while KeyframeEffect exposes an
AnimationEffectTiming read-write object. This allows the KeyframeEffect constructor to provide the right object type.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffectReadOnly.cpp: Renamed from Source/WebCore/animation/AnimationEffect.cpp.
(WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly):
(WebCore::AnimationEffectReadOnly::localTime const):
(WebCore::AnimationEffectReadOnly::phase const):
(WebCore::AnimationEffectReadOnly::activeTime const):
(WebCore::AnimationEffectReadOnly::overallProgress const):
(WebCore::AnimationEffectReadOnly::simpleIterationProgress const):
(WebCore::AnimationEffectReadOnly::currentIteration const):
(WebCore::AnimationEffectReadOnly::currentDirection const):
(WebCore::AnimationEffectReadOnly::directedProgress const):
(WebCore::AnimationEffectReadOnly::transformedProgress const):
(WebCore::AnimationEffectReadOnly::iterationProgress const):
(WebCore::AnimationEffectReadOnly::getComputedTiming):
* animation/AnimationEffectReadOnly.h: Renamed from Source/WebCore/animation/AnimationEffect.h.
(WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const):
(WebCore::AnimationEffectReadOnly::timing const):
* animation/AnimationEffectReadOnly.idl: Copied from Source/WebCore/animation/AnimationEffect.idl.
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::setIterationStart): Deleted.
(WebCore::AnimationEffectTiming::setIterations): Deleted.
(WebCore::AnimationEffectTiming::bindingsDuration const): Deleted.
(WebCore::AnimationEffectTiming::setBindingsDuration): Deleted.
(WebCore::AnimationEffectTiming::endTime const): Deleted.
(WebCore::AnimationEffectTiming::activeDuration const): Deleted.
(WebCore::AnimationEffectTiming::setEasing): Deleted.
* animation/AnimationEffectTiming.h:
(): Deleted.
* animation/AnimationEffectTiming.idl:
* animation/AnimationEffectTimingReadOnly.cpp: Copied from Source/WebCore/animation/AnimationEffectTiming.cpp.
(WebCore::AnimationEffectTimingReadOnly::create):
(WebCore::AnimationEffectTimingReadOnly::AnimationEffectTimingReadOnly):
(WebCore::AnimationEffectTimingReadOnly::~AnimationEffectTimingReadOnly):
(WebCore::AnimationEffectTimingReadOnly::setProperties):
(WebCore::AnimationEffectTimingReadOnly::setIterationStart):
(WebCore::AnimationEffectTimingReadOnly::setIterations):
(WebCore::AnimationEffectTimingReadOnly::bindingsDuration const):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDuration):
(WebCore::AnimationEffectTimingReadOnly::setEasing):
(WebCore::AnimationEffectTimingReadOnly::endTime const):
(WebCore::AnimationEffectTimingReadOnly::activeDuration const):
* animation/AnimationEffectTimingReadOnly.h: Copied from Source/WebCore/animation/AnimationEffectTiming.h.
(WebCore::AnimationEffectTimingReadOnly::isAnimationEffectTiming const):
(WebCore::AnimationEffectTimingReadOnly::bindingsDelay const):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDelay):
(WebCore::AnimationEffectTimingReadOnly::bindingsEndDelay const):
(WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay):
(WebCore::AnimationEffectTimingReadOnly::delay const):
(WebCore::AnimationEffectTimingReadOnly::setDelay):
(WebCore::AnimationEffectTimingReadOnly::endDelay const):
(WebCore::AnimationEffectTimingReadOnly::setEndDelay):
(WebCore::AnimationEffectTimingReadOnly::fill const):
(WebCore::AnimationEffectTimingReadOnly::setFill):
(WebCore::AnimationEffectTimingReadOnly::iterationStart const):
(WebCore::AnimationEffectTimingReadOnly::iterations const):
(WebCore::AnimationEffectTimingReadOnly::iterationDuration const):
(WebCore::AnimationEffectTimingReadOnly::setIterationDuration):
(WebCore::AnimationEffectTimingReadOnly::direction const):
(WebCore::AnimationEffectTimingReadOnly::setDirection):
(WebCore::AnimationEffectTimingReadOnly::easing const):
(WebCore::AnimationEffectTimingReadOnly::timingFunction const):
(WebCore::AnimationEffectTimingReadOnly::classType const):
* animation/AnimationEffectTimingReadOnly.idl: Renamed from Source/WebCore/animation/AnimationEffect.idl.
* animation/AnimationTimeline.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::IDLAttributeNameToAnimationPropertyName): Deleted.
(WebCore::CSSPropertyIDToIDLAttributeName): Deleted.
(WebCore::computeMissingKeyframeOffsets): Deleted.
(WebCore::processIterableKeyframes): Deleted.
(WebCore::processKeyframeLikeObject): Deleted.
(WebCore::processPropertyIndexedKeyframes): Deleted.
(WebCore::KeyframeEffect::getKeyframes): Deleted.
(WebCore::KeyframeEffect::processKeyframes): Deleted.
(WebCore::KeyframeEffect::computeStackingContextImpact): Deleted.
(WebCore::KeyframeEffect::apply): Deleted.
(WebCore::KeyframeEffect::shouldRunAccelerated): Deleted.
(WebCore::KeyframeEffect::getAnimatedStyle): Deleted.
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Deleted.
(WebCore::KeyframeEffect::startOrStopAccelerated): Deleted.
(WebCore::KeyframeEffect::renderer const): Deleted.
(WebCore::KeyframeEffect::currentStyle const): Deleted.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectReadOnly.cpp: Copied from Source/WebCore/animation/KeyframeEffect.cpp.
(WebCore::IDLAttributeNameToAnimationPropertyName):
(WebCore::CSSPropertyIDToIDLAttributeName):
(WebCore::computeMissingKeyframeOffsets):
(WebCore::processIterableKeyframes):
(WebCore::processKeyframeLikeObject):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffectReadOnly::create):
(WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly):
(WebCore::KeyframeEffectReadOnly::getKeyframes):
(WebCore::KeyframeEffectReadOnly::processKeyframes):
(WebCore::KeyframeEffectReadOnly::computeStackingContextImpact):
(WebCore::KeyframeEffectReadOnly::apply):
(WebCore::KeyframeEffectReadOnly::shouldRunAccelerated):
(WebCore::KeyframeEffectReadOnly::getAnimatedStyle):
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::startOrStopAccelerated):
(WebCore::KeyframeEffectReadOnly::renderer const):
(WebCore::KeyframeEffectReadOnly::currentStyle const):
* animation/KeyframeEffectReadOnly.h: Copied from Source/WebCore/animation/KeyframeEffect.h.
(WebCore::KeyframeEffectReadOnly::~KeyframeEffectReadOnly):
(WebCore::KeyframeEffectReadOnly::target const):
(WebCore::KeyframeEffectReadOnly::iterationComposite const):
(WebCore::KeyframeEffectReadOnly::composite const):
(WebCore::KeyframeEffectReadOnly::isRunningAccelerated const):
* animation/KeyframeEffectReadOnly.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::setEffect):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSAnimationEffectReadOnlyCustom.cpp: Copied from Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail const): Fix an error introduced in webkit.org/b/179591.
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::constructJSWebAnimation):
* bindings/js/WebCoreBuiltinNames.h:
2018-02-09 Andy Estes <aestes@apple.com>
[Payment Request] Crash in PaymentRequest::canMakePayment() when Apple Pay payment method data is missing required fields
https://bugs.webkit.org/show_bug.cgi?id=182631
Reviewed by Mark Lam.
PaymentRequest::canMakePayment() needs to parse each payment method's serialized data to
determine if it is a supported payment method. If parsing fails by raising an exception, we
intend to skip over that payment method and try the next one. If all payment method data
fail to parse, we resolve the returned promise with false. At no point do we intend to
propagate the parsing exception up to the calling script, however.
Even though we intend to swallow any exceptions from parsing, we failed to clear the
JavaScript VM's exception state. The next time WebCore tries to execute JavaScript, a
release assertion is raised due to seeing an unexpected exception in the VM.
Fix this by using a CatchScope in PaymentRequest::canMakePayment(), and calling
CatchScope::clearException() in the places we intend to swallow exceptions.
Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::canMakePayment):
2018-02-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move multicolumn descendant/sibling removal logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182628
<rdar://problem/37369528>
Reviewed by Antti Koivisto.
No change in functionality
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::takeChild):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::handleSpannerRemoval): Deleted.
(WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::multiColumnRelativeWillBeRemoved):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
(WebCore::RenderTreeBuilder::MultiColumn::multiColumnRelativeWillBeRemoved):
* rendering/updating/RenderTreeBuilderMultiColumn.h:
2018-02-09 Youenn Fablet <youenn@apple.com>
Add support for cache storage of blob response
https://bugs.webkit.org/show_bug.cgi?id=182637
Reviewed by Brady Eidson.
Covered by updated WPT test.
When putting a blob response in cache, create a readable stream to easily get the body.
Make clear that caching form data is not supported.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isBlob const):
(WebCore::FetchBody::isFormData const):
* Modules/fetch/FetchResponse.h:
2018-02-09 Youenn Fablet <youenn@apple.com>
Make CoreAudioCaptureSource error logging be release logging
https://bugs.webkit.org/show_bug.cgi?id=182614
Reviewed by Eric Carlson.
No change of behavior.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::addEchoCancellationSource):
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
(WebCore::CoreAudioSharedUnit::configureSpeakerProc):
(WebCore::CoreAudioSharedUnit::checkTimestamps):
(WebCore::CoreAudioSharedUnit::provideSpeakerData):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioSharedUnit::cleanupAudioUnit):
(WebCore::CoreAudioSharedUnit::reconfigureAudioUnit):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::verifyIsCapturing):
(WebCore::CoreAudioSharedUnit::stopInternal):
(WebCore::CoreAudioSharedUnit::defaultInputDevice):
2018-02-09 Carlos Garcia Campos <cgarcia@igalia.com>
Add a way to check if a host is an IP address
https://bugs.webkit.org/show_bug.cgi?id=182427
Reviewed by Alex Christensen.
There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
platform specific implementations, falling back to current assumption if there isn't an implementation for the
platform.
* page/OriginAccessEntry.cpp:
(WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress): Fallback implementation.
* platform/URL.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().
2018-02-08 Philippe Normand <pnormand@igalia.com>
[GStreamer][WebAudio] Winamp2-js woes
https://bugs.webkit.org/show_bug.cgi?id=182612
Reviewed by Xabier Rodriguez Calvar and Carlos Alberto Lopez Perez.
Test: webaudio/silence-after-playback.html
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::copyGStreamerBuffersToAudioChannel): Clear the bus if
the adapter can't provide enough data. This prevents a nasty noise
after playing songs in Winamp.
(WebCore::AudioSourceProviderGStreamer::setClient): No need to set
the client more than once, this fixes runtime warnings.
2018-02-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move multicolumn spanner mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182627
<rdar://problem/37367284>
Reviewed by Antti Koivisto.
Move spanner triggered mutation logic to RenderTreeBuilder.
No change in functionality.
* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
(WebCore::findSetRendering): Deleted.
(WebCore::isValidColumnSpanner): Deleted.
(WebCore::spannerPlacehoderCandidate): Deleted.
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant): Deleted.
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::insertedIntoTree):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::multiColumnDescendantInserted):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::findSetRendering):
(WebCore::spannerPlacehoderCandidate):
(WebCore::isValidColumnSpanner):
(WebCore::RenderTreeBuilder::MultiColumn::multiColumnDescendantInserted):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderMultiColumn.h:
2018-02-09 Javier Fernandez <jfernandez@igalia.com>
[css-align] Implement the new behavior of 'legacy' for justify-items
https://bugs.webkit.org/show_bug.cgi?id=172712
Reviewed by Antti Koivisto.
The syntax of the 'justify-items' property accepts a new 'legacy' value,
replacing the 'auto' value which is now parsed as invalid.
https://github.com/w3c/csswg-drafts/issues/1318
This change affects also to the 'place-items' shorthand, which doesn't
accept 'auto' and, for the time being, neither 'legacy'.
Since the new value 'legacy' is also the default value, I don't expect
this change to break content of sites currently using the 'justify-items'
property.
No new tests, rebaselined existing test.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ItemPosition const):
* css/CSSProperties.json:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAuto):
(WebCore::isNormalOrStretch):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeJustifyItems):
(WebCore::consumeSimplifiedDefaultPosition):
(WebCore::consumeSimplifiedSelfPosition):
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
* rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForChild const):
(WebCore::RenderGrid::rowAxisPositionForChild const):
* rendering/style/RenderStyle.cpp:
(WebCore::resolvedSelfAlignment):
(WebCore::RenderStyle::resolvedJustifyItems const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialJustifyItems):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2018-02-09 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add support for encrypted caps in GStreamerUtilities
https://bugs.webkit.org/show_bug.cgi?id=181990
Reviewed by Xabier Rodriguez-Calvar.
Add the support of encrypted caps in GStreamerUtilities.
Refactor the manner that the caps are handled, such as how to extract the resolution
from the video caps or how to check if the caps are encrypted.
The attachTrack function in PlaybackPipeline doesn't need the "structure" parameter,
it is already included in the "caps" parameter.
Replace the "mediaType" parameter by the "caps" parameter in reattachTrack function,
it allows to use the new functions that handle the caps in GStreamerUtilities.
Tests:
media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::getVideoSizeAndFormatFromCaps): Add the support of video encrypted caps.
(WebCore::getVideoResolutionFromCaps):
(WebCore::capsMediaType):
(WebCore::doCapsHaveType):
(WebCore::areEncryptedCaps): Add a new functions in order to handle the caps properly.
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
(WebCore::GStreamerMediaDescription::codec const):
(WebCore::GStreamerMediaDescription::isVideo const):
(WebCore::GStreamerMediaDescription::isAudio const):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::attachTrack):
(WebCore::PlaybackPipeline::reattachTrack):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcUpdatePresentationSize): Refactor some parts by using the new added functions.
2018-02-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Layout test fast/replaced/border-radius-clip.html crashes with GStreamer-CRITICAL **: gst_segment_to_stream_time: assertion 'segment->format == format' failed in gst_segment_to_stream_time()
https://bugs.webkit.org/show_bug.cgi?id=176802
Reviewed by Xabier Rodriguez Calvar.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Prevent the player from loading animated gifs.
2018-02-09 Antti Koivisto <antti@apple.com>
Move compiled selectors to StyleRule
https://bugs.webkit.org/show_bug.cgi?id=182602
Reviewed by Zalan Bujtas.
Currently they are owned by RuleData. Several RuleData objects can refer to the same StyleRule, requiring recompilation.
Compiled selectors are context-independent so they can be shared between all clients.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::listSize const):
Compute the number of complex selectors on the list.
* css/CSSSelectorList.h:
* css/DocumentRuleSets.cpp:
(WebCore::makeRuleSet):
(WebCore::DocumentRuleSets::classInvalidationRuleSets const):
Pass around list index along with the selector index (compiled selectors are found by list index).
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* css/RuleSet.cpp:
(WebCore::RuleData::RuleData):
* css/RuleSet.h:
(WebCore::RuleData::compilationStatus const): Deleted.
(WebCore::RuleData::compiledSelectorCodeRef const): Deleted.
(WebCore::RuleData::setCompiledSelector const): Deleted.
(WebCore::RuleData::~RuleData): Deleted.
(WebCore::RuleData::compiledSelectorUsed const): Deleted.
* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
* css/StyleRule.h:
Add CompiledSelector member.
* cssjit/CompiledSelector.h: Added.
Move to a header of its own to keeps dependencies simple.
(WebCore::SelectorCompilationStatus::SelectorCompilationStatus):
(WebCore::SelectorCompilationStatus::operator Status const):
* cssjit/SelectorCompiler.h:
(): Deleted.
(WebCore::SelectorCompilationStatus::SelectorCompilationStatus): Deleted.
(WebCore::SelectorCompilationStatus::operator Status const): Deleted.
2018-02-08 Antoine Quint <graouts@apple.com>
[Web Animations] Always expose "composite" in output of getKeyframes()
https://bugs.webkit.org/show_bug.cgi?id=182600
Reviewed by Dean Jackson.
The Web Animations spec has changed and whereas the output of getKeyframes() would not feature the "composite" property
for "null" values, it now lists "composite" in all cases.
To support this, we needed to fix an issue in the code generator such that a "null" default value for an optional enum
type was supported.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/TestObj.idl:
2018-02-08 Youenn Fablet <youenn@apple.com>
CoreAudioCaptureSourceIOSListener should be a WebProcess singleton
https://bugs.webkit.org/show_bug.cgi?id=182606
<rdar://problem/37355283>
Reviewed by Eric Carlson.
Not testable right now as this relies on iOS specific Core Audio stack.
Efforts should be made to somehow mock that part and mock interruptions.
Made CoreAudioCaptureSourceFactoryIOS responsible to receive iOS interruption messages.
Before the patch, individual capture sources were receiving these messages.
When there is only one capture source per process this is fine but with more capture sources,
this is messing up things as they all share the same shared unit and we would try to interrupt it or resume it several times.
Also, if we are suspended and there is no more capture source, the shared unit will remain suspended indefinitely, as we will
not process the interruption messages.
With the patch, we always process the messages.
We still go through the active source as done now to limit the changes.
In case of no source, we go to the shared unit.
In the future, we should directly go to the shared unit and clients of the shared unit should see their state being updated.
As a way to prevent staying suspended on iOS, we unsuspend ourselves in CoreAudioCaptureSource constructor.
This is fine as this constructor is only called when getUserMedia grants access to the camera which always goes to the UIProcess.
And the UIProcess is only processing getUserMedia calls if the WebProcess is foregrounded.
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
(-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
(WebCore::CoreAudioCaptureSourceFactoryIOS::CoreAudioCaptureSourceFactoryIOS):
(WebCore::CoreAudioCaptureSourceFactoryIOS::~CoreAudioCaptureSourceFactoryIOS):
(WebCore::CoreAudioCaptureSourceFactory::singleton):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSourceFactory::singleton):
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSourceFactory::beginInterruption):
(WebCore::CoreAudioCaptureSourceFactory::endInterruption):
(WebCore::CoreAudioCaptureSourceFactory::scheduleReconfiguration):
(WebCore::CoreAudioCaptureSource::factory):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
(WebCore::CoreAudioCaptureSource::beginInterruption):
(WebCore::CoreAudioCaptureSource::endInterruption):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
(WebCore::CoreAudioCaptureSourceFactory::setCoreAudioActiveSource):
(WebCore::CoreAudioCaptureSourceFactory::unsetCoreAudioActiveSource):
(WebCore::CoreAudioCaptureSourceFactory::coreAudioActiveSource):
2018-02-08 Chris Dumez <cdumez@apple.com>
There should be a way to disable [OverrideBuiltins] behavior in a given DOMWrapperWorld
https://bugs.webkit.org/show_bug.cgi?id=182524
<rdar://problem/9057327>
Reviewed by Ryosuke Niwa.
Add new flag on DOMWrapperWorld indicating if the [OverrideBuiltins] behavior should
be enabled in this world or not. The behavior is enabled by default for Web-compatibility.
This flag is queried in accessVisibleNamedProperty() when doing the named property
lookup.
Covered by new API test.
* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior):
(WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const):
* bindings/js/JSDOMAbstractOperations.h:
(WebCore::accessVisibleNamedProperty):
2018-02-08 Per Arne Vollan <pvollan@apple.com>
Move WebVideoFullscreenController from WebCore to WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=182615
Reviewed by Eric Carlson.
It is only used by WK1. Also there are a few references to NSApp in WebVideoFullscreenController.mm.
Ideally, we should not reference NSApp in WebCore.
No new tests. No change in behavior.
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.h:
* platform/mac/WebVideoFullscreenController.h: Removed.
* platform/mac/WebVideoFullscreenController.mm: Removed.
* platform/mac/WebVideoFullscreenHUDWindowController.h: Removed.
* platform/mac/WebVideoFullscreenHUDWindowController.mm: Removed.
* platform/mac/WebWindowAnimation.h: Removed.
* platform/mac/WebWindowAnimation.mm: Removed.
2018-02-08 Chris Dumez <cdumez@apple.com>
Form submission after navigation fails when decidePolicyForNavigationAction is async
https://bugs.webkit.org/show_bug.cgi?id=182412
<rdar://problem/35181099>
Reviewed by Alex Christensen.
When the form is submitted and schedules the load in an iframe that is already loading,
FrameLoader::stopLoading() is called as expected. However, because policy checks can
now be asynchronous, stopLoading() also needs to stop pending policy checks. Otherwise,
continueLoadAfterNavigationPolicy() gets called for a cancelled load and we're in trouble
because the FrameLoader was reused for another load since then.
Test: http/tests/navigation/sync-form-submit-iframe.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):
2018-02-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Do not use RenderTreeBuilder::current() in RenderRubyRun::takeChild
https://bugs.webkit.org/show_bug.cgi?id=182607
<rdar://problem/37355944>
Reviewed by Sam Weinig.
No change in functionality.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
2018-02-08 Antti Koivisto <antti@apple.com>
Use invalidation rulesets for attribute selectors
https://bugs.webkit.org/show_bug.cgi?id=182569
Reviewed by Zalan Bujtas.
Attribute change style invalidation should use invalidation rulesets, similarly how class change invalidation already does.
We'll invalidate fewer unnecessary elements immediately and enable more significant future gains.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::classInvalidationRuleSets const):
(WebCore::DocumentRuleSets::attributeInvalidationRuleSets const):
Make and cache invalidation RuleSets for an attribute.
(WebCore::DocumentRuleSets::ancestorAttributeRulesForHTML const): Deleted.
* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
Collect attribute selectors along with match elements.
(WebCore::RuleFeatureSet::collectFeatures):
(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::registerContentAttribute):
Separate hash to deal with invalidation of content:attr(foo) special case.
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
(WebCore::makeAttributeSelectorKey): Deleted.
* css/RuleFeature.h:
(WebCore::RuleFeature::RuleFeature):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent):
(WebCore::StyleBuilderCustom::applyValueAlt):
Use registerContentAttribute()
* html/HTMLEmbedElement.cpp:
(WebCore::hasTypeOrSrc):
(WebCore::HTMLEmbedElement::parseAttribute):
Invalidate style if both type and src attributes go missing as this changes result of rendererIsNeeded().
This was previously relying on any attribute change invalidating style.
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
Collect the invalidation rulesets for this attribute change.
Also check if any attribute selector actually changes state, unlike with classes attribute changes may
often not lead to a selector becoming non-matching.
(WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
(WebCore::Style::AttributeChangeInvalidation::invalidateDescendants): Deleted.
* style/AttributeChangeInvalidation.h:
(WebCore::Style::AttributeChangeInvalidation::AttributeChangeInvalidation):
(WebCore::Style::AttributeChangeInvalidation::~AttributeChangeInvalidation):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
Should not bail on shadow tree invalidation as we may also need to invalidate siblings.
2018-02-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Introduce RenderTreeBuilder to moveChild(ren)To() functions
https://bugs.webkit.org/show_bug.cgi?id=182596
<rdar://problem/37340553>
Reviewed by Sam Weinig.
This is in preparation for moving mutation code out of moveChildTo/moveChildrenTo.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::dropAnonymousBoxChild):
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveAllChildrenTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary): Deleted.
* rendering/RenderElement.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
(WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
(WebCore::RenderTreeBuilder::childFlowStateChangesAndNoLongerAffectsParentBlock):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2018-02-08 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r228261.
This broke an internal build
Reverted changeset:
"Add a way to check if a host is an IP address"
https://bugs.webkit.org/show_bug.cgi?id=182427
https://trac.webkit.org/changeset/228261
2018-02-08 Philippe Normand <pnormand@igalia.com>
[GStreamer] WebKit improperly handles missing GStreamer elements
https://bugs.webkit.org/show_bug.cgi?id=171205
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Add a
test checking the videoflip element was correctly created. It
might not be available on some exotic distros such as Gentoo.
2018-02-08 Chris Fleizach <cfleizach@apple.com>
AX: Defer attribute computation until needed.
https://bugs.webkit.org/show_bug.cgi?id=182386
<rdar://problem/37115277>
Reviewed by Zalan Bujtas.
Accessibility is doing too much work when handling attribute changes. Here's how we can improve this:
1) Defer attribute changes while the tree is dirty (and coalesce them).
2) Don't create AXObjects when an attribute changes unnecessarily. If no client has requested an ax object, it's likely no work needs to be done
(with the exception of a few attributes like aria-modal)
3) Stop calculating the entire accessible ARIA label when trying to decide if an element should be ignored. That's generally wasteful and the
consequence of including more AX elements in the tree is very minimal.
* accessibility/AXObjectCache.cpp:
(WebCore::rendererNeedsDeferredUpdate):
(WebCore::nodeAndRendererAreValid):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::handleAriaExpandedChange):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::deferAttributeChangeIfNeeded):
(WebCore::AXObjectCache::shouldProcessAttributeChange):
(WebCore::AXObjectCache::handleAttributeChange):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::deferRecomputeIsIgnoredIfNeeded):
(WebCore::AXObjectCache::deferRecomputeIsIgnored):
(WebCore::AXObjectCache::deferTextChangedIfNeeded):
(WebCore::AXObjectCache::deferSelectedChildrenChangedIfNeeded):
(WebCore::AXObjectCache::handleAttributeChanged): Deleted.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::deferAttributeChangeIfNeeded):
(WebCore::AXObjectCache::handleAttributeChanged): Deleted.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::hasAttributesRequiredForInclusion const):
* accessibility/AccessibleNode.cpp:
(WebCore::AccessibleNode::notifyAttributeChanged):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
2018-02-08 Chris Dumez <cdumez@apple.com>
Unreviewed, tiny partial rollout of r228260 as it caused some worker failures
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::toJSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::toJSDOMGlobalObject): Deleted.
2018-02-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement::removeAnonymousWrappersForInlinesIfNecessary to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182582
<rdar://problem/37327890>
Reviewed by Antti Koivisto.
Tree mutation -> RenderTreeBuilder.
No change in functionality
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary): Deleted.
* rendering/RenderElement.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::removeAnonymousWrappersForInlinesIfNecessary):
(WebCore::RenderTreeBuilder::childFlowStateChangesAndNoLongerAffectsParentBlock):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
2018-02-08 Philippe Normand <pnormand@igalia.com>
[GStreamer] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subsequent test flaky crash
https://bugs.webkit.org/show_bug.cgi?id=173916
Reviewed by Xabier Rodriguez Calvar.
This patch fixes two crashes and a runtime warning:
- The provider client configuration should be done from the main
thread but the no-more-pads signal of deinterleave was fired from
a non-main thread.
- The deinterleave pad-removed signal can be fired for a not fully
configured pipeline if the audio context is interrupted. So the
peer quark of the removed pad needs to be checked, it might be a
null pointer.
- The provider connects to the deinterleave signals only when a
client is provided, so the signal disconnection needs to check
that to avoid runtime warnings.
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
Create a main thread notifier.
(WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
Invalidate notifier and check a client was set before
disconnecting from deinterleave signals.
(WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad):
Check validity of the pad peer.
(WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured):
Set client from main thread.
* platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
2018-02-08 Philippe Normand <pnormand@igalia.com>
[GStreamer][WebAudio] No need for version check in each loop iteration
https://bugs.webkit.org/show_bug.cgi?id=182577
Reviewed by Xabier Rodriguez Calvar.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webkit_web_audio_src_init): Detect version once only, when creating the element.
(webKitWebAudioSrcLoop): Use boolean variable instead of checking the version every time.
2018-02-08 Frederic Wang <fwang@igalia.com>
Add scrolling node types to distinguish main frames and subframes.
https://bugs.webkit.org/show_bug.cgi?id=182533
Reviewed by Simon Fraser.
This patch splits FrameScrollingNode type into two types: MainFrameScrollingNode and
SubframeScrollingNode. This is needed because new places in the code are likely to
distinguish them e.g. in ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll
or when iOS frame scrolling is introduced (see bug 173833).
No new tests, behavior unchanged.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): This is only called
for main frames, so pass MainFrameScrollingNode.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<): Distinguish subframe and main frame when dumping.
* page/scrolling/ScrollingCoordinator.h: Split FrameScrollingNode into two cases.
* page/scrolling/ScrollingStateFrameScrollingNode.cpp: Add node type to constructor and
ASSERT it remains of type FrameScrollingNode.
(WebCore::ScrollingStateFrameScrollingNode::create):
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
* page/scrolling/ScrollingStateFrameScrollingNode.h: Add node type to constructor.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isFrameScrollingNode const): Includes the two cases.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode): Split FrameScrollingNode into two cases and pass
the node type.
(WebCore::ScrollingStateTree::attachNode): The first case only happens for main frames while
the second case only happens with subframes. Use the appriate node type.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add node type to constructor and
ASSERT it remains of type FrameScrollingNode.
(WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
* page/scrolling/ScrollingTreeFrameScrollingNode.h: Add node type to constructor.
* page/scrolling/ScrollingTreeNode.h: Includes the two cases.
(WebCore::ScrollingTreeNode::isFrameScrollingNode const):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Add node type to constructor.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Ditto.
(WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
* page/scrolling/ios/ScrollingTreeIOS.cpp: Split FrameScrollingNode into two cases.
(WebCore::ScrollingTreeIOS::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Add node type to constructor.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Ditto.
(WebCore::ScrollingTreeFrameScrollingNodeMac::create):
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
* page/scrolling/mac/ScrollingTreeMac.cpp: Split FrameScrollingNode into two cases.
(ScrollingTreeMac::createScrollingTreeNode):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Distinguish the cases of
main frames and subframes.
(WebCore::scrollCoordinationRoleForNodeType): Split FrameScrollingNode into two cases.
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Distinguish the cases
of main frames and subframes.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Split FrameScrollingNode into
two cases.
2018-02-07 Darin Adler <darin@apple.com>
Try to fix ErrorEvent tests seen failing on buildbot after fix for bug 179591.
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent): Add back line of code accidentally removed.
2018-02-05 Carlos Garcia Campos <cgarcia@igalia.com>
Add a way to check if a host is an IP address
https://bugs.webkit.org/show_bug.cgi?id=182427
Reviewed by Alex Christensen.
There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
platform specific implementations, falling back to current assumption if there isn't an implementation for the
platform.
* page/OriginAccessEntry.cpp:
(WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress): Fallback implementation.
* platform/URL.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().
2018-01-13 Darin Adler <darin@apple.com>
Event improvements
https://bugs.webkit.org/show_bug.cgi?id=179591
Reviewed by Chris Dumez.
- removed all use of Deprecated::ScriptValue
- fixed uses of JSC::Strong that can lead to reference cycles in CustomEvent,
MessageEvent, and PopStateEvent, refactoring to share more code
- removed incorrect use of CachedAttribute on attributes that can change values
(should have fixed a bug; can we find a way to test this?)
- did a more thorough job of clearing state from events, including clearing
certain things before dispatching, and clearing more in initKeyboardEvent
(may have fixed some obscure low-severity bugs; can we find a way to test this?)
- removed "dummy" keyboard events
- reworked code that omits details from error events for security reasons;
old approach was "sanitizing" the error by removing the details if not
allowed, new approach is adding the details only if allowed
* Modules/encryptedmedia/NavigatorEME.h: Added forward declaration needed
to compile.
* Modules/indexeddb/IDBCursor.h: Added comment about incorrect use of JSC::Strong.
* Modules/indexeddb/IDBRequest.h: Ditto.
* Modules/paymentrequest/PaymentResponse.h: Ditto.
* WebCore.xcodeproj/project.pbxproj: Added JSValueInWrappedObject.h.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow): Use VM::create instead of VM::createLeaked. Also use
local variable instead of the global.
* bindings/js/DOMWrapperWorld.h: Put the inline bodies of the currentWorld and
worldForDOMObject functions separate from the declarations; long term goal is
that the declarations serve as documentation, and are not interspersed with the
implementations. Changed currentWorld to take a reference instead of a pointer
to ExecState. Added isWorldCompatible function.
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement): Use toJSDOMWindow instead
of toJSDOMGlobalObject and added check for null.
(WebCore::JSCustomElementInterface::invokeCallback): Ditto.
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail const): Use cachedPropertyValue.
(WebCore::JSCustomEvent::visitAdditionalChildren): Added. Needed now that we are
using JSValueInWrappedObject instead of JSC::Strong.
* bindings/js/JSDOMConvertEventListener.h:
(WebCore::Converter<IDLEventListener<T>>::convert): Pass a reference.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::toJSDOMGlobalObject): Ditto.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject): Moved initialization to nullptr
to the header.
(WebCore::toJSDOMGlobalObject): Deleted.
* bindings/js/JSDOMGlobalObject.h: Updated for the above.
* bindings/js/JSDOMWindowBase.h: Updated includes. Added "DOMWindow.h" but also
expanded the deprecated "JSDOMBinding.h" into all the things it includes.
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::JSDOMWindowProxy::finishCreation): Tweak argument type to match usage.
(WebCore::JSDOMWindowProxy::create): Moved here from header, rolled in the code
that creates the structure.
(WebCore::JSDOMWindowProxy::setWindow): Take a reference instead of a pointer
or a RefPtr&&.
(WebCore::JSDOMWindowProxy::toWrapped): Use ? : instead of if.
(WebCore::toJS): Pass a reference.
* bindings/js/JSDOMWindowProxy.h: Updated for abvoe changes.
* bindings/js/JSDOMWrapper.cpp:
(WebCore::cloneAcrossWorlds): Added.
* bindings/js/JSDOMWrapper.h: Ditto.
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::JSErrorHandler): Changed to take a reference.
Marked inline.
(WebCore::JSErrorHandler::create): Moved here from header. No longer inline, but
the constructor is now inline, so same number of levels of function calls, and
less code compiled at the call site and less to compile in the header.
(WebCore::JSErrorHandler::handleEvent): Use toJSDOMWindow instead
of toJSDOMGlobalObject.
* bindings/js/JSErrorHandler.h: Ditto. Also made createJSErrorHandler take
references instead of pointers.
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::create): Moved here from the header.
(WebCore::createEventListenerForEventHandlerAttribute): Updated for change to
currentWorld.
(WebCore::toJSDOMGlobalObject): Moved here from JSDOMGlobalObject.cpp because
this is the only place this function is used now. Also, this was one of four
different overrides and so it was good to delete the other three. Also updated
to take a reference rather than a "must not be null" pointer.
(WebCore::JSEventListener::handleEvent): Coding style tweaks.
(WebCore::JSEventListener::virtualisAttribute const): Deleted. Now isAttribute
is virtual and uses final as needed to remain inline-able and efficient.
(WebCore::JSEventListener::operator== const): Use is<> and downcast<> instead
of JSEventListener::cast.
(WebCore::eventHandlerAttribute): Updated for change to currentWorld.
(WebCore::setEventHandlerAttribute): Ditto.
(WebCore::setWindowEventHandlerAttribute): Ditto.
(WebCore::setDocumentEventHandlerAttribute): Ditto.
* bindings/js/JSEventListener.h: Moved create functions into the cpp file.
Removed the cast function, since callers can use is<> and downcast<> instead.
Use final rather than override and made isAttribute override the virtual
function in the base class, eliminating virtualIsAttribute.
* bindings/js/JSExtendableMessageEventCustom.cpp:
(WebCore::JSExtendableMessageEvent::data const): Use isWorldCompatible.
Still need to return here and fix the reference cycle for this class.
* bindings/js/JSLazyEventListener.cpp:
(WebCore::eventParameterName): Moved up so it can be used by the constructor.
(WebCore::convertZeroToOne): Added, so that the constructor can fix up text
positions passed in to it as part of initializing a data member.
(WebCore::JSLazyEventListener::JSLazyEventListener): Changed to take
a CreationArguments object instead of lots of separate arguments.
(WebCore::JSLazyEventListener::initializeJSFunction const): Removed unneeded
checks of m_code and m_eventParameterName, both guaranteed not to be null
by the constructor. Tweaked coding style a bit.
(WebCore::JSLazyEventListener::create): Pass CreationArguments object.
* bindings/js/JSLazyEventListener.h: Updated for above changes. Changed the
m_eventParameterName to be a reference since it's always a global string
that is never destroyed.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data const): Use cachedPropertyValue and also
updated for the new version of MessageEvent that uses a Variant instead
of a type plus separate functions for each type.
(WebCore::JSMessageEvent::visitAdditionalChildren): Added. Needed now that we are
using JSValueInWrappedObject instead of JSC::Strong.
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state const): Use isWorldCompatible and also updated
to use JSValueInWrappedObject instead of JSC::Strong. Would be nice to share more
code with CustomEvent and MessageEvent, but at the moment they are subtly different.
Changed cacheState from a function to a lambda.
(WebCore::JSPopStateEvent::visitAdditionalChildren): Added. Needed now that we are
using JSValueInWrappedObject instead of JSC::Strong.
* bindings/js/JSValueInWrappedObject.h: Added.
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::restore): Updated for changes to JSDOMWindowProxy.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::createWindowProxy): Ditto.
(WebCore::ScriptController::setDOMWindowForWindowProxy): Ditto.
* bindings/js/WorkerScriptController.cpp: Removed include of ScriptValue.h.
(WebCore::WorkerScriptController::evaluate): Reworked to use the new
canIncludeErrorDetails instead of sanitizeScriptError. Added a FIXME about the
strange handling of the error message out argument.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString): Pass a reference to worldForDOMObject.
(GenerateImplementation): Removed an incorrect comment about a removed error
check that is truly unneeded.
(GenerateAttributeGetterBodyDefinition): Pass a reference to worldForDOMObject.
(GenerateAttributeSetterBodyDefinition): Pass references to createJSErrorHandler
and worldForDOMObject.
(GenerateCallWith): Pass a reference to worldForDOMObject.
* bindings/scripts/test/JS/JSTestGlobalObject.cpp: Updated for above changes.
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::CustomEvent): Marked inline. Removed now unneeded
ExecState argument.
(WebCore::CustomEvent::create): Moved here from header. No longer inline, but
the constructor is now inline, so same number of levels of function calls, and
less code compiled at the call site and less to compile in the header.
(WebCore::CustomEvent::initCustomEvent): Updated to use JSValueInWrappedObject.
(WebCore::CustomEvent::trySerializeDetail): Deleted. Now handled by bindings.
* dom/CustomEvent.h: Updated for the above.
* dom/CustomEvent.idl: Added JSCustomMarkFunction and removed
CallWith=ScriptState.
* dom/Document.cpp:
(WebCore::Document::shouldBypassMainWorldContentSecurityPolicy const):
Updated to pass reference to currentWorld but also rewrote to be more direct.
* dom/Element.cpp:
(WebCore::Element::isKeyboardFocusable const): Take a pointer instead of a
reference to the keyboard event. This function can be called with no event;
before this patch we were using a "dummy event".
* dom/Element.h: Ditto.
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::error): Use isWorldCompatible.
* dom/Event.cpp:
(WebCore::Event::create): Moved here from header.
(WebCore::Event::createForBindings): Ditto.
(WebCore::Event::initEvent): Updated to use the name m_canceled instead of
the name m_defaultPrevented.
(WebCore::Event::resetBeforeDispatch): Added. Clears m_defaultHandled so
a value left over from a previous dispatch doesn't affect the next dispatch.
* dom/Event.h: Renamed m_defaultPrevented to m_canceled to match specification
terminology and be slightly clearer. Added resetBeforeDispatch. Removed the
setDefaultPrevented function.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Added call to resetBeforeDispatch.
* dom/EventListener.h: Made isAttribute virtual and got rid of virtualIsAttribute,
which was an alternative to using "final" before we had that in the language.
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent): Added call to resetBeforeDispatch.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent): Removed unneeded code that initializes
m_handledByInputMethod to false; we do that in the class definition now.
(WebCore::KeyboardEvent::create): Moved here from header.
(WebCore::KeyboardEvent::createForBindings): Ditto.
(WebCore::KeyboardEvent::initKeyboardEvent): Added code to reset m_charCode,
m_isComposing, m_keyCode, m_repeat, m_underlyingPlatformEvent, m_which, m_code,
and m_key. These are needed now that we can reuse an existing event; we don't
want them getting out of sync with the other data members.
(WebCore::KeyboardEvent::keyCode const): Updated for name change from m_keyEvent
to m_underlyingPlatformEvent.
(WebCore::KeyboardEvent::charCode const): Ditto.
(WebCore::findKeyboardEvent): Deleted. Was unused.
* dom/KeyboardEvent.h: Updated for the above. Removed KeyboardEvent::createForDummy.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent): Removed unnneded ExecState argument.
Simplified since m_data is now a Variant.
(WebCore::MessageEvent::create): More of the same.
(WebCore::MessageEvent::initMessageEvent): Ditto.
(WebCore::MessageEvent::trySerializeData): Deleted.
(WebCore::MessageEvent::data const): Deleted.
* dom/MessageEvent.h: Use a Variant.
* dom/MessageEvent.idl: Added JSCustomMarkFunction and removed
CallWith=ScriptState and CachedAttribute.
* dom/MouseEvent.h: Removed obsolete comment.
* dom/MouseEvent.idl: Wrap line differently.
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent): Removed unneeded ExecState argument.
Updated to use JSValueInWrappedObject.
(WebCore::PopStateEvent::create): Ditto.
(WebCore::PopStateEvent::trySerializeState): Ditto.
* dom/PopStateEvent.h: Ditto.
* dom/PopStateEvent.idl: Use JSCustomMarkFunction, and don't use
ConstructorCallWith=ScriptState.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::sanitizeScriptError): Deleted.
(WebCore::ScriptExecutionContext::canIncludeErrorDetails): Added.
(WebCore::ScriptExecutionContext::dispatchErrorEvent): Clarify by
using canIncludeErrorDetails instead of sanitizeScriptError.
* dom/ScriptExecutionContext.h: Ditto.
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent): Updated for name change and also to
eliminate m_initializedWithPlatformWheelEvent.
(WebCore::WheelEvent::create): Moved here from header.
(WebCore::WheelEvent::createForBindings): Ditto.
(WebCore::WheelEvent::initWebKitWheelEvent): Renamed from initWheelEvent.
* dom/WheelEvent.h: Renamed initWheelEvent to initWebKitWheelEvent since
there is no standard init function for wheel events and we have this only
for backward compatibility. Got rid of the separate boolean
m_initializedWithPlatformWheelEvent and instead made the renamed
m_wheelEvent, m_underlyingPlatformEvent, optional for when there is no
underlying platform event.
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const): Take a
pointer to the event so we can handle the case where there is no event.
* html/BaseDateAndTimeInputType.h: Ditto.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable const): Ditto.
* html/HTMLAnchorElement.h: Ditto.
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isKeyboardFocusable const): Ditto.
* html/HTMLAreaElement.h: Ditto.
* html/HTMLDocument.cpp: Added include of "DOMWindow.h".
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isKeyboardFocusable const): Take
pointer to the event.
* html/HTMLFormControlElement.h: Ditto.
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::isKeyboardFocusable const): Ditto.
* html/HTMLFrameOwnerElement.h: Ditto.
* html/HTMLIFrameElement.h: Ditto.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isKeyboardFocusable const): Ditto.
(WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable const): Ditto.
* html/HTMLInputElement.h: Ditto.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isKeyboardFocusable const): Ditto.
* html/HTMLPlugInElement.h: Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::isKeyboardFocusable const): Ditto.
* html/HTMLSelectElement.h: Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::isKeyboardFocusable const): Ditto.
* html/HTMLTextAreaElement.h: Ditto.
* html/InputType.cpp:
(WebCore::InputType::isKeyboardFocusable const): Ditto.
* html/InputType.h: Ditto.
* html/RadioInputType.cpp:
(WebCore::RadioInputType::isKeyboardFocusable const): Ditto.
* html/RadioInputType.h: Ditto.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isKeyboardFocusable const): Ditto.
* html/TextFieldInputType.h: Ditto.
* inspector/CommandLineAPIHost.cpp:
(WebCore::listenerEntriesFromListenerInfo): Pass reference to currentWorld.
Use is<> and downcast<> instead of JSEventListener::cast.
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::isContentScript const): Pass reference to
currentWorld.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
Use is<> and downcast<> instead of JSEventListener::cast.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isKeyboardFocusable const): Take a
pointer to the event so we can handle the case where there is no event.
* mathml/MathMLElement.h: Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent): Added call to resetBeforeDispatch.
All event dispatching paths now need to do this; there are 3.
* page/EventHandler.cpp:
(WebCore::handleWheelEventInAppropriateEnclosingBox): Use the new
underlyingPlatformEvent function, less confusing than calling a function
named wheelEvent() on an object of type WheelEvent. Also, it returns
a const& to std::optional instead of a pointer, so updated for that.
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
(WebCore::EventHandler::internalKeyEvent): Use preventDefault instead
of setDefaultPrevented(true).
(WebCore::EventHandler::tabsToLinks const): Take a pointer.
(WebCore::EventHandler::defaultArrowEventHandler): Pass a pointer.
(WebCore::EventHandler::defaultTabEventHandler): Ditto.
* page/EventHandler.h: Updated for the above.
* page/EventSource.cpp:
(WebCore::EventSource::dispatchMessageEvent): Pass a reference rather
than a pointer when creating a message event.
* page/FocusController.cpp:
(WebCore::isFocusableElementOrScopeOwner): Use a pointer instead of reference
for keyboard event.
(WebCore::isNonFocusableScopeOwner): Ditto.
(WebCore::isFocusableScopeOwner): Ditto.
(WebCore::shadowAdjustedTabIndex): Ditto.
(WebCore::FocusController::findFocusableElementDescendingIntoSubframes):
Renamed to use simpler terminology than "descending down into frame document".
Changed to take a pointer instead of reference.
(WebCore::FocusController::setInitialFocus): Pass nullptr instead of
using KeyboardEvent::createForDummy.
(WebCore::FocusController::advanceFocus): Pointer instead of reference.
(WebCore::FocusController::advanceFocusInDocumentOrder): Ditto.
(WebCore::FocusController::findFocusableElementAcrossFocusScope): Ditto.
(WebCore::FocusController::findFocusableElementWithinScope): Ditto.
(WebCore::FocusController::nextFocusableElementWithinScope): Ditto.
(WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
(WebCore::FocusController::findFocusableElementOrScopeOwner): Ditto.
(WebCore::FocusController::findElementWithExactTabIndex): Ditto.
(WebCore::nextElementWithGreaterTabIndex): Ditto.
(WebCore::previousElementWithLowerTabIndex): Ditto.
(WebCore::FocusController::nextFocusableElement): Ditto.
(WebCore::FocusController::previousFocusableElement): Ditto.
(WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto.
(WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto.
(WebCore::FocusController::findFocusCandidateInContainer): Ditto.
(WebCore::FocusController::advanceFocusDirectionallyInContainer): Ditto.
(WebCore::FocusController::advanceFocusDirectionally): Ditto.
* page/FocusController.h: Updated for the above.
* page/PageConsoleClient.cpp:
(WebCore::objectArgumentAt): Added. Helper to make functions below simpler.
(WebCore::canvasRenderingContext): Factored out logic to get the context
from either a canvas or a canvas rendering context from the functions below.
Also updated to not use ScriptValue and to use auto quite a bit more.
(WebCore::PageConsoleClient::record): Updated to use the functions above.
(WebCore::PageConsoleClient::recordEnd): Ditto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tabsToAllFormControls const): Take a pointer
instead of a reference.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::tabsToAllFormControls const): Ditto.
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Ditto.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Ditto.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::isKeyboardFocusable const): Ditto.
* svg/SVGAElement.h: Ditto.
* testing/Internals.cpp:
(WebCore::Internals::isFromCurrentWorld const): Use isWorldCompatible.
2018-02-07 Andy Estes <aestes@apple.com>
ASSERTION FAILED: vm->currentThreadIsHoldingAPILock() seen with http/tests/paymentrequest/payment-request-show-method.https.html
https://bugs.webkit.org/show_bug.cgi?id=182591
Reviewed by Youenn Fablet.
Fixes assertion failures in http/tests/paymentrequest/payment-request-show-method.https.html.
DOMPromise::whenSettled() calls the JSC API without first aquiring the API lock, and
r228195 added a call to whenSettled() where the lock is not guaranteed to be already
acquired.
Fix this by creating a JSLockHolder in DOMPromise::whenSettled().
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenSettled):
2018-02-07 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r228243.
Introduced an assertion failure with API test
FullscreenZoomInitialFrame.WebKit
Reverted changeset:
"Assert that NSApp is not running in the WebProcess."
https://bugs.webkit.org/show_bug.cgi?id=182553
https://trac.webkit.org/changeset/228243
2018-02-07 Christopher Reid <chris.reid@sony.com>
[Curl] Cookie Database has some warnings when compiled in clang
https://bugs.webkit.org/show_bug.cgi?id=182583
Reviewed by Alex Christensen.
No new tests, no change in behavior.
Fixing unused-parameter, missing-field-initializers, reorder, and pragma-once-outside-header warnings.
* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
2018-02-07 Ryosuke Niwa <rniwa@webkit.org>
Remove unused CSSParserContext in CSSParser::parseInlineStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=182587
Reviewed by Simon Fraser.
Removed the code. There is no need to create an unused CSSParserContext in CSSParser.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseInlineStyleDeclaration):
* css/parser/CSSParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
* css/parser/CSSParserImpl.h:
2018-02-07 Ross Kirsling <ross.kirsling@sony.com>
Add missing #if ENABLE(VIDEO_TRACK) after r228201.
https://bugs.webkit.org/show_bug.cgi?id=182585
Reviewed by Chris Dumez.
* loader/LinkPreloadResourceClients.h:
2018-02-07 Per Arne Vollan <pvollan@apple.com>
Assert that NSApp is not running in the WebProcess.
https://bugs.webkit.org/show_bug.cgi?id=182553
<rdar://problem/37316144>
Reviewed by Simon Fraser.
In WebCore, there are a few places where NSApp is referenced. Since the WebContent process
is no longer using the NSApplication run loop, and NSApp is no longer guaranteed to be
valid, we should make sure that the NSApp is not referenced by the WebContent process or
the Network process, by asserting that the NSApplication event loop is running when NSApp
is referenced. It is still ok for the UIProcess to reference NSApp. Adding these assert
will help catch references to NSApp when the NSApplication run loop is not used.
Also, do not post a fake mouse event in PasteBoard::setDragImage when the NSApplication
run loop is not running, since this is only relevant in WK1.
No new tests, covered by existing tests.
* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController windowDidLoad]):
(-[WebVideoFullscreenController updateMenuAndDockForFullscreen]):
* platform/mac/WebWindowAnimation.mm:
(WebCore::WebWindowAnimationDurationFromDuration):
2018-02-07 Youenn Fablet <youenn@apple.com>
ASSERTION FAILED: m_timeOrigin in Performance::Performance()
https://bugs.webkit.org/show_bug.cgi?id=182558
<rdar://problem/37297551>
Reviewed by Chris Dumez.
Test: http/wpt/fetch/cors-preflight-star.any.serviceworker.html
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):
2018-02-07 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION(r226396): File paths are inserted when dropping image files
https://bugs.webkit.org/show_bug.cgi?id=182557
<rdar://problem/37294120>
Reviewed by Ryosuke Niwa.
Reverts unintended changes in <http://trac.webkit.org/r226396>. Before r226396, WebContentReader::readFilenames
(a helper function in macOS-specific code) contained logic to create and insert attachment elements if
ENABLE(ATTACHMENT_ELEMENT); otherwise, it would fall back to inserting the visible URL as a text node. Since we
enable the attachment element on all Cocoa platforms via xcconfig files, this was effectively dead code.
However, when r226396 (which moved this out from macOS to Cocoa platform code) refactored this helper function,
it also moved this chunk of code out of the !ENABLE(ATTACHMENT) conditional and into a PLATFORM(MAC) guard,
which means that we now fall back to inserting file paths as text when attachment elements are disabled. To fix
this, we simply remove the (previously) dead code.
A more subtle difference is that we no longer always return true from WebContentReader::readFilePaths. This
means that when we drop files, we no longer skip over the early return in documentFragmentFromDragData when
we've made a fragment, so we read the file path as a URL. To address this, we just restore the pre-macOS 10.13.4
behavior of initializing the document fragment.
Test: modified editing/pasteboard/drag-files-to-editable-element-as-URLs.html.
* editing/WebContentReader.cpp:
(WebCore::WebContentReader::ensureFragment): Deleted.
Remove this helper, as it was only used in WebContentReader::readFilePaths.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readFilePaths):
2018-02-07 John Wilander <wilander@apple.com>
Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode
https://bugs.webkit.org/show_bug.cgi?id=182559
<rdar://problem/36990337>
Reviewed by Andy Estes.
Tests: http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html
http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html
http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html
http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::referrerToOriginString):
Now exposed within WebCore. This is to make sure we create a proper referrer
string in WebCore::ResourceRequestBase::setExistingHTTPReferrerToOriginString().
(WebCore::referrerToOriginString): Deleted.
Used to be internal.
* page/SecurityPolicy.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setExistingHTTPReferrerToOriginString):
New, exported function used in WebKit. Note that this function does not
set the referrer if the request has none since before.
* platform/network/ResourceRequestBase.h:
2018-02-07 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Remove RenderElement::destroyLeftoverChildren.
https://bugs.webkit.org/show_bug.cgi?id=182518
<rdar://problem/37256035>
Reviewed by Antti Koivisto.
Remove leftover children before we call takeChild() on the parent (as opposed to when
we finally call destroy() on the parent).
This patch also explicitly destroys the top level pagination renderers.
Covered by existing tests.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild):
(WebCore::RenderElement::destroyLeftoverChildren): Deleted.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::destroy):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
* rendering/updating/RenderTreeUpdater.h:
2018-02-07 Daniel Bates <dabates@apple.com>
Log error when authentication challenge is blocked due to an insecure request
https://bugs.webkit.org/show_bug.cgi?id=182358
Reviewed by Andy Estes.
Emit an error message to Web Inspector console that explains why an authentication
challenge was blocked so that a developer can fix up their site.
Tests: http/tests/security/mixedContent/insecure-basic-auth-image.https.html
http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-insecure-page.https.html
http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-secure-page-via-insecure-redirect.https.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData): Log to the console an error message
if the document we are loading was forbidden from prompting for credentials.
Also removed duplicate assertion to ensure document is non-null and update
call to LinkLoader::loadLinksFromHeader() to use local variable to access
the document we are loading instead of asking the frame for it, again.
(WebCore::FrameLoader::reportAuthenticationChallengeBlocked): Added.
* loader/FrameLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::willSendRequestInternal):
Track the decision to forbid asking for credentials due to Fetch spec. requirements (m_canAskClientForCredentials)
independently from the decision to forbid them due to making an insecure request (m_wasInsecureRequestSeen)
so that we know the reason why we blocked asking for credentials when we receive an authentication challenge.
(WebCore::ResourceLoader::didBlockAuthenticationChallenge): Added.
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified code now that we track
whether we have seen an insecure request so far independently from decision to forbid prompting for
credentials due to a Fetch spec. requirement.
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
Store a bit whether we have seen an insecure request when loading the resource so far. Disallow
asking for credentials if we have seen an insecure request so far. Once we receive a response
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const): Added.
(WebCore::ResourceLoader::wasInsecureRequestSeen const): Added.
2018-02-06 Matt Lewis <jlewis3@apple.com>
Removed the assertions from VideoFullscreenInterfaceAVKit.mm temporarily to stop the resulting crashes during debugging.
https://bugs.webkit.org/show_bug.cgi?id=182527
Unreviewed build fix.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):
2018-02-07 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock::removeLeftoverAnonymousBlock to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182510
<rdar://problem/37250037>
Reviewed by Antti Koivisto.
Do not reinvent subtree reparenting.
Covered by existing tests.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removeLeftoverAnonymousBlock): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveAllChildrenToInternal):
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::detachRendererInternal):
(WebCore::RenderElement::attachRendererInternal):
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderElement.h:
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.h:
* rendering/RenderTextControl.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::Block::childBecameNonInline):
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
* rendering/updating/RenderTreeBuilderBlock.h:
2018-02-06 Don Olmstead <don.olmstead@sony.com>
Remove WebCore/ForwardingHeaders directory
https://bugs.webkit.org/show_bug.cgi?id=182347
Reviewed by Keith Miller.
No new tests. No change in behavior.
* CMakeLists.txt:
* ForwardingHeaders/bindings/ScriptFunctionCall.h: Removed.
* ForwardingHeaders/bindings/ScriptObject.h: Removed.
* ForwardingHeaders/bindings/ScriptValue.h: Removed.
* ForwardingHeaders/builtins/BuiltinNames.h: Removed.
* ForwardingHeaders/builtins/BuiltinUtils.h: Removed.
* ForwardingHeaders/builtins/JSCBuiltins.h: Removed.
* ForwardingHeaders/bytecode/CodeBlock.h: Removed.
* ForwardingHeaders/bytecode/SpeculatedType.h: Removed.
* ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Removed.
* ForwardingHeaders/debugger/Debugger.h: Removed.
* ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Removed.
* ForwardingHeaders/domjit/DOMJITEffect.h: Removed.
* ForwardingHeaders/domjit/DOMJITGetterSetter.h: Removed.
* ForwardingHeaders/domjit/DOMJITHeapRange.h: Removed.
* ForwardingHeaders/domjit/DOMJITSignature.h: Removed.
* ForwardingHeaders/heap/BlockDirectoryInlines.h: Removed.
* ForwardingHeaders/heap/DeleteAllCodeEffort.h: Removed.
* ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Removed.
* ForwardingHeaders/heap/GCActivityCallback.h: Removed.
* ForwardingHeaders/heap/GCFinalizationCallback.h: Removed.
* ForwardingHeaders/heap/HandleTypes.h: Removed.
* ForwardingHeaders/heap/Heap.h: Removed.
* ForwardingHeaders/heap/HeapInlines.h: Removed.
* ForwardingHeaders/heap/HeapObserver.h: Removed.
* ForwardingHeaders/heap/IncrementalSweeper.h: Removed.
* ForwardingHeaders/heap/LockDuringMarking.h: Removed.
* ForwardingHeaders/heap/MachineStackMarker.h: Removed.
* ForwardingHeaders/heap/MarkedBlockInlines.h: Removed.
* ForwardingHeaders/heap/MarkingConstraint.h: Removed.
* ForwardingHeaders/heap/RunningScope.h: Removed.
* ForwardingHeaders/heap/SimpleMarkingConstraint.h: Removed.
* ForwardingHeaders/heap/SlotVisitor.h: Removed.
* ForwardingHeaders/heap/SlotVisitorInlines.h: Removed.
* ForwardingHeaders/heap/Strong.h: Removed.
* ForwardingHeaders/heap/StrongInlines.h: Removed.
* ForwardingHeaders/heap/SubspaceInlines.h: Removed.
* ForwardingHeaders/heap/ThreadLocalCache.h: Removed.
* ForwardingHeaders/heap/Weak.h: Removed.
* ForwardingHeaders/heap/WeakInlines.h: Removed.
* ForwardingHeaders/inspector/ConsoleMessage.h: Removed.
* ForwardingHeaders/inspector/ContentSearchUtilities.h: Removed.
* ForwardingHeaders/inspector/IdentifiersFactory.h: Removed.
* ForwardingHeaders/inspector/InjectedScript.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptBase.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptHost.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptManager.h: Removed.
* ForwardingHeaders/inspector/InjectedScriptModule.h: Removed.
* ForwardingHeaders/inspector/InspectorAgentBase.h: Removed.
* ForwardingHeaders/inspector/InspectorAgentRegistry.h: Removed.
* ForwardingHeaders/inspector/InspectorBackendDispatcher.h: Removed.
* ForwardingHeaders/inspector/InspectorBackendDispatchers.h: Removed.
* ForwardingHeaders/inspector/InspectorEnvironment.h: Removed.
* ForwardingHeaders/inspector/InspectorFrontendChannel.h: Removed.
* ForwardingHeaders/inspector/InspectorFrontendDispatchers.h: Removed.
* ForwardingHeaders/inspector/InspectorFrontendRouter.h: Removed.
* ForwardingHeaders/inspector/InspectorProtocolObjects.h: Removed.
* ForwardingHeaders/inspector/InspectorProtocolTypes.h: Removed.
* ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Removed.
* ForwardingHeaders/inspector/ScriptArguments.h: Removed.
* ForwardingHeaders/inspector/ScriptBreakpoint.h: Removed.
* ForwardingHeaders/inspector/ScriptCallFrame.h: Removed.
* ForwardingHeaders/inspector/ScriptCallStack.h: Removed.
* ForwardingHeaders/inspector/ScriptCallStackFactory.h: Removed.
* ForwardingHeaders/inspector/ScriptDebugListener.h: Removed.
* ForwardingHeaders/inspector/ScriptDebugServer.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorConsoleAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h: Removed.
* ForwardingHeaders/inspector/agents/InspectorScriptProfilerAgent.h: Removed.
* ForwardingHeaders/interpreter/CallFrame.h: Removed.
* ForwardingHeaders/interpreter/FrameTracers.h: Removed.
* ForwardingHeaders/interpreter/ShadowChicken.h: Removed.
* ForwardingHeaders/interpreter/StackVisitor.h: Removed.
* ForwardingHeaders/jit/JITCode.h: Removed.
* ForwardingHeaders/jit/JITMathICForwards.h: Removed.
* ForwardingHeaders/jit/Snippet.h: Removed.
* ForwardingHeaders/jit/SnippetParams.h: Removed.
* ForwardingHeaders/jit/SpillRegistersMode.h: Removed.
* ForwardingHeaders/masm/X86Assembler.h: Removed.
* ForwardingHeaders/parser/ParserError.h: Removed.
* ForwardingHeaders/parser/SourceCode.h: Removed.
* ForwardingHeaders/parser/SourceProvider.h: Removed.
* ForwardingHeaders/parser/SourceProviderCache.h: Removed.
* ForwardingHeaders/profiler/ProfilerDatabase.h: Removed.
* ForwardingHeaders/runtime/ArgList.h: Removed.
* ForwardingHeaders/runtime/ArrayBuffer.h: Removed.
* ForwardingHeaders/runtime/ArrayBufferView.h: Removed.
* ForwardingHeaders/runtime/ArrayPrototype.h: Removed.
* ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed.
* ForwardingHeaders/runtime/BooleanObject.h: Removed.
* ForwardingHeaders/runtime/CallData.h: Removed.
* ForwardingHeaders/runtime/CatchScope.h: Removed.
* ForwardingHeaders/runtime/CommonIdentifiers.h: Removed.
* ForwardingHeaders/runtime/Completion.h: Removed.
* ForwardingHeaders/runtime/ConfigFile.h: Removed.
* ForwardingHeaders/runtime/ConsoleClient.h: Removed.
* ForwardingHeaders/runtime/ConsoleTypes.h: Removed.
* ForwardingHeaders/runtime/ConstructAbility.h: Removed.
* ForwardingHeaders/runtime/ConstructData.h: Removed.
* ForwardingHeaders/runtime/DataView.h: Removed.
* ForwardingHeaders/runtime/DateInstance.h: Removed.
* ForwardingHeaders/runtime/Error.h: Removed.
* ForwardingHeaders/runtime/ErrorHandlingScope.h: Removed.
* ForwardingHeaders/runtime/ErrorInstance.h: Removed.
* ForwardingHeaders/runtime/ErrorPrototype.h: Removed.
* ForwardingHeaders/runtime/Exception.h: Removed.
* ForwardingHeaders/runtime/ExceptionHelpers.h: Removed.
* ForwardingHeaders/runtime/Float32Array.h: Removed.
* ForwardingHeaders/runtime/Float64Array.h: Removed.
* ForwardingHeaders/runtime/FunctionConstructor.h: Removed.
* ForwardingHeaders/runtime/FunctionExecutable.h: Removed.
* ForwardingHeaders/runtime/FunctionPrototype.h: Removed.
* ForwardingHeaders/runtime/HashMapImpl.h: Removed.
* ForwardingHeaders/runtime/Identifier.h: Removed.
* ForwardingHeaders/runtime/IdentifierInlines.h: Removed.
* ForwardingHeaders/runtime/InitializeThreading.h: Removed.
* ForwardingHeaders/runtime/Int16Array.h: Removed.
* ForwardingHeaders/runtime/Int32Array.h: Removed.
* ForwardingHeaders/runtime/Int8Array.h: Removed.
* ForwardingHeaders/runtime/InternalFunction.h: Removed.
* ForwardingHeaders/runtime/Intrinsic.h: Removed.
* ForwardingHeaders/runtime/IterationKind.h: Removed.
* ForwardingHeaders/runtime/IteratorOperations.h: Removed.
* ForwardingHeaders/runtime/IteratorPrototype.h: Removed.
* ForwardingHeaders/runtime/JSAPIValueWrapper.h: Removed.
* ForwardingHeaders/runtime/JSArray.h: Removed.
* ForwardingHeaders/runtime/JSArrayBuffer.h: Removed.
* ForwardingHeaders/runtime/JSArrayBufferView.h: Removed.
* ForwardingHeaders/runtime/JSCInlines.h: Removed.
* ForwardingHeaders/runtime/JSCJSValue.h: Removed.
* ForwardingHeaders/runtime/JSCJSValueInlines.h: Removed.
* ForwardingHeaders/runtime/JSCallee.h: Removed.
* ForwardingHeaders/runtime/JSCell.h: Removed.
* ForwardingHeaders/runtime/JSCellInlines.h: Removed.
* ForwardingHeaders/runtime/JSDataView.h: Removed.
* ForwardingHeaders/runtime/JSDestructibleObject.h: Removed.
* ForwardingHeaders/runtime/JSDestructibleObjectHeapCellType.h: Removed.
* ForwardingHeaders/runtime/JSExportMacros.h: Removed.
* ForwardingHeaders/runtime/JSFunction.h: Removed.
* ForwardingHeaders/runtime/JSGlobalObject.h: Removed.
* ForwardingHeaders/runtime/JSGlobalObjectInlines.h: Removed.
* ForwardingHeaders/runtime/JSInternalPromise.h: Removed.
* ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Removed.
* ForwardingHeaders/runtime/JSLock.h: Removed.
* ForwardingHeaders/runtime/JSMap.h: Removed.
* ForwardingHeaders/runtime/JSMapIterator.h: Removed.
* ForwardingHeaders/runtime/JSModuleLoader.h: Removed.
* ForwardingHeaders/runtime/JSModuleRecord.h: Removed.
* ForwardingHeaders/runtime/JSNativeStdFunction.h: Removed.
* ForwardingHeaders/runtime/JSONObject.h: Removed.
* ForwardingHeaders/runtime/JSObject.h: Removed.
* ForwardingHeaders/runtime/JSObjectInlines.h: Removed.
* ForwardingHeaders/runtime/JSPromise.h: Removed.
* ForwardingHeaders/runtime/JSPromiseConstructor.h: Removed.
* ForwardingHeaders/runtime/JSPromiseDeferred.h: Removed.
* ForwardingHeaders/runtime/JSProxy.h: Removed.
* ForwardingHeaders/runtime/JSRunLoopTimer.h: Removed.
* ForwardingHeaders/runtime/JSScriptFetchParameters.h: Removed.
* ForwardingHeaders/runtime/JSScriptFetcher.h: Removed.
* ForwardingHeaders/runtime/JSSegmentedVariableObjectHeapCellType.h: Removed.
* ForwardingHeaders/runtime/JSSet.h: Removed.
* ForwardingHeaders/runtime/JSSetIterator.h: Removed.
* ForwardingHeaders/runtime/JSSourceCode.h: Removed.
* ForwardingHeaders/runtime/JSString.h: Removed.
* ForwardingHeaders/runtime/JSTypedArrays.h: Removed.
* ForwardingHeaders/runtime/JSWithScope.h: Removed.
* ForwardingHeaders/runtime/Lookup.h: Removed.
* ForwardingHeaders/runtime/MapBase.h: Removed.
* ForwardingHeaders/runtime/MapData.h: Removed.
* ForwardingHeaders/runtime/MapDataInlines.h: Removed.
* ForwardingHeaders/runtime/MatchResult.h: Removed.
* ForwardingHeaders/runtime/Microtask.h: Removed.
* ForwardingHeaders/runtime/ObjectConstructor.h: Removed.
* ForwardingHeaders/runtime/ObjectPrototype.h: Removed.
* ForwardingHeaders/runtime/Operations.h: Removed.
* ForwardingHeaders/runtime/PrivateName.h: Removed.
* ForwardingHeaders/runtime/PromiseDeferredTimer.h: Removed.
* ForwardingHeaders/runtime/PropertyNameArray.h: Removed.
* ForwardingHeaders/runtime/Protect.h: Removed.
* ForwardingHeaders/runtime/RegExp.h: Removed.
* ForwardingHeaders/runtime/RegExpObject.h: Removed.
* ForwardingHeaders/runtime/RuntimeFlags.h: Removed.
* ForwardingHeaders/runtime/SamplingProfiler.h: Removed.
* ForwardingHeaders/runtime/ScriptFetchParameters.h: Removed.
* ForwardingHeaders/runtime/ScriptFetcher.h: Removed.
* ForwardingHeaders/runtime/StringObject.h: Removed.
* ForwardingHeaders/runtime/StringPrototype.h: Removed.
* ForwardingHeaders/runtime/Structure.h: Removed.
* ForwardingHeaders/runtime/StructureChain.h: Removed.
* ForwardingHeaders/runtime/StructureInlines.h: Removed.
* ForwardingHeaders/runtime/Symbol.h: Removed.
* ForwardingHeaders/runtime/SymbolTable.h: Removed.
* ForwardingHeaders/runtime/ThrowScope.h: Removed.
* ForwardingHeaders/runtime/TypedArrayController.h: Removed.
* ForwardingHeaders/runtime/TypedArrayInlines.h: Removed.
* ForwardingHeaders/runtime/TypedArrays.h: Removed.
* ForwardingHeaders/runtime/Uint16Array.h: Removed.
* ForwardingHeaders/runtime/Uint32Array.h: Removed.
* ForwardingHeaders/runtime/Uint8Array.h: Removed.
* ForwardingHeaders/runtime/Uint8ClampedArray.h: Removed.
* ForwardingHeaders/runtime/VM.h: Removed.
* ForwardingHeaders/runtime/VMEntryScope.h: Removed.
* ForwardingHeaders/runtime/Watchdog.h: Removed.
* ForwardingHeaders/runtime/WeakGCMap.h: Removed.
* ForwardingHeaders/runtime/WeakGCMapInlines.h: Removed.
* ForwardingHeaders/runtime/WriteBarrier.h: Removed.
* ForwardingHeaders/wasm/WasmModule.h: Removed.
* ForwardingHeaders/wasm/js/JSWebAssemblyModule.h: Removed.
* ForwardingHeaders/yarr/RegularExpression.h: Removed.
* ForwardingHeaders/yarr/Yarr.h: Removed.
* ForwardingHeaders/yarr/YarrInterpreter.h: Removed.
* ForwardingHeaders/yarr/YarrJIT.h: Removed.
* ForwardingHeaders/yarr/YarrPattern.h: Removed.
* Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
* Modules/encryptedmedia/MediaKeyMessageEvent.h:
* Modules/encryptedmedia/MediaKeyMessageEventInit.h:
* Modules/encryptedmedia/MediaKeyStatusMap.h:
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchRequestInit.h:
* Modules/fetch/FetchResponse.h:
* Modules/indexeddb/IDBCursor.cpp:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursorWithValue.cpp:
* Modules/indexeddb/IDBDatabase.cpp:
* Modules/indexeddb/IDBIndex.cpp:
* Modules/indexeddb/IDBKey.cpp:
* Modules/indexeddb/IDBKeyRange.cpp:
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/client/TransactionOperation.cpp:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
* Modules/mediacontrols/MediaControlsHost.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediastream/RTCDataChannel.cpp:
* Modules/plugins/QuickTimePluginReplacement.mm:
* Modules/webaudio/AsyncAudioDecoder.cpp:
* Modules/webaudio/AudioBuffer.cpp:
* Modules/webaudio/AudioBuffer.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/RealtimeAnalyser.cpp:
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
* Modules/webaudio/WaveShaperProcessor.h:
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/websockets/WebSocket.cpp:
* Modules/websockets/WebSocketChannel.cpp:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
* Modules/webvr/VREyeParameters.h:
* Modules/webvr/VRFrameData.h:
* Modules/webvr/VRPose.h:
* Modules/webvr/VRStageParameters.h:
* PlatformWin.cmake:
* bindings/IDLTypes.h:
* bindings/js/BufferSource.h:
* bindings/js/CachedScriptFetcher.h:
* bindings/js/CachedScriptSourceProvider.h:
* bindings/js/CallTracerTypes.h:
* bindings/js/CommonVM.cpp:
* bindings/js/DOMGCOutputConstraint.cpp:
* bindings/js/DOMGCOutputConstraint.h:
* bindings/js/GCController.cpp:
* bindings/js/GCController.h:
* bindings/js/IDBBindingUtilities.cpp:
* bindings/js/JSCallbackData.cpp:
* bindings/js/JSCallbackData.h:
* bindings/js/JSCustomElementInterface.cpp:
* bindings/js/JSCustomElementInterface.h:
* bindings/js/JSCustomEventCustom.cpp:
* bindings/js/JSCustomXPathNSResolver.cpp:
* bindings/js/JSCustomXPathNSResolver.h:
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMBuiltinConstructorBase.cpp:
* bindings/js/JSDOMConstructorBase.cpp:
* bindings/js/JSDOMConvertBase.h:
* bindings/js/JSDOMConvertBufferSource.h:
* bindings/js/JSDOMConvertDate.cpp:
* bindings/js/JSDOMConvertInterface.h:
* bindings/js/JSDOMConvertJSON.h:
* bindings/js/JSDOMConvertNumbers.cpp:
* bindings/js/JSDOMConvertNumbers.h:
* bindings/js/JSDOMConvertObject.h:
* bindings/js/JSDOMConvertRecord.h:
* bindings/js/JSDOMConvertSequences.h:
* bindings/js/JSDOMConvertStrings.cpp:
* bindings/js/JSDOMConvertUnion.h:
* bindings/js/JSDOMExceptionHandling.cpp:
* bindings/js/JSDOMExceptionHandling.h:
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSDOMGuardedObject.h:
* bindings/js/JSDOMIterator.cpp:
* bindings/js/JSDOMIterator.h:
* bindings/js/JSDOMMapLike.cpp:
* bindings/js/JSDOMMapLike.h:
* bindings/js/JSDOMPromise.cpp:
* bindings/js/JSDOMPromise.h:
* bindings/js/JSDOMPromiseDeferred.cpp:
* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDOMWindowProxy.cpp:
* bindings/js/JSDOMWindowProxy.h:
* bindings/js/JSDOMWrapper.cpp:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSDOMWrapperCache.cpp:
* bindings/js/JSDOMWrapperCache.h:
* bindings/js/JSDynamicDowncast.h:
* bindings/js/JSErrorHandler.cpp:
* bindings/js/JSEventCustom.cpp:
* bindings/js/JSEventListener.cpp:
* bindings/js/JSEventListener.h:
* bindings/js/JSHTMLElementCustom.cpp:
* bindings/js/JSHistoryCustom.cpp:
* bindings/js/JSIDBCursorWithValueCustom.cpp:
* bindings/js/JSIDBIndexCustom.cpp:
* bindings/js/JSImageDataCustom.cpp:
* bindings/js/JSLazyEventListener.cpp:
* bindings/js/JSLocationCustom.cpp:
* bindings/js/JSMainThreadExecState.h:
* bindings/js/JSMainThreadExecStateInstrumentation.h:
* bindings/js/JSMessageChannelCustom.cpp:
* bindings/js/JSMessageEventCustom.cpp:
* bindings/js/JSNodeIteratorCustom.cpp:
* bindings/js/JSPopStateEventCustom.cpp:
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
* bindings/js/JSTreeWalkerCustom.cpp:
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/ReadableStreamDefaultController.cpp:
* bindings/js/ReadableStreamDefaultController.h:
* bindings/js/ScheduledAction.cpp:
* bindings/js/ScheduledAction.h:
* bindings/js/ScriptCachedFrameData.cpp:
* bindings/js/ScriptCachedFrameData.h:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptController.h:
* bindings/js/ScriptControllerMac.mm:
* bindings/js/ScriptModuleLoader.cpp:
* bindings/js/ScriptModuleLoader.h:
* bindings/js/ScriptSourceCode.h:
* bindings/js/ScriptState.cpp:
* bindings/js/ScriptWrappable.h:
* bindings/js/ScriptWrappableInlines.h:
* bindings/js/SerializedScriptValue.cpp:
* bindings/js/SerializedScriptValue.h:
* bindings/js/StructuredClone.cpp:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/js/WebCoreJSClientData.cpp:
* bindings/js/WebCoreTypedArrayController.cpp:
* bindings/js/WebCoreTypedArrayController.h:
* bindings/js/WorkerScriptController.cpp:
* bindings/js/WorkerScriptController.h:
* bridge/NP_jsobject.cpp:
* bridge/c/CRuntimeObject.cpp:
* bridge/c/c_class.cpp:
* bridge/c/c_instance.cpp:
* bridge/c/c_runtime.cpp:
* bridge/c/c_utility.cpp:
* bridge/c/c_utility.h:
* bridge/jsc/BridgeJSC.cpp:
* bridge/jsc/BridgeJSC.h:
* bridge/npruntime.cpp:
* bridge/objc/ObjCRuntimeObject.mm:
* bridge/objc/WebScriptObject.mm:
* bridge/objc/WebScriptObjectPrivate.h:
* bridge/objc/objc_instance.mm:
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
* bridge/objc/objc_utility.h:
* bridge/objc/objc_utility.mm:
* bridge/runtime_array.cpp:
* bridge/runtime_array.h:
* bridge/runtime_method.cpp:
* bridge/runtime_method.h:
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:
* bridge/runtime_root.cpp:
* bridge/runtime_root.h:
* crypto/SubtleCrypto.cpp:
* crypto/SubtleCrypto.h:
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
* crypto/keys/CryptoRsaKeyAlgorithm.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* css/CSSFontFaceSource.h:
* css/DOMMatrixReadOnly.cpp:
* css/DOMMatrixReadOnly.h:
* css/FontFace.cpp:
* dom/CustomElementReactionQueue.cpp:
* dom/CustomElementRegistry.cpp:
* dom/CustomEvent.cpp:
* dom/CustomEvent.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/ErrorEvent.cpp:
* dom/ErrorEvent.h:
* dom/LoadableScript.h:
* dom/MessageEvent.cpp:
* dom/MessageEvent.h:
* dom/ModuleFetchParameters.h:
* dom/PopStateEvent.cpp:
* dom/PopStateEvent.h:
* dom/PromiseRejectionEvent.cpp:
* dom/PromiseRejectionEvent.h:
* dom/RejectedPromiseTracker.cpp:
* dom/RejectedPromiseTracker.h:
* dom/ScriptExecutionContext.cpp:
* dom/ScriptExecutionContext.h:
* dom/TextEncoder.cpp:
* dom/TextEncoder.h:
* domjit/DOMJITHelpers.h:
* domjit/DOMJITIDLTypeFilter.h:
* domjit/JSDocumentDOMJIT.cpp:
* domjit/JSNodeDOMJIT.cpp:
* fileapi/BlobBuilder.cpp:
* fileapi/FileReader.cpp:
* fileapi/FileReaderLoader.cpp:
* fileapi/FileReaderSync.cpp:
* html/BaseTextInputType.cpp:
* html/EmailInputType.cpp:
* html/HTMLAllCollection.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLImageLoader.cpp:
* html/HTMLMediaElement.cpp:
* html/HTMLPlugInImageElement.cpp:
* html/ImageData.cpp:
* html/ImageData.h:
* html/MediaEncryptedEventInit.h:
* html/WebKitMediaKeyError.h:
* html/canvas/WebGLAny.h:
* html/canvas/WebGLRenderingContext.cpp:
* html/canvas/WebGLRenderingContextBase.cpp:
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGPUBuffer.cpp:
* html/canvas/WebGPURenderingContext.cpp:
* html/canvas/WebGPURenderingContext.h:
* html/track/DataCue.cpp:
* html/track/DataCue.h:
* inspector/CommandLineAPIHost.cpp:
* inspector/CommandLineAPIHost.h:
* inspector/CommandLineAPIModule.cpp:
* inspector/CommandLineAPIModule.h:
* inspector/InspectorCanvas.cpp:
* inspector/InspectorCanvas.h:
* inspector/InspectorClient.cpp:
* inspector/InspectorController.cpp:
* inspector/InspectorController.h:
* inspector/InspectorDatabaseResource.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/InspectorOverlay.cpp:
* inspector/InspectorOverlay.h:
* inspector/InspectorShaderProgram.cpp:
* inspector/InspectorShaderProgram.h:
* inspector/InspectorStyleSheet.cpp:
* inspector/InspectorStyleSheet.h:
* inspector/InspectorWebAgentBase.h:
* inspector/InstrumentingAgents.h:
* inspector/PageScriptDebugServer.cpp:
* inspector/PageScriptDebugServer.h:
* inspector/TimelineRecordFactory.cpp:
* inspector/WebInjectedScriptHost.h:
* inspector/WebInjectedScriptManager.h:
* inspector/WorkerInspectorController.cpp:
* inspector/WorkerInspectorController.h:
* inspector/WorkerScriptDebugServer.cpp:
* inspector/WorkerScriptDebugServer.h:
* inspector/WorkerToPageFrontendChannel.h:
* inspector/agents/InspectorApplicationCacheAgent.h:
* inspector/agents/InspectorCSSAgent.cpp:
* inspector/agents/InspectorCSSAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMStorageAgent.cpp:
* inspector/agents/InspectorDOMStorageAgent.h:
* inspector/agents/InspectorDatabaseAgent.cpp:
* inspector/agents/InspectorDatabaseAgent.h:
* inspector/agents/InspectorIndexedDBAgent.cpp:
* inspector/agents/InspectorIndexedDBAgent.h:
* inspector/agents/InspectorLayerTreeAgent.cpp:
* inspector/agents/InspectorLayerTreeAgent.h:
* inspector/agents/InspectorMemoryAgent.cpp:
* inspector/agents/InspectorMemoryAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorWorkerAgent.h:
* inspector/agents/WebConsoleAgent.cpp:
* inspector/agents/WebConsoleAgent.h:
* inspector/agents/WebDebuggerAgent.h:
* inspector/agents/WebHeapAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
* inspector/agents/page/PageRuntimeAgent.cpp:
* inspector/agents/page/PageRuntimeAgent.h:
* inspector/agents/worker/ServiceWorkerAgent.h:
* inspector/agents/worker/WorkerDebuggerAgent.cpp:
* inspector/agents/worker/WorkerRuntimeAgent.cpp:
* inspector/agents/worker/WorkerRuntimeAgent.h:
* loader/EmptyClients.cpp:
* page/CaptionUserPreferences.cpp:
* page/Chrome.cpp:
* page/ChromeClient.h:
* page/Crypto.cpp:
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/Frame.cpp:
* page/OriginThreadLocalCache.h:
* page/PageConsoleClient.cpp:
* page/PageConsoleClient.h:
* page/PageDebuggable.cpp:
* page/PageGroup.cpp:
* page/SettingsBase.h:
* page/UserContentController.cpp:
* page/cocoa/ResourceUsageThreadCocoa.mm:
* page/csp/ContentSecurityPolicy.cpp:
* page/ios/FrameIOS.mm:
* page/linux/ResourceUsageOverlayLinux.cpp:
* page/linux/ResourceUsageThreadLinux.cpp:
* platform/MediaSample.h:
* platform/SerializedPlatformRepresentation.h:
* platform/SharedBuffer.h:
* platform/audio/mac/CARingBuffer.h:
* platform/cocoa/SharedBufferCocoa.mm:
* platform/graphics/ImageBuffer.h:
* platform/graphics/LegacyCDMSession.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/cocoa/GPUDeviceMetal.mm:
* platform/graphics/filters/FEBlend.cpp:
* platform/graphics/filters/FEColorMatrix.cpp:
* platform/graphics/filters/FEComponentTransfer.cpp:
* platform/graphics/filters/FEComposite.cpp:
* platform/graphics/filters/FEConvolveMatrix.cpp:
* platform/graphics/filters/FEDisplacementMap.cpp:
* platform/graphics/filters/FEDropShadow.cpp:
* platform/graphics/filters/FEGaussianBlur.cpp:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMorphology.cpp:
* platform/graphics/filters/FETurbulence.cpp:
* platform/graphics/filters/FilterEffect.cpp:
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/iso/ISOBox.cpp:
* platform/graphics/iso/ISOOriginalFormatBox.cpp:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp:
* platform/graphics/iso/ISOSchemeInformationBox.cpp:
* platform/graphics/iso/ISOSchemeTypeBox.cpp:
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
* platform/graphics/iso/ISOVTTCue.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/ios/wak/WebCoreThread.mm:
* platform/mac/SerializedPlatformRepresentationMac.mm:
* platform/mac/StringUtilities.mm:
* platform/mock/mediasource/MockBox.cpp:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* svg/graphics/SVGImage.cpp:
* testing/GCObservation.cpp:
* testing/GCObservation.h:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/LegacyMockCDM.cpp:
* testing/MockCDMFactory.cpp:
* testing/js/WebCoreTestSupport.cpp:
* workers/Worker.cpp:
* workers/Worker.h:
* workers/WorkerConsoleClient.cpp:
* workers/WorkerConsoleClient.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerInspectorProxy.cpp:
* workers/WorkerMessagingProxy.cpp:
* workers/WorkerThread.h:
* workers/service/ExtendableEvent.cpp:
* workers/service/ServiceWorker.cpp:
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerClient.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
* workers/service/context/ServiceWorkerThread.cpp:
* xml/XMLHttpRequest.cpp:
2018-02-06 Said Abou-Hallawa <sabouhallawa@apple.com>
Rendering SVG images with same size as WebGL texture doesn't work correctly
https://bugs.webkit.org/show_bug.cgi?id=182367
Reviewed by Dean Jackson.
If am image buffer is created for a webgl texture and then it is reused
for another texture, it has to be cleared before drawing.
Test: webgl/webgl-texture-image-buffer-reuse.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
2018-02-06 Youenn Fablet <youenn@apple.com>
Use downcast in createLinkPreloadResourceClient
https://bugs.webkit.org/show_bug.cgi?id=182488
Reviewed by Antti Koivisto.
No observable change of behavior.
Add a new link preloader client for text track.
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):
* loader/LinkPreloadResourceClients.h:
2018-02-06 Youenn Fablet <youenn@apple.com>
imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182541
Reviewed by Chris Dumez.
Covered by test being no longer flaky.
In case of loading error when getting the response body, we were only reporting
the error if there was a callback set or a ReadableStream already created.
Otherwise, we were just stopping loading and if creating a ReadableStream, we were just returning an empty body.
FetchBodyOwner now stores a loading error.
In case a readable stream is created, it will error it if there is a loading error.
If there is not and the loading failed later on, the stream will be errored using the current code path.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone):
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
2018-02-06 Andy Estes <aestes@apple.com>
[Payment Request] show() should take an optional PaymentDetailsUpdate promise
https://bugs.webkit.org/show_bug.cgi?id=182538
<rdar://problem/36754552>
Reviewed by Tim Horton.
Taught show() to take an optional promise for a PaymentDetailsUpdate.
Added test cases to http/tests/paymentrequest/payment-request-show-method.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::detailsUpdated):
Changed to take a PaymentRequest::UpdateReason instead of a eventType string.
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):
(WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
(WebCore::ApplePayPaymentHandler::didSelectShippingContact):
(WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
Asserted that only one of the PaymentSession delegates is executing at a time.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentHandler.h:
Changed detailsUpdated to take a PaymentRequest::UpdateReason instead of a eventType string.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):
If there is a details promise, call updateWith() with UpdateReason::ShowDetailsResolved.
(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::paymentMethodChanged):
Used whenDetailsSettled() to ensure that update events do not start before the show()
details promise settles.
(WebCore::PaymentRequest::updateWith):
(WebCore::PaymentRequest::settleDetailsPromise):
Changed to use a PaymentRequest::UpdateReason instead of a eventType string.
(WebCore::PaymentRequest::whenDetailsSettled):
If there is a details promise, wait for it to settle before executing the callback.
* Modules/paymentrequest/PaymentRequest.h:
Defined enum class UpdateReason.
* Modules/paymentrequest/PaymentRequest.idl:
Updated show() to take an optional Promise<PaymentDetailsUpdate>.
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::updateWith):
Map the event type to a PaymentRequest::UpdateReason.
2018-02-06 Dean Jackson <dino@apple.com>
REGRESSION: WebGL no longer producing a transparent canvas on iOS
https://bugs.webkit.org/show_bug.cgi?id=182550
<rdar://problem/37234491>
Reviewed by Eric Carlson.
Due to some weirdness GL_RGBA8 is sometimes different between iOS and
other platforms. Only tell the WebGLLayer that it is opaque when it really
is not transparent.
Covered by existing test: fast/canvas/webgl/context-attributes-alpha
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Look at the context
attributes to decide if we should use an opaque layer.
* platform/graphics/cocoa/WebGLLayer.mm: Ditto.
(-[WebGLLayer initWithGraphicsContext3D:]):
2018-02-06 Andy Estes <aestes@apple.com>
[WebIDL] Support optional Promise arguments
https://bugs.webkit.org/show_bug.cgi?id=182399
<rdar://problem/36754552>
Reviewed by Sam Weinig and Chris Dumez.
Previously, declaring a Promise argument as optional would result in a native type of
std::optional<RefPtr<DOMPromise>>. This is wasteful, since RefPtr can represent an optional
argument by storing nullptr. Further, PassArgumentExpression() assumed Promises were never
optional and tried to pass the argument as a Ref by calling RefPtr::releaseNonNull().
This patch removes the std::optional wrapper around optional Promises and simply passes the
promise as a RefPtr to native code.
* bindings/scripts/CodeGeneratorJS.pm:
(PassArgumentExpression):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise):
* bindings/scripts/test/TestObj.idl:
2018-02-06 Youenn Fablet <youenn@apple.com>
HasServiceWorkerRegistration bit should be sent when creating a new page
https://bugs.webkit.org/show_bug.cgi?id=182410
Reviewed by Chris Dumez.
Covered by new API test.
Changed the default value of service workers being registered to false.
Every page created in the process will be responsible to change the value to true,
at which time the value will be kept to true for the lifetime of the process.
* workers/service/ServiceWorkerProvider.h:
2018-02-06 Ross Kirsling <ross.kirsling@sony.com>
Add missing #if ENABLE(VIDEO) after r228092.
https://bugs.webkit.org/show_bug.cgi?id=182539
Reviewed by Michael Catanzaro.
* html/ImageBitmap.cpp:
2018-02-06 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Test at media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html fails
https://bugs.webkit.org/show_bug.cgi?id=182425
Reviewed by Dean Jackson.
This test failed because the controls bar would not hit test at the moment we synthesized a mousemove over the controls bar as the first step towards
synthesizing a click on the controls bar to dismiss the tracks panel. Indeed, it would have "pointer-events" set to "none" until the tracks panel was
dismissed, which would only happen after the click event had been propagated. All we need to do is to ensure that none of the controls within the controls
bar get activated as a result of clicking over them when the tracks panel is visible, so we instead set "pointer-events" to "none" on all children of a
controls bar rather than the controls bar itself, which can thus still hit test.
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls.shows-tracks-panel > .controls-bar > *,):
(.media-controls.shows-tracks-panel > .controls-bar,): Deleted.
2018-02-06 Chris Dumez <cdumez@apple.com>
Service workers registrations are saved to disk before the install / activation succeeds
https://bugs.webkit.org/show_bug.cgi?id=182535
<rdar://problem/36591485>
Reviewed by Youenn Fablet.
Service workers registrations are saved to disk before the install / activation succeeds.
This means if the browser exits before the install / activation succeeds, we may restore
from disk a registration with an “active” worker which may have never been installed /
activated.
To address the issue, we now delay saving the registration to disk until after the service
worker has been activated.
No new tests, restoration from disk is covered by API tests that still pass.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didFinishActivation):
(WebCore::SWServer::installContextData):
2018-02-06 Ms2ger <Ms2ger@igalia.com>
Initialize ImageBitmap::m_bitmapData in the constructor.
https://bugs.webkit.org/show_bug.cgi?id=182487
Reviewed by Sam Weinig.
This removes the span of time where an ImageBitmap object would exist
with a null m_bitmapData during its construction.
No new tests: no behavior changes.
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::create): update signature
(WebCore::ImageBitmap::createPromise): update callers
(WebCore::ImageBitmap::ImageBitmap): update signature
* html/ImageBitmap.h: update signatures
2018-02-05 Ryosuke Niwa <rniwa@webkit.org>
Release assertion in inlineVideoFrame
https://bugs.webkit.org/show_bug.cgi?id=182513
<rdar://problem/37159363>
Reviewed by Zalan Bujtas.
The bug was caused by the fact it's not always safe to invoke updateLayout even when isSafeToUpdateStyleOrLayout
on a document of a flattened frame on iOS. isSafeToUpdateStyleOrLayout returns true when the frame view is in
the frame-flattening mode to avoid hitting a release asssertion in updateLayout of the frame. However, it's still
not safe to invoke updateLayout on a parent frame in this case.
As a result, inlineVideoFrame (in Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm) invokes updateLayout
even when the top-level document is not safe to update when the video element is in a frame-flattened document.
Fixed this bug by explicitly checking that we still have a live render tree and document hasn't been stopped.
Also replaced other uses of isSafeToUpdateStyleOrLayout by more explicit checks.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore): Made the early exit condition added in r227006 more explicit.
Namely, InspectorDOMAgent::pseudoElementCreated is invoked during style recalc.
* dom/Document.cpp:
(WebCore::isSafeToUpdateStyleOrLayout): Made this local to the file.
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay): Made the early exit condition added in r227529 more explicit. Don't
update the layout when the render tree had been destroyed or the active DOM objects had been stopped.
2018-02-05 Youenn Fablet <youenn@apple.com>
Crash in imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html
https://bugs.webkit.org/show_bug.cgi?id=182422
<rdar://problem/37182665>
Reviewed by Alex Christensen.
Covered by test no longer crashing in Debug mode.
Make sure completionHandler is called on the main thread.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
2018-02-05 Filip Pizlo <fpizlo@apple.com>
Global objects should be able to use TLCs to allocate from different blocks from each other
https://bugs.webkit.org/show_bug.cgi?id=182227
Reviewed by Daniel Bates and Chris Dumez.
No new tests because no change in behavior.
Adopt JSC TLC API to put distance between objects from different security origins. WebCore has
a subclass of ThreadLocalCache that supports hash-consing based on the relevant origin data
using the existing SecurityOriginHash. It's Document's job to initiate this, but all of the
logic is in WebCore::OriginThreadLocalCache.
Workers don't opt into this. They just get the VM's default TLC all the time.
* ForwardingHeaders/heap/ThreadLocalCache.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
(WebCore::Document::threadLocalCache):
* dom/Document.h:
* page/OriginThreadLocalCache.cpp: Added.
(WebCore::threadLocalCacheMap):
(WebCore::OriginThreadLocalCache::create):
(WebCore::OriginThreadLocalCache::~OriginThreadLocalCache):
(WebCore::OriginThreadLocalCache::OriginThreadLocalCache):
* page/OriginThreadLocalCache.h: Added.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::passesFileCheck const):
(WebCore::SecurityOrigin::setEnforcesFilePathSeparation):
(WebCore::SecurityOrigin::toString const):
(WebCore::SecurityOrigin::enforceFilePathSeparation): Deleted.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::enforcesFilePathSeparation const):
2018-02-05 Per Arne Vollan <pvollan@apple.com>
[Win] Release assert failed under NetworkStateNotifier::singleton.
https://bugs.webkit.org/show_bug.cgi?id=182516
Reviewed by Brent Fulgham.
The callback NetworkStateNotifier::addressChangeCallback will always be called on a
worker thread on Windows. Since the method NetworkStateNotifier::singleton() is
called by NetworkStateNotifier::addressChangeCallback, but has to be called on the
on the main thread, the call has to be moved there.
No new tests. I have not been able to reproduce the crash.
* platform/network/win/NetworkStateNotifierWin.cpp:
(WebCore::NetworkStateNotifier::addressChangeCallback):
2018-02-05 Don Olmstead <don.olmstead@sony.com>
Abstract heap generator should include JavaScriptCore headers directly
https://bugs.webkit.org/show_bug.cgi?id=182501
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* domjit/generate-abstract-heap.rb:
2018-02-05 Wenson Hsieh <wenson_hsieh@apple.com>
[Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
https://bugs.webkit.org/show_bug.cgi?id=182472
<rdar://problem/35143057>
Reviewed by Tim Horton.
Adds a localized string for the "Done" button text in extra zoomed form controls.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlDoneButtonTitle):
* platform/LocalizedStrings.h:
2018-02-05 John Wilander <wilander@apple.com>
Build fix for r228115, simple naming issue succeeded —> success.
https://bugs.webkit.org/show_bug.cgi?id=182507
<rdar://problem/37248566>
Reviewed by Eric Carlson.
No new tests. Build fix.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
succeeded —> success
2018-02-05 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r228086.
This introduced a failure with API test
URLTest.HostIsIPAddress.
Reverted changeset:
"Add a way to check if a host is an IP address"
https://bugs.webkit.org/show_bug.cgi?id=182427
https://trac.webkit.org/changeset/228086
2018-02-05 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r228103.
This caused multiple tests to crash.
Reverted changeset:
"Use downcast in createLinkPreloadResourceClient"
https://bugs.webkit.org/show_bug.cgi?id=182488
https://trac.webkit.org/changeset/228103
2018-02-05 Eric Carlson <eric.carlson@apple.com>
[iOS] VideoFullscreenInterfaceAVKit should not ignore errors
https://bugs.webkit.org/show_bug.cgi?id=182497
<rdar://problem/36986898>
Reviewed by Jer Noble.
Always call layoutIfNeeded before calling -[AVPlayerViewController enterFullScreenAnimated:completionHandler]
or -[AVPlayerViewController exitFullScreenAnimated:completionHandler] because they both fail
if the view needs layout. Also don't ignore errors returned by those calls.
No new tests, the failure is non deterministic and I was not able to reproduce in a test.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
(VideoFullscreenInterfaceAVKit::exitFullscreen):
(VideoFullscreenInterfaceAVKit::cleanupFullscreen):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoFullscreenInterfaceAVKit::doEnterFullscreen):
(VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
2018-02-05 Daniel Bates <dabates@apple.com>
REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
https://bugs.webkit.org/show_bug.cgi?id=182491
<rdar://problem/36533447>
Reviewed by Brent Fulgham.
Exempt Nike from the XHR header restrictions in r222795.
Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Nike also depends on such functionality.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isNike):
2018-02-02 Brent Fulgham <bfulgham@apple.com>
Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
https://bugs.webkit.org/show_bug.cgi?id=182455
<rdar://problem/36626601>
Reviewed by Chris Dumez.
After this refactoring, a convenience method I added in r227860 is no longer needed.
This patch removes this dead code.
* platform/network/NetworkStorageSession.h: Export 'cookieStoragePartition' so it can
be used in WebKit.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame): Deleted unused method.
2018-02-05 Antti Koivisto <antti@apple.com>
Make ASSERT_WITH_SECURITY_IMPLICATION in CachedResourceClientWalker::next a release assert
https://bugs.webkit.org/show_bug.cgi?id=182492
Reviewed by Youenn Fablet.
* loader/cache/CachedResourceClientWalker.h:
(WebCore::CachedResourceClientWalker::next):
2018-02-05 John Wilander <wilander@apple.com>
Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
https://bugs.webkit.org/show_bug.cgi?id=181601
<rdar://problem/36475837>
Reviewed by Alex Christensen.
No new tests. Existing test updated.
http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2018-02-05 Youenn Fablet <youenn@apple.com>
Use downcast in createLinkPreloadResourceClient
https://bugs.webkit.org/show_bug.cgi?id=182488
Reviewed by Antti Koivisto.
No observable change of behavior.
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):
2018-02-05 Chris Dumez <cdumez@apple.com>
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181166
<rdar://problem/37169508>
Reviewed by Youenn Fablet.
I found out that this test was flakily timing out because our jobQueues would sometimes get stuck
when their current job's connection or service worker (when scheduled by a service worker) would
go away before the job is complete.
This patch makes our job queues operation more robust by:
1. Cancelling all jobs from a given connection when a SWServerConnection goes away
2. Cancelling all jobs from a given service worker when a service worker gets terminated
We also make sure service workers created by a job get properly terminated when a job
is canceled to avoid leaving service workers in limbo.
No new tests, unskipped existing flaky test.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
(WebCore::ServiceWorkerJobData::isolatedCopy const):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startScriptFetch):
(WebCore::SWServer::scriptContextFailedToStart):
(WebCore::SWServer::scriptContextStarted):
(WebCore::SWServer::terminatePreinstallationWorker):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::unregisterConnection):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::removeAllJobsMatching):
(WebCore::SWServerJobQueue::cancelJobsFromConnection):
(WebCore::SWServerJobQueue::cancelJobsFromServiceWorker):
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::setPreInstallationWorker):
2018-02-05 Antti Koivisto <antti@apple.com>
Crash on sfgate.com because mismatching link preload types
https://bugs.webkit.org/show_bug.cgi?id=182483
<rdar://problem/37065331>
Reviewed by Daniel Bates.
Preloading the same URL with different 'as' types causes some confusion.
Test: http/tests/preload/link-preload-type-mismatch.html
* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):
Ensure we use the actual resource type when creating the client.
(WebCore::LinkLoader::preloadIfNeeded):
Don't construct client if the types don't match. This can happen if there is an existing
preload for the same resource with different type.
2018-02-05 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Rename gutter properties to remove "grid-" prefix
https://bugs.webkit.org/show_bug.cgi?id=180290
Reviewed by Javier Fernandez.
This patch applies the resoultion of the CSS WG to unprefix
the CSS Grid Layout gutter properties:
https://github.com/w3c/csswg-drafts/issues/1696
column-gap already existed before, as it's part of Multicol.
The patch adds the new properties row-gap and gap, and keep the legacy ones
as aliases:
- grid-column-gap => column-gap
- grid-row-gap => row-gap
- grid-gap => gap
As column-gap was already animatable, this change takes advantage
to make animatable row-gap too.
Tests: imported/w3c/web-platform-tests/css/css-align/gaps/
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::availableSpaceForGutters const):
(WebCore::RenderGrid::gridGap const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::gridAutoRows const):
(WebCore::RenderStyle::columnGap const):
(WebCore::RenderStyle::rowGap const):
(WebCore::RenderStyle::setGridItemRowEnd):
(WebCore::RenderStyle::setColumnGap):
(WebCore::RenderStyle::setRowGap):
(WebCore::RenderStyle::initialRowGap):
* rendering/style/StyleGridData.cpp:
(WebCore::StyleGridData::StyleGridData):
* rendering/style/StyleGridData.h:
(WebCore::StyleGridData::operator== const):
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
(WebCore::StyleMultiColData::operator== const):
* rendering/style/StyleMultiColData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
2018-02-05 Ms2ger <Ms2ger@igalia.com>
Implement createImageBitmap(HTMLVideoElement)
https://bugs.webkit.org/show_bug.cgi?id=182388
Reviewed by Žan Doberšek.
The implementation is inspired by CanvasRenderingContext2DBase::drawImage().
Tests:
- web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
- web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
* html/ImageBitmap.cpp:
(WebCore::taintsOrigin): Add function to help with the implementation.
(WebCore::ImageBitmap::createPromise): Fill in implementation.
2018-02-05 Zan Dobersek <zdobersek@igalia.com>
Unreviewed, rolling out r228085.
Pixel data stride is imposed by OpenGL and shouldn't be
adjusted for Cairo
Reverted changeset:
"[Cairo] Correctly calculate stride in
GraphicsContext3D::paintToCanvas()"
https://bugs.webkit.org/show_bug.cgi?id=182466
https://trac.webkit.org/changeset/228085
2018-02-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] WebSockets must use system proxy settings
https://bugs.webkit.org/show_bug.cgi?id=126384
Reviewed by Michael Catanzaro.
Use soup_session_connect_async() when available to create the WebSockets connection instead of GSocketClient
directly.
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::wssSocketClientEventCallback):
(WebCore::SocketStreamHandleImpl::create):
(WebCore::SocketStreamHandleImpl::connected):
(WebCore::SocketStreamHandleImpl::connectedCallback):
(WebCore::SocketStreamHandleImpl::platformClose):
2018-02-05 Carlos Garcia Campos <cgarcia@igalia.com>
Add a way to check if a host is an IP address
https://bugs.webkit.org/show_bug.cgi?id=182427
Reviewed by Alex Christensen.
There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
platform specific implementations, falling back to current assumption if there isn't an implementation for the
platform.
* page/OriginAccessEntry.cpp:
(WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress): Fallback implementation.
* platform/URL.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().
2018-02-04 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
https://bugs.webkit.org/show_bug.cgi?id=182466
Reviewed by Michael Catanzaro.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
Use cairo_format_stride_for_width() to obtain stride that Cairo thinks
is appropriate for the given width, taking into account internal
alignment requirements.
2018-02-04 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Split TexMap functionality out of GraphicsContext3DCairo
https://bugs.webkit.org/show_bug.cgi?id=182465
Reviewed by Michael Catanzaro.
Take the Non-Cairo GraphicsContext3D functionality that's stashed in
GraphicsContext3DCairo and move it into the GraphicsContext3DTextureMapper
file.
In GraphicsContext3DCairo.cpp, only the Cairo-specific GraphicsContext3D
functionality remains, specifically ImageExtractor and paintToCanvas().
Everything else is moved into GraphicsContext3DTextureMapper.cpp. This
filename and its location under platform/graphics/texmap/ was chosen
since all the ports using this file (GTK, WPE, WinCairo) are also using
the TextureMapper module. Various #if-guards are simplified in the
moved-over code to reflect this.
GraphicsContext3DCairo.cpp now better reflects GraphicsContext3DCG.cpp,
with both implementing functionality specific to a 2D painting library,
whereas GraphicsContext3DTextureMapper.cpp reflects
GraphicsContext3DCocoa.cpp in covering functionality needed to integrate
the GraphicsContext3D output into the platform-specific composition
system.
No new tests -- no change in behavior.
* platform/TextureMapper.cmake:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::activeContexts): Deleted.
(WebCore::GraphicsContext3D::create): Deleted.
(WebCore::GraphicsContext3D::GraphicsContext3D): Deleted.
(WebCore::GraphicsContext3D::~GraphicsContext3D): Deleted.
(WebCore::GraphicsContext3D::setContextLostCallback): Deleted.
(WebCore::GraphicsContext3D::setErrorMessageCallback): Deleted.
(WebCore::GraphicsContext3D::makeContextCurrent): Deleted.
(WebCore::GraphicsContext3D::checkGPUStatus): Deleted.
(WebCore::GraphicsContext3D::platformGraphicsContext3D): Deleted.
(WebCore::GraphicsContext3D::platformTexture const): Deleted.
(WebCore::GraphicsContext3D::isGLES2Compliant const): Deleted.
(WebCore::GraphicsContext3D::platformLayer const): Deleted.
(WebCore::GraphicsContext3D::getExtensions): Deleted.
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Copied from Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp.
(WebCore::activeContexts):
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::platformTexture const):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
(WebCore::GraphicsContext3D::platformLayer const):
(WebCore::GraphicsContext3D::getExtensions):
2018-02-04 Zan Dobersek <zdobersek@igalia.com>
Simplify GraphicsContext3D::paintToCanvas()
https://bugs.webkit.org/show_bug.cgi?id=182459
Reviewed by Michael Catanzaro.
Cairo-specific paintToCanvas() method is dropped in favor of the more
common one that operates on a GraphicsContext object. The platform
context object is then retrieved inside the Cairo-speficic
paintToCanvas() implementation, and not at the call site in
GraphicsContext3D::paintRenderingResultsToCanvas().
GraphicsContext3D::paintToCanvas() is also modified so that the image
and canvas sizes are passed through IntSize objects, and not through
a width-and-height pair of integer values.
No new tests -- no change in behavior.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2018-02-03 Alexey Proskuryakov <ap@apple.com>
Tweak availability macros for CAN_DISALLOW_USER_INSTALLED_FONTS
Rubber-stamped by Maciej Stachowiak.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
2018-02-02 Daniel Bates <dabates@apple.com>
Clean up FrameLoader::receivedFirstData()
https://bugs.webkit.org/show_bug.cgi?id=182361
Reviewed by Andy Estes.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):
2018-02-02 Myles C. Maxfield <mmaxfield@apple.com>
Test fix after r227995
https://bugs.webkit.org/show_bug.cgi?id=180951
Unreviewed.
Webfonts shouldn't be run through CTFontDescriptorCreateMatchingFontDescriptor().
Also, unify macOS's and iOS's implementation of FontCache::lastResortFallbackFont().
Covered by existing tests.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForInstalledFonts):
(WebCore::addAttributesForWebFonts):
(WebCore::installedFontMandatoryAttributes):
(WebCore::FontCache::lastResortFallbackFont):
(WebCore::addAttributesForUserInstalledFonts): Deleted.
(WebCore::mandatoryAttributesForUserInstalledFonts): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::lastResortFallbackFont): Deleted.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFont): Deleted.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
2018-02-02 Basuke Suzuki <Basuke.Suzuki@sony.com>
Fix build error after r 227457 with VIDEO and WEB_AUDIO disabled
https://bugs.webkit.org/show_bug.cgi?id=182395
Reviewed by Eric Carlson
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
2018-02-02 Don Olmstead <don.olmstead@sony.com>
Remove WebCore/ForwardingHeaders directory
https://bugs.webkit.org/show_bug.cgi?id=182347
Reviewed by Alex Christensen.
Baseline tests updated.
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GenerateEnumerationImplementationContent):
(GenerateDictionaryImplementationContent):
(GenerateHeader):
(GenerateOverloadDispatcher):
(addUnscopableProperties):
(GenerateImplementation):
(GenerateOperationDefinition):
(GenerateSerializerDefinition):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* dom/make_event_factory.pl:
(generateImplementation):
2018-02-02 David Quesada <david_quesada@apple.com>
WebAppManifest scope should default to the containing directory of start_url if 'scope' is not specified
https://bugs.webkit.org/show_bug.cgi?id=182363
rdar://problem/37093498
Reviewed by Ryosuke Niwa.
If an app manifest doesn't specify a scope, we should default to the "parent directory" of
the start URL, rather than leaving the app unbounded. This is more reasonable than using the
entire internet as the app scope.
No new tests, updates to the existing tests verify the new behavior.
* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseScope):
2018-02-02 Youenn Fablet <youenn@apple.com>
Clearing all service worker registrations should wait for importing service worker registration to finish
https://bugs.webkit.org/show_bug.cgi?id=182407
<rdar://problem/37167523>
Reviewed by Chris Dumez.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clear): ensure completion handler is called on early exit case.
2018-02-02 Youenn Fablet <youenn@apple.com>
Clearing all service worker registrations should wait for importing service worker registration to finish
https://bugs.webkit.org/show_bug.cgi?id=182407
Reviewed by Chris Dumez.
Covered by existing tests and the service worker API test being no longer flaky.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registrationStoreImportComplete):
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::getOriginsWithRegistrations):
* workers/service/server/SWServer.h:
2018-02-02 Chris Dumez <cdumez@apple.com>
Clearing a registration should null out its workers before setting their state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182418
<rdar://problem/37142874>
Reviewed by Youenn Fablet.
Clearing a registration should null out its workers before setting their state to "redundant".
This seems to match Firefox and Chrome.
No new tests, rebaselined existing test.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::clear):
(WebCore::clearRegistrationWorker): Deleted.
2018-02-02 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn media/modern-media-controls/tracks-panel and media/modern-media-controls/tracks-support back on
https://bugs.webkit.org/show_bug.cgi?id=182426
Reviewed by Dean Jackson.
Ensure that the tracks panel isn't dismissed by updating the layout.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
2018-02-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r227964.
https://bugs.webkit.org/show_bug.cgi?id=182423
It broke several unit tests (Requested by KaL on #webkit).
Reverted changeset:
"[SOUP] Ensure domain is valid when converting a WebCore
Cookie to Soup"
https://bugs.webkit.org/show_bug.cgi?id=182328
https://trac.webkit.org/changeset/227964
2018-02-01 Chris Dumez <cdumez@apple.com>
When SW install fails, null out registration.installing before setting worker state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182416
<rdar://problem/37141997>
Reviewed by Youenn Fablet.
When SW install fails, null out registration.installing before setting worker state to "redundant".
This does not match the spec but this is what Firefox and Chrome do. This is also what the
web-platform-tests expect.
Test: http/tests/workers/service/install-fails.html
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::didFinishInstall):
2018-02-01 Myles C. Maxfield <mmaxfield@apple.com>
Test fix after r227848.
https://bugs.webkit.org/show_bug.cgi?id=180951
Unreviewed.
Using kCTFontNameAttribute on an in-memory font causes CTFontDescriptorCreateMatchingFontDescriptor()
to return nullptr. Luckily, we weren't using that attribute anyway.
Covered by existing tests.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::mandatoryAttributesForUserInstalledFonts):
2018-02-01 Youenn Fablet <youenn@apple.com>
Delay service worker process creation until actually needed by SWServer
https://bugs.webkit.org/show_bug.cgi?id=182301
Reviewed by Chris Dumez.
Rename SWServer::Connection::scheduleJobInServer to scheduleJob.
Add sessionID getter from an SWServer.
* workers/service/server/SWServer.h:
(WebCore::SWServer::sessionID const):
2018-02-01 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r227594) [WinCairo] NULL pointer crash in GraphicsContext::getWindowsContext
https://bugs.webkit.org/show_bug.cgi?id=182282
Reviewed by Žan Doberšek.
ImageBufferCairo has been changed to use GraphicsContextImplCairo
in r227594. But, GraphicsContext::getWindowsContext doesn't care
the case of using GraphicsContextImpl and crashes due to null
dereference of GraphicsContext::m_data.
GraphicsContext::getWindowsContext should create a HDC in that case.
Remove the argument mayCreateBitmap because it is always
true at the moment.
No new tests (Covered by the existing tests)
* platform/graphics/GraphicsContext.h:
Removed a argument mayCreateBitmap of getWindowsContext and releaseWindowsContext.
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Ditto.
* platform/graphics/win/GraphicsContextCairoWin.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Ditto.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Ditto.
* platform/graphics/win/GraphicsContextWin.cpp:
(WebCore::GraphicsContext::getWindowsContext):
Create a HDC if m_impl is null. Removed a argument mayCreateBitmap.
* platform/graphics/win/LocalWindowsContext.h:
(WebCore::LocalWindowsContext::LocalWindowsContext):
Removed m_mayCreateBitmap.
(WebCore::LocalWindowsContext::~LocalWindowsContext): Ditto.
2018-02-01 Christopher Reid <chris.reid@sony.com>
[Curl] Use SQLite database in cookie jar implementation for Curl port
https://bugs.webkit.org/show_bug.cgi?id=174942
Reviewed by Alex Christensen.
No new tests, Set-Cookie is already tested in Layout tests.
Adding an initial SQLite CookieJar implementation to the curl network layer.
WebCore will now parse and handle both HTTP and DOM cookies instead of using libcurl.
This currently supports cookie storage and retrieval.
Cookie deletion is not yet implemented.
* platform/Curl.cmake:
* platform/network/NetworkStorageSession.h: Added cookieDB storage in curl.
* platform/network/curl/CookieJarCurl.cpp: Removed the old curl cookie handling.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarCurlDatabase.cpp: Added.
* platform/network/curl/CookieJarCurlDatabase.h: Added.
* platform/network/curl/CookieJarDB.cpp: Added.
* platform/network/curl/CookieJarDB.h: Added.
* platform/network/curl/CookieUtil.cpp: Added.
* platform/network/curl/CookieUtil.h: Added.
* platform/network/curl/CurlContext.cpp: Removed the old curl cookie handling.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp: Added handlers for HTTP response cookies.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
2018-02-01 Chris Dumez <cdumez@apple.com>
Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
https://bugs.webkit.org/show_bug.cgi?id=182392
<rdar://problem/37119215>
Reviewed by Geoffrey Garen.
Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
given that getting the property from the object can throw an exception.
No new tests, rebaselined existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
2018-02-01 Ryosuke Niwa <rniwa@webkit.org>
Some test cases in accessibility/mac/selection-notification-focus-change.html fail
https://bugs.webkit.org/show_bug.cgi?id=182212
<rdar://problem/36937147>
Reviewed by Antti Koivisto and Wenson Hsieh.
The failure was caused by the async update of the selection appearance not preserving selection reveal intent.
Fixed the bug by storing the intent in a member variable and using it later.
* dom/Element.cpp:
(WebCore::Element::focus): Removed an unnecessary synchronous layout update.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior.
(WebCore::FrameSelection::respondToNodeModification): Ditto.
(WebCore::FrameSelection::setSelection): Save the selection reveal intent.
(WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent.
* editing/FrameSelection.h:
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking
nodeRectInAbsoluteCoordinates.
2018-02-01 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
https://bugs.webkit.org/show_bug.cgi?id=182306
<rdar://problem/37041440>
Reviewed by Darin Adler.
Addressing post-review comment.
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-02-01 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild()
https://bugs.webkit.org/show_bug.cgi?id=182373
<rdar://problem/37101484>
Reviewed by Antti Koivisto.
This is in preparation for moving mutation code out of takeChild.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::takeChild):
* rendering/RenderBlockFlow.h:
* rendering/RenderButton.cpp:
(WebCore::RenderButton::takeChild):
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::takeChild):
(WebCore::RenderElement::removeAndDestroyChild):
(WebCore::RenderElement::destroyLeftoverChildren):
* rendering/RenderElement.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::takeChild):
* rendering/RenderGrid.h:
* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild):
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy):
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::takeChild):
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/RenderRubyRun.h:
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
* rendering/RenderTableRow.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::takeChild):
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::takeChild):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::takeChild):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::takeChild):
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::collapseAndDestroyAnonymousSiblingRows):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
2018-02-01 Dean Jackson <dino@apple.com>
REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
https://bugs.webkit.org/show_bug.cgi?id=182394
<rdar://problem/34840816>
Reviewed by Simon Fraser.
If a scale < 1 is applied to the page, then the visual viewport will be bigger
than the layout viewport. Our hit testing code would then ignore any hits
that were outside the layout viewport.
The fix is to only apply a hit testing clip if the page is scaling up, not down.
Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.
* page/FrameView.cpp:
(WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
no longer used, and it would have probably been more confusing to have it accept
a flag to ignore the scale if it is less than 1.
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
and pass it to a helper that added the origin back. The only thing the helper was
doing for us was applying a scale factor, which we only want to do if it was
scaling up.
2018-02-01 Yusuke Suzuki <utatane.tea@gmail.com>
Structured cloning a Symbol should throw
https://bugs.webkit.org/show_bug.cgi?id=182380
Reviewed by Darin Adler.
Test: js/dom/post-message-symbol.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
Structured cloning should throw "DataCloneError" DOMException if it finds Symbol.
Remove unused `isNumber()` case. It is done in dumpImmediate.
(WebCore::CloneSerializer::serializeUndefined): Deleted.
(WebCore::CloneSerializer::serializeBoolean): Deleted.
(WebCore::CloneSerializer::serializeNumber): Deleted.
Remove unused functions.
2018-02-01 Chris Dumez <cdumez@apple.com>
We no longer need to queue service worker jobs until the connection to the service worker process has been established
https://bugs.webkit.org/show_bug.cgi?id=182375
Reviewed by Youenn Fablet.
We no longer need to queue service worker jobs until the connection to the service worker process
has been established. We initially did this to work around the fact that registrations restored
from disk would not have an active worker until the service worker process had been established.
However, this issue has been fixed in r227696.
This is basically a revert of r227220, which is no longer needed after r227696.
No new tests, initial fix was covered by an API test that still passes.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:
2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Shift + mouse scroll should scroll horizontally
https://bugs.webkit.org/show_bug.cgi?id=181629
Reviewed by Michael Catanzaro.
We currently turn vertical scroll into horizontal when scrolling over the horizontal scrollbar. When Shift key is
pressed, we still want to scroll in the scrollbar direction when scrolling over a scrollbar, so we need to swap
directions in both scrollbars depending on whther the Shift key is pressed or not.
* page/EventHandler.cpp:
(WebCore::EventHandler::shouldSwapScrollDirection const): Renamed.
(WebCore::EventHandler::handleWheelEvent): Use the new name.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
* page/EventHandler.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copySwappingDirection const): Swap the direction of the event.
(WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks const): Deleted.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::shouldSwapScrollDirection const): Take into account whether the Shift key is present.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Problem with Washington Post images
https://bugs.webkit.org/show_bug.cgi?id=181421
Reviewed by Carlos Alberto Lopez Perez.
This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
washingtonpost.com.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
https://bugs.webkit.org/show_bug.cgi?id=182328
Reviewed by Michael Catanzaro.
soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but
soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore
Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to
prepend the '.' if missing.
Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
* platform/network/soup/CookieSoup.cpp:
(WebCore::Cookie::toSoupCookie const):
2018-02-01 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182374
<rdar://problem/37102005>
Reviewed by Antti Koivisto.
It's only called from RenderTreeBuilder.
No change in functionality.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
* rendering/RenderTableRow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
* rendering/updating/RenderTreeBuilderTable.h:
2018-02-01 Chris Dumez <cdumez@apple.com>
Queue a microtask when a waitUntil() promise is settled
https://bugs.webkit.org/show_bug.cgi?id=182372
<rdar://problem/37101019>
Reviewed by Mark Lam.
Queue a microtask when a waitUntil() promise is settled, as per:
- https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil (step 5)
Otherwise, we decrement m_pendingPromiseCount too quickly and it may cause
following calls to waitUntil() to throw when they shouldn't.
No new tests, rebaselined existing test.
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::addExtendLifetimePromise):
2018-02-01 Antti Koivisto <antti@apple.com>
Invalidate style for sibling combinators accurately on class change
https://bugs.webkit.org/show_bug.cgi?id=182336
Reviewed by Zalan Bujtas.
Use Style::Invalidator to invalidate only those elements that may be affected by a class
change for sibling combinators and nth pseudo classes.
* css/RuleFeature.cpp:
Add new AllSiblings MatchElement to use for nth pseudo classes with subselectors.
(WebCore::isSiblingOrSubject):
Add a helper.
(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
Compute and propage MatchElement::AllSiblings.
* css/RuleFeature.h:
* dom/Node.cpp:
(WebCore::Node::updateAncestorsForStyleRecalc):
Don't need to test for childrenAffectedByPropertyBasedBackwardPositionalRules anymore (an oddly named bit for nth pseudo classes).
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
Invalidate only the potentially affected elements.
The old code would just unconditionally invalidate the current element. This would propagate to descedants of siblings via
affectedByPreviousSibling bits. That mechanism can be removed when everything has been switched to accurate invalidation.
2018-01-31 Simon Fraser <simon.fraser@apple.com>
Use different debug red colors for different contexts
https://bugs.webkit.org/show_bug.cgi?id=182362
Reviewed by Tim Horton.
Pure red is used elsehwere in the system as a debug color indicator, so use different
shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
so they are identifiable.
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
2018-01-31 Don Olmstead <don.olmstead@sony.com>
[CMake] Make JavaScriptCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182303
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
2018-01-31 Per Arne Vollan <pvollan@apple.com>
Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181204
<rdar://problem/36256274>
Reviewed by Ryosuke Niwa.
When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
the frame will be detached when removed from its previous position in the DOM tree. When being
detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
However, this method will return early when executed in a beforeunload handler, since navigation
is not allowed then. The end result is a detached frame which will continue to load, and hitting
asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
possible to stop a frame load, even when executing a beforeunload handler.
No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable): Fix a failing API test by allowing scripts to be executed
under the PageCache::prune method.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isStopLoadingAllowed const):
(WebCore::FrameLoader::stopAllLoaders):
* loader/FrameLoader.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::~SVGImage): Disable scripts disallowed assertions in this scope, since it is
safe in this context.
2018-01-31 Javier Fernandez <jfernandez@igalia.com>
inline-block baseline not computed correctly for vertical-lr
https://bugs.webkit.org/show_bug.cgi?id=170176
Reviewed by Manuel Rego Casasnovas.
When computing the baseline position of inline-block elements we use the
InlineFlow logicalTop and the FontMetrics ascent. The issue comes from
the fact that these units are incompatible. The logicalTop of a
vertical-lr element is offset to the left edge, while the ascent is the
distance from the right edge.
We need to either use logical value for the FontMetrics ascent so we can
compute the correctly the baselines of vertical-lr elements, or just using
the logicalBottom for these cases.
The approach based on a logicalAscent API for FontMetrics would require
a lot of work because inline-block logic assumes everything is vertical-rl
and at some point, flips the elements along the block-axis in case of
vertical-lr mode.
While it'd be desirable to get rid of this flipping logic, this patch tries
first the simpler approach of using logicalBottom, which aligns with the
currently implemented logic.
Tests: fast/inline-block/baseline-vertical-01.html
fast/inline-block/baseline-vertical-02.html
fast/inline-block/baseline-vertical-03.html
fast/inline-block/baseline-vertical-04.html
fast/inline-block/baseline-vertical-05.html
fast/inline-block/baseline-vertical-06.html
fast/inline-block/baseline-vertical-07.html
fast/inline-block/baseline-vertical-08.html
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
2018-01-31 Said Abou-Hallawa <sabouhallawa@apple.com>
BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
https://bugs.webkit.org/show_bug.cgi?id=182277
Reviewed by Simon Fraser.
BitmapImage::drawPattern() needs to destroy the incomplete decoded frame
before trying to draw it as a pattern.
Test: http/tests/images/draw-pattern-slow-load-large-image.html
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::updateBufferInternal): We need to disable CachedImage
data buffering for testing. This simulates slow network where intervals
between data chunks can last for seconds.
* loader/cache/CachedImage.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern): Destroy the incomplete decoded frame
before drawing this frame as a pattern. We do not destroy incomplete decoded
frame once new data is received because it may be drawn by async image
drawing while waiting for the newer frame to finish decoding.
* testing/Internals.cpp:
(WebCore::Internals::setForceUpdateImageDataEnabledForTesting):
* testing/Internals.h:
* testing/Internals.idl:
2018-01-31 Ryosuke Niwa <rniwa@webkit.org>
Add a release assertion to ensure timers are deleted in the right thread
https://bugs.webkit.org/show_bug.cgi?id=182351
Reviewed by David Kilzer.
Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
when WebThread is being used.
* platform/Timer.cpp:
(WebCore::TimerBase::~TimerBase): Added the assertion.
* platform/Timer.h:
(WebCore::TimerBase::m_thread): Always store the current thread in a timer.
2018-01-31 Youenn Fablet <youenn@apple.com>
Change SWServer::claim to set the iterator value as soon as possible
https://bugs.webkit.org/show_bug.cgi?id=182337
Reviewed by Chris Dumez.
No change of behavior, this is a "let's go safe way" fix.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::claim):
2018-01-31 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder.
https://bugs.webkit.org/show_bug.cgi?id=182348
<rdar://problem/37082837>
Reviewed by Antti Koivisto.
All the callsites are in the RenderTreeUpdater by now.
No change in functionality.
* rendering/RenderObject.cpp:
(WebCore::isAnonymousAndSafeToDelete): Deleted.
(WebCore::findDestroyRootIncludingAnonymous): Deleted.
(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
* rendering/RenderObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::isAnonymousAndSafeToDelete):
(WebCore::findDestroyRootIncludingAnonymous):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):
2018-01-31 Ryosuke Niwa <rniwa@webkit.org>
Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk
https://bugs.webkit.org/show_bug.cgi?id=182319
<rdar://problem/36904312>
Reviewed by Chris Dumez.
The crash was caused by a wrong release assertion. Handle author scripts shrinking the resource timing buffer
while resourcetimingbufferfull event is being dispatched.
Also fixed a bug that a superflous resourcetimingbufferfull event will be fired when new resource timing entries
are queued while resourcetimingbufferfull event is being dispatched.
Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html
http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html
* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired):
2018-01-31 Youenn Fablet <youenn@apple.com>
com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration
https://bugs.webkit.org/show_bug.cgi?id=182316
<rdar://problem/37025976>
Reviewed by Chris Dumez.
SWServer.m_clientToControllingWorker and SWServerRegistration.m_clientsUsingRegistration might currently get out of sync.
This is a defensive fix to ensure storage process will not crash in Release.
We keep the ASSERT as this probably means there is an abnormal situation that other patches might fix.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::removeClientUsingRegistration):
2018-01-31 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
https://bugs.webkit.org/show_bug.cgi?id=182297
Reviewed by Jon Lee and Eric Carlson.
We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
cases where the play/pause button would never actually become visible because we would first set it as one of
the buttons in the left container in the bottom controls bar before we would identify that we should show the
prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
though it wasn't visible.
Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
the "x" and "visible" properties which we set while performing layout.
This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
other modern-media-controls tests that could have been affected by this unexpected behavior.
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.willRemoveChild):
(ButtonsContainer.prototype.didChangeChildren):
(ButtonsContainer.prototype.layout):
(ButtonsContainer.prototype.get buttons): Deleted.
(ButtonsContainer.prototype.set buttons): Deleted.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._updateBottomControlsBarLabel):
(InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
(InlineMediaControls):
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):
(LayoutNode.prototype.addChild):
(LayoutNode.prototype.removeChild):
(LayoutNode.prototype.willRemoveChild):
(LayoutNode.prototype.didChangeChildren):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
data-auto-hide-delay on a <video> element.
2018-01-31 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
https://bugs.webkit.org/show_bug.cgi?id=182315
<rdar://problem/37048160>
Reviewed by Antti Koivisto.
resolveMovedChild() is only called from RenderTreeBuilder.
No change in functionality.
* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::resolveMovedChild const): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
* rendering/updating/RenderTreeBuilderMultiColumn.h:
2018-01-31 Philippe Normand <pnormand@igalia.com>
[GStreamer] Silent WebAudio buffers support
https://bugs.webkit.org/show_bug.cgi?id=143869
Reviewed by Carlos Garcia Campos.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
enables downstream elements to optimize the buffer processing.
2018-01-31 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
https://bugs.webkit.org/show_bug.cgi?id=182324
Reviewed by Žan Doberšek.
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::tryNextSupportedConfiguration): Fix
candidateCofiguration typo.
2018-01-30 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
https://bugs.webkit.org/show_bug.cgi?id=182093
Reviewed by Alex Christensen.
WebKit draws texts doubly by shifting 1px for fonts without bold
fonts but bold font is desired. This synthetic bold method draws
fonts with embedded bitmap fonts look like double strike in HiDPI.
No new tests (Covered by the existing tests).
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::createGDIFont): Overwrite lfWeight if the desired weight
is bold and matched font weight is't bold and in WinCairo port.
Fix wrong indentation.
2018-01-30 Youenn Fablet <youenn@apple.com> and Oleksandr Skachkov <gskachkov@gmail.com>
FetchResponse should support ConsumeData callback on chunk data is received
https://bugs.webkit.org/show_bug.cgi?id=181600
<rdar://problem/36932547>
Reviewed by Alex Christensen.
Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
Apply same read-by-chunk strategy for body coming from network as for body coming from ReadableStream.
Refactor to have one consumeBodyReceivedByChunk method for both cases.
This allows streaming data from a service worker to WebProcess as would be done by NetworkProcess.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::addAll):
(WebCore::DOMCache::put):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveData):
(WebCore::FetchResponse::BodyLoader::consumeDataByChunk):
(WebCore::FetchResponse::consumeBody):
(WebCore::FetchResponse::consumeBodyReceivedByChunk):
* Modules/fetch/FetchResponse.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
2018-01-30 Don Olmstead <don.olmstead@sony.com>
JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
https://bugs.webkit.org/show_bug.cgi?id=182312
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
* config.h:
2018-01-30 Chris Nardi <cnardi@chromium.org>
Use double-quotes when serializing font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=182201
According to the CSSOM spec, all strings should be serialized with double-quotes. The feature
tag value was previously serialized with single-quotes; change this to double-quotes to match
the spec and non-WebKit browsers.
Reviewed by Myles C. Maxfield.
Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
and fast/text/font-face-javascript.html.
* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::customCSSText const):
2018-01-30 Brent Fulgham <bfulgham@apple.com>
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>
Reviewed by Chris Dumez.
Part 2: Add telemetry for the Storage Access API case
Adds a new convenience method to identify origin/page/frame combinations that
have been granted access to the Storage Access API. This is used for debug
logging in the NetworkProcess. It is not used in production builds.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Added.
2018-01-30 Ryosuke Niwa <rniwa@webkit.org>
Release assert in updateLayout() via AXObjectCache::childrenChanged
https://bugs.webkit.org/show_bug.cgi?id=182279
<rdar://problem/36994456>
Reviewed by Antti Koivisto.
Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it
would require a large architectural refactoring of the accessibility code.
Test: accessibility/accessibility-object-update-during-style-resolution-crash.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here.
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable.
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable.
2018-01-30 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
https://bugs.webkit.org/show_bug.cgi?id=182306
<rdar://problem/37041440>
Reviewed by Antti Koivisto.
With all the ruby mutation code moving, only RenderTreeBuilder calls RenderRubyRun::rubyBaseSafe.
No change in functionality.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyText const):
(WebCore::RenderRubyRun::rubyBase const):
(WebCore::RenderRubyRun::firstLineBlock const):
(WebCore::RenderRubyRun::takeChild):
(WebCore::RenderRubyRun::rubyBaseSafe): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-01-30 Fujii Hironori <Hironori.Fujii@sony.com>
Unified sources for FEMorphology.cpp seems to break the windows build.
https://bugs.webkit.org/show_bug.cgi?id=178847
Reviewed by Yusuke Suzuki.
Fix a compilation error.
platform/graphics/filters/SpotLightSource.cpp(45): error C2027: use of undefined type 'WebCore::FilterEffect'
No new tests (No behavior change)
* Sources.txt: Removed @no-unify for FEMorphology.cpp.
* platform/graphics/filters/SpotLightSource.cpp: Added #include "FilterEffect.h".
2018-01-30 Myles C. Maxfield <mmaxfield@apple.com>
Test fix after r227776
https://bugs.webkit.org/show_bug.cgi?id=180951
Unreviewed.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::mandatoryAttributesForUserInstalledFonts):
2018-01-30 Dean Jackson <dino@apple.com>
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>
Removing a misleading comment based on Zalan Bujtas's feedback.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
2018-01-30 Dean Jackson <dino@apple.com>
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>
Reviewed by Simon Fraser.
Mostly speculative fix for the case where a scrollTo moves an
animated SVG image into view, causing its animation to restart during
a paint operation. This was causing a release ASSERT, so we now defer
the resumption of the animation into a timer.
Test: svg/animated-svgImage-scroll.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
animation if it is an SVGImage.
* svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::startAnimationTimerFired):
(WebCore::SVGImage::enqueueStartAnimation):
(WebCore::SVGImage::stopAnimation):
* svg/graphics/SVGImage.h:
2018-01-30 Chris Dumez <cdumez@apple.com>
Service worker registration soft updates happen too frequently
https://bugs.webkit.org/show_bug.cgi?id=182296
<rdar://problem/37031862>
Reviewed by Youenn Fablet.
Move code that updates the registration's last update check time from after
the script bytecheck to before, as per:
- https://w3c.github.io/ServiceWorker/#update (step 7.19)
This way, the last update check time gets updated even if the newly fetched
script is identical to the previous one, which is the common case.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
2018-01-30 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182265
<rdar://problem/37004459>
Reviewed by Antti Koivisto.
Move the mutation code that wraps/unwraps a child element when its flow state changes
from(to) in-flow to(from) floating/out-of-flow.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::childBecameNonInline): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::childBecameNonInline): Deleted.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::handleDynamicFloatPositionChange): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::childBecameNonInline): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::splitFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::childBecameNonInline):
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
* rendering/updating/RenderTreeBuilderInline.h:
2018-01-30 Brent Fulgham <bfulgham@apple.com>
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>
Reviewed by Chris Dumez.
Partial roll-out of r227755.
The original patch assumed the WebContent process kept track of user interaction. This is
only tracked in the UIProcess, so we can get rid of some of the logging code adding in
r227755.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Deleted.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Deleted.
* loader/ResourceLoadObserver.h:
2018-01-30 Chris Dumez <cdumez@apple.com>
Make sure we never create a WebSWClientConnection with an invalid sessionID
https://bugs.webkit.org/show_bug.cgi?id=182276
<rdar://problem/36582633>
Reviewed by Alex Christensen.
Make sure we never create a WebSWClientConnection with an invalid sessionID as this
could corrupt our hash tables.
* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::ensureSWClientConnection):
2018-01-30 Antti Koivisto <antti@apple.com>
Avoid traversing too much when doing class change invalidation
https://bugs.webkit.org/show_bug.cgi?id=181604
Reviewed by Zalan Bujtas.
We are now collecting information about which part of the tree a change in class can potentially affect.
Use the information to traverse only the required elements in Style::Invalidator.
The same mechanism can be later used for attribute and id change invalidation.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::classInvalidationRuleSets const):
(WebCore::DocumentRuleSets::subjectClassRules const): Deleted.
(WebCore::DocumentRuleSets::ancestorClassRules const): Deleted.
Remove separate subject and ancestor invalidation RuleSets. Instead collect all invalidation rulesets
to a vector along with their MatchElements.
* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
(WebCore::RuleFeatureSet::collectFeatures):
Similarly collect all class invalidation RuleFeatures to a general HashMap along with the MatchElement.
(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
* css/RuleFeature.h:
(WebCore::RuleFeature::RuleFeature):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
Find out InvalidationRuleSets to use.
(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
Pass them to Style::Invalidator.
* style/ClassChangeInvalidation.h:
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForTree):
(WebCore::Style::Invalidator::invalidateStyleForDescendants):
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
Traverse only the part of the tree needed by the given MatchElement.
* style/StyleInvalidator.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::classNamesAffectedByRules const):
2018-01-30 Javier Fernandez <jfernandez@igalia.com>
[css-align] The 'baseline' value must be invalid for the 'justify-content' property
https://bugs.webkit.org/show_bug.cgi?id=181794
Reviewed by Antti Koivisto.
The CSS WG has resolved that it doesn't make sense to define Baseline
Content-Alignment in the inline/main axis.
https://github.com/w3c/csswg-drafts/issues/1184
The spec has been updated so that <baseline-postion> is not valid for
the 'justify-content' property's syntax. This CL updates our parsing
logic to match the new spec, including the parsing logic of the
place-content shorthand.
Additionally, this CL updates the computed value of the
<baseline-position> values to match other browsers.
We don't implement support for <baseline-position> values in the
Content Distribution properties (align-content and justify-content),
so I don't expect this change to break content of sites using the CSS
Box Alignment feature.
No new tests, just adapt the Web Platform Tests we already have to the new CSS syntax.
* css/parser/CSSPropertyParser.cpp:
(WebCore::getBaselineKeyword):
(WebCore::consumeBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::consumeSimplifiedItemPosition):
2018-01-30 Basuke Suzuki <Basuke.Suzuki@sony.com>
[WinCairo] Fix forwarding header conflict of WebKit on WinCairo
https://bugs.webkit.org/show_bug.cgi?id=177202
Reviewed by Alex Christensen.
* PlatformWin.cmake:
2018-01-30 Myles C. Maxfield <mmaxfield@apple.com>
A disallowed user-installed font may be used if its PostScript name is specified
https://bugs.webkit.org/show_bug.cgi?id=180951
Reviewed by Brent Fulgham.
This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
fonts which WebKit creates. It also adds this attribute to web fonts, so that font
fallback will happen according to our rules about user-installed fonts. It also marks
these font attributes as "mandatory" so CoreText will be guaranteed to follow the
policy.
Test: fast/text/user-installed-fonts/disable.html
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForUserInstalledFonts):
(WebCore::mandatoryAttributesForUserInstalledFonts):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
2018-01-29 Youenn Fablet <youenn@apple.com>
Cache API should make sure to resolve caches.open promises in the same order as called
https://bugs.webkit.org/show_bug.cgi?id=182193
<rdar://problem/36930363>
Reviewed by Chris Dumez.
Covered by LayoutTests/http/wpt/cache-storage/cache-open-delete-in-parallel.https.html.
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::doRemove): Removed optimization consisting in removing the cache from DOMCacheStorage object synchronously.
This optimization prevents going to the network process to try deleting the cache.
2018-01-29 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Add a compile-time feature flag
https://bugs.webkit.org/show_bug.cgi?id=182211
<rdar://problem/36936365>
Reviewed by Brent Fulgham.
Add a compile-time feature flag for WebAuthN as most of the functionality is platform
dependent.
No tests.
* Configurations/FeatureDefines.xcconfig:
* Modules/credentialmanagement/BasicCredential.cpp:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/Authenticator.cpp:
* Modules/webauthn/Authenticator.h:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
* Modules/webauthn/AuthenticatorAssertionResponse.h:
* Modules/webauthn/AuthenticatorAssertionResponse.idl:
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
* Modules/webauthn/AuthenticatorAttestationResponse.h:
* Modules/webauthn/AuthenticatorAttestationResponse.idl:
* Modules/webauthn/AuthenticatorResponse.cpp:
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/PublicKeyCredentialType.h:
* Modules/webauthn/PublicKeyCredentialType.idl:
* bindings/js/JSAuthenticatorResponseCustom.cpp:
* bindings/js/JSBasicCredentialCustom.cpp:
2018-01-29 John Wilander <wilander@apple.com>
Resource Load Statistics: Introduce debug mode as experimental feature
https://bugs.webkit.org/show_bug.cgi?id=182199
<rdar://problem/36930364>
Reviewed by Alex Christensen.
No new tests. This adds an experimental feature.
The only changes to default behavior are:
- Increased resolution on timestamps which is needed to be able to set shorter
timeouts in debug mode.
- Only update partitioning and blocking table when needed. This is an optimization
which pays off in less XPC with shorter timeouts.
* loader/ResourceLoadObserver.cpp:
(WebCore::reduceTimeResolution):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::reduceToHourlyTimeResolution): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode):
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const):
* page/Settings.yaml:
2018-01-29 Oleksandr Skachkov <gskachkov@gmail.com>
FetchResponse should support ConsumeData callback on chunk data is received: handling ReadableStream bodies
https://bugs.webkit.org/show_bug.cgi?id=182008
Reviewed by Youenn Fablet.
Modify FetchResponse to support ConsumeData callback with
handling of ReadableStream by chunks
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::consumeBodyFromReadableStream):
* Modules/fetch/FetchResponse.h:
* Modules/streams/ReadableStreamChunk.h: Added.
* Modules/streams/ReadableStreamSink.cpp:
(WebCore::ReadableStreamToSharedBufferSink::enqueue):
(WebCore::ReadableStreamToSharedBufferSink::close):
* Modules/streams/ReadableStreamSink.h:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
2018-01-29 Andy Estes <aestes@apple.com>
[iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
https://bugs.webkit.org/show_bug.cgi?id=182252
<rdar://problem/21555881>
Reviewed by Tim Horton.
Test: http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https.html
* dom/Document.h:
(WebCore::Document::handlingTouchEvent const):
* page/EventHandler.h:
(WebCore::EventHandler::touchEventTargetSubframe const):
(WebCore::EventHandler::touches const):
Exposed some information needed by WebPage::updatePotentialTapSecurityOrigin().
* page/Frame.h:
* page/ios/FrameIOS.mm:
(WebCore::Frame::betterApproximateNode):
(WebCore::Frame::qualifyingNodeAtViewportLocation):
Changed NodeQualifier from a function pointer to a WTF::Function.
(WebCore::Frame::nodeRespondingToClickEvents):
Turned ancestorRespondingToClickEvents() into a lambda that captures originRestriction. In
the lambda, if there is an origin restriction, return nullptr if the hit test result's inner
Node is not in the restricted origin.
(WebCore::Frame::nodeRespondingToScrollWheelEvents):
Turned ancestorRespondingToScrollWheelEvents() into a lambda.
(WebCore::ancestorRespondingToScrollWheelEvents):
Moved to lambda in nodeRespondingToScrollWheelEvents().
(WebCore::ancestorRespondingToClickEvents):
Moved to lambda in nodeRespondingToClickEvents().
2018-01-29 Emilio Cobos Álvarez <emilio@crisal.io>
Trivially cleanup std::optional usage in RenderBlockFlow.
https://bugs.webkit.org/show_bug.cgi?id=182142
Reviewed by Antti Koivisto.
No new tests, no behavior change.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
2018-01-29 Brent Fulgham <bfulgham@apple.com>
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>
Reviewed by Chris Dumez.
Part 1: Add telemetry for the user interaction case
This patch adds telemetry to track how frequently third-party cookies are
used in a first party context due to user interaction. This will help
understand cases where the new Storage Access API can help, and to help
us understand if we have considered relevant use cases in its design.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Let the observer
know the first party interaction duration.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Added.
(WebCore::ResourceLoadObserver::logFrameNavigation): Note when a third party
resource is accessed as a first party due to user interaction.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const): Handle new fields.
(WebCore::ResourceLoadStatistics::decode): Ditto.
* loader/ResourceLoadStatistics.h:
2018-01-29 Antti Koivisto <antti@apple.com>
CalcExpressionBlendLength::evaluate hits stack limit
https://bugs.webkit.org/show_bug.cgi?id=182243
Reviewed by Zalan Bujtas.
Speculative fix to prevent nesting of CalcExpressionBlendLength.
No test, don't know how to make one.
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
CalcExpressionBlendLength is only used in Length values of animated style. Normally such styles are not used
as input for further blending but there are some paths where this could in principle happen. Repeated
application (for each animation frame) could construct CalcExpressionBlendLength expression that blows
the stack when evaluated.
Speculatively fix by flattening any nesting.
* platform/CalculationValue.h:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength): Deleted.
2018-01-29 Chris Dumez <cdumez@apple.com>
Drop unnecessary "ServiceWorker Task Thread" in SWServer
https://bugs.webkit.org/show_bug.cgi?id=182253
Reviewed by Youenn Fablet.
Drop unnecessary "ServiceWorker Task Thread" in SWServer. We're spinning a thread for
each SWServer that is never used.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::taskThreadEntryPoint): Deleted.
(WebCore::SWServer::postTask): Deleted.
(WebCore::SWServer::postTaskReply): Deleted.
(WebCore::SWServer::handleTaskRepliesOnMainThread): Deleted.
* workers/service/server/SWServer.h:
2018-01-29 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r227731.
This caused and assertion failure in API tests.
Reverted changeset:
"Layout Test fast/events/beforeunload-dom-manipulation-
crash.html is crashing"
https://bugs.webkit.org/show_bug.cgi?id=181204
https://trac.webkit.org/changeset/227731
2018-01-29 Brady Eidson <beidson@apple.com>
Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
https://bugs.webkit.org/show_bug.cgi?id=182229
Reviewed by Chris Dumez.
Covered by existing LayoutTests and a new API test.
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::checkRemotePortForActivity): Don't use the global singleton
provider. Instead use the provider that belongs to the owning registry.
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl): Pass a reference
to *this to the Registry.
* dom/messageports/MessagePortChannelProviderImpl.h:
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry): Keep a Provider member so
MessagePortChannels can get to it instead of relying on the global singleton provider.
* dom/messageports/MessagePortChannelRegistry.h:
(WebCore::MessagePortChannelRegistry::provider):
2018-01-29 Per Arne Vollan <pvollan@apple.com>
Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181204
<rdar://problem/36256274>
Reviewed by Ryosuke Niwa.
When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
the frame will be detached when removed from its previous position in the DOM tree. When being
detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
However, this method will return early when executed in a beforeunload handler, since navigation
is not allowed then. The end result is a detached frame which will continue to load, and hitting
asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
possible to stop a frame load, even when executing a beforeunload handler.
No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isStopLoadingAllowed const):
(WebCore::FrameLoader::stopAllLoaders):
* loader/FrameLoader.h:
2018-01-29 Miguel Gomez <magomez@igalia.com>
[CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
https://bugs.webkit.org/show_bug.cgi?id=181080
Reviewed by Žan Doberšek.
Check whether the applied clipping area is empty before drawing the children of a TextureMapperLayer. If
the area is empty no children will be drawn, so we can avoid drawing them.
No new tests -- no change in behavior.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildren):
2018-01-29 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Add GraphicsContextImplCairo::createFactory() helpers
https://bugs.webkit.org/show_bug.cgi?id=182238
Reviewed by Carlos Garcia Campos.
Instead of duplicating lambdas that return a newly-created
GraphicsContextImplCairo object, provide static createFactory() helpers
on that class that produce GraphicsContextImplFactory wrappers which are
then invoked in the GraphicsContext constructor. The static functions
accept either the PlatformContextCairo reference or the cairo_t pointer,
invoking the proper GraphicsContextImplCairo constructor in the returned
lambda wrapper.
No new tests -- no change in functionality.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::createFactory):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::strokeBoundingRect const):
(WebCore::Path::strokeContains const):
* platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::PaintingContextCairo):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
2018-01-29 Zan Dobersek <zdobersek@igalia.com>
Construct GraphicsContext with NonPaintingReasons::NoReason in FrameView::adjustPageHeightDeprecated()
https://bugs.webkit.org/show_bug.cgi?id=182235
Reviewed by Carlos Garcia Campos.
Pass the NonPaintingReasons::NoReason value to the GraphicsContext
constructor in FrameView::adjustPageHeightDeprecated(). This has the
same effect as when passing a null PlatformGraphicsContext to the
constructor, which effectively disables any painting through that
GraphicsContext, but doesn't have a platform-specific connotation.
No new tests -- no change in functionality.
* page/FrameView.cpp:
(WebCore::FrameView::adjustPageHeightDeprecated):
2018-01-29 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Remove the GraphicsContext(cairo_t*) constructor
https://bugs.webkit.org/show_bug.cgi?id=182234
Reviewed by Carlos Garcia Campos.
Instead of using the GraphicsContext(cairo_t*) constructor, leverage the
GraphicsContextImplCairo class and work with an existing Cairo context
through that GraphicsContextImpl implementation.
A new GraphicsContextImplCairo constructor is added, expecting pointer
to the cairo_t object. With that, a PlatformContextCairo object is
created, with ownership of that object now being handled by the
GraphicsContextImplCairo class.
Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
instead provide a factory function that returns a fresh
GraphicsContextImplCairo object, passing that cairo_t object to its
constructor.
No new tests -- no change in behavior.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::GraphicsContext): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo):
(WebCore::m_private):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::strokeBoundingRect const):
(WebCore::Path::strokeContains const):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
2018-01-28 Minsheng Liu <lambda@liu.ms>
Overflow of formulas is hidden for display mathematics
https://bugs.webkit.org/show_bug.cgi?id=160547
Reviewed by Frédéric Wang.
Previously, <math> with display="block" uses its container's logical width as logical width.
However, that behavior will truncate overflowed contents. The patch fixes it by setting
the logical width as its content width rather than its container's logical width
if the former is wider than the latter.
Test: mathml/presentation/display-math-horizontal-overflow.html
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layoutBlock):
2018-01-26 Antoine Quint <graouts@apple.com>
[Web Animations] Distinguish between an omitted and a null timeline argument to the Animation constructor
https://bugs.webkit.org/show_bug.cgi?id=179065
<rdar://problem/36869046>
Reviewed by Dean Jackson.
The Web Animations specification requires that a missing or undefined "timeline" parameter means that the
document's timeline should be used, but a null value should be supported. To support this, we need to provide
a custom Animation constructor where we can check on the ExecState whether the second argument passed is
undefined, which is true if an explicit "undefined" value is passed or if the argument does not exist.
* Sources.txt: Add the new JSWebAnimationCustom.cpp file.
* WebCore.xcodeproj/project.pbxproj: Add the new JSWebAnimationCustom.cpp file.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create): Add a create() variant that doesn't provide an AnimationTimeline parameter
to clearly indicate that the provided Document's timeline should be used.
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSWebAnimationCustom.cpp: Added.
(WebCore::constructJSWebAnimation): Provide a custom Animation constructor where we check whether the second
argument, the timeline, is undefined.
* dom/Element.cpp:
(WebCore::Element::animate): Use the new create() variant since passing "nullptr" now means a null timeline.
2018-01-26 Ricky Mondello <rmondello@apple.com>
Use the standard -webkit-autofill color on iOS
https://bugs.webkit.org/show_bug.cgi?id=182182
Reviewed by Tim Horton.
* css/html.css:
(input:-webkit-autofill, input:-webkit-autofill-strong-password):
2018-01-26 Dean Jackson <dino@apple.com>
REGRESSION (r222961): Clear function not clearing whole screen when antialias is set to false
https://bugs.webkit.org/show_bug.cgi?id=179368
<rdar://problem/36111549>
Reviewed by Sam Weinig.
When we changed from using a CAOpenGLLayer to a regular CALayer, we should
have also swapped the "opaque" property to "contentsOpaque".
Covered by the existing test: fast/canvas/webgl/context-attributes-alpha.html
(when run on some hardware!)
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]):
2018-01-26 Mark Lam <mark.lam@apple.com>
Add infrastructure for pointer preparation.
https://bugs.webkit.org/show_bug.cgi?id=182191
<rdar://problem/36889194>
Reviewed by JF Bastien.
No new tests because this patch does not introduce any behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
2018-01-26 Simon Fraser <simon.fraser@apple.com>
REGRESSiON (r226492): Crash under Element::absoluteEventBounds() on a SVGPathElement which has not been laid out yet
https://bugs.webkit.org/show_bug.cgi?id=182185
rdar://problem/36836262
Reviewed by Zalan Bujtas.
Document::absoluteRegionForEventTargets() can fire when layout is dirty, and SVGPathElement's path() can be null if it
hasn't been laid out yet. So protect against a null path in getBBox().
Not easily testable because internals.nonFastScrollableRects() forces layout, and the crash depends on the timing of
absoluteRegionForEventTargets().
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::getBBox):
2018-01-26 Chris Dumez <cdumez@apple.com>
Offlined content does not work for apps on home screen
https://bugs.webkit.org/show_bug.cgi?id=182070
<rdar://problem/36843906>
Reviewed by Youenn Fablet.
Already registered service workers were unable to intercept the very first
load because registration matching was happening after the registration
was loaded from disk, but *before* its active worker was populated.
We now initialize the registrations' active worker as soon as we load
them from disk. We do not necessarily have a SW Context process connection
identifier yet at this point so I made it optional on the SWServerWorker.
This identifier gets set on the SWServerWorker when the worker is actually
launched and gets cleared when the SWServerWorker gets terminated.
Covered by new API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::fireInstallEvent):
(WebCore::SWServer::fireActivateEvent):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::contextConnectionIdentifier const):
(WebCore::SWServerWorker::setContextConnectionIdentifier):
2018-01-26 Chris Nardi <cnardi@chromium.org>
Addressing post-review comments after r226614
https://bugs.webkit.org/show_bug.cgi?id=182151
Reviewed by Myles C. Maxfield.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
* html/TextFieldInputType.cpp:
(WebCore::limitLength):
* platform/LocalizedStrings.cpp:
(WebCore::truncatedStringForLookupMenuItem):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2018-01-26 Antoine Quint <graouts@apple.com>
[iOS] prefers-reduced-motion media query is not working
https://bugs.webkit.org/show_bug.cgi?id=182169
<rdar://problem/36801631>
Reviewed by Dean Jackson.
The code that would eventually query UIKit for the system setting was not run since USE(NEW_THEME) is off on iOS.
Adding a PLATFORM(IOS) flag here allows the code to run.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
2018-01-26 Youenn Fablet <youenn@apple.com>
CSP post checks should be done for service worker responses
https://bugs.webkit.org/show_bug.cgi?id=182160
Reviewed by Daniel Bates.
Covered by updated test.
Add security checks when receiving a service worker response.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
* loader/cache/CachedResourceLoader.h:
2018-01-26 Manuel Rego Casasnovas <rego@igalia.com>
[css-multicol] Support percentages in column-gap
https://bugs.webkit.org/show_bug.cgi?id=182004
Reviewed by Javier Fernandez.
This patch adds percentage support to column-gap property.
Most of the changes are related to the parsing logic,
the column-gap property now accepts both length and percentages,
on top of the "normal" initial value.
A new utility class GapLength has been added, as it'll be useful
to implement row-gap in the future.
Apart from that the muticolumn layout code has been modified
to resolve the percentage gaps (treating them as zero while computing
preferred widths) and resolving them during layout.
This doesn't follow the current text on the spec, but there is an
ongoing discussion that might cause the text is changed:
https://github.com/w3c/csswg-drafts/issues/509#issuecomment-355242101
We could update the implementation once we have a definitive answer
from the CSS WG.
Test: web-platform-tests/css/css-multicol/multicol-gap-percentage-001.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGapLength):
* css/StyleBuilderCustom.h:
(WebCore::forwardInheritedValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGapLength):
(WebCore::CSSPropertyParser::parseSingleValue):
* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::columnGap const):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::columnGap const):
* rendering/style/GapLength.cpp: Added.
(WebCore::operator<<):
* rendering/style/GapLength.h: Added.
(WebCore::GapLength::GapLength):
(WebCore::GapLength::isNormal const):
(WebCore::GapLength::length const):
(WebCore::GapLength::operator== const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::columnGap const):
(WebCore::RenderStyle::setColumnGap):
(WebCore::RenderStyle::initialColumnGap):
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
(WebCore::StyleMultiColData::operator== const):
* rendering/style/StyleMultiColData.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2018-01-26 Emilio Cobos Álvarez <emilio@crisal.io>
Remove unused RenderFragmentedFlow::createFragmentedFlowStyle.
https://bugs.webkit.org/show_bug.cgi?id=182138
Reviewed by Manuel Rego Casasnovas.
Has no callers.
No new tests, just removes unused code so no behavior change.
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderFragmentedFlow.h:
2018-01-26 Emilio Cobos Álvarez <emilio@crisal.io>
Remove useless RenderBlockFlow overrides.
https://bugs.webkit.org/show_bug.cgi?id=182139
Reviewed by Manuel Rego Casasnovas.
I think these are leftovers from the CSS regions removal, looking at
blame.
No new tests, no behavior change.
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
2018-01-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Add InspectorShaderProgram to Unified Sources build
https://bugs.webkit.org/show_bug.cgi?id=182084
Reviewed by Dan Bernstein.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* Sources.txt:
Move to Sources.txt always.
* inspector/InspectorShaderProgram.cpp:
Add ENABLE(WEBGL) guard to contents.
2018-01-25 Ryosuke Niwa <rniwa@webkit.org>
Make scrolling to the focused element async
https://bugs.webkit.org/show_bug.cgi?id=181575
<rdar://problem/36459767>
Reviewed by Simon Fraser.
Made the revealing of the focused element asynchronous in Element::focus. Like selection, schedule a timer when
a new element is focused, and only scroll to the focused element when the timer fires. If any other scrolling
happens meanwhile, we cancel this timer.
There are two Web exposed behavioral changes:
1. The scrolling position doesn't change immediately when calling Element::focus.
2. Only the last focused element will be revealed.
Both behavioral changes pose its own compatibility risks but we're making a conscious decision here since
the scrolling asynchronous has a clear performance benefit.
There is one edge case to cosnider: when the history controller restores the scrolling position, canceling the
timer results in a focused element in an overflow: hidden element to be never revealed. Expediate revealing of
the focused element in this one case instead of canceling.
Tests: fast/scrolling/scroll-to-focused-element-asynchronously.html
fast/scrolling/scroll-to-focused-element-canceled-by-fragment-navigation.html
* dom/Element.cpp:
(WebCore::Element::focus): Call updateFocusAppearance on focusAppearanceUpdateTarget to handle HTMLAreaElement
which delegates the focus appearance update to its image element.
(WebCore::Element::focusAppearanceUpdateTarget): Extracted. Returns "this" element for all but HTMLAreaElement.
(WebCore::Element::updateFocusAppearance): Schedule the revealing of the focused element in FrameView instead of
synchronously scrolling to the focused element.
* dom/Element.h:
(WebCore::Element::defaultFocusTextStateChangeIntent):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::focusAppearanceUpdateTarget): Extracted from updateFocusAppearance.
(WebCore::HTMLAreaElement::updateFocusAppearance): Deleted.
* html/HTMLAreaElement.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState): Reveal the focused element
prior to restoring the scrolling location of the fragment navigation. This is needed to reveal a focused element
inside overflow: hidden element which got focused.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView): Added a boolean flag and a timer for scrolling to the focused element.
(WebCore::FrameView::reset): Stop the timer and clear the flag.
(WebCore::FrameView::maintainScrollPositionAtAnchor): Ditto when scrolling to an anchor.
(WebCore::FrameView::setScrollPosition): Ditto when some other programatic scroll or the user scrolls the view.
(WebCore::FrameView::scheduleScrollToFocusedElement): Added.
(WebCore::FrameView::scrollToFocusedElementImmediatelyIfNeeded): Added.
(WebCore::FrameView::scrollToFocusedElementTimerFired): Added.
(WebCore::FrameView::scrollToAnchor): Stop the timer and clear the flag when scrolling to an achor.
(WebCore::FrameView::setWasScrolledByUser): Ditto when the user scrolls.
* page/FrameView.h:
2018-01-25 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r217236): [iOS] PDFDocumentImage does not update its cached ImageBuffer if it has a sub-rectangle of the image
https://bugs.webkit.org/show_bug.cgi?id=182083
Reviewed by Simon Fraser.
Test: fast/images/pdf-as-image-dest-rect-change.html
Revert the change r217236 back. Fix the issue of throwing out the cached
ImageBuffer of the PDF document image when moving its rectangle.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::cacheParametersMatch): Return the if-statement
which was deleted in r217236 back but intersect it with dstRect. The context
clipping rectangle can be more than the dstRect.
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
-- Remove a wrong optimization which used to work for Mac only if the context
interpolation quality is not set to low or none quality. This optimization
does not consider the case when srcRect or destRect change after caching
the ImageBuffer. Or even if m_cachedImageRect does not include the
whole clipping rectangle.
-- Move back the call to cacheParametersMatch() before changing the
m_cachedImageRect.
-- Always intersect the clipping rectangle with the dstRect to ensure we
only look at the dirty rectangle inside the image boundary.
-- If cacheParametersMatch() returns true, set m_cachedDestinationRect to
dstRect and move m_cachedImageRect by the difference between the new
and the old dstRects since no re-caching will happen.
* platform/graphics/cg/PDFDocumentImage.h:
* testing/Internals.cpp:
(WebCore::pdfDocumentImageFromImageElement):
(WebCore::Internals::pdfDocumentCachingCount):
* testing/Internals.h:
* testing/Internals.idl:
Add an internal API which returns the number of drawing the PDF into an
ImageBuffer.
2018-01-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unnecessary developerExtrasEnabled checks
https://bugs.webkit.org/show_bug.cgi?id=182156
Reviewed by Matt Baker.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
These checks should not be needed. The step above bails if there is
no inspector frontend, and there can be no inspector frontend unless
developer extras enabled are enabled.
2018-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Add localizable strings for extra-zoomed form controls
https://bugs.webkit.org/show_bug.cgi?id=182080
Reviewed by Tim Horton.
Add new localizable strings. Additionally, run `update-webkit-localizable-strings` to re-sort
Localizable.strings.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlCancelButtonTitle):
(WebCore::formControlHideButtonTitle):
(WebCore::formControlGoButtonTitle):
(WebCore::formControlSearchButtonTitle):
(WebCore::textInputModeWriteButton):
(WebCore::textInputModeSpeechButton):
* platform/LocalizedStrings.h:
2018-01-25 Chris Dumez <cdumez@apple.com>
Access to service workers / Cache API should be disabled in sandboxed frames without allow-same-origin flag
https://bugs.webkit.org/show_bug.cgi?id=182140
<rdar://problem/36879952>
Reviewed by Youenn Fablet.
Throw a SecurityError when accessing navigator.serviceWorker or window.caches inside a sandboxed iframe
without the allow-same-origin flag. This behavior is consistent with Chrome. Firefox, however, seems
to return these objects but have their API reject promises with a SecurityError instead.
No new tests, rebaselined existing tests.
* Modules/cache/DOMWindowCaches.cpp:
(WebCore::DOMWindowCaches::caches): Deleted.
* Modules/cache/DOMWindowCaches.h:
* Modules/cache/DOMWindowCaches.idl:
* page/NavigatorBase.cpp:
* page/NavigatorBase.h:
* page/NavigatorServiceWorker.idl:
2018-01-25 Chris Dumez <cdumez@apple.com>
Clients.get(id) should only returns clients in the service worker's origin
https://bugs.webkit.org/show_bug.cgi?id=182149
<rdar://problem/36882310>
Reviewed by Youenn Fablet.
When looking for SW clients with a given identifier, only look in the list of
clients that have the same origin as the service worker.
No new tests, rebaselined existing test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::serviceWorkerClientWithOriginByID const):
(WebCore::SWServer::serviceWorkerClientByID const): Deleted.
* workers/service/server/SWServer.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::findClientByIdentifier const):
* workers/service/server/SWServerWorker.h:
2018-01-25 Youenn Fablet <youenn@apple.com>
WebPluginInfoProvider should handle null host queries
https://bugs.webkit.org/show_bug.cgi?id=182112
Reviewed by Chris Dumez.
No change of behavior.
Removed assertion that is not always true, as shown by API tests.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
2018-01-25 Youenn Fablet <youenn@apple.com>
ShapeOutside should use same origin credentials mode
https://bugs.webkit.org/show_bug.cgi?id=182141
Reviewed by Chris Dumez.
Covered by updated test.
As per https://drafts.csswg.org/css-shapes/#shape-outside-property, ShapeOutside images
should be fetched with anonymous cors mode, meaning credentials should be set to same-origin.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):
2018-01-25 John Wilander <wilander@apple.com>
Make sure we have a frame as we iterate in ResourceLoadObserver::nonNullOwnerURL()
https://bugs.webkit.org/show_bug.cgi?id=182116
<rdar://problem/36210134>
Reviewed by Alex Christensen.
No new tests. No known repro case, just crash logs.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::nonNullOwnerURL const):
2018-01-25 Jer Noble <jer.noble@apple.com>
Move ImageDecoderAVFObjC from using AVSampleBufferGenerator to AVAssetReaderOutput for parsing
https://bugs.webkit.org/show_bug.cgi?id=182091
Reviewed by Eric Carlson.
No new tests; should be covered by existing tests.
AVSampleBufferGenerator is not available on iOS, so in order to enable ImageDecoderAVFObjC there,
we must adopt a similar API which is available both on iOS and macOS: AVAssetReaderOutput. Unlike
the generator, AVAssetReaderOutput doesn't necessarily generate samples in decode order, so we'll
repurpose the SampleMap from EME to hold the decoded samples as well as their generated images.
* Modules/mediasource/SampleMap.cpp:
* Modules/mediasource/SampleMap.h:
(WebCore::SampleMap::size const):
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
* platform/MediaSample.h:
(WebCore::MediaSample::hasAlpha const):
* platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
(WebCore::ImageDecoder::supportsMediaType):
* platform/graphics/avfoundation/MediaSampleAVFObjC.h: Make non-final.
(WebCore::MediaSampleAVFObjC::sampleBuffer const):
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjCSample::create):
(WebCore::ImageDecoderAVFObjCSample::sampleBuffer const):
(WebCore::ImageDecoderAVFObjCSample::image const):
(WebCore::ImageDecoderAVFObjCSample::setImage):
(WebCore::ImageDecoderAVFObjCSample::ImageDecoderAVFObjCSample):
(WebCore::ImageDecoderAVFObjCSample::cacheMetadata):
(WebCore::toSample):
(WebCore::ImageDecoderAVFObjC::readSamples):
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
(WebCore::ImageDecoderAVFObjC::advanceCursor):
(WebCore::ImageDecoderAVFObjC::setTrack):
(WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
(WebCore::ImageDecoderAVFObjC::repetitionCount const):
(WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const):
(WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
(WebCore::ImageDecoderAVFObjC::setData):
(WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):
(WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
(WebCore::ImageDecoderAVFObjC::readSampleMetadata): Deleted.
2018-01-25 Youenn Fablet <youenn@apple.com>
DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
https://bugs.webkit.org/show_bug.cgi?id=182137
Reviewed by Chris Dumez.
Covered by rebased test.
In case redirection does not come from memory cache or service worker, disable service worker interception when following the redirection.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
2018-01-25 Youenn Fablet <youenn@apple.com>
DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
https://bugs.webkit.org/show_bug.cgi?id=182115
Reviewed by Alex Christensen.
Covered by rebased test.
In case a navigation load is going to the network process,
we need to interrupt it if having a redirection that leads to a new request going to a service worker.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
2018-01-25 Chris Dumez <cdumez@apple.com>
Registering same scope as the script directory without the last slash should fail
https://bugs.webkit.org/show_bug.cgi?id=182122
<rdar://problem/36877167>
Reviewed by Youenn Fablet.
This aligns our behavior with Firefox and Chrome.
No new tests, rebaselined existing test.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::didReceiveResponse):
2018-01-25 Antoine Quint <graouts@apple.com>
[Web Animations] Expose the reverse() method
https://bugs.webkit.org/show_bug.cgi?id=182100
<rdar://problem/36867117>
Reviewed by Dean Jackson.
We expose and implement the reverse() method on Animation as specified.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::reverse):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
2018-01-25 Antoine Quint <graouts@apple.com>
[Web Animations] Account for provided easings when computing progress and resolving keyframe effect values
https://bugs.webkit.org/show_bug.cgi?id=182098
<rdar://problem/36866149>
Reviewed by Dean Jackson.
We now account for the timing functions provided through the "easing" propreties on whole animation effects
and individual keyframes. Exposing those exposed shortcomings of our keyframe resolution in general through
WPT tests so we now implement the "effect value of a keyframe effect" procedure from the spec to correctly
resolve keyframes in KeyframeEffect::setAnimatedPropertiesInStyle(). The tests also showed some shortcomings
in our TimingFunction code where our step() function resolution wasn't fully compliant and our cubic-bezier()
resolution not accurate enough. We now have microsecond accuracy when resolving cubic-bezier() timing functions
and identify cubic-bezier(0, 0, 0, 0), cubic-bezier(0, 0, 1, 1) and cubic-bezier(1, 1, 1, 1) as linear timing
functions, as called out by the WPT tests.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::transformedProgress const): Account for the effect-wide timing function when computing
the progress.
(WebCore::AnimationEffect::iterationProgress const): Use the transformed progress now that we support this procedure.
* animation/AnimationEffect.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::apply): We now use the computed progress from AnimationEffect rather than compute based
on the provided time, which we've dropped as an argument.
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Implement the "effect value of a keyframe effect" procedure
in full as specified (save for composite operations).
(WebCore::KeyframeEffect::applyAtLocalTime): Deleted.
* animation/KeyframeEffect.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::resolve):
* css/CSSTimingFunctionValue.h: Fix a small error made in a previous patch where we used "int" instead of "unsigned".
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
2018-01-25 Antoine Quint <graouts@apple.com>
[Web Animations] Avoid querying the current time multiple time when resolving the play state
https://bugs.webkit.org/show_bug.cgi?id=182099
Reviewed by Dean Jackson.
No test change since this shouldn't cause any change in behavior.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):
2018-01-25 Youenn Fablet <youenn@apple.com>
Set integrity fetch options for loading scripts and CSS
https://bugs.webkit.org/show_bug.cgi?id=182077
Reviewed by Chris Dumez.
Covered by updated test.
Set integrity fetch option in script and CSS loading.
* bindings/js/CachedModuleScriptLoader.cpp:
(WebCore::CachedModuleScriptLoader::load):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestModuleScript const):
(WebCore::CachedScriptFetcher::requestScriptWithCache const):
* bindings/js/CachedScriptFetcher.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::load):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptElementCachedScriptFetcher.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
2018-01-25 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use GraphicsContextImplCairo in Nicosia::PaintingContextCairo
https://bugs.webkit.org/show_bug.cgi?id=182094
Reviewed by Carlos Garcia Campos.
Have Nicosia::PaintingContextCairo create a GraphicsContext object that
utilizes a factory function which returns a freshly-allocated
GraphicsContextImplCairo through which all the painting is then done.
This moves GraphicsLayer painting over to using the GraphicsContextImpl
infrastructure.
No new tests -- no changes in behavior.
* platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::PaintingContextCairo):
2018-01-24 Frederic Wang <fwang@igalia.com>
ScrollingStateNode::reconcileLayerPositionForViewportRect is only called on direct children of the root
https://bugs.webkit.org/show_bug.cgi?id=179946
Reviewed by Simon Fraser.
ScrollingStateNode::reconcileLayerPositionForViewportRect is currently only called on the
direct children of root of the scrolling tree. Hence nodes like "position: fixed" will not
update their layers after scrolling when they are deeper in the tree. This is already
possible on iOS with overflow nodes and will happen with subframes when async scrolling is
implemented. This commit fixes that issue by recursively calling the function
ScrollingStateNode::reconcileLayerPositionForViewportRect on the scrolling tree.
Test: fast/scrolling/ios/reconcile-layer-position-recursive.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Just call
reconcileLayerPositionForViewportRect on the root node.
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): By default, this
function now recursively calls reconcileLayerPositionForViewportRect on the children.
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect): Call the function
on children.
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): Ditto.
2018-01-24 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use GraphicsContextImplCairo for ImageBuffer context
https://bugs.webkit.org/show_bug.cgi?id=181977
Reviewed by Carlos Garcia Campos.
Enhance the GraphicsContextImpl interface to the point of enabling the
Cairo-based implementation to be used for GraphicsContext construction
in ImageBufferCairo.cpp.
In order to enable GraphicsContextImpl implementations to properly
manage PlatformGraphicsContext objects, the hasPlatformContext() and
platformContext() methods are added. Cairo implementation returns true
in the first method, and returns pointer to the PlatformContextCairo
object in the second. The DisplayList::Recorder, due to its recording
nature, doesn't manage such an object, so it returns false and nullptr,
respectively.
GraphicsContextImpl also gains the setCTM(), getCTM(), clipBounds() and
roundToDevicePixels() methods, corresponding to the GraphicsContext
methods that now invoke these new methods on any existing m_impl object.
GraphicsContextImplCairo implementations mimic the existing behavior in
the Cairo-specific GraphicsContext methods, but DisplayList::Recorder
implementations remain no-op, logging the invocation but doing nothing
otherwise.
drawImage() and drawTiledImage() methods on the GraphicsContextImpl
interface are changed to return the ImageDrawResult value, corresponding
to what's been done in the method. In DisplayList::Recorder, the methods
return ImageDrawResult::DidRecord, while in GraphicsContextImplCairo the
methods return the return result of Image::draw() or Image::drawTiled()
call.
To make the protected Image::draw() and Image::drawTiled() methods
accessible, invocations of those are packed into static drawImageImpl()
and drawTiledImageImpl() functions on the GraphicsContextImpl class.
This makes it possible to simply declare GraphicsContextImpl class as a
friend class of Image, and not every specific GraphicsContextImpl
derivation. Implementations of these functions mirror behavior of the
drawImage() and drawTiledImage() methods on the GraphicsContext class,
when an m_impl object isn't present, constructing a scope-tied
InterpolationQualityMaintainer object and invoking the relevant Image
method.
To make immediate use of the new GraphicsContextImplCairo functionality,
the GraphicsContext construction in Cairo-specific ImageBuffer
implementation now uses a factory function that returns a new
GraphicsContextImplCairo object through which the given
PlatformContextCairo is used for painting.
No new tests -- no change in functionality.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::hasPlatformContext const):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::hasPlatformContext const): Deleted.
* platform/graphics/GraphicsContextImpl.cpp:
(WebCore::GraphicsContextImpl::drawImageImpl):
(WebCore::GraphicsContextImpl::drawTiledImageImpl):
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/Image.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::platformContext const):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::setCTM):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::m_private):
(WebCore::GraphicsContextImplCairo::~GraphicsContextImplCairo):
(WebCore::GraphicsContextImplCairo::hasPlatformContext const):
(WebCore::GraphicsContextImplCairo::platformContext const):
(WebCore::GraphicsContextImplCairo::updateState):
(WebCore::GraphicsContextImplCairo::setLineCap):
(WebCore::GraphicsContextImplCairo::setLineDash):
(WebCore::GraphicsContextImplCairo::setLineJoin):
(WebCore::GraphicsContextImplCairo::setMiterLimit):
(WebCore::GraphicsContextImplCairo::fillRect):
(WebCore::GraphicsContextImplCairo::fillRoundedRect):
(WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
(WebCore::GraphicsContextImplCairo::fillPath):
(WebCore::GraphicsContextImplCairo::fillEllipse):
(WebCore::GraphicsContextImplCairo::strokeRect):
(WebCore::GraphicsContextImplCairo::strokePath):
(WebCore::GraphicsContextImplCairo::strokeEllipse):
(WebCore::GraphicsContextImplCairo::clearRect):
(WebCore::GraphicsContextImplCairo::drawGlyphs):
(WebCore::GraphicsContextImplCairo::drawImage):
(WebCore::GraphicsContextImplCairo::drawTiledImage):
(WebCore::GraphicsContextImplCairo::drawNativeImage):
(WebCore::GraphicsContextImplCairo::drawPattern):
(WebCore::GraphicsContextImplCairo::drawRect):
(WebCore::GraphicsContextImplCairo::drawLine):
(WebCore::GraphicsContextImplCairo::drawLinesForText):
(WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
(WebCore::GraphicsContextImplCairo::drawEllipse):
(WebCore::GraphicsContextImplCairo::drawFocusRing):
(WebCore::GraphicsContextImplCairo::save):
(WebCore::GraphicsContextImplCairo::restore):
(WebCore::GraphicsContextImplCairo::translate):
(WebCore::GraphicsContextImplCairo::rotate):
(WebCore::GraphicsContextImplCairo::scale):
(WebCore::GraphicsContextImplCairo::concatCTM):
(WebCore::GraphicsContextImplCairo::setCTM):
(WebCore::GraphicsContextImplCairo::getCTM):
(WebCore::GraphicsContextImplCairo::beginTransparencyLayer):
(WebCore::GraphicsContextImplCairo::endTransparencyLayer):
(WebCore::GraphicsContextImplCairo::clip):
(WebCore::GraphicsContextImplCairo::clipOut):
(WebCore::GraphicsContextImplCairo::clipPath):
(WebCore::GraphicsContextImplCairo::clipBounds):
(WebCore::GraphicsContextImplCairo::roundToDevicePixels):
(WebCore::m_platformContext): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::roundToDevicePixels):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawImage):
(WebCore::DisplayList::Recorder::drawTiledImage):
(WebCore::DisplayList::Recorder::drawNativeImage):
(WebCore::DisplayList::Recorder::setCTM):
(WebCore::DisplayList::Recorder::getCTM):
(WebCore::DisplayList::Recorder::clipBounds):
(WebCore::DisplayList::Recorder::roundToDevicePixels):
* platform/graphics/displaylists/DisplayListRecorder.h:
2018-01-24 Christopher Reid <chris.reid@sony.com>
Linker error in ShareableBitmapCairo.cpp undefined reference to WebCore::Cairo::ShadowState::ShadowState
https://bugs.webkit.org/show_bug.cgi?id=182060
Reviewed by Žan Doberšek.
No new tests, no change in behavior.
Added exports to WebCore::Cairo::ShadowState::ShadowState.
* platform/graphics/cairo/CairoOperations.h:
2018-01-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Implement didSendData client callback.
https://bugs.webkit.org/show_bug.cgi?id=182063
Reviewed by Alex Christensen.
No new tests (covered by existing tests).
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::willSendData):
* platform/network/curl/CurlRequestClient.h:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidSendData):
* platform/network/curl/ResourceHandleCurlDelegate.h:
2018-01-24 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement PublicKeyCredentials [[DiscoverFromExternalSource]] with a dummy authenticator
https://bugs.webkit.org/show_bug.cgi?id=182032
<rdar://problem/36459922>
Reviewed by Brent Fulgham.
This patch implements PublicKeyCredential's [[DiscoverFromExternalSource]] from
https://www.w3.org/TR/webauthn/#getAssertion as of 5 December 2017. In order to
do testing, a dummy authenticator is implemented to exercise a failure and a
pass path. A number of dependencies need to be resolved later in order to comply
with the spec, which are marked by FIXME in the patch and tracked by proper
bugs. Those dependencies will be addressed once the first prototype is finshed.
Tests: http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html
http/wpt/credential-management/credentialscontainer-store-basics.https.html
http/wpt/webauthn/public-key-credential-get-failure.https.html
http/wpt/webauthn/public-key-credential-get-success.https.html
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
Fixes some minor issues.
* Modules/webauthn/Authenticator.cpp:
(WebCore::Authenticator::getAssertion const):
* Modules/webauthn/Authenticator.h:
(WebCore::Authenticator::AssertionReturnBundle::AssertionReturnBundle):
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::collectFromCredentialStore):
Changed a parameter type.
(WebCore::PublicKeyCredential::discoverFromExternalSource):
(WebCore::PublicKeyCredential::create):
Improved some comments.
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(): Deleted.
* bindings/js/JSAuthenticatorResponseCustom.cpp:
(WebCore::toJSNewlyCreated):
2018-01-24 Dean Jackson <dino@apple.com>
Move WebGL's colorspace code into IOSurface
https://bugs.webkit.org/show_bug.cgi?id=182076
<rdar://problem/36846863>
Reviewed by Simon Fraser, with assistance from Tim Horton.
Rather than have WebGLLayer talk directly to an IOSurfaceRef,
use a helper function on WebCore::IOSurface.
No behaviour change.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::migrateColorSpaceToProperties): Add new helper.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): The
newly created IOSurfaces call the helper to set up their colorspace.
2018-01-24 Dean Jackson <dino@apple.com>
Add a note about not implementing these functions without discussion.
<rdar://problem/36666458>
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::getSyncParameter):
2018-01-24 Youenn Fablet <youenn@apple.com>
Opaque being-loaded responses should clone their body
https://bugs.webkit.org/show_bug.cgi?id=182056
Reviewed by Brady Eidson.
Test: http/wpt/service-workers/clone-opaque-being-loaded-response.https.html
When cloning a being-loaded response, make sure we create a ReadableStream.
Before the patch, the readableStream was not created in that case for opaque responses.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::readableStream):
(WebCore::FetchBodyOwner::createReadableStream):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone):
2018-01-24 Chris Dumez <cdumez@apple.com>
close() operation should not be exposed inside a ServiceWorkerGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=182057
Reviewed by Youenn Fablet.
Move close() from WorkerGlobalScope to DedicatedWorkerGlobalScope as per:
- https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope
This change to the specification was made to avoid exposing this deprecated
features to service workers (which are new).
No new tests, rebaselined existing test.
* workers/DedicatedWorkerGlobalScope.idl:
* workers/WorkerGlobalScope.idl:
2018-01-24 David Hyatt <hyatt@apple.com>
Implement line clamp for mail.
https://bugs.webkit.org/show_bug.cgi?id=180818
Reviewed by Dean Jackson.
This patch implements a form of clamping that can clamp lines at both the top
and the bottom, and the interior can be replaced with a DOM element (identified
by id) that replaces the middle section.
The implementation derives from the multicolumn classes, but ultimately the
clamp should derive from the fragmentset classes instead (with most of the current
multicolumn code moving into base classes).
The virtualization of many of the multicolumn functions is something that would happen
once we move pages/printing over to this pagination model anyway.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Add the new clamp classes.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLinesClamp):
(WebCore::CSSPropertyParser::parseSingleValue):
Implement the new CSS property, webkit-lines-clamp. This is only exposed if a preference
is set, so it is not exposed to the Web.
* page/Settings.yaml:
Add a new setting to control allowing access to the new CSS property.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):
Make sure columns are created when lines clamp is set.
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::logicalHeightForLineCount):
(WebCore::RenderBlockFlow::logicalHeightExcludingLineCount):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
(WebCore::RenderBlockFlow::heightForLineCount): Deleted.
* rendering/RenderBlockFlow.h:
Re-use the same clamping logic as the old line clamp code, but modernize it to work
with writing modes and to be able to go backwards from the end of the block.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
The line count method got renamed to have the word "logical" in it, since it now
works with vertical writing.
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const):
* rendering/RenderFragmentContainer.h:
Since line clamp sets have variable page heights, this new method takes the offset
as an argument so that it can return the appropriate page for the given offset.
This method will eventually be used by printing/page sets as well, since pages
can have variable heights.
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
(WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
* rendering/RenderFragmentedFlow.h:
Support for variable page heights in a fragment set.
* rendering/RenderLinesClampFlow.cpp: Added.
(WebCore::RenderLinesClampFlow::RenderLinesClampFlow):
(WebCore::RenderLinesClampFlow::renderName const):
(WebCore::RenderLinesClampFlow::layout):
(WebCore::RenderLinesClampFlow::createMultiColumnSet):
(WebCore::RenderLinesClampFlow::isChildAllowedInFragmentedFlow const):
(WebCore::RenderLinesClampFlow::layoutFlowExcludedObjects):
* rendering/RenderLinesClampFlow.h: Added.
* rendering/RenderLinesClampSet.cpp: Added.
(WebCore::RenderLinesClampSet::RenderLinesClampSet):
(WebCore::RenderLinesClampSet::recalculateColumnHeight):
(WebCore::RenderLinesClampSet::computeLogicalHeight const):
(WebCore::RenderLinesClampSet::columnCount const):
(WebCore::RenderLinesClampSet::columnRectAt const):
(WebCore::RenderLinesClampSet::columnIndexAtOffset const):
(WebCore::RenderLinesClampSet::pageLogicalTopForOffset const):
(WebCore::RenderLinesClampSet::pageLogicalHeightForOffset const):
(WebCore::RenderLinesClampSet::fragmentedFlowPortionRectAt const):
(WebCore::RenderLinesClampSet::fragmentedFlowPortionOverflowRect):
(WebCore::RenderLinesClampSet::customBlockProgressionAdjustmentForColumn const):
(WebCore::RenderLinesClampSet::renderName const):
* rendering/RenderLinesClampSet.h: Added.
The new classes. They subclass all the methods necessary to do multi-pass layout,
and to determine the page heights of each section.
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
(WebCore::isValidColumnSpanner):
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
(WebCore::RenderMultiColumnFlow::createMultiColumnSet):
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::collectLayerFragments):
(WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
* rendering/RenderMultiColumnSet.h:
(WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const):
(WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const):
Virtualized methods so that lines clamp can subclass and change behavior.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderLinesClampFlow const):
(WebCore::RenderObject::isRenderLinesClampSet const):
Add new functions for type checking.
* rendering/RenderRubyText.cpp:
Include adjustment.
* rendering/style/LineClampValue.h:
(WebCore::LinesClampValue::LinesClampValue):
(WebCore::LinesClampValue::isNone const):
(WebCore::LinesClampValue::operator== const):
(WebCore::LinesClampValue::operator!= const):
(WebCore::LinesClampValue::start const):
(WebCore::LinesClampValue::end const):
(WebCore::LinesClampValue::center const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::linesClamp const):
(WebCore::RenderStyle::hasLinesClamp const):
(WebCore::RenderStyle::setLinesClamp):
(WebCore::RenderStyle::initialLinesClamp):
(WebCore::RenderStyle::hasInlineColumnAxis const):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
The front end style implementation of the new property.
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
Make sure to build the correct renderer when lines clamp is set.
2018-01-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Allocate CurlSSLVerifier only when it is required.
https://bugs.webkit.org/show_bug.cgi?id=182061
CurlSSLVerifier was a member function of CurlRequest. This patch do
lazy initialization of it only when actually it is required.
Also configuration method is not required by moving those stuff to
constructor of SSLVerifier which makes much safer because there's
no change to change its behavior from outside.
Reviewed by Alex Christensen.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::willSetupSslCtx):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::finalizeTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::setSslCtx): Deleted.
* platform/network/curl/CurlSSLVerifier.h:
(WebCore::CurlSSLVerifier::setCurlHandle): Deleted.
(WebCore::CurlSSLVerifier::setHostName): Deleted.
2018-01-24 Antti Koivisto <antti@apple.com>
Assertion failure in RenderMultiColumnSet::requiresBalancing() on fast/multicol/spanner-crash-when-adding-summary.html
https://bugs.webkit.org/show_bug.cgi?id=179308
<rdar://problem/34592771>
Reviewed by Zalan Bujtas.
The issue here is that we fail to tear down render tree for a summary element because adding another summary element
takes it out of the composed tree. This leaves behind renderers that break some multicolumn assumptions.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
When tearing down renderers go through the real children of the shadow hosts at the end and see if we left any renderers behind.
If so, tear them down too.
* rendering/updating/RenderTreeUpdater.h:
2018-01-24 Daniel Bates <dabates@apple.com>
[CSP] Check policy for targeted windows when navigating to a JavaScript URL
https://bugs.webkit.org/show_bug.cgi?id=182018
<rdar://problem/36795781>
Reviewed by Brent Fulgham.
Move the CSP check to be earlier in the function.
Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked.html
* loader/FrameLoader.cpp:
(WebCore::createWindow):
2018-01-24 Chris Dumez <cdumez@apple.com>
Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
https://bugs.webkit.org/show_bug.cgi?id=182021
<rdar://problem/21629943>
Reviewed by Ryosuke Niwa.
Add layout testing infrastructure for the new flag.
Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* testing/Internals.h:
* testing/Internals.idl:
2018-01-24 Alex Christensen <achristensen@webkit.org>
Remove pre-Sierra-OS-specific code in WebCore
https://bugs.webkit.org/show_bug.cgi?id=182026
Reviewed by Tim Horton.
* page/cocoa/UserAgent.mm:
(WebCore::systemMarketingVersionForUserAgentString):
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculatorMac::retargetedScrollOffsetDidChange):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::bitmapPNGFileType):
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/FontPlatformData.h:
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
(PlatformCALayerCocoa::backingStoreBytesPerPixel const):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::linearRGBColorSpaceRef):
(WebCore::extendedSRGBColorSpaceRef):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::getCSSAttribute):
(WebCore::capabilitiesForFontDescriptor):
(WebCore::findClosestFont):
(WebCore::platformFontLookupWithFamily):
(WebCore::lookupFallbackFont):
(WebCore::fontWeightFromCoreText): Deleted.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
(WebCore::Font::platformWidthForGlyph const):
(WebCore::advanceForColorBitmapFont): Deleted.
(WebCore::canUseFastGlyphAdvanceGetter): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::hash const):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::ctFont const):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::linearRGBColorSpaceRef): Deleted.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::setTimebase):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::didCreateScrollerImp):
(WebCore::ScrollbarThemeMac::isLayoutDirectionRTL):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::userPrefersReducedMotion const):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* platform/text/mac/TextBoundaries.mm:
(WebCore::findNextWordFromIndex):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion const):
2018-01-24 Alex Christensen <achristensen@webkit.org>
Remove WebProcess authentication code
https://bugs.webkit.org/show_bug.cgi?id=182020
Reviewed by Brady Eidson.
We were keeping it around for pre-NetworkSession media loading, which is gone now.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
* html/HTMLMediaElement.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Deleted.
2018-01-24 Joanmarie Diggs <jdiggs@igalia.com>
AX: SVG AAM mapping trumps ARIA role attribute in the case of SVG root
https://bugs.webkit.org/show_bug.cgi?id=181994
Reviewed by Chris Fleizach.
Only return AccessibilityRole::Group if we have no author-provided
ARIA role attribute value.
Test: accessibility/svg-element-with-aria-role.html
* accessibility/AccessibilitySVGRoot.cpp:
(WebCore::AccessibilitySVGRoot::roleValue const):
* accessibility/AccessibilitySVGRoot.h:
2018-01-24 Alex Christensen <achristensen@webkit.org>
Remove unused QTKit preference
https://bugs.webkit.org/show_bug.cgi?id=181968
Reviewed by Alexey Proskuryakov.
They weren't used and didn't do anything.
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
2018-01-24 Antoine Quint <graouts@apple.com>
[Web Animations] Compute the progress and currentIteration properties on getComputedTiming()
https://bugs.webkit.org/show_bug.cgi?id=182039
<rdar://problem/36813568>
Reviewed by Dean Jackson.
Compute the "progress" and "currentIteration" properties on the dictionary returned by getComputedTiming().
To support this we implement several procedures from the specification implemented separately with links
and steps copied from the specification. There is one last procedure we don't implement, which is to obtain
the transformed time following the application of the provided easing, which will be the next patch.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::directedProgress const):
(WebCore::AnimationEffect::iterationProgress const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h:
2018-01-24 Daniel Bates <dabates@apple.com>
REGRESSION (r226138): Selecting a line that ends with zero-width joiner (ZWJ) may cause text transformation
https://bugs.webkit.org/show_bug.cgi?id=181993
<rdar://problem/36421080>
Reviewed by David Hyatt.
Re-implement paint optimization that was inadvertently removed in r226138. This optimization
works around an issue where selecting the last printable character in a line that is followed
followed by a zero-width joiner transforms the selected character.
We need to fix <https://bugs.webkit.org/show_bug.cgi?id=181964> to improve the interaction
of selection and zero-width joiner characters. For now, re-implement a paint optimization
to perform a single paint operation when the style of the non-selected text is identical
to the style of the selected text.
Test: fast/text/mac/select-character-before-zero-width-joiner.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual):
(WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual):
(WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual):
Add helper functions to determine when marker styles are identical. We make use of these
equality functions to coalesce adjacent subranges that have the same visual style and
hence reduce the number of drawing commands to paint all the subranges in a line.
(WebCore::InlineTextBox::paint): Coalesce subranges before painting.
(WebCore::InlineTextBox::subdivideAndResolveStyle): Split out the logic to coalesce
subranges with the same style into its own function InlineTextBox::coalesceAdjacentSubranges()
and kept this function focused on subdivision and style resolution. Manually compute
the frontmost subranges so that we can resolve style for each subrange with respect to
the correct base style. Formerly we always resolved style with respect the specified
base style. Now we resolve style with respect the previous frontmost subrange to ensure
styles cascade as expected. This change causes no visual difference now. Once we implement
<https://bugs.webkit.org/show_bug.cgi?id=175784> we will be able to test this change
with respect to selection of ::spelling-error/::grammar-error pseudo elements.
(WebCore::InlineTextBox::coalesceAdjacentSubranges): Extracted logic from InlineTextBox::subdivideAndResolveStyle().
(WebCore::InlineTextBox::MarkerSubrangeStyle::operator== const): Deleted.
(WebCore::InlineTextBox::MarkerSubrangeStyle::operator!= const): Deleted.
Comparing MarkerSubrangeStyle objects should be performed using the appropriate
are*MarkerSubrangeStylesEqual() non-member function.
* rendering/InlineTextBox.h:
* rendering/MarkerSubrange.cpp:
(WebCore::subdivide): Remove overlap strategy FrontmostWithLongestEffectiveRange
as this strategy is now implemented by InlineTextBox::subdivideAndResolveStyle() and
InlineTextBox::coalesceAdjacentSubranges() that compute the set of frontmost subranges and
coalesces adjacent subranges with the same style into the longest effective subrange,
respectively. Unlike WebCore::subdivide(), InlineTextBox knows what the base style should
be for the subranges and can more aggressively coalesce adjacent subranges of different
types that have the same visual style.
* rendering/MarkerSubrange.h:
2018-01-24 Youenn Fablet <youenn@apple.com>
Fetch response should copy its url from the request if null
https://bugs.webkit.org/show_bug.cgi?id=182048
Reviewed by Chris Dumez.
No change of behavior.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Add assertion to check that the response URL is not null.
2018-01-24 Youenn Fablet <youenn@apple.com>
Account for memory cache in DocumentThreadableLoader::didReceiveResponse assertion
https://bugs.webkit.org/show_bug.cgi?id=182049
Reviewed by Chris Dumez.
No change of behavior.
A response served from Service Worker may be cached in Memory Cache and reused later on.
Update DTL assertion to handle that case.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
2018-01-24 Eric Carlson <eric.carlson@apple.com>
REGRESSION(r227457): Release assert in updateLayout while destructing a media element
https://bugs.webkit.org/show_bug.cgi?id=182038
<rdar://problem/36812083>
Reviewed by Jer Noble.
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay): Early return if element.isSuspended().
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::clientCharacteristicsChanged): Call scheduleUpdateNowPlayingInfo
instead of updateNowPlayingInfo.
2018-01-24 Chris Fleizach <cfleizach@apple.com>
AX: Provide a way for VoiceOver to uniquely identify a web session
https://bugs.webkit.org/show_bug.cgi?id=181894
Reviewed by Joanmarie Diggs.
Add a way for VoiceOver to uniquely track a web page session.
Test: accessibility/mac/session-id.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2018-01-24 Antti Koivisto <antti@apple.com>
RenderBlockRareData::m_enclosingFragmentedFlow should be WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=182045
<rdar://problem/36334787>
Reviewed by Zalan Bujtas.
For safety.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::cachedEnclosingFragmentedFlow const):
(WebCore::RenderBlock::updateCachedEnclosingFragmentedFlow const):
(WebCore::RenderBlock::locateEnclosingFragmentedFlow const):
2018-01-23 Dean Jackson <dino@apple.com>
REGRESSION (r222961?): sRGB images shown in WebGL are over-saturated on a wide gamut monitor
https://bugs.webkit.org/show_bug.cgi?id=182033
<rdar://problem/36377780>
Reviewed by Antoine Quint.
My fix for YouTube360 changed the way we composite WebGL on macOS. Unfortunately it dropped
a flag telling the compositor the colorspace of the content should be sRGB. Reinstate this
by explicitly setting the colorspace on the IOSurface we use for WebGL back buffers.
This *should* be covered by the test in:
fast/canvas/webgl/match-page-color-space.html
... however, it shows a problem with our testing infrastructure. As long as it is not
testing on a Wide Gamut display, and explicitly setting the color profile, an automated
test won't pick up this regression. I could add an Internals helper to query the colorspace
of the WebGL content, but that doesn't actually verify the composited result, which is
all that matters.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
2018-01-24 Ms2ger <Ms2ger@igalia.com>
[GTK] Fix some test failures in ATK selection handling.
https://bugs.webkit.org/show_bug.cgi?id=168369
<rdar://problem/30534881>
Reviewed by Joanmarie Diggs.
In r208479, selectionBelongsToObject was changed to return false if the
intersectsNode call returns an exception.
In particular, this caused accessibility/gtk/text-at-offset-textarea.html
to fail. In this test, the selection is situated in the shadow DOM of the
textarea, while the node that is checked for intersection is the textarea
itself. In line with the standard, intersectsNode returns an exception in
this case.
This caused webkitAccessibleText{Word, Line, Sentence}ForBoundary to stop
returning the expected text in the tested case. Removing this check fixes
the test, along with some others.
Tests: accessibility/gtk/text-at-offset-textarea.html
accessibility/gtk/text-at-offset-textinput.html
accessibility/selected-text-range-aria-elements.html
accessibility/textarea-selected-text-range.html
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getSelectionOffsetsForObject): Remove the selectionBelongsToObject() call.
2018-01-18 Sergio Villar Senin <svillar@igalia.com>
[WebVR] Add OpenVR to the tree and to the build
https://bugs.webkit.org/show_bug.cgi?id=177298
Reviewed by Žan Doberšek.
Added build dependencies with the OpenVR library.
* CMakeLists.txt:
2018-01-23 Wenson Hsieh <wenson_hsieh@apple.com>
Harden against layout passes triggered when iterating through HTMLFormElement::associatedElements
https://bugs.webkit.org/show_bug.cgi?id=182037
<rdar://problem/36747812>
Reviewed by Ryosuke Niwa.
Observe that HTMLFormElement::associatedElements returns a const reference to a Vector of raw
FormAssociatedElement pointers. In various call sites that iterate through these associated elements using this
function, some require synchronous layout updates per iteration, which can lead to a bad time when combined with
the first observation.
To address this, we introduce HTMLFormElement::copyAssociatedElementsVector. This returns a new vector
containing strong Refs to each associated element. From each call site that may trigger synchronous layout and
execute arbitrary script while iterating over associated form elements, we instead use iterate over protected
FormAssociatedElements.
From each call site that currently doesn't (and shouldn't) require a layout update, we use the old version that
returns a list of raw FormAssociatedElement pointers, but add ScriptDisallowedScopes to ensure that we never
execute script there in the future.
Test: fast/forms/form-data-associated-element-iteration.html
* html/DOMFormData.cpp:
(WebCore::DOMFormData::DOMFormData):
Change to use copyAssociatedElementsVector().
* html/FormController.cpp:
(WebCore::recordFormStructure):
(WebCore::FormController::restoreControlStateIn):
Change to use copyAssociatedElementsVector().
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::copyAssociatedElementsVector const):
(WebCore:: const):
(WebCore::HTMLFieldSetElement::length const):
Refactor to use unsafeAssociatedElements().
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
(WebCore::HTMLFormControlsCollection::customElementAfter const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
Refactor these to use unsafeAssociatedElements().
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::unsafeAssociatedElements const):
(WebCore::HTMLFormElement::copyAssociatedElementsVector const):
* html/HTMLFormElement.h:
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
Refactor to use copyAssociatedElementsVector().
2018-01-23 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix wrong redirection with relative url when it happens from
different host than original host.
https://bugs.webkit.org/show_bug.cgi?id=181873
Reviewed by Alex Christensen.
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::willSendRequest):
2018-01-23 Eric Carlson <eric.carlson@apple.com>
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>
Reviewed by Jer Noble.
Updated API test.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
so NowPlaying status will be updated.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Return early when the media
element has been suspended.
(WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
for NowPlaying status in an inactive document or when element has been suspended.
(WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
style because HitTest can force a layout.
(WebCore::MediaElementSession::updateIsMainContent const): Ditto.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
ports.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
whenever status changes.
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
in the base class.
2018-01-23 Alex Christensen <achristensen@webkit.org>
Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
https://bugs.webkit.org/show_bug.cgi?id=181961
Reviewed by Michael Catanzaro.
No change in behavior.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponseAsync):
* loader/ResourceLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
* loader/appcache/ApplicationCacheGroup.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
(WebCore::BlobResourceHandle::continueDidReceiveResponse): Deleted.
* platform/network/BlobResourceHandle.h:
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueDidReceiveResponse): Deleted.
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::handleDataURL):
(WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueDidReceiveResponse]): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
2018-01-23 Chris Dumez <cdumez@apple.com>
Unreviewed, rollout r227216 as it seems to be causing deadlocks
https://bugs.webkit.org/show_bug.cgi?id=182013
* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-01-23 Ali Juma <ajuma@chromium.org>
REGRESSION (r226622): ASSERTION FAILED: !m_frame in WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame()
https://bugs.webkit.org/show_bug.cgi?id=181756
Reviewed by Simon Fraser.
Don't create a VisualViewport for a suspended DOMWindow. When a DOMWindow is suspended
for document suspension, all DOMWindowProperties are disconnected from their frame.
Creating a new VisualViewport while in this state means unexpectedly having a DOMWindowProperty
that's connected to a frame, and this leads to an assertion failure.
Test: http/tests/navigation/https-in-page-cache.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::visualViewport const):
Don't create a VisualViewport while suspended.
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
Handle null DOMWindow::visualViewport.
2018-01-23 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] CurlRequest must protect its client from disposal while it's on duty.
https://bugs.webkit.org/show_bug.cgi?id=181875
Reviewed by Alex Christensen.
No new tests. It's covered by existing tests.
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::callClient):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlRequestClient.h:
* platform/network/curl/ResourceHandleCurlDelegate.h:
2018-01-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r227437.
https://bugs.webkit.org/show_bug.cgi?id=182011
broke build (Requested by alexchristensen on #webkit).
Reverted changeset:
"Remove unused QTKit preference"
https://bugs.webkit.org/show_bug.cgi?id=181968
https://trac.webkit.org/changeset/227437
2018-01-23 Antoine Quint <graouts@apple.com>
[Web Animations] Expose getKeyframes() and parsing of remaining keyframe properties
https://bugs.webkit.org/show_bug.cgi?id=181978
Not reviewed.
Fix failures for http/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html introduced in the previous patch.
Those keyword values are not expected.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const):
2018-01-23 Simon Fraser <simon.fraser@apple.com>
feMorphology stops applying if either x or y radius is 0 but should not.
https://bugs.webkit.org/show_bug.cgi?id=181903
Reviewed by Dean Jackson.
feMorphology should allow the radius on one axis to be zero but still apply the effect
(it's akin to a blur on just one axis). Also, any negative radius, or zero on both axes
should act like a pass-through, rather than outputting transparent blank (this is a spec
change from SVG 1.1 to SVG 2).
Tests: svg/filters/feMorphology-zero-radius-one-axis-expected.svg
svg/filters/feMorphology-zero-radius-one-axis.svg
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplyDegenerate):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::createImageBufferResult):
2018-01-23 Alex Christensen <achristensen@webkit.org>
Remove unused MediaPlayerSupportsTypeClient
https://bugs.webkit.org/show_bug.cgi?id=182003
Reviewed by Sam Weinig.
This was used for a QTKit-specific hack I removed in r227372.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::isTypeSupported):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementationSupportsTypeClient::DOMImplementationSupportsTypeClient): Deleted.
(): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks const): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerDocumentHost const): Deleted.
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::supportsType):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerSupportsTypeClient::mediaPlayerNeedsSiteSpecificHacks const): Deleted.
(WebCore::MediaPlayerSupportsTypeClient::mediaPlayerDocumentHost const): Deleted.
2018-01-23 Alex Christensen <achristensen@webkit.org>
Remove unused QTKit preference
https://bugs.webkit.org/show_bug.cgi?id=181968
Reviewed by Alexey Proskuryakov.
They weren't used and didn't do anything.
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
2018-01-23 Javier Fernandez <jfernandez@igalia.com>
[css-align] 'left' and 'right' should parse as invalid in block/cross-axis alignment
https://bugs.webkit.org/show_bug.cgi?id=181792
Reviewed by Antti Koivisto.
The CSS WG resolved to remove the 'left' and 'right' values from the
block/cross axis alignment properties.
https://github.com/w3c/csswg-drafts/issues/1403
This patch changes the CSS parsing logic of all the CSS Box Alignment
properties, both block-axis (align-{self, items, content} and
inline-axis (justify-{self, items, content}).
Additionally, the alignment shorthands (place-{self, items, content})
have been also changed to respect the new syntax.
Despite the number of layout tests changed, I don't think this
change will break any content in current sites. The CSS values
'left' and 'right' were introduced by the new CSS Box Alignment
spec and only implemented by the CSS Grid Layout feature, shipped
last year. Additionally, the removed values have no effect on the
layout result when they are applied to the block/cross-axis CSS
Alignment properties.
Tests: imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-001.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-002.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-003.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-004.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-005.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-001.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-002.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-003.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-004.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-005.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-003.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-005.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/justify-items-legacy-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-002.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-003.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-004.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-005.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-004.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-005.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-006.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-003.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-005.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-006.html
imported/w3c/web-platform-tests/css/css-align/distribution-values/space-evenly-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-002.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-003.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-004.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-005.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-002.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-003.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-004.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-005.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-003.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-005.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-006.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::isLeftOrRightKeyword):
(WebCore::isContentPositionKeyword):
(WebCore::isContentPositionOrLeftOrRightKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::isSelfPositionKeyword):
(WebCore::isSelfPositionOrLeftOrRightKeyword):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeAlignItems):
(WebCore::consumeJustifyItems):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::consumeSimplifiedItemPosition):
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
2018-01-23 Simon Fraser <simon.fraser@apple.com>
Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
https://bugs.webkit.org/show_bug.cgi?id=181741
rdar://problem/36593581
Reviewed by Tim Horton.
The #ifdef for iOS was wrong; on iOS, visibleSize() is in content coordinates and matches
unscaledDocumentRect, so there's no need to scale it. Doing so computed the wrong unscaledMaximumScrollPosition
which broke hit-testing when the document minimum scale was > 1.
Test: fast/visual-viewport/ios/min-scale-greater-than-one.html
* page/FrameView.cpp:
(WebCore::FrameView::unscaledMaximumScrollPosition const):
2018-01-23 Antoine Quint <graouts@apple.com>
[Web Animations] Expose getKeyframes() and parsing of remaining keyframe properties
https://bugs.webkit.org/show_bug.cgi?id=181978
<rdar://problem/36772586>
Reviewed by Dean Jackson.
We finish our implementation of multiple keyframes by exposing the getKeyframes() method on KeyframeEffect and
parsing the remaining properties that can be exposed on keyframes: "easing" and "composite". And since we parse
those properties on keyframes, we also parse "easing" on AnimationEffectTiming and "composite" and "iterationComposite"
on KeyframeEffect.
To support this, we implement a new TimingFunction::createFromCSSText() method which takes in a string that is
a value provided directly via the JS API. As its converse, we expose a TimingFunction::cssText() method which
provides a string that can be sent back to JS to represent a timing function, using keywords when the timing
function matches one and ommitting default values.
We now also keep track of the original "offset" value provided through the JS API since that value is required
when calling getKeyframes() and distinct from the "computedOffset". These original offsets, composite operations
and timing functions are kept as separate Vectors from the KeyframeList since this type does not support exposing
those. We may consider improving that in a future patch.
Finally, we make some adjustments in the keyframe parsing to comply with the specification and correctly parse
all provided timing functions, regardless of the number of keyframes and timing functions provided.
Note that this patch is only about parsing, storing and returning provided easing and composite operations but
that such values will only be used for the resolution of animation effects in future patches.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getComputedTiming): Set the "easing" property on the getComputedTiming() return value
now that we expose "easing" on AnimationEffectTiming.
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming): Create a linear TimingFunction by default.
(WebCore::AnimationEffectTiming::setEasing): Parse the "easing" value and propagate an exception for invalid values.
* animation/AnimationEffectTiming.h: Expose the new "easing" property and backing TimingFunction.
* animation/AnimationEffectTiming.idl: Expose the new "easing" property.
* animation/KeyframeEffect.cpp:
(WebCore::CSSPropertyIDToIDLAttributeName): Provide a way to convert the name of a CSS property to a string that can
be used to generate a JS property name for use by getKeyframes().
(WebCore::computeMissingKeyframeOffsets): Implement the full steps of the spec.
(WebCore::processIterableKeyframes): Fix a problematic declaration for the easing variable.
(WebCore::processPropertyIndexedKeyframes): Now that ProcessedKeyframe has both an offset and a computedOffset, use
computed offsets. We also fix a couple of loops to fix compliance issues revealed by WPT tests.
(WebCore::KeyframeEffect::create): Parse the provided "easing" property on the KeyframeEffectOptions object.
(WebCore::KeyframeEffect::getKeyframes): Implement the getKeyframes() method as mandated by the spec.
(WebCore::KeyframeEffect::processKeyframes): Keep a list of unused easings so these might be parsed as well, and
potentially throw exceptions, as mandated by the spec. For valid easings, store their matching TimingFunction in
m_timingFunctions, original offset values in m_offsets and CompositeOperation values in m_compositeOperations.
* animation/KeyframeEffect.h: Switch the order in which we specify some of the Variant types so that default values
are correctly used.
* animation/KeyframeEffect.idl: Switch the order in which we specify some of the Variant types so that default values
are correctly used.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::createFromCSSText):
(WebCore::TimingFunction::cssText const):
* platform/animation/TimingFunction.h:
2018-01-23 Brady Eidson <beidson@apple.com>
Allow passing MessagePorts across processes (e.g. ServiceWorkers).
https://bugs.webkit.org/show_bug.cgi?id=181178
Reviewed by Andy Estes.
Test: http/tests/workers/service/basic-messageport.html
* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::entanglePortWithProcess):
* dom/messageports/MessagePortChannel.h:
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorker):
* workers/service/context/SWContextManager.h:
2018-01-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r227279 and r227373.
https://bugs.webkit.org/show_bug.cgi?id=181988
The LayoutTest crash fix introduced an API test failure.
(Requested by ryanhaddad on #webkit).
Reverted changesets:
"Resign NowPlaying status when no media element is eligible"
https://bugs.webkit.org/show_bug.cgi?id=181914
https://trac.webkit.org/changeset/227279
"Resign NowPlaying status when no media element is eligible"
https://bugs.webkit.org/show_bug.cgi?id=181914
https://trac.webkit.org/changeset/227373
2018-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix some format specifiers added in r227190
https://bugs.webkit.org/show_bug.cgi?id=181454
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::takeAllMessagesForPort):
2018-01-23 Ting-Wei Lan <lantw44@gmail.com>
[GTK] Add user agent quirk for Microsoft Outlook Web App
https://bugs.webkit.org/show_bug.cgi?id=181982
Reviewed by Michael Catanzaro.
Microsoft Outlook Web App forces users to switch to the lite version on
the login page with our standard user agent on all non-macOS systems.
Since it is an application that can be installed by different companies,
schools and organizations, it is not possible to fix the issue unless
we keep a big list of host names that are known to run it. We check the
host name instead of the base domain name here because it is not
expected to run all sites under a base domain on this webmail and
calendar application.
https://mail.ntu.edu.tw is a site that is known to run Microsoft Outlook
Web App for several years, and it is not likely to change. When there
are other sites found to run it and having the same user agent problem,
we can expand the list to include them.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2018-01-23 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME] Add support of multi keys from different sessions in CDMinstanceClearKey
https://bugs.webkit.org/show_bug.cgi?id=180083
Reviewed by Xabier Rodriguez-Calvar.
Add support of multi keys from different MediaKeySession in CDMInstanceClearKey.
Currently the CDMInstanceClearKey manages two "m_keys", one is a WTF::Vector
where it stores the list of last added keys, an other which is defined in the
ClearKeyState::singleton it is a WTF::HashMap, in this last one, it stores the
keys lists of each created session.
The method "keys()" of CDMInstanceClearKey returns the first "m_keys" which
contains just the list of last keys.
The goal of this commit is to return all keys lists of all sessions, thus
we remove the "m_keys" which is WTF::Vector and we modify the method
"keys()" to return all keys lists, which is stored in "m_keys" WTF::HashMap,
in one Vector instead of return just the list of last keys.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceClearKey::keys const):
(WebCore::CDMInstanceClearKey::updateLicense):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
2018-01-22 Simon Fraser <simon.fraser@apple.com>
Optimize building the non-fast scrollable region with multiple iframes
https://bugs.webkit.org/show_bug.cgi?id=181971
Reviewed by Zalan Bujtas.
AsyncScrollingCoordinator::frameViewLayoutUpdated() is called every time a subframe lays out.
We don't need to eagerly update the non-fast scrollable region at this time; we can just mark
it dirty, and rely on the existing scrolling tree commit code to recompute it.
On my machine this makes fast/frames/lots-of-objects.html no longer a timeout.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2018-01-22 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement PublicKeyCredential's [[Create]] with a dummy authenticator
https://bugs.webkit.org/show_bug.cgi?id=181928
<rdar://problem/36459893>
Reviewed by Brent Fulgham.
This patch implements PublicKeyCredential's [[Create]] from https://www.w3.org/TR/webauthn/#createCredential
as of 5 December 2017. In order to do testing, a dummy authenticator is implemented to exercise a failure
and a pass path. A number of dependencies need to be resolved later in order to comply with the spec.
Also, the current architecture of handling async WebAuthN operations including dispatching, timeout, and aborting
might need a redesign once the underlying authenticator is clear. Since this is our first attempt to implement
a prototype, all those limitations, in my opinion, can be marked as non-blocking to accelerate the whole
process. Those limitations will then be addressed once the first prototype is finshed.
Tests: http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html
http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https.html
http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https.html
http/wpt/webauthn/idl.https.html
http/wpt/webauthn/public-key-credential-create-failure.https.html
http/wpt/webauthn/public-key-credential-create-success.https.html
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::PendingPromise::PendingPromise):
(WebCore::CredentialsContainer::dispatchTask):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess const):
(WebCore::CredentialsContainer::preventSilentAccess): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::PendingPromise::create):
* Modules/webauthn/Authenticator.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.cpp.
(WebCore::Authenticator::singleton):
(WebCore::Authenticator::makeCredential const):
* Modules/webauthn/Authenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
(WebCore::AuthenticatorAssertionResponse::authenticatorData const):
(WebCore::AuthenticatorAssertionResponse::signature const):
(WebCore::AuthenticatorAssertionResponse::userHandle const):
(WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse): Deleted.
(WebCore::AuthenticatorAssertionResponse::authenticatorData): Deleted.
(WebCore::AuthenticatorAssertionResponse::signature): Deleted.
(WebCore::AuthenticatorAssertionResponse::userHandle): Deleted.
* Modules/webauthn/AuthenticatorAssertionResponse.h:
(WebCore::AuthenticatorAssertionResponse::create):
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
(WebCore::AuthenticatorAttestationResponse::attestationObject const):
(WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse): Deleted.
(WebCore::AuthenticatorAttestationResponse::attestationObject): Deleted.
* Modules/webauthn/AuthenticatorAttestationResponse.h:
(WebCore::AuthenticatorAttestationResponse::create):
* Modules/webauthn/AuthenticatorResponse.cpp:
(WebCore::AuthenticatorResponse::clientDataJSON const):
(WebCore::AuthenticatorResponse::~AuthenticatorResponse): Deleted.
(WebCore::AuthenticatorResponse::clientDataJSON): Deleted.
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredentialInternal::produceClientDataJson):
(WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash):
(WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject):
(WebCore::PublicKeyCredential::PublicKeyCredential):
(WebCore::PublicKeyCredential::discoverFromExternalSource):
(WebCore::PublicKeyCredential::create):
(WebCore::PublicKeyCredential::rawId const):
(WebCore::PublicKeyCredential::response const):
(WebCore::PublicKeyCredential::getClientExtensionResults const):
(WebCore::PublicKeyCredential::rawId): Deleted.
(WebCore::PublicKeyCredential::response): Deleted.
(WebCore::PublicKeyCredential::getClientExtensionResults): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(): Deleted.
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAuthenticatorResponseCustom.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorAttestationResponse.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSBasicCredentialCustom.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSBindingsAllInOne.cpp:
2018-01-22 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Support font collections
https://bugs.webkit.org/show_bug.cgi?id=181826
<rdar://problem/36455137>
Reviewed by Dean Jackson.
Use the CoreText call CTFontManagerCreateFontDescriptorsFromData() to get all the descriptors inside
the collection file. We select which one by using the fragment identifier at the end of the url linking
to the remote font. For example, to select the 4th font inside a TTC file, the @font-face block would
look like:
@font-face {
font-family: "MyFont";
src: url("path/to/font.ttc#4");
}
Note that these numbers are 1-indexed.
The CSS Fonts spec states:
> Fragment identifiers are used to indicate which font to load. If a container format lacks a defined
> fragment identifier scheme, implementations should use a simple 1-based indexing scheme (e.g.
> "font-collection#1" for the first font, "font-collection#2" for the second font).
Not only are TTC font collections supported, but WOFF2 font collections are also supported, which is
increasingly important web standard.
No new tests because I don't have a font collection file with the appropriate license for the
WebKit repository. I tested manually.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateIndex const):
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createCustomFontData):
* loader/cache/CachedFont.h:
* platform/graphics/cairo/FontCustomPlatformData.h:
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::createFontCustomPlatformData):
2018-01-22 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r227011): fast/frames/hidpi-position-iframe-on-device-pixel.html times out
https://bugs.webkit.org/show_bug.cgi?id=181959
Reviewed by Zalan Bujtas.
This test creates 300 iframes, which became slow after r227011 because they all became part
of the non-fast scrollable region, slowing down ScrollingCoordinator::absoluteEventTrackingRegionsForFrame().
Fix by not adding non-scrollable iframes, and making FrameView::isScrollable() more efficient for frames
that have not done layout yet.
* page/FrameView.cpp:
(WebCore::FrameView::isScrollable):
(WebCore::FrameView::addChild):
2018-01-22 Dan Bernstein <mitz@apple.com>
Fixed building for macOS 10.12 with the macOS 10.13 SDK after r227156.
* Configurations/WebCore.xcconfig:
2018-01-22 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r226981): ASSERTION FAILED: startY >= 0 && endY <= height && startY < endY in WebCore::FEMorphology::platformApplyGeneric
https://bugs.webkit.org/show_bug.cgi?id=181836
Reviewed by Tim Horton.
All the filters that use ParallelJobs<> has the same type of bug where very wide but not tall
filter regions could result in computing an optimalThreadNumber that was greater than the
number of rows to process, which resulted in jobs with zero rows to process.
Since we split the work by rows, cap the maximum number of threads to height/8 so that each job
has at least 8 rows of pixels to process. Add some assertions to detect jobs with zero rows.
FEMorphology was also using implicit float -> int conversion to detect integer overflow of radius,
so change that to use explicit clamping.
Tests: svg/filters/feLighting-parallel-jobs.svg
svg/filters/feTurbulence-parallel-jobs-wide.svg
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplyGenericPaint):
(WebCore::FELighting::platformApplyGeneric):
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplyGeneric):
(WebCore::FEMorphology::platformApply):
(WebCore::FEMorphology::platformApplyDegenerate):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
(WebCore::FETurbulence::platformApplySoftware):
2018-01-22 Eric Carlson <eric.carlson@apple.com>
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>
Reviewed by Jer Noble.
No new tests, these changes prevent existing tests from crashing.
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Return early when the media
element has been suspended.
(WebCore::MediaElementSession::canShowControlsManager const): Return false when the
media element has been suspended.
(WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
style because HitTest can force a layout.
(WebCore::MediaElementSession::updateIsMainContent const): Ditto.
2018-01-22 Alex Christensen <achristensen@webkit.org>
Begin removing QTKit code
https://bugs.webkit.org/show_bug.cgi?id=181951
Reviewed by Jer Noble.
QTKit was being used on El Capitan and before.
* Configurations/WebCore.xcconfig:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
(WebCore::MediaPlayer::supportsType):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h: Removed.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Removed.
* platform/graphics/mac/MediaTimeQTKit.h: Removed.
* platform/graphics/mac/MediaTimeQTKit.mm: Removed.
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController setVideoElement:]):
(-[WebVideoFullscreenController updatePowerAssertions]):
2018-01-22 Per Arne Vollan <pvollan@apple.com>
[Win] Null pointer crash under WebCore::RenderStyle::colorIncludingFallback.
https://bugs.webkit.org/show_bug.cgi?id=181801
<rdar://problem/35614900>
Reviewed by Brent Fulgham.
Do not paint synchronously when popup items have been added or changed while the popup is visible.
If new popup items have been added after the popup was shown, a synchronous paint operation will
possibly access their style before it is ready, leading to a null pointer crash. The invalidated
area will be painted asynchronously.
No new tests. To reproduce this crash, it is necessary to open a popup with JavaScript, add new
popup items, and then end the test. Opening the popup can be done by sending a mousedown event
with the eventsender. However, on Windows the mousedown event is sent synchronously, and will
block as long as the popup is open and running the popup event loop. This means no JS can be
executed until the popup is closed, causing the test to always time out before new popup items
can be added. I have verified the fix with a manual test case.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::updateFromElement):
2018-01-22 Chris Dumez <cdumez@apple.com>
RELEASE_ASSERT(registration) hit in SWServer::installContextData(const ServiceWorkerContextData&)
https://bugs.webkit.org/show_bug.cgi?id=181941
<rdar://problem/36744892>
Reviewed by Youenn Fablet.
Make sure we clear SWServer::m_pendingContextDatas & SWServer::m_pendingJobs as needed
when clearing Website data. Otherwise, we will hit assertion when those gets processed
after the connection to the SW process has been established (not to mentioned we failed
to clear some in-memory data even though the user asked us to).
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
2018-01-22 Ryosuke Niwa <rniwa@webkit.org>
Blob conversion and sanitization doesn't work with Microsoft Word for Mac 2011
https://bugs.webkit.org/show_bug.cgi?id=181616
<rdar://problem/36484908>
Reviewed by Wenson Hsieh.
The bug was caused by WebContentReader::readHTML and WebContentMarkupReader::readHTML not sanitizing plain HTML string
as done for web archives even when custom pasteboard data is enabled. Fixed the bug by doing the sanitization.
Unfortunately, we can't make file URLs available in this case because WebContent process doesn't have sandbox extensions
to access local files referenced by the HTML source in the clipboard, and we can't make WebContent process request for
a sandbox extension¸on an arbitrary local file, as it would defeat the whole point of sandboxing.
Instead, we strip away all HTML attributes referencing a URL whose scheme is not HTTP, HTTPS, or data when sanitizing
text/html from the clipboard to avoid exposing local file paths, which can reveal privacy & security sensitive data
such as the user's full name, and the location of private containers of other applications in the system.
Tests: PasteHTML.DoesNotSanitizeHTMLWhenCustomPasteboardDataIsDisabled
PasteHTML.DoesNotStripFileURLsWhenCustomPasteboardDataIsDisabled
PasteHTML.ExposesHTMLTypeInDataTransfer
PasteHTML.KeepsHTTPURLs
PasteHTML.SanitizesHTML
PasteHTML.StripsFileURLs
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readHTML): Fixed the bug by sanitizing the markup, and stripping away file URLs.
(WebCore::WebContentMarkupReader::readHTML): Ditto.
* editing/markup.cpp:
(WebCore::removeSubresourceURLAttributes): Added.
(WebCore::sanitizeMarkup): Added.
* editing/markup.h:
2018-01-22 Chris Dumez <cdumez@apple.com>
Add release logging to help debug issues related to service workers
https://bugs.webkit.org/show_bug.cgi?id=181935
<rdar://problem/36735900>
Reviewed by Brady Eidson.
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::scheduleTaskToUpdateState):
(WebCore::ServiceWorker::postMessage):
(WebCore::ServiceWorker::isAlwaysOnLoggingAllowed const):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::updateStateFromServer):
(WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::scriptContextFailedToStart):
(WebCore::SWServer::didFinishInstall):
(WebCore::SWServer::didFinishActivation):
(WebCore::SWServer::terminateWorkerInternal):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::didResolveRegistrationPromise):
(WebCore::SWServerJobQueue::runRegisterJob):
2018-01-22 Youenn Fablet <youenn@apple.com>
Safari Tech Preview can't use GitHub login at forums.swift.org
https://bugs.webkit.org/show_bug.cgi?id=181908
<rdar://problem/36715111>
Reviewed by Chris Dumez.
Test: http/wpt/service-workers/navigation-redirect.https.html
For subresource loads, redirections will not change who is in charge of continuing the load (service worker or network process).
For navigation loads, we need to match the registration for every redirection since this is using the Manual redirect mode.
This allows starting the load with a service worker and finishing the load with another service worker, which will become the controller.
Implement this by wrapping the registration matching of an URL within DocumentLoader::matchRegistration.
Use that method in DocumentLoader::redirectReceived.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::doRegistrationsMatch):
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
2018-01-22 Antti Koivisto <antti@apple.com>
REGRESSION (Safari 11): Buttons inside a fieldset legend cannot be clicked on in Safari 11
https://bugs.webkit.org/show_bug.cgi?id=179666
<rdar://problem/35534292>
Reviewed by Zalan Bujtas.
The legend element of a fieldset is in the border area, outside the clip rect.
With overflow:hidden mouse events won't reach it.
Test case by Dhaya Benmessaoud.
Test: fast/forms/legend-overflow-hidden-hit-test.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
(WebCore::RenderBlock::hitTestExcludedChildrenInBorder):
Add a special case to hit testing to handle legend, similarly to what is done for painting.
* rendering/RenderBlock.h:
2018-01-22 Joanmarie Diggs <jdiggs@igalia.com>
AX: Implement support for Graphics ARIA roles
https://bugs.webkit.org/show_bug.cgi?id=181796
Reviewed by Chris Fleizach.
Add mappings for the three new roles (graphics-document, graphics-object,
and graphics-symbol) as per the Graphics Accessibility API Mappings spec.
No new tests; instead, new test cases added to roles-computedRoleString.html
and roles-exposed.html.
* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString const):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
2018-01-22 Antti Koivisto <antti@apple.com>
REGRESSION(r224535): Can't write reviews in the App Store
https://bugs.webkit.org/show_bug.cgi?id=181936
<rdar://problem/36670246>
Reviewed by Zalan Bujtas.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::updateStyleForLayout):
r224535 was about media queries but it also removed a seemingly spurious call to SyleScope::didChangeStyleSheetEnvironment
from the path that does not involve media queries.
Turns out UITextContentView somehow depended on it, so revert this specific change.
2018-01-22 Brady Eidson <beidson@apple.com>
In WebKit2, make the MessagePortChannelRegistry live in the UI process.
https://bugs.webkit.org/show_bug.cgi?id=181922
Reviewed by Andy Estes.
No new tests (Refactor, no behavior change)
Add encoder/decoders and EXPORT a whole bunch of stuff.
* WebCore.xcodeproj/project.pbxproj:
* dom/MessagePort.h:
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::processForPort):
* dom/messageports/MessagePortChannel.h:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelRegistry.h:
* dom/messageports/MessageWithMessagePorts.h:
(WebCore::MessageWithMessagePorts::encode const):
(WebCore::MessageWithMessagePorts::decode):
2018-01-22 Youenn Fablet <youenn@apple.com>
Fetch Headers from an Opaque response should be filtered out
https://bugs.webkit.org/show_bug.cgi?id=181926
Reviewed by Chris Dumez.
Covered by updated test.
Refactor to use the same FetchResponse::create for Cache API and cloning.
In this method, ensure that response and headers are filtered correctly according response tainting.
Make also sure that synthetic responses do not get filtered (not needed since created by JavaScript).
Introduce helper routine to set the header map of a resource response.
Use this routine when cloning a synthetic response as in that case, m_internalResponse has no header at all.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::updateRecords):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
(WebCore::FetchResponse::clone):
* Modules/fetch/FetchResponse.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
2018-01-22 Javier Fernandez <jfernandez@igalia.com>
[css-align] 'overflow' keyword must precede the self-position and content-position value
https://bugs.webkit.org/show_bug.cgi?id=181793
Reviewed by Antti Koivisto.
There were several discussions to avoid ambiguities with the complex
values, specially when it comes to define the place-xxx shorthands.
One of the sources of problems is the 'overflow-position' keyword. The
CSS WG has decided to change the syntax of all the CSS Box Alignment
properties so that the 'overflow-position' keyword always precede the
'self-position' or the 'content-position' keywords.
https://github.com/w3c/csswg-drafts/issues/1446#event-1125715434
In order to apply this change to the Content Distribution properties'
(align-content and justify-content) syntax I had to completely
re-implement their parsing function. Thanks to this I addressed also
the issue with the content-distribution fallback, which cannot be
specified explicitly now.
https://github.com/w3c/csswg-drafts/issues/1002#ref-commit-c38cac4
No new tests, just rebaselined the expected results of the test cases affected.
Despite the so many layout tests affected by this change, it's
unlikely that it might break any content in current web
sites. This patch changes the new CSS syntax, obviously backward
compatible, defined by the new CSS Box Alignment. The
'overflow-position' keyword is only used by the layout models
implementing the new spec, so far only CSS Grid Layout.
Considering that CSS Grid has been shipped last year, it's unlikely
that many sites are using the new CSS values.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
* css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::customCSSText const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeOverflowPositionKeyword):
(WebCore::consumeContentPositionKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
2018-01-22 Chris Nardi <csnardi1@gmail.com>
Parse calc() in CSS media queries
https://bugs.webkit.org/show_bug.cgi?id=181716
calc() was previously unsupported inside of media queries. This change
adds in support for parsing calc inside of media queries.
Reviewed by Antti Koivisto.
Tests: Imported web-platform-tests/css/mediaqueries
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Updated function to take a CSSPrimitiveValue.
(WebCore::featureWithValidDensity): Updated function to take a CSSPrimitiveValue instead of a CSSParserToken.
(WebCore::featureWithValidPositiveLength): Ditto.
(WebCore::featureExpectingPositiveInteger): Ditto.
(WebCore::featureWithPositiveInteger): Ditto.
(WebCore::featureWithPositiveNumber): Ditto.
(WebCore::featureWithZeroOrOne): Ditto.
(WebCore::MediaQueryExpression::MediaQueryExpression): Use CSSPropertyParserHelpers for consuming.
* css/MediaQueryExpression.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeResolution): Added function for use in media query expression parsing.
* css/parser/CSSPropertyParserHelpers.h:
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readRestrictor): Updated functions to take a CSSParserTokenRange in order to use CSSPropertyParserHelpers.
(WebCore::MediaQueryParser::readMediaNot): Ditto.
(WebCore::MediaQueryParser::readMediaType): Ditto.
(WebCore::MediaQueryParser::readAnd): Ditto.
(WebCore::MediaQueryParser::readFeatureStart): Ditto.
(WebCore::MediaQueryParser::readFeature): Ditto.
(WebCore::MediaQueryParser::readFeatureColon): Ditto.
(WebCore::MediaQueryParser::readFeatureValue): Ditto.
(WebCore::MediaQueryParser::readFeatureEnd): Ditto.
(WebCore::MediaQueryParser::skipUntilComma): Ditto.
(WebCore::MediaQueryParser::skipUntilBlockEnd): Ditto.
(WebCore::MediaQueryParser::processToken): Ditto.
(WebCore::MediaQueryParser::parseInternal): Ditto.
(WebCore::MediaQueryData::clear): Removed reference to m_valueList
(WebCore::MediaQueryData::addExpression): Use CSSParserTokenRange.
(WebCore::MediaQueryData::lastExpressionValid): New helper function.
(WebCore::MediaQueryData::removeLastExpression): New helper function.
* css/parser/MediaQueryParser.h:
2018-01-22 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
https://bugs.webkit.org/show_bug.cgi?id=181930
Reviewed by Carlos Garcia Campos.
Move the PlatformContextCairo::drawSurfaceToContext() code into the
Cairo namespace as an operation, renaming it to drawSurface(). Mirroring
other operations, the PlatformContextCairo object is now passed through
a reference as the first argument to the function, and cairo_t context
object is retrieved from that.
Call sites of the PlatformContextCairo::drawSurfaceToContext() method
are adjusted to now call Cairo::drawSurface() and properly pass the
PlatformContextCairo object to the function.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareForStroking): Make this static.
(WebCore::Cairo::drawPatternToCairoContext):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::drawSurface):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::drawPatternToCairoContext): Deleted.
(WebCore::PlatformContextCairo::drawSurfaceToContext): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-01-22 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Spanning Grid item has too much space at the bottom / is too high
https://bugs.webkit.org/show_bug.cgi?id=181677
Reviewed by Javier Fernandez.
In IndefiniteSizeStrategy::findUsedFlexFraction() we were not
subtracting the size of the gutters when we call findFrUnitSize().
If an item spans several tracks, we cannot pass the maxContentForChild()
directly, we need to subtract the gutters as they are treated
as fixed size tracks in the algorithm.
The spec text is pretty clear regarding this
(https://drafts.csswg.org/css-grid/#algo-find-fr-size):
"Let leftover space be the space to fill minus the base sizes
of the non-flexible grid tracks."
Gutters are treated as fixed-size tracks for the purpose
of the track sizing algorithm, so we need to subtract them from the
leftover space while finding the size of an "fr".
Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-find-fr-size-gutters-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-find-fr-size-gutters-002.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::findFrUnitSize const):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
2018-01-21 Ryosuke Niwa <rniwa@webkit.org>
Turning off custom pasteboard data doesn't actually turn it off in WK2
https://bugs.webkit.org/show_bug.cgi?id=181920
<rdar://problem/36686429>
Reviewed by Wenson Hsieh.
Replaced the global settings for custom pasteboard data by regular runtime enabled flags.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):
(WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::commitToPasteboard):
* dom/DataTransferItemList.cpp:
(WebCore::shouldExposeTypeInItemList):
* editing/Editor.cpp:
(WebCore::createDataTransferForClipboardEvent):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentAndAddResources):
(WebCore::WebContentReader::readWebArchive):
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
(WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setCustomPasteboardDataEnabled):
2018-01-21 Wenson Hsieh <wenson_hsieh@apple.com>
Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
https://bugs.webkit.org/show_bug.cgi?id=181918
Reviewed by Tim Horton.
Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default). No change in behavior.
* Configurations/FeatureDefines.xcconfig:
2018-01-19 Ryosuke Niwa <rniwa@webkit.org>
Release assertion in canExecuteScript when executing scripts during page cache restore
https://bugs.webkit.org/show_bug.cgi?id=181902
Reviewed by Antti Koivisto.
The crash was caused by an erroneous instantiation of ScriptDisallowedScope::InMainThread in CachedPage::restore.
It can execute arbitrary scripts since CachedFrame::open can update style, layout, and evaluate media queries.
This is fine because there is no way to put this page back into a page cache until the load is commited via
FrameLoader::commitProvisionalLoad is invoked later which only happens after CachedPage::restore had exited.
Also added a release assert to make sure this condition holds.
Tests: fast/history/page-cache-execute-script-during-restore.html
fast/history/page-cache-navigate-during-restore.html
* history/CachedPage.cpp:
(WebCore::CachedPageRestorationScope::CachedPageRestorationScope): Added.
(WebCore::CachedPageRestorationScope::~CachedPageRestorationScope): Added.
(WebCore::CachedPage::restore): Don't instantiate ScriptDisallowedScope::InMainThread. Set isRestoringCachedPage
on the cached pate to release-assert that there won't be any attempt to put this very page back into the cache.
* history/PageCache.cpp:
(WebCore::canCachePage): Added a release assert to make sure the page which is in the process of being restored
from the page cache is not put into the page cache.
* page/Page.h:
(WebCore::Page::setIsRestoringCachedPage): Added.
(WebCore::Page::isRestoringCachedPage const): Added.
2018-01-21 Eric Carlson <eric.carlson@apple.com>
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>
Reviewed by Jer Noble.
Updated API test.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
so NowPlaying status will be updated.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
for NowPlaying status in an inactive document.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
ports.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
whenever status changes.
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
in the base class.
2018-01-21 Jer Noble <jer.noble@apple.com>
REGRESSION (macOS 10.13.2): imported/w3c/web-platform-tests/media-source/mediasource-* LayoutTests failing
https://bugs.webkit.org/show_bug.cgi?id=181891
Reviewed by Eric Carlson.
In macOS 10.13.2, CoreMedia changed the definition of CMSampleBufferGetDuration() to return
the presentation duration rather than the decode duration. For media streams where those two
durations are identical (or at least, closely similar), this isn't a problem. But the media
file used in the WPT tests have an unusual frame cadence: decode durations go {3000, 1, 5999,
1, 5999,...} and presentation durations go {3000, 2999, 3000, 2999}. This caused one check in
the "Coded Frame Processing" algorithm to begin failing, where it checks that the delta
between the last sample's decode time and the new decode time is no more than 2x as far as
the last sample's duration. That's not a problem as long as the "duration" is the "decode
duration" and the samples are all adjacent. Once the "duration" is "presentation duration",
all the assumptions in the algorithm are invalidated. In the WPT test case, the delta between
decode times is 5999, and 2 * the presentation duration is 5998, causing all samples up to
the next sync sample to be dropped.
To work around this change in behavior, we'll adopt the same technique used by Mozilla's MSE
implementation, which was done for similar reasons. Rather than track the "last frame duration",
we'll record the "greatest frame duration", and use actual decode timestamps to derive this
duration. The "greatest frame duration" field will be reset at the same times as "last frame
duration", and will be used only in the part of the algorithm that checks for large decode
timestamp gaps.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-01-21 Andy Estes <aestes@apple.com>
[ios] LayoutTest imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html is crashing in JSC::JSONParse
https://bugs.webkit.org/show_bug.cgi?id=177832
<rdar://problem/34805315>
Reviewed by Tim Horton.
Test: http/tests/paymentrequest/rejects_if_not_active.https.html
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show): Rejected promise if the document is not active.
2018-01-20 Brady Eidson <beidson@apple.com>
Make garbage collection of MessagePort objects be asynchronous.
https://bugs.webkit.org/show_bug.cgi?id=181910
Reviewed by Andy Estes.
No new tests (Covered by existing tests, including GC-specific ones).
The basic premise here is as follows:
- You can *always* GC a MessagePort that is closed
- You can *always* GC a MessagePort that has no onmessage handler, as incoming messages cannot
possibly revive it.
- You can GC a MessagePort, even if it has a message handler, as long as there are no messages
in flight between it and the remote port, and as long as the remote port is "maybe eligible for GC."
A MessagePort is considered "maybe eligible for GC" once hasPendingActivity is asked once.
A MessagePort loses "maybe eligible for GC" status once it is used for sending or receiving a message.
The changes to MessagePort.cpp implement the above with a tiny little bool-driven state machine.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::registerLocalActivity):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::isLocallyReachable const):
(WebCore::MessagePort::addEventListener):
(WebCore::MessagePort::removeEventListener):
* dom/MessagePort.h:
- Remove the lock and any background-thread code paths
- Add ASSERT(isMainThread())s throughout
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::includesPort):
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::closePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::checkRemotePortForActivity):
(WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
* dom/messageports/MessagePortChannel.h:
Add a callback for a MessagePortChannel to go ask the remote MessagePort object about local activity:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
(WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
(WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync): Deleted.
* dom/messageports/MessagePortChannelProviderImpl.h:
- Remove the lock and any background-thread code paths
- Add ASSERT(isMainThread())s throughout
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
(WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
(WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
(WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
(WebCore::MessagePortChannelRegistry::didCloseMessagePort):
(WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
(WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
(WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): Deleted.
* dom/messageports/MessagePortChannelRegistry.h:
2018-01-20 Andy Estes <aestes@apple.com>
[Apple Pay] Stop eagerly loading PassKit.framework
https://bugs.webkit.org/show_bug.cgi?id=181911
<rdar://problem/36555369>
Reviewed by Tim Horton.
r226458 and r226123 added code that caused PassKit.framework to be eagerly loaded when
initializing a WKWebView. This is costly and should only be done when Apple Pay is first used.
To avoid eagerly loading PassKit, this patch does two things:
1. Instead of sending the available payment networks as part of WebPageCreationParameters,
PaymentCoordinator asks for them using a syncrhonous message the first time they are needed.
2. Instead of setting the Apple Pay preference to false when PassKit can't be loaded,
the following API entry points check for a missing PassKit and return false, or throw
exceptions, or reject promises:
- ApplePaySession.canMakePayments()
- ApplePaySession.canMakePaymentsWithActiveCard()
- ApplePaySession.openPaymentSetup()
- ApplePaySession.begin()
No new tests for (1), which causes no change in behavior. (2) was manually verified by
locally moving aside PassKit.framework, but that's not possible to do in an automated test.
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::PaymentCoordinator):
(WebCore::PaymentCoordinator::validatedPaymentNetwork const):
(WebCore::toHashSet): Deleted.
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* loader/EmptyClients.cpp:
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
Removed PaymentCoordinator::m_availablePaymentNetworks and made
PaymentCoordinator::validatedPaymentNetwork() call
PaymentCoordinatorClient::validatedPaymentNetwork() instead.
* page/PageConfiguration.h:
Removed availablePaymentNetworks from PageConfiguration.
* testing/Internals.cpp:
(WebCore::Internals::Internals):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::validatedPaymentNetwork):
* testing/MockPaymentCoordinator.h:
Implemented PaymentCoordinatorClient::validatedPaymentNetwork().
2018-01-20 Jer Noble <jer.noble@apple.com>
Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
https://bugs.webkit.org/show_bug.cgi?id=181840
<rdar://problem/36186214>
Reviewed by Simon Fraser.
Test: media/video-fullscreen-reload-crash.html
Short circuit play() or pause() operations if the document is suspended or stopped.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
2018-01-20 Youenn Fablet <youenn@apple.com>
fetch redirect is incompatible with "no-cors" mode
https://bugs.webkit.org/show_bug.cgi?id=181866
<rdar://problem/35827140>
Reviewed by Chris Dumez.
Covered by updated tests.
Return a network error when no-cors mode and redirect mode is manual or error.
Update preflight implementation to no longer use manual redirect mode to simulate https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
Instead implement redirectReceived callback to treat any redirect response as the preflight response.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::redirectReceived):
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/CrossOriginPreflightChecker.h:
2018-01-19 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK2] Drag location is computed incorrectly when dragging content from subframes
https://bugs.webkit.org/show_bug.cgi?id=181896
<rdar://problem/35479043>
Reviewed by Tim Horton.
In r218837, I packaged most of the information needed to start a drag into DragItem, which is propagated to the client layer
via the startDrag codepath. However, this introduced a bug in computing the event position and drag location in window
coordinates. Consider the case where we're determining the drag image offset for a dragged element in a subframe:
Before the patch, the drag location (which starts out in the subframe's content coordinates) would be converted to root view
coordinates, which would then be converted to mainframe content coordinates, which would then be converted to window coordinates
using the mainframe's view. After the patch, we carry out the same math until the last step, where we erroneously use the
_subframe's_ view to convert to window coordinates from content coordinates. This results in the position of the iframe relative
to the mainframe being accounted for twice.
To fix this, we simply use the main frame's view to convert from mainframe content coordinates to window coordinates while
computing the drag location. As for the event position in window coordinates, this is currently unused by any codepath in WebKit,
so we can just remove it altogether.
Since this bug only affects drag and drop in the macOS WebKit2 port, there's currently no way to test this. I'll be using
<https://bugs.webkit.org/show_bug.cgi?id=181898> to track adding test support for drag and drop on macOS WebKit2. Manually tested
dragging in both WebKit1 and WebKit2 on macOS. dragLocationInWindowCoordinates isn't used at all for iOS drag and drop.
* page/DragController.cpp:
(WebCore::DragController::doSystemDrag):
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):
2018-01-19 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r227235.
The test for this change consistently times out on High
Sierra.
Reverted changeset:
"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/227235
2018-01-19 Youenn Fablet <youenn@apple.com>
Cache storage errors like Quota should trigger console messages
https://bugs.webkit.org/show_bug.cgi?id=181879
<rdar://problem/36669048>
Reviewed by Chris Dumez.
Covered by rebased test.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords):
(WebCore::DOMCache::batchDeleteOperation):
(WebCore::DOMCache::batchPutOperation):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::errorToException):
(WebCore::DOMCacheEngine::logErrorAndConvertToException):
* Modules/cache/DOMCacheEngine.h:
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::doOpen):
(WebCore::DOMCacheStorage::doRemove):
2018-01-19 Youenn Fablet <youenn@apple.com>
Do not go to the storage process when registering a service worker client if there is no service worker registered
https://bugs.webkit.org/show_bug.cgi?id=181740
<rdar://problem/36650400>
Reviewed by Chris Dumez.
Register a document as service worker client only if there is an existing service worker connection.
This allows not creating any connection if no service worker is registered.
Add internals API to test whether a service worker connection was created or not.
This is used by API tests that cover the changes.
* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange): No need to create a service worker connection if client is not registered yet.
(WebCore::Document::setServiceWorkerConnection): No need to unregister/register if service worker connection is the same.
Similarly, if Document is to be destroyed or suspended, we should not register it.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerConnection):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:
2018-01-19 Dean Jackson <dino@apple.com>
REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
https://bugs.webkit.org/show_bug.cgi?id=181817
<rdar://problem/35274055>
Add a setting for controlling whether touch listeners are passive
by default on document/window/body.
Updated existing test.
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* page/Settings.yaml:
2018-01-19 Daniel Bates <dabates@apple.com>
Update frame-ancestor directive to match Content Security Policy Level 3
https://bugs.webkit.org/show_bug.cgi?id=178891
<rdar://problem/35209458>
Reviewed by Alex Christensen.
Derived from Blink e667cc2e501fabab3605b838e4ee0d642a9c4a59:
<https://chromium.googlesource.com/chromium/src.git/+/e667cc2e501fabab3605b838e4ee0d642a9c4a59>
Update frame-ancestor directive to match against the origin of the ancestor document per the
Content Security Policy Level 3 spec.: <https://w3c.github.io/webappsec-csp/> (15 January 2018).
Specifically this change in behavior was made to CSP 3 in <https://github.com/w3c/webappsec/issues/311>.
In earlier versions of the spec, the frame-ancestor directive matched against the URL of the
ancestor document.
Disregarding allow-same-origin sandboxed iframes, a document with policy "frame-ancestor 'self'"
will be blocked from loading in a sandboxed iframe as a result of this change.
Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow.html
http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block.html
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):
2018-01-19 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Add timeout support to XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=181876
Reviewed by Alex Christensen
* platform/network/ResourceRequestBase.cpp:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setTimeout):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
(WebCore::ResourceError::httpError):
2018-01-19 Yoav Weiss <yoav@yoav.ws>
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657
Reviewed by Darin Adler.
Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.
Test: http/tests/preconnect/link-header-rel-preconnect-http.php
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
(WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
* loader/LinkLoader.h:
2018-01-19 Joseph Pecoraro <pecoraro@apple.com>
AppCache: Log a Deprecation warning to the Console when AppCache is used
https://bugs.webkit.org/show_bug.cgi?id=181778
Reviewed by Alex Christensen.
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
2018-01-19 Chris Dumez <cdumez@apple.com>
ASSERT(registration || isTerminating()) hit in SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181761
<rdar://problem/36594564>
Reviewed by Youenn Fablet.
There is a short period of time, early in the registration process where a
SWServerWorker object exists for a registration but is not in the registration's
installing/waiting/active slots yet. As a result, if a registration is cleared
during this period (for e.g. due to the user clearing all website data), that
SWServerWorker will not be terminated. We then hit assertion later on when this
worker is trying to do things (like call skipWaiting).
To address the issue, we now keep a reference this SWServerWorker on the
registration, via a new SWServerRegistration::m_preInstallationWorker data member.
When the registration is cleared, we now take care of terminating this worker.
No new tests, covered by existing tests that crash flakily in debug builds.
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
if the mutex is locked, then the worker thread is still starting. We spin the
runloop and try to stop again later. This avoids the deadlock shown in
Bug 181763 as the worker thread may need to interact with the main thread
during startup.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::installContextData):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::install):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::~SWServerRegistration):
(WebCore::SWServerRegistration::setPreInstallationWorker):
(WebCore::SWServerRegistration::clear):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::preInstallationWorker const):
2018-01-19 Chris Dumez <cdumez@apple.com>
Service worker registrations restored from disk may not be reused when the JS calls register() again
https://bugs.webkit.org/show_bug.cgi?id=181810
<rdar://problem/36591711>
Reviewed by Youenn Fablet.
The issue was that when restoring a registration from disk, we would not set its active worker right
away. We only set it later in installContextData(). installContextData() is only called after weve
launched the service worker process and established a connection to it.
However, we would start processing jobs (such as registrations) before weve established the connection
to the service worker process. SWServerJobQueue::runRegisterJob(), in order to reuse an existing
registration checks the registrations active worker has the right script URL. The issue was that when
this code would execute, we may not have set the registrations active service worker yet, in which case,
we would update the existing registration instead of reusing it as-is.
To address the issue, we now delay the processing of jobs until the connection to the service worker
process has been established and we've installed all pending contexts via installContextData().
Changed is covered by new API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::scheduleJobInServer):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:
2018-01-19 James Craig <jcraig@apple.com>
AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=181281
<rdar://problem/36291776>
Reviewed by Simon Fraser.
Updated "Smart Invert" to include img and picture element inversion and tests.
Tests: accessibility/smart-invert-reference.html
accessibility/smart-invert.html
* css/html.css:
(@media (inverted-colors)):
(img:not(picture>img), picture, video):
2018-01-19 Chris Dumez <cdumez@apple.com>
The WebContent process should not process incoming IPC while waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=181560
Reviewed by Ryosuke Niwa.
Add internals API for testing purposes.
Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* testing/Internals.h:
* testing/Internals.idl:
2018-01-19 Keith Miller <keith_miller@apple.com>
HaveInternalSDK includes should be "#include?"
https://bugs.webkit.org/show_bug.cgi?id=179670
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
2018-01-19 Daniel Bates <dabates@apple.com>
Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willDetachRenderers):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::willDetachRenderer):
(WebCore::PluginViewBase::willDetatchRenderer): Deleted.
2018-01-19 Jonathan Bedard <jbedard@apple.com>
Unreviewed build fix, remove unused lambda captures.
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::takeAllMessagesForPort):
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
2018-01-19 Antoine Quint <graouts@apple.com>
[Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
https://bugs.webkit.org/show_bug.cgi?id=181857
<rdar://problem/36660081>
Reviewed by Dean Jackson.
We start the work to implement the rest of the Web Animations timing and animation model by exposing more properties on
AnimationEffectTiming to control delay (delay, endDelay), looping (iterationStart, iterations), fill and direction.
Additionally, we expose the getComputedTiming() method on AnimationEffect, although it currently lacks some computed
properties that will come in later patch as we implement various processes defined by the spec. We also update the
existing duration() method on AnimationEffectTiming to be called iterationDuration() to match the terms used in the
specification.
Finally, we make all new properties, and update existing ones, that expose a time value go through the new utility
function secondsToWebAnimationsAPITime() to guarantee rounded values with microseconds precision, as advised by
the Web Animations specification.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h:
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::setIterationStart):
(WebCore::AnimationEffectTiming::setIterations):
(WebCore::AnimationEffectTiming::bindingsDuration const):
(WebCore::AnimationEffectTiming::setBindingsDuration):
(WebCore::AnimationEffectTiming::endTime const):
(WebCore::AnimationEffectTiming::activeDuration const):
* animation/AnimationEffectTiming.h:
* animation/AnimationEffectTiming.idl:
* animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
(WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::bindingsCurrentTime):
* animation/ComputedTimingProperties.h: Added.
* animation/ComputedTimingProperties.idl: Added. We set nullable double values to a default value of "null" since
otherwise setting those properties to a null value would not set the properties in the converted JS dictionary.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Handle new timing properties passed in the KeyframeEffectOptions dictionary.
(WebCore::KeyframeEffect::applyAtLocalTime):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::startOrStopAccelerated):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::bindingsCurrentTime const):
(WebCore::WebAnimation::effectEndTime const):
(WebCore::WebAnimation::timeToNextRequiredTick const):
* animation/WebAnimationUtilities.h: Added.
(WebCore::secondsToWebAnimationsAPITime):
2018-01-19 Alex Christensen <achristensen@webkit.org>
Remove dead networking code
https://bugs.webkit.org/show_bug.cgi?id=181813
Reviewed by Tim Horton.
CFURLConnection is only used on Windows.
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData const):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):
2018-01-19 Alex Christensen <achristensen@webkit.org>
Remove unused WebViewPrivate _allowCookies
https://bugs.webkit.org/show_bug.cgi?id=181812
Reviewed by Tim Horton.
This SPI was in the original iOS upstreaming and has not been used in many years.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setDefaultAllowCookies): Deleted.
(WebCore::ResourceRequestBase::defaultAllowCookies): Deleted.
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::ResourceRequestBase):
2018-01-18 Brady Eidson <beidson@apple.com>
Make in-process MessagePorts be (mostly) asynchronous
https://bugs.webkit.org/show_bug.cgi?id=181454
Reviewed by Alex Christensen.
No new tests (Covered *brutally* by existing tests)
Part of making MessagePorts be a thing we can pass across processes is making them work async.
The existing "MessagePortChannel" method of abstraction was not cut out for this.
This patch gets rid of MessagePortChannel and adds a new MessagePortChannelProvider abstraction.
It then gets the new machinery working in-process (with some pieces of out-of-process in place)
One synchronous behavior this patch maintains is the hasPendingActivity() check used to support GC.
That will (creatively) be made async in the next followup.
More generally from MessagePorts, this patch also adds a "MessageWithMessagePorts" object to be used
with all forms of postMessage(). Much better.
* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/InProcessMessagePortChannel.cpp: Removed.
* dom/InProcessMessagePortChannel.h: Removed.
* dom/MessagePortChannel.cpp: Removed.
* dom/MessagePortChannel.h: Removed.
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::create):
(WebCore::MessageChannel::MessageChannel):
(WebCore::m_port2): Deleted.
* dom/MessageChannel.h:
(WebCore::MessageChannel::create): Deleted.
* dom/MessagePort.cpp:
(WebCore::MessagePort::create):
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::messageAvailable):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::locallyEntangledPort const):
(WebCore::MessagePort::disentanglePorts):
(WebCore::MessagePort::entanglePorts):
(WebCore::MessagePort::entangleWithRemote): Deleted.
* dom/MessagePort.h:
* dom/MessagePortIdentifier.h:
(WebCore::MessagePortIdentifier::logString const):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessageWithMessagePortsSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon): Deleted.
* dom/ScriptExecutionContext.h:
Add a single object that represents two intertwined ports, tracks their pending
messages, tracks which process they're in, etc etc:
* dom/messageports/MessagePortChannel.cpp: Added.
(WebCore::MessagePortChannel::create):
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::~MessagePortChannel):
(WebCore::MessagePortChannel::includesPort):
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::closePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
* dom/messageports/MessagePortChannel.h: Added.
(WebCore::MessagePortChannel::port1 const):
(WebCore::MessagePortChannel::port2 const):
(WebCore::MessagePortChannel::logString const):
Abstraction for creating and operating on MessagePorts in a potentially cross-process way:
* dom/messageports/MessagePortChannelProvider.cpp: Added.
(WebCore::MessagePortChannelProvider::singleton):
(WebCore::MessagePortChannelProvider::setSharedProvider):
* dom/messageports/MessagePortChannelProvider.h: Added.
(WebCore::MessagePortChannelProvider::~MessagePortChannelProvider):
Adds a concrete implementation of that provider to be used in-process (e.g. WK1):
* dom/messageports/MessagePortChannelProviderImpl.cpp: Added.
(WebCore::MessagePortChannelProviderImpl::~MessagePortChannelProviderImpl):
(WebCore::MessagePortChannelProviderImpl::performActionOnAppropriateThread):
(WebCore::MessagePortChannelProviderImpl::createNewMessagePortChannel):
(WebCore::MessagePortChannelProviderImpl::entangleLocalPortInThisProcessToRemote):
(WebCore::MessagePortChannelProviderImpl::messagePortDisentangled):
(WebCore::MessagePortChannelProviderImpl::messagePortClosed):
(WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
(WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
(WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync):
* dom/messageports/MessagePortChannelProviderImpl.h: Added.
Adds a main thread object to handle the set of all MessagePortChannels that are open.
For now it lives in the WebProcess, but for out-of-process it will live in the UIProcess:
* dom/messageports/MessagePortChannelRegistry.cpp: Added.
(WebCore::MessagePortChannelRegistry::~MessagePortChannelRegistry):
(WebCore::MessagePortChannelRegistry::didCreateMessagePortChannel):
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
(WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
(WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
(WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
(WebCore::MessagePortChannelRegistry::didCloseMessagePort):
(WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): This is named against style
and weird on purpose - to call attention to how bad it is and how it's temporary.
(WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
* dom/messageports/MessagePortChannelRegistry.h: Added.
Add an object that represents a "SerializedScriptValue for the message payload and the ports
that are being transferred along with that payload". This is used in all forms of postMessage():
* dom/messageports/MessageWithMessagePorts.cpp: Added.
* dom/messageports/MessageWithMessagePorts.h: Added.
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer):
(WebCore::PostMessageTimer::event):
(WebCore::DOMWindow::postMessage):
* platform/Logging.h:
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerObjectProxy.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::fireMessageEvent):
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.h:
2018-01-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed build fix, removed unused lambda capture.
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
2018-01-18 Chris Dumez <cdumez@apple.com>
We should be able to terminate service workers that are unresponsive
https://bugs.webkit.org/show_bug.cgi?id=181563
<rdar://problem/35280031>
Reviewed by Alex Christensen.
Test: http/tests/workers/service/postmessage-after-terminating-hung-worker.html
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
Before calling WorkerThread::stop(), set a timer with the given timeout parameter.
If the worker thread has not stopped when the timer fires, forcefully exit the
service worker process. The StorageProcess will take care of relaunching the
service worker process if it exits abruptly.
(WebCore::SWContextManager::serviceWorkerFailedToTerminate):
Log error message if we failed to terminate a service worker and call exit().
(WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
* workers/service/context/SWContextManager.h:
2018-01-18 Youenn Fablet <youenn@apple.com>
Do not go to the storage process when loading a main resource if there is no service worker registered
https://bugs.webkit.org/show_bug.cgi?id=181395
Reviewed by Chris Dumez.
No observable behavior change.
Instead of creating a connection to know whether there is a potential service worker,
Ask the service worker provider that will use the connection if needed.
Otherwise, it will use a default value provided by the UIProcess.
Tested by cleaning all service workers and checking the computed value of the default value,
then observing whether pages registering service workers work well.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
* workers/service/ServiceWorkerProvider.h:
2018-01-18 Dan Bernstein <mitz@apple.com>
[Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
https://bugs.webkit.org/show_bug.cgi?id=181803
Reviewed by Tim Horton.
* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
useful for defining settings that depend on the target macOS version.
2018-01-18 Chris Dumez <cdumez@apple.com>
Service Workers restored from persistent storage have 'redundant' state
https://bugs.webkit.org/show_bug.cgi?id=181749
<rdar://problem/36556486>
Reviewed by Youenn Fablet.
Tested by new API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::installContextData):
Make sure the SWServerWorker's state is set to "activated" after it is assigned to
the registrations' active slot. Otherwise, it stays in its default state (redundant).
2018-01-18 Antti Koivisto <antti@apple.com>
REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
https://bugs.webkit.org/show_bug.cgi?id=181460
<rdar://problem/36379776>
Reviewed by Ryosuke Niwa.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
Don't do the expensive security origin test if the supplied sheet base URL is null. This
is true for rules coming from the same document.
2018-01-18 Antti Koivisto <antti@apple.com>
REGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
https://bugs.webkit.org/show_bug.cgi?id=181795
<rdar://problem/36334524>
Reviewed by David Kilzer.
<noscript> disallows renderer generation outside CSS mechanisms, however we would still construct
PseudoElements for them during style resolution. These were never removed properly because the
pseudo element removal was tied to render tree teardown. Without proper removal the associated
animations were also not canceled.
Test: fast/css-generated-content/noscript-pseudo-anim-crash.html
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
Take care to get rid of PseudoElements when the element is removed from the tree.
This also cancels any associated animations.
2018-01-18 Chris Fleizach <cfleizach@apple.com>
AX: Aria-activedescendant not supported
https://bugs.webkit.org/show_bug.cgi?id=161734
<rdar://problem/28202679>
Reviewed by Joanmarie Diggs.
When a combo-box owns/controls a list/listbox/grid/tree, the owned element needs to check the active-descendant of the combobox when
checking if it has selected children.
The target of the selection change notification should also be the owned element in these cases.
Test: accessibility/aria-combobox-controlling-list.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectedListItem):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
2018-01-17 Per Arne Vollan <pvollan@apple.com>
REGRESSION (r224780): Text stroke not applied to video captions.
https://bugs.webkit.org/show_bug.cgi?id=181743
<rdar://problem/35874338>
Reviewed by Simon Fraser.
Tests: media/track/track-css-visible-stroke-expected.html
media/track/track-css-visible-stroke.html
After r224780, it is no longer possible to mix text stroke styles with webkit
legacy text stroke styles.
* css/StyleResolver.cpp:
(WebCore::isValidCueStyleProperty):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):
2018-01-18 Andy Estes <aestes@apple.com>
[Payment Request] Support a default shipping address for Apple Pay
https://bugs.webkit.org/show_bug.cgi?id=181754
<rdar://problem/36009733>
Reviewed by Brady Eidson.
Move shippingContact from ApplePayPaymentRequest to ApplePayRequestBase. This allows
merchants to specify a default shipping address when using Apple Pay with Payment Request.
This also fixes a bug found during testing where
+[NSPersonNameComponentsFormatter localizedStringFromPersonNameComponents:style:options:]
would throw an exception when passed a nil NSPersonNameComponents.
Test: http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html
* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::version const):
(WebCore::ApplePaySessionPaymentRequest::setVersion):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
* testing/MockPaymentCoordinator.h:
2018-01-18 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Specify -[NSURL _title] for the associated URL when copying an image element
https://bugs.webkit.org/show_bug.cgi?id=181783
<rdar://problem/35785445>
Reviewed by Ryosuke Niwa.
Always specify the -[NSURL _title] to be either the title specified in a PasteboardImage's inner PasteboardURL,
or if no title is specified, fall back to the user-visible URL string. This is because at least one internal
client always tries to use the -_title property to determine the title of a pasted URL, or if none is specified,
the -suggestedName. Since we need to set suggestedName to the preferred file name of the copied image and we
don't want the suggested name to become the title of the link, we need to explicitly set the link title.
In doing so, this patch also fixes a bug wherein we forget to set the _title of the NSURL we're registering to
an NSItemProvider.
Tests: ActionSheetTests.CopyImageElementWithHREFAndTitle (new)
ActionSheetTests.CopyImageElementWithHREF (modified)
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
2018-01-17 Jer Noble <jer.noble@apple.com>
WebVTT served via HLS never results in cues
https://bugs.webkit.org/show_bug.cgi?id=181773
Reviewed by Eric Carlson.
Test: http/tests/media/hls/hls-webvtt-tracks.html
Three independant errors conspired to keep in-band WebVTT samples from parsing:
- The definition of ISOWebVTTCue::boxTypeName() was incorrect.
- ISOWebVTTCue::parse() didn't call it's superclass's parse() method (leading to an incorrect size and offset).
- Use String::fromUTF8() rather than String.adopt(StringVector&&).
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::parse):
* platform/graphics/iso/ISOVTTCue.h:
(WebCore::ISOWebVTTCue::boxTypeName):
2018-01-17 John Wilander <wilander@apple.com>
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>
Reviewed by Alex Christensen.
Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
* platform/network/NetworkStorageSession.h:
Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
Fixes the FIXME.
2018-01-17 Dean Jackson <dino@apple.com>
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770
Reviewed by Eric Carlson.
Remove a very old linked-on-or-after test.
* platform/graphics/ca/GraphicsLayerCA.cpp:
2018-01-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r227098.
This broke the build.
Reverted changeset:
"Remove linked-on test for Snow Leopard"
https://bugs.webkit.org/show_bug.cgi?id=181770
https://trac.webkit.org/changeset/227098
2018-01-17 Dean Jackson <dino@apple.com>
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770
Reviewed by Eric Carlson.
Remove a very old linked-on-or-after test.
* platform/graphics/ca/GraphicsLayerCA.cpp:
2018-01-17 Stephan Szabo <stephan.szabo@sony.com>
[Curl] Use ResourceRequest::encodeWithPlatformData()
https://bugs.webkit.org/show_bug.cgi?id=181768
Reviewed by Alex Christensen.
No new tests, assertion hit in downstream port, should be covered by
existing tests.
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData const):
(WebCore::ResourceRequest::decodeWithPlatformData):
2018-01-17 Eric Carlson <eric.carlson@apple.com>
Use existing RGB colorspace instead of creating a new one
https://bugs.webkit.org/show_bug.cgi?id=181765
<rdar://problem/36595753>
Reviewed by Dean Jackson.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Use sRGBColorSpaceRef instead
of creating a new static colorspace.
2018-01-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r227076.
This breaks internal builds
Reverted changeset:
"Resource Load Statistics: Block cookies for prevalent
resources without user interaction"
https://bugs.webkit.org/show_bug.cgi?id=177394
https://trac.webkit.org/changeset/227076
2018-01-17 Ryosuke Niwa <rniwa@webkit.org>
input and textarea elements should reveal selection in setSelection when focused
https://bugs.webkit.org/show_bug.cgi?id=181715
<rdar://problem/36570546>
Reviewed by Zalan Bujtas.
Made input and textarea elements reveal selection in FrameSelection::setSelection instead of by directly
invoking FrameSelection::revealSelection in their respective updateFocusAppearance to unify code paths.
Also added options to reveal selection up to the main frame to SetSelectionOption to be used in iOS.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::moveWithoutValidationTo): Takes SelectionRevealMode as an argument and converts
sets appropriate selection options.
(WebCore::FrameSelection::setSelection): Reconstruct SelectionRevealMode out of selection option sets.
(WebCore::FrameSelection::updateAndRevealSelection):
* editing/FrameSelection.h:
(WebCore::FrameSelection): Added RevealSelectionUpToMainFrame as a SelectionRevealMode and replaced
m_shouldRevealSelection by m_selectionRevealMode.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance): Pass SelectionRevealMode to HTMLTextFormControlElement's
select and restoreCachedSelection instead of directly invoking FrameSelection::revealSelection.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updateFocusAppearance): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::restoreCachedSelection):
* html/HTMLTextFormControlElement.h:
2018-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
WEBKIT_FRAMEWORK should not modify file-global include directories
https://bugs.webkit.org/show_bug.cgi?id=181656
Reviewed by Konstantin Tokarev.
* CMakeLists.txt:
* PlatformWPE.cmake:
2018-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Try even harder not to static link WTF into libwebkit2gtk
https://bugs.webkit.org/show_bug.cgi?id=181751
Reviewed by Alex Christensen.
We don't want two copies of WTF. It should only be in libjavascriptcoregtk.
* PlatformGTK.cmake:
2018-01-17 Zalan Bujtas <zalan@apple.com>
Multicol: RenderMultiColumnFlow should not inherit the flow state
https://bugs.webkit.org/show_bug.cgi?id=181762
<rdar://problem/35448565>
Reviewed by Simon Fraser.
Do not compute the inherited flow state flag for RenderMultiColumnFlow.
It is (by definition) always inside a fragmented flow.
Test: fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFragmentedFlowState):
2018-01-17 Alex Christensen <achristensen@webkit.org>
Deprecate Application Cache
https://bugs.webkit.org/show_bug.cgi?id=181764
Reviewed by Geoffrey Garen.
* features.json:
2018-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage is failing
https://bugs.webkit.org/show_bug.cgi?id=181758
Reviewed by Tim Horton.
This test is failing because Editor::clientReplacementURLForResource expects a MIME type, but on iOS, the type
paramter passed into WebContentReader::readImage is a UTI; subsequently, the bundle editing delegate receives
a MIME type that's actually a UTI, which is incorrect. To address this, ensure that a MIME type is passed to
bundle SPI by converting the type in WebContentReader::readImage to a MIME type.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readImage):
2018-01-17 Antti Koivisto <antti@apple.com>
REGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator::evaluate const + 32
https://bugs.webkit.org/show_bug.cgi?id=181742
<rdar://problem/36334726>
Reviewed by David Kilzer.
Test: fast/media/mediaqueryevaluator-crash.html
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
Use WeakPtr<Document> instead of a plain Frame pointer.
(WebCore::MediaQueryEvaluator::evaluate const):
Get the frame via document.
* css/MediaQueryEvaluator.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
Take care to clear style resolver.
2018-01-17 Youenn Fablet <youenn@apple.com>
Put fetch request keepAlive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592
Reviewed by Chris Dumez.
No change of behavior.
* Modules/fetch/FetchRequest.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fetchAPIKeepAliveEnabled const):
(WebCore::RuntimeEnabledFeatures::setFetchAPIKeepAliveEnabled):
2018-01-17 Per Arne Vollan <pvollan@apple.com>
[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
https://bugs.webkit.org/show_bug.cgi?id=181686
Reviewed by Alex Christensen.
No new tests, covered by existing tests.
A switch will make the function easier on the eyes. Also, use the function in places where the ResourceRequestCachePolicy
is just casted to a platform cache policy.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy):
2018-01-17 John Wilander <wilander@apple.com>
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>
Reviewed by Alex Christensen.
Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
* platform/network/NetworkStorageSession.h:
Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
Fixes the FIXME.
2018-01-17 Daniel Bates <dabates@apple.com>
REGRESSION (r222795): Cardiogram never signs in
https://bugs.webkit.org/show_bug.cgi?id=181693
<rdar://problem/36286293>
Reviewed by Ryosuke Niwa.
Exempt Cardiogram from the XHR header restrictions in r222795.
Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Cardiogram also depends on such functionality.
Test: fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html
* page/Settings.yaml:
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isCardiogram):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):
2018-01-17 Daniel Bates <dabates@apple.com>
ASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
https://bugs.webkit.org/show_bug.cgi?id=181746
<rdar://problem/36586248>
Reviewed by Chris Dumez.
Call PingHandle::pingLoadComplete() with an error when NSURLConnection queries
whether the ping is able to respond to an authentication request. (Pings do not
respond to authenticate requests.) It will call the completion handler, nullify
the completion handler, and deallocate the PingHandle. Nullifying the completion
handler is necessary to avoid the assertion failure in ~PingHandle().
Test: http/tests/misc/before-unload-load-image.html
* platform/network/PingHandle.h:
2018-01-17 Daniel Bates <dabates@apple.com>
WebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWithOperationQueue may
be deleted in main thread callback
https://bugs.webkit.org/show_bug.cgi?id=181747
<rdar://problem/36588120>
Reviewed by Alex Christensen.
Retain the delegate (e.g. WebCoreResourceHandleAsOperationQueueDelegate) before scheduling
a main thread callback and blocking on a semaphore for its reply because the main thread
callback can do anything, including deleting the delegate, before the non-main thread
has a chance to execute. For instance, a PingHandle will delete itself (and hence delete
its resource handle delegate) in most of the code paths invoked by the delegate.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
2018-01-17 Chris Dumez <cdumez@apple.com>
'fetch' event may be sent to a service worker before its state is set to 'activated'
https://bugs.webkit.org/show_bug.cgi?id=181698
<rdar://problem/36554856>
Reviewed by Youenn Fablet.
'fetch' event may be sent to a service worker before its state is set to 'activated'.
When the registration's active worker needs to intercept a load, and its state is 'activating',
we queue the request to send the fetch event in SWServerWorker::m_whenActivatedHandlers.
Once the SWServerWorker::setState() is called with 'activated' state, we then call the
handlers in m_whenActivatedHandlers to make send the fetch event now that the worker is
activated. The issue is that even though the worker is activated and its state was set to
'activated' on Storage process side, we had not yet notified the ServiceWorker process
of the service worker's new state yet.
To address the issue, we now make sure that SWServerWorker::m_whenActivatedHandlers are
called *after* we've sent the IPC to the ServiceWorker process to update the worker's
state to 'activated'. Also, we now call ServiceWorkerFetch::dispatchFetchEvent()
asynchronously in a postTask() as the service worker's state is also updated asynchronously
in a postTask. This is as per specification [1], which says to "queue a task" to fire
the fetch event.
[1] https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
No new tests, covered by imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
which hits the new assertion without the fix.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
Add assertions to make sure that we dispatch the fetch event on the right worker and
that the worker is in 'activated' state.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postFetchTask):
Queue a task to fire the fetch event as per:
- https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
We need to match the specification exactly here or things will happen in the wrong
order. In particular, things like "update registration state" and "update worker state"
might happen *after* firing the fetch event, even though the IPC for "update registration/worker
state" was sent before the "fire fetch event" one, because the code for updating a registration/
worker state already queues a task, as per the specification.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateWorkerState):
* workers/service/server/SWServerRegistration.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
Move code to send the IPC to the Service Worker process whenever the service worker's state
needs to be updated from SWServerRegistration::updateWorkerState() to SWServerWorker::setState().
This way, we can make sure the IPC is sent *before* we call the m_whenActivatedHandlers handlers,
as they may also send IPC to the Service Worker process, and we need to make sure this IPC happens
after so that the service worker is in the right state.
2018-01-17 Stephan Szabo <stephan.szabo@sony.com>
Page.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE(VIDEO) is off
https://bugs.webkit.org/show_bug.cgi?id=181713
Reviewed by Darin Adler.
No new tests (build fix).
* page/Page.cpp: Add include for ApplicationStateChangeListener
2018-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
https://bugs.webkit.org/show_bug.cgi?id=181637
<rdar://problem/36508471>
Reviewed by Tim Horton.
Before carrying out blob URL conversion for pasted or dropped rich content, let the editor client replace
subresource URLs in WebKit2 by calling out to new injected bundle SPI. See comments below for more detail.
Tests: WKAttachmentTests.InjectedBundleReplaceURLsWhenPastingAttributedString
WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage
* editing/Editor.cpp:
(WebCore::Editor::clientReplacementURLForResource):
* editing/Editor.h:
Add a new helper to call out to the editor client for a URL string to replace a given ArchiveResource. In
WebKit2, this calls out to the injected bundle's new `replacementURLForResource` SPI hook.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldReplaceSubresourceURL):
(WebCore::replaceRichContentWithAttachments):
(WebCore::replaceSubresourceURLsWithURLsFromClient):
Add a new static helper to replace subresource URLs in the given DocumentFragment with URLs supplied by the
editor client. Additionally builds a list of ArchiveResources that have not been replaced, for use at call sites
so that we don't unnecessarily create more Blobs for ArchiveResources that have already been replaced.
(WebCore::createFragmentAndAddResources):
(WebCore::sanitizeMarkupWithArchive):
Tweak web content reading codepaths to first replace subresource URLs with editor-client-supplied URLs.
(WebCore::WebContentReader::readImage):
(WebCore::shouldConvertToBlob): Deleted.
Rename this helper to shouldReplaceSubresourceURL, blob URL replacement is no longer the only scenario in which
we replace resource URLs, but in both cases, we still want to ignore `http:`-family and `data:` URLs.
* loader/EmptyClients.cpp:
* page/EditorClient.h:
2018-01-17 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey decryptor
https://bugs.webkit.org/show_bug.cgi?id=180080
Reviewed by Xabier Rodriguez-Calvar.
Currently the GStreamer clearKey decryptor doesn't support the full-sample encryption,
where the buffer is entirely encrypted, it supports only the sub-sample encryption.
Test: media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt):
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
Unreviewed follow-up to r227051.
* platform/graphics/cairo/CairoOperations.h: Fix declaration of the
fillRoundedRect() function by removing the bool parameter that's not
used at all in the definition. This went unspotted due to the unified
source build including the implementation file before fillRoundedRect()
usage in GrapihcsContextCairo.cpp, leaving the declaration undefined
and instead using the definition directly.
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
https://bugs.webkit.org/show_bug.cgi?id=181725
Reviewed by Carlos Garcia Campos.
Don't duplicate global alpha and image interpolation quality state
values on the PlatformContextCairo. Instead, retrieve them from
the managing GraphicsContextState when necessary.
For Cairo operations, the FillSource and StrokeSource containers now
store the global alpha value, using it during the operation executions.
For drawNativeImage(), the global alpha and interpolation quality values
are passed through arguments.
In PlatformContextCairo, the two values are no longer stored on the
internally-managed stack, and the getter-setter pairs for the two values
are removed. In drawSurfaceToContext(), the two values are now expected
to be passed through the method arguments.
No new tests -- no change in behavior.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setGlobalAlpha): Deleted.
(WebCore::Cairo::State::setImageInterpolationQuality): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::setPlatformAlpha):
(WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::save):
(WebCore::PlatformContextCairo::drawSurfaceToContext):
(WebCore::PlatformContextCairo::State::State): Deleted.
(WebCore::PlatformContextCairo::setImageInterpolationQuality): Deleted.
(WebCore::PlatformContextCairo::imageInterpolationQuality const): Deleted.
(WebCore::PlatformContextCairo::globalAlpha const): Deleted.
(WebCore::PlatformContextCairo::setGlobalAlpha): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-01-17 Philippe Normand <pnormand@igalia.com>
REGRESSION(r226973/r226974): Four multimedia tests failing
https://bugs.webkit.org/show_bug.cgi?id=181696
Reviewed by Carlos Garcia Campos.
This patch reverts some of the changes of the above revisions so as to fix layout test failures.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Properly
prepare stalled event when an error was detected.
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Revert to previous version.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
Emit progress event also when streaming but not when an error was
detected.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const): use isLiveStream like everywhere else.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Revert to keep-alive FALSE by default.
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Move prepareForFilling(), prepareForStroking() code to CairoOperations
https://bugs.webkit.org/show_bug.cgi?id=181721
Reviewed by Carlos Garcia Campos.
Move the prepareForFilling() and prepareForStroking() code off of the
PlatformContextCairo class and into static functions inside the
CairoOperations implementation files. The original methods weren't
called from any place other than the Cairo operations, and they only
operated with the cairo_t object that's stored in and retrievable from
the PlatformContextCairo object.
No new tests -- no change in behavior.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::reduceSourceByAlpha):
(WebCore::Cairo::prepareCairoContextSource):
(WebCore::Cairo::clipForPatternFilling):
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::reduceSourceByAlpha): Deleted.
(WebCore::prepareCairoContextSource): Deleted.
(WebCore::PlatformContextCairo::prepareForFilling): Deleted.
(WebCore::PlatformContextCairo::prepareForStroking): Deleted.
(WebCore::PlatformContextCairo::clipForPatternFilling): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use one-time ShadowBlur objects when performing shadowing
https://bugs.webkit.org/show_bug.cgi?id=181720
Reviewed by Carlos Garcia Campos.
Don't maintain a ShadowBlur object in the PlatformContextCairo class.
Instead, use temporary ShadowBlur objects whenever shadowing is needed,
providing all the shadow state information to it and drawing shadow into
the given GraphicsContext object.
ShadowBlur constructors are cleaned up. The 'shadows ignored' argument
can now also be provided to the variant that accepts explicit shadow
attributes, but the argument is false by default.
In CairoOperations, the ShadowBlurUsage functionality is rolled into the
new ShadowState class. ShadowState parameter is now used for operations
that might need to perform shadow painting. Call sites are modified
accordingly.
Cairo::State::setShadowValues() and Cairo::State::clearShadow() are
removed, since the ShadowBlur object that was modified through those is
being removed from the PlatformContextCairo class. We still have to flip
the Y-axis of the shadow offset in GraphicsContext::setPlatformShadow()
when shadows are ignoring transformations.
No new tests -- no change in behavior.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::ShadowBlur):
* platform/graphics/ShadowBlur.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowState::ShadowState):
(WebCore::Cairo::ShadowState::isVisible const):
(WebCore::Cairo::ShadowState::isRequired const):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setShadowValues): Deleted.
(WebCore::Cairo::State::clearShadow): Deleted.
(WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage): Deleted.
(WebCore::Cairo::ShadowBlurUsage::required const): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::clearPlatformShadow):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):
* platform/graphics/cairo/PlatformContextCairo.h:
(WebCore::PlatformContextCairo::shadowBlur): Deleted.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
CanvasImageData: createImageData() parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=181670
Reviewed by Sam Weinig.
createImageData() method on the CanvasImageData interface should not
treat the ImageData parameter as nullable, but should instead reject any
null values with a TypeError, as demanded by the specification.
No new tests -- current tests covering createImageData(null) are updated
to properly cover new behavior of throwing a TypeError exception.
* html/canvas/CanvasImageData.idl:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createImageData const):
* html/canvas/CanvasRenderingContext2DBase.h:
2018-01-16 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] Remove WebCoreDerivedSources library target
https://bugs.webkit.org/show_bug.cgi?id=181664
Reviewed by Carlos Garcia Campos.
After unified source build has been introduced, CMake Visual
Studio build suffers complicated unnecessary recompilation issues
because Visual Studio invokes scripts twice in both WebCore and
WebCoreDerivedSources projects (Bug 181117).
WebCoreDerivedSources library has been introduced in r198766 to
avoid command line length limit of CMake Ninja build on macOS.
Fortunately, unified source build has reduced the number of source
files to compile, WebCore doesn't need to be split anymore.
No new tests (No behavior change)
* CMakeLists.txt: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES. Removed WebCoreDerivedSources library target.
Do not compile each JavaScript Builtins.cpp files because the unified source WebCoreJSBuiltins.cpp is already included.
* PlatformGTK.cmake: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES.
* PlatformWin.cmake: Ditto.
2018-01-16 Simon Fraser <simon.fraser@apple.com>
Can't scroll iframe after toggling it to display:none and back
https://bugs.webkit.org/show_bug.cgi?id=181708
rdar://problem/13234778
Reviewed by Tim Horton.
Nothing updated the FrameView's set of scrollable areas when a subframe came back from display:none.
Mirror the existing virtual removeChild() by making addChild() virtual, and using it to mark
the FrameView's scrollable area set as dirty.
Test: tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html
* page/FrameView.cpp:
(WebCore::FrameView::addChild):
* page/FrameView.h:
* platform/ScrollView.h:
2018-01-16 Chris Dumez <cdumez@apple.com>
SWServerWorker::m_contextConnectionIdentifier may get out of date
https://bugs.webkit.org/show_bug.cgi?id=181687
<rdar://problem/36548111>
Reviewed by Brady Eidson.
SWServerWorker::m_contextConnectionIdentifier may get out of date. This happens when the
context process crashes and is relaunched.
No new tests, added assertion in terminateWorkerInternal() that hits without this fix.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::unregisterServiceWorkerClient):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::setContextConnectionIdentifier):
2018-01-16 Jer Noble <jer.noble@apple.com>
Reset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying SourceBufferPrivate is removed.
https://bugs.webkit.org/show_bug.cgi?id=181707
<rdar://problem/34809474>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-remove-unload-crash.html
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
2018-01-12 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement dummy WebAuthN IDLs
https://bugs.webkit.org/show_bug.cgi?id=181627
<rdar://problem/36459864>
Reviewed by Alex Christensen.
This patch implements dummy WebAuthN IDLs and connect them with Credential Management as well.
All implementations in this patch are subject to change when real implementations land. The
purpose here on the other hand is to have IDLs, bindings and implementations connected. This
patch should handle all IDLs that we need.
No tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
(WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse):
(WebCore::AuthenticatorAssertionResponse::authenticatorData):
(WebCore::AuthenticatorAssertionResponse::signature):
(WebCore::AuthenticatorAssertionResponse::userHandle):
* Modules/webauthn/AuthenticatorAssertionResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorAssertionResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
(WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::attestationObject):
* Modules/webauthn/AuthenticatorAttestationResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorAttestationResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
(WebCore::AuthenticatorResponse::AuthenticatorResponse):
(WebCore::AuthenticatorResponse::~AuthenticatorResponse):
(WebCore::AuthenticatorResponse::clientDataJSON):
* Modules/webauthn/AuthenticatorResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::rawId):
(WebCore::PublicKeyCredential::response):
(WebCore::PublicKeyCredential::getClientExtensionResults):
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl: Added.
* Modules/webauthn/PublicKeyCredentialDescriptor.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
* Modules/webauthn/PublicKeyCredentialDescriptor.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/PublicKeyCredentialType.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredentialType.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-01-16 Zalan Bujtas <zalan@apple.com>
AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
https://bugs.webkit.org/show_bug.cgi?id=181703
<rdar://problem/36365706>
Reviewed by Ryosuke Niwa.
Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
Unable to create test with WebInspector involved.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
(WebCore::isSafeToUpdateStyleOrLayout): Deleted.
* dom/Document.h:
2018-01-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r226962.
The LayoutTest added with this change is a flaky timeout.
Reverted changeset:
"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/226962
2018-01-16 Simon Fraser <simon.fraser@apple.com>
Text looks bad on some CSS spec pages
https://bugs.webkit.org/show_bug.cgi?id=181700
rdar://problem/36552107
Reviewed by Tim Horton.
When making new tiles in a TileController, we failed to set their "supports antialiased layer text"
setting, so tile caches could end up with a mixture of layers that do and do not support
antialiased layer text.
No tests because the tiled drawing tests don't dump out tiles inside of tile caches.
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::createTileLayer):
2018-01-16 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion
https://bugs.webkit.org/show_bug.cgi?id=179986
Reviewed by Simon Fraser.
This patch reverts all or parts of the following changes-sets
<http://trac.webkit.org/changeset/221292>
<http://trac.webkit.org/changeset/197967>
<http://trac.webkit.org/changeset/196670>
A JS statement like this:
var item = text.x.animVal.getItem(0);
Creates the following C++ objects:
SVGAnimatedListPropertyTearOff<SVGLengthListValues> for 'text.x'
SVGListPropertyTearOff<SVGLengthListValues> for 'text.x.animVal'
SVGPropertyTearOff<SVGLengthValue> for 'text.x.animVal.getItem(0)'
If 'item' changes, the attribute 'x' of the element '<text>' will change
as well. But this binding works only in one direction. If the attribute
'x' of the element '<text>' changes, e.g.:
text.setAttribute('x', '10,20,30');
This will detach 'item' from the element <text> and any further changes
in 'item' won't affect the attribute 'x' of element <text>.
The one direction binding can only work if this chain of tear-off objects
is kept connected. This is implemented by RefCounted back pointers from
SVGPropertyTearOff and SVGListPropertyTearOff to SVGAnimatedListPropertyTearOff.
The security crashes and the memory leaks are happening because of the
raw forward pointers:
-- SVGAnimatedListPropertyTearOff maintains raw pointers of type
SVGListPropertyTearOff for m_baseVal and m_animVal
-- The m_wrappers and m_animatedWrappers of SVGAnimatedListPropertyTearOff
are vectors of raw pointer Vector<SVGLength*>
To control the life cycle of the raw pointers, SVGListPropertyTearOff and
SVGPropertyTearOff call SVGAnimatedListPropertyTearOff::propertyWillBeDeleted()
to notify it they are going to be deleted. In propertyWillBeDeleted(), we
clear the pointers so they are not used after being freed. This mechanism
has been error-prone and we've never got it 100% right.
The solution we need to adopt with SVG tear-off objects is the following:
-- All the forward pointers should be weak pointers.
-- All the back pointers should be ref pointers.
This solution may not look intuitive but it solves the bugs and keeps the
one direction binding. The forward weak pointers allows the tear-off
objects to go aways if no reference from JS exists. The back ref pointers
maintains the chain of objects and guarantees the correct binding.
* svg/SVGPathSegList.h:
* svg/SVGTransformList.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::baseVal):
(WebCore::SVGAnimatedListPropertyTearOff::animVal):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedProperty.h:
(WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
(WebCore::SVGAnimatedProperty::propertyWillBeDeleted): Deleted.
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
(WebCore::SVGListProperty::createWeakPtr const):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::removeItemFromList):
(WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff): Deleted.
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::createWeakPtr const):
(WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
2018-01-16 Eric Carlson <eric.carlson@apple.com>
AVSampleBufferDisplayLayer should be flushed when application activates
https://bugs.webkit.org/show_bug.cgi?id=181623
<rdar://problem/36487738>
Reviewed by Darin Adler.
No new tests, I wasn't able to reproduce it in a test.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::addApplicationStateChangeListener): New.
(WebCore::Document::removeApplicationStateChangeListener): Ditto.
(WebCore::Document::forEachApplicationStateChangeListener): Ditto.
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument): Register for application state changes.
(WebCore::HTMLMediaElement::unregisterWithDocument): Unregister.
(WebCore::HTMLMediaElement::applicationWillResignActive): Pass through to the player.
(WebCore::HTMLMediaElement::applicationDidBecomeActive): Ditto.
* html/HTMLMediaElement.h:
* page/ApplicationStateChangeListener.h: Added.
(WebCore::ApplicationStateChangeListener::applicationWillResignActive):
(WebCore::ApplicationStateChangeListener::applicationDidBecomeActive):
* page/Page.cpp:
(WebCore::Page::forEachDocument):
(WebCore::Page::applicationWillResignActive):
(WebCore::Page::applicationDidEnterBackground):
(WebCore::Page::applicationWillEnterForeground):
(WebCore::Page::applicationDidBecomeActive):
* page/Page.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::applicationWillResignActive):
(WebCore::MediaPlayer::applicationDidBecomeActive):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::applicationWillResignActive):
(WebCore::MediaPlayerPrivateInterface::applicationDidBecomeActive):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Switch
to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Split out of enqueueVideoSample.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Move code that updates
the display later to enqueueCorrectedVideoSample. Rearrange logic to the image painter sample
buffer has the correct timestamp.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange): Switch to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): f the display
layer is in the "failed" state, flush the renderer and update the display mode.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Switch to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateReadyState) Ditto.:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes): Deleted.
2018-01-16 Michael Catanzaro <mcatanzaro@igalia.com>
PAL should link to JavaScriptCore rather than WTF
https://bugs.webkit.org/show_bug.cgi?id=181683
Reviewed by Konstantin Tokarev.
Do not link directly to JavaScriptCore. Get it via PAL.
* CMakeLists.txt:
2018-01-16 Zach Li <zachli@apple.com>
Add pop-up policy support in website policies.
https://bugs.webkit.org/show_bug.cgi?id=181544.
rdar://problem/30521400.
Reviewed by Alex Christensen.
* loader/DocumentLoader.h:
Introduce pop-up policy getter and setter. Initialize
the policy as Default.
(WebCore::DocumentLoader::popUpPolicy const):
(WebCore::DocumentLoader::setPopUpPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
Pop-up policy specified on a per-page basis holds
precedence over the global policy. If no pop-up policy
is specified during navigation, global policy is used.
2018-01-16 Jer Noble <jer.noble@apple.com>
Crash playing audio-only HLS stream via hls.js (MSE)
https://bugs.webkit.org/show_bug.cgi?id=181691
<rdar://problem/32967295>
Reviewed by Eric Carlson.
Add a weak-link check to the block called by -[AVSampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:usingBlock:].
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
2018-01-16 Simon Fraser <simon.fraser@apple.com>
Rename applyHorizontalScale/applyVerticalScale in SVG filters, and related cleanup
https://bugs.webkit.org/show_bug.cgi?id=181684
Reviewed by Alex Christensen.
Rename the confusing applyHorizontalScale/applyVerticalScale to scaledByFilterResolution(),
and have it take and return a FloatSize. Change callers to do math in terms of FloatSizes.
Add inflate(size) to each of the rect classes.
* platform/graphics/FloatRect.h:
(WebCore::FloatRect::inflate):
* platform/graphics/IntRect.h:
(WebCore::IntRect::inflate):
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::inflate):
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::determineAbsolutePaintRect):
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
(WebCore::FEGaussianBlur::calculateKernelSize):
(WebCore::FEGaussianBlur::determineAbsolutePaintRect):
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::determineAbsolutePaintRect):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::determineAbsolutePaintRect):
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::setSourceImage):
(WebCore::Filter::scaledByFilterResolution const):
(WebCore::Filter::applyHorizontalScale const): Deleted.
(WebCore::Filter::applyVerticalScale const): Deleted.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::outsetSizeForBlur):
* rendering/FilterEffectRenderer.h:
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::scaledByFilterResolution const):
(WebCore::SVGFilter::applyHorizontalScale const): Deleted.
(WebCore::SVGFilter::applyVerticalScale const): Deleted.
* svg/graphics/filters/SVGFilter.h:
2018-01-16 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake][Mac] Fix the build errors
https://bugs.webkit.org/show_bug.cgi?id=181665
Reviewed by Alex Christensen.
No new tests (No behavior change)
* CMakeLists.txt: Added Modules/paymentrequest/MerchantValidationEvent.idl to compile.
* PlatformMac.cmake: Added Modules/paymentrequest/MerchantValidationEvent.cpp to compile.
Added workers/service/context and Modules/applicationmanifest as forwarding header paths.
2018-01-16 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
https://bugs.webkit.org/show_bug.cgi?id=181638
<rdar://problem/36508702>
Reviewed by Dan Bernstein.
Adjust the `didInsertAttachment` codepath to additionally propagate the attachment element's `src`.
Additionally, fix an issue with insertion and removal client notifications wherein the client can receive
insertion calls without corresponding removal calls, or vice versa. This is an existing issue, but matters more
now because we actually need to access the attachment element for its `src` when propagating changes to the
client. See below for details.
Test: WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup
* dom/Document.h:
(WebCore::Document::attachmentElementsByIdentifier const):
* editing/Editor.cpp:
(WebCore::Editor::notifyClientOfAttachmentUpdates):
* page/EditorClient.h:
(WebCore::EditorClient::didInsertAttachment):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
When a Frame's document changes, inform the client that the attachments in the previous document are going away.
For each attachment currently connected to the document, we have either (1) already informed the client that it
was inserted, or (2) the attachment is pending an insertion call to the client. If (1) is the case, then we'll
tell the client that the attachment is removed, which will balance out the earlier insertion call. If (2) is the
case, then we'll remove the previously inserted attachment identifier from the set of attachment identifiers
pending insertion, and the client won't be informed of insertions or removals.
2018-01-16 Antoine Quint <graouts@apple.com>
Use traits for animation timing functions
https://bugs.webkit.org/show_bug.cgi?id=181651
Reviewed by Dean Jackson.
Cleaning up Dean's previous patch as suggested by Darin's post-commit review comments. The
downcast function can match const automatically and it's a better style to put the * inside
the downcast call rather than outside.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::toCAMediaTimingFunction):
2018-01-16 Philippe Normand <pnormand@igalia.com>
[GStreamer] Live streaming cleanups
https://bugs.webkit.org/show_bug.cgi?id=181672
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Switch to
streaming code path when no content-length was reported by the
http source element.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const): Return early when streaming.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::responseReceived): Emit headers as
an element message, like souphttpsrc.
2018-01-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] misc fixes and cleanups
https://bugs.webkit.org/show_bug.cgi?id=181647
Reviewed by Michael Catanzaro.
* platform/graphics/MediaPlayer.cpp:
(WebCore::convertEnumerationToString): New utility function to convert preload enum to string.
* platform/graphics/MediaPlayerEnums.h: Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Debug tweak
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Ditto
(WebCore::MediaPlayerPrivateGStreamer::play): Ditto
(WebCore::MediaPlayerPrivateGStreamer::paused const): Ditto
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Prevent useless state update.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Debug tweak.
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Remove useless handlesSyncMessage method.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Prevent useless state update.
(WebCore::MediaPlayerPrivateGStreamerBase::muted const): Debug tweak.
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Ditto.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Enable keepAlive by default like in souphttpsrc.
(webKitWebSrcStart): Debug tweak.
(webKitWebSrcQueryWithParent): Ditto.
(webKitWebSrcNeedData): Ditto.
(CachedResourceStreamingClient::responseReceived): Change appsrc
stream-type when we wan't seek. Also update caps like souphttpsrc
does.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Add forward declaration of MediaPlayer.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append): Fix compilation warning.
2018-01-16 Yacine Bandou <yacine.bandou_ext@softathome.com>
[WPE] Two clearkey tests failing since r226621
https://bugs.webkit.org/show_bug.cgi?id=181532
Reviewed by Xabier Rodriguez-Calvar.
Whith a fake initData, we can have a pssh size nul, thus we should check it.
We saw this issue in the subtest "initData longer than 64Kb characters" in
the clearkey-generate-request-disallowed-input layout test.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::extractKeyidsLocationFromCencInitData):
2018-01-15 Yoav Weiss <yoav@yoav.ws>
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657
Reviewed by Darin Adler.
Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.
Test: http/tests/preconnect/link-header-rel-preconnect-http.php
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnect.
(WebCore::LinkLoader::preconnect): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::preload): Renamed `preloadIfNeeded` to `preload`.
(WebCore::LinkLoader::loadLink): Call preconnect.
* loader/LinkLoader.h:
2018-01-15 Michael Catanzaro <mcatanzaro@igalia.com>
Improve use of ExportMacros
https://bugs.webkit.org/show_bug.cgi?id=181652
Reviewed by Konstantin Tokarev.
Remove a comment.
* platform/PlatformExportMacros.h:
2018-01-15 Konstantin Tokarev <annulen@yandex.ru>
image-rendering should affect scaling of border-image
https://bugs.webkit.org/show_bug.cgi?id=169440
Reviewed by Michael Catanzaro.
Test: fast/borders/border-image-pixelated.html
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::paint):
2018-01-15 Tomas Popela <tpopela@redhat.com>
2.19.3 ACCELERATED_2D_CANVAS support is broken
https://bugs.webkit.org/show_bug.cgi?id=180799
Reviewed by Michael Catanzaro.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::didDraw):
2018-01-15 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Enable HTTP/2
https://bugs.webkit.org/show_bug.cgi?id=181551
Reviewed by Michael Catanzaro.
Start supporting HTTP/2 protocol. The first step is just enabling the HTTP/2 on Curl backend.
Next step will be to enable multiplexing feature.
No new tests because we don't have HTTP/2 test backend yet.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::isHttp2Enabled const):
(WebCore::CurlHandle::enableHttp):
(WebCore::CurlHandle::enableHttpGetRequest):
(WebCore::CurlHandle::enableHttpHeadRequest):
(WebCore::CurlHandle::enableHttpPostRequest):
(WebCore::CurlHandle::enableHttpPutRequest):
(WebCore::CurlHandle::setHttpCustomRequest):
* platform/network/curl/CurlContext.h:
2018-01-15 Dean Jackson <dino@apple.com>
Use a helper function for checked arithmetic in WebGL validation
https://bugs.webkit.org/show_bug.cgi?id=181620
<rdar://problem/36485879>
Reviewed by Eric Carlson.
Eric recommended using a templated helper function to do
a common arithmetic check in WebGL validation.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::validateDrawArrays):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
2018-01-15 Dean Jackson <dino@apple.com>
Use traits for animation timing functions
https://bugs.webkit.org/show_bug.cgi?id=181651
<rdar://problem/36525328>
Reviewed by Antoine Quint.
Use the type traits for TimingFunction classes, so
we can is<> and downcast<>.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationHasStepsTimingFunction):
(WebCore::animationHasFramesTimingFunction):
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::toCAMediaTimingFunction):
2018-01-15 Youenn Fablet <youenn@apple.com>
RealtimeMediaSource should be ThreadSafeRefCounted
https://bugs.webkit.org/show_bug.cgi?id=181649
Reviewed by Eric Carlson.
Difficult to write a test as this is really racy.
RealtimeIncomingVideoSourceCocoa::OnFrame is taking a reference on a background thread
to send a task to the main thread.
This requires it to be thread safe ref counted.
* platform/mediastream/RealtimeMediaSource.h:
2018-01-15 Philippe Normand <pnormand@igalia.com>
Prevent useless MediaPlayer mute state notifications
https://bugs.webkit.org/show_bug.cgi?id=181646
Reviewed by Carlos Garcia Campos.
On GTK port the mute change notification was triggering the test
runner to think the whole page mute state had changed and that
media elements were muted. The simplest solution is to propagate
the notification only if the state actually changed.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::muteChanged): Propagate mute notification
only if the mute state actually changed.
2018-01-15 Sebastian Dröge <sebastian@centricular.com>
[GStreamer] Don't wait for draw condition variable when shutting down.
https://bugs.webkit.org/show_bug.cgi?id=180978
Reviewed by Carlos Garcia Campos.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
By also waiting for the draw condition variable while shutting down,
it is possible that the GStreamer video sink is waiting for the main
thread to actually render the current frame, while at the same time
the main thread is waiting for the GStreamer video sink to shut down,
resulting in a deadlock.
2018-01-13 Minsheng Liu <lambda@liu.ms>
MathML Lengths should take zoom level into account
https://bugs.webkit.org/show_bug.cgi?id=180029
Reviewed by Frédéric Wang.
The patch applies the effective zoom factor to physical units in toUserUnits().
Test: mathml/presentation/mspace-units-with-zoom.html
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::toUserUnits):
2018-01-12 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181603
<rdar://problem/36476050>
Reviewed by Youenn Fablet.
No new tests, covered by existing tests that crash flakily.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::terminateWorkerInternal):
If the connection to the context process is gone, make sure we make the worker as terminated
so that it does not stay in Running state and in SWServer::m_runningOrTerminatingWorkers.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::~SWServerRegistration):
Add assertions to make sure none of the registration's workers are still running when
the registration is destroyed.
(WebCore::SWServerRegistration::updateRegistrationState):
Make sure registration workers that are overwritten are not still running.
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
If a worker's state is set to redundant, make sure we also terminate it.
2018-01-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226927.
https://bugs.webkit.org/show_bug.cgi?id=181621
Breaks 32-bit and iOS release for some reason that i don't
understand yet (Requested by dino on #webkit).
Reverted changeset:
"Use a helper function for checked arithmetic in WebGL
validation"
https://bugs.webkit.org/show_bug.cgi?id=181620
https://trac.webkit.org/changeset/226927
2018-01-12 Myles C. Maxfield <mmaxfield@apple.com>
Data URL fonts split in the middle of an alphabet cause random letters to disappear
https://bugs.webkit.org/show_bug.cgi?id=175845
<rdar://problem/33996578>
Reviewed by Brent Fulgham.
It is fairly common practice for a font foundry to split a font up into two files such that a semi-random
half of the alphabet is present in one of the files, and the other half is present in the other file. This
practice involves representing the files as data URLs, so as to minimize the time it takes to load them.
Because resource loading is asynchronous (even for data URLs), it is possible today to get a paint after
the first file is loaded but before the second file is loaded. Indeed, because of the way font fallback
works, we will never start loading the second file until a layout has occurred with the first font.
Because a site usually only uses this pattern for a handful of fonts, and I've never seen this pattern
being used for CJK fonts, it isn't very expensive to opportunistically decode these data URLs eagerly.
Using this method doesn't actually guarantee that the two fonts will load in between successive paints,
but it at least makes this much more likely. This patch implements this strategy, along with a size
threshold to make sure that we won't decode any super large data URLs when it isn't necessary.
Test: fast/text/font-load-data-partitioned-alphabet.html
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::opportunisticallyStartFontDataURLLoading):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::opportunisticallyStartFontDataURLLoading):
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::opportunisticallyStartFontDataURLLoading):
* css/CSSFontSelector.h:
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::opportunisticallyStartFontDataURLLoading):
(WebCore::FontCascadeFonts::glyphDataForVariant):
* platform/graphics/FontSelector.h:
2018-01-12 Alex Christensen <achristensen@webkit.org>
History state should be updated during client redirects with asynchronous policy decisions
https://bugs.webkit.org/show_bug.cgi?id=181358
<rdar://problem/35547689>
Reviewed by Andy Estes.
When decidePolicyForNavigationAction is responded to asynchronously during a client redirect,
HistoryController::updateForRedirectWithLockedBackForwardList does not update the history because
the document loader has not been marked as a client redirect because the FrameLoader only looks
at its provisional document loader to mark it as a client redirect. When decidePolicyForNavigationAction
is responded to asynchronously, though, the FrameLoader's provisional document loader has moved to
its policy document loader. To get both asynchronous and synchronous cases, let's just mark the document
loader as a client redirect whether it's the provisional or policy document loader.
Covered by a new API test.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadPostRequest):
2018-01-12 Dean Jackson <dino@apple.com>
Use a helper function for checked arithmetic in WebGL validation
https://bugs.webkit.org/show_bug.cgi?id=181620
<rdar://problem/36485879>
Reviewed by Eric Carlson.
Eric recommended using a templated helper function to do
a common arithmetic check in WebGL validation.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::validateDrawArrays):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
* html/canvas/WebGLRenderingContextBase.h:
2018-01-12 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] CTFontCopyDefaultCascadeListForLanguages() can return nullptr
https://bugs.webkit.org/show_bug.cgi?id=181615
<rdar://problem/36334637>
Reviewed by Jon Lee.
Speculative fix. We are getting crash reports saying that this call can return nullptr, and we
don't check for it.
No new tests because I couldn't find the specific input that causes it to return nullptr. (I
tried running this code with every 0, 1, and 2 length locale string, every weight value, and
every italic value, and couldn't get it to crash. I also inspected the code to figure out what
values would cause it to return nullptr, and I couldn't find anything other than if the system
has a totally busted font setup.)
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::computeCascadeList):
2018-01-11 Dean Jackson <dino@apple.com>
[WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
https://bugs.webkit.org/show_bug.cgi?id=181558
<rdar://problem/36189833>
Reviewed by Eric Carlson.
Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
our simulated vertexAttrib0 buffer might be too large. We need
to check for out-of-memory, but we can also detect some of the issues
earlier in our validation code. Additionally, make sure that we don't
accidentally cast an unsigned to a signed.
Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
code to look for overflow, rather than relying on looking for sign changes.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
use GC3Duint, since that's what the indicies are.
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
(WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
* html/canvas/WebGLRenderingContextBase.h:
2018-01-12 Wenson Hsieh <wenson_hsieh@apple.com>
Large in-place attachment elements cause the document width to expand when inserted
https://bugs.webkit.org/show_bug.cgi?id=181614
Reviewed by Dan Bernstein.
Make in-place images and videos have a max-width of 100%, so that large attachments aren't inserted with full
display size, causing the document and viewport width to expand.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
2018-01-12 Keith Rollin <krollin@apple.com>
Logged JSON should escape "'s and \'s in strings.
https://bugs.webkit.org/show_bug.cgi?id=181608
Reviewed by Brent Fulgham.
No new tests -- no new functionality, just changed logging. The
efficacy of the logging was verified by inspecting its output.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2018-01-12 Dean Jackson <dino@apple.com>
drawElements should be invalid if vertexAttrib0 doesn't have data
https://bugs.webkit.org/show_bug.cgi?id=181609
<rdar://problem/36392883>
Reviewed by Antoine Quint.
If a vertex attribute has been enabled, but no data provided, then
draw validation should fail.
Test: fast/canvas/webgl/drawElements-empty-vertex-data.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateVertexAttributes): If there were
never any data in the vertex buffer, then we incorrectly compared with 0.
2018-01-12 Youenn Fablet <youenn@apple.com>
FormDataElement::lengthInBytes should use ThreadableBlobRegistry
https://bugs.webkit.org/show_bug.cgi?id=181554
Reviewed by Chris Dumez.
Covered by updated test.
Fix blobRegistry() use and add support for creating a response that may trigger the issue.
* platform/network/FormData.cpp:
(WebCore::FormDataElement::lengthInBytes const): Was using directly blobRegistry() while ThreadableBlobRegistry is more appropriate
in case this is called from workers.
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchResponse.h:
* fileapi/Blob.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
2018-01-12 Jer Noble <jer.noble@apple.com>
Wrap CDMFairPlayStreaming and related classes in ENABLE(ENCRYPTED_MEDIA) checks
https://bugs.webkit.org/show_bug.cgi?id=181602
Reviewed by Maciej Stachowiak.
* platform/graphics/avfoundation/CDMFairPlayStreaming.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2018-01-12 Youenn Fablet <youenn@apple.com>
WebProcess should pass the registration identifier and not the worker identifier for fetch events
https://bugs.webkit.org/show_bug.cgi?id=181591
Reviewed by Chris Dumez.
Test: http/wpt/service-workers/update-service-worker.https.html
Store service worker registration identifier in ResourceLoaderOptions instead of service worker identifier.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::prepareFetch):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerRegistrationIdentifierIfNeeded):
(WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData):
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded): Deleted.
* loader/cache/CachedResourceRequest.h:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::activeWorkerFromRegistrationID):
* workers/service/server/SWServer.h:
2018-01-12 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][CMake] Remove all-in-one file for WebCore DerivedSources
https://bugs.webkit.org/show_bug.cgi?id=181582
Reviewed by Alex Christensen.
Those source files are compiled in unified source build nowadays.
No new tests (No behavior change)
* CMakeLists.txt: Removed calling PROCESS_ALLINONE_FILE.
* DerivedSources.cpp: Removed.
* WebCoreMacros.cmake: Removed a macro PROCESS_ALLINONE_FILE.
2018-01-12 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo][CMake] Use ${CURL_LIBRARY} instead of specifying the library name libcurl_imp explicitly
https://bugs.webkit.org/show_bug.cgi?id=181578
Reviewed by Alex Christensen.
vcpkg has libcurl.lib, not libcurl_imp.lib.
No new tests because no behavior change.
* PlatformWinCairo.cmake: Link ${CURL_LIBRARY} instead of libcurl_imp.
2018-01-12 Jer Noble <jer.noble@apple.com>
WebGL video texture black in Safari 11.0.2 and wrong colored in Safari Preview 11.1
https://bugs.webkit.org/show_bug.cgi?id=181445
<rdar://problem/36383183>
Reviewed by Dean Jackson.
Tests: added compile-time correctness tests for YCbCrMatrix values.
Perform the derivation from YCbCr coefficients into matrices in constexpr expressions
at compile-time. This allows us to also perform compile-time correctness checks to catch
regressions which may cause incorrect color conversions.
Since we now have general-purpose derivation of matrix values from coefficients,
adding missing specificed matrices is trivial, so add support for SMPTE 240M and BT.2020
matrices.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::GLfloatColor::GLfloatColor):
(WebCore::GLfloatColor::abs):
(WebCore::GLfloatColor::isApproximatelyEqualTo const):
(WebCore::YCbCrMatrix::operator Vector<GLfloat> const):
(WebCore::YCbCrMatrix::YCbCrMatrix):
(WebCore::YCbCrMatrix::operator* const):
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
2018-01-12 Antoine Quint <graouts@apple.com>
Add support for the frames() timing function
https://bugs.webkit.org/show_bug.cgi?id=181585
<rdar://problem/36463317>
Reviewed by Dean.
Implement the frames() timing function as specified in the CSS Timing Functions Level 1
specification, specifically https://www.w3.org/TR/css-timing-1/#frames-timing-functions.
A frames timing function is a type of timing function that divides the input time into a
specified number of intervals of equal length.
Test: transitions/frames-timing-function.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSFramesTimingFunctionValue::customCSSText const):
(WebCore::CSSFramesTimingFunctionValue::equals const):
* css/CSSTimingFunctionValue.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFramesTimingFunctionValue const):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSteps):
(WebCore::consumeFrames):
(WebCore::consumeAnimationTimingFunction):
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::isFramesTimingFunction const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationHasFramesTimingFunction):
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2018-01-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226721.
https://bugs.webkit.org/show_bug.cgi?id=181583
Lets do a slightly different fix (Requested by anttik on
#webkit).
Reverted changeset:
"REGRESSION(r225650): The scores of MotionMark tests Multiply
and Leaves dropped by 8%"
https://bugs.webkit.org/show_bug.cgi?id=181460
https://trac.webkit.org/changeset/226721
2018-01-11 Keith Miller <keith_miller@apple.com>
Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
https://bugs.webkit.org/show_bug.cgi?id=181573
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
2018-01-11 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import a CBOR coder from Chromium
https://bugs.webkit.org/show_bug.cgi?id=181522
<rdar://problem/36055729>
Reviewed by Brent Fulgham.
This patch imports a CBOR coder including encoder and decoder from Chromium. CBOR encoder
is needed for WebAuthN to encode attestation object into binaries. When supporting extensions
in the future, CBOR encoder/decoder will be needed as well. Implementating and maintaining
a fully-fledged CBOR coder doesn't seem to align with WebKit's best interests. Therefore,
importing a most suitable third party implementation will be wise.
In this patch, it fully integrate the whole coder into our codebase. Those changes includes:
1. Substitute data structures that enjoy a better WTF version.
2. Replacing marcos.
3. Implementating workarounds for some functionalities that we lack fundamental types' support.
4. Changing the coding style to match ours.
This patch doesn't intend to improve the logic of the original codebase. Hence some of the
coding logic might not match what WebKit ususally has.
Here is a full list of Chromium changes that constructed this CBOR coder in chronological order:
6efcf495521d18d060027762f48bb292d6979136,
9eb43fd347890b4c6cf54c4bd7ec1bbb88e381e1,
31c85e74fd567772f18e0a41be468d04af721f21,
68672fdcad280a8ff69b91927d38d0eabf2c87f2,
0ca8667c0584fb21c0748ebd7468d32889759a07,
df763d790d7e45d70116bdefacbfd4f9faa8995e,
6d30c4a621c65314db63eb56e87c19ab75627b26,
50fe92953f4739f17a62303fedbf8db9234317c8,
47be22c3603424d1832d046a348ff3f982500288,
98a59e46948b2c71608926004fac8192b0ff2208,
07540c6d850ed6e0fa508d63c20a8ce96d751de6,
06ae32d640c8e4b86ea8914a80ee419ea16e56d8.
Covered by API tests.
* Modules/webauthn/cbor/CBORBinary.h: Added.
* Modules/webauthn/cbor/CBORReader.cpp: Added.
(cbor::CBORReader::CBORReader):
(cbor::CBORReader::~CBORReader):
(cbor::CBORReader::read):
(cbor::CBORReader::decodeCBOR):
(cbor::CBORReader::readVariadicLengthInteger):
(cbor::CBORReader::decodeValueToNegative):
(cbor::CBORReader::decodeValueToUnsigned):
(cbor::CBORReader::readSimpleValue):
(cbor::CBORReader::readString):
Workarounds applied.
(cbor::CBORReader::readBytes):
(cbor::CBORReader::readCBORArray):
(cbor::CBORReader::readCBORMap):
(cbor::CBORReader::canConsume):
(cbor::CBORReader::checkMinimalEncoding):
(cbor::CBORReader::checkExtraneousData):
(cbor::CBORReader::checkDuplicateKey):
(cbor::CBORReader::hasValidUTF8Format):
Workarounds applied.
(cbor::CBORReader::checkOutOfOrderKey):
(cbor::CBORReader::getErrorCode):
(cbor::CBORReader::errorCodeToString):
* Modules/webauthn/cbor/CBORReader.h: Added.
* Modules/webauthn/cbor/CBORValue.cpp: Added.
(cbor::CBORValue::CBORValue):
(cbor::CBORValue::operator=):
(cbor::CBORValue::~CBORValue):
(cbor::CBORValue::clone const):
(cbor::CBORValue::getInteger const):
(cbor::CBORValue::getUnsigned const):
(cbor::CBORValue::getNegative const):
(cbor::CBORValue::getString const):
(cbor::CBORValue::getByteString const):
(cbor::CBORValue::getArray const):
(cbor::CBORValue::getMap const):
(cbor::CBORValue::getSimpleValue const):
(cbor::CBORValue::internalMoveConstructFrom):
(cbor::CBORValue::internalCleanup):
* Modules/webauthn/cbor/CBORValue.h: Added.
* Modules/webauthn/cbor/CBORWriter.cpp: Added.
(cbor::CBORWriter::~CBORWriter):
(cbor::CBORWriter::write):
(cbor::CBORWriter::CBORWriter):
(cbor::CBORWriter::encodeCBOR):
Workarounds applied.
(cbor::CBORWriter::startItem):
(cbor::CBORWriter::setAdditionalInformation):
(cbor::CBORWriter::setUint):
(cbor::CBORWriter::getNumUintBytes):
* Modules/webauthn/cbor/CBORWriter.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-01-11 Chris Dumez <cdumez@apple.com>
Setting Window.opener to null should disown its opener
https://bugs.webkit.org/show_bug.cgi?id=181505
<rdar://problem/36443151>
Reviewed by Ryosuke Niwa.
Setting Window.opener to null should disown its opener as per:
- https://html.spec.whatwg.org/#dom-opener
With this change, tabs opened by clicking link inside Gmail no
longer have the Gmail window as opener.
Tests: fast/dom/Window/window-opener-set-to-null.html
fast/dom/Window/window-opener-shadowing.html
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setOpener):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::disownOpener):
* page/DOMWindow.h:
* page/DOMWindow.idl:
2018-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Star character disappears when bolded
https://bugs.webkit.org/show_bug.cgi?id=181568
<rdar://problem/18755569>
Reviewed by Simon Fraser.
We had some code in ComplexTextController to ask the FontCache for a font, given the name
of a particular font CoreText used inside a CTRun. This is wrong for two reasons: fonts
are not identifiable by PostScript name (in the general case), and because the lookup
procedure requires a FontDescription, the result may yield a font that is not the one
looked up. The goal of this code was simply to preserve the rendering mode of the font,
but we removed support for these rendering modes years ago. So the solution is to skip
that lookup and use the CoreText font directly.
Test: fast/text/unknown-font.html
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-01-11 Keith Rollin <krollin@apple.com>
Add optional logging of ITP-related user interaction information
https://bugs.webkit.org/show_bug.cgi?id=181556
Reviewed by Brent Fulgham.
In order to support the tracking of the efficacy of Intelligent
Tracking Protection, add some logging indicating when the user
interacts with a page in a way that affects cookie partitioning. This
logging is off by default, and is enabled with `defaults write -g
WebKitLogCookieInformation -bool true`.
No new tests -- no changed functionality.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* loader/ResourceLoadObserver.h:
(WebCore::ResourceLoadObserver::shouldLogUserInteraction const):
(WebCore::ResourceLoadObserver::setShouldLogUserInteraction):
2018-01-11 James Craig <jcraig@apple.com>
AX: when invert colors is on, double-invert video elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=168447
<rdar://problem/30559874>
Reviewed by Simon Fraser.
Double-invert video when platform "invert colors" setting is enabled. Behavior matches
current "Smart Invert" feature of Safari Reader on macOS/iOS and other iOS native apps.
Tests: accessibility/smart-invert-reference.html
accessibility/smart-invert.html
* Modules/modern-media-controls/controls/media-controls.css:
(@media (inverted-colors)):
(:host):
(picture):
* css/html.css:
(@media (inverted-colors)):
(video):
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
Don't load inline data when requesting info for an attachment element backed by a file path
https://bugs.webkit.org/show_bug.cgi?id=181550
Reviewed by Tim Horton.
When requesting data for an attachment element that is backed by a file path, we currently trigger a load in the
web process to fetch contents of the attachment data as inline data in the AttachmentInfo. This is unnecessary,
since the file path of the attachment element must have come from the UI process anyways, so it is sufficient to
simply send the file path to the UI process and have the UI process read the contents of the path as a memory-
mapped NSData.
This patch lets HTMLAttachmentElement skip over resource loading codepaths when creating an AttachmentInfo for
the client, and also teaches _WKAttachment to read a AttachmentInfo's filepath as memory-mapped data if a file
path is present, and no inline data was specified.
Covered by existing API tests.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::requestInfo):
2018-01-10 Ryosuke Niwa <rniwa@webkit.org>
Make elements of zero width or height focusable
https://bugs.webkit.org/show_bug.cgi?id=181516
Reviewed by Chris Dumez.
Don't check render box's size or bounding rect when deciding whether an element is focusable.
New behavior matches that of Firefox and Chrome.
Test: fast/events/focus-zero-size-element.html
* dom/Element.cpp:
(WebCore::Element::isFocusable): Only update the style.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isFocusable const): Deleted.
* html/HTMLFormControlElement.h:
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isFocusable const): Deleted. As far as I can tell, no math ml element is focusable.
* mathml/MathMLElement.h:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::isFocusable const): Deleted.
* svg/SVGAElement.h:
2018-01-11 Filip Pizlo <fpizlo@apple.com>
Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
https://bugs.webkit.org/show_bug.cgi?id=181543
Rubber stamped by Michael Saboff.
No new tests because I'm just renaming things.
* ForwardingHeaders/heap/BlockDirectoryInlines.h: Copied from Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h.
* ForwardingHeaders/heap/MarkedAllocatorInlines.h: Removed.
* bindings/js/DOMGCOutputConstraint.cpp:
2018-01-11 Alex Christensen <achristensen@webkit.org>
REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
https://bugs.webkit.org/show_bug.cgi?id=181553
<rdar://problem/35733938>
Reviewed by Eric Carlson.
There is an environment where dispatch_async does not work, but performSelectorOnMainThread works.
r225003 broke loading in this environment. This fixes it and updates the test that r225003 fixed.
It failed sometimes because loading was happening in a different order than html parsing, so I made
the test not depend on html parsing timing by updating media/video-src-remove.html.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2018-01-11 Dean Jackson <dino@apple.com>
Rolling out 226814. It crashes on some bots.
2018-01-11 Dean Jackson <dino@apple.com>
[WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
https://bugs.webkit.org/show_bug.cgi?id=181558
<rdar://problem/36189833>
Reviewed by Eric Carlson.
Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
our simulated vertexAttrib0 buffer might be too large. We need
to check for out-of-memory, but we can also detect some of the issues
earlier in our validation code. Additionally, make sure that we don't
accidentally cast an unsigned to a signed.
Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
code to look for overflow, rather than relying on looking for sign changes.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
use GC3Duint, since that's what the indicies are.
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
(WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
* html/canvas/WebGLRenderingContextBase.h:
2018-01-11 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: registration in WebCore::SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181222
<rdar://problem/36332686>
Reviewed by Youenn Fablet.
Replace assertion in SWServerWorker::skipWaiting() that assumes the worker
has a registration. Nowadays, a SWServerWorker can stay alive for a short
period without having a registration, while it is terminating.
No new tests, unskipped existing test.
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::skipWaiting):
2018-01-11 Antti Koivisto <antti@apple.com>
Don't call RenderElement::setStyle when nothing changes
https://bugs.webkit.org/show_bug.cgi?id=181530
Reviewed by Zalan Bujtas.
* style/StyleChange.h:
Remove 'Force' value. This essentially meant 'compute style for all descendants and call setStyle unconditionally'.
Using this value lost information about whether anything actually changed in a particular style as it was automatically
inherited by all descendants. The 'compute all descendants' part of the behavior is what is actually needed.
Instead add separate DescendantsToResolve enum for communicating what else to compute.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Parent::Parent):
(WebCore::Style::computeDescendantsToResolve):
Figure out which descendants will need resolving based on how the current elements style changed.
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::pushParent):
(WebCore::Style::shouldResolveElement):
Use DescendantsToResolve as input.
(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleTreeResolver.h:
* style/StyleUpdate.h:
(WebCore::Style::ElementUpdates::ElementUpdates):
Add DescendantsToResolve.
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
https://bugs.webkit.org/show_bug.cgi?id=181497
Reviewed by Tim Horton.
Refactor drag initiation with DOMFile-backed attachment elements. See WebKit ChangeLog for more information. No
change in behavior; promised blob dragging covered by WKAttachment API tests.
* loader/EmptyClients.cpp:
* page/DragClient.h:
(WebCore::DragClient::prepareToDragPromisedBlob): Deleted.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
(WebCore::DragController::promisedBlobInfo):
(WebCore::DragController::dragAttachmentElement): Deleted.
* page/DragController.h:
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):
2018-01-11 Youenn Fablet <youenn@apple.com>
RTCController should disable ICE candidate filtering in case of getUserMedia based on the RTCPerrConnection origin
https://bugs.webkit.org/show_bug.cgi?id=180851
Reviewed by Eric Carlson.
Test: http/wpt/webrtc/third-party-frame-ice-candidate-filtering.html
RTCController now stores all the client origins (top+frame origins) of frames that got access to camera/microphone access.
For any such client origin, PeerConnection objects ICE candidate filtering is disabled.
ICE candidate filtering is reset whenever navigating/reloading the page.
* Modules/mediastream/RTCController.cpp:
(WebCore::RTCController::reset):
(WebCore::matchDocumentOrigin):
(WebCore::RTCController::shouldDisableICECandidateFiltering):
(WebCore::RTCController::add):
(WebCore::RTCController::disableICECandidateFilteringForAllOrigins):
(WebCore::RTCController::disableICECandidateFiltering):
(WebCore::RTCController::enableICECandidateFiltering):
* Modules/mediastream/RTCController.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
* page/Page.cpp:
(WebCore::Page::disableICECandidateFiltering):
* testing/Internals.cpp:
(WebCore::Internals::setICECandidateFiltering):
2018-01-11 Ali Juma <ajuma@chromium.org>
window.visualViewport should behave as [SameObject]
https://bugs.webkit.org/show_bug.cgi?id=181548
Reviewed by Chris Dumez.
Add 'GenerateIsReachable' to VisualViewport so that window.visualViewport's
JS wrapper object doesn't get garbage collected too soon.
Test: fast/visual-viewport/visual-viewport-same-object.html
* page/VisualViewport.idl:
2018-01-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Extract multipart handling from ResourceHandle to CurlRequest.
https://bugs.webkit.org/show_bug.cgi?id=181506
Reviewed by Alex Christensen.
Rename old MultipartHandle class to CurlMultipartHandle and modernize it. Also move the responsibility
of handling multi part from ResourceHandle to CurlRequest. This is required for upcoming NetworkLoadTask.
No new tests because no new behavior.
* platform/Curl.cmake:
* platform/network/curl/CurlMultipartHandle.cpp: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.cpp.
(WebCore::CurlMultipartHandle::createIfNeeded):
(WebCore::CurlMultipartHandle::extractBoundary):
(WebCore::CurlMultipartHandle::extractBoundaryFromContentType):
(WebCore::CurlMultipartHandle::CurlMultipartHandle):
(WebCore::CurlMultipartHandle::didReceiveData):
(WebCore::CurlMultipartHandle::didComplete):
(WebCore::CurlMultipartHandle::processContent):
(WebCore::CurlMultipartHandle::checkForBoundary):
(WebCore::CurlMultipartHandle::matchedLength):
(WebCore::CurlMultipartHandle::parseHeadersIfPossible):
* platform/network/curl/CurlMultipartHandle.h: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.h.
(WebCore::CurlMultipartHandle::~CurlMultipartHandle):
* platform/network/curl/CurlMultipartHandleClient.h: Added.
(WebCore::CurlMultipartHandleClient::~CurlMultipartHandleClient):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveHeaderFromMultipart):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::invokeDidReceiveResponse):
(WebCore::CurlRequest::completeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
(WebCore::ResourceHandleCurlDelegate::curlDidComplete):
* platform/network/curl/ResourceHandleCurlDelegate.h:
2018-01-11 Zalan Bujtas <zalan@apple.com>
RenderTreeUpdater::current() returns null_ptr when mutation is done through Document::resolveStyle.
https://bugs.webkit.org/show_bug.cgi?id=181513
<rdar://problem/36367085>
Reviewed by Antti Koivisto.
This patch ensures that we use a valid RenderTreeBuilder even when
Document::resolveStyle (incorrectly) triggers tree mutation.
It can be reverted soon after the incorrect mutations are taken care of.
Test: fast/forms/button-set-text-crash.html
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderMenuList.cpp:
(RenderMenuList::setText):
2018-01-11 Antoine Quint <graouts@apple.com>
Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user
https://bugs.webkit.org/show_bug.cgi?id=181547
<rdar://problem/35947650>
Reviewed by Eric Carlson.
Because listening to "webkitplaybacktargetavailabilitychanged" events incurs some higher power usage on iOS,
we only listen to such events when controls are visible to the user. In other words, the MediaControls need to
have both "visible" set to "true" and "faded" set to "false". To support this, we add a delegate method on
MediaControls such that it can tell the MediaController that the "visible" property changed. With this message,
MediaController can inform its MediaControllerSupport objects that user visibility of the controls changed, which
lets AirplaySupport disable itself when controls are no longer visible.
Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.set visible):
* Modules/modern-media-controls/media/airplay-support.js:
(AirplaySupport.prototype.controlsUserVisibilityDidChange):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.controlsUserVisibilityDidChange):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.mediaControlsVisibilityDidChange):
(MediaController.prototype.mediaControlsFadedStateDidChange):
(MediaController.prototype._controlsUserVisibilityDidChange):
2018-01-11 Antoine Quint <graouts@apple.com>
[iOS] There should be no controls markup generated in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=181540
<rdar://problem/35060379>
Reviewed by Eric Carlson.
We completely forgo the display of any content when fullscreen on iOS by setting the
"visible" flag to "false" on the MediaControls, which will prevent any DOM content from
being added.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateiOSFullscreenProperties):
(MediaController):
(MediaController.prototype._updateSupportingObjectsEnabledState): Deleted.
2018-01-11 Alex Christensen <achristensen@webkit.org>
Revert changes accidentally committed with r226789.
https://bugs.webkit.org/show_bug.cgi?id=181423
I had some local changes I did not mean to commit.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(scheduledWithCustomRunLoopMode):
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
(WebCore::if): Deleted.
(WebCore::>::fromCallable): Deleted.
2018-01-10 Simon Fraser <simon.fraser@apple.com>
On macOS, getBoundingClientRect gives incorrect values when pinch-zoomed
https://bugs.webkit.org/show_bug.cgi?id=181511
rdar://problem/33741427
Reviewed by Zalan Bujtas.
When reverting "client coordinates are relative to layout viewport" in r219829
I broke documentToClientOffset() on macOS by failing to take pinch zoom scale into
account (frameScaleFactor() is always 1 on iOs, so this bug doesn't manifest there).
Covered by existing tests.
* page/FrameView.cpp:
(WebCore::FrameView::documentToClientOffset const):
2018-01-11 Youenn Fablet <youenn@apple.com>
Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
https://bugs.webkit.org/show_bug.cgi?id=181480
Reviewed by Eric Carlson.
No change of behavior.
* page/RuntimeEnabledFeatures.h: Set default value to false.
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Support moving attachment elements in editable areas using drag and drop
https://bugs.webkit.org/show_bug.cgi?id=181337
<rdar://problem/36324813>
Reviewed by Tim Horton.
Makes slight adjustments to attachment-specific drag and drop logic to ensure that moving attachments via drag
and drop behaves correctly. See per-change comments for more detail.
Tests: WKAttachmentTests.DragInPlaceVideoAttachmentElement
WKAttachmentTests.MoveAttachmentElementAsIconByDragging
WKAttachmentTests.MoveInPlaceAttachmentElementByDragging
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getPasteboardTypesAndDataForAttachment):
Stop vending the private web archive pasteboard type for attachments, for now. This works around issues where an
attachment element that is dragged and dropped within the same page may lose its blob backing data if we try to
remove and insert it as a fragment from the archive. Providing a web archive would allow us to avoid destroying
and recreating an attachment element when dragging within the same page, but this is a nice-to-have optimization
we can re-enable after investigation in a subsequent patch.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
Add `draggable=false` to the image element of an in-place attachment element.
* page/DragController.cpp:
(WebCore::enclosingAttachmentElement):
(WebCore::DragController::draggableElement const):
Tweak single-selected-attachment handling to account for in-place attachments. Since the hit-tested node is
inside the shadow subtree of the attachment element, the condition needs to check for the startElement as well
as the startElement's shadow host.
(WebCore::DragController::startDrag):
Make two tweaks here. First, don't require a RenderAttachment to drag an attachment element (this is required
for dragging in-place attachments). This was added in r217083 to address <rdar://problem/32282831>, but is no
longer correct, since attachments may now be displayed in-place.
Secondly, only restore the previous selection if the attachment is in a richly contenteditable area. This was
added to prevent the selection highlight from appearing in when dragging non-editable attachment elements in the
Mail viewer. However, to allow drag moves to occur, we need the selection to persist after drag start.
2018-01-04 Filip Pizlo <fpizlo@apple.com>
CodeBlocks should be in IsoSubspaces
https://bugs.webkit.org/show_bug.cgi?id=180884
Reviewed by Saam Barati.
No new tests because no new behavior.
Adopting new parallel constraint API, so that more of the logic of doing parallel
constraint solving is shared between the DOM's output constraints and JSC's output
constraints.
* bindings/js/DOMGCOutputConstraint.cpp:
(WebCore::DOMGCOutputConstraint::executeImpl):
(WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
(WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
* bindings/js/DOMGCOutputConstraint.h:
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Support dragging attachment elements out as files on iOS
https://bugs.webkit.org/show_bug.cgi?id=181199
<rdar://problem/36299316>
Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
Adds support for dragging "files" (i.e. creating item providers with preferred attachment presentation styles)
from attachment elements on iOS for Mail. See below for more detail.
Tests: WKAttachmentTestsIOS.DragAttachmentInsertedAsData
WKAttachmentTestsIOS.DragAttachmentInsertedAsFile
* page/DragController.cpp:
(WebCore::DragController::platformContentTypeForBlobType const):
(WebCore::DragController::dragAttachmentElement):
* page/DragController.h:
* page/mac/DragControllerMac.mm:
(WebCore::DragController::platformContentTypeForBlobType const):
Add a private method to convert the type of a promised blob to a platform type. For Cocoa platforms, this
converts the blob type (either a UTI or a MIME type) to a UTI for the platform to consume.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
Refactor WebItemProviderRegistrationInfo. WebItemProviderRegistrationInfo currently encapsulates a single item
provider registration call, and contains either a type identifier and data buffer, or an NSItemProviderWriting-
conformant object. To register an item provider using a WebItemProviderRegistrationInfo, the item provider
pasteboard currently checks to see whether the info contains an object or a type and data.
This patch removes WebItemProviderRegistrationInfo and replaces it with WebItemProviderDataRegistrar. Objects
that implement this protocol know how to take an NSItemProvider and register data to it. So far, there are
three implementations below.
(-[WebItemProviderDataRegistrar initWithData:type:]):
(-[WebItemProviderDataRegistrar typeIdentifier]):
(-[WebItemProviderDataRegistrar data]):
(-[WebItemProviderDataRegistrar typeIdentifierForClient]):
(-[WebItemProviderDataRegistrar dataForClient]):
(-[WebItemProviderDataRegistrar registerItemProvider:]):
(-[WebItemProviderDataRegistrar description]):
A data registrar takes a UTI and data buffer, and registers the UTI to the data. This replaces a
WebItemProviderRegistrationInfo with both a type and data, but no representing object.
(-[WebItemProviderWritableObjectRegistrar initWithObject:]):
(-[WebItemProviderWritableObjectRegistrar representingObjectForClient]):
(-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
(-[WebItemProviderWritableObjectRegistrar description]):
The writable object registrar writes an NSItemProviderWriting-conformant object to an item provider. This
replaces a WebItemProviderRegistrationInfo with only a representing object.
(-[WebItemProviderPromisedFileRegistrar initWithType:callback:]):
(-[WebItemProviderPromisedFileRegistrar registerItemProvider:]):
(-[WebItemProviderPromisedFileRegistrar description]):
(-[WebItemProviderRegistrationInfoList addData:forType:]):
(-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
(-[WebItemProviderRegistrationInfoList addPromisedType:fileCallback:]):
Helper methods to add new registrars to a registration info list.
(-[WebItemProviderRegistrationInfoList itemAtIndex:]):
(-[WebItemProviderRegistrationInfoList enumerateItems:]):
(-[WebItemProviderRegistrationInfoList itemProvider]):
(-[WebItemProviderRegistrationInfoList description]):
(-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]): Deleted.
(-[WebItemProviderRegistrationInfo representingObject]): Deleted.
(-[WebItemProviderRegistrationInfo typeIdentifier]): Deleted.
2018-01-11 Michael Saboff <msaboff@apple.com>
Add a DOM gadget for Spectre testing
https://bugs.webkit.org/show_bug.cgi?id=181351
Reviewed by Ryosuke Niwa.
This change is used to test Spectre mitigations.
Added a new DOM class to test for Spectre issues in the DOM layer.
This additional functionality is disabled by default and must be enabled
through the JSC option "enableSpectreGadgets".
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/SpectreGadget.cpp: Added.
(WebCore::SpectreGadget::SpectreGadget):
(WebCore::SpectreGadget::create):
(WebCore::SpectreGadget::setReadLength):
(WebCore::SpectreGadget::charCodeAt):
(WebCore::SpectreGadget::clflushReadLength):
* dom/SpectreGadget.h: Added.
* dom/SpectreGadget.idl: Added.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
* page/RuntimeEnabledFeatures.h:
2018-01-11 Philippe Normand <pnormand@igalia.com>
[GTK] media/muted-video-is-playing-audio.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=163781
Reviewed by Carlos Garcia Campos.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Sprinkle some debugging.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Ditto.
2018-01-10 Andy Estes <aestes@apple.com>
[Payment Request] Rename ApplePayMerchantValidationEvent to MerchantValidationEvent
https://bugs.webkit.org/show_bug.cgi?id=181437
<rdar://problem/36376481>
Reviewed by Tim Horton.
Renamed ApplePayMerchantValidationEvent to MerchantValidationEvent and changed complete() to accept a Promise.
Test: http/tests/paymentrequest/payment-request-merchant-validation.https.html
* DerivedSources.make:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::merchantValidationCompleted):
(WebCore::ApplePayPaymentHandler::validateMerchant):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/MerchantValidationEvent.cpp: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.cpp.
(WebCore::MerchantValidationEvent::create):
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
(WebCore::MerchantValidationEvent::eventInterface const):
(WebCore::MerchantValidationEvent::complete):
* Modules/paymentrequest/MerchantValidationEvent.h: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.h.
* Modules/paymentrequest/MerchantValidationEvent.idl: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl.
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::completeMerchantValidation):
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
2018-01-10 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Cross-protocol, cross-site scripting (XPXSS) using HTML forms
Nhttps://bugs.webkit.org/show_bug.cgi?id=153088
Reviewed by Alex Christensen.
No new tests because it's covered by existing tests.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getHttpVersion):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
(WebCore::ResourceResponse::setStatusLine):
2018-01-10 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION(r222507): Composition highlight doesn't render when using IME
https://bugs.webkit.org/show_bug.cgi?id=181485
<rdar://problem/35896516>
Reviewed by Ryosuke Niwa.
Fixes the order of arguments passed to paintTextSubrangeBackground from paintCompositionBackground.
Test: editing/marked-text-appearance.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionBackground):
2018-01-10 Youenn Fablet <youenn@apple.com>
Use no-cache fetch mode when loading main documents with location.reload()
https://bugs.webkit.org/show_bug.cgi?id=181285
Reviewed by Alex Christensen.
Covered by rebased tests.
Start to translate cache policy used for navigation as FetchOptions::Cache.
This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
Keep reload mode for ReloadFromOrigin.
* loader/DocumentLoader.cpp:
(WebCore::toFetchOptionsCache):
(WebCore::DocumentLoader::loadMainResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::defaultRequestCachingPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/NavigationScheduler.cpp:
2018-01-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226667 and r226673.
https://bugs.webkit.org/show_bug.cgi?id=181488
This caused a flaky crash. (Requested by mlewis13 on #webkit).
Reverted changesets:
"CodeBlocks should be in IsoSubspaces"
https://bugs.webkit.org/show_bug.cgi?id=180884
https://trac.webkit.org/changeset/226667
"REGRESSION (r226667): CodeBlocks should be in IsoSubspaces"
https://bugs.webkit.org/show_bug.cgi?id=180884
https://trac.webkit.org/changeset/226673
2018-01-10 Antti Koivisto <antti@apple.com>
REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
https://bugs.webkit.org/show_bug.cgi?id=181460
<rdar://problem/36379776>
Reviewed by Ryosuke Niwa.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
Don't do the expensive security origin test if the sheet base URL and document URL are identical.
This is true for inline style and inline stylesheets.
2018-01-10 Antti Koivisto <antti@apple.com>
Try to fix windows build.
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::computeNextMatchElement):
2018-01-10 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRuby's moveChildren logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181470
<rdar://problem/36397683>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* rendering/RenderBlockFlow.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveChildren): Deleted.
(WebCore::RenderRubyBase::mergeChildrenWithBase): Deleted.
(WebCore::RenderRubyBase::moveInlineChildren): Deleted.
(WebCore::RenderRubyBase::moveBlockChildren): Deleted.
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::moveRubyChildren):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::moveChildren):
(WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
(WebCore::RenderTreeBuilder::Ruby::insertChild):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-01-10 Philippe Normand <pnormand@igalia.com>
[GStreamer] fix critical GObject warning
Rubber-stamped by Carlos Garcia Campos.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): No need to
resort to complicated things to get the element name...
2018-01-10 Philippe Normand <pnormand@igalia.com>
[GStreamer] REGRESSION(r226629): broke media/video-interruption-with-resume-allowing-play.html
https://bugs.webkit.org/show_bug.cgi?id=181471
<rdar://problem/36402323>
Reviewed by Carlos Garcia Campos.
This patch mainly reduces the amount of playback state changes
emitted by the GStreamer player to its client. Emitting those
notifications too often has bad side effects.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::paused const): Add debug messages.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): This debug message appears too much. Demote.
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Try to emit
playback state change notification only when going to PLAYING.
(WebCore::MediaPlayerPrivateGStreamer::loadingFailed): Add warning message.
2018-01-10 Youenn Fablet <youenn@apple.com>
Add Service Worker CSP persistency
https://bugs.webkit.org/show_bug.cgi?id=181434
Reviewed by Alex Christensen.
Covered by manual testing.
Future work on service worker test infrastructure should allow automating such tests.
Add support for service worker CSP data persistency.
Add a version parameter to increment each time the schema is changing.
This allows the same store to be used by multiple WebKits.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
2018-01-10 Antti Koivisto <antti@apple.com>
Invalidate current element style on class change accurately
https://bugs.webkit.org/show_bug.cgi?id=181210
Reviewed by Zalan Bujtas.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::subjectClassRules const):
New rule set containing class rules affecting the subject element.
(WebCore::DocumentRuleSets::ancestorClassRules const):
* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
Classify selector components into various buckets based on the elements they match relative to
the subject element. There are more categories than this patch strictly needs, for future use.
(WebCore::RuleFeatureSet::collectFeatures):
(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
* css/RuleFeature.h:
* css/StyleResolver.h:
(WebCore::StyleResolver::hasSelectorForClass const): Deleted.
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::elementNeedsInvalidation):
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
Don't invalidate current element unconditionally on class change. Instead find the subject rulesets
that might affect it use them to perform invalidation.
(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
(WebCore::Style::ClassChangeInvalidation::invalidateStyle): Deleted.
(WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle): Deleted.
* style/ClassChangeInvalidation.h:
(WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
(WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::classNamesAffectedByRules const):
2018-01-09 Antoine Quint <graouts@apple.com>
[Web Animations] Expose the id property on Animation
https://bugs.webkit.org/show_bug.cgi?id=181450
<rdar://problem/36383600>
Reviewed by Dean Jackson.
Expose the "id" property on Animation and handle the "id" property on the optional KeyframeAnimationOptions object
passed to Element.animate(). All of the WPT tests related to this property are now passing.
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* dom/Element.cpp:
(WebCore::Element::animate):
2018-01-09 Chris Dumez <cdumez@apple.com>
Make service workers behave correctly with regards to Page Cache
https://bugs.webkit.org/show_bug.cgi?id=181446
<rdar://problem/36164291>
Reviewed by Youenn Fablet.
Make service workers behave correctly with regards to Page Cache:
1. If a document has an active service worker, do not let it go into PageCache
2. When a document goes into page cache, unregister it from the list of service worker clients
3. When a document is restored from page cache, add it nack to the list of service worker clients
Tests: http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html
http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html
http/tests/workers/service/no-page-cache-when-controlled.html
http/tests/workers/service/other_resources/test.html
* dom/Document.cpp:
(WebCore::Document::suspend):
(WebCore::Document::resume):
* history/PageCache.cpp:
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
* page/DiagnosticLoggingKeys.h:
2018-01-09 Chris Dumez <cdumez@apple.com>
We should not return undefined for most properties of a detached Window
https://bugs.webkit.org/show_bug.cgi?id=181416
<rdar://problem/36162489>
Reviewed by Ryosuke Niwa.
We should not return undefined for most properties on a detached Window. WebKit previously only exposed "closed"
and "close" properties on detached / frameless windows. However, this does not match the HTML specification [1]
or the behavior of Firefox and Chrome.
Note that Chrome does not seem to fully follow the HTML specification either, it seems to treat detached windows
the same way as cross-origin ones. As a result, it only exposed properties that are visible cross-origin when
a window is detached / frameless.
[1] https://html.spec.whatwg.org/#windowproxy-get
No new tests, updated existingt tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2018-01-09 Darin Adler <darin@apple.com>
Further refinement to list item and counter code after "list-item" counter fix
https://bugs.webkit.org/show_bug.cgi?id=181426
Reviewed by Zalan Bujtas.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritCounter): Use auto.
(WebCore::StyleBuilderCustom::applyValueCounter): Use auto, removed unneeded
null checks for things that can never be null, moved the saturated addition
here and got rid of the addIncrementValue function from CounterDirectives.
Use the saturatedAddition function from SaturatedArithmetic.h instead of the
much less efficient one that did the same thing, CounterDirectives::addClamped.
* rendering/RenderCounter.cpp:
(WebCore::listItemCounterDirectives): Use aggregate syntax for the return
statements.
(WebCore::planCounter): Changed to use a struct return value instead of two
out arguments. Use the saturatedAddition function from SaturatedArithmetic.h
instead of the much less efficient one that did the same thing,
CounterDirectives::addClamped.
(WebCore::findPlaceForCounter): Changed to use a struct return value instead
of two out arguments.
(WebCore::makeCounterNode): Updated for the above changes. Changed code to
use add instead of both get and set. Updated to keep the counter maps inside
the values of the "map of maps" instead of using a unique_ptr and allocating
each one on the heap.
(WebCore::destroyCounterNodeWithoutMapRemoval): Changed argument to a reference
instead of a pointer. Updated for changes to the map. Use RefPtr more
consistently.
(WebCore::RenderCounter::destroyCounterNodes): Use iterators less.
(WebCore::RenderCounter::destroyCounterNode): Ditto.
(WebCore::RenderCounter::rendererRemovedFromTree): Add a check of
hasCounterNodeMap here before calling destroyCounterNodes, so that function
can assume the flag is true (both other callers already check it).
(WebCore::updateCounters): Use auto and update for changes above.
(WebCore::RenderCounter::rendererStyleChanged): Use modern for loops instead
of iterators.
(showCounterRendererTree): Use auto and udpate for changes above.
* rendering/RenderListItem.cpp:
(WebCore::enclosingList): Stop referring to elements as "nodes". Changed
the local variable names for clarity.
(WebCore::nextListItemHelper): Renamed from nextListItem since it's not
intended to be called directly and we want to use a function pointer to
nextListItem. Fixed the algorithm to correctly handle ad hoc "lists" that
are not actually HTML list elements, using the definition in the enclosingList
function as the previousListItem function already did.
(WebCore::nextListItem): Updated for name changes.
(WebCore::firstListItem): Renamed from nextListItem for clarity.
(WebCore::previousListItem): Rewrote loop so it doesn't have to do things
so strangely when we find another list.
(WebCore::RenderListItem::updateItemValuesForOrderedList): Use auto and
update local variable names.
(WebCore::RenderListItem::itemCountForOrderedList): Ditto.
(WebCore::RenderListItem::updateValueNow const): Rewrote to use an iterative
algorithm instead of a recursive one. Fixes the FIXME here.
(WebCore::RenderListItem::updateValue): Use m_valueWasSetExplicitly
instead of m_explicitValue.
(WebCore::RenderListItem::explicitValueChanged): Use auto and simplified
the loop a bit.
(WebCore::RenderListItem::setExplicitValue): Set m_valueWasSetExplicitly
instead of m_explicitValue.
(WebCore::previousOrNextItem): Deleted.
(WebCore::RenderListItem::updateListMarkerNumbers): Streamlined the loop
a bit and used a fucntion pointer to handle the two different directions.
(WebCore::RenderListItem::isInReversedOrderedList const): Simplified by
getting rid of an unneeded use of pointers and local variables.
* rendering/RenderListItem.h: Use a boolean, m_valueWasSetExplicitly,
instead of a separate optional m_explicitValue.
* rendering/style/CounterDirectives.h: Since all the code in this file was
rewritten, removed old copyrights. Deleted the addIncrementValue function,
since it is clear enough in the one call site in the style builder.
Deleted the addClamped function because it was just a much slower
version of the saturatedAddition function. Made == and != into constexpr
functions since they are simple enough to be.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getCounterDirectives const): Deleted. Caller can
handle this just fine without a helper function.
* rendering/style/RenderStyle.h: Ditto.
2018-01-09 Myles C. Maxfield <mmaxfield@apple.com>
font-display:fallback can cause a visual flash (which is supposed to be impossible)
https://bugs.webkit.org/show_bug.cgi?id=181374
Reviewed by Simon Fraser.
A FontCascade represents an entire font-family fallback list, but sometimes we need to pull out a single
representative font from the list to calculate things like line height. Previously, if the first item in
the font-family list was in the middle of being downloaded, this representative font was hardcoded to be
Times. However, when actually laying out and drawing the glyphs, we have logic to skip the interstitial
Times if there are any installed fonts present in the font-family list (so you wouldn't ever actually
see Times). This means that line height (among other things) was being calculated as if Times was used,
but in reality, some other font from the font-family list was being used.
Alone, this isn't a huge problem, but font-display:fallback makes a font transition between "timed out"
and "failed," and when the font hits the failed state, the representative font skips over the cancelled
item and hits the next item in the fallback list. This means that line heights will change, which causes
a visual flash, even when font-display:fallback is specified.
The solution is simply to educate the logic which identifies this representative font so that it
understands what to do for currently-loading fonts.
Tests: fast/text/font-display/swap-flash.html
* platform/graphics/FontCascadeFonts.h:
(WebCore::FontCascadeFonts::primaryFont):
* rendering/line/BreakingContext.h:
(WebCore::textWidth):
2018-01-04 Filip Pizlo <fpizlo@apple.com>
CodeBlocks should be in IsoSubspaces
https://bugs.webkit.org/show_bug.cgi?id=180884
Reviewed by Saam Barati.
No new tests because no new behavior.
Adopting new parallel constraint API, so that more of the logic of doing parallel
constraint solving is shared between the DOM's output constraints and JSC's output
constraints.
* bindings/js/DOMGCOutputConstraint.cpp:
(WebCore::DOMGCOutputConstraint::executeImpl):
(WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
(WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
* bindings/js/DOMGCOutputConstraint.h:
2018-01-08 Simon Fraser <simon.fraser@apple.com>
Clean up Marquee-related enums
https://bugs.webkit.org/show_bug.cgi?id=181347
Reviewed by Anders Carlsson.
Modernize EMarqueeBehavior and EMarqueeDirection enums. Stop using the weird negative
values in the MarqueeDirection and do manual reverse direction mapping.
Make some member functions of RenderMarquee private.
Stop using bitfields in RenderMarquee because the memory saving is not worth it, and doing so
allows us to use modern initialization.
No behavior change.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator MarqueeBehavior const):
(WebCore::CSSPrimitiveValue::operator MarqueeDirection const):
(WebCore::CSSPrimitiveValue::operator EMarqueeBehavior const): Deleted.
(WebCore::CSSPrimitiveValue::operator EMarqueeDirection const): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesLogicalWidthToFitContent const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::RenderMarquee):
(WebCore::reverseDirection):
(WebCore::RenderMarquee::direction const):
(WebCore::RenderMarquee::isHorizontal const):
(WebCore::RenderMarquee::computePosition):
(WebCore::RenderMarquee::start):
(WebCore::RenderMarquee::updateMarqueePosition):
(WebCore::RenderMarquee::updateMarqueeStyle):
(WebCore::RenderMarquee::timerFired):
* rendering/RenderMarquee.h:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::marqueeBehavior const):
(WebCore::RenderStyle::marqueeDirection const):
(WebCore::RenderStyle::setMarqueeDirection):
(WebCore::RenderStyle::setMarqueeBehavior):
(WebCore::RenderStyle::initialMarqueeBehavior):
(WebCore::RenderStyle::initialMarqueeDirection):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleMarqueeData.cpp:
(WebCore::StyleMarqueeData::StyleMarqueeData):
* rendering/style/StyleMarqueeData.h:
2018-01-09 Jer Noble <jer.noble@apple.com>
Many CVDisplayLink threads created and destroyed while watching a YouTube video
https://bugs.webkit.org/show_bug.cgi?id=181396
Reviewed by Simon Fraser.
When watching some YouTube videos (or any video with default controls), event handlers for
the "timeupdate" event which use rAF will cause the underlying platform objects to be
destroyed in between "timeupdate" events being fired, since they occur every 250ms, and rAF
objects are destroyed every 166ms (or 10/60hz). Update this constant to destroy the
underlying objects every 333ms (or 20/60hz) so that this common pattern doesn't lead to
excessive rAF platform object turnover.
* platform/Logging.h:
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::shouldBeTerminated const):
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::displayDidRefresh):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
(WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement addChild mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181451
<rdar://problem/36385562>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
(WebCore::RenderElement::childRequiresTable const): Deleted.
* rendering/RenderElement.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderElement):
(WebCore::RenderTreeBuilder::childRequiresTable):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::newChildIsInline):
(WebCore::newChildIsInline): Deleted.
* rendering/updating/RenderTreeBuilderInline.h:
2018-01-09 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r226531.
This caused test failures on macOS WK2.
Reverted changeset:
"Use no-cache fetch mode when loading main documents with
location.reload()"
https://bugs.webkit.org/show_bug.cgi?id=181285
https://trac.webkit.org/changeset/226531
2018-01-09 Michael Saboff <msaboff@apple.com>
Unreviewed, rolling out r226600 and r226603
https://bugs.webkit.org/show_bug.cgi?id=181351
Add a DOM gadget for Spectre testing
* dom/Comment.cpp:
(WebCore::Comment::Comment):
(WebCore::Comment::setReadLength): Deleted.
(WebCore::Comment::charCodeAt): Deleted.
(WebCore::Comment::clflushReadLength): Deleted.
* dom/Comment.h:
* dom/Comment.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const): Deleted.
* page/RuntimeEnabledFeatures.h:
2018-01-09 Don Olmstead <don.olmstead@sony.com>
Add additional WEBCORE_EXPORTs
https://bugs.webkit.org/show_bug.cgi?id=181414
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* dom/Document.h:
* dom/ViewportArguments.h:
* page/DOMWindow.h:
* page/FrameView.h:
* page/PageOverlayController.h:
* platform/ContextMenuItem.h:
* platform/Pasteboard.h:
* platform/SharedBuffer.h:
* platform/UserAgent.h:
* platform/graphics/GLContext.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayerTransform.h:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/cairo/BackingStoreBackendCairoImpl.h:
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/cairo/RefPtrCairo.h:
* platform/graphics/nicosia/NicosiaBuffer.h:
* platform/graphics/nicosia/NicosiaPaintingEngine.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperFPSCounter.h:
* platform/graphics/texmap/TextureMapperLayer.h:
(WebCore::TextureMapperLayer::TextureMapperLayer): Deleted.
(WebCore::TextureMapperLayer::setID): Deleted.
(WebCore::TextureMapperLayer::id): Deleted.
(WebCore::TextureMapperLayer:: const): Deleted.
(WebCore::TextureMapperLayer::setScrollClient): Deleted.
(WebCore::TextureMapperLayer::setIsScrollable): Deleted.
(WebCore::TextureMapperLayer::isScrollable const): Deleted.
(WebCore::TextureMapperLayer::textureMapper const): Deleted.
(WebCore::TextureMapperLayer::setTextureMapper): Deleted.
(WebCore::TextureMapperLayer::drawsContent const): Deleted.
(WebCore::TextureMapperLayer::contentsAreVisible const): Deleted.
(WebCore::TextureMapperLayer::size const): Deleted.
(WebCore::TextureMapperLayer::opacity const): Deleted.
(WebCore::TextureMapperLayer::transform const): Deleted.
(WebCore::TextureMapperLayer::hasFilters const): Deleted.
(WebCore::TextureMapperLayer::isShowingRepaintCounter const): Deleted.
(WebCore::TextureMapperLayer::fixedToViewport const): Deleted.
(WebCore::TextureMapperLayer::rootLayer const): Deleted.
(WebCore::TextureMapperLayer::texture): Deleted.
(WebCore::TextureMapperLayer::adjustedPosition const): Deleted.
(WebCore::TextureMapperLayer::layerRect const): Deleted.
(WebCore::TextureMapperLayer::State::State): Deleted.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
(WebCore::CoordinatedGraphicsLayer::isScrollable const): Deleted.
(WebCore::CoordinatedGraphicsLayer::id const): Deleted.
(WebCore::CoordinatedGraphicsLayer::coverRect const): Deleted.
(WebCore::CoordinatedGraphicsLayer::fixedToViewport const): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
(WebCore::CoordinatedImageBacking::id const): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
* platform/graphics/texmap/coordinated/UpdateAtlas.h:
* platform/network/AuthenticationChallengeBase.h:
* platform/network/CredentialBase.h:
* platform/network/ProtectionSpaceBase.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* replay/UserInputBridge.h:
2018-01-09 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Move FormData related tasks into new CurlFormDataStream class.
https://bugs.webkit.org/show_bug.cgi?id=181106
Reviewed by Alex Christensen.
No new tests because no behavior change.
* platform/Curl.cmake:
* platform/network/curl/CurlFormDataStream.cpp: Added.
(WebCore::CurlFormDataStream::CurlFormDataStream):
(WebCore::CurlFormDataStream::~CurlFormDataStream):
(WebCore::CurlFormDataStream::clean):
(WebCore::CurlFormDataStream::shouldUseChunkTransfer):
(WebCore::CurlFormDataStream::totalSize):
(WebCore::CurlFormDataStream::computeContentLength):
(WebCore::CurlFormDataStream::read):
(WebCore::CurlFormDataStream::readFromFile):
(WebCore::CurlFormDataStream::readFromData):
* platform/network/curl/CurlFormDataStream.h: Renamed from Source/WebCore/platform/network/curl/FormDataStreamCurl.h.
(WebCore::CurlFormDataStream::elementSize):
(WebCore::CurlFormDataStream::totalReadSize):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::willSendData):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::setupPUT):
(WebCore::CurlRequest::setupPOST):
(WebCore::CurlRequest::setupSendData):
(WebCore::CurlRequest::resolveBlobReferences): Deleted.
(WebCore::CurlRequest::setupFormData): Deleted.
* platform/network/curl/CurlRequest.h:
* platform/network/curl/FormDataStreamCurl.cpp: Removed.
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181443
<rdar://problem/36380228>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::addChild):
(WebCore::RenderMathMLFenced::createMathMLOperator): Deleted.
(WebCore::RenderMathMLFenced::makeFences): Deleted.
* rendering/mathml/RenderMathMLFenced.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderMathMLFenced):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::mathMLBuilder):
2018-01-09 Antti Koivisto <antti@apple.com>
Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true
https://bugs.webkit.org/show_bug.cgi?id=180940
<rdar://problem/36116507>
Reviewed by Darin Adler.
Test: http/tests/local/loading-stylesheet-import-remove.html
If a <link> referencing a stylesheet containing an @import that was still loading was removed
from the document, the loading state was never cleared. For head stylesheets this blocked
rendering permanently.
Test reduction by Justin Ridgewell.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFromAncestor):
Test if the stylesheet it loading before clearing the pointer.
2018-01-09 Dan Bernstein <mitz@apple.com>
Removed some empty directories that were left behind
* Modules/indieui: Removed.
* Modules/vibration: Removed.
* platform/graphics/ca/mac: Removed.
* platform/mediastream/gstreamer: Removed.
2018-01-09 Antoine Quint <graouts@apple.com>
Refactor timing function solving code
https://bugs.webkit.org/show_bug.cgi?id=181428
Reviewed by Dean Jackson.
We have duplicated code to solve "cubic" and "steps" timing functions in AnimationBase and TextureMapperAnimation,
and we will soon need similar code to deal with timing functions in Web Animations. We move this code into TimingFunction
with a single transformTime() function that can be called directly on the timing function rather than having callers
figure out what type timing functions are to solve them.
No test as there shouldn't be any behavior change.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::progress const):
(WebCore::solveEpsilon): Deleted.
(WebCore::solveCubicBezierFunction): Deleted.
(WebCore::solveStepsFunction): Deleted.
(WebCore::solveSpringFunction): Deleted.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
(WebCore::solveEpsilon): Deleted.
(WebCore::solveCubicBezierFunction): Deleted.
(WebCore::solveStepsFunction): Deleted.
(WebCore::applyTimingFunction): Deleted.
2018-01-09 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence -Wunused-parameter warning
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setupNewlyCreatedServiceWorker):
2018-01-09 Said Abou-Hallawa <sabouhallawa@apple.com>
Check Image::m_image is not null in ImageLoader::decode()
https://bugs.webkit.org/show_bug.cgi?id=180386
<rdar://problem/34634483>
Reviewed by Tim Horton.
Ensure ImageLoader::m_image is not null before referencing it.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::decode):
2018-01-09 Yusuke Suzuki <utatane.tea@gmail.com>
[FreeType] Use FastMalloc for FreeType
https://bugs.webkit.org/show_bug.cgi?id=181387
Reviewed by Michael Catanzaro.
Add custom memory allocator for FreeType to use FastMalloc.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::initializeFreeTypeLibrary):
(WebCore::createFontCustomPlatformData):
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTable* addChild mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181424
<rdar://problem/36368628>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
Covered by existing tests.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderTable):
(WebCore::RenderTreeBuilder::insertChildToRenderTableSection):
(WebCore::RenderTreeBuilder::insertChildToRenderTableRow):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
* rendering/updating/RenderTreeBuilderTable.h:
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Transition Render*::addChild() calls to RenderTreeBuilder::insertChildToRender*()
https://bugs.webkit.org/show_bug.cgi?id=181407
<rdar://problem/36361176>
Reviewed by Antti Koivisto.
Eventually all mutation will be going through the RenderTreeBuilder.
No change in functionality.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
2018-01-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Ensure SleepDisabler is not held by pages in page cache
https://bugs.webkit.org/show_bug.cgi?id=180197
Reviewed by Eric Carlson.
The sleep disabler is now checked again whenever the media player
playback state or other characteristic has changed in the media
engine.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
Check if the sleep disabler state needs to be updated or not.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
(WebCore::HTMLMediaElement::shouldDisableSleep const): Enable
sleep disabler for GTK and WPE ports.
2018-01-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Missing notifications to player client
https://bugs.webkit.org/show_bug.cgi?id=181432
Reviewed by Carlos Garcia Campos.
We now properly emit playback state changes and characteristic
updates to the client when the pipeline state changes and when
audio/video tracks changes are detected.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
This debug message appears too often in logs. Demote.
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Emit
charasteristicChanged notification.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Keep track
of old and current pipeline state.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2018-01-09 Youenn Fablet <youenn@apple.com>
Add CSP support to service workers
https://bugs.webkit.org/show_bug.cgi?id=181385
Reviewed by Chris Dumez.
Covered by rebased tests.
Added recovery of CSP information from WorkerScriptLoader.
Added plumbing to pass the CSP information to Service Workers.
Did not add persistency support for the CSP information as this requires changing the SQL database schema.
This will be done in a follow-up.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::contentSecurityPolicy const):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::finishedFetchingScript):
(WebCore::SWClientConnection::failedFetchingScript):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_contentSecurityPolicy):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:
2018-01-09 Antoine Quint <graouts@apple.com>
Provide a method to obtain a CSS value from a RenderStyle by CSSPropertyID
https://bugs.webkit.org/show_bug.cgi?id=181429
Reviewed by Antti Koivisto.
The KeyframeEffect.getKeyframes() method from Web Animations requires that we return all styles applied at a given
animation effect keyframe. When we parse keyframes, we create RenderStyle objects that are stored in a KeyframeList,
as well as a list of CSSPropertyIDs that are animated. In order to provide the list of animated properties and their
values when calling getKeyframes(), we need to be able to read back from the RenderStyle we create. As a first step
towards this goal, we factor some code in ComputedStyleExtractor::propertyValue() out into a new method
ComputedStyleExtractor::valueForPropertyinStyle() which takes in an explicit RenderStyle.
No test as this is simply refactoring that doesn't change or add behavior.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSComputedStyleDeclaration.h:
2018-01-09 Youenn Fablet <youenn@apple.com>
SWClientConnection should not keep references to service worker jobs
https://bugs.webkit.org/show_bug.cgi?id=181381
Reviewed by Chris Dumez.
Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
Instead pass job identifiers and related data to the main thread.
Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::scheduleJob):
(WebCore::SWClientConnection::failedFetchingScript):
(WebCore::SWClientConnection::postTaskForJob):
(WebCore::SWClientConnection::jobRejectedInServer):
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::unregistrationJobResolvedInServer):
(WebCore::SWClientConnection::startScriptFetchForServer):
(WebCore::SWClientConnection::clearPendingJobs):
(WebCore::SWClientConnection::finishedFetchingScript): Deleted.
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::rejectJob):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::resolveUnregistrationJob):
(WebCore::SWServer::startScriptFetch):
* workers/service/server/SWServer.h:
2018-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r224460): Text fields sometimes get "messed up"
https://bugs.webkit.org/show_bug.cgi?id=181115
Reviewed by Zalan Bujtas.
Add the scroll position to paint offset before computing the clip rectangle. Before r224460, scroll position was
substracted after the clip rectangle was computed.
* rendering/LayoutState.cpp:
(WebCore::LayoutState::computeClipRect):
2018-01-09 Ali Juma <ajuma@chromium.org>
Implement VisualViewport API events
https://bugs.webkit.org/show_bug.cgi?id=179386
Reviewed by Frédéric Wang.
Implement the events (resize and scroll) defined by the Visual Viewport API
(https://wicg.github.io/visual-viewport/#events).
This is behind the VisualViewportAPI experimental feature flag.
In order to detect when events need to be fired, change the computation of
Visual Viewport attributes to happen whenever the layout viewport is updated
rather than only on-demand.
Tests: fast/visual-viewport/resize-event-fired-window-resized.html
fast/visual-viewport/resize-event-fired.html
fast/visual-viewport/scroll-event-fired.html
* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded):
Add support for tracking resize event listeners.
* dom/Document.h:
* dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
(WebCore::DocumentEventQueue::enqueueScrollEvent):
Factored out of enqueueOrDispatchScrollEvent so that this logic can be reused
for Visual Viewport scroll events.
(WebCore::DocumentEventQueue::enqueueResizeEvent):
(WebCore::DocumentEventQueue::pendingEventTimerFired):
* dom/DocumentEventQueue.h:
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
* page/VisualViewport.cpp:
(WebCore::VisualViewport::addEventListener):
(WebCore::layoutIfNonNull):
(WebCore::VisualViewport::offsetLeft const):
Remove attribute computation logic since this now happens during update().
(WebCore::VisualViewport::offsetTop const): Ditto.
(WebCore::VisualViewport::pageLeft const): Ditto.
(WebCore::VisualViewport::pageTop const): Ditto.
(WebCore::VisualViewport::width const): Ditto.
(WebCore::VisualViewport::height const): Ditto.
(WebCore::VisualViewport::scale const):
(WebCore::VisualViewport::update):
Added. Computes all of the Visual Viewport attributes and determines
whether events need to be fired.
(WebCore::VisualViewport::enqueueResizeEvent):
(WebCore::VisualViewport::enqueueScrollEvent):
(WebCore::getFrameViewAndLayoutIfNonNull): Deleted.
* page/VisualViewport.h:
2018-01-09 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME] Add the CENC initData support in ClearKey CDM
https://bugs.webkit.org/show_bug.cgi?id=180081
Reviewed by Xabier Rodriguez-Calvar.
Add the "cenc" initDataType support in ClearKey CDM.
Parse the CENC initData and extract the KIDs by following the W3C spec
https://www.w3.org/TR/eme-initdata-cenc/#common-system
Tests: media/encrypted-media/clearKey/clearKey-message-cenc-event.html
media/encrypted-media/clearKey/clearKey-message-cenc-event-mse.html
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::extractKeyidsLocationFromCencInitData):
(WebCore::isCencInitData):
(WebCore::extractKeyidsFromCencInitData):
(WebCore::CDMPrivateClearKey::supportsInitDataType const):
(WebCore::CDMPrivateClearKey::supportsInitData const):
(WebCore::CDMInstanceClearKey::requestLicense):
2018-01-09 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Pass state values directly to Cairo operations
https://bugs.webkit.org/show_bug.cgi?id=181389
Reviewed by Carlos Garcia Campos.
Instead of passing reference to the GraphicsContextState object to
various Cairo operations, only pass the required state values. This
makes it explicit what state values are used in these operations, at the
expense of some long parameter lists, but this will be better addressed
by future refactoring of this code into more concise functions.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::dashedLineCornerWidthForStrokeWidth):
(WebCore::Cairo::dashedLinePatternWidthForStrokeWidth):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawRect):
(WebCore::Cairo::drawLine):
(WebCore::Cairo::drawEllipse):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
2018-01-09 Ryosuke Niwa <rniwa@webkit.org>
Release assert in addResourceTiming when a cache resource is requested during style recalc
https://bugs.webkit.org/show_bug.cgi?id=181137
<rdar://problem/35666574>
Reviewed by Simon Fraser.
Make the dispatching of resourcetimingbufferfull event asynchronous to avoid dispatching it
synchronously during a style resolution when CachedResourceLoader::requestImage requests
a previously loaded image.
We now schedule a timer when the resource timing buffer becomes full, and dispatch the event
when the timer fires. Meanwhile, we have a backup buffer to which additional resource timing
entries would be added. Once the event is dispatched, we refill the buffer exposed to author
scripts. When refilling the buffer results in it becoming full again, we keep repeating the
process of firing resourcetimingbufferfull and re-filling the buffer until either we stop
making progress (i.e. the script didn't increase the number of empty entires in the buffer)
or the backup buffer (at the time we started this process) becomes empty.
Also fixed a bug that we were firing resourcetimingbufferfull event when the last entry that
fits within the buffer size was added instead of when an entry is being added to an already
full buffer. To make this work, the patch introduces m_resourceTimingBufferFullFlag,
representing the concept "resource timing buffer full" flag in the resource timing specification.
Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-crash.html
* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::clearResourceTimings):
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::addResourceTiming):
(WebCore::Performance::resourceTimingBufferFullTimerFired):
* page/Performance.h:
2018-01-08 Chris Nardi <csnardi1@gmail.com>
::first-letter incorrectly selects grapheme pairs
https://bugs.webkit.org/show_bug.cgi?id=181315
Reviewed by Darin Adler.
Grapheme pairs were incorrectly selected by ::first-letter. This
change fixes their selection.
Tests: Updated fast/css/first-letter-punctuation.html and imported
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo-4/first-letter-004.html
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::isPunctuationForFirstLetter):
(WebCore::shouldSkipForFirstLetter):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2018-01-08 Darin Adler <darin@apple.com>
Special list-item counter starts from an incorrect number for ::before and ::after
https://bugs.webkit.org/show_bug.cgi?id=181084
Reviewed by Zalan Bujtas.
Test: fast/css/counters/counter-list-item.html
* Sources.txt: Removed CounterDirectives.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::counterToCSSValue): Updated for changes to the CounterDirectives struct.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritCounter): Ditto.
(WebCore::StyleBuilderCustom::applyValueCounter): Ditto.
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::parseValue): Call setExplicitValue(std::nullopt) instead
of clearExplicitValue since we are using std::optional now.
* rendering/RenderCounter.cpp:
(WebCore::listItemCounterDirectives): Added. Computes the counter directives that
express the effects on the list-item counter from list item and list elements.
Used something as close to what the CSS 3 draft says as possible. This uses a
negative increment when creating a list to counteract the positive increment done
by a list element, except in the case of an unordered list. This is where the bug
fix actually lies. Also fixed handling of reversed ordered lists at the same time.
(WebCore::planCounter): Refactored to use the function above. Also changed the
code to pay attention to both the counter directives and the implicit ones from
list item and list elements, getting as close as possible to what the specification
seems to call for.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::RenderListItem): Since we are using std::optional and no
longer using bit fields, simplified the constructor for each list item.
(WebCore::RenderListItem::calcValue const): Deleted.
(WebCore::RenderListItem::updateValueNow const): Merged in all the code from the
old calcValue function, but it is also simpler now since m_value is std::optional.
(WebCore::RenderListItem::updateValue): Updated to use std::optional.
(WebCore::RenderListItem::setExplicitValue): Ditto.
(WebCore::RenderListItem::clearExplicitValue): Deleted.
(WebCore::RenderListItem::updateListMarkerNumbers): Updated to use std::optional.
(WebCore::RenderListItem::isInReversedOrderedList const): Added. This is used by
the counter code so it can decrement instead of incrementing.
* rendering/RenderListItem.h: Updated to use std::optional. Also marked functions
final instead of override and initialized m_notInList after making it not be a
bitfield any more.
* rendering/style/CounterDirectives.cpp: Removed.
* rendering/style/CounterDirectives.h: Removed most of the CounterDirectives
class and replaced it with a struct with two std::optional. Added an addClamped
function so the counter code can share it with the addIncrementValue function.
If we want to make a faster version that doesn't use double, we can come back
and do that. Also moved the == function to the header since the implementation
is so trivial.
* rendering/style/StyleAllInOne.cpp: Removed CounterDirectives.cpp.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated to
use std::make_unique directly instead of using a clone function.
2018-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Expose HTMLAttachmentElement.uniqueIdentifier to bindings
https://bugs.webkit.org/show_bug.cgi?id=181420
<rdar://problem/36365827>
Reviewed by Alex Christensen.
Add a new IDL definition for uniqueIdentifier on HTMLAttachmentElement. This allows clients to relate attachment
elements in the DOM to _WKAttachments delivered via Objective-C SPI.
Adjusted existing tests in WKAttachmentTests.
* html/HTMLAttachmentElement.idl:
2018-01-08 Don Olmstead <don.olmstead@sony.com>
AccessibilityARIAGrid does not compile when accessibility is disabled
https://bugs.webkit.org/show_bug.cgi?id=181418
<rdar://problem/36365398>
Reviewed by Chris Fleizach.
No new tests. No change in behavior.
* accessibility/AccessibilityARIAGrid.cpp:
2018-01-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226532 and r226540.
https://bugs.webkit.org/show_bug.cgi?id=181422
jessie says basic browsing does not seem to work (Requested by
alexchristensen on #webkit).
Reverted changesets:
"Add CSP support to service workers"
https://bugs.webkit.org/show_bug.cgi?id=181385
https://trac.webkit.org/changeset/226532
"SWClientConnection should not keep references to service
worker jobs"
https://bugs.webkit.org/show_bug.cgi?id=181381
https://trac.webkit.org/changeset/226540
2018-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Expose file name and content type of WKAttachment
https://bugs.webkit.org/show_bug.cgi?id=181390
<rdar://problem/36336837>
Reviewed by Tim Horton.
Add new structs in AttachmentTypes.h and refactor HTMLAttachmentElement::requestData to requestInfo. See below
for more details. Augmented existing API tests in WKAttachmentTests.
* html/AttachmentTypes.h:
Add a struct to represent a snapshot of information about an attachment element.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::requestInfo):
(WebCore::HTMLAttachmentElement::requestData): Deleted.
* html/HTMLAttachmentElement.h:
Change requestData to requestInfo. Instead of fetching and delivering data via callback, requestInfo returns an
AttachmentInfo.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderAttachmentInfo::addLine):
(WebCore::RenderAttachmentInfo::buildWrappedLines):
(WebCore::RenderAttachmentInfo::buildSingleLine):
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
(WebCore::RenderThemeIOS::attachmentBaseline const):
(WebCore::paintAttachmentIcon):
(WebCore::paintAttachmentText):
(WebCore::paintAttachmentProgress):
(WebCore::attachmentBorderPath):
(WebCore::RenderThemeIOS::paintAttachment):
(WebCore::AttachmentInfo::addLine): Deleted.
(WebCore::AttachmentInfo::buildWrappedLines): Deleted.
(WebCore::AttachmentInfo::buildSingleLine): Deleted.
(WebCore::AttachmentInfo::AttachmentInfo): Deleted.
Rename AttachmentInfo to RenderAttachmentInfo to resolve a name conflict with the new AttachmentInfo struct.
2018-01-08 Saam Barati <sbarati@apple.com>
Speculative build fix after r226600. We only use clflush on x86 and the `asm volatile` syntax is not available in the Windows build.
No new tests because this is a build fix.
* dom/Comment.cpp:
(WebCore::Comment::clflushReadLength):
2018-01-08 Michael Saboff <msaboff@apple.com>
Add a DOM gadget for Spectre testing
https://bugs.webkit.org/show_bug.cgi?id=181351
Reviewed by Saam Barati.
This change is used to test Spectre mitigations.
Added a side data array to the Comment DOM node to test for Spectre issues in
the DOM layer. This additional functionality is disabled by default and must
be enabled through the JSC option "enableSpectreGadgets".
* dom/Comment.cpp:
(WebCore::Comment::Comment):
(WebCore::Comment::setReadLength):
(WebCore::Comment::charCodeAt):
(WebCore::Comment::clflushReadLength):
* dom/Comment.h:
* dom/Comment.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
* page/RuntimeEnabledFeatures.h:
2018-01-08 Said Abou-Hallawa <sabouhallawa@apple.com>
A canvas should not be tainted if it draws a data URL SVGImage with a <foreignObject>
https://bugs.webkit.org/show_bug.cgi?id=180301
Reviewed by Dean Jackson.
Don't taint the canvas if it draws a data URL SVGImage with a <foreignObject>.
There should not be a cross-origin data leak in this case.
Tests: svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html
svg/as-image/svg-canvas-data-url-svg-with-foreign-object-not-tainted.html
svg/as-image/svg-canvas-data-url-svg-with-image-not-tainted.html
* html/ImageBitmap.cpp:
(WebCore::taintsOrigin):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
2018-01-08 Don Olmstead <don.olmstead@sony.com>
Simplify platform checks in Graphics Context
https://bugs.webkit.org/show_bug.cgi?id=181344
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/GLContext.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking const):
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move SVG addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181405
<rdar://problem/36360476>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addChild):
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::addChild):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::addChild):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToSVGContainer):
(WebCore::RenderTreeBuilder::insertChildToSVGInline):
(WebCore::RenderTreeBuilder::insertChildToSVGRoot):
(WebCore::RenderTreeBuilder::insertChildToSVGText):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::SVGBuilder):
* rendering/updating/RenderTreeBuilderSVG.cpp: Added.
(WebCore::RenderTreeBuilder::SVG::SVG):
(WebCore::RenderTreeBuilder::SVG::insertChild):
* rendering/updating/RenderTreeBuilderSVG.h: Added.
2018-01-08 John Wilander <wilander@apple.com>
Storage Access API: Remove access for all frames under a page when the page is closed
https://bugs.webkit.org/show_bug.cgi?id=181398
<rdar://problem/36357879>
Reviewed by Alex Christensen.
No new tests. Discussed with Alex Christensen and we concluded that
both a layout test and an API test would require a lot of work and
we have existing tests for clearing out storage access for frames.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
2018-01-08 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r226385.
The test introduced with this was a flaky since being added.
Reverted changeset:
"AX: when invert colors is on, double-invert certain media
elements in UserAgentStyleSheet"
https://bugs.webkit.org/show_bug.cgi?id=168447
https://trac.webkit.org/changeset/226385
2018-01-08 Youenn Fablet <youenn@apple.com>
SWClientConnection should not keep references to service worker jobs
https://bugs.webkit.org/show_bug.cgi?id=181381
Reviewed by Chris Dumez.
Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
Instead pass job identifiers and related data to the main thread.
Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::scheduleJob):
(WebCore::SWClientConnection::failedFetchingScript):
(WebCore::SWClientConnection::postTaskForJob):
(WebCore::SWClientConnection::jobRejectedInServer):
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::unregistrationJobResolvedInServer):
(WebCore::SWClientConnection::startScriptFetchForServer):
(WebCore::SWClientConnection::clearPendingJobs):
(WebCore::SWClientConnection::finishedFetchingScript): Deleted.
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::rejectJob):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::resolveUnregistrationJob):
(WebCore::SWServer::startScriptFetch):
* workers/service/server/SWServer.h:
2018-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
Copying, pasting, and then deleting an attachment element breaks attachment data requests
https://bugs.webkit.org/show_bug.cgi?id=181365
<rdar://problem/36340647>
Reviewed by Tim Horton.
Currently, copying and pasting an attachment element within the same document and then deleting backwards to
remove the pasted attachment element causes the original attachment element to be inaccessible via SPI. This is
because there are now two different attachment elements with the same unique identifier, such that Document,
which keeps a map of all unique attachment identifiers to attachment elements, will lose track of the original
attachment element.
To fix this, we ensure that attachment elements should always have unique identifiers when they are inserted
into the document. We make several small adjustments to accomplish this:
1. First, refactor HTMLAttachmentElement's unique identifier so that it no longer depends on the value of the
"webkitattachmentid" attribute, and is instead just a member of HTMLAttachmentElement that is not exposed to
DOM bindings. This means setting and querying an attachment element's uniqueIdentifier can be done without
triggering any side effects, such as layout or mutation events.
2. Next, make "webkitattachmentid" a temporary attribute similar to "webkitattachmentpath" and
"webkitattachmentbloburl", so that it is added only when generating a markup fragment for editing, and
removed upon deserialization.
3. Lastly, shift the responsibility of assigning a unique identifier to an attachment away from places where we
create attachment elements, and instead have Document enforce this when an attachment element is inserted.
Tests: WKAttachmentTests.InsertAndRemoveDuplicateAttachment
WKAttachmentTests.InsertDuplicateAttachmentAndUpdateData
* dom/Document.cpp:
(WebCore::Document::didInsertAttachmentElement):
Assign the unique identifier of an attachment element that has been inserted. If the identifier already tracks
an existing attachment element in the document or is missing, reassign the identifier to a new value.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentForImageAttachment):
(WebCore::replaceRichContentWithAttachments):
(WebCore::WebContentReader::readFilePaths):
Remove calls to setUniqueIdentifier here, since Document will assign a unique identifier upon insertion.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendCustomAttributes):
(WebCore::createFragmentFromMarkup):
Set the attachment's unique identifier to the value of the "webkitattachmentid" attribute. When moving existing
attachments around in the DOM without duplication, this ensures that the attachment will be removed and
reinserted in the document without triggering removal and insertion client delegate methods.
When pasting an attachment element that has the same identifier as an existing attachment, we let Document
realize that the attachment identifier already exists, and reassign it to a unique value.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::uniqueIdentifier const): Deleted.
(WebCore::HTMLAttachmentElement::setUniqueIdentifier): Deleted.
* html/HTMLAttachmentElement.h:
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlockFlow addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181348
<rdar://problem/36328117>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::blockFlowBuilder):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp: Added.
(WebCore::RenderTreeBuilder::BlockFlow::BlockFlow):
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderBlockFlow.h: Added.
2018-01-08 Youenn Fablet <youenn@apple.com>
Add CSP support to service workers
https://bugs.webkit.org/show_bug.cgi?id=181385
Reviewed by Chris Dumez.
Covered by rebased tests.
Added recovery of CSP information from WorkerScriptLoader.
Added plumbing to pass the CSP information to Service Workers.
Added persistency support for the CSP information.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::contentSecurityPolicy const):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::finishedFetchingScript):
(WebCore::SWClientConnection::failedFetchingScript):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_contentSecurityPolicy):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:
2018-01-08 Youenn Fablet <youenn@apple.com>
Use no-cache fetch mode when loading main documents with location.reload()
https://bugs.webkit.org/show_bug.cgi?id=181285
Reviewed by Alex Christensen.
Covered by rebased tests.
Start to translate cache policy used for navigation as FetchOptions::Cache.
This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
Keep reload mode for ReloadFromOrigin.
* loader/DocumentLoader.cpp:
(WebCore::toFetchOptionsCache):
(WebCore::DocumentLoader::loadMainResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::defaultRequestCachingPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/NavigationScheduler.cpp:
2018-01-08 Youenn Fablet <youenn@apple.com>
Stop exposing fetch and extendable events to window
https://bugs.webkit.org/show_bug.cgi?id=181325
Reviewed by Chris Dumez.
Covered by updated tests.
Marked FetchEvent and ExtendableEvent as visible in ServiceWorker environments only.
Moved related Internals testing routines to ServiceWorkerInternals.
* testing/Internals.cpp:
(WebCore::Internals::waitForFetchEventToFinish): Deleted.
(WebCore::Internals::createBeingDispatchedFetchEvent): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
(WebCore::ServiceWorkerInternals::createBeingDispatchedFetchEvent):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
* workers/service/ExtendableEvent.idl:
* workers/service/FetchEvent.idl:
2018-01-08 Antti Koivisto <antti@apple.com>
REGRESSION (r219145): Toggling layer borders on a static document no longer works immediately
https://bugs.webkit.org/show_bug.cgi?id=176260
<rdar://problem/34219966>
Reviewed by Simon Fraser.
Optimization reveled bugs in debug indicator painting.
Test: compositing/debug-borders-dynamic.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateDebugIndicators):
(WebCore::GraphicsLayerCA::updateDebugBorder): Deleted.
- Rename to indicate this is not just about debug borders.
- Trigger display so repaint counters get painted. This helper is only called when the indicators change.
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
Ensure we do compositing update on debug border change even when there is no layout.
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderInline addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181336
<rdar://problem/36324693>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild):
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::childBecameNonInline):
(WebCore::nextContinuation): Deleted.
(WebCore::RenderInline::continuationBefore): Deleted.
(WebCore::newChildIsInline): Deleted.
(WebCore::RenderInline::cloneAsContinuation const): Deleted.
(WebCore::RenderInline::splitInlines): Deleted.
(WebCore::RenderInline::splitFlow): Deleted.
(WebCore::canUseAsParentForContinuation): Deleted.
(WebCore::RenderInline::addChildToContinuation): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderInline):
(WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation):
(WebCore::RenderTreeBuilder::splitFlow):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::inlineBuilder):
* rendering/updating/RenderTreeBuilderInline.cpp: Added.
(WebCore::canUseAsParentForContinuation):
(WebCore::nextContinuation):
(WebCore::continuationBefore):
(WebCore::cloneAsContinuation):
(WebCore::newChildIsInline):
(WebCore::inFlowPositionedInlineAncestor):
(WebCore::RenderTreeBuilder::Inline::Inline):
(WebCore::RenderTreeBuilder::Inline::insertChild):
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::splitFlow):
(WebCore::RenderTreeBuilder::Inline::splitInlines):
* rendering/updating/RenderTreeBuilderInline.h: Added.
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181319
<rdar://problem/36313464>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChild):
(WebCore::RenderBlock::addChildIgnoringContinuation):
(WebCore::RenderBlock::childBecameNonInline):
(WebCore::RenderBlock::continuationBefore): Deleted.
(WebCore::RenderBlock::addChildToContinuation): Deleted.
(WebCore::getInlineRun): Deleted.
(WebCore::RenderBlock::makeChildrenNonInline): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::markBoxForRelayoutAfterSplit): Deleted.
(WebCore::RenderBox::splitAnonymousBoxesAroundChild): Deleted.
* rendering/RenderBox.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveChildren):
(WebCore::RenderRubyBase::moveBlockChildren):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::markBoxForRelayoutAfterSplit):
(WebCore::getInlineRun):
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderBlock):
(WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::blockBuilder):
* rendering/updating/RenderTreeBuilderBlock.cpp: Added.
(WebCore::continuationBefore):
(WebCore::RenderTreeBuilder::Block::Block):
(WebCore::RenderTreeBuilder::Block::insertChild):
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderBlock.h: Added.
2018-01-08 Jeremy Jones <jeremyj@apple.com>
Standard controls sometimes say video is in pip when it isnt.
https://bugs.webkit.org/show_bug.cgi?id=181095
rdar://problem/36182687
Reviewed by Eric Carlson.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::exitFullscreen):
2018-01-08 Jer Noble <jer.noble@apple.com>
REGRESSION: [iOS] ASSERTION FAILED: !node.isConnected() in WebCore::notifyNodeInsertedIntoDocument
https://bugs.webkit.org/show_bug.cgi?id=181091
Reviewed by Darin Adler.
Move the work previously performed in insertedIntoAncestor() into didFinishInsertingNode().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):
2018-01-08 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use isolated fill and stroke source containers
https://bugs.webkit.org/show_bug.cgi?id=181386
Reviewed by Carlos Garcia Campos.
Generate fill and stroke source objects upon invocation of various Cairo
operations, initializing necessary data from the GraphicsContextState
object.
Cairo::FillSource and Cairo::StrokeSource structs are introduced, both
being default-constructible as well as providing a constructor that
accepts a GraphicsContextState object from which the appropriate
resources are created.
The FillSource and StrokeSource objects are then passed to
PlatformContextCairo's prepareForFilling() and prepareForStroking()
methods. Here the helper prepareCairoContextSource() function is now
invoked with cairo_pattern_t objects as pattern or gradient sources, or
the source color if neither cairo_pattern_t object is specified.
The FillSource and StrokeSource constructors mimic the previous behavior
of prepareCairoContextSource(). In case the source is a Pattern object,
a cairo_pattern_t object is created from that. In case of FillSource,
we also retrieve pattern size, transform and repetition information. In
case the source os a Gradient object, we create a 'base' cairo_pattern_t
object for a completely opaque alpha channel. Additionally, if the alpha
value on the state is not 1, we create an alpha-adjusted cairo_pattern_t
that is potentially used for any filling or stroking operation that has
to preserve transparency. If neither Pattern or Gradient objects are set
on the GraphicsContextState, we default to the current fill or stroke
color.
Overall, there's no change in behavior, this is simply a refactoring
that enables us to construct Cairo objects for filling and stroking
sources at the time of Cairo operation dispatch, instead of pulling down
GraphicsContextState deeper into the Cairo-specific code.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::prepareCairoContextSource):
(WebCore::PlatformContextCairo::prepareForFilling):
(WebCore::PlatformContextCairo::prepareForStroking):
(WebCore::PlatformContextCairo::clipForPatternFilling):
* platform/graphics/cairo/PlatformContextCairo.h:
2018-01-08 Youenn Fablet <youenn@apple.com>
navigator.onLine does not work inside service workers
https://bugs.webkit.org/show_bug.cgi?id=181079
<rdar://problem/36178606>
Reviewed by Darin Adler.
Test: http/wpt/service-workers/online.https.html
Added support for onLine by reusing a similar implementation as regular workers.
Added ServiceWorkerInternals as an interface for an object exposed as self.internals in WTR.
This object has currently one method to trigger change in the online/offline status.
This allows writing a test for the onLine feature.
Note that self.internals is inserted asynchronously after the script was evaluated.
When writing a worker script using self.internals, one must make sure to use self.internals when initialized.
online-worker.js for instance makes use of self.internals in a postMessage callback.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WorkerScriptController.h:
* dom/ScriptExecutionContext.h:
* testing/ServiceWorkerInternals.cpp: Added.
(WebCore::ServiceWorkerInternals::ServiceWorkerInternals):
(WebCore::ServiceWorkerInternals::setOnline):
* testing/ServiceWorkerInternals.h: Added.
* testing/ServiceWorkerInternals.idl: Added.
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setupNewlyCreateServiceWorker):
* testing/js/WebCoreTestSupport.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
(WebCore::SWContextManager::startedServiceWorker):
* workers/service/context/SWContextManager.h:
(WebCore::SWContextManager::setServiceWorkerCreationCallback):
(WebCore::SWContextManager::workerByID):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::~ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::networkStateChanged):
(WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-01-08 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Contain shadow blur requirement state in a separate object
https://bugs.webkit.org/show_bug.cgi?id=181380
Reviewed by Carlos Garcia Campos.
Instead of picking up the necessary state parameters from a
GraphicsContextState object, store the necessary parameters in a helper
ShadowBlurUsage struct. Mimicking the mustUseShadowBlur() function that
is being removed, values of the shadow color, shadow blur, and shadow
transform ignorance are stored there. Additionally, the required()
method accepts a PlatformContextCairo object through which it can
retrieve the current CTM and determine whether it's an identity, finally
deciding whether shadow blur can or cannot be ignored.
Goal of this change is to limit usage of GraphicsContextState directly
in operations implemented inside the Cairo namespace. Instead, the
state parameters should be passed directly, or an equivalent but limited
state object should be constructed for invocation of such operations.
This is likely only an intermediate solution. It's possible it will be
replaced by a more complete shadow state struct that would be used for
any operation that is required to draw shadows, if necessary.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage):
(WebCore::Cairo::ShadowBlurUsage::required const):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::mustUseShadowBlur): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
2018-01-08 Philippe Normand <pnormand@igalia.com>
[GStreamer][Soup] Remove dead getCreateOrReadBuffer code path
https://bugs.webkit.org/show_bug.cgi?id=181376
Reviewed by Carlos Garcia Campos.
This code path is no longer used now that the GStreamer HTTP
source element uses data coming directly from the network process.
* SourcesGTK.txt:
* SourcesWPE.txt:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::getOrCreateReadBuffer): Deleted.
* loader/MediaResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cache/CachedRawResource.h:
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
(WebCore::CachedRawResourceClient::getOrCreateReadBuffer): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::getOrCreateReadBuffer): Deleted.
* loader/soup/CachedRawResourceSoup.cpp: Removed.
* loader/soup/SubresourceLoaderSoup.cpp: Removed.
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::loadFinished):
(WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Deleted.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::getOrCreateReadBuffer): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::getOrCreateReadBuffer): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::ensureReadBuffer):
2018-01-08 Zan Dobersek <zdobersek@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] use FastMalloc-based GstAllocator
https://bugs.webkit.org/show_bug.cgi?id=165793
Reviewed by Philippe Normand.
Add GstAllocatorFastMalloc, a GstAllocator implementation using fast malloc. It's only used when fast malloc is
enabled and can be disabled using an environment variable for debugging purposes.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: Added.
(gstMemoryFastMallocNew):
(gstAllocatorFastMallocAlloc):
(gstAllocatorFastMallocFree):
(gstAllocatorFastMallocMemMap):
(gstAllocatorFastMallocMemUnmap):
(gstAllocatorFastMallocMemCopy):
(gstAllocatorFastMallocMemShare):
(gstAllocatorFastMallocMemIsSpan):
(gst_allocator_fast_malloc_class_init):
(gst_allocator_fast_malloc_init):
* platform/graphics/gstreamer/GstAllocatorFastMalloc.h: Added.
2018-01-07 Ms2ger <Ms2ger@igalia.com>
Implement createImageBitmap(ImageBitmap)
https://bugs.webkit.org/show_bug.cgi?id=181287
Reviewed by Darin Adler.
Tests: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
2018-01-07 Ryosuke Niwa <rniwa@webkit.org>
Reduce the precision of "high" resolution time to 1ms
https://bugs.webkit.org/show_bug.cgi?id=180910
<rdar://problem/36085943>
Reviewed by Saam Barati.
Reduced the high prevision time's resolution to 1ms, the same precision as Date.now().
Also fixed the bug in fillRTCStats that we weren't reducing the time resolution in RTCStats dictionaries.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillRTCStats):
* page/Performance.cpp:
(WebCore::Performance::reduceTimeResolution):
2018-01-06 Simon Fraser <simon.fraser@apple.com>
Possible crash computing event regions
https://bugs.webkit.org/show_bug.cgi?id=181368
rdar://problem/34847081
Reviewed by Zalan Bujtas.
Don't trigger layout in Element::absoluteEventHandlerBounds(), since this can run arbirary script
which might delete elements or re-enter Document::absoluteRegionForEventTargets().
It's OK to not trigger layout, because if layout is dirty, the next layout will update event regions again.
Add a LayoutDisallowedScope to check that Document::absoluteRegionForEventTargets() doesn't
trigger layout, and move the check for LayoutDisallowedScope::isLayoutAllowed() from Document::updateLayout()
to LayoutContext::layout(), since some layouts don't happen via the former (e.g. the one being removed here).
The test checks that the assertion does not fire. I was not able to get a reliable test for any crash.
Test: fast/events/event-handler-regions-layout.html
* dom/Document.cpp:
(WebCore::Document::updateLayout):
(WebCore::Document::absoluteRegionForEventTargets):
* dom/Element.cpp:
(WebCore::Element::absoluteEventHandlerBounds):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout):
* rendering/LayoutDisallowedScope.h: Move the #ifdefs around to avoid defining the enum twice.
(WebCore::LayoutDisallowedScope::LayoutDisallowedScope):
(WebCore::LayoutDisallowedScope::isLayoutAllowed):
2018-01-06 Simon Fraser <simon.fraser@apple.com>
Crash under RenderLayer::scrollTo() with marquee
https://bugs.webkit.org/show_bug.cgi?id=181349
rdar://problem/36190168
Reviewed by Zalan Bujtas.
Don't call updateWidgetPositions() synchonously during RenderLayer scrolling, because it
can run arbitrary script which may trigger destruction of this RenderLayer.
Instead, queue up updateWidgetPositions() on a zero-delay timer.
Under some circumstances this may allow a paint to occur before the widgets have been
updated (which could be fixed with a more invasive change), but in practice I saw no
painting issues with plug-ins or iframes inside overflow scroll, in WebKit or LegacyWebKit.
Test: fast/scrolling/marquee-scroll-crash.html
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::updateWidgetPositions):
(WebCore::FrameView::scheduleUpdateWidgetPositions):
(WebCore::FrameView::updateWidgetPositionsTimerFired):
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
2018-01-05 Dean Jackson <dino@apple.com>
Accurately clip copyTexImage2D and copyTexSubImage2D
https://bugs.webkit.org/show_bug.cgi?id=181356
<rdar://problem/35083877>
Reviewed by Eric Carlson.
The code to make sure copyTexSubImage2D and copyTexImage2D will not try to read
out of bounds had a bad bug introduced here:
https://bugs.webkit.org/show_bug.cgi?id=51421
With appropriate parameters, it would produce a rectangle with
negative dimensions. Most GL drivers just ignored this, but some
are not happy.
Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d-bad-input.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::clip2D): Reimplement this in a more sane manner, and use
checked arithmetic while here.
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::clip1D): Deleted.
(WebCore::clip2D): Deleted.
2018-01-06 Antti Koivisto <antti@apple.com>
Use WeakPtr for RenderTreePosition::m_nextSibling
https://bugs.webkit.org/show_bug.cgi?id=181363
Reviewed by Zalan Bujtas.
For safety. In most cases it is null and won't cause us to instantiate WeakReferences for
many new objects.
* rendering/updating/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::computeNextSibling):
* rendering/updating/RenderTreePosition.h:
(WebCore::RenderTreePosition::RenderTreePosition):
(WebCore::RenderTreePosition::nextSibling const):
2018-01-05 David Kilzer <ddkilzer@apple.com>
Re-enable -Wcast-qual in WebCore for Apple ports
<https://webkit.org/b/177895>
<rdar://problem/34960830>
Reviewed by Joseph Pecoraro.
* Configurations/Base.xcconfig:
(WARNING_CFLAGS): Remove FIXME and add -Wcast-qual back to
arguments.
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey):
- Use checked_cf_cast<SecACLRef>().
* editing/cocoa/DataDetection.mm:
(WebCore::detectItemAtPositionWithRange):
- Manually cast CFTypeRef to DDResultRef until
DDResultGetTypeID() is available as SPI.
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::initElementsFromArray):
- Use checked_cf_cast<IOHIDElementRef>().
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::createImageSample):
(WebCore::CMSampleBufferIsRandomAccess):
(WebCore::CMSampleBufferIsNonDisplaying):
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy const):
- Use checked_cf_cast<CFMutableDictionaryRef>() and
checked_cf_cast<CFDictionaryRef>().
* platform/graphics/cocoa/IOSurface.h:
(WebCore::IOSurface::asLayerContents):
- Use reinterpret_cast<id>() to cast from IOSurfaceRef to id.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
(WebCore::WebCoreDecompressionSession::automaticDequeue):
(WebCore::WebCoreDecompressionSession::imageForTime):
(WebCore::WebCoreDecompressionSession::getDecodeTime):
(WebCore::WebCoreDecompressionSession::getPresentationTime):
(WebCore::WebCoreDecompressionSession::getDuration):
- Use checked_cf_cast<CMSampleBufferRef>().
* platform/graphics/Font.h:
(WebCore::Font::m_kernedCFStringAttributes):
(WebCore::Font::m_nonKernedCFStringAttributes):
- Change type from RetainPtr<CFDictionaryRef> to
RetainPtr<CFMutableDictionaryRef> since that's what they are.
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes const):
- Replace local `mutableAttributes` variable with
`attributesDictionary.get()` since it returns the correct type
now.
* platform/ios/wak/WAKView.mm:
(-[WAKView _initWithViewRef:]):
(_WAKCopyWrapper):
* platform/ios/wak/WKView.mm:
(_WKViewClearSuperview):
(WKViewFirstChild):
(WKViewNextSibling):
- Use static_cast<WKViewRef>(const_cast<void*>()) to convert
const void* variable to WKViewRef.
* platform/mac/PasteboardMac.mm:
(WebCore::flipImageSpec):
(WebCore::setDragImageImpl):
- Use const_cast<> to remove 'const' modifier from
unsigned char pointers. This regressed while -Wcast-qual was
disabled for WebCore.
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString):
- Use checked_cf_cast<SecACLRef>().
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
- Use checked_cf_cast<CFMutableDictionaryRef>().
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::copyCONNECTProxyResponse):
- Use checked_cf_cast<CFHTTPMessageRef>().
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
- Use checked_cf_cast<SecTrustRef>().
* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate const):
(WebCore::CertificateInfo::dump const):
- Use checked_cf_cast<SecCertificateRef>().
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData):
- Use checked_cf_cast<>() for CFMutable* types.
2018-01-05 John Wilander <wilander@apple.com>
Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
https://bugs.webkit.org/show_bug.cgi?id=181357
<rdar://problem/36331031>
Reviewed by Alex Christensen.
No new tests. The only changed functionality that isn't covered
by existing tests is cross-origin iframes in the same partition
should be handled as already having access. This cannot be
tested in layout tests since they don't support subdomains.
This change does the following:
- Changes function and message names to reflect how this feature
was eventually implemented, i.e. access per frame.
- Makes it explicit that the UI process is only involved in
granting storage access and not removing storage access.
The latter is done directly by the web process.
- Simplifies the network process' entry map since only needs to
be able to give access to one domain in one frame at a time.
Access goes away on frame navigation so there can only be one
domain at a time per frame. Also, the map now uses pageIDs as
main keys to prepare for efficient access removal for all
frames under a page.
- Fixes a bug in so that a cross-origin iframe with the same
partition as the top frame correctly is handled as already
having access.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
The only change here is the changed named of the call to
NetworkStorageSession::hasStorageAccessForFrame().
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const):
(WebCore::NetworkStorageSession::grantStorageAccessForFrame):
(WebCore::NetworkStorageSession::removeStorageAccessForFrame):
(WebCore::NetworkStorageSession::isStorageAccessGranted const): Deleted.
(WebCore::NetworkStorageSession::setStorageAccessGranted): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccess): Deleted.
2018-01-05 Youenn Fablet <youenn@apple.com>
Implement Cache API partitioning based on ClientOrigin
https://bugs.webkit.org/show_bug.cgi?id=181240
Reviewed by Alex Christensen.
Covered by updated tests.
Previously, cache storage was partitioned according the origin of the client, represented as a String.
We now partition according both client and top origins, represented as a ClientOrigin
Minor refactoring to use more makePendingActivity.
Added support for IPC serialization of ClientOrigin.
Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
* Modules/cache/CacheStorageConnection.cpp:
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::retrieveCaches):
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::clearMemoryRepresentation):
(WebCore::CacheStorageConnection::doOpen):
(WebCore::CacheStorageConnection::doRetrieveCaches):
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::open):
(WebCore::DOMCacheStorage::remove):
* Modules/cache/DOMCacheStorage.h:
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
* Modules/cache/WorkerCacheStorageConnection.h:
* page/ClientOrigin.h:
(WebCore::ClientOrigin::isolatedCopy const):
(WebCore::ClientOrigin::encode const):
(WebCore::ClientOrigin::decode):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::debugString const): Deleted.
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::debugString const):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
2018-01-05 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Add a way to write blob data to a file URL from the UI process
https://bugs.webkit.org/show_bug.cgi?id=181236
Reviewed by Brady Eidson.
Add support for writing a blob to a designated file path. See comments below for more detail. No new tests, as
there change in behavior yet. See part 2: https://bugs.webkit.org/show_bug.cgi?id=181199.
* page/DragController.cpp:
(WebCore::DragController::dragAttachmentElement):
* platform/PromisedBlobInfo.h:
Remove PromisedBlobData entirely. This was added with the premise of having the web process deliver blob data to
the UI process. However, the new approach I'm taking just has the UI process tell the network process to write
a blob to a given location, so a data structure to deliver blob data over IPC is no longer necessary.
(WebCore::PromisedBlobData::hasData const): Deleted.
(WebCore::PromisedBlobData::hasFile const): Deleted.
(WebCore::PromisedBlobData::operator bool const): Deleted.
(WebCore::PromisedBlobData::fulfills const): Deleted.
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
Introduce a new helper to build a list of blob data for file writing.
(WebCore::writeFilePathsOrDataBuffersToFile):
Introduce a new static helper to write blob data (a list of file paths and data buffers) to a given file handle.
Automatically closes the given file handle upon exit.
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
(WebCore::BlobRegistryImpl::writeBlobToFilePath):
Pull out common logic in writeBlobsToTemporaryFiles and writeBlobToFilePath into helper methods (see above), and
refactor both methods to use the helpers.
* platform/network/BlobRegistryImpl.h:
2018-01-05 Alex Christensen <achristensen@webkit.org>
Forbid < and > in URL hosts
https://bugs.webkit.org/show_bug.cgi?id=181308
<rdar://problem/36012757>
Reviewed by Tim Horton.
https://url.spec.whatwg.org/#forbidden-host-code-point does not include these characters yet, but I think it should.
Firefox fails to parse URLs with < or > in the host. Chrome percent encodes them. Safari needs to do something.
The web platform tests are unclear on this case, and they will need to be updated with the specification.
They do show a change in behavior, though.
* platform/URLParser.cpp:
Add < and > to the list of forbidden host code points.
2018-01-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mac screen capture source
https://bugs.webkit.org/show_bug.cgi?id=181333
<rdar://problem/36323219>
Reviewed by Dean Jackson.
* SourcesCocoa.txt: Add ScreenDisplayCaptureSourceMac.mm.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/cocoa/CoreVideoSoftLink.cpp: Declare new constants used.
* platform/cocoa/CoreVideoSoftLink.h:
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::displayReconfigurationCallBack): Call refreshCaptureDevices.
(WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Unregister for display
reconfiguration callbacks.
(WebCore::DisplayCaptureManagerCocoa::captureDevices): Register for display reconfigrations.
(WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Use CGActiveDisplayList to
get list of active screens.
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Validate screen
ID, return CaptureDevice.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::VideoCaptureSourceFactoryMac::createVideoCaptureSource): Deal with screen capture
on macOS.
Implement Mac screen capture with CGDisplayStream.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: Added.
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::~DisplaySurface):
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::operator=):
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::ioSurface const):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: Added.
(WebCore::roundUpToMacroblockMultiple):
(WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID):
(WebCore::ScreenDisplayCaptureSourceMac::create):
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac):
(WebCore::ScreenDisplayCaptureSourceMac::~ScreenDisplayCaptureSourceMac):
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
(WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
(WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface):
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame):
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::applySize):
(WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate):
(WebCore::ScreenDisplayCaptureSourceMac::commitConfiguration):
(WebCore::ScreenDisplayCaptureSourceMac::displayWasReconfigured):
(WebCore::ScreenDisplayCaptureSourceMac::displayReconfigurationCallBack):
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
2018-01-05 Don Olmstead <don.olmstead@sony.com>
[curl] Can't load file:// URL with a URL fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=181170
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2018-01-05 Don Olmstead <don.olmstead@sony.com>
TextCodec uses std::array but does not include it
https://bugs.webkit.org/show_bug.cgi?id=181340
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* platform/text/TextCodec.h:
2018-01-05 Said Abou-Hallawa <sabouhallawa@apple.com>
SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded() should do nothing if the property is not animating
https://bugs.webkit.org/show_bug.cgi?id=181316
<rdar://problem/36147545>
Reviewed by Simon Fraser.
This is a speculative change to fix a crash which appeared after r226065.
The crash is very intermittent and sometimes very hard to reproduce. The
basic code analysis did not show how this crash can even happen.
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues): For SVG property
with two values, e.g. <SVGAngleValue, SVGMarkerOrientType>, we need to
detach the wrappers of the animated property if the animated values are
going to change. This is similar to what we did in resetFromBaseValue().
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
2018-01-05 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r226401.
This caused timeouts on multiple platforms.
Reverted changeset:
"Implement Cache API partitioning based on ClientOrigin"
https://bugs.webkit.org/show_bug.cgi?id=181240
https://trac.webkit.org/changeset/226401
2018-01-05 Dan Bernstein <mitz@apple.com>
Fixed the build following AppKit API deprecations in a recent SDKs
* platform/mac/PasteboardMac.mm:
(WebCore::setDragImageImpl): Suppressed deprecation warnings.
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint): Ditto.
2018-01-05 Joseph Pecoraro <pecoraro@apple.com>
ServiceWorkers: Enable UserTiming / ResourceTiming
https://bugs.webkit.org/show_bug.cgi?id=181297
<rdar://problem/36307306>
Reviewed by Youenn Fablet.
Tests: http/tests/workers/service/service-worker-resource-timing.https.html
http/tests/workers/service/service-worker-user-timing.https.html
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
We used to clear extra NetworkLoadMetrics data early on. However,
for Workers we want to pass the complete NetworkLoadMetrics to
the Worker so that a Worker inspector has access to it.
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
Instead move the clearing of extra data to here, when the NetworkLoadMetrics
have finally settled into being used only for a performance entry.
2018-01-04 Philippe Normand <pnormand@igalia.com>
[EME][GStreamer] Fix wrong ifdef
https://bugs.webkit.org/show_bug.cgi?id=181289
Reviewed by Alex Christensen.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove the
ENCRYPTED_MEDIA ifdef from the VIDEO_TRACK ifdef block. Both have
nothing to do together.
2018-01-05 Fujii Hironori <Hironori.Fujii@sony.com>
[Cairo] Canvas: Path::clear should clear its transform
https://bugs.webkit.org/show_bug.cgi?id=181320
Reviewed by Carlos Garcia Campos.
Path of Cairo port has its cairo context. Path::clear() didn't
clear the transform matrix of the context.
Test: fast/canvas/reset-scaling-by-height-change.html
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::clear): Reset the transform matrix of Path.
2018-01-04 Devin Rousso <webkit@devinrousso.com>
Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
https://bugs.webkit.org/show_bug.cgi?id=180770
Reviewed by Joseph Pecoraro.
No change in functionality.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContext2d):
(WebCore::HTMLCanvasElement::createContextWebGL):
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::createContextBitmapRenderer):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::setImageBuffer const):
(WebCore::HTMLCanvasElement::addObserver): Deleted.
(WebCore::HTMLCanvasElement::removeObserver): Deleted.
(WebCore::HTMLCanvasElement::cssCanvasClients): Deleted.
(WebCore::HTMLCanvasElement::notifyObserversCanvasChanged): Deleted.
* html/OffscreenCanvas.h:
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext.cpp:
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::create):
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::create):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::create):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::create):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create):
Instead of adding didCreateCanvasRenderingContext calls at the construction sites of each
context, we can make the constructors private and force the usage of static `create` functions.
This way, we have access to the fully constructed object and have a guaranteed path for creation.
* html/CanvasBase.h:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::~CanvasBase):
(WebCore::CanvasBase::renderingContext const):
(WebCore::CanvasBase::addObserver):
(WebCore::CanvasBase::removeObserver):
(WebCore::CanvasBase::notifyObserversCanvasChanged):
(WebCore::CanvasBase::notifyObserversCanvasResized):
(WebCore::CanvasBase::notifyObserversCanvasDestroyed):
(WebCore::CanvasBase::cssCanvasClients const):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* css/CSSCanvasValue.h:
Move the CanvasObserver class to CanvasBase so that it can also be used for OffscreenCanvas.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
(WebCore::InspectorInstrumentation::didChangeCanvasMemory):
(WebCore::InspectorInstrumentation::recordCanvasAction):
(WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
(WebCore::InspectorInstrumentation::didEnableExtension):
(WebCore::InspectorInstrumentation::didCreateProgram):
(WebCore::InspectorInstrumentation::willDeleteProgram):
(WebCore::InspectorInstrumentation::isShaderProgramDisabled):
(WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
(WebCore::InspectorInstrumentation::didCreateCSSCanvas): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
(WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
(WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
(WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
(WebCore::InspectorInstrumentation::didEnableExtensionImpl):
(WebCore::InspectorInstrumentation::didCreateProgramImpl):
(WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): Deleted.
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::requestNode):
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
(WebCore::contextAsScriptValue):
(WebCore::InspectorCanvasAgent::resolveCanvasContext):
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
(WebCore::InspectorCanvasAgent::recordCanvasAction):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
(WebCore::InspectorCanvasAgent::didEnableExtension):
(WebCore::InspectorCanvasAgent::didCreateProgram):
(WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
(WebCore::InspectorCanvasAgent::clearCanvasData):
(WebCore::InspectorCanvasAgent::unbindCanvas):
(WebCore::InspectorCanvasAgent::findInspectorCanvas):
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::didCreateCSSCanvas): Deleted.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::create):
(WebCore::InspectorCanvas::InspectorCanvas):
(WebCore::InspectorCanvas::canvasElement):
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::getCanvasContentAsDataURL):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::~InspectorCanvas): Deleted.
* inspector/InspectorShaderProgram.h:
* inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::context const):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::record):
(WebCore::PageConsoleClient::recordEnd):
* dom/Document.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasElement):
(WebCore::Document::nameForCSSCanvasElement const):
We have no reason to save the CSS canvas name for each InspectorCanvas object, so instead we
can just query for the name based on the CanvasRenderingContext's HTMLCanvasElement (assuming
it is not an OffscreenCanvas) when we need it.
2018-01-04 Chris Fleizach <cfleizach@apple.com>
AX: Implement updated CSS3 Speech for 'speak' and 'speak-as' properties
https://bugs.webkit.org/show_bug.cgi?id=180361
Reviewed by Zalan Bujtas.
Change speak -> speakAs, and allow a combination of properties.
Tests: Updated accessibility/mac/css-speech-speak.html
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::speakAsProperty const):
(WebCore::AccessibilityObject::speakProperty const): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::speakAsProperty const):
(WebCore::AccessibilityRenderObject::speakProperty const): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilitySpeechHint]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::speakAsToCSSValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ESpeakAs const):
(WebCore::CSSPrimitiveValue::operator ESpeak const): Deleted.
* css/CSSProperties.json:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSpeakAs):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSpeakAs):
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::speakAs const):
(WebCore::RenderStyle::setSpeakAs):
(WebCore::RenderStyle::initialSpeakAs):
(WebCore::RenderStyle::speak const): Deleted.
(WebCore::RenderStyle::setSpeak): Deleted.
(WebCore::RenderStyle::initialSpeak): Deleted.
* rendering/style/RenderStyleConstants.h:
(WebCore::operator| ):
(WebCore::operator|= ):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
2018-01-04 Brian Burg <bburg@apple.com>
Web Inspector: Capture Element Screenshot looks fuzzy
https://bugs.webkit.org/show_bug.cgi?id=175734
<rdar://problem/33803377>
Reviewed by Joseph Pecoraro and Simon Fraser.
Screenshots taken by Web Inspector were being downscaled from the
internal size to the logical size, causing them to be blurry when
later upscaled to the internal size.
Replace ScaleBehavior { Scaled, Unscaled } with PreserveResolution { No, Yes }.
This is a lot less confusing to read both inside ImageBuffer and at its use sites.
Remove unused CoordinateSystem argument for ImageBuffer::toDataURL,
and replace it with PreserveResolution. Plumb PreserveResolution into toCFData
so that PreserveResolution::Yes will preserve the internal size of
the image buffer, just as it does in other methods that take PreserveResolution.
At the use site in InspectorPageAgent, always request PreserveResolution::Yes snapshots
when taking an element screenshot. For now, keep using downscaled (smaller)
snapshots when capturing canvas previews, as the previews are not full-size.
Test: inspector/page/hidpi-snapshot-size.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::makePresentationCopy):
(WebCore::HTMLCanvasElement::copiedImage const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createPattern):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::snapshotNode):
(WebCore::InspectorPageAgent::snapshotRect):
* page/TextIndicator.cpp:
(WebCore::takeSnapshot):
* platform/DragImage.cpp:
(WebCore::createDragImageFromSnapshot):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::toDataURL const):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createBitmapImageAfterScalingIfNeeded):
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::toDataURL const):
(WebCore::ImageBuffer::toData const):
(WebCore::ImageBuffer::toCFData const):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toDataURL const):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::toDataURL const):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):
2018-01-04 John Wilander <wilander@apple.com>
Storage Access API: Turn feature on by default in Settings.yaml
https://bugs.webkit.org/show_bug.cgi?id=181298
<rdar://problem/36302506>
Reviewed by Brent Fulgham.
No new tests. This is just a feature settings change.
* page/Settings.yaml:
2018-01-04 Zalan Bujtas <zalan@apple.com>
WebContent process crashes while loading https://www.classicspecs.com
https://bugs.webkit.org/show_bug.cgi?id=181290
<rdar://problem/36225906>
Reviewed by Simon Fraser.
Floats can overhang multiple blocks (they are called intruding floats).
Each block keeps track of such intruding floats. When an overhanging float box is destroyed,
we need to deregister it from all those blocks. We do it by walking up the ancestor block chain
and check if the parent (grandparent etc) block still contains this float. Once we find the topmost block,
we start deregistering it by traversing back on the descendant blocks.
Normally we do it in RenderElement::takeChildInternal right before the box is getting detached.
However in certain cases (like when the float's parent happens to be an anonymous wrapper)
by the time we get to ::takeChildInternal the subtree is already detached and we can't access all the
ancestors.
This patch ensure that the floating box is still attached during de-registration.
Test: fast/block/float/crash-when-intruding-float-has-anonymous-parent-and-detach.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2018-01-04 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mock screen capture source
https://bugs.webkit.org/show_bug.cgi?id=181291
<rdar://problem/36298164>
Reviewed by Dean Jackson.
Tests: http/tests/media/media-stream/get-display-media-prompt.html
GetDisplayMediaTest.BasicPrompt
GetDisplayMediaTest.Constraints
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices): Add static_assert to ensure MediaDevices::DisplayCaptureSurfaceType
and RealtimeMediaSourceSettings::DisplaySurfaceType values are equivalent.
(WebCore::MediaDevices::getSupportedConstraints): Remove bogus code.
* Modules/mediastream/MediaDevices.h: Add DisplayCaptureSurfaceType.
* Modules/mediastream/MediaDevices.idl: Ditto.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Add a FIXME.
* Modules/mediastream/MediaStreamTrack.h: Add displaySurface and logicalSurface.
* Modules/mediastream/MediaTrackSupportedConstraints.h: Remove displaySurface and logicalSurface.
* Modules/mediastream/MediaTrackSupportedConstraints.idl:
* SourcesCocoa.txt: Add DisplayCaptureManagerCocoa.cpp and DisplayCaptureSourceCocoa.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::encode const): Add.
(WebCore::CaptureDevice::decode):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): Include display capture "devices".
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Deal with display capture devices.
(WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::displaySurface const): Return a DisplaySurfaceType.
(WebCore::RealtimeMediaSourceSettings::setDisplaySurface): Take a DisplaySurfaceType.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::singleton):
(WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa):
(WebCore::DisplayCaptureManagerCocoa::captureDevices):
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
(WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID):
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: Added.
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::capabilities const):
(WebCore::DisplayCaptureSourceCocoa::settings const):
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::elapsedTime):
(WebCore::DisplayCaptureSourceCocoa::applyFrameRate):
(WebCore::DisplayCaptureSourceCocoa::emitFrame):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureDeviceManager): New.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::deviceMap): Add screen capture "devices".
(WebCore::MockRealtimeMediaSource::displayDevices): New.
* platform/mock/MockRealtimeMediaSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp: Clean up includes.
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Mock two screen devices.
(WebCore::MockRealtimeVideoSource::updateSettings): Deal with mock screens.
(WebCore::MockRealtimeVideoSource::initializeCapabilities): Ditto.
(WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
(WebCore::MockRealtimeVideoSource::generateFrame): Ditto.
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockCamera const):
(WebCore::MockRealtimeVideoSource::mockScreen const):
2018-01-04 Youenn Fablet <youenn@apple.com>
FetchResponse should set its internal response text encoding name
https://bugs.webkit.org/show_bug.cgi?id=181284
Reviewed by Alex Christensen.
Covered by rebased test.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create): Set response text encoding based on content type charset.
2018-01-04 John Wilander <wilander@apple.com>
Storage Access API: Remove JavaScript confirm() prompt from Document::requestStorageAccess()
https://bugs.webkit.org/show_bug.cgi?id=181276
<rdar://problem/36290463>
Reviewed by Alex Christensen.
No new tests. Existing test expectations updated.
* dom/Document.cpp:
(WebCore::Document::requestStorageAccess):
2018-01-04 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Issues with Ahem's ex / x-height
https://bugs.webkit.org/show_bug.cgi?id=180581
Reviewed by Michael Catanzaro.
Get the x-height value from the TT_OS2 table if available.
Fixes: fast/text/break-word-pre-wrap.html
imported/w3c/web-platform-tests/css/css-shapes-1/shape-outside/values/shape-outside-shape-arguments-000.html
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):
2018-01-04 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK build fix attempt after r226357
* platform/graphics/gstreamer/GStreamerUtilities.h: The
GST_BUFFER_DTS_OR_PTS macro was added in GStreamer 1.8 but old
versions of Debian might not have this release yet.
2018-01-04 Youenn Fablet <youenn@apple.com>
Implement Cache API partitioning based on ClientOrigin
https://bugs.webkit.org/show_bug.cgi?id=181240
Reviewed by Alex Christensen.
Covered by updated tests.
Previously, cache storage was partitioned according the origin of the client, represented as a String.
We now partition according both client and top origins, represented as a ClientOrigin
Minor refactoring to use more makePendingActivity.
Added support for IPC serialization of ClientOrigin.
Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
* Modules/cache/CacheStorageConnection.cpp:
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::retrieveCaches):
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::clearMemoryRepresentation):
(WebCore::CacheStorageConnection::doOpen):
(WebCore::CacheStorageConnection::doRetrieveCaches):
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::open):
(WebCore::DOMCacheStorage::remove):
* Modules/cache/DOMCacheStorage.h:
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
* Modules/cache/WorkerCacheStorageConnection.h:
* page/ClientOrigin.h:
(WebCore::ClientOrigin::isolatedCopy const):
(WebCore::ClientOrigin::encode const):
(WebCore::ClientOrigin::decode):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::debugString const): Deleted.
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::debugString const):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
2018-01-04 Youenn Fablet <youenn@apple.com>
Service Worker should expose redirect mode for navigation loads as manual
https://bugs.webkit.org/show_bug.cgi?id=181067
Reviewed by Alex Christensen.
Covered by rebased tests.
* loader/CrossOriginAccessControl.cpp: Removing ContentType header only if affecting CORS checks.
This allows extending header filtering in service worker to all modes, including Navigate.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent): Ideally, document loading code should set redirect to manual.
Since it is not the case yet and that would require changes to various places, manual is set before exposing the corresponding fetch event.
2018-01-04 Youenn Fablet <youenn@apple.com>
ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope should be a no-op if worker is being terminated
https://bugs.webkit.org/show_bug.cgi?id=181245
Reviewed by Alex Christensen.
Stop appending tasks to a terminating worker and returning false in that case.
This mirrors what is done for regular workers.
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-01-04 Youenn Fablet <youenn@apple.com>
Cancel pending script loads when service worker is being terminated
https://bugs.webkit.org/show_bug.cgi?id=181250
Reviewed by Alex Christensen.
Covered by service worker tests no longer crashing in ASAN builds.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::notifyFinished): Clearing loader when finished.
(WebCore::WorkerScriptLoader::cancel): Implementing cancel of a script loader by cancelling the underlying threadable loader.
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerContainer.cpp: Canceling loads of all pending jobs.
(WebCore::ServiceWorkerContainer::stop):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::cancelPendingLoad):
* workers/service/ServiceWorkerJob.h:
2018-01-04 Youenn Fablet <youenn@apple.com>
Implement https://fetch.spec.whatwg.org/#main-fetch default referrer policy setting
https://bugs.webkit.org/show_bug.cgi?id=181239
Reviewed by Alex Christensen.
Covered by updated and rebased test.
Setting the request referrer policy to the Document referrer policy if no one is set.
If Document has no referrer policy, use no-referrer-when-downgrade as per the spec.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateReferrerPolicy):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
* loader/cache/CachedResourceRequest.h:
2018-01-03 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Create attachment elements when dropping files on iOS
https://bugs.webkit.org/show_bug.cgi?id=181192
<rdar://problem/36280945>
Reviewed by Tim Horton.
Implements support for dropping data as attachment elements on iOS. See comments below for more detail.
Tests: WKAttachmentTests.InsertDroppedRichAndPlainTextFilesAsAttachments
WKAttachmentTests.InsertDroppedZipArchiveAsAttachment
WKAttachmentTests.InsertDroppedItemProvidersInOrder
* WebCore.xcodeproj/project.pbxproj:
* editing/WebContentReader.cpp:
(WebCore::WebContentReader::ensureFragment):
Add a new helper to create the WebContentReader's fragment, if it hasn't already been created.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readFilePaths):
Rename readFilenames to readFilePaths (which better reflects its parameters, which are file paths). Also, move
the implementation of readFilePaths to shared iOS/macOS code in WebContentReaderCocoa, and remove the stub
implementation on iOS.
There's a bit of code here that I kept macOS-only which deals with inserting file paths as plain text in
editable areas, but it's unclear to me why and if WebKit clients currently find this useful, so I left a FIXME
to investigate removing this altogether. Code for handling this plain text insertion of file paths on Mac was
introduced in r67403.
* editing/ios/WebContentReaderIOS.mm:
(WebCore::WebContentReader::readFilenames): Deleted.
* editing/mac/WebContentReaderMac.mm:
(WebCore::WebContentReader::readFilenames): Deleted.
* page/mac/DragControllerMac.mm:
(WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
Teach DragController to accept all types conforming to "public.item" and "public.content" on iOS, only when
attachment elements are enabled. This allows us to load content from item providers that we otherwise would not
have loaded, since we now have the ability to fall back to attachment element insertion if the type is not have
a default representation using standard web content.
* platform/Pasteboard.h:
* platform/PasteboardItemInfo.h: Added.
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
Add PasteboardItemInfo, a struct that describes an item on the pasteboard. Also, implement encoding and decoding
support for PasteboardItemInfo. So far, the item info only describes file information about the pasteboard item,
and flags indicating whether the item prefers attachment or inline presentation.
* platform/PasteboardStrategy.h:
Replace getFilenamesForDataInteraction with informationForItemAtIndex. Instead of returning all of the file
paths associated with any item on the pasteboard, fetch a PasteboardItemInfo at a given item index, which
includes information about the file path as well as some other metadata we'll need when deciding how to read
pasteboard contents as a document fragment.
* platform/PlatformPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::read):
* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
Teach the iOS Pasteboard to read web content using attachment elements, if enabled. There are two scenarios in
which we would want to insert an attachment element:
(1) The item provider uses a preferred presentation style of attachment, in which case we bail out of trying to
handle the drop using the default mechanisms, and simply insert it as an attachment. We need this to deal
with the case where we drop text or HTML files from the Files app, so that we don't try and insert the
contents of the text or HTML as inline web content.
(2) The item provider doesn't have a preferred attachment presentation style, but there's nothing WebKit would
otherwise do with the dropped content, so insert an attachment element as a fallback. Examples where this is
relevant are dropping a PDF or ZIP archive without attachment presentation style explicitly set.
We first check if we fall into case (1). If so, we can bail early by inserting an attachment; otherwise, we
proceed normally and see if we can read the contents of the drop as web content. If, at the end of default drop
handling, we don't still have a way to represent the dropped content, enter case (2).
(WebCore::Pasteboard::readFilePaths):
(WebCore::Pasteboard::readFilenames): Deleted.
Rename readFilenames to readFilePaths, and reimplement it using informationForItemAtIndex.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::pasteboardItemPresentationStyle):
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::PlatformPasteboard::filenamesForDataInteraction): Deleted.
Implement informationForItemAtIndex and remove filenamesForDataInteraction. As before, we ask the pasteboard
(i.e. WebItemProviderPasteboard) for information about dropped file URLs. This time, we limit this to a single
file, so we don't end up creating multiple attachment elements for each representation of a single item
provider. See below for -preferredFileUploadURLAtIndex:fileType: for more detail.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderLoadResult initWithItemProvider:typesToLoad:]):
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
Remove this synthesized instance variable and instead just check the item provider's preferredPresentationStyle.
(-[WebItemProviderLoadResult description]):
Add a verbose -description to the load result object. Useful for debugging what was content was loaded from an
item provider on drop.
(-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
Return the highest fidelity loaded type identifier for a given item.
(-[WebItemProviderPasteboard allDroppedFileURLs]):
(-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
Prefer flat RTFD to RTFD. In the case where attachments are enabled and we're accepting all types of content
using attachment elements as a fallback representation, if the source writes attributed strings to the
pasteboard with com.apple.rtfd at a higher fidelity than com.apple.flat-rtfd, we'll end up loading only
com.apple.rtfd and dropping the text as an attachment element because we cannot convert the dropped content to
markup. Instead, if flat RTFD is present in the item provider, always prefer that over RTFD so that dropping as
regular web content isn't overridden when attachment elements are enabled.
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
(-[WebItemProviderPasteboard droppedFileURLs]): Deleted.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsCompatibleContent const):
DragData::containsCompatibleContent should be true when attachment elements are enabled, and there are files we
can drop as attachment elements.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readFilePaths):
(WebCore::Pasteboard::readFilenames): Deleted.
2018-01-03 Ting-Wei Lan <lantw44@gmail.com>
Replace hard-coded paths in shebangs with #!/usr/bin/env
https://bugs.webkit.org/show_bug.cgi?id=181040
Reviewed by Alex Christensen.
* bindings/scripts/InFilesCompiler.pm:
* bindings/scripts/InFilesParser.pm:
* bindings/scripts/generate-bindings-all.pl:
* bindings/scripts/generate-bindings.pl:
* bindings/scripts/preprocess-idls.pl:
* css/make-css-file-arrays.pl:
* css/makeprop.pl:
* css/makevalues.pl:
* dom/make_event_factory.pl:
* dom/make_names.pl:
* extract-localizable-strings.pl:
* make-hash-tools.pl:
2018-01-03 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Add plumbing for starting a drag with promised blob data
https://bugs.webkit.org/show_bug.cgi?id=181201
Reviewed by Tim Horton.
Adds logic to allow dragging an attachment element as a file by sending promised blob information to the UI
process. See comments below for more detail.
The only change in behavior is that dragging an attachment element will no longer write web content and injected
bundle data to the pasteboard if the attachment element's file attribute is nonnull. This will cause one
existing WK1 layout test to fail, but will otherwise not affect any attachment editing clients. On iOS,
attachment elements in the Mail viewer can be dragged, but each attachment's file is null, so we fall back to
current behavior; on macOS, Mail currently overrides the drag completely, beginning at -mouseDown:, so this
doesn't make a difference to macOS Mail either.
* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getPasteboardTypesAndDataForAttachment):
Add a helper method to retrieve an attachment element as web archive data, for moving attachments within the
same document. Also gives the injected editor bundle a chance to supply custom pasteboard types.
* loader/EmptyClients.cpp:
* page/DragClient.h:
(WebCore::DragClient::prepareToDragPromisedBlob):
Add new DragClient methods to send information about a promised blob to the UI process.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Call dragAttachmentElement when starting a drag on an attachment element.
(WebCore::DragController::dragAttachmentElement):
Try to begin dragging a given attachment element, propagating promised blob information to the client layers.
Returns true iff the attachment is backed by blob data (i.e. the file is nonnull).
* platform/PromisedBlobInfo.h:
Add a list of additional types and data to PromisedBlobInfo. In addition to the promised blob info, this would
allow injected bundle data and other private types alongside the main attachment data on the pasteboard.
2018-01-03 Simon Fraser <simon.fraser@apple.com>
Remove the 'resolutionScale' parameter from ImageBufferDataCG get/putBytes
https://bugs.webkit.org/show_bug.cgi?id=181268
Reviewed by Alex Christensen.
These functions were always called with resolutionScale=1.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData const):
(WebCore::ImageBuffer::getPremultipliedImageData const):
(WebCore::ImageBuffer::putByteArray):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData const):
(WebCore::ImageBufferData::putData):
(WebCore::affineWarpBufferData): Deleted.
* platform/graphics/cg/ImageBufferDataCG.h:
2018-01-03 John Wilander <wilander@apple.com>
Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
https://bugs.webkit.org/show_bug.cgi?id=181270
<rdar://problem/36289544>
Reviewed by Alex Christensen.
No new tests. Existing test re-enabled.
This change refactors how the web process tells the network process
to remove storage access. Previously, this was done over the UI process
just like requests for storage access. But since no further reasoning
is needed, the message should go straight from the web process to the
network process for performance reasons and to minimize the risk of a
race.
As a consequence, the XPC code for storage access removal in the UI
process is deleted.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
Removes the storageAccessAPIEnabled check since the flag
doesn't get propagated when the network process is created.
Figuring this out will take some work which is unnecessary
when we already gate access to the feature in Document.idl.
2018-01-03 James Craig <jcraig@apple.com>
AX: when invert colors is on, double-invert certain media elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=168447
<rdar://problem/30559874>
Reviewed by Simon Fraser.
Double-invert video when platform 'invert colors' setting is enabled. Behavior matches
current 'Smart Invert' feature of Safari Reader on macOS/iOS and other iOS native apps.
Tests: accessibility/smart-invert-reference.html
accessibility/smart-invert.html
* Modules/modern-media-controls/controls/media-controls.css:
(@media (inverted-colors)):
(:host):
(picture):
* css/html.css:
(@media (inverted-colors)):
(video):
2018-01-03 Youenn Fablet <youenn@apple.com>
LayoutTest http/tests/media/media-stream/disconnected-frame.html to consistently fail an assertion: !m_adoptionIsRequired
https://bugs.webkit.org/show_bug.cgi?id=181264
Reviewed by Eric Carlson.
Covered by http/tests/media/media-stream/disconnected-frame.html not crashing anymore in Debug builds.
Calling suspendIfNeeded in create method instead of constructor.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::create):
(WebCore::UserMediaRequest::UserMediaRequest):
2018-01-03 Antti Koivisto <antti@apple.com>
Remove DeprecatedCSSOMValue::equals
https://bugs.webkit.org/show_bug.cgi?id=181241
Reviewed by Zalan Bujtas.
This is dead code.
* css/DeprecatedCSSOMValue.cpp:
(WebCore::compareCSSOMValues): Deleted.
(WebCore::DeprecatedCSSOMValue::equals const): Deleted.
* css/DeprecatedCSSOMValue.h:
(WebCore::DeprecatedCSSOMValue::operator== const): Deleted.
(WebCore::DeprecatedCSSOMComplexValue::equals const): Deleted.
* css/DeprecatedCSSOMValueList.cpp:
(WebCore::DeprecatedCSSOMValueList::equals const): Deleted.
* css/DeprecatedCSSOMValueList.h:
2018-01-03 Simon Fraser <simon.fraser@apple.com>
feLighting is broken with primitiveUnits="objectBoundingBox"
https://bugs.webkit.org/show_bug.cgi?id=181197
Reviewed by Tim Horton.
With <filter primitiveUnits="objectBoundingBox"> we need to convert the coordinates
of fePointLights and feSpotLights into user space coordinates. Following
https://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute
this is done by treating them as fractions of the bounding box on the referencing
element, with treatment for z following https://www.w3.org/TR/SVG/coords.html#Units_viewport_percentage
To do this, store the bounds of the referencing elemenet on SVGFilterBuilder as
targetBoundingBox, and store the primitiveUnits type. Then do the conversion of lighting
coordinates in SVGFESpecularLightingElement::build() and SVGFEDiffuseLightingElement::build().
Remove SVGFELightElement::findLightSource(), since we need to be able to pass the SVGFilterBuilder
to the lightSource() function so hoist the code up.
Tests: svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox-expected.svg
svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox.svg
svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDistantLightElement.cpp:
(WebCore::SVGFEDistantLightElement::lightSource const):
* svg/SVGFEDistantLightElement.h:
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::findLightSource): Deleted.
* svg/SVGFELightElement.h:
* svg/SVGFEPointLightElement.cpp:
(WebCore::SVGFEPointLightElement::lightSource const):
* svg/SVGFEPointLightElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFESpotLightElement.cpp:
(WebCore::SVGFESpotLightElement::lightSource const):
* svg/SVGFESpotLightElement.h:
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::setTargetBoundingBox):
(WebCore::SVGFilterBuilder::targetBoundingBox const):
(WebCore::SVGFilterBuilder::primitiveUnits const):
(WebCore::SVGFilterBuilder::setPrimitiveUnits):
2018-01-03 Antti Koivisto <antti@apple.com>
Crash beneath CSSValue::equals @ csas.cz
https://bugs.webkit.org/show_bug.cgi?id=181243
<rdar://problem/35990826>
Reviewed by Alex Christensen.
Test: fast/text/oblique-degree-equals-crash.html
* css/CSSFontStyleValue.cpp:
(WebCore::CSSFontStyleValue::equals const):
Null check both oblique pointers.
2018-01-03 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
https://bugs.webkit.org/show_bug.cgi?id=180979
<rdar://problem/36146670>
Reviewed by Matt Baker.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(fontNameIsSystemFont):
(WebCore::FontCache::systemFontFamilies):
Switch to the original Mac algorithm before r180979 that uses
CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
available on iOS but now it is. This is a performance improvement on
both platforms, but significantly so on macOS. It also finds more,
valid, family names.
2018-01-03 Michael Catanzaro <mcatanzaro@igalia.com>
ASSERTION FAILED: !source || is<Target>(*source) in CoordinatedGraphicsLayer::removeFromParent
https://bugs.webkit.org/show_bug.cgi?id=166568
Reviewed by Simon Fraser.
When a GraphicsLayer has a mask layer, it fails to properly unparent the mask layer before
it is destroyed. This leaves the mask layer with a dangling parent pointer. Fix it, while
taking care not to introduce yet another virtual function call during the execution of the
destructor.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::willBeDestroyed):
2018-01-03 Simon Fraser <simon.fraser@apple.com>
SVG lighting filter lights are in the wrong coordinate system
https://bugs.webkit.org/show_bug.cgi?id=181147
Reviewed by Zalan Bujtas.
Point and spot light coordinates weren't being converted into buffer-relative
coordinates before being fed into the lighting math, resulting in incorrect light
rendering on Retina devices, and when the filter primitive region was clipped.
Fix by storing absoluteUnclippedSubregion on FilterEffect, which allows us to map
lighting points from user space coordinates into the coordinates of the buffer being
used for rendering. Also scale the light z coordinate by doing a dummy point mapping in x.
Rename members of PointLightSource and SpotLightSource to make it clear which coordinate
system they are in.
Tests include HiDPI tests.
Tests: svg/filters/fePointLight-coordinates-expected.svg
svg/filters/fePointLight-coordinates.svg
svg/filters/feSpotLight-coordinates-expected.svg
svg/filters/feSpotLight-coordinates.svg
svg/filters/hidpi/fePointLight-coordinates-expected.svg
svg/filters/hidpi/fePointLight-coordinates.svg
svg/filters/hidpi/feSpotLight-coordinates-expected.svg
svg/filters/hidpi/feSpotLight-coordinates.svg
* platform/graphics/FloatPoint3D.h: Make it easy to get and set the X and Y coords as a FloatPoint.
(WebCore::FloatPoint3D::xy const):
(WebCore::FloatPoint3D::setXY):
* platform/graphics/GeometryUtilities.cpp:
(WebCore::mapPoint):
(WebCore::mapRect):
* platform/graphics/GeometryUtilities.h: Helper to make a point between rects.
* platform/graphics/filters/DistantLightSource.cpp:
(WebCore::DistantLightSource::initPaintingData):
* platform/graphics/filters/DistantLightSource.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::drawLighting):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::mapPointFromUserSpaceToBuffer const):
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::setUnclippedAbsoluteSubregion):
* platform/graphics/filters/LightSource.h:
* platform/graphics/filters/PointLightSource.cpp:
(WebCore::PointLightSource::initPaintingData):
(WebCore::PointLightSource::computePixelLightingData const):
(WebCore::PointLightSource::setX):
(WebCore::PointLightSource::setY):
(WebCore::PointLightSource::setZ):
* platform/graphics/filters/PointLightSource.h:
(WebCore::PointLightSource::position const):
(WebCore::PointLightSource::PointLightSource):
* platform/graphics/filters/SpotLightSource.cpp:
(WebCore::SpotLightSource::initPaintingData):
(WebCore::SpotLightSource::computePixelLightingData const):
(WebCore::SpotLightSource::setX):
(WebCore::SpotLightSource::setY):
(WebCore::SpotLightSource::setZ):
(WebCore::SpotLightSource::setPointsAtX):
(WebCore::SpotLightSource::setPointsAtY):
(WebCore::SpotLightSource::setPointsAtZ):
* platform/graphics/filters/SpotLightSource.h:
(WebCore::SpotLightSource::position const):
(WebCore::SpotLightSource::direction const):
(WebCore::SpotLightSource::SpotLightSource):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
(WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
2018-01-03 Youenn Fablet <youenn@apple.com>
Select service worker for documents with data/blob URLS
https://bugs.webkit.org/show_bug.cgi?id=181213
Reviewed by Alex Christensen.
Covered by updated test.
Reusing the service worker of the parent for blob/data URL documents.
* loader/DocumentLoader.cpp:
(WebCore::isLocalURL):
(WebCore::DocumentLoader::commitData):
2018-01-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r226352.
Breaks Sierra and El Capitan builds.
Reverted changeset:
"Web Inspector: Slow open time enumerating system fonts
(FontCache::systemFontFamilies)"
https://bugs.webkit.org/show_bug.cgi?id=180979
https://trac.webkit.org/changeset/226352
2018-01-03 Philippe Normand <pnormand@igalia.com>
[GStreamer] The bus synchronous handler should be in the base player class
https://bugs.webkit.org/show_bug.cgi?id=181237
Reviewed by Carlos Garcia Campos.
Because this is where video rendering is handled.
No new tests, this is only a refactoring.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
2018-01-03 Philippe Normand <pnormand@igalia.com>
[GStreamer] move MediaSample implementation out of mse/
https://bugs.webkit.org/show_bug.cgi?id=179165
Reviewed by Carlos Garcia Campos.
This module isn't specific to MSE and can potentially be reused
elsewhere, for WebRTC for instance. Additionally the
::platformSample() method was implemented and the code was cleaned up.
* platform/GStreamer.cmake:
* platform/MediaSample.h:
* platform/graphics/gstreamer/GStreamerMediaSample.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp.
(WebCore::GStreamerMediaSample::platformSample):
* platform/graphics/gstreamer/GStreamerMediaSample.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.h.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::enqueueSample):
2018-01-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix resource load stats tests on GLib based ports after r226355.
The monitor can be created in the work queue thread too.
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
2018-01-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash destroying WebCore::FileMonitor
https://bugs.webkit.org/show_bug.cgi?id=181138
Reviewed by Michael Catanzaro.
Ensure that platform file monitor is always created and destroyed in the work queue thread synchronously.
* platform/FileMonitor.h:
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
(WebCore::FileMonitor::~FileMonitor):
(WebCore::FileMonitor::didChange):
2018-01-02 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
https://bugs.webkit.org/show_bug.cgi?id=180979
<rdar://problem/36146670>
Reviewed by Matt Baker.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::systemFontFamilies):
Switch to the original Mac algorithm before r180979 that uses
CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
available on iOS but now it is. This is a performance improvement on
both platforms, but significantly so on macOS. It also finds more,
valid, family names.
2018-01-02 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, fix GCC warning by using #include
https://bugs.webkit.org/show_bug.cgi?id=181189
This file is included in C++ files. Use #include instead of #import to suppress warning in GCC.
* platform/PromisedBlobInfo.h:
2017-12-28 Yusuke Suzuki <utatane.tea@gmail.com>
Remove std::chrono completely
https://bugs.webkit.org/show_bug.cgi?id=181186
Reviewed by Alex Christensen.
Use MonotonicTime, WallTime, and Seconds instead.
Changes are mechanical ones. But persistent network cache data is changed.
So we bump the version number of the cache storage.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::removeAllDatabasesForOriginPath):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
* Modules/indexeddb/server/IDBServer.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
* Modules/webdatabase/DatabaseTracker.h:
* dom/Document.cpp:
(WebCore::Document::lastModified):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaCache):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::clearMediaCache):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::parseAccessControlMaxAge):
(WebCore::CrossOriginPreflightResultCacheItem::parse):
(WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
* loader/CrossOriginPreflightResultCache.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::freshnessLifetime const):
(WebCore::CachedResource::responseReceived):
(WebCore::CachedResource::updateResponseAfterRevalidation):
* loader/cache/CachedResource.h:
* platform/FileSystem.cpp:
(WebCore::FileSystem::getFileModificationTime):
* platform/FileSystem.h:
* platform/SearchPopupMenu.h:
* platform/cocoa/SearchPopupMenuCocoa.h:
* platform/cocoa/SearchPopupMenuCocoa.mm:
(WebCore::toSystemClockTime):
(WebCore::toNSDateFromSystemClock):
(WebCore::removeRecentlyModifiedRecentSearches):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::clearMediaCache):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::clearMediaCache):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::toSystemClockTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
* platform/network/CacheValidation.cpp:
(WebCore::computeCurrentAge):
(WebCore::computeFreshnessLifetimeForHTTPFamily):
(WebCore::updateRedirectChainStatus):
(WebCore::redirectChainAllowsReuse):
(WebCore::parseCacheControlDirectives):
* platform/network/CacheValidation.h:
(WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPDate):
* platform/network/HTTPParsers.h:
* platform/network/PlatformCookieJar.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::cacheControlMaxAge const):
(WebCore::parseDateValueInHeader):
(WebCore::ResourceResponseBase::date const):
(WebCore::ResourceResponseBase::age const):
(WebCore::ResourceResponseBase::expires const):
(WebCore::ResourceResponseBase::lastModified const):
* platform/network/ResourceResponseBase.h:
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::deleteAllCookiesModifiedSince):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
(WebCore::deleteAllCookiesModifiedSince):
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry):
(WebCore::CurlCacheEntry::isCached):
(WebCore::CurlCacheEntry::parseResponseHeaders):
* platform/network/curl/CurlCacheEntry.h:
* platform/network/mac/CookieJarMac.mm:
(WebCore::deleteAllCookiesModifiedSince):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::deleteAllCookiesModifiedSince):
* platform/win/SearchPopupMenuWin.cpp:
(WebCore::SearchPopupMenuWin::loadRecentSearches):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult):
2018-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Introduce data structures and IPC support for writing promised blobs
https://bugs.webkit.org/show_bug.cgi?id=181189
Reviewed by Tim Horton.
Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
file on disk).
No new tests, since there is no observable change in functionality yet.
* WebCore.xcodeproj/project.pbxproj:
* platform/PromisedBlobInfo.h: Added.
(WebCore::PromisedBlobInfo::operator bool const):
(WebCore::PromisedBlobData::hasData const):
(WebCore::PromisedBlobData::hasFile const):
(WebCore::PromisedBlobData::operator bool const):
(WebCore::PromisedBlobData::fulfills const):
2018-01-02 Brady Eidson <beidson@apple.com>
Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
https://bugs.webkit.org/show_bug.cgi?id=181205
Reviewed by Alex Christensen.
No new tests (No behavior change)
This is needed for the ongoing WK2 MessagePort work.
For WK1 in-process MessagePorts it is still synchronous; no behavior change.
* dom/InProcessMessagePortChannel.cpp:
(WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
* dom/InProcessMessagePortChannel.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
* dom/MessagePortChannel.h:
2018-01-02 Jiewen Tan <jiewen_tan@apple.com>
Add a WebAuthentication runtime feature flag
https://bugs.webkit.org/show_bug.cgi?id=181220
<rdar://problem/36055305>
Reviewed by Brent Fulgham.
This patch basically renames the CredentialManagement runtime feature flag into
WebAuthentication runtime feature flag.
No tests.
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/PublicKeyCredential.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
(WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
(WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
2018-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
https://bugs.webkit.org/show_bug.cgi?id=181143
<rdar://problem/36200381>
Reviewed by Tim Horton.
Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
replacement as well.
Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldConvertToBlob):
(WebCore::replaceRichContentWithAttachments):
2018-01-02 Brady Eidson <beidson@apple.com>
Identify MessagePorts by a globally unique MessagePortIdentifier.
https://bugs.webkit.org/show_bug.cgi?id=181172
Reviewed by Alex Christensen.
No new tests (Behavior change covered by all existing tests).
This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
instead of actual MessagePort objects.
The identifiers are compounded with the current ProcessIdentifier meaning they are global
across all processes for the running UI process, enabling easy cross-process communication.
(Actual cross-process communication comes in a followup)
* WebCore.xcodeproj/project.pbxproj:
* dom/InProcessMessagePortChannel.cpp:
(WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
(WebCore::InProcessMessagePortChannel::isConnectedTo):
(WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
(WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
* dom/InProcessMessagePortChannel.h:
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
(WebCore::m_port2):
* dom/MessagePort.cpp:
(WebCore::allMessagePortsLock):
(WebCore::MessagePort::ref const):
(WebCore::MessagePort::deref const):
(WebCore::MessagePort::existingMessagePortForIdentifier):
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::entangleWithRemote):
(WebCore::MessagePort::entanglePorts):
(WebCore::MessagePort::entangle): Deleted.
* dom/MessagePort.h:
* dom/MessagePortChannel.h:
* dom/MessagePortIdentifier.h: Added.
(WebCore::operator==):
(WebCore::MessagePortIdentifier::encode const):
(WebCore::MessagePortIdentifier::decode):
(WebCore::MessagePortIdentifier::hash const):
(WTF::MessagePortIdentifierHash::hash):
(WTF::MessagePortIdentifierHash::equal):
(WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
(WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
(WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
2018-01-02 Youenn Fablet <youenn@apple.com>
Memory cache should not reuse resources with different credential fetch option
https://bugs.webkit.org/show_bug.cgi?id=181212
Reviewed by Alex Christensen.
Covered by rebased test.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
2018-01-02 Jiewen Tan <jiewen_tan@apple.com>
Update Credential Management API for WebAuthentication
https://bugs.webkit.org/show_bug.cgi?id=181082
<rdar://problem/36055239>
Reviewed by Brent Fulgham.
Part 2/2
This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
cannot be instantiated.
Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
http/wpt/credential-management/credentialscontainer-get-basics.https.html
http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
http/wpt/credential-management/idl.https.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentialmanagement/BasicCredential.cpp:
(WebCore::BasicCredential::BasicCredential):
(WebCore::BasicCredential::type const):
* Modules/credentialmanagement/BasicCredential.h:
(WebCore::BasicCredential::discovery const):
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::CredentialsContainer):
(WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
(WebCore::CredentialsContainer::dispatchTask):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::store):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess):
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::create):
(WebCore::CredentialsContainer::CredentialsContainer): Deleted.
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
(WebCore::NavigatorCredentials::credentials):
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
(WebCore::PublicKeyCredential::PublicKeyCredential):
(WebCore::PublicKeyCredential::collectFromCredentialStore):
(WebCore::PublicKeyCredential::discoverFromExternalSource):
(WebCore::PublicKeyCredential::store):
(WebCore::PublicKeyCredential::create):
* Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
* Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
2018-01-02 Oleksandr Skachkov <gskachkov@gmail.com>
WebAssembly: sending module to iframe fails
https://bugs.webkit.org/show_bug.cgi?id=179263
Reviewed by JF Bastien.
Allow use WebAssembly.Module as input parameters for postMessage
in window and iframe object. To prevent sending message to iframe
that is not ready, in iframe-* test we are waiting message from
iframe only after that we send message to it.
Tests: wasm/iframe-parent-postmessage.html
wasm/iframe-postmessage.html
wasm/window-postmessage.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
* bindings/js/SerializedScriptValue.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
== Rolled over to ChangeLog-2018-01-01 ==