2018-06-26 Miguel Gomez [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-05-08 Jer Noble 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-06 Dean Jackson WebGL: Reset simulated values after validation fails https://bugs.webkit.org/show_bug.cgi?id=185363 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-02 Brent Fulgham Widgets should hold a WeakPtr to their parents https://bugs.webkit.org/show_bug.cgi?id=185239 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-06-04 Brent Fulgham REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement https://bugs.webkit.org/show_bug.cgi?id=186096 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-05-02 Brent Fulgham Use RetainPtr for form input type https://bugs.webkit.org/show_bug.cgi?id=185210 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 Brent Fulgham Prevent Debug ASSERT when changing forms https://bugs.webkit.org/show_bug.cgi?id=185173 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-06-22 Michael Catanzaro 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-03-28 Daniel Bates WebSocket cookie incorrectly stored https://bugs.webkit.org/show_bug.cgi?id=184100 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-27 Daniel Bates Attempt to fix media control layout tests after (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 Daniel Bates CSS mask images should be retrieved using potentially CORS-enabled fetch https://bugs.webkit.org/show_bug.cgi?id=179983 Reviewed by Brent Fulgham. As per (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 * 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-21 Said Abou-Hallawa Disconnect the SVGPathSegList items from their SVGPathElement before rebuilding a new list https://bugs.webkit.org/show_bug.cgi?id=183723 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-05-22 Carlos Garcia Campos [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-06-07 Brent Fulgham Handle Storage Access API calls in the absence of an attached frame https://bugs.webkit.org/show_bug.cgi?id=186373 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-09 Zalan Bujtas REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page https://bugs.webkit.org/show_bug.cgi?id=186464 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-10 Michael Catanzaro [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-08 Miguel Gomez [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-05-15 Carlos Alberto Lopez Perez [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 Thomas Klausner 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-10 Michael Catanzaro Unreviewed, silence a couple more build warnings on the stable branch * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage): 2018-05-09 Michael Catanzaro [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-04-25 Michael Catanzaro [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-05-04 Carlos Garcia Campos [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 Miguel Gomez 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-04-30 Myles C. Maxfield Improve the performance of FontCascadeDescription's effectiveFamilies https://bugs.webkit.org/show_bug.cgi?id=184720 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 Michael Catanzaro [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-24 Tadeu Zagallo REGRESSION(r221839): Fix requests with FormData containing empty files https://bugs.webkit.org/show_bug.cgi?id=184490 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 Zan Dobersek [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-23 Antti Koivisto 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 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-20 Carlos Garcia Campos 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 [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-03-09 Zalan Bujtas Turn off offset*/scroll* optimization for input elements with shadow content https://bugs.webkit.org/show_bug.cgi?id=182383 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-04-17 Michael Catanzaro [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-13 Miguel Gomez 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 [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-08 Yusuke Suzuki 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-17 Carlos Alberto Lopez Perez [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-11 Michael Catanzaro [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-10 Wenson Hsieh FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it https://bugs.webkit.org/show_bug.cgi?id=183395 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 Zalan Bujtas 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-09 Michael Catanzaro 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-09 Michael Catanzaro [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-05 Zalan Bujtas Folding anonymous blocks should not result in deleting content. https://bugs.webkit.org/show_bug.cgi?id=184339 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-03 Chris Dumez 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 [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 [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-03-27 Fujii Hironori [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-22 Zalan Bujtas [Simple line layout] Text with letter spacing is not positioned properly. https://bugs.webkit.org/show_bug.cgi?id=183079 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-22 Adrian Perez de Castro [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 Carlos Alberto Lopez Perez [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-09 Nan Wang AX: AOM: More accessibility events support https://bugs.webkit.org/show_bug.cgi?id=183023 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-12 Danyao Wang 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-07 Zalan Bujtas Invalid innerTextRenderer in RenderTextControlSingleLine::styleDidChange() https://bugs.webkit.org/show_bug.cgi?id=183385 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 Sihui Liu replaceState cause back/forward malfunction on html page with tag https://bugs.webkit.org/show_bug.cgi?id=182678 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-06 Myles C. Maxfield 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-05 Antti Koivisto Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors https://bugs.webkit.org/show_bug.cgi?id=183325 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-03 Said Abou-Hallawa 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 [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=183273 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-12 Michael Catanzaro [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-01 Carlos Garcia Campos 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 [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 Zalan Bujtas Remove RenderElement::s_noLongerAffectsParentBlock https://bugs.webkit.org/show_bug.cgi?id=183196 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 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 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 Carlos Garcia Campos [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 Chris Dumez html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates https://bugs.webkit.org/show_bug.cgi?id=183168 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 Zalan Bujtas Remove RenderElement::s_affectsParentBlock https://bugs.webkit.org/show_bug.cgi?id=183187 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 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 Daniel Bates 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 Milan Crha 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 Mark Lam Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments. https://bugs.webkit.org/show_bug.cgi?id=183159 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 Youenn Fablet 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 Charlie Turner 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 Commit Queue 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-24 Fujii Hironori 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-23 Chris Dumez Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&) https://bugs.webkit.org/show_bug.cgi?id=183066 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 Zalan Bujtas [RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED https://bugs.webkit.org/show_bug.cgi?id=183084 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 [RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183027 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 [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach() https://bugs.webkit.org/show_bug.cgi?id=183073 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-23 Philippe Normand [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 [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 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 Zalan Bujtas [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy() https://bugs.webkit.org/show_bug.cgi?id=183061 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 ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition https://bugs.webkit.org/show_bug.cgi?id=183059 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 Document.open() cancels existing provisional load but not navigation policy check https://bugs.webkit.org/show_bug.cgi?id=183012 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 Miguel Gomez 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-21 Zalan Bujtas [RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183022 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-16 Daniel Bates Remove UTF-32 BOM parsing code https://bugs.webkit.org/show_bug.cgi?id=182900 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-09 Dean Jackson ImageBitmapRenderingContext should be Runtime guarded https://bugs.webkit.org/show_bug.cgi?id=182665 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-21 Zalan Bujtas [RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore. https://bugs.webkit.org/show_bug.cgi?id=183019 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 Zalan Bujtas [RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=183014 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 Philippe Normand [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-21 Zalan Bujtas [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 [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 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::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 [RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182946 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 [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 Zalan Bujtas [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182947 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 [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182943 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 Chris Dumez Crash under JSC::JSCell::toNumber(JSC::ExecState*) https://bugs.webkit.org/show_bug.cgi?id=182984 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::convert): * testing/TypeConversions.h: (WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const): (WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const): (WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const): * testing/TypeConversions.idl: 2018-02-19 Dean Jackson Handle all writing-modes in downcast https://bugs.webkit.org/show_bug.cgi?id=182949 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 Miguel Gomez [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-19 Antti Koivisto Use selector filter when invalidating descendants https://bugs.webkit.org/show_bug.cgi?id=182839 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 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 Chris Dumez Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType() https://bugs.webkit.org/show_bug.cgi?id=182927 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 SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm const + 45 https://bugs.webkit.org/show_bug.cgi?id=182944 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 REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ https://bugs.webkit.org/show_bug.cgi?id=182910 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 Zalan Bujtas [RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy() https://bugs.webkit.org/show_bug.cgi?id=182934 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 Zalan Bujtas [RenderTreeBuilder] Remove redundant RenderObject::removeFromParentAndDestroy https://bugs.webkit.org/show_bug.cgi?id=182926 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 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::removeAndDestroyChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182915 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-19 Manuel Rego Casasnovas [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 [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 [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 Fujii Hironori REGRESSION(r219298): RELEASE_ASSERT(!m_owningPointerForClose) fails in WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose https://bugs.webkit.org/show_bug.cgi?id=174354 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 Zalan Bujtas [RenderTreeBuilder] REGRESSION(r228238) Detach renderer before destroying its subtree. https://bugs.webkit.org/show_bug.cgi?id=182908 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 [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-16 Zalan Bujtas [RenderTreeBuilder] Cleanup RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182899 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 Zalan Bujtas [RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182896 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 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182885 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 Antti Koivisto Assert in mixed blend animation https://bugs.webkit.org/show_bug.cgi?id=182887 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 [RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182876 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 Chris Dumez Crash under WebCore::EventTarget::fireEventListeners https://bugs.webkit.org/show_bug.cgi?id=182880 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 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182878 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 Fujii Hironori 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 [RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182862 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 Zan Dobersek 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 [RenderTreeBuilder] parent.Render*::addChild() cleanup https://bugs.webkit.org/show_bug.cgi?id=182842 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 Zalan Bujtas [RenderTreeBuilder] Move RenderMenuList::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182840 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 Zalan Bujtas [RenderTreeBuilder] Move RenderTableRow::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182838 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 Zalan Bujtas [RenderTreeBuilder] Move RenderTableSection::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182835 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 [RenderTreeBuilder] Move RenderTable::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182832 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-15 Zan Dobersek 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 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 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 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 Zalan Bujtas [RenderTreeBuilder] Move RenderInline/RenderGrid::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182819 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 Zan Dobersek 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 [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 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 [RenderTreeBuilder] Move RenderMathMLFenced::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182817 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 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 Zalan Bujtas [RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182811 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 Don Olmstead 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-14 Dean Jackson CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot + 618 https://bugs.webkit.org/show_bug.cgi?id=182798 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 Brent Fulgham 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 [RenderTreeBuilder] Remove redundant RenderTreeBuilder methods https://bugs.webkit.org/show_bug.cgi?id=182770 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 [RenderTreeBuilder] Move RenderElement::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182762 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 Zalan Bujtas [RenderTreeBuilder] Move RenderBlock::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182746 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 Antti Koivisto Crash when breakpoint hit in unload handler https://bugs.webkit.org/show_bug.cgi?id=169855 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 [RenderTreeBuilder] Move RenderBlockFlow::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182739 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 Zalan Bujtas [RenderTreeBuilder] Move RenderSVG*::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182736 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 [RenderTreeBuilder] Move RenderGrid::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182734 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 AX: Remove AccessibleNode class https://bugs.webkit.org/show_bug.cgi?id=182724 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 [RenderTreeBuilder] Move RenderButton::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182732 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 [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-18 Yoshiaki Jitsukawa 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-12 Chris Fleizach AX: defer focusedUIElement notifications https://bugs.webkit.org/show_bug.cgi?id=182643 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 Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources https://bugs.webkit.org/show_bug.cgi?id=182664 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 [RenderTreeBuilder] Move RenderMenuList::takeChild() to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182715 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 Zalan Bujtas [RenderTreeBuilder] Introduce RenderTreebuilder::takeChild https://bugs.webkit.org/show_bug.cgi?id=182707 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 [RenderTreeBuilder] Move RenderBlock::dropAnonymousBoxChild to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182704 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 Zalan Bujtas [RenderTreeBuilder] Remove redundant RenderTreeBuilder instance https://bugs.webkit.org/show_bug.cgi?id=182700 Reviewed by Antti Koivisto. * rendering/RenderView.cpp: (WebCore::RenderView::willBeDestroyed): 2018-02-11 Gustavo Noronha Silva [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 Zalan Bujtas [RenderTreeBuilder] Move RenderBlock::takeChild mutation to a RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182662 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-09 Zalan Bujtas [RenderTreeBuilder] Move RenderRubyRun::takeChild mutation to a RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182655 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 Zalan Bujtas [RenderTreeBuilder] Move RenderRubyAsInline/AsBlock::takeChild mutation to a RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182651 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 Zalan Bujtas [RenderTreeBuilder] Introduce RenderTreeBuilder to willBeDestoryed/removeFromParentAndDestroy https://bugs.webkit.org/show_bug.cgi?id=182635 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 Zalan Bujtas [RenderTreeBuilder] Move multicolumn descendant/sibling removal logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182628 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-08 Philippe Normand [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 [RenderTreeBuilder] Move multicolumn spanner mutation logic to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182627 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 [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 [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 [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-13 Antti Koivisto REGRESSION(r228313): Membuster | macOS | All Devices | 1.5 MB https://bugs.webkit.org/show_bug.cgi?id=182744 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-09 Antti Koivisto 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 [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): (WebCore::convertDictionaryToJS): * bindings/scripts/test/TestObj.idl: 2018-02-13 Chris Dumez REGRESSION (r228299): Broke reader mode in Safari https://bugs.webkit.org/show_bug.cgi?id=182697 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-08 Chris Dumez Form submission after navigation fails when decidePolicyForNavigationAction is async https://bugs.webkit.org/show_bug.cgi?id=182412 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 [RenderTreeBuilder] Do not use RenderTreeBuilder::current() in RenderRubyRun::takeChild https://bugs.webkit.org/show_bug.cgi?id=182607 Reviewed by Sam Weinig. No change in functionality. * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::takeChild): 2018-02-08 Antti Koivisto 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 [RenderTreeBuilder] Introduce RenderTreeBuilder to moveChild(ren)To() functions https://bugs.webkit.org/show_bug.cgi?id=182596 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 Philippe Normand [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 AX: Defer attribute computation until needed. https://bugs.webkit.org/show_bug.cgi?id=182386 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 Zalan Bujtas [RenderTreeBuilder] Move RenderElement::removeAnonymousWrappersForInlinesIfNecessary to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182582 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 [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 [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-07 Andy Estes 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 Ryosuke Niwa 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 Youenn Fablet ASSERTION FAILED: m_timeOrigin in Performance::Performance() https://bugs.webkit.org/show_bug.cgi?id=182558 Reviewed by Chris Dumez. Test: http/wpt/fetch/cors-preflight-star.any.serviceworker.html * loader/CrossOriginPreflightChecker.cpp: (WebCore::CrossOriginPreflightChecker::startPreflight): 2018-02-07 Zalan Bujtas [RenderTreeBuilder] Remove RenderElement::destroyLeftoverChildren. https://bugs.webkit.org/show_bug.cgi?id=182518 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 Zalan Bujtas [RenderTreeBuilder] Move RenderBlock::removeLeftoverAnonymousBlock to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182510 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 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 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-07 Ross Kirsling 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-06 Youenn Fablet 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 Andy Estes [WebIDL] Support optional Promise arguments https://bugs.webkit.org/show_bug.cgi?id=182399 Reviewed by Sam Weinig and Chris Dumez. Previously, declaring a Promise argument as optional would result in a native type of std::optional>. 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-05 Ryosuke Niwa Release assertion in inlineVideoFrame https://bugs.webkit.org/show_bug.cgi?id=182513 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 Filip Pizlo 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 Don Olmstead 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 Antti Koivisto 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 Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit https://bugs.webkit.org/show_bug.cgi?id=181601 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 Chris Dumez 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 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 Crash on sfgate.com because mismatching link preload types https://bugs.webkit.org/show_bug.cgi?id=182483 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 [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 Zan Dobersek 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 [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 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 [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 [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 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 Tweak availability macros for CAN_DISALLOW_USER_INSTALLED_FONTS Rubber-stamped by Maciej Stachowiak. * platform/graphics/cocoa/FontCacheCoreText.cpp: 2018-02-02 Daniel Bates 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 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 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 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 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 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. * workers/service/server/SWServer.cpp: (WebCore::SWServer::clear): ensure completion handler is called on early exit case. 2018-02-02 Youenn Fablet 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 Clearing a registration should null out its workers before setting their state to "redundant" https://bugs.webkit.org/show_bug.cgi?id=182418 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 [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 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 When SW install fails, null out registration.installing before setting worker state to "redundant" https://bugs.webkit.org/show_bug.cgi?id=182416 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 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 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 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 [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 Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>() https://bugs.webkit.org/show_bug.cgi?id=182392 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): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::convertDictionary): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): (WebCore::convertDictionary): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::convertDictionary): * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: (WebCore::convertDictionary): 2018-02-01 Ryosuke Niwa Some test cases in accessibility/mac/selection-notification-focus-change.html fail https://bugs.webkit.org/show_bug.cgi?id=182212 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 [RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby https://bugs.webkit.org/show_bug.cgi?id=182306 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 [RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild() https://bugs.webkit.org/show_bug.cgi?id=182373 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 REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body https://bugs.webkit.org/show_bug.cgi?id=182394 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 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 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 [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 [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 [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 [RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=182374 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 Queue a microtask when a waitUntil() promise is settled https://bugs.webkit.org/show_bug.cgi?id=182372 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 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 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 [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 Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing https://bugs.webkit.org/show_bug.cgi?id=181204 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 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 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 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 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 [RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder. https://bugs.webkit.org/show_bug.cgi?id=182348 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 Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk https://bugs.webkit.org/show_bug.cgi?id=182319 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 com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration https://bugs.webkit.org/show_bug.cgi?id=182316 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 [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